Changeset 320
- Timestamp:
- Mar 21, 2008 10:20:11 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/list_template.cli.php
r316 r320 182 182 183 183 echo isset($op) ? '' : <<<E_O_F 184 <td class="sc-nowrap" align="right"><a title="<\x3fphp printf(_("Delete %s"), oTxt(\$list[\$i]['__///__'])) \x3f>" href="<\x3fphp echo \$app->oHREF(\$_SERVER['PHP_SELF'] . "?op=del&$primary_key=" . \$list[\$i]['$primary_key']); \x3f>" onclick "javascript:return confirm('<\x3fphp printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt(\$list[\$i]['__///__'])) \x3f>');"><img src="/admin/i/trash.gif" alt="Delete" width="10" height="10" border="0" /></a> </td>184 <td class="sc-nowrap" align="right"><a title="<\x3fphp printf(_("Delete %s"), oTxt(\$list[\$i]['__///__'])) \x3f>" href="<\x3fphp echo \$app->oHREF(\$_SERVER['PHP_SELF'] . "?op=del&$primary_key=" . \$list[\$i]['$primary_key']); \x3f>" onclick="javascript:return confirm('<\x3fphp printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt(\$list[\$i]['__///__'])) \x3f>');"><img src="/admin/i/trash.gif" alt="Delete" width="10" height="10" border="0" /></a> </td> 185 185 </tr> 186 186 <\x3fphp } \x3f> -
trunk/bin/module_maker/skel/adm_list.ihtml
r316 r320 29 29 <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF('/admin/versions.php?record_table=%DB_TBL%&record_key=%PRIMARY_KEY%&boomerang=true&record_val=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/i/multiple.png" alt="" width="12" height="12" border="0" /></a> </td> 30 30 %ADM_LIST_ROWS% 31 <td class="sc-padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . "?op=del&%PRIMARY_KEY%=" . $list[$i]['%PRIMARY_KEY%']); ?>" onclick "javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['__///__'])) ?>');"><img src="/admin/i/trash.gif" alt="Delete" width="10" height="10" border="0" /></a> </td>31 <td class="sc-padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . "?op=del&%PRIMARY_KEY%=" . $list[$i]['%PRIMARY_KEY%']); ?>" onclick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['__///__'])) ?>');"><img src="/admin/i/trash.gif" alt="Delete" width="10" height="10" border="0" /></a> </td> 32 32 </tr> 33 33 <?php } ?> -
trunk/css/admin2.inc.css
r297 r320 126 126 127 127 #leftnav a.addlink { 128 margin-left: 0. 5em;128 margin-left: 0.25em; 129 129 font-weight: normal; 130 130 } … … 288 288 289 289 .sc-form-row { 290 margin: . 35em 0;290 margin: .5em 0; 291 291 } 292 292 .sc-form-row:after { content: " "; display: block; visibility: hidden; clear: both; height: 0.1px; font-size: 0.1em; line-height: 0; } /* clear floats - Ydnar Hack */ … … 329 329 .sc-form-row label { 330 330 font-size: 70%; 331 padding-top: 0. 5em;331 padding-top: 0.25em; 332 332 } 333 333 … … 352 352 input[type="button"] { 353 353 margin-right: 5px; 354 padding: 0.4em 0.6em; 354 355 border: 1px solid #ccc; 356 background-color: #eee; 355 357 } 356 358 357 359 .sc-submit-buttons { 358 margin -top: 20px;360 margin: 20px 0 20px 130px; 359 361 } 360 362 .sc-form-row .sc-help { -
trunk/lib/ImageThumb.inc.php
r315 r320 638 638 * 639 639 * @access public 640 * @param string $file_name The file name to delete, with extension. 640 * @param string $file_name The file name to delete, with extension. 641 * @param bool $use_glob Set true to use glob to find the filename (using $file_name as a pattern) 641 642 * @return bool true on success, false on failure. 642 643 */ 643 function deleteThumbs($file_name )644 function deleteThumbs($file_name, $use_glob=false) 644 645 { 645 646 $app =& App::getInstance(); … … 653 654 $return_val = 0; 654 655 foreach ($this->_image_specs as $spec) { 655 if ('/' == $spec['dest_dir']{0}) { 656 // Absolute path. 657 $dest_file = realpath(sprintf('%s/%s.%s', $spec['dest_dir'], mb_substr($file_name, 0, mb_strrpos($file_name, '.')), $spec['dest_file_extension'])); 656 // Get base directory depending on if the spec's dest_dir is an absolute path or not. 657 $dest_dir = '/' == $spec['dest_dir']{0} ? $spec['dest_dir'] : sprintf('%s/%s', $this->getParam('source_dir'), $spec['dest_dir']); 658 if ($use_glob) { 659 $dest_file = realpath(sprintf('%s/%s', $dest_dir, $this->_glob($file_name, $dest_dir))); 658 660 } else { 659 // Relative path.660 $dest_file = realpath(sprintf('%s/%s/%s.%s', $this->getParam('source_dir'), $spec['dest_dir'], mb_substr($file_name, 0, mb_strrpos($file_name, '.')), $spec['dest_file_extension']));661 }661 $dest_file = realpath(sprintf('%s/%s.%s', $dest_dir, mb_substr($file_name, 0, mb_strrpos($file_name, '.')), $spec['dest_file_extension'])); 662 } 663 662 664 if (file_exists($dest_file)) { 663 665 if (!unlink($dest_file)) { … … 667 669 } 668 670 } 669 $app->logMsg(sprintf('Thumbnails deleted for file: %s', $ file_name), LOG_INFO, __FILE__, __LINE__);671 $app->logMsg(sprintf('Thumbnails deleted for file: %s', $dest_file), LOG_DEBUG, __FILE__, __LINE__); 670 672 return 0 === $return_val; 671 673 } … … 766 768 $dest_dir = dirname($filename); 767 769 } else { 768 if ('/' == $spec['dest_dir']{0}) { 769 // Absolute path. 770 $dest_dir = $spec['dest_dir']; 771 } else { 772 // Relative path. 773 $dest_dir = sprintf('%s/%s', $this->getParam('source_dir'), $spec['dest_dir']); 774 } 770 // Get base directory depending on if the spec's dest_dir is an absolute path or not. 771 $dest_dir = '/' == $spec['dest_dir']{0} ? $spec['dest_dir'] : sprintf('%s/%s', $this->getParam('source_dir'), $spec['dest_dir']); 775 772 } 776 773 if (!file_exists($dest_dir)) { … … 835 832 } 836 833 } 834 835 /** 836 * Get filename by glob pattern. Searches a directory for an image that matches the 837 * specified glob pattern and returns the filename of the first file found. 838 * 839 * @access public 840 * @param string $pattern Pattern to match filename. 841 * @param string $directory Pattern to match containing directory. 842 * @return string filename on success, empty string on failure. 843 * @author Quinn Comendant <quinn@strangecode.com> 844 * @since 15 Nov 2005 20:55:22 845 */ 846 function _glob($pattern, $directory) 847 { 848 $file_list = glob(sprintf('%s/%s', $directory, $pattern)); 849 if (isset($file_list[0])) { 850 return basename($file_list[0]); 851 } else { 852 return ''; 853 } 854 } 837 855 838 856 } // End of class. -
trunk/lib/Utilities.inc.php
r294 r320 108 108 /** 109 109 * Returns text with stylistic modifications. Warning: this will break some HTML attibutes! 110 * TODO: Allow a string such as this to be pass ted: <a href="javascript:openPopup('/foo/bar.php')">Click here</a>110 * TODO: Allow a string such as this to be passed: <a href="javascript:openPopup('/foo/bar.php')">Click here</a> 111 111 * 112 112 * @param string $text Text to clean. -
trunk/services/templates/admin_list.ihtml
r316 r320 50 50 <td class="sc-nowrap"><?php echo oTxt($list[$i]['added_admin_username'], true); ?> </td> 51 51 <td class="sc-nowrap"><?php echo '0000-00-00 00:00:00' == $list[$i]['modified_datetime'] ? '' : date($app->getParam('date_format'), strtotime($list[$i]['modified_datetime'])); ?> </td> 52 <td class="sc-padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . "?op=del&admin_id=" . $list[$i]['admin_id']); ?>" onclick "javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['username'])) ?>')"><img src="/admin/i/trash.gif" alt="Delete" width="10" height="10" border="0" /></a> </td>52 <td class="sc-padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . "?op=del&admin_id=" . $list[$i]['admin_id']); ?>" onclick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['username'])) ?>')"><img src="/admin/i/trash.gif" alt="Delete" width="10" height="10" border="0" /></a> </td> 53 53 </tr> 54 54 <?php } ?> -
trunk/services/templates/log_list.ihtml
r296 r320 21 21 <?php if (!preg_match($no_download_files, $l['filename'])) { ?><a class="sc-padright" href="<?php echo $app->oHREF('/admin/logs.php?op=download&log=' . $l['filename']); ?>"><?php echo _("Download"); ?></a><?php } ?> 22 22 <?php if (!preg_match($no_archive_files, $l['filename'])) { ?><a class="sc-padright" href="<?php echo $app->oHREF('/admin/logs.php?op=archive&log=' . $l['filename']); ?>"><?php echo _("Archive"); ?></a><?php } ?> 23 <?php if (!preg_match($no_clear_files, $l['filename'])) { ?><a class="sc-padright" href="<?php echo $app->oHREF('/admin/logs.php?op=clear&log=' . $l['filename']); ?>" onclick "javascript:return confirm('<?php printf(_("Are you sure you want to clear the log file %s? This will empty this file of its contents. This action is not reversible."), $l['filename'])?>')"><?php echo _("Clear"); ?></a><?php } ?>24 <?php if (!preg_match($no_delete_files, $l['filename'])) { ?><a href="<?php echo $app->oHREF('/admin/logs.php?op=delete&log=' . $l['filename']); ?>" onclick "javascript:return confirm('<?php printf(_("Are you sure you want to delete the log file %s? This will remove this log file permanently. This action is not reversible."), $l['filename'])?>')"><?php echo _("Delete"); ?></a><?php } ?>23 <?php if (!preg_match($no_clear_files, $l['filename'])) { ?><a class="sc-padright" href="<?php echo $app->oHREF('/admin/logs.php?op=clear&log=' . $l['filename']); ?>" onclick="javascript:return confirm('<?php printf(_("Are you sure you want to clear the log file %s? This will empty this file of its contents. This action is not reversible."), $l['filename'])?>')"><?php echo _("Clear"); ?></a><?php } ?> 24 <?php if (!preg_match($no_delete_files, $l['filename'])) { ?><a href="<?php echo $app->oHREF('/admin/logs.php?op=delete&log=' . $l['filename']); ?>" onclick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the log file %s? This will remove this log file permanently. This action is not reversible."), $l['filename'])?>')"><?php echo _("Delete"); ?></a><?php } ?> 25 25 </td> 26 26 </tr><?php
Note: See TracChangeset
for help on using the changeset viewer.