Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sat, Sep 20, 12:58 AM

in-portal

Index: branches/unlabeled/unlabeled-1.12.2/kernel/units/groups/groups_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.12.2/kernel/units/groups/groups_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.12.2/kernel/units/groups/groups_config.php (revision 5549)
@@ -0,0 +1,129 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'g',
+
+ 'ItemClass' => Array('class' => 'GroupsItem', 'file' => 'groups_item.php', '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', 'advanced:manage_permissions'),
+ '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(
+ 'GroupId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td'),
+ 'Name' => Array('title' => 'la_col_GroupName'),
+ 'UserCount' => Array('title' => 'la_col_UserCount'),
+ ),
+ ),
+
+ 'Radio' => Array(
+ 'Icons' => Array(1 => 'icon16_group.gif', 0 => 'icon16_group_disabled.gif'),
+ 'Fields' => Array(
+ 'GroupId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_radio_td'),
+ 'Name' => Array('title' => 'la_col_GroupName'),
+ 'Description' => Array('title' => 'la_col_Description'),
+ ),
+ ),
+
+ /*'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.12.2/kernel/units/groups/groups_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.12
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.12.2/kernel/include/custommetadata.php
===================================================================
--- branches/unlabeled/unlabeled-1.12.2/kernel/include/custommetadata.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.12.2/kernel/include/custommetadata.php (revision 5549)
@@ -0,0 +1,175 @@
+<?php
+
+
+class clsCustomMetaData extends clsItem
+{
+// var $m_CustomDataId;
+// var $m_ResourceId;
+// var $m_CustomFieldId;
+// var $m_Value;
+
+ var $FieldName;
+
+ function clsCustomMetaData($CustomDataId=-1,$table="CustomMetaData")
+ {
+ parent::clsItem();
+ $this->tablename=GetTablePrefix()."CustomMetaData";
+ $this->type=12;
+ $this->BasePermission="";
+ $this->id_field = "CustomDataId";
+ $this->NoResourceId=1; //set this to avoid using a resource ID
+ }
+}
+
+class clsCustomDataList extends clsItemCollection
+{
+ function clsCustomDataList()
+ {
+ parent::clsItemCollection();
+ $this->classname = 'clsCustomMetaData';
+ }
+
+ function LoadResource($ResourceId)
+ {
+ // TO REMOVE
+ }
+
+ function DeleteResource($ResourceId, $main_prefix)
+ {
+ if (!$ResourceId) return false;
+
+ $custom_table = $this->Application->getUnitOption($main_prefix.'-cdata', 'TableName');
+ $sql = 'DELETE FROM '.$custom_table.'
+ WHERE ResourceId = '.$ResourceId;
+ $this->adodbConnection->Execute($sql);
+ }
+
+ function CopyResource($OldId,$NewId, $main_prefix)
+ {
+ $custom_data =& $this->Application->recallObject($main_prefix.'-cdata.-item', null, Array('skip_autoload' => true));
+ $custom_data->Load($OldId, 'ResourceId');
+
+ if ($custom_data->isLoaded()) {
+ $custom_data->SetDBField('ResourceId', $NewId);
+ $custom_data->Create();
+ }
+ }
+
+ function &SetFieldValue($FieldId,$ResourceId,$Value)
+ {
+ // so strange construction used, because in normal
+ // way it doesn't work at all (gets item copy not
+ // pointer)
+ $index = $this->GetDataItem($FieldId, true);
+
+ if($index !== false)
+ {
+ $d =& $this->Items[$index];
+ }
+ else
+ {
+ $d = null;
+ }
+
+ if(is_object($d))
+ {
+ $d->Set('Value', $Value);
+ if(!strlen($Value))
+ {
+ for($x=0;$x<count($this->Items);$x++)
+ {
+ if($this->Items[$x]->Get("CustomFieldId") == $FieldId && $this->Items[$x]->Get("ResourceId") == $ResourceId)
+ {
+ $this->Items[$x]->Set("CustomFieldId",0);
+ break;
+ }
+ }
+ $d->Delete(true);
+ }
+ }
+ else
+ {
+ $d = new clsCustomMetaData();
+ $d->Set("CustomFieldId",$FieldId);
+ $d->Set("ResourceId",$ResourceId);
+ $d->Set("Value",$Value);
+ array_push($this->Items,$d);
+ }
+ return $d;
+ }
+
+ function &GetDataItem($id, $return_index = false)
+ {
+ // $id - custom field id to find
+ // $return_index - return index to items, not her.
+ $found = false;
+ $index = false;
+ for($i = 0; $i < $this->NumItems(); $i++)
+ {
+ $d =& $this->GetItemRefByIndex($i);
+ if($d->Get("CustomFieldId")==$id)
+ {
+ $found=TRUE;
+ break;
+ }
+ }
+ return $found ? ($return_index ? $i : $d) : false;
+ }
+
+ function SaveData($main_prefix, $resource_id)
+ {
+ // to call OnAfterConfigRead event
+ $item_table = $this->Application->getUnitOption($main_prefix, 'TableName');
+
+ $ml_formatter =& $this->Application->recallObject('kMultiLanguage');
+ $custom_data =& $this->Application->recallObject($main_prefix.'-cdata', null, Array('skip_autoload' => true));
+ $custom_data->Load($resource_id, 'ResourceId');
+
+ foreach($this->Items as $f) {
+ $custom_id = $f->Get('CustomFieldId');
+ $value = isset($GLOBALS['_CopyFromEditTable']) ? $f->Get('Value') : stripslashes($f->Get('Value'));
+
+ $custom_name = $ml_formatter->LangFieldName('cust_'.$custom_id);
+ $custom_data->SetDBField($custom_name, $value);
+ }
+
+ $custom_data->SetDBField('ResourceId', $resource_id);
+ return $custom_data->isLoaded() ? $custom_data->Update() : $custom_data->Create();
+ }
+
+ function &getTempHandler($prefix)
+ {
+ if (strlen($prefix) > 2 || strlen($prefix) == 0) {
+ // not e.g. bb, c, u, but CustomFieldId :) or empty at all
+ $this->Application->reportError(get_class($this), 'CopyToEditTable');
+ }
+
+ $temp_handler =& $this->Application->recallObject($prefix.'-cdata_TempHandler', 'kTempTablesHandler');
+ return $temp_handler;
+ }
+
+ function CopyToEditTable($main_prefix, $idlist)
+ {
+ $temp_handler =& $this->getTempHandler($main_prefix);
+ $temp_handler->DoCopyLiveToTemp($temp_handler->Tables, $idlist);
+ }
+
+ function CopyFromEditTable($main_prefix)
+ {
+ $temp_handler =& $this->getTempHandler($main_prefix);
+ $temp_handler->DoCopyTempToOriginal($temp_handler->Tables);
+ }
+
+ function PurgeEditTable($main_prefix)
+ {
+ $temp_handler =& $this->getTempHandler($main_prefix);
+ $temp_handler->CancelEdit();
+ }
+
+ function CreateEmptyEditTable($main_prefix)
+ {
+ $temp_handler =& $this->getTempHandler($main_prefix);
+ $temp_handler->DoCopyLiveToTemp($temp_handler->Tables, Array(0));
+ }
+}
+?>
Property changes on: branches/unlabeled/unlabeled-1.12.2/kernel/include/custommetadata.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.12
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.12.2/admin/import/step4.php
===================================================================
--- branches/unlabeled/unlabeled-1.12.2/admin/import/step4.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.12.2/admin/import/step4.php (revision 5549)
@@ -0,0 +1,164 @@
+<?php
+
+// new startup: begin
+define('REL_PATH', 'admin/import');
+$relation_level = count( explode('/', REL_PATH) );
+define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
+require_once FULL_PATH.'/kernel/startup.php';
+// new startup: end
+checkViewPermission('in-portal:main_import');
+
+//admin only util
+$pathtolocal = $pathtoroot."kernel/";
+require_once ($pathtoroot.$admin."/include/elements.php");
+require_once ($pathtoroot."kernel/admin/include/navmenu.php");
+require_once ($pathtolocal."admin/include/navmenu.php");
+require_once($pathtoroot.$admin."/toolbar.php");
+
+ //Set Section
+ $section = "in-portal:main_import";
+
+ //Set Environment Variable
+ $envar = "env=" . BuildEnv();
+
+ $sec = $objSections->GetSection($section);
+ $objCatToolBar = new clsToolBar();
+
+ //check if the previous input is correct
+ if( $_POST["Action"] == 'checkconn')
+ {
+ // save supplied connection info
+ $objSession->SetVariable("import_sql_type", $_POST["db_sql_type"]);
+ $objSession->SetVariable("import_server", $_POST["db_server"]);
+ $objSession->SetVariable("import_db", $_POST["db_db"]);
+ $objSession->SetVariable("import_user", $_POST["db_user"]);
+ $objSession->SetVariable("import_pass", $_POST["db_pass"]);
+ $objSession->SetVariable("error_importing", '');
+
+ // get them for using here
+ $db_sql_type = $objSession->GetVariable("import_sql_type");
+ $db_server = $objSession->GetVariable("import_server");
+ $db_db = $objSession->GetVariable("import_db");
+ $db_user = $objSession->GetVariable("import_user");
+ $db_pass = $objSession->GetVariable("import_pass");
+
+ // check supplied connection
+ $linkconn =& ADONewConnection($db_sql_type);
+ if( !$linkconn->NConnect($db_server, $db_user, $db_pass, $db_db) || !$db_server || !$db_db )
+ {
+ $objSession->SetVariable("error_importing","Error: The connection to the DB failed please check your settings");
+ header('Location: step3.php?'.$envar);
+ }
+ unset($linkconn);
+ }
+
+ $import_script = GetImportScript( $objSession->GetVariable('ImportScriptID') );
+
+ $var = "?env=".BuildEnv();
+
+ // Previous Button
+ $MouseOver = "swap('moveleft','toolbar/tool_prev_f2.gif');";
+ $MouseOut = "swap('moveleft', 'toolbar/tool_prev.gif');";
+ $link = $adminURL."/import/step3.php".$var;
+ $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif");
+
+ // Next Button
+ $MouseOver = "swap('moveright','toolbar/tool_next_f2.gif');";
+ $MouseOut = "swap('moveright', 'toolbar/tool_next.gif');";
+
+ $formaction = $rootURL.$import_script['module'].'/'.$admin.'/import/'.$import_script['url'].'.php?'.$envar;
+
+ $onClick = "if( !CheckFinalForm('import_form') ) alert('Please fill in all of the fields'); else import_submit('import_form','$formaction'); ";
+ $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),'#',$MouseOver,$MouseOut,$onClick,"tool_next.gif");
+
+ // Header
+ $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 4";
+ $NewSection = strtolower($import_script['module']).':'.$import_script['id'];
+ int_header($objCatToolBar,NULL,$title,NULL,NULL,Array(),$NewSection);
+
+?>
+
+<form id="import_form" name="import_form" method="post" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>">
+ <input type="hidden" name="Action" value="m_save_import_config">
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <?php int_subsection_title("Matching Fields - Intechnic In-Portal "); ?>
+<!-- script common fields: begin -->
+<?php
+if( $import_script['id'] == 'in-link' )
+{
+?>
+ <tr <?php echo int_table_color(); ?>>
+ <td width="60%" valign="top"><span class="text"><?php echo admin_language("la_prompt_AdminId"); ?></span></td>
+ <td>
+ <b><?php echo $objSession->GetVariable("user_admin_names"); ?></b>
+ <input type="hidden" name="user_admin" size="15" class="text" value="<?php echo $objSession->GetVariable("user_admin_values"); ?>">
+ <input type="hidden" name="grouplist1" value="<?php echo $objSession->GetVariable('grouplist1'); ?>">
+ <a href="#"><img src="../images/icon_users_sm.gif" style="cursor:hand;" border="0" onclick="OpenGroupSelector('<?php echo $envar; ?>&en=0&destform=import_form&destfield=grouplist1&Selector=radio');"></a>
+ </td>
+ </tr>
+<?php
+}
+?>
+ <tr <?php echo int_table_color(); ?>>
+ <td width="60%" valign="top"><span class="text"><?php echo admin_language("la_prompt_RegUserId"); ?></span></td>
+ <td>
+ <b><?php echo $objSession->GetVariable("user_regular_names"); ?></b>
+ <input type="hidden" name="user_regular" size="15" class="text" value="<?php echo $objSession->GetVariable("user_regular_values"); ?>">
+ <input type="hidden" name="grouplist2" value="<?php echo $objSession->GetVariable('grouplist2'); ?>">
+ <a href="#"><img src="../images/icon_users_sm.gif" style="cursor:hand;" border="0" onclick="OpenGroupSelector('<?php echo $envar; ?>&en=0&destform=import_form&destfield=grouplist2&Selector=radio');"></a>
+ </td>
+ </tr>
+ <tr <?php echo int_table_color(); ?>>
+ <td width="60%" valign="top"><span class="text"><?php
+ echo admin_language("la_prompt_InitImportCat");
+ $catid = $objSession->GetVariable('categoryid');
+ $path = prompt_language($objConfig->Get("Root_Name"));
+ if($catid > 0)
+ {
+ $c = $objCatList->GetItemByField('ResourceId', $catid);
+ $path .= "&gt;".$c->GetCachedNavBar();
+ }
+ ?>
+ </td>
+ <td>
+ <b><?php echo $path; ?></b>
+ <input type="hidden" name="init_cat" size="15" class="text" value="<?php echo $objSession->GetVariable("categoryid"); ?>">
+ <a href="#"><img src="<?php echo $imagesURL; ?>/folder.gif" style="cursor:hand;" border="0" ONCLICK="OpenCatSelector('<?php echo $envar; ?>&source=inlinkimport4&continue_sess=1&destform=import_form&destfield=categorylist&Selector=radio');"></a>
+ <input type="hidden" name="categorylist" value="<?php echo $objSession->GetVariable('categorylist'); ?>">
+ </td>
+ </tr>
+<!-- script common fields: end -->
+<!-- script spefific fields: begin -->
+<?php
+ if( $import_script['id'] == 'in-link' )
+ {
+ if( GetVar('link_image') ) $objSession->SetVariable('link_image', GetVar('link_image') );
+?>
+ <tr <?php echo int_table_color(); ?>>
+ <td width="60%" valign="top"><span class="text"><?php echo admin_language("la_prompt_Import_ImageName"); ?></span></td>
+ <td>
+ <input type="text" name="link_image" class="text" size="30" value="<?php echo $objSession->GetVariable('link_image'); ?>">
+ </td>
+ </tr>
+<?php
+ }
+
+ if( $import_script['module'] == 'in-bulletin' )
+ {
+ if( GetVar('bb_prefix') ) $objSession->SetVariable('import_table_prefix', GetVar('bb_prefix') );
+?>
+ <tr <?php echo int_table_color(); ?>>
+ <td width="60%" valign="top"><span class="text"><?php echo admin_language("la_prompt_Import_Prefix"); ?></span></td>
+ <td>
+ <input type="text" name="bb_prefix" class="text" size="30" value="<?php echo $objSession->GetVariable('import_table_prefix'); ?>">
+ </td>
+ </tr>
+<?php
+ }
+?>
+<!-- script spefific fields: end -->
+</table>
+</form>
+<?php
+int_footer();
+?>
Property changes on: branches/unlabeled/unlabeled-1.12.2/admin/import/step4.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.12
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.12.2/core/kernel/parser/tags.php
===================================================================
--- branches/unlabeled/unlabeled-1.12.2/core/kernel/parser/tags.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.12.2/core/kernel/parser/tags.php (revision 5549)
@@ -0,0 +1,414 @@
+<?php
+
+define ('parse', 0);
+define ('skip', 1);
+define ('skip_tags', 2);
+
+class MyTagHolder extends kBase {
+
+ var $_Tag;
+
+ function MyTagHolder()
+ {
+
+ }
+
+ function &GetTag($tag_data, &$parser, $inp_tag = 0)
+ {
+ if (!isset($this->_Tag)) {
+ $this->_Tag =& new Tag($tag_data, $parser, $inp_tag);
+ }
+ else {
+// $this->_Tag->Parser =& $parser;
+ $this->_Tag->TagData = $tag_data;
+ if ($tag_data != '') $this->_Tag->ParseTagData($tag_data);
+ $this->_Tag->NP =& $this->_Tag->NamedParams;
+ }
+ return $this->_Tag;
+ }
+
+}
+
+class Tag extends kBase {
+ var $Processor;
+ var $Tag;
+ var $Params = Array();
+ var $NamedParams = Array();
+ var $NP;
+ /**
+ * Enter description here...
+ *
+ * @var TemplateParser
+ */
+ var $Parser;
+ var $TagData = '';
+
+ function Tag($tag_data, &$parser, $inp_tag=0)
+ {
+ parent::kBase();
+ $this->Parser =& $parser;
+ $this->TagData = $tag_data;
+ if ($tag_data != '') $this->ParseTagData($tag_data);
+ $this->NP =& $this->NamedParams;
+ }
+
+ function CopyFrom(&$tag)
+ {
+ $this->Processor = $tag->Processor;
+ $this->Tag = $tag->Tag;
+ $this->TagData = $tag->TagData;
+ $this->Params = $tag->Params;
+ $this->NamedParams = $tag->NamedParams;
+ $this->Parser =& $tag->Parser;
+ }
+
+ function GetFullTag()
+ {
+ return '<%'.$this->TagData.'%>';
+ }
+
+ function RebuildTagData()
+ {
+ $res = $this->Processor.':'.$this->Tag.' ';
+ foreach ($this->NamedParams as $name => $value) {
+ $res .= "$name='$value' ";
+ }
+ return $res;
+ }
+
+ /**
+ * Escape chars in phrase translation, that could harm parser to process tag
+ *
+ * @param string $text
+ * @return string
+ * @access private
+ */
+ function EscapeReservedChars($text)
+ {
+ $reserved = Array('"',"'"); // =
+ $replacement = Array('\"',"\'"); // \=
+ return str_replace($reserved,$replacement,$text);
+ }
+
+
+ function ReplaceParams($tag_data)
+ {
+ //print_pre($this->Parser->Pattern, $tag_data);
+ $values = $this->Parser->Values;
+ foreach($values as $param_name => $param_value)
+ {
+ $values[$param_name] = $this->EscapeReservedChars($param_value);
+ }
+
+ if (is_array($this->Parser->Params)) {
+ $tag_data = preg_replace($this->Parser->Pattern, $values, $tag_data);
+ }
+ //echo "got: $tag_data<br>";
+ return $tag_data;
+ }
+
+ function PreParseReplaceParams($tag_data)
+ {
+ //print_pre($this->Parser->Pattern, $tag_data);
+ $values = $this->Parser->Values;
+ foreach($values as $param_name => $param_value)
+ {
+ $values[$param_name] = $this->EscapeReservedChars($param_value);
+ }
+
+ /*$patterns = Array();
+ if ( is_array($this->Parser->Args) ) {
+ foreach ($this->Parser->Args as $arg) {
+
+ }
+ }*/
+
+ if ($this->Parser->SkipMode == parse) {
+ if (is_array($this->Parser->Params)) {
+ $tag_data = preg_replace($this->Parser->Pattern, $values, $tag_data);
+ }
+ }
+ //echo "got: $tag_data<br>";
+ return $tag_data;
+ }
+
+ function CmpParams($a, $b)
+ {
+ $a_len = strlen($a);
+ $b_len = strlen($b);
+ if ($a_len == $b_len) return 0;
+ return $a_len > $b_len ? -1 : 1;
+ }
+
+ /**
+ * Set's Prefix and Special for Tag object
+ * based on ones from tagname
+ *
+ * @param string $tag_data
+ * @access protected
+ */
+ function ParseTagData($tag_data)
+ {
+ if (defined('EXPERIMENTAL_PRE_PARSE') ) {
+ $this->OriginalTagData = $tag_data;
+ $tag_data = $this->PreParseReplaceParams($tag_data) . ' ';
+ }
+ else {
+ $tag_data = $this->ReplaceParams($tag_data) . ' ';
+// $tag_data = $this->Application->ReplaceLanguageTags($tag_data);
+ }
+
+ list ($key_data, $params) = split("[ \t\n]{1}", $tag_data, 2);
+ $key_data = trim($key_data);
+
+ $tmp=explode(':',$key_data);
+ $this->Tag=$tmp[1];
+
+ $tmp=$this->Application->processPrefix($tmp[0]);
+ $this->Prefix=$tmp['prefix'];
+ $this->Special=$tmp['special'];
+ $this->Processor=$this->Prefix;
+
+ if ($params != '') {
+ $this->ParseNamedParams($params);
+ }
+ else {
+ $this->NamedParams = array();
+ }
+ }
+
+ function ParseNamedParams($params_str)
+ {
+ $params =& new Params($params_str);
+ $this->NamedParams = $params->_Params;
+ }
+
+ function GetParam($param)
+ {
+ if (isset($this->NP[$param]))
+ return $this->NP[$param];
+ else
+ return false;
+ }
+
+ /**
+ * Process IF tags in specific way
+ *
+ */
+ function Process()
+ {
+ if ($this->Processor == 'm' || $this->Processor == 'm_TagProcessor') { //if we are procssing Main tags
+ if ($this->Tag == 'block' || $this->Tag == 'DefineElement') {
+ $tag =& new BlockTag('', $this->Parser);
+ $tag->CopyFrom($this);
+ $tag->Process();
+ }
+ elseif ($this->Parser->SkipMode == skip_tags) {
+ return;
+ }
+ elseif (
+ $this->Tag == 'if' ||
+ $this->Tag == 'ifnot' ||
+ $this->Tag == 'else' ||
+ $this->Tag == 'elseif'
+ )
+ {
+ if ( defined('EXPERIMENTAL_PRE_PARSE') ) {
+ $this->Parser->AppendCompiledCode( $this->GetCode() );
+ }
+ $tag =& new ConstructTag('', $this->Parser);
+ $tag->CopyFrom($this);
+ $tag->Process();
+ }
+ else {
+ if ($this->Parser->SkipMode == skip) {
+ if ( defined('EXPERIMENTAL_PRE_PARSE') ) {
+ $this->Parser->AppendCompiledCode( $this->GetCode() );
+ }
+ return;
+ }
+ $this->ProcessTag();
+ if ( defined('EXPERIMENTAL_PRE_PARSE') ) {
+ $this->Parser->AppendCompiledCode( $this->GetCode() );
+ }
+ }
+ }
+ else { //normal tags - processors other than main
+ if ($this->Parser->SkipMode == skip) { // inside if - add statements inside if to compiled code
+ if ( defined('EXPERIMENTAL_PRE_PARSE') ) {
+ $this->Parser->AppendCompiledCode( $this->GetCode() );
+ }
+ return;
+ }
+ elseif ($this->Parser->SkipMode == skip_tags) return; //do not parse if we skipping tags
+ $this->ProcessTag();
+ if ( defined('EXPERIMENTAL_PRE_PARSE') ) {
+ $this->Parser->AppendCompiledCode( $this->GetCode() );
+ }
+ }
+ }
+
+ /**
+ * Set's Prefix and Special for TagProcessor
+ * based on tag beeing processed
+ *
+ * @return string
+ * @access protected
+ */
+ function DoProcessTag()
+ {
+ // $tag->Prefix - l_TagProcessor
+ $tmp = $this->Application->processPrefix($this->Processor);
+
+ $processor =& $this->Application->recallObject($tmp['prefix'].'_TagProcessor'); // $this->Processor
+
+ $tmp=explode('_',$tmp['prefix'],2);
+ $processor->Prefix=$tmp[0];
+ $processor->Special=$this->Special;
+
+ // pass_params for non ParseBlock tags :)
+ $parser_params = $this->Application->Parser->Params;
+ if( getArrayValue($this->NamedParams,'pass_params') )
+ {
+ unset( $this->NamedParams['pass_params'] );
+ $this->NamedParams = array_merge_recursive2($parser_params, $this->NamedParams);
+ }
+
+ return $processor->ProcessTag($this);
+ }
+
+ function ProcessTag()
+ {
+ $o = $this->DoProcessTag();
+ if ($o !== false)
+ {
+ $this->Parser->AppendOutput($o);
+ }
+ else
+ {
+ trigger_error('can\'t process tag '.$this->Tag,E_USER_WARNING);
+ }
+ }
+
+ function GetCode($echo=false)
+ {
+ $tmp_params = $this->NamedParams;
+ $splited = split("[ \t\n]{1}", $this->OriginalTagData, 2);
+ if (isset($splited[1]) && $splited[1]) {
+ $this->ParseNamedParams($splited[1]);
+ }
+ $pass_params = $this->NamedParams;
+ $this->NamedParams = $tmp_params;
+
+ $code = Array();
+
+ $to_pass = 'Array(';
+ foreach ($pass_params as $name => $val) {
+ $to_pass .= '"'.$name.'" => "'.str_replace('"', '\"', $val).'",';
+ }
+ $to_pass .= ')';
+
+ if ($echo) $code[] = '$o = '."'';\n";
+
+ switch ( $this->Tag ) {
+ case 'DefaultParam':
+ foreach ($this->NP as $key => $val) {
+ $code[] = '$'.$key.' = $'.$key.' ? $'.$key.' : \''.$val.'\';';
+ }
+ return $code;
+ case 'param':
+ $code[] = '$o .= $params["'.$this->NP['name'].'"];';
+ return $code;
+ case 'if':
+ if (isset($this->NP['_closing_tag_'])) {
+ $code[] = ' }';
+ }
+ else {
+
+ $check = $this->GetParam('check');
+ if ($check) {
+ if (strpos($check, '_') !== false) {
+ list($prefix, $function) = explode('_', $check, 2);
+ }
+ else {
+ $function = $check;
+ $prefix = $this->Parser->GetParam('PrefixSpecial');
+ }
+ }
+ else {
+ $prefix = $this->GetParam('prefix');
+ $function = $this->GetParam('function');
+ }
+
+ $code[] = '$tmp = $application->processPrefix("'.$prefix.'");'."\n";
+ $code[] = '$__tp = $tmp[\'prefix\'].\'_TagProcessor\';'."\n";
+ $code[] = '$p =& $application->recallObject($__tp);'."\n";
+ $code[] = '$p->Prefix = $tmp[\'prefix\'];'."\n";
+ $code[] = '$p->Special = $tmp[\'special\'];'."\n";
+ $code[] = '$if_result = $p->ProcessParsedTag(\''.$function.'\', '.$to_pass.', "'.$prefix.'");'."\n";
+ if (isset($pass_params['inverse'])) {
+ $code[] = 'if (!$if_result) {';
+ }
+ else {
+ $code[] = 'if ($if_result) {';
+ }
+ }
+ return $code;
+
+ case 'endif':
+ $code[] = ' }';
+ return $code;
+
+ case 'else':
+ $code[] = ' }';
+ $code[] = ' else {';
+ return $code;
+ }
+
+ /* $tmp_pref = $this->getPrefixSpecial();
+ $tmp = $this->Application->processPrefix($tmp_pref);
+ $tmp_processor = $tmp['prefix'].'_TagProcessor';
+ if (strpos($tmp['prefix'], '$') !== false) {
+ $processor_to_check = '{'.$tmp['prefix'].'}_TagProcessor';
+ }
+ else {
+ $processor_to_check = $tmp_processor;
+ } */
+
+ $code[] = '$tmp = $application->processPrefix("'.$this->getPrefixSpecial().'");'."\n";
+
+ /*if (!isset($this->Application->CompilationCache[$this->getPrefixSpecial()])) {
+ $code[] = '$tmp = $application->processPrefix("'.$this->getPrefixSpecial().'");'."\n";
+ $code[] = '$__tp = $tmp[\'prefix\'].\'_TagProcessor\';'."\n";
+ $code[] = '$application->CachedProcessors["'.$this->getPrefixSpecial().'"] =& $application->recallObject($__tp);'."\n";
+ $this->Application->CompilationCache[$this->getPrefixSpecial()] = true;
+
+ if (strpos($tmp_pref, '$') === false) {
+ $this->Application->CachedProcessors[$this->getPrefixSpecial()] =& $this->Application->recallObject($tmp_processor);
+ }
+ }
+
+ $this->Parser->UsedProcessors[] = $tmp['prefix'];*/
+ $code[] = '$__tp = $tmp[\'prefix\'].\'_TagProcessor\';'."\n";
+ $code[] = '$p =& $application->recallObject($__tp);'."\n";
+ $code[] = '$p->Prefix = $tmp[\'prefix\'];'."\n";
+ $code[] = '$p->Special = $tmp[\'special\'];'."\n";
+
+ $tag_func = $this->Tag;
+ if ($tag_func == 'include') $tag_func = 'MyInclude';
+
+// $code[] = '$o .= $application->CachedProcessors["'.$this->getPrefixSpecial().'"]->ProcessParsedTag(\''.$tag_func.'\', '.$to_pass.', "'.$this->Processor.'");'."\n";
+
+ $code[] = '$o .= $p->ProcessParsedTag(\''.$tag_func.'\', '.$to_pass.', "'.$this->Processor.'");'."\n";
+
+ /*$code = ' $processor =& $application->recallObject(\''.$this->Processor.'_TagProcessor\');
+ $o .= $processor->ProcessParsedTag(\''.$this->Tag.'\', unserialize(\''.serialize($this->NP).'\'));';*/
+
+ if ($echo) $code[] = ' echo $o;'."\n";
+
+ return $code;
+ //return '$o .= \'tag:'. $this->Tag .'\'';
+ }
+}
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.12.2/core/kernel/parser/tags.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.12
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.12.2/core/units/groups/groups_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.12.2/core/units/groups/groups_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.12.2/core/units/groups/groups_config.php (revision 5549)
@@ -0,0 +1,129 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'g',
+
+ 'ItemClass' => Array('class' => 'GroupsItem', 'file' => 'groups_item.php', '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', 'advanced:manage_permissions'),
+ '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(
+ 'GroupId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td'),
+ 'Name' => Array('title' => 'la_col_GroupName'),
+ 'UserCount' => Array('title' => 'la_col_UserCount'),
+ ),
+ ),
+
+ 'Radio' => Array(
+ 'Icons' => Array(1 => 'icon16_group.gif', 0 => 'icon16_group_disabled.gif'),
+ 'Fields' => Array(
+ 'GroupId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_radio_td'),
+ 'Name' => Array('title' => 'la_col_GroupName'),
+ 'Description' => Array('title' => 'la_col_Description'),
+ ),
+ ),
+
+ /*'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.12.2/core/units/groups/groups_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.12
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline