fixed requested changes, array processing of multilingual_stip_langs
This commit is contained in:
parent
502b837dd6
commit
ea371f6a4e
@ -145,16 +145,13 @@ function &serendipity_fetchEntryCategories($entryid) {
|
||||
WHERE ec.entryid = {$entryid}
|
||||
ORDER BY c.category_name ASC";
|
||||
|
||||
$cat =& serendipity_db_query($query);
|
||||
$cat =& serendipity_db_query($query,false,'assoc');
|
||||
|
||||
if (!is_array($cat)) {
|
||||
$arr = array();
|
||||
return $arr;
|
||||
} else {
|
||||
foreach ($cat as $key => $catdata) {
|
||||
serendipity_plugin_api::hook_event('multilingual_strip_langs',$cat[$key]['category_name']);
|
||||
serendipity_plugin_api::hook_event('multilingual_strip_langs',$cat[$key]['category_description']);
|
||||
}
|
||||
serendipity_plugin_api::hook_event('multilingual_strip_langs',$cat, array('category_name','category_description'));
|
||||
return $cat;
|
||||
}
|
||||
}
|
||||
@ -515,9 +512,8 @@ function serendipity_fetchEntryData(&$ret) {
|
||||
$search_ret =& serendipity_db_query($query, false, 'assoc');
|
||||
|
||||
if (is_array($search_ret)) {
|
||||
serendipity_plugin_api::hook_event('multilingual_strip_langs', $search_ret, array('category_name','category_description'));
|
||||
foreach($search_ret AS $i => $entry) {
|
||||
serendipity_plugin_api::hook_event('multilingual_strip_langs',$entry['category_name']);
|
||||
serendipity_plugin_api::hook_event('multilingual_strip_langs',$entry['category_description']);
|
||||
$ret[$assoc_ids[$entry['entryid']]]['categories'][] = $entry;
|
||||
}
|
||||
}
|
||||
@ -728,16 +724,13 @@ function &serendipity_fetchCategories($authorid = null, $name = null, $order = n
|
||||
$cats = serendipity_walkRecursive($ret, 'categoryid', 'parentid', VIEWMODE_THREADED);
|
||||
$flat_cats = array();
|
||||
$flat_cats[0] = NO_CATEGORY;
|
||||
serendipity_plugin_api::hook_event('multilingual_strip_langs',$cats, array('category_name','category_description'));
|
||||
foreach($cats AS $catidx => $catdata) {
|
||||
serendipity_plugin_api::hook_event('multilingual_strip_langs', $catdata['category_name']);
|
||||
$flat_cats[$catdata['categoryid']] = str_repeat(' ', $catdata['depth']*2) . serendipity_specialchars($catdata['category_name']);
|
||||
}
|
||||
return $flat_cats;
|
||||
} else {
|
||||
foreach ($ret as $key => $catdata) {
|
||||
serendipity_plugin_api::hook_event('multilingual_strip_langs',$ret[$key]['category_name']);
|
||||
serendipity_plugin_api::hook_event('multilingual_strip_langs',$ret[$key]['category_description']);
|
||||
}
|
||||
serendipity_plugin_api::hook_event('multilingual_strip_langs',$ret, array('category_name','category_description'));
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
@ -213,6 +213,9 @@ class serendipity_plugin_categories extends serendipity_plugin
|
||||
|
||||
if (is_array($categories) && count($categories)) {
|
||||
$categories = serendipity_walkRecursive($categories, 'categoryid', 'parentid', VIEWMODE_THREADED);
|
||||
// strip language tags if multilingual plugin is active
|
||||
serendipity_plugin_api::hook_event('multilingual_strip_langs', $categories, 'category_name');
|
||||
|
||||
foreach ($categories as $cid => $cat) {
|
||||
// Hide parents not wanted
|
||||
if ($use_parent && $use_parent != 'all') {
|
||||
@ -255,9 +258,6 @@ class serendipity_plugin_categories extends serendipity_plugin
|
||||
}
|
||||
}
|
||||
|
||||
// strip language tags if multilingual plugin is active
|
||||
serendipity_plugin_api::hook_event('multilingual_strip_langs',$cat['category_name']);
|
||||
|
||||
$categories[$cid]['feedCategoryURL'] = serendipity_feedCategoryURL($cat, 'serendipityHTTPPath');
|
||||
$categories[$cid]['categoryURL'] = serendipity_categoryURL($cat, 'serendipityHTTPPath');
|
||||
$categories[$cid]['paddingPx'] = $cat['depth']*6;
|
||||
|
@ -46,8 +46,7 @@ class serendipity_plugin_superuser extends serendipity_plugin
|
||||
$base = $serendipity['serendipityHTTPPath'];
|
||||
}
|
||||
|
||||
//$link = $base . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] .'?/' : '') . PATH_ADMIN;
|
||||
$link = $base . 'serendipity_admin.php';
|
||||
$link = $base . ($serendipity['rewrite'] == 'none' ? 'serendipity_admin.php' : PATH_ADMIN);
|
||||
$text = (($_SESSION['serendipityAuthedUser'] === true) ? SUPERUSER_OPEN_ADMIN : SUPERUSER_OPEN_LOGIN);
|
||||
echo '<a href="' . $link . '" rel="nofollow" title="'. $text .'">'. $text .'</a>';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user