• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

XOOPS Cube Legacy base repository


Commit MetaInfo

Revision415bd2cf056ab85464df7c76b4022592a6d46af1 (tree)
Zeit2011-11-10 23:46:31
Autornbuy <nbuy@704c...>
Commiternbuy

Log Message

enhance mainmenu block. cache enabled. show all submenus.

git-svn-id: https://xoopscube.svn.sourceforge.net/svnroot/xoopscube/Package_Legacy/trunk@1043 704cf05f-ae62-4b0e-a484-234ee0250e75

Ändern Zusammenfassung

Diff

--- a/extras/extra_languages/czech/modules/legacy/language/czech/blocks.php
+++ b/extras/extra_languages/czech/modules/legacy/language/czech/blocks.php
@@ -34,4 +34,7 @@ define('_MB_LEGACY_LANG_THWIDTH', "V
3434 define('_MB_LEGACY_LANG_RECOMMENDSITE', "Doporu鑼e tento web p?tel?");
3535
3636 define('_MB_LEGACY_MESSAGE_CAN_NOT_THEME_CHANGE', "Promi?e, nyn nelze 啾blonu m?it.");
37+
38+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "Show all submenus");
39+
3740 ?>
--- a/extras/extra_languages/fr_utf8/modules/legacy/language/fr_utf8/blocks.php
+++ b/extras/extra_languages/fr_utf8/modules/legacy/language/fr_utf8/blocks.php
@@ -34,4 +34,6 @@ define('_MB_LEGACY_LANG_RECOMMENDSITE', "Recommender ce Site a un(e) Ami(e)");
3434
3535 define('_MB_LEGACY_MESSAGE_CAN_NOT_THEME_CHANGE', "Désolé, Il est actuellement impossible de changer les themes.");
3636
37+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "Voir toutes les sous-menus");
38+
3739 ?>
\ No newline at end of file
--- a/extras/extra_languages/french/modules/legacy/language/french/blocks.php
+++ b/extras/extra_languages/french/modules/legacy/language/french/blocks.php
@@ -35,4 +35,6 @@ define("_MB_LEGACY_LANG_RECOMMENDSITE", "Recommender ce Site a un(e) Ami(e)");
3535
3636 define("_MB_LEGACY_MESSAGE_CAN_NOT_THEME_CHANGE", "D駸ol? Il est actuellement impossible de changer les themes.");
3737
38+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "Voir toutes les sous-menus");
39+
3840 ?>
--- a/extras/extra_languages/greek/modules/legacy/language/greek/blocks.php
+++ b/extras/extra_languages/greek/modules/legacy/language/greek/blocks.php
@@ -36,6 +36,8 @@ define('_MB_LEGACY_LANG_THWIDTH', "Screenshot image width");
3636
3737 define('_MB_LEGACY_LANG_RECOMMENDSITE', "Recommend this Site to a Friend");
3838
39-define('_MB_LEGACY_MESSAGE_CAN_NOT_THEME_CHANGE', "Sorry, you can't change themes now.");
39+define('_MB_LEGACY_MESSAGE_CAN_NOT_THEME_CHANGE', "Λυπούμαστε, αλλά δεν μπορείτε να αλλάξετε τα θέματα τώρα.");
40+
41+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "Εμφάνιση όλων των υπομενού");
4042
4143 ?>
--- a/extras/extra_languages/ja_utf8/modules/legacy/language/ja_utf8/blocks.php
+++ b/extras/extra_languages/ja_utf8/modules/legacy/language/ja_utf8/blocks.php
@@ -35,4 +35,6 @@ define('_MB_LEGACY_LANG_RECOMMENDSITE', "当サイトを友達に薦める");
3535
3636 define('_MB_LEGACY_MESSAGE_CAN_NOT_THEME_CHANGE', "ただいまテーマチェンジャーはご利用になれません");
3737
38+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "全てのサブメニューを表示する");
39+
3840 ?>
--- a/extras/extra_languages/japanese/modules/legacy/language/japanese/blocks.php
+++ b/extras/extra_languages/japanese/modules/legacy/language/japanese/blocks.php
@@ -35,4 +35,6 @@ define('_MB_LEGACY_LANG_RECOMMENDSITE', "
3535
3636 define('_MB_LEGACY_MESSAGE_CAN_NOT_THEME_CHANGE', "ただいまテーマチェンジャーはご利用になれません");
3737
38+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "全てのサブメニューを表示する");
39+
3840 ?>
--- a/extras/extra_languages/ko_utf8/html/modules/legacy/language/ko_utf8/blocks.php
+++ b/extras/extra_languages/ko_utf8/html/modules/legacy/language/ko_utf8/blocks.php
@@ -65,4 +65,6 @@ define('_MB_LEGACY_LANG_RECOMMENDSITE', "친구에게 이 사이트를 추천");
6565
6666 define('_MB_LEGACY_MESSAGE_CAN_NOT_THEME_CHANGE', "지금은 테마를 변경하실 수 없습니다.");
6767
68+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "모든 하위 메뉴를 표시");
69+
6870 ?>
\ No newline at end of file
--- a/extras/extra_languages/korean/modules/legacy/language/korean/blocks.php
+++ b/extras/extra_languages/korean/modules/legacy/language/korean/blocks.php
@@ -65,4 +65,6 @@ define('_MB_LEGACY_LANG_RECOMMENDSITE', "庁
6565
6666 define('_MB_LEGACY_MESSAGE_CAN_NOT_THEME_CHANGE', "走榎精 砺原研 痕井馬叔 呪 蒸柔艦陥.");
6767
68+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "乞窮 馬是 五敢研 妊獣");
69+
6870 ?>
\ No newline at end of file
--- a/extras/extra_languages/portuguese/modules/legacy/language/portuguese/blocks.php
+++ b/extras/extra_languages/portuguese/modules/legacy/language/portuguese/blocks.php
@@ -43,4 +43,7 @@ define("_MB_LEGACY_SUBMS","Conte
4343 define("_MB_LEGACY_VACNT","Informa鋏es");
4444 define("_MB_LEGACY_WDLS","Arquivos pendentes");
4545 define("_MB_LEGACY_WLNKS","Endere輟s pendentes");
46+
47+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "Mostrar todos os submenus");
48+
4649 ?>
\ No newline at end of file
--- a/extras/extra_languages/pt_utf8/modules/legacy/language/pt_utf8/blocks.php
+++ b/extras/extra_languages/pt_utf8/modules/legacy/language/pt_utf8/blocks.php
@@ -43,4 +43,7 @@ define("_MB_LEGACY_SUBMS","Conteúdo pendente");
4343 define("_MB_LEGACY_VACNT","Informações");
4444 define("_MB_LEGACY_WDLS","Arquivos pendentes");
4545 define("_MB_LEGACY_WLNKS","Endereços pendentes");
46+
47+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "Mostrar todos os submenus");
48+
4649 ?>
\ No newline at end of file
--- a/extras/extra_languages/russian/modules/legacy/language/russian/main.php
+++ b/extras/extra_languages/russian/modules/legacy/language/russian/main.php
@@ -57,4 +57,6 @@ define('_MD_LEGACY_MESSAGE_LOGGEDOUT', "
5757
5858 define('_MD_LEGACY_MESSAGE_THANKYOUFORVISIT', "廷瘰 闔聳謗矗鴾 轢 轢 騾蜥!");
5959
60+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "Show all submenus");
61+
6062 ?>
--- a/extras/extra_languages/schinese/modules/legacy/language/schinese/blocks.php
+++ b/extras/extra_languages/schinese/modules/legacy/language/schinese/blocks.php
@@ -36,4 +36,6 @@ define('_MB_LEGACY_LANG_RECOMMENDSITE', "
3636
3737 define('_MB_LEGACY_MESSAGE_CAN_NOT_THEME_CHANGE', "宇埜?艇?壓涙隈延厚麼籾。");
3838
39+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "顯示所有子菜單");
40+
3941 ?>
--- a/extras/extra_languages/tw_utf-8/html/modules/legacy/language/tw_utf-8/blocks.php
+++ b/extras/extra_languages/tw_utf-8/html/modules/legacy/language/tw_utf-8/blocks.php
@@ -36,4 +36,6 @@ define('_MB_LEGACY_LANG_RECOMMENDSITE', "推薦本站");
3636
3737 define('_MB_LEGACY_MESSAGE_CAN_NOT_THEME_CHANGE', "抱歉,您現在無法變更佈景。");
3838
39+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "顯示所有子菜單");
40+
3941 ?>
--- a/extras/extra_languages/zh-tw/modules/legacy/language/zh-tw/blocks.php
+++ b/extras/extra_languages/zh-tw/modules/legacy/language/zh-tw/blocks.php
@@ -35,4 +35,6 @@ define('_MB_LEGACY_LANG_RECOMMENDSITE', '推薦這個網站給一個朋友');
3535
3636 define('_MB_LEGACY_MESSAGE_CAN_NOT_THEME_CHANGE', '抱歉,您現在不能修改佈景。');
3737
38+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "顯示所有子菜單");
39+
3840 ?>
--- a/html/modules/legacy/blocks/legacy_mainmenu.php
+++ b/html/modules/legacy/blocks/legacy_mainmenu.php
@@ -19,7 +19,7 @@
1919 // This file has been modified for Legacy from XOOPS2 System module block //
2020 // ------------------------------------------------------------------------- //
2121
22-function b_legacy_mainmenu_show() {
22+function b_legacy_mainmenu_show( $options ) {
2323 $root =& XCube_Root::getSingleton();
2424 $xoopsModule =& $root->mContext->mXoopsModule;
2525 $xoopsUser =& $root->mController->mRoot->mContext->mXoopsUser;
@@ -35,20 +35,38 @@ function b_legacy_mainmenu_show() {
3535 $moduleperm_handler =& xoops_gethandler('groupperm');
3636 $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
3737 $read_allowed = $moduleperm_handler->getItemIds('module_read', $groups);
38+ $all_links = (int)$options[0];
39+ $mid = is_object($xoopsModule)?$xoopsModule->getVar('mid', 'N'):'';
3840 foreach (array_keys($modules) as $i) {
3941 if (in_array($i, $read_allowed)) {
40- $block['modules'][$i]['name'] = $modules[$i]->getVar('name');
41- $block['modules'][$i]['directory'] = $modules[$i]->getVar('dirname');
42- $sublinks =& $modules[$i]->subLink();
43- if ((count($sublinks) > 0) && (!empty($xoopsModule)) && ($i == $xoopsModule->getVar('mid'))) {
42+ $module = &$modules[$i];
43+ $blockm = &$block['modules'][$i];
44+ $blockm['name'] = $module->getVar('name');
45+ $moddir = XOOPS_URL.'/modules/';
46+ $moddir .= $blockm['directory'] = $module->getVar('dirname', 'N');
47+ $info = $module->getInfo();
48+ $sublinks =& $module->subLink();
49+ if (count($sublinks)>0 && ($all_links || $i==$mid)) {
4450 foreach($sublinks as $sublink){
45- $block['modules'][$i]['sublinks'][] = array('name' => $sublink['name'], 'url' => XOOPS_URL.'/modules/'.$modules[$i]->getVar('dirname').'/'.$sublink['url']);
51+ $blockm['sublinks'][] = array('name' => $sublink['name'], 'url' => $moddir.'/'.$sublink['url']);
4652 }
4753 } else {
48- $block['modules'][$i]['sublinks'] = array();
54+ $blockm['sublinks'] = array();
4955 }
5056 }
5157 }
5258 return $block;
5359 }
60+
61+function b_legacy_mainmenu_edit( $options ) {
62+ $off='checked="checked"';
63+ $on='';
64+ if ($options[0]) {
65+ $on = $off;
66+ $off = '';
67+ }
68+ return "<div>"._MB_LEGACY_MAINMENU_EXPAND_SUB.
69+ "<input type=\"radio\" name=\"options[0]\" value=\"0\" $off>"._NO.
70+ " &nbsp; <input type=\"radio\" name=\"options[0]\" value=\"1\" $on>"._YES."</div>";
71+}
5472 ?>
--- a/html/modules/legacy/kernel/Legacy_CacheInformation.class.php
+++ b/html/modules/legacy/kernel/Legacy_CacheInformation.class.php
@@ -216,8 +216,8 @@ class Legacy_BlockCacheInformation extends Legacy_AbstractCacheInformation
216216 $this->mGetCacheFilePath->call(new XCube_Ref($filepath), $this);
217217
218218 if (!$filepath) {
219- $id = md5(XOOPS_SALT . $this->mBlock->get('bid') . "(" . implode("_", $this->mIdentityArr) . ")" . implode("_", $this->mGroupArr));
220- $filepath = XOOPS_CACHE_PATH . "/" . $id . ".cache.html";
219+ $id = md5(XOOPS_SALT . "(" . implode("_", $this->mIdentityArr) . ")" . implode("_", $this->mGroupArr));
220+ $filepath = XOOPS_CACHE_PATH . "/bid".$this->mBlock->get('bid') . '_' . $id . ".cache.html";
221221 }
222222
223223 return $filepath;
--- a/html/modules/legacy/language/english/blocks.php
+++ b/html/modules/legacy/language/english/blocks.php
@@ -35,4 +35,6 @@ define('_MB_LEGACY_LANG_RECOMMENDSITE', "Recommend this Site to a Friend");
3535
3636 define('_MB_LEGACY_MESSAGE_CAN_NOT_THEME_CHANGE', "Sorry, you can't change themes now.");
3737
38+define('_MB_LEGACY_MAINMENU_EXPAND_SUB', "Show all submenus");
39+
3840 ?>
--- a/html/modules/legacy/xoops_version.php
+++ b/html/modules/legacy/xoops_version.php
@@ -9,7 +9,7 @@
99 */
1010
1111 $modversion['name'] = _MI_LEGACY_NAME;
12-$modversion['version'] = 2.01;
12+$modversion['version'] = 2.02;
1313 $modversion['description'] = _MI_LEGACY_NAME_DESC;
1414 $modversion['author'] = "";
1515 $modversion['credits'] = "XOOPS Cube Project";
@@ -151,9 +151,11 @@ $modversion['blocks'][2]['file'] = "legacy_mainmenu.php";
151151 $modversion['blocks'][2]['name'] = _MI_LEGACY_BLOCK_MAINMENU_NAME;
152152 $modversion['blocks'][2]['description'] = _MI_LEGACY_BLOCK_MAINMENU_DESC;
153153 $modversion['blocks'][2]['show_func'] = "b_legacy_mainmenu_show";
154+$modversion['blocks'][2]['edit_func'] = "b_legacy_mainmenu_edit";
154155 $modversion['blocks'][2]['template'] = 'legacy_block_mainmenu.html';
155156 $modversion['blocks'][2]['visible_any'] = true;
156157 $modversion['blocks'][2]['show_all_module'] = true;
158+$modversion['blocks'][2]['options'] = '0';
157159
158160 $modversion['blocks'][3]['func_num'] = 3;
159161 $modversion['blocks'][3]['file'] = "legacy_search.php";
--- a/html/modules/stdCache/preload/Initialize.class.php
+++ b/html/modules/stdCache/preload/Initialize.class.php
@@ -17,6 +17,16 @@ class StdCache_Initialize extends XCube_ActionFilter
1717 function setForBlock($cacheInfo)
1818 {
1919 $user =& $this->mRoot->mContext->mXoopsUser;
20+ $block =& $cacheInfo->mBlock;
21+ switch ($block->getVar('show_func','n')) {
22+ case 'b_legacy_mainmenu_show': // mainmenu context
23+ list($option) = explode('|', $block->getVar('options','n'));
24+ if ($option) break; // but options setting no context
25+ $module = $this->mRoot->mContext->mXoopsModule;
26+ $cacheInfo->mIdentityArr['dirname'] = is_object($module)?$module->getVar('dirname'):'';
27+ break;
28+ // something other block with context cache
29+ }
2030 if (is_object($user)) {
2131 $cacheInfo->mGroupArr = $user->getGroups();
2232 $cacheInfo->setEnableCache(!in_array(XOOPS_GROUP_ADMIN, $user->getGroups()));