Index: trunk/kernel/admin_templates/config/config_search_edit.tpl =================================================================== diff -u -N -r4834 -r4842 --- trunk/kernel/admin_templates/config/config_search_edit.tpl (.../config_search_edit.tpl) (revision 4834) +++ trunk/kernel/admin_templates/config/config_search_edit.tpl (.../config_search_edit.tpl) (revision 4842) @@ -1,3 +1,4 @@ + Index: trunk/kernel/admin_templates/index.tpl =================================================================== diff -u -N -r4821 -r4842 --- trunk/kernel/admin_templates/index.tpl (.../index.tpl) (revision 4821) +++ trunk/kernel/admin_templates/index.tpl (.../index.tpl) (revision 4842) @@ -33,10 +33,10 @@ - " name="head" scrolling="no" noresize> + " name="head" scrolling="no" noresize> - " name="menu" target="main" noresize scrolling="auto" marginwidth="0" marginheight="0"> - " name="main" marginwidth="0" marginheight="0" frameborder="no" noresize scrolling="auto"> + " name="menu" target="main" noresize scrolling="auto" marginwidth="0" marginheight="0"> + " name="main" marginwidth="0" marginheight="0" frameborder="no" noresize scrolling="auto"> Index: trunk/kernel/units/custom_fields/custom_fields_event_handler.php =================================================================== diff -u -N -r4670 -r4842 --- trunk/kernel/units/custom_fields/custom_fields_event_handler.php (.../custom_fields_event_handler.php) (revision 4670) +++ trunk/kernel/units/custom_fields/custom_fields_event_handler.php (.../custom_fields_event_handler.php) (revision 4842) @@ -16,8 +16,6 @@ $section = $this->Application->getUnitOption($main_prefix.'.custom', 'PermSection'); $event->setEventParam('PermSection', $section); return parent::CheckPermission($event); - - } /** Index: trunk/core/units/custom_fields/custom_fields_event_handler.php =================================================================== diff -u -N -r4670 -r4842 --- trunk/core/units/custom_fields/custom_fields_event_handler.php (.../custom_fields_event_handler.php) (revision 4670) +++ trunk/core/units/custom_fields/custom_fields_event_handler.php (.../custom_fields_event_handler.php) (revision 4842) @@ -16,8 +16,6 @@ $section = $this->Application->getUnitOption($main_prefix.'.custom', 'PermSection'); $event->setEventParam('PermSection', $section); return parent::CheckPermission($event); - - } /** Index: trunk/kernel/admin_templates/config/config_general.tpl =================================================================== diff -u -N -r4834 -r4842 --- trunk/kernel/admin_templates/config/config_general.tpl (.../config_general.tpl) (revision 4834) +++ trunk/kernel/admin_templates/config/config_general.tpl (.../config_general.tpl) (revision 4842) @@ -1,3 +1,4 @@ +<inp2:m_RequireLogin perm_event="conf:OnLoad" system="1"/> <inp2:m_include t="incs/header" nobody="yes"/> <body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF"> Index: trunk/kernel/admin_templates/config/config_universal.tpl =================================================================== diff -u -N -r4834 -r4842 --- trunk/kernel/admin_templates/config/config_universal.tpl (.../config_universal.tpl) (revision 4834) +++ trunk/kernel/admin_templates/config/config_universal.tpl (.../config_universal.tpl) (revision 4842) @@ -1,3 +1,4 @@ +<inp2:m_RequireLogin perm_event="conf:OnLoad" system="1"/> <inp2:m_include t="incs/header" nobody="yes"/> <body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF"> Index: trunk/kernel/admin_templates/config/config_search.tpl =================================================================== diff -u -N -r4834 -r4842 --- trunk/kernel/admin_templates/config/config_search.tpl (.../config_search.tpl) (revision 4834) +++ trunk/kernel/admin_templates/config/config_search.tpl (.../config_search.tpl) (revision 4842) @@ -1,3 +1,4 @@ +<inp2:m_RequireLogin perm_event="confs:OnLoad" system="1"/> <inp2:m_include t="incs/header" nobody="yes"/> <body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF"> Index: trunk/core/units/general/helpers/permissions_helper.php =================================================================== diff -u -N -r4840 -r4842 --- trunk/core/units/general/helpers/permissions_helper.php (.../permissions_helper.php) (revision 4840) +++ trunk/core/units/general/helpers/permissions_helper.php (.../permissions_helper.php) (revision 4842) @@ -220,7 +220,7 @@ $permission_groups = getArrayValue($params, 'permissions'); if ($permission_groups) { - $this->showDebug('Tag <b>'.$tag_name.'</b> permission(-s): '.$permission_groups); + $this->showDebug('Tag <b>'.$tag_name.'</b> permission(-s): <b>'.$permission_groups.'</b>'); $permission_groups = explode('|', $permission_groups); $group_has_permission = false; foreach ($permission_groups as $permission_group) { @@ -238,6 +238,7 @@ return false; } elseif ($perm_event) { + $this->showDebug('Tag <b>'.$tag_name.'</b> permission_event: <b>'.$perm_event.'</b>'); list($prefix, $event) = explode(':', $perm_event); $event_handler =& $this->Application->recallObject($prefix.'_EventHandler'); return $event_handler->CheckPermission( new kEvent($perm_event) ); @@ -271,7 +272,7 @@ $redirect_template = $this->Application->IsAdmin() ? 'no_permission' : $this->Application->ConfigValue('NoPermissionTemplate'); } - $redirect_params = $this->Application->isDebugMode() ? Array('from_template' => 1, 'perms' => $params['permissions'], 'next_template' => $t) : Array(); + $redirect_params = $this->Application->isDebugMode() ? Array('from_template' => 1, 'perms' => $params[ isset($params['permissions']) ? 'permissions' : 'perm_event'], 'next_template' => $t) : Array(); } return Array($redirect_template, $redirect_params); Index: trunk/kernel/units/general/helpers/permissions_helper.php =================================================================== diff -u -N -r4840 -r4842 --- trunk/kernel/units/general/helpers/permissions_helper.php (.../permissions_helper.php) (revision 4840) +++ trunk/kernel/units/general/helpers/permissions_helper.php (.../permissions_helper.php) (revision 4842) @@ -220,7 +220,7 @@ $permission_groups = getArrayValue($params, 'permissions'); if ($permission_groups) { - $this->showDebug('Tag <b>'.$tag_name.'</b> permission(-s): '.$permission_groups); + $this->showDebug('Tag <b>'.$tag_name.'</b> permission(-s): <b>'.$permission_groups.'</b>'); $permission_groups = explode('|', $permission_groups); $group_has_permission = false; foreach ($permission_groups as $permission_group) { @@ -238,6 +238,7 @@ return false; } elseif ($perm_event) { + $this->showDebug('Tag <b>'.$tag_name.'</b> permission_event: <b>'.$perm_event.'</b>'); list($prefix, $event) = explode(':', $perm_event); $event_handler =& $this->Application->recallObject($prefix.'_EventHandler'); return $event_handler->CheckPermission( new kEvent($perm_event) ); @@ -271,7 +272,7 @@ $redirect_template = $this->Application->IsAdmin() ? 'no_permission' : $this->Application->ConfigValue('NoPermissionTemplate'); } - $redirect_params = $this->Application->isDebugMode() ? Array('from_template' => 1, 'perms' => $params['permissions'], 'next_template' => $t) : Array(); + $redirect_params = $this->Application->isDebugMode() ? Array('from_template' => 1, 'perms' => $params[ isset($params['permissions']) ? 'permissions' : 'perm_event'], 'next_template' => $t) : Array(); } return Array($redirect_template, $redirect_params); Index: trunk/kernel/admin_templates/popups/translator.tpl =================================================================== diff -u -N -r4834 -r4842 --- trunk/kernel/admin_templates/popups/translator.tpl (.../translator.tpl) (revision 4834) +++ trunk/kernel/admin_templates/popups/translator.tpl (.../translator.tpl) (revision 4842) @@ -1,3 +1,4 @@ +<inp2:m_RequireLogin perm_event="trans:OnLoad"/> <!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">--> <html> <head> Index: trunk/kernel/units/general/cat_event_handler.php =================================================================== diff -u -N -r4730 -r4842 --- trunk/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 4730) +++ trunk/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 4842) @@ -34,15 +34,15 @@ } } - if ($event->Name == 'OnExport') { // save category_id before doing export $this->Application->LinkVar('m_cat_id'); } if ($event->Name == 'OnNew' && preg_match('/(.*)\/import$/', $this->Application->GetVar('t'), $rets)) { // redirect to item import template, where permission (import) category will be chosen) - $this->Application->StoreVar('m_cat_id', $this->Application->findModule('Path', $rets[1].'/', 'RootCat')); + $root_category = $this->Application->findModule('Path', $rets[1].'/', 'RootCat'); + $this->Application->StoreVar('m_cat_id', $root_category); } return parent::CheckPermission($event); Index: trunk/core/kernel/application.php =================================================================== diff -u -N -r4840 -r4842 --- trunk/core/kernel/application.php (.../application.php) (revision 4840) +++ trunk/core/kernel/application.php (.../application.php) (revision 4842) @@ -280,25 +280,16 @@ * @param mixed $value * @param string field value to returns, if not specified, then return all fields * @param string field to return - * @param string field case-insensitive compare * @return Array */ - function findModule($field, $value, $return_field = null, $ci=false) + function findModule($field, $value, $return_field = null) { $found = false; foreach ($this->ModuleInfo as $module_name => $module_info) { - if ($ci) { - if (strtolower($module_info[$field]) == strtolower($value)) { - $found = true; - break; - } + if (strtolower($module_info[$field]) == strtolower($value)) { + $found = true; + break; } - else { - if ($module_info[$field] == $value) { - $found = true; - break; - } - } } if ($found) { Index: trunk/kernel/admin_templates/custom_fields/custom_fields_list.tpl =================================================================== diff -u -N -r4834 -r4842 --- trunk/kernel/admin_templates/custom_fields/custom_fields_list.tpl (.../custom_fields_list.tpl) (revision 4834) +++ trunk/kernel/admin_templates/custom_fields/custom_fields_list.tpl (.../custom_fields_list.tpl) (revision 4842) @@ -1,3 +1,4 @@ +<inp2:m_RequireLogin perm_event="cf:OnLoad" system="1"/> <inp2:m_include t="incs/header" nobody="yes"/> <body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF"> Index: trunk/kernel/admin_templates/tree.tpl =================================================================== diff -u -N -r4834 -r4842 --- trunk/kernel/admin_templates/tree.tpl (.../tree.tpl) (revision 4834) +++ trunk/kernel/admin_templates/tree.tpl (.../tree.tpl) (revision 4842) @@ -13,16 +13,6 @@ var screen_y = (screen.availHeight-height)/2; window.open(url, 'credits', 'width=280,height=520,left='+screen_x+',top='+screen_y); } - - - function checkEditMode() - { - if (window.parent.getFrame('main').$edit_mode) { - return confirm('<inp2:m_Phrase label="la_EditingInProgress" escape="1"/>') ? true : false; - } - - return true; - } </script> <script src="incs/tree.js"></script> @@ -60,7 +50,6 @@ .tree tr td a:hover { color: #009FF0; } - </style> <table cellpadding="0" cellspacing="0" border="0" width="100%"> Index: trunk/core/units/general/cat_event_handler.php =================================================================== diff -u -N -r4730 -r4842 --- trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 4730) +++ trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 4842) @@ -34,15 +34,15 @@ } } - if ($event->Name == 'OnExport') { // save category_id before doing export $this->Application->LinkVar('m_cat_id'); } if ($event->Name == 'OnNew' && preg_match('/(.*)\/import$/', $this->Application->GetVar('t'), $rets)) { // redirect to item import template, where permission (import) category will be chosen) - $this->Application->StoreVar('m_cat_id', $this->Application->findModule('Path', $rets[1].'/', 'RootCat')); + $root_category = $this->Application->findModule('Path', $rets[1].'/', 'RootCat'); + $this->Application->StoreVar('m_cat_id', $root_category); } return parent::CheckPermission($event); Index: trunk/kernel/units/admin/admin_tag_processor.php =================================================================== diff -u -N -r4794 -r4842 --- trunk/kernel/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4794) +++ trunk/kernel/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4842) @@ -99,11 +99,11 @@ elseif ($is_params['is_type'] == 'csv') { $module = strtolower($is_params['is_Module']); $template = $module.'/import'; - $sql = 'SELECT Var - FROM '.TABLE_PREFIX.'Modules - WHERE LOWER(Name) = '.$db->qstr($module); - $item_prefix = $db->GetOne($sql); - $pass_params = Array('m_opener' => 'd', $item_prefix.'.import_id' => 0, $item_prefix.'.import_event' => 'OnNew', 'pass' => 'm,'.$item_prefix.'.import'); + $module_info = $this->Application->findModule('Name', $module); + + $item_prefix = $module_info['Var']; + $pass_params = Array('m_opener' => 'd', $item_prefix.'.import_id' => 0, $item_prefix.'.import_event' => 'OnNew', 'pass' => 'm,'.$item_prefix.'.import', 'm_cat_id' => $module_info['RootCat']); + $this->Application->Redirect($template, $pass_params); } } Index: trunk/kernel/admin_templates/config/config_email.tpl =================================================================== diff -u -N -r4834 -r4842 --- trunk/kernel/admin_templates/config/config_email.tpl (.../config_email.tpl) (revision 4834) +++ trunk/kernel/admin_templates/config/config_email.tpl (.../config_email.tpl) (revision 4842) @@ -1,3 +1,4 @@ +<inp2:m_RequireLogin perm_event="emailevents:OnLoad" system="1"/> <inp2:m_include t="incs/header" nobody="yes"/> <body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF"> Index: trunk/core/units/admin/admin_tag_processor.php =================================================================== diff -u -N -r4794 -r4842 --- trunk/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4794) +++ trunk/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4842) @@ -99,11 +99,11 @@ elseif ($is_params['is_type'] == 'csv') { $module = strtolower($is_params['is_Module']); $template = $module.'/import'; - $sql = 'SELECT Var - FROM '.TABLE_PREFIX.'Modules - WHERE LOWER(Name) = '.$db->qstr($module); - $item_prefix = $db->GetOne($sql); - $pass_params = Array('m_opener' => 'd', $item_prefix.'.import_id' => 0, $item_prefix.'.import_event' => 'OnNew', 'pass' => 'm,'.$item_prefix.'.import'); + $module_info = $this->Application->findModule('Name', $module); + + $item_prefix = $module_info['Var']; + $pass_params = Array('m_opener' => 'd', $item_prefix.'.import_id' => 0, $item_prefix.'.import_event' => 'OnNew', 'pass' => 'm,'.$item_prefix.'.import', 'm_cat_id' => $module_info['RootCat']); + $this->Application->Redirect($template, $pass_params); } } Index: trunk/kernel/admin_templates/custom_fields/custom_fields_edit.tpl =================================================================== diff -u -N -r4834 -r4842 --- trunk/kernel/admin_templates/custom_fields/custom_fields_edit.tpl (.../custom_fields_edit.tpl) (revision 4834) +++ trunk/kernel/admin_templates/custom_fields/custom_fields_edit.tpl (.../custom_fields_edit.tpl) (revision 4842) @@ -1,3 +1,4 @@ +<inp2:m_RequireLogin perm_event="cf:OnLoad" system="1"/> <inp2:m_include t="incs/header" nobody="yes"/> <body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">