Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Wed, Sep 24, 1:27 AM

in-portal

Index: branches/unlabeled/unlabeled-1.8.2/kernel/units/groups/groups_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/units/groups/groups_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/units/groups/groups_config.php (revision 4944)
@@ -0,0 +1,119 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'g',
+
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'GroupsEventHandler', 'file' => 'groups_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'kDBTagProcessor', 'file' => '','build_event'=>'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'GroupId',
+
+ 'StatusField' => Array('Enabled'),
+
+ 'TitleField' => 'Name',
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('g' => '!la_title_Adding_Group!'),
+ 'edit_status_labels' => Array('g' => '!la_title_Editing_Group!'),
+ 'new_titlefield' => Array('g' => '!la_title_New_Group!'),
+ ),
+
+ 'groups_list' => Array('prefixes' => Array('g_List'), 'format' => "!la_title_Groups! (#g_recordcount#)"),
+
+ 'groups_edit' => Array('prefixes' => Array('g'), 'format' => "#g_status# '#g_titlefield#' - !la_title_General!"),
+
+ 'groups_edit_users' => Array('prefixes' => Array('g', 'g-ug_List'), 'format' => "#g_status# '#g_titlefield#' - !la_title_Users! (#g-ug_recordcount#)" ),
+
+ 'groups_edit_permissions' => Array('prefixes' => Array('g'), 'format' => "#g_status# '#g_titlefield#' - !la_title_Permissions!" ),
+
+ 'groups_edit_additional_permissions' => Array('prefixes' => Array('g'), 'format' => "#g_status# '#g_titlefield#' - !la_title_AdditionalPermissions!" ),
+
+ 'groups_select' => Array('prefixes' => Array('g_List'), 'format' => "!la_title_Groups! (#g_recordcount#) - !la_title_SelectGroup!"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-portal:user_groups'),
+
+ 'Sections' => Array(
+ 'in-portal:user_groups' => Array(
+ 'parent' => 'in-portal:users',
+ 'icon' => 'usergroups',
+ 'label' => 'la_tab_User_Groups',
+ 'url' => Array('t' => 'groups/groups_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:send_email'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'PortalGroup',
+
+ 'ListSQLs' => Array('' => ' SELECT %1$s.* %2$s FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON ug.GroupId = %1$s.GroupId'),
+
+ 'ItemSQLs' => Array('' => ' SELECT %1$s.* %2$s FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON ug.GroupId = %1$s.GroupId'),
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'Sorting' => Array('Name' => 'asc'),
+ )
+ ),
+
+ 'SubItems' => Array('g-perm', /*'g-ug'*/),
+ 'CalculatedFields' => Array(
+ 'total' => Array(
+ 'UserCount' => 'COUNT(ug.PortalUserId)',
+ ),
+ ),
+
+ 'Fields' => Array (
+ 'GroupId' => Array(),
+ 'Name' => Array('type' => 'string', 'not_null' => '1', 'required' => 1, 'default' => ''),
+ 'Description' => Array('type' => 'string','default' => ''),
+ 'CreatedOn' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'not_null' => '1','default' => '#NOW#'),
+ 'System' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'Personal' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'Enabled' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Enabled', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => '1','default' => 1),
+ 'ResourceId' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ ),
+
+ 'VirtualFields' => Array(
+ 'UserCount' => Array('type' => 'int', 'default' => 0),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array(1 => 'icon16_group.gif', 0 => 'icon16_group_disabled.gif'),
+ 'Fields' => Array(
+ 'Name' => Array('title' => 'la_col_GroupName', 'data_block' => 'grid_checkbox_td'),
+ 'UserCount' => Array('title' => 'la_col_UserCount'),
+ ),
+ ),
+
+ /*'GroupSelector' => Array(
+ 'Icons' => Array(0 => 'icon16_user_disabled.gif', 1 => 'icon16_user.gif', 2 => 'icon16_user_pending.gif'),
+ 'Fields' => Array(
+ 'Login' => Array('title' => 'la_col_Username', 'data_block' => 'grid_radio_td'),
+ 'LastName' => Array( 'title'=>'la_col_LastName'),
+ 'FirstName' => Array( 'title'=>'la_col_FirstName'),
+ 'Email' => Array( 'title'=>'la_col_Email'),
+ 'PrimaryGroup' => Array( 'title'=>'la_col_PrimaryGroup'),
+ 'CreatedOn_formatted' => Array('title' => 'la_col_CreatedOn', 'sort_field' => 'CreatedOn'),
+ ),
+ ),*/
+ ),
+
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/units/groups/groups_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/kernel/units/phrases/phrases_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/units/phrases/phrases_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/units/phrases/phrases_config.php (revision 4944)
@@ -0,0 +1,129 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'phrases',
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'PhrasesEventHandler','file'=>'phrases_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hBEFORE,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'phrases',
+ 'HookToSpecial' => '',
+ 'HookToEvent' => Array('OnCreate'),
+ 'DoPrefix' => 'phrases',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnBeforePhraseCreate',
+ ),
+
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'phrases',
+ 'HookToSpecial' => '',
+ 'HookToEvent' => Array('OnBeforeItemCreate','OnBeforeItemUpdate'),
+ 'DoPrefix' => 'phrases',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnSetLastUpdated',
+ ),
+ ),
+
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'label',
+ ),
+ 'IDField' => 'PhraseId',
+
+ 'TitleField' => 'Phrase',
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('phrases'=>'!la_title_Adding_Phrase!'),
+ 'edit_status_labels' => Array('phrases'=>'!la_title_Editing_Phrase!'),
+ 'new_titlefield' => Array('phrases'=>'!la_title_New_Phrase!'),
+ ),
+
+ 'phrase_edit' => Array('prefixes' => Array('phrases'), 'format' => '#phrases_status# - #phrases_titlefield#'),
+
+ ),
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_front','show_admin','show_both'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_front' => Array('label' =>'la_PhraseType_Front', 'on_sql' => '', 'off_sql' => '%1$s.PhraseType != 0' ),
+ 'show_admin' => Array('label' => 'la_PhraseType_Admin', 'on_sql' => '', 'off_sql' => '%1$s.PhraseType != 1' ),
+ 'show_both' => Array('label' => 'la_PhraseType_Both', 'on_sql' => '', 'off_sql' => '%1$s.PhraseType != 2' ),
+ )
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Phrase',
+
+ 'CalculatedFields' => Array(
+ '' => Array(
+ 'PrimaryTranslation' => 'pri.Translation',
+ ),
+
+ ),
+
+ 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'Phrase pri ON (%1$s.Phrase = pri.Phrase) AND (pri.LanguageId = 1)'),
+
+ 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'Phrase pri ON (%1$s.Phrase = pri.Phrase) AND (pri.LanguageId = 1)',),
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'Sorting' => Array('Phrase' => 'asc'),
+ )
+ ),
+
+ 'ForeignKey' => 'LanguageId',
+ 'ParentTableKey' => 'LanguageId',
+ 'ParentPrefix' => 'lang',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'Fields' => Array(
+ 'Phrase' => Array('type' => 'string','required'=>1,'unique'=>Array('LanguageId'),'not_null' => '1','default' => ''),
+ 'Translation' => Array('type' => 'string','required'=>1,'not_null' => '1','default' => ''),
+ 'PhraseType' => Array('type' => 'int','required'=>1,'formatter'=>'kOptionsFormatter','options'=>Array(0=>'la_PhraseType_Front',1=>'la_PhraseType_Admin',2=>'la_PhraseType_Both'), 'use_phrases' => 1, 'not_null' => '1','default' => '0'),
+ 'PhraseId' => Array('type' => 'int','not_null' => '1','default' => ''),
+ 'LanguageId' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'LastChanged' => Array('type' => 'int', 'formatter'=>'kDateFormatter', 'not_null' => '1','default' => '0'),
+ 'LastChangeIP' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Module' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>''), 'options_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Modules WHERE Loaded = 1 ORDER BY LoadOrder', 'option_key_field'=>'Name', 'option_title_field'=>'Name', 'not_null' => '1','default' => 'In-Portal'),
+ ),
+
+ 'VirtualFields' => Array(
+ 'PrimaryTranslation' => Array(),
+ 'LangFile' => Array(),
+ 'ImportOverwrite' => Array(),
+ 'DoNotEncode' => Array(),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_language_var.gif'),
+ 'Fields' => Array(
+ 'Phrase' => Array( 'title'=>'la_col_Label', 'data_block' => 'grid_checkbox_td'),
+ 'Translation' => Array( 'title'=>'la_col_Translation' ),
+ 'PrimaryTranslation' => Array( 'title'=>'la_col_PrimaryValue' ),
+ 'PhraseType' => Array( 'title'=>'la_col_PhraseType' ),
+ 'LastChanged' => Array( 'title'=>'la_col_LastChanged' ),
+ 'Module' => Array( 'title'=>'la_col_Module' ),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/units/phrases/phrases_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/kernel/units/config_search/config_search_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/units/config_search/config_search_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/units/config_search/config_search_config.php (revision 4944)
@@ -0,0 +1,115 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'confs',
+
+ 'Clones' => Array(
+ 'confs-cf' => Array(
+ 'Prefix' => 'confs-cf',
+ 'ParentPrefix' => 'cf',
+ 'ParentTableKey' => 'CustomFieldId', // linked field in master table
+ 'ForeignKey' => 'CustomFieldId', // linked field in subtable
+ 'AutoClone' => false, // because OnCreateCustomField hook does the stuff
+ 'AutoDelete' => true,
+
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => '#PARENT#',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnAfterItemCreate', 'OnAfterItemUpdate'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '*',
+ 'DoEvent' => 'OnCreateCustomField',
+ ),
+ ),
+ ),
+ ),
+
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'ConfigSearchEventHandler','file'=>'config_search_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'ConfigSearchTagProcessor','file'=>'config_search_tag_processor.php','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+ 'hooks' => Array(),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ ),
+
+ 'IDField' => 'SearchConfigId',
+
+ 'TitleField' => 'FieldName',
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('confs'=>'!la_title_Adding_ConfigSearch!'),
+ 'edit_status_labels' => Array('confs'=>'!la_title_Editing_ConfigSearch!'),
+ 'new_titlefield' => Array('confs'=>'!la_title_New_ConfigSearch!'),
+ ),
+
+ 'configsearch_edit' => Array('prefixes' => Array('confs'), 'format' => "#confs_status# '#confs_titlefield#' - !la_title_General!"),
+ 'config_list_search' => Array('prefixes' => Array('confs_List'), 'tag_params' => Array('confs' => Array('per_page' => -1) ), 'format' => "!la_updating_config!"),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'SearchConfig',
+
+ 'CalculatedFields' => Array(
+ '' => Array(
+ 'IsCustom' => 'IF(CustomFieldId IS NULL, 0, 1)',
+ ),
+ ),
+
+ 'ListSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s'),
+
+ 'ItemSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s'),
+
+
+
+ 'Fields' => Array(
+ 'TableName' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
+ 'FieldName' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
+ 'SimpleSearch' => Array('type' => 'int','not_null' => '1','default' => '1'),
+ 'AdvancedSearch' => Array('type' => 'int','not_null' => '1','default' => '1'),
+ 'Description' => Array('type' => 'string','default' => ''),
+ 'DisplayName' => Array('type' => 'string', 'required' => 1, 'default' => ''),
+ 'ModuleName' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>''), 'options_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Modules WHERE Loaded = 1 ORDER BY LoadOrder', 'option_key_field'=>'Name', 'option_title_field'=>'Name', 'not_null' => '1','default' => 'In-Portal'),
+ 'ConfigHeader' => Array('type' => 'string', 'required' => 1, 'default' => ''),
+ 'DisplayOrder' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'SearchConfigId' => Array('type' => 'int','not_null' => '1','default' => ''),
+ 'Priority' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'FieldType' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('text' => 'text', 'range' => 'range', 'boolean' => 'boolean', 'date' => 'date'), 'not_null' => '1', 'required' => 1, 'default' => 'text'),
+ 'ForeignField' => Array('type' => 'string','default' => null),
+ 'JoinClause' => Array('type' => 'string','default' => null),
+ 'IsWhere' => Array('type' => 'string','default' => null),
+ 'IsNotWhere' => Array('type' => 'string','default' => null),
+ 'ContainsWhere' => Array('type' => 'string','default' => null),
+ 'NotContainsWhere' => Array('type' => 'string','default' => null),
+ 'CustomFieldId' => Array('type' => 'int', 'default' => null),
+ ),
+
+ 'VirtualFields' => Array(
+ 'IsCustom' => Array('type' => 'int', 'default' => 0),
+ ),
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('IsCustom' => 'asc'),
+ 'Sorting' => Array('DisplayOrder' => 'asc'),
+ )
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif'), // icons for each StatusField values, if no matches or no statusfield selected, then "default" icon is used
+ 'Fields' => Array(
+ 'TableName' => Array( 'title'=>'la_col_TableName', 'data_block' => 'grid_data_td'),
+ 'FieldName' => Array( 'title'=>'la_col_FieldName', 'data_block' => 'grid_data_td' ),
+ 'SimpleSearch' => Array( 'title'=>'la_col_SimpleSearch', 'data_block' => 'grid_data_td'),
+ ),
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/units/config_search/config_search_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/kernel/units/general/helpers/permissions_helper.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/units/general/helpers/permissions_helper.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/units/general/helpers/permissions_helper.php (revision 4944)
@@ -0,0 +1,368 @@
+<?php
+
+ class kPermissionsHelper extends kHelper {
+
+ /**
+ * Current set of permissions for group being edited
+ *
+ * @var Array
+ */
+ var $Permissions = Array();
+
+ function LoadPermissions($prefix)
+ {
+ $object =& $this->Application->recallObject($prefix.'-perm', null, Array('skip_autoload' => true));
+
+ $foreign_key = $this->Application->getUnitOption($prefix.'-perm', 'ForeignKey');
+ $foreign_value = $this->Application->GetVar($prefix.'_id');
+ $sql = 'SELECT *
+ FROM '.$object->TableName.'
+ WHERE '.$foreign_key.' = '.$foreign_value;
+ $permissions = $this->Conn->Query($sql, 'Permission');
+
+ $this->Permissions = Array();
+ foreach ($permissions as $perm_name => $perm_options) {
+ $perm_record['value'] = $perm_options['PermissionValue'];
+ $perm_record['id'] = $perm_options['PermissionId'];
+ $this->Permissions[$perm_name] = $perm_record;
+ }
+ }
+
+ function getPermissionValue($perm_name)
+ {
+ return getArrayValue($this->Permissions, $perm_name) ? $this->Permissions[$perm_name]['value'] : 0;
+ }
+
+ function getPermissionID($perm_name)
+ {
+ return getArrayValue($this->Permissions, $perm_name) ? $this->Permissions[$perm_name]['id'] : 0;
+ }
+
+ /**
+ * This is old permission like ADMIN or LOGIN
+ *
+ * @param string $section_name
+ * @param string $perm_name
+ * @return bool
+ */
+ function isOldPermission($section_name, $perm_name)
+ {
+ return $section_name == 'in-portal:root' && $perm_name != 'view';
+ }
+
+ /**
+ * Returns permission names to check based on event name and item prefix (main item or subitem)
+ *
+ * @param kEvent $event
+ * @return Array
+ */
+ function getPermissionByEvent(&$event, $perm_mapping)
+ {
+ $top_prefix = $event->getEventParam('top_prefix');
+
+ $pefix_type = ($top_prefix == $event->Prefix) ? 'self' : 'subitem';
+ $perm_mapping = getArrayValue($perm_mapping, $event->Name);
+
+ if (!$perm_mapping[$pefix_type]) {
+ trigger_error('Permission mappings not defined for event <b>'.$top_prefix.' <- '.$event->Prefix.':'.$event->Name.'</b>', E_USER_ERROR);
+ }
+
+ if ($perm_mapping[$pefix_type] === true) {
+ // event is defined in mapping but is not checked by permissions
+ return true;
+ }
+
+ return explode('|', $perm_mapping[$pefix_type]);
+ }
+
+ /**
+ * Common event permission checking method
+ *
+ * @param kEvent $event
+ */
+ function CheckEventPermission(&$event, $perm_mapping)
+ {
+ $section = $event->getSection();
+ if (preg_match('/^CATEGORY:(.*)/', $section)) {
+ return $this->CheckEventCategoryPermission($event, $perm_mapping);
+ }
+
+ $top_prefix = $event->getEventParam('top_prefix');
+ $check_perms = $this->getPermissionByEvent($event, $perm_mapping);
+
+ if ($check_perms === true) {
+ // event is defined in mapping but is not checked by permissions
+ return true;
+ }
+
+ $perm_status = false;
+ foreach ($check_perms as $perm_name) {
+ // check if at least one of required permissions is set
+ $perm_name = $section.'.'.$perm_name;
+ $perm_status = $this->CheckPermission($perm_name, 1);
+ if (($perm_name == $section.'.add') && $perm_status && ($top_prefix == $event->Prefix)) {
+ // main item, add permission allowed, but ID is > 0, then deny permission
+ // how to get id here
+ }
+ if ($perm_status) {
+ return $perm_status;
+ }
+ }
+
+ if (!$perm_status) {
+ if ($this->Application->isDebugMode()) {
+ // for debugging purposes
+ $event->SetRedirectParam('section', $section);
+ $event->SetRedirectParam('main_prefix', $top_prefix);
+ $event->SetRedirectParam('event_name', $event->Name);
+ $event->SetRedirectParam('next_template', $this->Application->GetVar('t'));
+ }
+ $event->status = erPERM_FAIL;
+ }
+ return $perm_status;
+ }
+
+ /**
+ * Checks non-system permission on event per category basis
+ *
+ * @param kEvent $event
+ */
+ function CheckEventCategoryPermission(&$event, $event_perm_mapping)
+ {
+ // mapping between specific permissions and common permissions
+ $perm_mapping = Array('add' => 'ADD', 'edit' => 'MODIFY', 'delete' => 'DELETE', 'view' => 'VIEW');
+
+ $top_prefix = $event->getEventParam('top_prefix');
+ $event_handler =& $this->Application->recallObject($event->Prefix.'_EventHandler');
+ if ($event->Prefix != $top_prefix) {
+ $top_event = new kEvent($top_prefix.':'.$event->Name);
+ $id = $event_handler->getPassedID($top_event);
+ }
+ else {
+ $id = $event_handler->getPassedID($event);
+ }
+
+ $item_prefix = $this->Application->getUnitOption($top_prefix, 'PermItemPrefix');
+
+ // 1. get primary category of category item
+ $id_field = $this->Application->getUnitOption($top_prefix, 'IDField');
+ $table_name = $this->Application->getUnitOption($top_prefix, 'TableName');
+ $ci_table = $this->Application->getUnitOption($top_prefix.'-ci', 'TableName');
+
+ if (!$id) {
+ // item being created -> check by current (before editing started, saved in OnPreCreate event) category permissions
+ $category_id = $this->Application->RecallVar('m_cat_id');
+ }
+ else {
+ // item being edited -> check by it's primary category permissions
+ $sql = 'SELECT ci.CategoryId
+ FROM '.$table_name.' main_table
+ LEFT JOIN '.$ci_table.' ci ON ci.ItemResourceId = main_table.ResourceId
+ WHERE (main_table.'.$id_field.' = '.$id.') AND (ci.PrimaryCat = 1)';
+ $category_id = $this->Conn->GetOne($sql);
+ }
+
+ if ((substr($event->Name, 0, 9) == 'OnPreSave') || ($event->Name == 'OnSave')) {
+ if ($event_handler->isNewItemCreate($event)) {
+ return $this->CheckPermission($item_prefix.'.ADD', 0, $category_id);
+ }
+ else {
+ return $this->CheckPermission($item_prefix.'.ADD', 0, $category_id) || $this->CheckPermission($item_prefix.'.MODIFY', 0, $category_id);
+ }
+ }
+
+ $perm_status = false;
+ $check_perms = $this->getPermissionByEvent($event, $event_perm_mapping);
+
+ if ($check_perms === true) {
+ // event is defined in mapping but is not checked by permissions
+ return true;
+ }
+
+ foreach ($check_perms as $perm_name) {
+ // check if at least one of required permissions is set
+ if (!isset($perm_mapping[$perm_name])) {
+ // not mapped permission (e.g. advanced:approve) -> skip
+ continue;
+ }
+ $perm_name = $item_prefix.'.'.$perm_mapping[$perm_name];
+ $this->showDebug('Event <b>'.$event->Name.'</b> permission(-s): <b>'.$perm_name.'</b>');
+ $perm_status = $this->CheckPermission($perm_name, 0, $category_id);
+
+ if ($perm_status) {
+ return $perm_status;
+ }
+ }
+
+ if (!$perm_status) {
+ $event->SetRedirectParam('index_file', 'index.php'); // because called from browse.php
+ if ($this->Application->isDebugMode()) {
+ // for debugging purposes
+ $event->SetRedirectParam('section', $event->getSection());
+ $event->SetRedirectParam('main_prefix', $top_prefix);
+ $event->SetRedirectParam('event_name', $event->Name);
+ $event->SetRedirectParam('next_template', $this->Application->GetVar('t'));
+ }
+ $event->status = erPERM_FAIL;
+ }
+ return $perm_status;
+ }
+
+ function showDebug($text)
+ {
+ if (!$this->Application->isDebugMode()) return true;
+ echo $text.'<br />';
+ }
+
+ function TagPermissionCheck($params, $tag_name)
+ {
+ $perm_event = getArrayValue($params, 'perm_event');
+ $permission_groups = getArrayValue($params, 'permissions');
+
+ if ($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) {
+ $permissions = explode(',', $permission_group);
+ $has_permission = true;
+ foreach ($permissions as $permission) {
+ $has_permission = $has_permission && $this->CheckPermission($permission, isset($params['system']) && $params['system'] ? 1 : 0);
+ }
+ $group_has_permission = $group_has_permission || $has_permission;
+
+ if ($group_has_permission) {
+ return true;
+ }
+ }
+ 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) );
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns no permission template to redirect to
+ *
+ * @param Array $params
+ * @return Array
+ */
+ function getPermissionTemplate($params)
+ {
+ $t = $this->Application->GetVar('t');
+ if ($next_t = getArrayValue($params, 'next_template')) {
+ $t = $next_t;
+ }
+
+ if (!$this->Application->LoggedIn()) {
+ $redirect_template = $params['login_template'];
+ $redirect_params = Array('next_template' => $t);
+ }
+ else {
+ if (isset($params['no_permissions_template'])) {
+ $redirect_template = $params['no_permissions_template'];
+ }
+ else {
+ $redirect_template = $this->Application->IsAdmin() ? 'no_permission' : $this->Application->ConfigValue('NoPermissionTemplate');
+ }
+
+ $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);
+ }
+
+ /**
+ * Check current user permissions based on it's group permissions in specified category (for non-system permissions) or just checks if system permission is set
+ *
+ * @param string $name permission name
+ * @param int $cat_id category id, current used if not specified
+ * @param int $type permission type {1 - system, 0 - per category}
+ * @return int
+ */
+ function CheckPermission($name, $type = 1, $cat_id = null)
+ {
+ if ($this->Application->GetVar('u_id') == -1) {
+ // "root" is allowed anywhere
+ return $name == 'SYSTEM_ACCESS.READONLY' ? 0 : 1;
+ }
+
+ if ($type == 1) {
+ // "system" permission are always checked per "Home" category (ID = 0)
+ $cat_id = 0;
+ }
+
+ if (!isset($cat_id)) {
+ $cat_id = $this->Application->GetVar('m_cat_id');
+ }
+
+ $cache_key = $name.'|'.$type.'|'.$cat_id;
+ $perm_value = $this->Application->getCache('permissions', $cache_key);
+ if ($perm_value !== false) {
+ return $perm_value;
+ }
+
+ // perm cache is build only based on records in db, that's why if permission is not explicitly denied, then
+ // that (perm cache creator) code thinks that it is allowed & adds corresponding record and code below will
+ // return incorrect results
+
+ /*if (preg_match('/(.*)\.VIEW$/', $name) && ($type == 0)) {
+ // cached view permission of category: begin
+ $sql = 'SELECT perm_cache.PermId
+ FROM '.TABLE_PREFIX.'PermCache perm_cache
+ LEFT JOIN '.TABLE_PREFIX.'PermissionConfig perm_config ON perm_cache.PermId = perm_config.PermissionConfigId
+ WHERE (perm_config.PermissionName = '.$this->Conn->qstr($name).' AND perm_cache.CategoryId = '.$cat_id.')';
+
+ $view_filters = Array();
+ $groups = explode(',', $this->Application->RecallVar('UserGroups'));
+ foreach ($groups as $group) {
+ $view_filters[] = 'FIND_IN_SET('.$group.', perm_cache.ACL) || ((NOT FIND_IN_SET('.$group.', perm_cache.DACL)) AND perm_cache.ACL = \'\')';
+ }
+ $sql .= ' AND ('.implode(' OR ', $view_filters).')';
+ $perm_value = $this->Conn->GetOne($sql) ? 1 : 0;
+
+ $this->Application->setCache('permissions', $cache_key, $perm_value);
+ return $perm_value;
+ // cached view permission of category: end
+ }*/
+
+ if ($cat_id == 0) {
+ $cat_hierarchy = Array(0);
+ }
+ else {
+ $sql = 'SELECT ParentPath
+ FROM '.$this->Application->getUnitOption('c', 'TableName').'
+ WHERE CategoryId = '.$cat_id;
+ $cat_hierarchy = $this->Conn->GetOne($sql);
+ $cat_hierarchy = explode('|', $cat_hierarchy);
+ array_shift($cat_hierarchy);
+ array_pop($cat_hierarchy);
+ $cat_hierarchy = array_reverse($cat_hierarchy);
+ array_push($cat_hierarchy, 0);
+ }
+
+ $perm_value = 0;
+ $groups = $this->Application->RecallVar('UserGroups');
+ foreach ($cat_hierarchy as $category_id) {
+ $sql = 'SELECT PermissionValue
+ FROM '.TABLE_PREFIX.'Permissions
+ WHERE Permission = "'.$name.'" AND CatId = '.$category_id.' AND GroupId IN ('.$groups.') AND Type = '.$type;
+ $res = $this->Conn->GetOne($sql);
+ if ($res !== false) {
+ $perm_value = $res;
+ break;
+ }
+ }
+
+ $this->Application->setCache('permissions', $cache_key, $perm_value);
+ return $perm_value;
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/units/general/helpers/permissions_helper.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/kernel/units/general/inp_db_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/units/general/inp_db_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/units/general/inp_db_event_handler.php (revision 4944)
@@ -0,0 +1,124 @@
+<?php
+
+ class InpDBEventHandler extends kDBEventHandler
+ {
+
+ function mapEvents()
+ {
+ parent::mapEvents();
+ $common_events = Array( 'OnMassApprove'=>'iterateItems',
+ 'OnMassDecline'=>'iterateItems',
+ 'OnMassMoveUp'=>'iterateItems',
+ 'OnMassMoveDown'=>'iterateItems',
+ );
+
+ $this->eventMethods = array_merge($this->eventMethods, $common_events);
+ }
+
+ /**
+ * Apply same processing to each item beeing selected in grid
+ *
+ * @param kEvent $event
+ * @access private
+ */
+ function iterateItems(&$event)
+ {
+ if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
+ return;
+ }
+
+ $this->Application->setUnitOption($event->Prefix,'AutoLoad',false);
+ $object =& $event->getObject();
+ $this->StoreSelectedIDs($event);
+ $ids=$this->getSelectedIDs($event);
+
+ if($ids)
+ {
+ $status_field = array_shift( $this->Application->getUnitOption($event->Prefix,'StatusField') );
+
+ foreach($ids as $id)
+ {
+ $object->Load($id);
+
+ switch ($event->Name)
+ {
+ case 'OnMassApprove':
+ $object->SetDBField($status_field, 1);
+ break;
+
+ case 'OnMassDecline':
+ $object->SetDBField($status_field, 0);
+ break;
+
+ case 'OnMassMoveUp':
+ $object->SetDBField('Priority', $object->GetDBField('Priority') + 1);
+ break;
+
+ case 'OnMassMoveDown':
+ $object->SetDBField('Priority', $object->GetDBField('Priority') - 1);
+ break;
+ }
+
+ if( $object->Update() )
+ {
+ $event->status=erSUCCESS;
+ $event->redirect_params = Array('opener' => 's', 'pass_events' => true); //stay!
+ }
+ else
+ {
+ $event->status=erFAIL;
+ $event->redirect=false;
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnMassClone(&$event)
+ {
+ if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
+ return;
+ }
+
+ $event->status=erSUCCESS;
+
+ $temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
+
+ $this->StoreSelectedIDs($event);
+ $ids=$this->getSelectedIDs($event);
+
+ if($ids)
+ {
+ $temp->CloneItems($event->Prefix, $event->Special, $ids);
+ }
+ }
+
+ function check_array($records, $field, $value)
+ {
+ foreach ($records as $record)
+ {
+ if ($record[$field] == $value)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ function OnPreSavePopup(&$event)
+ {
+ $object =& $event->getObject();
+ $this->RemoveRequiredFields($object);
+ $event->CallSubEvent('OnPreSave');
+
+ $this->finalizePopup($event);
+ }
+ }
+
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/units/general/inp_db_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/groups/groups_edit_permissions.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/groups/groups_edit_permissions.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/groups/groups_edit_permissions.tpl (revision 4944)
@@ -0,0 +1,147 @@
+<inp2:m_RequireLogin permissions="in-portal:user_groups.view" system="1"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+
+<inp2:m_ParseBlock name="section_header" prefix="g" icon="icon46_usergroups" module="in-portal" title="!la_title_Groups!"/>
+
+<inp2:m_include t="groups/groups_edit_tabs"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="g" title_preset="groups_edit_permissions" module="in-portal" icon="icon46_usergroups"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+ <tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
+ submit_event('g','<inp2:g_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ submit_event('g','OnCancelEdit');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
+ go_to_id('g', '<inp2:g_PrevId/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+ go_to_id('g', '<inp2:g_NextId/>');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ <inp2:m_if prefix="g" function="IsSingle"/>
+ a_toolbar.HideButton('prev');
+ a_toolbar.HideButton('next');
+ a_toolbar.HideButton('sep1');
+ //a_toolbar.HideButton('sep2');
+ <inp2:m_else/>
+ <inp2:m_if prefix="g" function="IsLast"/>
+ a_toolbar.DisableButton('next');
+ <inp2:m_endif/>
+ <inp2:m_if prefix="g" function="IsFirst"/>
+ a_toolbar.DisableButton('prev');
+ <inp2:m_endif/>
+ <inp2:m_endif/>
+ </script>
+
+ </td>
+ </tr>
+ </tbody>
+</table>
+
+<inp2:g_SaveWarning name="grid_save_warning"/>
+
+<inp2:m_DefineElement name="permission_element" prefix="g-perm" onclick="">
+ <td>
+ <inp2:$prefix_HasPermission perm_name="$perm_name" section_name="$section_name">
+ <input type="hidden" id="<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" name="<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" value="<inp2:$prefix_PermissionValue section_name="$section_name" perm_name="$perm_name"/>">
+ <input type="checkbox" align="absmiddle" id="_cb_<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" name="_cb_<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" <inp2:m_if check="{$prefix}_PermissionValue" section_name="$section_name" perm_name="$perm_name" value="1">checked</inp2:m_if> onchange="update_checkbox(this, document.getElementById('<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]'));" onclick="<inp2:m_param name="onclick"/>">
+ <inp2:m_else/>
+ &nbsp;
+ </inp2:m_if>
+ </td>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="tree_element">
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <td>
+ <img src="img/spacer.gif" height="1" width="<inp2:g-perm_LevelIndicator level="$deep_level" multiply="20"/>" alt="" border="0"/>
+
+ <img src="<inp2:$SectionPrefix_ModulePath/>img/icons/icon24_<inp2:m_param name="icon"/>.gif" border="0" alt="" title="" align="absmiddle"/>
+ <inp2:m_if check="m_ParamEquals" name="children_count" value="0">
+ <inp2:m_phrase name="$label"/>
+ <inp2:m_else/>
+ <inp2:m_if check="m_ParamEquals" name="section_name" value="in-portal:root">
+ <b><inp2:m_param name="label"/></b>
+ <inp2:m_else/>
+ <b><inp2:m_phrase name="$label"/></b>
+ </inp2:m_if>
+ </inp2:m_if>
+
+ <inp2:m_if check="m_IsDebugMode">
+ <br />
+ <img src="img/spacer.gif" height="1" width="<inp2:g-perm_LevelIndicator level="$deep_level" multiply="20"/>" alt="" border="0"/>
+ <span class="small">[<inp2:m_param name="section_name"/>, <b><inp2:m_param name="SectionPrefix"/></b>]</span>
+ </inp2:m_if>
+ </td>
+
+ <inp2:m_RenderElement name="permission_element" section_name="$section_name" perm_name="view" onclick="update_perm_checkboxes(this);"/>
+ <inp2:m_RenderElement name="permission_element" section_name="$section_name" perm_name="add"/>
+ <inp2:m_RenderElement name="permission_element" section_name="$section_name" perm_name="edit"/>
+ <inp2:m_RenderElement name="permission_element" section_name="$section_name" perm_name="delete"/>
+ <td>
+ <inp2:m_if check="g-perm_HasAdvancedPermissions" section_name="$section_name">
+ <a href="javascript:openSelector('g-perm', '<inp2:m_t t="groups/permissions_selector" pass="all,g-perm" section_name="$section_name" escape="1"/>', 'PermList', null, 'OnSavePermissions');"><inp2:m_phrase name="la_btn_Change"/></a>
+ <inp2:m_else/>
+ &nbsp;
+ </inp2:m_if>
+ </td>
+ </tr>
+</inp2:m_DefineElement>
+
+<inp2:g-perm_LoadPermissions/>
+
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <inp2:m_set {$PrefixSpecial}_sequence="1" odd_even="table_color1"/>
+
+ <tr class="subsectiontitle">
+ <td><inp2:m_phrase label="la_col_PermissionName"/></td>
+ <td><inp2:m_phrase label="la_col_PermView"/></td>
+ <td><inp2:m_phrase label="la_col_PermAdd"/></td>
+ <td><inp2:m_phrase label="la_col_PermEdit"/></td>
+ <td><inp2:m_phrase label="la_col_PermDelete"/></td>
+ <td><inp2:m_phrase label="la_col_AdditionalPermissions"/></td>
+ </tr>
+
+ <inp2:adm_DrawTree render_as="tree_element" section_name="in-portal:root"/>
+</table>
+
+
+<script type="text/javascript">
+ function update_perm_checkboxes($source_perm)
+ {
+ var $permissions = ['add', 'edit', 'delete'];
+ var $rets = $source_perm.id.match(/_cb_g-perm\[(.*)\]\[(.*)\]/);
+ var $test_perm = '';
+ var $i = 0;
+ while($i < $permissions.length) {
+ $test_perm = '_cb_g-perm[' + $rets[1] + '][' + $permissions[$i] + ']';
+ $test_perm = document.getElementById($test_perm);
+ if ($test_perm) {
+ $test_perm.checked = $source_perm.checked;
+ update_checkbox($test_perm, document.getElementById('g-perm[' + $rets[1] + '][' + $permissions[$i] + ']'));
+ }
+ $i++;
+ }
+ }
+</script>
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/groups/groups_edit_permissions.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/regional/languages_export.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/regional/languages_export.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/regional/languages_export.tpl (revision 4944)
@@ -0,0 +1,49 @@
+<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:m_ParseBlock name="section_header" icon="icon46_conf_regional" title="!la_title_ExportLanguagePack!"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="lang" title_preset="export_language" module="in-portal" icon="icon46_conf_regional"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
+ submit_event('lang','OnExportProgress');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ submit_event('lang', 'OnGoBack');
+ }
+ ) );
+
+ a_toolbar.Render();
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <inp2:m_ParseBlock name="subsection" title="!la_section_General!"/>
+
+
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_ParseBlock name="inp_edit_field_caption" prefix="phrases.export" field="LangFile" title="la_fld_ExportFileName"/>
+ <td>
+ <inp2:lang_ExportPath/> <input type="text" name="<inp2:phrases.export_InputName field="LangFile"/>" id="<inp2:phrases.export_InputName field="LangFile"/>" value="<inp2:phrases.export_Field field="LangFile"/>" />
+ </td>
+ <td class="error"><inp2:phrases.export_Error field="LangFile"/>&nbsp;</td>
+ </tr>
+
+ <inp2:m_ParseBlock name="inp_edit_checkboxes" use_phrases="1" prefix="phrases.export" field="PhraseType" title="!la_fld_ExportPhraseTypes!"/>
+ <inp2:m_ParseBlock name="inp_edit_checkboxes" no_empty="no_empty" prefix="phrases.export" field="Module" title="!la_fld_ExportModules!"/>
+ <inp2:m_ParseBlock name="inp_edit_checkbox" prefix="phrases.export" field="DoNotEncode" title="!la_fld_DoNotEncode!"/>
+</table>
+
+<inp2:m_include t="incs/footer"/>
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/regional/languages_export.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/sections_list.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/sections_list.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/sections_list.tpl (revision 4944)
@@ -0,0 +1,56 @@
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<link rel="stylesheet" rev="stylesheet" href="incs/sections_list.css" type="text/css" />
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+
+<inp2:m_DefineElement name="section_list_header">
+ <!-- section header -->
+ <table cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tr style="background: url(<inp2:$SectionPrefix_ModulePath module="#session#"/>img/logo_bg.gif) no-repeat top right;">
+ <td valign="top" class="admintitle" align="left" style="padding-top: 2px; padding-bottom: 2px;">
+ <inp2:m_if check="m_RecallEquals" name="section" value="in-portal:root">
+ <img width="46" height="46" src="<inp2:$SectionPrefix_ModulePath/>img/icons/<inp2:adm_GetSectionIcon icon="icon46_{$icon}"/>.gif" align="absmiddle" title="<inp2:adm_GetSectionTitle phrase="$label" default="$label"/>">&nbsp;<inp2:adm_GetSectionTitle phrase="$label" default="$label"/>
+ <inp2:m_else/>
+ <img width="46" height="46" src="<inp2:$SectionPrefix_ModulePath/>img/icons/<inp2:adm_GetSectionIcon icon="icon46_{$icon}"/>.gif" align="absmiddle" title="<inp2:adm_GetSectionTitle phrase="$label"/>">&nbsp;<inp2:adm_GetSectionTitle phrase="$label"/>
+ </inp2:m_if>
+ </td>
+ </tr>
+ </table>
+
+ <inp2:m_ParseBlock name="blue_bar" prefix="$SectionPrefix" title_preset="tree_#section#" icon="icon46_{$icon}"/>
+</inp2:m_DefineElement>
+
+<inp2:adm_PrintSection section_name="#session#" render_as="section_list_header"/>
+
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td valign="top">
+ <table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <inp2:m_DefineElement name="section_element">
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <td class="subitem_icon">
+ <img src="<inp2:$SectionPrefix_ModulePath/>img/icons/icon46_list_<inp2:m_param name="icon"/>.gif" border="0" alt="<inp2:m_phrase name="$label"/>" align="absmiddle"/>
+ </td>
+ <td class="subitem_description">
+ <a href="<inp2:m_param name="section_url"/>" class="dLink" title="<inp2:m_phrase name="$label"/>" target="main"><inp2:m_phrase name="$label"/></a>
+ <inp2:m_if check="m_ParamEquals" name="is_tab" value="1">
+ <inp2:m_phrase name="la_Description_{$parent}"/>
+ <inp2:m_else/>
+ <inp2:m_phrase name="la_Description_{$section_name}"/>
+ </inp2:m_if>
+ </td>
+ </tr>
+ </inp2:m_DefineElement>
+
+ <inp2:m_set odd_even="table_color1"/>
+ <inp2:adm_PrintSections block="section_element" section_name="#session#"/>
+ </table>
+ </td>
+
+ <td valign="top">
+ <inp2:adm_ModuleInclude template="summary/#section#"/>
+ </td>
+ </tr>
+</table>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/sections_list.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/units/groups/groups_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/units/groups/groups_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/units/groups/groups_config.php (revision 4944)
@@ -0,0 +1,119 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'g',
+
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'GroupsEventHandler', 'file' => 'groups_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'kDBTagProcessor', 'file' => '','build_event'=>'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'GroupId',
+
+ 'StatusField' => Array('Enabled'),
+
+ 'TitleField' => 'Name',
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('g' => '!la_title_Adding_Group!'),
+ 'edit_status_labels' => Array('g' => '!la_title_Editing_Group!'),
+ 'new_titlefield' => Array('g' => '!la_title_New_Group!'),
+ ),
+
+ 'groups_list' => Array('prefixes' => Array('g_List'), 'format' => "!la_title_Groups! (#g_recordcount#)"),
+
+ 'groups_edit' => Array('prefixes' => Array('g'), 'format' => "#g_status# '#g_titlefield#' - !la_title_General!"),
+
+ 'groups_edit_users' => Array('prefixes' => Array('g', 'g-ug_List'), 'format' => "#g_status# '#g_titlefield#' - !la_title_Users! (#g-ug_recordcount#)" ),
+
+ 'groups_edit_permissions' => Array('prefixes' => Array('g'), 'format' => "#g_status# '#g_titlefield#' - !la_title_Permissions!" ),
+
+ 'groups_edit_additional_permissions' => Array('prefixes' => Array('g'), 'format' => "#g_status# '#g_titlefield#' - !la_title_AdditionalPermissions!" ),
+
+ 'groups_select' => Array('prefixes' => Array('g_List'), 'format' => "!la_title_Groups! (#g_recordcount#) - !la_title_SelectGroup!"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-portal:user_groups'),
+
+ 'Sections' => Array(
+ 'in-portal:user_groups' => Array(
+ 'parent' => 'in-portal:users',
+ 'icon' => 'usergroups',
+ 'label' => 'la_tab_User_Groups',
+ 'url' => Array('t' => 'groups/groups_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:send_email'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'PortalGroup',
+
+ 'ListSQLs' => Array('' => ' SELECT %1$s.* %2$s FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON ug.GroupId = %1$s.GroupId'),
+
+ 'ItemSQLs' => Array('' => ' SELECT %1$s.* %2$s FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON ug.GroupId = %1$s.GroupId'),
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'Sorting' => Array('Name' => 'asc'),
+ )
+ ),
+
+ 'SubItems' => Array('g-perm', /*'g-ug'*/),
+ 'CalculatedFields' => Array(
+ 'total' => Array(
+ 'UserCount' => 'COUNT(ug.PortalUserId)',
+ ),
+ ),
+
+ 'Fields' => Array (
+ 'GroupId' => Array(),
+ 'Name' => Array('type' => 'string', 'not_null' => '1', 'required' => 1, 'default' => ''),
+ 'Description' => Array('type' => 'string','default' => ''),
+ 'CreatedOn' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'not_null' => '1','default' => '#NOW#'),
+ 'System' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'Personal' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'Enabled' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Enabled', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => '1','default' => 1),
+ 'ResourceId' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ ),
+
+ 'VirtualFields' => Array(
+ 'UserCount' => Array('type' => 'int', 'default' => 0),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array(1 => 'icon16_group.gif', 0 => 'icon16_group_disabled.gif'),
+ 'Fields' => Array(
+ 'Name' => Array('title' => 'la_col_GroupName', 'data_block' => 'grid_checkbox_td'),
+ 'UserCount' => Array('title' => 'la_col_UserCount'),
+ ),
+ ),
+
+ /*'GroupSelector' => Array(
+ 'Icons' => Array(0 => 'icon16_user_disabled.gif', 1 => 'icon16_user.gif', 2 => 'icon16_user_pending.gif'),
+ 'Fields' => Array(
+ 'Login' => Array('title' => 'la_col_Username', 'data_block' => 'grid_radio_td'),
+ 'LastName' => Array( 'title'=>'la_col_LastName'),
+ 'FirstName' => Array( 'title'=>'la_col_FirstName'),
+ 'Email' => Array( 'title'=>'la_col_Email'),
+ 'PrimaryGroup' => Array( 'title'=>'la_col_PrimaryGroup'),
+ 'CreatedOn_formatted' => Array('title' => 'la_col_CreatedOn', 'sort_field' => 'CreatedOn'),
+ ),
+ ),*/
+ ),
+
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/units/groups/groups_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/units/phrases/phrases_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/units/phrases/phrases_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/units/phrases/phrases_config.php (revision 4944)
@@ -0,0 +1,129 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'phrases',
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'PhrasesEventHandler','file'=>'phrases_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hBEFORE,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'phrases',
+ 'HookToSpecial' => '',
+ 'HookToEvent' => Array('OnCreate'),
+ 'DoPrefix' => 'phrases',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnBeforePhraseCreate',
+ ),
+
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'phrases',
+ 'HookToSpecial' => '',
+ 'HookToEvent' => Array('OnBeforeItemCreate','OnBeforeItemUpdate'),
+ 'DoPrefix' => 'phrases',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnSetLastUpdated',
+ ),
+ ),
+
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'label',
+ ),
+ 'IDField' => 'PhraseId',
+
+ 'TitleField' => 'Phrase',
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('phrases'=>'!la_title_Adding_Phrase!'),
+ 'edit_status_labels' => Array('phrases'=>'!la_title_Editing_Phrase!'),
+ 'new_titlefield' => Array('phrases'=>'!la_title_New_Phrase!'),
+ ),
+
+ 'phrase_edit' => Array('prefixes' => Array('phrases'), 'format' => '#phrases_status# - #phrases_titlefield#'),
+
+ ),
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_front','show_admin','show_both'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_front' => Array('label' =>'la_PhraseType_Front', 'on_sql' => '', 'off_sql' => '%1$s.PhraseType != 0' ),
+ 'show_admin' => Array('label' => 'la_PhraseType_Admin', 'on_sql' => '', 'off_sql' => '%1$s.PhraseType != 1' ),
+ 'show_both' => Array('label' => 'la_PhraseType_Both', 'on_sql' => '', 'off_sql' => '%1$s.PhraseType != 2' ),
+ )
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Phrase',
+
+ 'CalculatedFields' => Array(
+ '' => Array(
+ 'PrimaryTranslation' => 'pri.Translation',
+ ),
+
+ ),
+
+ 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'Phrase pri ON (%1$s.Phrase = pri.Phrase) AND (pri.LanguageId = 1)'),
+
+ 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'Phrase pri ON (%1$s.Phrase = pri.Phrase) AND (pri.LanguageId = 1)',),
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'Sorting' => Array('Phrase' => 'asc'),
+ )
+ ),
+
+ 'ForeignKey' => 'LanguageId',
+ 'ParentTableKey' => 'LanguageId',
+ 'ParentPrefix' => 'lang',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'Fields' => Array(
+ 'Phrase' => Array('type' => 'string','required'=>1,'unique'=>Array('LanguageId'),'not_null' => '1','default' => ''),
+ 'Translation' => Array('type' => 'string','required'=>1,'not_null' => '1','default' => ''),
+ 'PhraseType' => Array('type' => 'int','required'=>1,'formatter'=>'kOptionsFormatter','options'=>Array(0=>'la_PhraseType_Front',1=>'la_PhraseType_Admin',2=>'la_PhraseType_Both'), 'use_phrases' => 1, 'not_null' => '1','default' => '0'),
+ 'PhraseId' => Array('type' => 'int','not_null' => '1','default' => ''),
+ 'LanguageId' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'LastChanged' => Array('type' => 'int', 'formatter'=>'kDateFormatter', 'not_null' => '1','default' => '0'),
+ 'LastChangeIP' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Module' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>''), 'options_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Modules WHERE Loaded = 1 ORDER BY LoadOrder', 'option_key_field'=>'Name', 'option_title_field'=>'Name', 'not_null' => '1','default' => 'In-Portal'),
+ ),
+
+ 'VirtualFields' => Array(
+ 'PrimaryTranslation' => Array(),
+ 'LangFile' => Array(),
+ 'ImportOverwrite' => Array(),
+ 'DoNotEncode' => Array(),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_language_var.gif'),
+ 'Fields' => Array(
+ 'Phrase' => Array( 'title'=>'la_col_Label', 'data_block' => 'grid_checkbox_td'),
+ 'Translation' => Array( 'title'=>'la_col_Translation' ),
+ 'PrimaryTranslation' => Array( 'title'=>'la_col_PrimaryValue' ),
+ 'PhraseType' => Array( 'title'=>'la_col_PhraseType' ),
+ 'LastChanged' => Array( 'title'=>'la_col_LastChanged' ),
+ 'Module' => Array( 'title'=>'la_col_Module' ),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/units/phrases/phrases_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/units/config_search/config_search_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/units/config_search/config_search_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/units/config_search/config_search_config.php (revision 4944)
@@ -0,0 +1,115 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'confs',
+
+ 'Clones' => Array(
+ 'confs-cf' => Array(
+ 'Prefix' => 'confs-cf',
+ 'ParentPrefix' => 'cf',
+ 'ParentTableKey' => 'CustomFieldId', // linked field in master table
+ 'ForeignKey' => 'CustomFieldId', // linked field in subtable
+ 'AutoClone' => false, // because OnCreateCustomField hook does the stuff
+ 'AutoDelete' => true,
+
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => '#PARENT#',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnAfterItemCreate', 'OnAfterItemUpdate'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '*',
+ 'DoEvent' => 'OnCreateCustomField',
+ ),
+ ),
+ ),
+ ),
+
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'ConfigSearchEventHandler','file'=>'config_search_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'ConfigSearchTagProcessor','file'=>'config_search_tag_processor.php','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+ 'hooks' => Array(),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ ),
+
+ 'IDField' => 'SearchConfigId',
+
+ 'TitleField' => 'FieldName',
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('confs'=>'!la_title_Adding_ConfigSearch!'),
+ 'edit_status_labels' => Array('confs'=>'!la_title_Editing_ConfigSearch!'),
+ 'new_titlefield' => Array('confs'=>'!la_title_New_ConfigSearch!'),
+ ),
+
+ 'configsearch_edit' => Array('prefixes' => Array('confs'), 'format' => "#confs_status# '#confs_titlefield#' - !la_title_General!"),
+ 'config_list_search' => Array('prefixes' => Array('confs_List'), 'tag_params' => Array('confs' => Array('per_page' => -1) ), 'format' => "!la_updating_config!"),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'SearchConfig',
+
+ 'CalculatedFields' => Array(
+ '' => Array(
+ 'IsCustom' => 'IF(CustomFieldId IS NULL, 0, 1)',
+ ),
+ ),
+
+ 'ListSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s'),
+
+ 'ItemSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s'),
+
+
+
+ 'Fields' => Array(
+ 'TableName' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
+ 'FieldName' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
+ 'SimpleSearch' => Array('type' => 'int','not_null' => '1','default' => '1'),
+ 'AdvancedSearch' => Array('type' => 'int','not_null' => '1','default' => '1'),
+ 'Description' => Array('type' => 'string','default' => ''),
+ 'DisplayName' => Array('type' => 'string', 'required' => 1, 'default' => ''),
+ 'ModuleName' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>''), 'options_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Modules WHERE Loaded = 1 ORDER BY LoadOrder', 'option_key_field'=>'Name', 'option_title_field'=>'Name', 'not_null' => '1','default' => 'In-Portal'),
+ 'ConfigHeader' => Array('type' => 'string', 'required' => 1, 'default' => ''),
+ 'DisplayOrder' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'SearchConfigId' => Array('type' => 'int','not_null' => '1','default' => ''),
+ 'Priority' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'FieldType' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('text' => 'text', 'range' => 'range', 'boolean' => 'boolean', 'date' => 'date'), 'not_null' => '1', 'required' => 1, 'default' => 'text'),
+ 'ForeignField' => Array('type' => 'string','default' => null),
+ 'JoinClause' => Array('type' => 'string','default' => null),
+ 'IsWhere' => Array('type' => 'string','default' => null),
+ 'IsNotWhere' => Array('type' => 'string','default' => null),
+ 'ContainsWhere' => Array('type' => 'string','default' => null),
+ 'NotContainsWhere' => Array('type' => 'string','default' => null),
+ 'CustomFieldId' => Array('type' => 'int', 'default' => null),
+ ),
+
+ 'VirtualFields' => Array(
+ 'IsCustom' => Array('type' => 'int', 'default' => 0),
+ ),
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('IsCustom' => 'asc'),
+ 'Sorting' => Array('DisplayOrder' => 'asc'),
+ )
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif'), // icons for each StatusField values, if no matches or no statusfield selected, then "default" icon is used
+ 'Fields' => Array(
+ 'TableName' => Array( 'title'=>'la_col_TableName', 'data_block' => 'grid_data_td'),
+ 'FieldName' => Array( 'title'=>'la_col_FieldName', 'data_block' => 'grid_data_td' ),
+ 'SimpleSearch' => Array( 'title'=>'la_col_SimpleSearch', 'data_block' => 'grid_data_td'),
+ ),
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/units/config_search/config_search_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/permissions_helper.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/permissions_helper.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/permissions_helper.php (revision 4944)
@@ -0,0 +1,368 @@
+<?php
+
+ class kPermissionsHelper extends kHelper {
+
+ /**
+ * Current set of permissions for group being edited
+ *
+ * @var Array
+ */
+ var $Permissions = Array();
+
+ function LoadPermissions($prefix)
+ {
+ $object =& $this->Application->recallObject($prefix.'-perm', null, Array('skip_autoload' => true));
+
+ $foreign_key = $this->Application->getUnitOption($prefix.'-perm', 'ForeignKey');
+ $foreign_value = $this->Application->GetVar($prefix.'_id');
+ $sql = 'SELECT *
+ FROM '.$object->TableName.'
+ WHERE '.$foreign_key.' = '.$foreign_value;
+ $permissions = $this->Conn->Query($sql, 'Permission');
+
+ $this->Permissions = Array();
+ foreach ($permissions as $perm_name => $perm_options) {
+ $perm_record['value'] = $perm_options['PermissionValue'];
+ $perm_record['id'] = $perm_options['PermissionId'];
+ $this->Permissions[$perm_name] = $perm_record;
+ }
+ }
+
+ function getPermissionValue($perm_name)
+ {
+ return getArrayValue($this->Permissions, $perm_name) ? $this->Permissions[$perm_name]['value'] : 0;
+ }
+
+ function getPermissionID($perm_name)
+ {
+ return getArrayValue($this->Permissions, $perm_name) ? $this->Permissions[$perm_name]['id'] : 0;
+ }
+
+ /**
+ * This is old permission like ADMIN or LOGIN
+ *
+ * @param string $section_name
+ * @param string $perm_name
+ * @return bool
+ */
+ function isOldPermission($section_name, $perm_name)
+ {
+ return $section_name == 'in-portal:root' && $perm_name != 'view';
+ }
+
+ /**
+ * Returns permission names to check based on event name and item prefix (main item or subitem)
+ *
+ * @param kEvent $event
+ * @return Array
+ */
+ function getPermissionByEvent(&$event, $perm_mapping)
+ {
+ $top_prefix = $event->getEventParam('top_prefix');
+
+ $pefix_type = ($top_prefix == $event->Prefix) ? 'self' : 'subitem';
+ $perm_mapping = getArrayValue($perm_mapping, $event->Name);
+
+ if (!$perm_mapping[$pefix_type]) {
+ trigger_error('Permission mappings not defined for event <b>'.$top_prefix.' <- '.$event->Prefix.':'.$event->Name.'</b>', E_USER_ERROR);
+ }
+
+ if ($perm_mapping[$pefix_type] === true) {
+ // event is defined in mapping but is not checked by permissions
+ return true;
+ }
+
+ return explode('|', $perm_mapping[$pefix_type]);
+ }
+
+ /**
+ * Common event permission checking method
+ *
+ * @param kEvent $event
+ */
+ function CheckEventPermission(&$event, $perm_mapping)
+ {
+ $section = $event->getSection();
+ if (preg_match('/^CATEGORY:(.*)/', $section)) {
+ return $this->CheckEventCategoryPermission($event, $perm_mapping);
+ }
+
+ $top_prefix = $event->getEventParam('top_prefix');
+ $check_perms = $this->getPermissionByEvent($event, $perm_mapping);
+
+ if ($check_perms === true) {
+ // event is defined in mapping but is not checked by permissions
+ return true;
+ }
+
+ $perm_status = false;
+ foreach ($check_perms as $perm_name) {
+ // check if at least one of required permissions is set
+ $perm_name = $section.'.'.$perm_name;
+ $perm_status = $this->CheckPermission($perm_name, 1);
+ if (($perm_name == $section.'.add') && $perm_status && ($top_prefix == $event->Prefix)) {
+ // main item, add permission allowed, but ID is > 0, then deny permission
+ // how to get id here
+ }
+ if ($perm_status) {
+ return $perm_status;
+ }
+ }
+
+ if (!$perm_status) {
+ if ($this->Application->isDebugMode()) {
+ // for debugging purposes
+ $event->SetRedirectParam('section', $section);
+ $event->SetRedirectParam('main_prefix', $top_prefix);
+ $event->SetRedirectParam('event_name', $event->Name);
+ $event->SetRedirectParam('next_template', $this->Application->GetVar('t'));
+ }
+ $event->status = erPERM_FAIL;
+ }
+ return $perm_status;
+ }
+
+ /**
+ * Checks non-system permission on event per category basis
+ *
+ * @param kEvent $event
+ */
+ function CheckEventCategoryPermission(&$event, $event_perm_mapping)
+ {
+ // mapping between specific permissions and common permissions
+ $perm_mapping = Array('add' => 'ADD', 'edit' => 'MODIFY', 'delete' => 'DELETE', 'view' => 'VIEW');
+
+ $top_prefix = $event->getEventParam('top_prefix');
+ $event_handler =& $this->Application->recallObject($event->Prefix.'_EventHandler');
+ if ($event->Prefix != $top_prefix) {
+ $top_event = new kEvent($top_prefix.':'.$event->Name);
+ $id = $event_handler->getPassedID($top_event);
+ }
+ else {
+ $id = $event_handler->getPassedID($event);
+ }
+
+ $item_prefix = $this->Application->getUnitOption($top_prefix, 'PermItemPrefix');
+
+ // 1. get primary category of category item
+ $id_field = $this->Application->getUnitOption($top_prefix, 'IDField');
+ $table_name = $this->Application->getUnitOption($top_prefix, 'TableName');
+ $ci_table = $this->Application->getUnitOption($top_prefix.'-ci', 'TableName');
+
+ if (!$id) {
+ // item being created -> check by current (before editing started, saved in OnPreCreate event) category permissions
+ $category_id = $this->Application->RecallVar('m_cat_id');
+ }
+ else {
+ // item being edited -> check by it's primary category permissions
+ $sql = 'SELECT ci.CategoryId
+ FROM '.$table_name.' main_table
+ LEFT JOIN '.$ci_table.' ci ON ci.ItemResourceId = main_table.ResourceId
+ WHERE (main_table.'.$id_field.' = '.$id.') AND (ci.PrimaryCat = 1)';
+ $category_id = $this->Conn->GetOne($sql);
+ }
+
+ if ((substr($event->Name, 0, 9) == 'OnPreSave') || ($event->Name == 'OnSave')) {
+ if ($event_handler->isNewItemCreate($event)) {
+ return $this->CheckPermission($item_prefix.'.ADD', 0, $category_id);
+ }
+ else {
+ return $this->CheckPermission($item_prefix.'.ADD', 0, $category_id) || $this->CheckPermission($item_prefix.'.MODIFY', 0, $category_id);
+ }
+ }
+
+ $perm_status = false;
+ $check_perms = $this->getPermissionByEvent($event, $event_perm_mapping);
+
+ if ($check_perms === true) {
+ // event is defined in mapping but is not checked by permissions
+ return true;
+ }
+
+ foreach ($check_perms as $perm_name) {
+ // check if at least one of required permissions is set
+ if (!isset($perm_mapping[$perm_name])) {
+ // not mapped permission (e.g. advanced:approve) -> skip
+ continue;
+ }
+ $perm_name = $item_prefix.'.'.$perm_mapping[$perm_name];
+ $this->showDebug('Event <b>'.$event->Name.'</b> permission(-s): <b>'.$perm_name.'</b>');
+ $perm_status = $this->CheckPermission($perm_name, 0, $category_id);
+
+ if ($perm_status) {
+ return $perm_status;
+ }
+ }
+
+ if (!$perm_status) {
+ $event->SetRedirectParam('index_file', 'index.php'); // because called from browse.php
+ if ($this->Application->isDebugMode()) {
+ // for debugging purposes
+ $event->SetRedirectParam('section', $event->getSection());
+ $event->SetRedirectParam('main_prefix', $top_prefix);
+ $event->SetRedirectParam('event_name', $event->Name);
+ $event->SetRedirectParam('next_template', $this->Application->GetVar('t'));
+ }
+ $event->status = erPERM_FAIL;
+ }
+ return $perm_status;
+ }
+
+ function showDebug($text)
+ {
+ if (!$this->Application->isDebugMode()) return true;
+ echo $text.'<br />';
+ }
+
+ function TagPermissionCheck($params, $tag_name)
+ {
+ $perm_event = getArrayValue($params, 'perm_event');
+ $permission_groups = getArrayValue($params, 'permissions');
+
+ if ($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) {
+ $permissions = explode(',', $permission_group);
+ $has_permission = true;
+ foreach ($permissions as $permission) {
+ $has_permission = $has_permission && $this->CheckPermission($permission, isset($params['system']) && $params['system'] ? 1 : 0);
+ }
+ $group_has_permission = $group_has_permission || $has_permission;
+
+ if ($group_has_permission) {
+ return true;
+ }
+ }
+ 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) );
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns no permission template to redirect to
+ *
+ * @param Array $params
+ * @return Array
+ */
+ function getPermissionTemplate($params)
+ {
+ $t = $this->Application->GetVar('t');
+ if ($next_t = getArrayValue($params, 'next_template')) {
+ $t = $next_t;
+ }
+
+ if (!$this->Application->LoggedIn()) {
+ $redirect_template = $params['login_template'];
+ $redirect_params = Array('next_template' => $t);
+ }
+ else {
+ if (isset($params['no_permissions_template'])) {
+ $redirect_template = $params['no_permissions_template'];
+ }
+ else {
+ $redirect_template = $this->Application->IsAdmin() ? 'no_permission' : $this->Application->ConfigValue('NoPermissionTemplate');
+ }
+
+ $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);
+ }
+
+ /**
+ * Check current user permissions based on it's group permissions in specified category (for non-system permissions) or just checks if system permission is set
+ *
+ * @param string $name permission name
+ * @param int $cat_id category id, current used if not specified
+ * @param int $type permission type {1 - system, 0 - per category}
+ * @return int
+ */
+ function CheckPermission($name, $type = 1, $cat_id = null)
+ {
+ if ($this->Application->GetVar('u_id') == -1) {
+ // "root" is allowed anywhere
+ return $name == 'SYSTEM_ACCESS.READONLY' ? 0 : 1;
+ }
+
+ if ($type == 1) {
+ // "system" permission are always checked per "Home" category (ID = 0)
+ $cat_id = 0;
+ }
+
+ if (!isset($cat_id)) {
+ $cat_id = $this->Application->GetVar('m_cat_id');
+ }
+
+ $cache_key = $name.'|'.$type.'|'.$cat_id;
+ $perm_value = $this->Application->getCache('permissions', $cache_key);
+ if ($perm_value !== false) {
+ return $perm_value;
+ }
+
+ // perm cache is build only based on records in db, that's why if permission is not explicitly denied, then
+ // that (perm cache creator) code thinks that it is allowed & adds corresponding record and code below will
+ // return incorrect results
+
+ /*if (preg_match('/(.*)\.VIEW$/', $name) && ($type == 0)) {
+ // cached view permission of category: begin
+ $sql = 'SELECT perm_cache.PermId
+ FROM '.TABLE_PREFIX.'PermCache perm_cache
+ LEFT JOIN '.TABLE_PREFIX.'PermissionConfig perm_config ON perm_cache.PermId = perm_config.PermissionConfigId
+ WHERE (perm_config.PermissionName = '.$this->Conn->qstr($name).' AND perm_cache.CategoryId = '.$cat_id.')';
+
+ $view_filters = Array();
+ $groups = explode(',', $this->Application->RecallVar('UserGroups'));
+ foreach ($groups as $group) {
+ $view_filters[] = 'FIND_IN_SET('.$group.', perm_cache.ACL) || ((NOT FIND_IN_SET('.$group.', perm_cache.DACL)) AND perm_cache.ACL = \'\')';
+ }
+ $sql .= ' AND ('.implode(' OR ', $view_filters).')';
+ $perm_value = $this->Conn->GetOne($sql) ? 1 : 0;
+
+ $this->Application->setCache('permissions', $cache_key, $perm_value);
+ return $perm_value;
+ // cached view permission of category: end
+ }*/
+
+ if ($cat_id == 0) {
+ $cat_hierarchy = Array(0);
+ }
+ else {
+ $sql = 'SELECT ParentPath
+ FROM '.$this->Application->getUnitOption('c', 'TableName').'
+ WHERE CategoryId = '.$cat_id;
+ $cat_hierarchy = $this->Conn->GetOne($sql);
+ $cat_hierarchy = explode('|', $cat_hierarchy);
+ array_shift($cat_hierarchy);
+ array_pop($cat_hierarchy);
+ $cat_hierarchy = array_reverse($cat_hierarchy);
+ array_push($cat_hierarchy, 0);
+ }
+
+ $perm_value = 0;
+ $groups = $this->Application->RecallVar('UserGroups');
+ foreach ($cat_hierarchy as $category_id) {
+ $sql = 'SELECT PermissionValue
+ FROM '.TABLE_PREFIX.'Permissions
+ WHERE Permission = "'.$name.'" AND CatId = '.$category_id.' AND GroupId IN ('.$groups.') AND Type = '.$type;
+ $res = $this->Conn->GetOne($sql);
+ if ($res !== false) {
+ $perm_value = $res;
+ break;
+ }
+ }
+
+ $this->Application->setCache('permissions', $cache_key, $perm_value);
+ return $perm_value;
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/permissions_helper.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/units/general/inp_db_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/units/general/inp_db_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/units/general/inp_db_event_handler.php (revision 4944)
@@ -0,0 +1,124 @@
+<?php
+
+ class InpDBEventHandler extends kDBEventHandler
+ {
+
+ function mapEvents()
+ {
+ parent::mapEvents();
+ $common_events = Array( 'OnMassApprove'=>'iterateItems',
+ 'OnMassDecline'=>'iterateItems',
+ 'OnMassMoveUp'=>'iterateItems',
+ 'OnMassMoveDown'=>'iterateItems',
+ );
+
+ $this->eventMethods = array_merge($this->eventMethods, $common_events);
+ }
+
+ /**
+ * Apply same processing to each item beeing selected in grid
+ *
+ * @param kEvent $event
+ * @access private
+ */
+ function iterateItems(&$event)
+ {
+ if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
+ return;
+ }
+
+ $this->Application->setUnitOption($event->Prefix,'AutoLoad',false);
+ $object =& $event->getObject();
+ $this->StoreSelectedIDs($event);
+ $ids=$this->getSelectedIDs($event);
+
+ if($ids)
+ {
+ $status_field = array_shift( $this->Application->getUnitOption($event->Prefix,'StatusField') );
+
+ foreach($ids as $id)
+ {
+ $object->Load($id);
+
+ switch ($event->Name)
+ {
+ case 'OnMassApprove':
+ $object->SetDBField($status_field, 1);
+ break;
+
+ case 'OnMassDecline':
+ $object->SetDBField($status_field, 0);
+ break;
+
+ case 'OnMassMoveUp':
+ $object->SetDBField('Priority', $object->GetDBField('Priority') + 1);
+ break;
+
+ case 'OnMassMoveDown':
+ $object->SetDBField('Priority', $object->GetDBField('Priority') - 1);
+ break;
+ }
+
+ if( $object->Update() )
+ {
+ $event->status=erSUCCESS;
+ $event->redirect_params = Array('opener' => 's', 'pass_events' => true); //stay!
+ }
+ else
+ {
+ $event->status=erFAIL;
+ $event->redirect=false;
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnMassClone(&$event)
+ {
+ if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
+ return;
+ }
+
+ $event->status=erSUCCESS;
+
+ $temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
+
+ $this->StoreSelectedIDs($event);
+ $ids=$this->getSelectedIDs($event);
+
+ if($ids)
+ {
+ $temp->CloneItems($event->Prefix, $event->Special, $ids);
+ }
+ }
+
+ function check_array($records, $field, $value)
+ {
+ foreach ($records as $record)
+ {
+ if ($record[$field] == $value)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ function OnPreSavePopup(&$event)
+ {
+ $object =& $event->getObject();
+ $this->RemoveRequiredFields($object);
+ $event->CallSubEvent('OnPreSave');
+
+ $this->finalizePopup($event);
+ }
+ }
+
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/units/general/inp_db_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/admin_templates/groups/groups_edit_permissions.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/admin_templates/groups/groups_edit_permissions.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/admin_templates/groups/groups_edit_permissions.tpl (revision 4944)
@@ -0,0 +1,147 @@
+<inp2:m_RequireLogin permissions="in-portal:user_groups.view" system="1"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+
+<inp2:m_ParseBlock name="section_header" prefix="g" icon="icon46_usergroups" module="in-portal" title="!la_title_Groups!"/>
+
+<inp2:m_include t="groups/groups_edit_tabs"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="g" title_preset="groups_edit_permissions" module="in-portal" icon="icon46_usergroups"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+ <tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
+ submit_event('g','<inp2:g_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ submit_event('g','OnCancelEdit');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
+ go_to_id('g', '<inp2:g_PrevId/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+ go_to_id('g', '<inp2:g_NextId/>');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ <inp2:m_if prefix="g" function="IsSingle"/>
+ a_toolbar.HideButton('prev');
+ a_toolbar.HideButton('next');
+ a_toolbar.HideButton('sep1');
+ //a_toolbar.HideButton('sep2');
+ <inp2:m_else/>
+ <inp2:m_if prefix="g" function="IsLast"/>
+ a_toolbar.DisableButton('next');
+ <inp2:m_endif/>
+ <inp2:m_if prefix="g" function="IsFirst"/>
+ a_toolbar.DisableButton('prev');
+ <inp2:m_endif/>
+ <inp2:m_endif/>
+ </script>
+
+ </td>
+ </tr>
+ </tbody>
+</table>
+
+<inp2:g_SaveWarning name="grid_save_warning"/>
+
+<inp2:m_DefineElement name="permission_element" prefix="g-perm" onclick="">
+ <td>
+ <inp2:$prefix_HasPermission perm_name="$perm_name" section_name="$section_name">
+ <input type="hidden" id="<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" name="<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" value="<inp2:$prefix_PermissionValue section_name="$section_name" perm_name="$perm_name"/>">
+ <input type="checkbox" align="absmiddle" id="_cb_<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" name="_cb_<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" <inp2:m_if check="{$prefix}_PermissionValue" section_name="$section_name" perm_name="$perm_name" value="1">checked</inp2:m_if> onchange="update_checkbox(this, document.getElementById('<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]'));" onclick="<inp2:m_param name="onclick"/>">
+ <inp2:m_else/>
+ &nbsp;
+ </inp2:m_if>
+ </td>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="tree_element">
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <td>
+ <img src="img/spacer.gif" height="1" width="<inp2:g-perm_LevelIndicator level="$deep_level" multiply="20"/>" alt="" border="0"/>
+
+ <img src="<inp2:$SectionPrefix_ModulePath/>img/icons/icon24_<inp2:m_param name="icon"/>.gif" border="0" alt="" title="" align="absmiddle"/>
+ <inp2:m_if check="m_ParamEquals" name="children_count" value="0">
+ <inp2:m_phrase name="$label"/>
+ <inp2:m_else/>
+ <inp2:m_if check="m_ParamEquals" name="section_name" value="in-portal:root">
+ <b><inp2:m_param name="label"/></b>
+ <inp2:m_else/>
+ <b><inp2:m_phrase name="$label"/></b>
+ </inp2:m_if>
+ </inp2:m_if>
+
+ <inp2:m_if check="m_IsDebugMode">
+ <br />
+ <img src="img/spacer.gif" height="1" width="<inp2:g-perm_LevelIndicator level="$deep_level" multiply="20"/>" alt="" border="0"/>
+ <span class="small">[<inp2:m_param name="section_name"/>, <b><inp2:m_param name="SectionPrefix"/></b>]</span>
+ </inp2:m_if>
+ </td>
+
+ <inp2:m_RenderElement name="permission_element" section_name="$section_name" perm_name="view" onclick="update_perm_checkboxes(this);"/>
+ <inp2:m_RenderElement name="permission_element" section_name="$section_name" perm_name="add"/>
+ <inp2:m_RenderElement name="permission_element" section_name="$section_name" perm_name="edit"/>
+ <inp2:m_RenderElement name="permission_element" section_name="$section_name" perm_name="delete"/>
+ <td>
+ <inp2:m_if check="g-perm_HasAdvancedPermissions" section_name="$section_name">
+ <a href="javascript:openSelector('g-perm', '<inp2:m_t t="groups/permissions_selector" pass="all,g-perm" section_name="$section_name" escape="1"/>', 'PermList', null, 'OnSavePermissions');"><inp2:m_phrase name="la_btn_Change"/></a>
+ <inp2:m_else/>
+ &nbsp;
+ </inp2:m_if>
+ </td>
+ </tr>
+</inp2:m_DefineElement>
+
+<inp2:g-perm_LoadPermissions/>
+
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <inp2:m_set {$PrefixSpecial}_sequence="1" odd_even="table_color1"/>
+
+ <tr class="subsectiontitle">
+ <td><inp2:m_phrase label="la_col_PermissionName"/></td>
+ <td><inp2:m_phrase label="la_col_PermView"/></td>
+ <td><inp2:m_phrase label="la_col_PermAdd"/></td>
+ <td><inp2:m_phrase label="la_col_PermEdit"/></td>
+ <td><inp2:m_phrase label="la_col_PermDelete"/></td>
+ <td><inp2:m_phrase label="la_col_AdditionalPermissions"/></td>
+ </tr>
+
+ <inp2:adm_DrawTree render_as="tree_element" section_name="in-portal:root"/>
+</table>
+
+
+<script type="text/javascript">
+ function update_perm_checkboxes($source_perm)
+ {
+ var $permissions = ['add', 'edit', 'delete'];
+ var $rets = $source_perm.id.match(/_cb_g-perm\[(.*)\]\[(.*)\]/);
+ var $test_perm = '';
+ var $i = 0;
+ while($i < $permissions.length) {
+ $test_perm = '_cb_g-perm[' + $rets[1] + '][' + $permissions[$i] + ']';
+ $test_perm = document.getElementById($test_perm);
+ if ($test_perm) {
+ $test_perm.checked = $source_perm.checked;
+ update_checkbox($test_perm, document.getElementById('g-perm[' + $rets[1] + '][' + $permissions[$i] + ']'));
+ }
+ $i++;
+ }
+ }
+</script>
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/admin_templates/groups/groups_edit_permissions.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline