[][]" name="[][]" value="">
@@ -108,7 +108,6 @@
-
Index: trunk/core/kernel/globals.php
===================================================================
diff -u -r4665 -r4702
--- trunk/core/kernel/globals.php (.../globals.php) (revision 4665)
+++ trunk/core/kernel/globals.php (.../globals.php) (revision 4702)
@@ -478,6 +478,10 @@
$module_section = $application->RecallVar('section');
if ($module_section) {
// substitute section instead of #section# parameter in title preset name
+ if (strpos($module_section, ':') === false) {
+ return $string;
+ }
+
$module_section = explode(':', $module_section);
$section = preg_replace('/(configuration|configure)_(.*)/i', '\\2', $module_section[1]);
$string = str_replace('#section#', strtolower($section), $string);
Index: trunk/kernel/admin_templates/tree.tpl
===================================================================
diff -u -r4684 -r4702
--- trunk/kernel/admin_templates/tree.tpl (.../tree.tpl) (revision 4684)
+++ trunk/kernel/admin_templates/tree.tpl (.../tree.tpl) (revision 4702)
@@ -70,8 +70,6 @@
-
-
" onclick="checkEditMode()" icon="img/icons/icon24_.gif">
Index: trunk/kernel/admin_templates/groups/permissions_selector.tpl
===================================================================
diff -u -r4674 -r4702
--- trunk/kernel/admin_templates/groups/permissions_selector.tpl (.../permissions_selector.tpl) (revision 4674)
+++ trunk/kernel/admin_templates/groups/permissions_selector.tpl (.../permissions_selector.tpl) (revision 4702)
@@ -59,10 +59,8 @@
|
-
-
Index: trunk/kernel/admin_templates/groups/groups_edit_permissions.tpl
===================================================================
diff -u -r4636 -r4702
--- trunk/kernel/admin_templates/groups/groups_edit_permissions.tpl (.../groups_edit_permissions.tpl) (revision 4636)
+++ trunk/kernel/admin_templates/groups/groups_edit_permissions.tpl (.../groups_edit_permissions.tpl) (revision 4702)
@@ -60,7 +60,7 @@
-
+
[][]" name="[][]" value="">
@@ -108,7 +108,6 @@
-
Index: trunk/core/units/users/users_config.php
===================================================================
diff -u -r4698 -r4702
--- trunk/core/units/users/users_config.php (.../users_config.php) (revision 4698)
+++ trunk/core/units/users/users_config.php (.../users_config.php) (revision 4702)
@@ -99,7 +99,7 @@
'icon' => 'users',
'label' => 'la_tab_User_List',
'url' => Array('index_file' => 'users/user_list.php', 'pass' => 'm', 'resetpage' => 1),
- 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:ban', 'advanced:send_email', 'advanced:add_favorite', 'advanced:remove_favorite',),
+ 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:ban', 'advanced:send_email', /*'advanced:add_favorite', 'advanced:remove_favorite',*/),
'priority' => 1,
'type' => stTREE,
),
Index: trunk/core/admin_templates/groups/permissions_selector.tpl
===================================================================
diff -u -r4674 -r4702
--- trunk/core/admin_templates/groups/permissions_selector.tpl (.../permissions_selector.tpl) (revision 4674)
+++ trunk/core/admin_templates/groups/permissions_selector.tpl (.../permissions_selector.tpl) (revision 4702)
@@ -59,10 +59,8 @@
-
-
Index: trunk/kernel/units/users/users_config.php
===================================================================
diff -u -r4698 -r4702
--- trunk/kernel/units/users/users_config.php (.../users_config.php) (revision 4698)
+++ trunk/kernel/units/users/users_config.php (.../users_config.php) (revision 4702)
@@ -99,7 +99,7 @@
'icon' => 'users',
'label' => 'la_tab_User_List',
'url' => Array('index_file' => 'users/user_list.php', 'pass' => 'm', 'resetpage' => 1),
- 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:ban', 'advanced:send_email', 'advanced:add_favorite', 'advanced:remove_favorite',),
+ 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:ban', 'advanced:send_email', /*'advanced:add_favorite', 'advanced:remove_favorite',*/),
'priority' => 1,
'type' => stTREE,
),
Index: trunk/kernel/units/admin/admin_tag_processor.php
===================================================================
diff -u -r4684 -r4702
--- trunk/kernel/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4684)
+++ trunk/kernel/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4702)
@@ -125,17 +125,11 @@
}
/**
- * Builds xml for tree in left frame in admin
+ * Used in table form section drawing
*
* @param Array $params
+ * @return string
*/
- function BuildTree($params)
- {
- $sections_helper =& $this->Application->recallObject('SectionsHelper');
- $sections_helper->BuildTree();
- }
-
-
function DrawTree($params)
{
static $deep_level = 0;
@@ -191,6 +185,12 @@
return $ret;
}
+ /**
+ * Used in XML drawing for tree
+ *
+ * @param Array $params
+ * @return string
+ */
function PrintSections($params)
{
// when processings, then sort children by priority (key of children array)
@@ -212,6 +212,27 @@
foreach ($section_data['children'] as $section_name) {
$params['section_name'] = $section_name;
$section_data =& $sections_helper->getSectionData($section_name);
+
+ if (isset($section_data['tabs_only']) && $section_data['tabs_only']) {
+ $perm_status = false;
+ $folder_label = $section_data['label'];
+ ksort($section_data['children'], SORT_NUMERIC);
+ foreach ($section_data['children'] as $priority => $section_name) {
+ $perm_status = $this->Application->CheckPermission($section_name.'.view', 1);
+ if ($perm_status) {
+ break;
+ }
+ }
+ if (!$perm_status) {
+ // no permission for all tabs -> don't display tree node either
+ continue;
+ }
+
+ $params['section_name'] = $section_name;
+ $section_data =& $sections_helper->getSectionData($section_name);
+ $section_data['label'] = $folder_label; // use folder label in tree
+ }
+
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
$template = $section_data['url']['t'];
@@ -278,6 +299,33 @@
$ret = str_replace(' ', '\n', $ret);
return $ret;
}
+
+ /**
+ * Draws section tabs using block name passed
+ *
+ * @param Array $params
+ */
+ function ListTabs($params)
+ {
+ $sections_helper =& $this->Application->recallObject('SectionsHelper');
+ $section_data =& $sections_helper->getSectionData($params['section_name']);
+
+ $ret = '';
+ $block_params = Array('name' => $params['render_as']);
+ ksort($section_data['children'], SORT_NUMERIC);
+ foreach ($section_data['children'] as $priority => $section_name) {
+ if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue;
+
+ $tab_data =& $sections_helper->getSectionData($section_name);
+ $block_params['t'] = $tab_data['url']['t'];
+ $block_params['title'] = $tab_data['label'];
+ $block_params['main_prefix'] = $section_data['SectionPrefix'];
+ $ret .= $this->Application->ParseBlock($block_params);
+ }
+
+
+ return $ret;
+ }
}
?>
\ No newline at end of file
Index: trunk/kernel/units/general/helpers/sections_helper.php
===================================================================
diff -u -r4620 -r4702
--- trunk/kernel/units/general/helpers/sections_helper.php (.../sections_helper.php) (revision 4620)
+++ trunk/kernel/units/general/helpers/sections_helper.php (.../sections_helper.php) (revision 4702)
@@ -14,6 +14,19 @@
var $Tree = Array();
/**
+ * Set's prefix and special
+ *
+ * @param string $prefix
+ * @param string $special
+ * @access public
+ */
+ function Init($prefix, $special, $event_params = null)
+ {
+ parent::Init($prefix, $special, $event_params);
+ $this->BuildTree();
+ }
+
+ /**
* Builds xml for tree in left frame in admin
*
* @param Array $params
@@ -32,7 +45,6 @@
foreach ($sections as $section_name => $section_params) {
// we could also skip not allowed sections here in future
- if ($section_params['type'] != stTREE) continue;
$section_params['SectionPrefix'] = $prefix;
$section_params['url']['m_opener'] = 'r';
@@ -54,6 +66,11 @@
$this->Tree[$section_name] = array_merge_recursive2($current_data, $section_params);
$this->Tree[ $section_params['parent'] ]['children'][ "{$section_params['priority']}" ] = $section_name;
+
+ if ($section_params['type'] == stTAB) {
+ // if this is tab, then mark parent section as TabOnly
+ $this->Tree[ $section_params['parent'] ]['tabs_only'] = true;
+ }
}
}
}
Index: trunk/core/units/admin/admin_tag_processor.php
===================================================================
diff -u -r4684 -r4702
--- trunk/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4684)
+++ trunk/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4702)
@@ -125,17 +125,11 @@
}
/**
- * Builds xml for tree in left frame in admin
+ * Used in table form section drawing
*
* @param Array $params
+ * @return string
*/
- function BuildTree($params)
- {
- $sections_helper =& $this->Application->recallObject('SectionsHelper');
- $sections_helper->BuildTree();
- }
-
-
function DrawTree($params)
{
static $deep_level = 0;
@@ -191,6 +185,12 @@
return $ret;
}
+ /**
+ * Used in XML drawing for tree
+ *
+ * @param Array $params
+ * @return string
+ */
function PrintSections($params)
{
// when processings, then sort children by priority (key of children array)
@@ -212,6 +212,27 @@
foreach ($section_data['children'] as $section_name) {
$params['section_name'] = $section_name;
$section_data =& $sections_helper->getSectionData($section_name);
+
+ if (isset($section_data['tabs_only']) && $section_data['tabs_only']) {
+ $perm_status = false;
+ $folder_label = $section_data['label'];
+ ksort($section_data['children'], SORT_NUMERIC);
+ foreach ($section_data['children'] as $priority => $section_name) {
+ $perm_status = $this->Application->CheckPermission($section_name.'.view', 1);
+ if ($perm_status) {
+ break;
+ }
+ }
+ if (!$perm_status) {
+ // no permission for all tabs -> don't display tree node either
+ continue;
+ }
+
+ $params['section_name'] = $section_name;
+ $section_data =& $sections_helper->getSectionData($section_name);
+ $section_data['label'] = $folder_label; // use folder label in tree
+ }
+
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
$template = $section_data['url']['t'];
@@ -278,6 +299,33 @@
$ret = str_replace(' ', '\n', $ret);
return $ret;
}
+
+ /**
+ * Draws section tabs using block name passed
+ *
+ * @param Array $params
+ */
+ function ListTabs($params)
+ {
+ $sections_helper =& $this->Application->recallObject('SectionsHelper');
+ $section_data =& $sections_helper->getSectionData($params['section_name']);
+
+ $ret = '';
+ $block_params = Array('name' => $params['render_as']);
+ ksort($section_data['children'], SORT_NUMERIC);
+ foreach ($section_data['children'] as $priority => $section_name) {
+ if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue;
+
+ $tab_data =& $sections_helper->getSectionData($section_name);
+ $block_params['t'] = $tab_data['url']['t'];
+ $block_params['title'] = $tab_data['label'];
+ $block_params['main_prefix'] = $section_data['SectionPrefix'];
+ $ret .= $this->Application->ParseBlock($block_params);
+ }
+
+
+ return $ret;
+ }
}
?>
\ No newline at end of file
Index: trunk/kernel/constants.php
===================================================================
diff -u -r4627 -r4702
--- trunk/kernel/constants.php (.../constants.php) (revision 4627)
+++ trunk/kernel/constants.php (.../constants.php) (revision 4702)
@@ -14,8 +14,8 @@
safeDefine('STATUS_PENDING', 2);
// sections
- safeDefine('stTREE', 1);
- safeDefine('stTAB', 2);
+ define('stTREE', 1);
+ define('stTAB', 2);
// event statuses
define('erSUCCESS', 0); // event finished working succsessfully
Index: trunk/core/units/general/helpers/sections_helper.php
===================================================================
diff -u -r4620 -r4702
--- trunk/core/units/general/helpers/sections_helper.php (.../sections_helper.php) (revision 4620)
+++ trunk/core/units/general/helpers/sections_helper.php (.../sections_helper.php) (revision 4702)
@@ -14,6 +14,19 @@
var $Tree = Array();
/**
+ * Set's prefix and special
+ *
+ * @param string $prefix
+ * @param string $special
+ * @access public
+ */
+ function Init($prefix, $special, $event_params = null)
+ {
+ parent::Init($prefix, $special, $event_params);
+ $this->BuildTree();
+ }
+
+ /**
* Builds xml for tree in left frame in admin
*
* @param Array $params
@@ -32,7 +45,6 @@
foreach ($sections as $section_name => $section_params) {
// we could also skip not allowed sections here in future
- if ($section_params['type'] != stTREE) continue;
$section_params['SectionPrefix'] = $prefix;
$section_params['url']['m_opener'] = 'r';
@@ -54,6 +66,11 @@
$this->Tree[$section_name] = array_merge_recursive2($current_data, $section_params);
$this->Tree[ $section_params['parent'] ]['children'][ "{$section_params['priority']}" ] = $section_name;
+
+ if ($section_params['type'] == stTAB) {
+ // if this is tab, then mark parent section as TabOnly
+ $this->Tree[ $section_params['parent'] ]['tabs_only'] = true;
+ }
}
}
}
Index: trunk/kernel/admin_templates/sections_list.tpl
===================================================================
diff -u -r4524 -r4702
--- trunk/kernel/admin_templates/sections_list.tpl (.../sections_list.tpl) (revision 4524)
+++ trunk/kernel/admin_templates/sections_list.tpl (.../sections_list.tpl) (revision 4702)
@@ -1,7 +1,6 @@
-
| |