[php-blog-cvs] r2684 - in branches/1.5: . docs include include/admin templates/default
A reliable, secure & extensible PHP blog | Not mainstream since 2002
Brought to you by:
garvinhicking,
jhermanns
From: <gar...@ma...> - 2010-08-26 15:51:43
|
Author: garvinhicking Date: 2010-08-26 17:51:33 +0200 (Thu, 26 Aug 2010) New Revision: 2684 Modified: branches/1.5/docs/NEWS branches/1.5/include/admin/category.inc.php branches/1.5/include/admin/plugins.inc.php branches/1.5/include/functions_config.inc.php branches/1.5/include/functions_images.inc.php branches/1.5/include/functions_smarty.inc.php branches/1.5/include/plugin_api.inc.php branches/1.5/rss.php branches/1.5/templates/default/feed_2.0.tpl branches/1.5/templates/default/feed_atom0.3.tpl branches/1.5/templates/default/feed_atom1.0.tpl Log: backport Modified: branches/1.5/docs/NEWS =================================================================== --- branches/1.5/docs/NEWS 2010-08-26 15:49:12 UTC (rev 2683) +++ branches/1.5/docs/NEWS 2010-08-26 15:51:33 UTC (rev 2684) @@ -1,10 +1,23 @@ # $Id$ -Version 1.5.4 () +Version 1.5.4 (August 26th, 2010) ------------------------------------------------------------------------ * Fix PHP 5.3.2 parse error in a file, thanks to fyremoon + * Fix SQL query statement for deleting a category, which on some + DB types (SQlite) might not return "true" and thus not really + delete the category. (garvinhicking) + + * Include license output in plugin listing (onli) + + * Fix escaping when using ImageMagick to create PDF-thumbnail images + (stm9x9) + + * Add new template variable to feed*.tpl files to support new + plugins like pubsubhubbub, so that plugins can embed data to the + main XML element (onli) + Version 1.5.3 (May 10th, 2010); ------------------------------------------------------------------------ Modified: branches/1.5/include/admin/category.inc.php =================================================================== --- branches/1.5/include/admin/category.inc.php 2010-08-26 15:49:12 UTC (rev 2683) +++ branches/1.5/include/admin/category.inc.php 2010-08-26 15:51:33 UTC (rev 2684) @@ -93,19 +93,18 @@ AND c.category_left BETWEEN {$category_range} {$admin_category}"; } - if ( serendipity_db_query($query) ) { - if (serendipity_deleteCategory($category_range, $admin_category) ) { + serendipity_db_query($query); + if (serendipity_deleteCategory($category_range, $admin_category) ) { - foreach($category_ranges AS $cid) { - if (serendipity_ACLCheck($serendipity['authorid'], $cid, 'category', 'write')) { - serendipity_ACLGrant($cid, 'category', 'read', array()); - serendipity_ACLGrant($cid, 'category', 'write', array()); - } + foreach($category_ranges AS $cid) { + if (serendipity_ACLCheck($serendipity['authorid'], $cid, 'category', 'write')) { + serendipity_ACLGrant($cid, 'category', 'read', array()); + serendipity_ACLGrant($cid, 'category', 'write', array()); } - - echo '<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . ($remaining_cat ? sprintf(CATEGORY_DELETED_ARTICLES_MOVED, (int)$serendipity['GET']['cid'], $remaining_cat) : sprintf(CATEGORY_DELETED,(int)$serendipity['GET']['cid'])) .'</div>'; - $serendipity['GET']['adminAction'] = 'view'; } + + echo '<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . ($remaining_cat ? sprintf(CATEGORY_DELETED_ARTICLES_MOVED, (int)$serendipity['GET']['cid'], $remaining_cat) : sprintf(CATEGORY_DELETED,(int)$serendipity['GET']['cid'])) .'</div>'; + $serendipity['GET']['adminAction'] = 'view'; } } else { echo '<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />'. INVALID_CATEGORY .'</div>'; Modified: branches/1.5/include/admin/plugins.inc.php =================================================================== --- branches/1.5/include/admin/plugins.inc.php 2010-08-26 15:49:12 UTC (rev 2683) +++ branches/1.5/include/admin/plugins.inc.php 2010-08-26 15:51:33 UTC (rev 2684) @@ -73,6 +73,7 @@ $name = htmlspecialchars($bag->get('name')); $desc = htmlspecialchars($bag->get('description')); + $license = htmlspecialchars($bag->get('license')); $documentation = $bag->get('website'); @@ -169,6 +170,12 @@ ?> </td> </tr> + <?php + if (!empty($license)) { + echo '<tr><th>'.MEDIA_PROPERTY_COPYRIGHT.'</th><td>'.$license.'</td></tr>'; + } + ?> + </table> <br /> Modified: branches/1.5/include/functions_config.inc.php =================================================================== --- branches/1.5/include/functions_config.inc.php 2010-08-26 15:49:12 UTC (rev 2683) +++ branches/1.5/include/functions_config.inc.php 2010-08-26 15:51:33 UTC (rev 2684) @@ -267,8 +267,12 @@ $directories = array(); $directories[] = isset($serendipity['template']) ? $serendipity['template'] . '/' : ''; + if (isset($serendipity['template_engine']) && (stristr($file, 'admin/') === false || $serendipity['template_engine'] != 'default')) { - $directories[] = $serendipity['template_engine'] . '/'; + $p = explode(',', $serendipity['template_engine']); + foreach($p AS $te) { + $directories[] = trim($te) . '/'; + } } $directories[] = $serendipity['defaultTemplate'] .'/'; Modified: branches/1.5/include/functions_images.inc.php =================================================================== --- branches/1.5/include/functions_images.inc.php 2010-08-26 15:49:12 UTC (rev 2683) +++ branches/1.5/include/functions_images.inc.php 2010-08-26 15:51:33 UTC (rev 2684) @@ -659,7 +659,7 @@ } $newSize = $r['width'] . 'x' . $r['height']; if ($fdim['mime'] == 'application/pdf') { - $cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -flatten -scale '. serendipity_escapeshellarg($newSize) .' "'. serendipity_escapeshellarg($infile) .'[0]" '. serendipity_escapeshellarg($outfile . '.png'); + $cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -flatten -scale '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile . '[0]') . ' ' . serendipity_escapeshellarg($outfile . '.png'); } else { if (!$force_resize && serendipity_ini_bool(ini_get('safe_mode')) === false) { $newSize .= '>'; // Tell imagemagick to not enlarge small images, only works if safe_mode is off (safe_mode turns > in to \>) Modified: branches/1.5/include/functions_smarty.inc.php =================================================================== --- branches/1.5/include/functions_smarty.inc.php 2010-08-26 15:49:12 UTC (rev 2683) +++ branches/1.5/include/functions_smarty.inc.php 2010-08-26 15:51:33 UTC (rev 2684) @@ -880,10 +880,13 @@ $serendipity['smarty']->debugging = true; } - $serendipity['smarty']->template_dir = array( - $template_dir, - $serendipity['serendipityPath'] . $serendipity['templatePath'] . 'default' - ); + $serendipity['smarty']->template_dir = array($template_dir); + $p = explode(',', $serendipity['template_engine']); + foreach($p AS $te) { + $serendipity['smarty']->template_dir[] = $serendipity['serendipityPath'] . $serendipity['templatePath'] . $te; + } + + $serendipity['smarty']->template_dir[] = $serendipity['serendipityPath'] . $serendipity['templatePath'] . 'default'; $serendipity['smarty']->compile_dir = $serendipity['serendipityPath'] . PATH_SMARTY_COMPILE; if (!is_dir($serendipity['smarty']->compile_dir) || !is_writable($serendipity['smarty']->compile_dir)) { Modified: branches/1.5/include/plugin_api.inc.php =================================================================== --- branches/1.5/include/plugin_api.inc.php 2010-08-26 15:49:12 UTC (rev 2683) +++ branches/1.5/include/plugin_api.inc.php 2010-08-26 15:51:33 UTC (rev 2684) @@ -1099,6 +1099,24 @@ return $instance; } + + /** + * Probe for a language include with constants. Still include defines later on, if some constants were missing + * + * @access public + * @param current plugin's path + * @return object Returns the plugin object or false, if failure + */ + function load_language($path) { + global $serendipity; + + $probelang = $path . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php'; + if (file_exists($probelang)) { + include $probelang; + } + + include $path . '/lang_en.inc.php'; + } } /** Modified: branches/1.5/rss.php =================================================================== --- branches/1.5/rss.php 2010-08-26 15:49:12 UTC (rev 2683) +++ branches/1.5/rss.php 2010-08-26 15:51:33 UTC (rev 2684) @@ -247,11 +247,13 @@ serendipity_plugin_api::hook_event($namespace_hook, $entries); $namespace_display_dat = $entries['display_dat']; +$channel_display_dat = $entries['channel_dat']; unset($entries['display_dat']); $serendipity['smarty']->assign_by_ref('metadata', $metadata); $serendipity['smarty']->assign_by_ref('entries', $entries); $serendipity['smarty']->assign_by_ref('namespace_display_dat', $namespace_display_dat); +$serendipity['smarty']->assign_by_ref('channel_display_dat', $channel_display_dat); $serendipity['smarty']->assign_by_ref('once_display_dat', $once_display_dat); $serendipity['smarty']->assign( Modified: branches/1.5/templates/default/feed_2.0.tpl =================================================================== --- branches/1.5/templates/default/feed_2.0.tpl 2010-08-26 15:49:12 UTC (rev 2683) +++ branches/1.5/templates/default/feed_2.0.tpl 2010-08-26 15:51:33 UTC (rev 2684) @@ -9,6 +9,7 @@ xmlns:content="http://purl.org/rss/1.0/modules/content/" {$namespace_display_dat}> <channel> + {$channel_display_dat} <title>{$metadata.title}</title> <link>{$metadata.link}</link> <description>{$metadata.description}</description> Modified: branches/1.5/templates/default/feed_atom0.3.tpl =================================================================== --- branches/1.5/templates/default/feed_atom0.3.tpl 2010-08-26 15:49:12 UTC (rev 2683) +++ branches/1.5/templates/default/feed_atom0.3.tpl 2010-08-26 15:51:33 UTC (rev 2684) @@ -8,6 +8,7 @@ xmlns:admin="http://webns.net/mvcb/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"> + {$channel_display_dat} <link href="{$serendipityBaseURL}rss.php?version=atom0.3" rel="service.feed" title="{$metadata.title}" type="application/x.atom+xml" /> <link href="{$serendipityBaseURL}" rel="alternate" title="{$metadata.title}" type="text/html" /> <link href="{$serendipityBaseURL}rss.php?version=2.0" rel="alternate" title="{$metadata.title}" type="application/rss+xml" /> Modified: branches/1.5/templates/default/feed_atom1.0.tpl =================================================================== --- branches/1.5/templates/default/feed_atom1.0.tpl 2010-08-26 15:49:12 UTC (rev 2683) +++ branches/1.5/templates/default/feed_atom1.0.tpl 2010-08-26 15:51:33 UTC (rev 2684) @@ -8,6 +8,7 @@ xmlns:admin="http://webns.net/mvcb/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"> + {$channel_display_dat} <link href="{$self_url}" rel="self" title="{$metadata.title}" type="application/atom+xml" /> <link href="{$serendipityBaseURL}" rel="alternate" title="{$metadata.title}" type="text/html" /> <link href="{$serendipityBaseURL}rss.php?version=2.0" rel="alternate" title="{$metadata.title}" type="application/rss+xml" /> |