Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sat, Jun 21, 7:45 AM

in-portal

This file is larger than 256 KB, so syntax highlighting was skipped.
Index: trunk/kernel/units/relationship/relationship_event_handler.php
===================================================================
--- trunk/kernel/units/relationship/relationship_event_handler.php (revision 7634)
+++ trunk/kernel/units/relationship/relationship_event_handler.php (revision 7635)
@@ -1,266 +1,266 @@
<?php
class RelationshipEventHandler extends kDBEventHandler
{
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnProcessSelected' => Array('subitem' => 'add|edit'),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Initializes new relation
*
* @param kEvent $event
*/
function OnNew(&$event)
{
parent::OnNew($event);
$object =& $event->getObject();
$table_info = $object->getLinkedInfo();
$object->SetDBField('SourceId', $table_info['ParentId']);
$source_itemtype = $this->Application->getUnitOption($table_info['ParentPrefix'], 'ItemType');
$object->SetDBField('SourceType', $source_itemtype);
$object->SetDBField('TargetId', $this->Application->GetVar('target_id'));
$object->SetDBField('TargetType', $this->Application->GetVar('target_type'));
$this->OnAfterItemLoad($event);
}
/**
* Add new relation
*
* @param kEvent $event
*/
function OnProcessSelected(&$event)
{
$dst_field = $this->Application->RecallVar('dst_field');
if ($dst_field == 'TargetId') {
// prepare target_id & target_type
$object =& $event->getObject( Array('skip_autoload' => true) );
$selected_ids = $this->Application->GetVar('selected_ids');
$target_prefix = false;
foreach ($selected_ids as $selected_prefix => $target_id) {
if ($target_id > 0) {
$target_prefix = $selected_prefix;
break;
}
}
if (!$target_prefix) {
$this->finalizePopup($event);
return;
}
$sql = 'SELECT ResourceId
FROM '.$this->Application->getUnitOption($target_prefix, 'TableName').'
- WHERE '.$this->Application->getUnitOption($target_prefix, 'IDField').' = '.$target_id;
+ WHERE '.$this->Application->getUnitOption($target_prefix, 'IDField').' IN ('.$target_id.')';
$target_id = $this->Conn->GetOne($sql);
$target_type = $this->Application->getUnitOption($target_prefix, 'ItemType');
// don't add same relation twice
$table_info = $object->getLinkedInfo();
$sql = 'SELECT TargetId
FROM '.$object->TableName.'
WHERE (SourceId = '.$table_info['ParentId'].') AND (TargetId = '.$target_id.')';
$duplicate_relation = $this->Conn->GetOne($sql) == $target_id;
$this->finalizePopup($event);
if (!$duplicate_relation) {
// place correct template in opener stack
$source_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
$template = $this->Application->getUnitOption($source_prefix, 'AdminTemplatePath').'/relations_edit';
-
+
$redirect_params = Array($event->Prefix.'_event' => 'OnNew', 'target_id' => $target_id, 'm_opener' => 's', 'target_type' => $target_type);
$this->Application->EventManager->openerStackPush($template, $redirect_params, 'all,'.$event->Prefix);
-
+
// $event->SetRedirectParam('popup_stay', 1); // if popup mode, then set this
}
}
else {
$this->finalizePopup($event);
}
}
/**
* Set ItemName & ItemType virtual fields based on loaded item data
*
* @param kEvent $event
*/
function OnAfterItemLoad(&$event)
{
$object =& $event->getObject();
$sql = 'SELECT Prefix
FROM '.TABLE_PREFIX.'ItemTypes
WHERE ItemType = '.$object->GetDBField('TargetType');
$target_prefix = $this->Conn->GetOne($sql);
$title_field = $this->getTitleField($target_prefix);
$title_phrase = $this->Application->getUnitOption($target_prefix, 'TitlePhrase');
$sql = 'SELECT '.$title_field.'
FROM '.$this->Application->getUnitOption($target_prefix, 'TableName').'
WHERE ResourceId = '.$object->GetDBField('TargetId');
$object->SetDBField('ItemName', $this->Conn->GetOne($sql));
$object->SetDBField('ItemType', $this->Application->Phrase($title_phrase));
}
/**
* Creates needed sql query to load list,
* if no query is defined in config for
* special requested, then use default
* query
*
* @param kEvent $event
* @access protected
*/
function ListPrepareQuery(&$event)
{
return $this->BaseQuery($event, 'ListSQLs');
}
/**
* Creates needed sql query to load item,
* if no query is defined in config for
* special requested, then use default
* query
*
* @param kEvent $event
* @access protected
*/
function ItemPrepareQuery(&$event)
{
return $this->BaseQuery($event, 'ItemSQLs');
}
/**
* Get item name & type based on relation type & modules installed
*
* @param kEvent $event
* @param string $sql_field
*/
function BaseQuery(&$event, $sql_field)
{
$sqls = $this->Application->getUnitOption($event->Prefix,$sql_field);
$sql = isset($sqls[$event->Special]) ? $sqls[$event->Special] : $sqls[''];
$configs = $this->extractModulesInfo();
// 2. build sql based on information queried
$sql_templates['ItemName'] = 'IFNULL(%s.%s,\' \')';
$sql_templates['TableJoin'] = 'LEFT JOIN %1$s ON %1$s.ResourceId = rel.TargetId';
$sql_templates['TargetName'] = 'IF(rel.TargetType = %s, \'%s\', %s)';
$sql_parts = Array();
$sql_parts['TargetName'] = "''";
foreach ($configs as $prefix => $config_data) {
$title_field = $this->getTitleField($prefix);
$sql_parts['ItemName'][] = sprintf($sql_templates['ItemName'], $config_data['TableName'], $title_field);
$sql_parts['TableJoin'][] = sprintf($sql_templates['TableJoin'], $config_data['TableName']);
$sql_parts['TargetName'] = sprintf( $sql_templates['TargetName'],
$config_data['ItemType'],
'!'.$config_data['TitlePhrase'].'!',
$sql_parts['TargetName']);
$sql_parts['TargetName'] = str_replace('rel','%1$s',$sql_parts['TargetName']);
}
$object =& $event->getObject();
$vars = Array('#ITEM_NAMES#', '#ITEM_TYPES#');
$replacements = Array( implode(', ',$sql_parts['ItemName']), $sql_parts['TargetName'] );
$calculated_fields =& $object->getProperty('CalculatedFields');
foreach ($calculated_fields as $field_name => $field_expression) {
$calculated_fields[$field_name] = str_replace($vars, $replacements, $field_expression);
}
$object->setProperty('CalculatedFields', $calculated_fields);
$sql = str_replace('#ITEM_JOIN#', implode(' ',$sql_parts['TableJoin']), $sql);
$sql = str_replace('rel.','%1$s.',$sql);
return $sql;
}
/**
* Convert TitleField field of kMultiLanguage formatter used for it
*
* @param string $prefix
* @return string
*/
function getTitleField($prefix)
{
$lang_prefix = 'l'.$this->Application->GetVar('m_lang').'_';
$title_field = $this->Application->getUnitOption($prefix, 'TitleField');
$field_options = $this->Application->getUnitOption($prefix.'.'.$title_field, 'Fields');
$formatter_class = isset($field_options['formatter']) ? $field_options['formatter'] : '';
if ($formatter_class == 'kMultiLanguage' && !isset($field_options['master_field'])) {
$title_field = $lang_prefix.$title_field;
}
return $title_field;
}
/**
* Get configs from modules installed
*
* @return Array
* @access private
*/
function extractModulesInfo()
{
// get installed modules & their config info
// maybe we should leave only prefixes, that have "view" permission
$configs = Array();
foreach ($this->Application->ModuleInfo as $module_name => $module_data) {
$prefix = $module_data['Var'];
if ($prefix == 'm') {
$prefix = 'c';
}
if (!$this->Application->prefixRegistred($prefix)) continue;
-
+
$configs[$prefix] = $this->Application->getUnitOptions($prefix);
if($configs[$prefix] === false) unset($configs[$prefix]);
if(!isset($configs[$prefix]['CatalogItem']) || !$configs[$prefix]['CatalogItem']) unset($configs[$prefix]);
}
return $configs;
}
/**
* Deletes relations to hooked item from other items
*
* @param kEvent $event
*/
function OnDeleteForeignRelations(&$event)
{
$main_object =& $event->MasterEvent->getObject();
$resource_id = $main_object->GetDBField('ResourceId');
$table = $this->Application->getUnitOption($event->Prefix,'TableName');
$sql = 'DELETE FROM '.$table.' WHERE TargetId = '.$resource_id;
$this->Conn->Query($sql);
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/relationship/relationship_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.10
\ No newline at end of property
+1.11
\ No newline at end of property
Index: trunk/kernel/units/reviews/reviews_config.php
===================================================================
--- trunk/kernel/units/reviews/reviews_config.php (revision 7634)
+++ trunk/kernel/units/reviews/reviews_config.php (revision 7635)
@@ -1,136 +1,137 @@
<?php
$config = Array(
'Prefix' => 'rev',
'Clones' => Array(
'l-rev' => Array(
'ParentPrefix' => 'l',
),
'n-rev' => Array(
'ParentPrefix' => 'n',
),
'bb-rev'=> Array(
'ParentPrefix' => 'bb',
),
/*'p-rev' => Array('ParentPrefix' => 'p'),*/
),
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'ReviewsEventHandler','file'=>'reviews_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'ReviewsTagProcessor','file'=>'reviews_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
+ 4 => 'mode',
),
'ParentPrefix' => 'p', // replace all usage of rev to "p-rev" and then remove this param from here and Prefix too
'IDField' => 'ReviewId',
'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
'TableName' => TABLE_PREFIX.'ItemReview',
'ParentTableKey' => 'ResourceId', // linked field in master table
'ForeignKey' => 'ItemId', // linked field in subtable
'AutoDelete' => true,
'AutoClone' => true,
'TitlePresets' => Array(
'reviews_edit' => Array('format' => "!la_title_Editing_Review!"),
),
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER),
),
'Filters' => Array(
'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
)
),
'CalculatedFields' => Array(
'' => Array(
'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
),
'products' => Array(
'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
'ItemName' => 'pr.l1_Name',
'ProductId' => 'pr.ProductId',
),
'product' => Array(
'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
'ItemName' => 'pr.l1_Name',
'ProductId' => 'pr.ProductId',
),
),
// key - special, value - list select sql
'ListSQLs' => Array( ''=>'SELECT %1$s.* %2$s FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
'products' => ' SELECT %1$s.* %2$s
FROM %1$s, '.TABLE_PREFIX.'Products pr
LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
'product' => ' SELECT %1$s.* %2$s
FROM %1$s, '.TABLE_PREFIX.'Products pr
LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
),
'ItemSQLs' => Array( ''=> 'SELECT * FROM %s'),
'ListSortings' => Array(
'' => Array(
'ForcedSorting' => Array('Priority' => 'desc'),
'Sorting' => Array('CreatedOn' => 'desc'),
)
),
'Fields' => Array(
'ReviewId' => Array('type'=>'int'),
'CreatedOn' => Array('formatter'=>'kDateFormatter','not_null'=>1,'default'=>'#NOW#'),
'ReviewText' => Array('type'=>'string','required'=>1,'not_null'=>1,'default'=>''),
'IPAddress' => Array('type'=>'string','max_value_inc'=>15,'not_null'=>1,'default'=>''),
'ItemId' => Array('type'=>'int','not_null'=>1,'default'=>0),
'CreatedById' => Array('formatter'=>'kLEFTFormatter','options'=>Array(-1=>'root',-2=>'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'','left_key_field'=>'PortalUserId','left_title_field'=>'Login','required'=>1,'not_null'=>1,'default'=>-1),
'ItemType' => Array('type'=>'int','not_null'=>1,'default'=>0),
'Priority' => Array('type'=>'int','not_null'=>1,'default'=>0),
'Status' => Array('formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options'=>Array(1=>'la_Active',2=>'la_Pending',0=>'la_Disabled'),'not_null'=>1,'default'=>2 ),
'TextFormat' => Array('type'=>'int','not_null'=>1,'default'=>0),
'Module' => Array('type'=>'string','not_null'=>1,'default'=>''),
),
'VirtualFields' => Array(
'ReviewedBy' => Array(),
),
'Grids' => Array(
'Default' => Array( 'Icons' => Array('default'=>'icon16_custom.gif',1=>'icon16_review.gif',2=>'icon16_review_pending.gif',0=>'icon16_review_disabled.gif'),
'Fields' => Array(
'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'data_block' => 'reviewtext_checkbox_td'),
'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy' ),
'CreatedOn_formatted' => Array( 'title'=>'la_col_CreatedOn', 'sort_field' => 'CreatedOn' ),
'Status' => Array( 'title'=>'la_col_Status' ),
),
),
'ReviewsSection' => Array( 'Icons' => Array('default'=>'icon16_custom.gif',1=>'icon16_review.gif',2=>'icon16_review_pending.gif',0=>'icon16_review_disabled.gif'),
'Fields' => Array(
'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'data_block' => 'grid_checkbox_namelink_td'),
'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy' ),
'CreatedOn_formatted' => Array( 'title'=>'la_col_CreatedOn', 'sort_field' => 'CreatedOn' ),
'Status' => Array( 'title'=>'la_col_Status' ),
),
),
),
);
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/reviews/reviews_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property
Index: trunk/kernel/units/reviews/reviews_event_handler.php
===================================================================
--- trunk/kernel/units/reviews/reviews_event_handler.php (revision 7634)
+++ trunk/kernel/units/reviews/reviews_event_handler.php (revision 7635)
@@ -1,204 +1,215 @@
<?php
class ReviewsEventHandler extends kDBEventHandler
{
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if ($event->Name == 'OnAddReview') {
$item_prefix = $this->getPermPrefix($event);
$res = $this->Application->CheckPermission($item_prefix.'.REVIEW.PENDING', 0) || $this->Application->CheckPermission($item_prefix.'.REVIEW', 0);
if (!$res) {
$event->status = erPERM_FAIL;
}
return $res;
}
return parent::CheckPermission($event);
}
/**
* Returns prefix for permissions
*
* @param kEvent $event
*/
function getPermPrefix(&$event)
{
$main_prefix = $this->Application->GetTopmostPrefix($event->Prefix);
// this will return LINK for l, ARTICLE for n, TOPIC for bb, PRODUCT for p
$item_prefix = $this->Application->getUnitOption($main_prefix, 'PermItemPrefix');
return $item_prefix;
}
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @access protected
* @see OnListBuild
*/
function SetCustomQuery(&$event)
{
$object =& $event->getObject();
switch ($event->Special)
{
case 'showall':
$object->clearFilters();
break;
case 'products':
$object->removeFilter('parent_filter'); // this is important
$object->addFilter('product_reviews', '%1$s.ItemId = pr.ResourceId');
// $object->addFilter('active', '%1$s.Status = 1');
/*$this->Application->setUnitOption('p', 'AutoLoad', true);
$product =& $this->Application->recallObject('p');
$object->addFilter('current_product', 'pr.ResourceId = '.$product->GetDBField('ResourceId'));*/
break;
case 'item':
$object->clearFilters();
$info = $object->getLinkedInfo();
$this->Application->setUnitOption($info['ParentPrefix'], 'AutoLoad', true);
$parent =& $this->Application->recallObject($info['ParentPrefix']);
$object->addFilter('item_reviews', '%1$s.ItemId = '.$parent->GetDBField('ResourceId'));
$object->addFilter('active', '%1$s.Status = 1');
break;
case 'product':
$object->clearFilters();
$object->addFilter('product_reviews', '%1$s.ItemId = pr.ResourceId');
$object->addFilter('active', '%1$s.Status = 1');
$this->Application->setUnitOption('p', 'AutoLoad', true);
$product =& $this->Application->recallObject('p');
$object->addFilter('current_product', 'pr.ResourceId = '.$product->GetDBField('ResourceId'));
break;
}
if($event->getEventParam('type') == 'current_user')
{
$user_id = $this->getUserID();
$ip = $_SERVER['REMOTE_ADDR'];
$object =& $event->getObject( Array('skip_autoload' => true) );
$product_info = $object->getLinkedInfo();
$object->addFilter('current_item', '%1$s.ItemId = '.$product_info['ParentId']);
$object->addFilter('current_user', '%1$s.CreatedById = '.$user_id);
$object->addFilter('current_ip', '%1$s.IPAddress = "'.$ip.'"');
}
}
/**
* Adds review from front in case if user is logged in
*
* @param kEvent $event
*/
function OnAddReview(&$event)
{
$user_id = $this->getUserID();
$event->redirect_params = Array('pass' => 'all,p');
$object =& $event->getObject( Array('skip_autoload' => true) );
$parent_info = $object->getLinkedInfo();
$review_fields = $this->Application->GetVar($event->getPrefixSpecial(true));
$sql = ' SELECT * FROM '.TABLE_PREFIX.'SpamControl
WHERE ItemResourceId='.$parent_info['ParentId'].'
AND IPaddress="'.$_SERVER['REMOTE_ADDR'].'"
AND PortalUserId='.$user_id.'
AND DataType="Review"';
$res = $this->Conn->GetRow($sql);
if( $res && $res['Expire'] < adodb_mktime() )
{
$sql = ' DELETE FROM '.TABLE_PREFIX.'SpamControl
WHERE ItemResourceId='.$parent_info['ParentId'].'
AND IPaddress="'.$_SERVER['REMOTE_ADDR'].'"
AND PortalUserId='.$user_id.'
AND DataType="Review"';
$this->Conn->Query($sql);
unset($res);
}
if(!$res)
{
$object->SetFieldsFromHash( array_shift($review_fields) );
$object->SetDBField('CreatedById', $user_id);
$object->SetDBField('IPAddress', $_SERVER['REMOTE_ADDR']);
$object->SetDBField('CreatedOn', adodb_mktime());
$module_info = $this->Application->findModule('Var',$parent_info['ParentPrefix']);
$object->SetDBField('Module', $module_info['Name']);
if( $this->Application->CheckPermission( $this->getPermPrefix($event).'.REVIEW.PENDING', 0) )
{
$object->SetDBField('Status', 2);
$template_var = 'success_pending_template';
}
if( $this->Application->CheckPermission($this->getPermPrefix($event).'.REVIEW', 0) )
{
$object->SetDBField('Status', 1);
$template_var = 'success_template';
}
$object->SetDBField('ItemId', $parent_info['ParentId']);
$event->CallSubEvent('OnCreate');
if($event->status == erSUCCESS)
{
$parent =& $this->Application->recallObject($parent_info['ParentPrefix']);
$sql = ' SELECT COUNT(ReviewId)
FROM '.$object->TableName.'
WHERE ItemId='.$parent_info['ParentId'];
$review_qty = $this->Conn->GetOne($sql);
$parent->SetDBField('CachedReviewsQty', $review_qty);
$parent->Update();
$expire = adodb_mktime() + $this->Application->ConfigValue('product_ReviewDelay_Value') * $this->Application->ConfigValue('product_ReviewDelay_Interval');
$sql = ' INSERT INTO '.TABLE_PREFIX.'SpamControl
(ItemResourceId, IPaddress, PortalUserId, DataType, Expire)
VALUES ('.$parent_info['ParentId'].',
"'.$_SERVER['REMOTE_ADDR'].'",
'.$user_id.',
"Review",
'.$expire.')';
$this->Conn->Query($sql);
$event->redirect_params = Array('pass' => 'all,'.$parent_info['ParentPrefix']);
$event->redirect = $this->Application->GetVar($template_var);
}
}
else
{
// $this->Application->removeObject($event->getPrefixSpecial());
$event->status == erFAIL;
$event->redirect=false;
$object->FieldErrors['ReviewText']['pseudo'] = 'too_frequent';
$object->ErrorMsgs['too_frequent'] = $this->Application->Phrase('lu_ferror_review_duplicate');
}
}
-
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ $object =& $event->getObject();
+ $object->SetDBField('Module', $this->Application->findModule('Var',$this->Application->getUnitOption($this->Prefix, 'ParentPrefix'), 'Name'));
+ }
+
/**
* Returns current user id for reviews, for logic ask Kostja T.
*
* @return int
*/
function getUserID()
{
$user_id = $this->Application->RecallVar('user_id');
-
+
if ($user_id == 0) {
$user_id = -2;
}
-
+
return $user_id;
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/reviews/reviews_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.9
\ No newline at end of property
+1.10
\ No newline at end of property
Index: trunk/kernel/units/sections/sections_config.php
===================================================================
--- trunk/kernel/units/sections/sections_config.php (revision 7634)
+++ trunk/kernel/units/sections/sections_config.php (revision 7635)
@@ -1,343 +1,355 @@
<?php
$config = Array(
'Prefix' => 'inportal-sections',
'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
// 'SectionPrefix' => 'u',
'Sections' => Array(
'in-portal:root' => Array(
'parent' => null,
'icon' => 'in-portal:site',
'label' => $this->Application->ConfigValue('Site_Name'),
'url' => Array('t' => 'sections_list', 'pass' => 'm', 'pass_section' => true, 'no_amp' => 1),
'permissions' => Array('advanced:admin_login', 'advanced:front_login'),
'priority' => 0,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
'in-portal:site' => Array(
'parent' => 'in-portal:root',
'icon' => 'in-portal:struct',
'label' => 'la_tab_Site_Structure',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 1,
'type' => stTREE,
'SectionPrefix' => 'c',
),
'in-portal:browse' => Array(
'parent' => 'in-portal:site',
'icon' => 'in-portal:catalog',
'label' => 'la_tab_Browse',
'url' => Array('t' => 'in-portal/catalog', 'pass' => 'm'),
'late_load' => Array('t' => 'in-portal/xml/tree_categories', 'pass' => 'm', 'm_cat_id' => 0),
'onclick' => 'checkCatalog(0)',
'permissions' => Array('view'),
'priority' => 0.1,
'type' => stTREE,
),
'in-portal:advanced_view' => Array(
'parent' => 'in-portal:site',
'icon' => 'in-portal:advanced_view',
'label' => 'la_tab_AdvancedView',
'url' => Array('t' => 'in-portal/advanced_view', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 0.2,
'type' => stTREE,
),
'in-portal:reviews' => Array(
'parent' => 'in-portal:site',
'icon' => 'in-portal:reviews',
'label' => 'la_tab_Reviews',
'url' => Array('index_file' => 'reviews.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:configure_categories' => Array(
'parent' => 'in-portal:site',
'icon' => 'in-portal:cat_settings',
'label' => 'la_tab_Settings',
'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:configuration_search' => Array(
'parent' => 'in-portal:site',
'icon' => 'in-portal:settings_search',
'label' => 'la_tab_ConfigSearch',
'url' => Array('t' => 'in-portal/config/config_search', 'module_key' => 'category', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:configuration_email' => Array(
'parent' => 'in-portal:site',
'icon' => 'in-portal:settings_email',
'label' => 'la_tab_ConfigE-mail',
'url' => Array('t' => 'in-portal/config/config_email', 'module' => 'In-Portal:Category', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 6,
'type' => stTREE,
),
'in-portal:configuration_custom' => Array(
'parent' => 'in-portal:site',
'icon' => 'in-portal:settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array('t' => 'in-portal/custom_fields/custom_fields_list', 'cf_type' => 1, 'pass_section' => true, 'pass' => 'm,cf'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 7,
'type' => stTREE,
),
'in-portal:users' => Array(
'parent' => 'in-portal:root',
'icon' => 'in-portal:community',
'label' => 'la_tab_Community',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 2,
'type' => stTREE,
'SectionPrefix' => 'u',
),
+ 'in-portal:user_list' => Array(
+ 'parent' => 'in-portal:users',
+ 'icon' => 'in-portal:users',
+ 'label' => 'la_tab_User_List',
+ 'url' => Array('index_file' => 'users/user_list.php', 'pass' => 'm', 'resetpage' => 1),
+ 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:ban', 'advanced:send_email', /*'advanced:add_favorite', 'advanced:remove_favorite',*/),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:k4_user_list' => Array(
+ 'parent' => 'in-portal:users',
+ 'icon' => 'in-portal:users',
+ 'label' => 'la_title_K4Users',
+ 'url' => Array('t' => 'in-portal/users/users_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:ban', 'advanced:send_email', /*'advanced:add_favorite', 'advanced:remove_favorite',*/),
+ 'priority' => 1.5,
+ 'debug_only' => true,
+ 'type' => stTREE,
+ ),
+
'in-portal:user_groups' => Array(
'parent' => 'in-portal:users',
'icon' => 'in-portal:usergroups',
'label' => 'la_tab_User_Groups',
'url' => Array('t' => 'in-portal/groups/groups_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:send_email', 'advanced:manage_permissions'),
'priority' => 2,
'type' => stTREE,
),
- 'in-portal:user_list' => Array(
- 'parent' => 'in-portal:users',
- 'icon' => 'in-portal:users',
- 'label' => 'la_tab_User_List',
- 'url' => Array('index_file' => 'users/user_list.php', 'pass' => 'm', 'resetpage' => 1),
- 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:ban', 'advanced:send_email', /*'advanced:add_favorite', 'advanced:remove_favorite',*/),
- 'priority' => 1,
- 'type' => stTREE,
- ),
-
+
'in-portal:configure_users' => Array(
'parent' => 'in-portal:users',
'icon' => 'in-portal:users_settings',
'label' => 'la_tab_ConfigSettings',
'url' => Array('t' => 'config/config_universal', 'module' => 'In-Portal:Users', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:user_email' => Array(
'parent' => 'in-portal:users',
'icon' => 'in-portal:settings_email',
'label' => 'la_tab_ConfigE-mail',
'url' => Array('t' => 'config/config_email', 'module' => 'In-Portal:Users', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:user_custom' => Array(
'parent' => 'in-portal:users',
'icon' => 'in-portal:settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 6, 'pass_section' => true, 'pass' => 'm,cf'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:user_banlist' => Array(
'parent' => 'in-portal:users',
'icon' => 'in-portal:banlist',
'label' => 'la_tab_BanList',
'url' => Array('index_file' => 'config/edit_banlist.php', 'DataType' => 6, 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 6,
'type' => stTREE,
),
// "Help" section
'in-portal:help' => Array(
'parent' => 'in-portal:root',
'icon' => 'in-portal:help',
'label' => 'la_tab_Help',
'url' => Array('index_file' => 'help/manual.pdf', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 7,
'type' => stTREE,
),
// "Summary & Logs" section
'in-portal:reports' => Array(
'parent' => 'in-portal:root',
'icon' => 'in-portal:summary_logs',
'label' => 'la_tab_Reports',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 4,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
'in-portal:log_summary' => Array(
'parent' => 'in-portal:reports',
'icon' => 'in-portal:summary',
'label' => 'la_tab_Summary',
'url' => Array('index_file' => 'logs/summary.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:searchlog' => Array(
'parent' => 'in-portal:reports',
'icon' => 'in-portal:search_log',
'label' => 'la_tab_SearchLog',
'url' => Array('index_file' => 'logs/searchlog.php', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:sessionlog' => Array(
'parent' => 'in-portal:reports',
'icon' => 'in-portal:sessions_log',
'label' => 'la_tab_SessionLog',
'url' => Array('index_file' => 'logs/session_list.php', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:emaillog' => Array(
'parent' => 'in-portal:reports',
'icon' => 'in-portal:email_log',
'label' => 'la_tab_EmailLog',
'url' => Array('index_file' => 'logs/email_log.php', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:visits' => Array(
'parent' => 'in-portal:reports',
'icon' => 'in-portal:visits',
'label' => 'la_tab_Visits',
'url' => Array('t' => 'in-portal/visits/visits_list', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 5,
'type' => stTREE,
),
// "Configuration" section
'in-portal:system' => Array(
'parent' => 'in-portal:root',
'icon' => 'in-portal:conf',
'label' => 'la_tab_Sys_Config',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 5,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
'in-portal:configure_general' => Array(
'parent' => 'in-portal:system',
'icon' => 'in-portal:conf_general',
'label' => 'la_tab_General',
'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'module' => 'In-Portal', 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:configure_themes' => Array(
'parent' => 'in-portal:system',
'icon' => 'in-portal:conf_themes',
'label' => 'la_tab_Themes',
'url' => Array('index_file' => 'config/config_theme.php', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 3,
'type' => stTREE,
),
// "Tools" section
'in-portal:tools' => Array(
'parent' => 'in-portal:root',
'icon' => 'in-portal:tools',
'label' => 'la_tab_Tools',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 6,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
'in-portal:backup' => Array(
'parent' => 'in-portal:tools',
'icon' => 'in-portal:tool_backup',
'label' => 'la_tab_Backup',
'url' => Array('index_file' => 'backup/backup1.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:restore' => Array(
'parent' => 'in-portal:tools',
'icon' => 'in-portal:tool_restore',
'label' => 'la_tab_Restore',
'url' => Array('index_file' => 'backup/restore1.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:main_import' => Array(
'parent' => 'in-portal:tools',
'icon' => 'in-portal:tool_import',
'label' => 'la_tab_ImportData',
'url' => Array('index_file' => 'import/step1.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:sql_query' => Array(
'parent' => 'in-portal:tools',
'icon' => 'in-portal:tool_import',
'label' => 'la_tab_QueryDB',
'url' => Array('index_file' => 'tools/sql_query.php', 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:server_info' => Array(
'parent' => 'in-portal:tools',
'icon' => 'in-portal:server_info',
'label' => 'la_tab_ServerInfo',
'url' => Array('index_file' => 'tools/server_info.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 6,
'type' => stTREE,
),
),
);
\ No newline at end of file
Property changes on: trunk/kernel/units/sections/sections_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/kernel/units/modules/modules_event_handler.php
===================================================================
--- trunk/kernel/units/modules/modules_event_handler.php (revision 7634)
+++ trunk/kernel/units/modules/modules_event_handler.php (revision 7635)
@@ -1,79 +1,79 @@
<?php
class ModulesEventHandler extends kDBEventHandler {
/**
* Builds item
*
* @param kEvent $event
* @access protected
*/
function OnItemBuild(&$event)
{
$this->Application->SetVar($event->getPrefixSpecial(true).'_id', $event->Special);
parent::OnItemBuild($event);
}
/**
* List with one record if special passed
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
if ($event->Special) {
$object =& $event->getObject();
$object->addFilter('current_module', 'Name = '.$event->Special);
}
}
function mapEvents()
{
parent::mapEvents();
$this->eventMethods['OnMassApprove'] = 'moduleAction';
$this->eventMethods['OnMassDecline'] = 'moduleAction';
}
/**
* Disabled modules, but not In-Portal
*
* @param kEvent $event
*/
function moduleAction(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$object =& $event->getObject( Array('skip_autoload' => true) );
$ids = $this->StoreSelectedIDs($event);
if (!$ids) return true;
$status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') );
foreach($ids as $id)
{
$object->Load($id);
if ($object->GetID() == 'In-Portal') continue;
$object->SetDBField($status_field, $event->Name == 'OnMassApprove' ? 1 : 0);
if ($object->Update()) {
$event->status = erSUCCESS;
- $event->redirect_params = Array('opener' => 's', 'pass_events' => true); //stay!
+ $event->redirect_params = Array('opener' => 's'); //stay!
}
else {
$event->status = erFAIL;
$event->redirect = false;
break;
}
}
$this->Application->UnitConfigReader->ResetParsedData(true); //true to reset sections cache also
$event->SetRedirectParam('RefreshTree', 1);
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/modules/modules_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.9
\ No newline at end of property
+1.10
\ No newline at end of property
Index: trunk/kernel/include/custommetadata.php
===================================================================
--- trunk/kernel/include/custommetadata.php (revision 7634)
+++ trunk/kernel/include/custommetadata.php (revision 7635)
@@ -1,175 +1,184 @@
<?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 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);
+ $tables = $temp_handler->Tables;
+ $parent_prefix = $this->Application->getUnitOption($main_prefix.'-cdata', 'ParentPrefix');
+ if ($parent_prefix) {
+ $tables['ForeignKey'] = $this->Application->getUnitOption($main_prefix.'-cdata', 'ForeignKey');
+ $tables['ParentPrefix'] = $parent_prefix;
+ $tables['ParentTableKey'] = $this->Application->getUnitOption($main_prefix.'-cdata', 'ParentTableKey');
+ }
+ $temp_handler->Tables = $tables;
+
$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: trunk/kernel/include/custommetadata.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.12
\ No newline at end of property
+1.13
\ No newline at end of property
Index: trunk/kernel/include/category.php
===================================================================
--- trunk/kernel/include/category.php (revision 7634)
+++ trunk/kernel/include/category.php (revision 7635)
@@ -1,2586 +1,2590 @@
<?php
define('TYPE_CATEGORY', 0);
$DownloadId=0;
RegisterPrefix("clsCategory","cat","kernel/include/category.php");
class clsCategory extends clsItem
{
var $Permissions;
var $DescriptionField = '';
function clsCategory($CategoryId=NULL)
{
global $objSession;
$this->clsItem(TRUE);
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$this->TitleField = $ml_formatter->LangFieldName('Name');
$this->DescriptionField = $ml_formatter->LangFieldName('Description');
$this->tablename = GetTablePrefix()."Category";
$this->type=1;
$this->BasePermission ="CATEGORY";
$this->id_field = "CategoryId";
$this->TagPrefix = "cat";
$this->Prefix = 'c';
$this->debuglevel=0;
/* keyword highlighting */
$this->OpenTagVar = "Category_Highlight_OpenTag";
$this->CloseTagVar = "Category_Highlight_CloseTag";
if($CategoryId!=NULL)
{
$this->LoadFromDatabase($CategoryId);
$this->Permissions = new clsPermList($CategoryId,$objSession->Get("GroupId"));
}
else
{
$this->Permissions = new clsPermList();
}
}
function StripDisallowed($string)
{
$not_allowed = Array( ' ', '\\', '/', ':', '*', '?', '"', '<', '>', '|', '`',
'~', '!', '@', '#', '$', '%', '^', '&', '(', ')', '~',
'+', '=', '-', '{', '}', ']', '[', "'", ';', '.', ',');
$string = str_replace($not_allowed, '_', $string);
$string = preg_replace('/(_+)/', '_', $string);
$string = $this->checkAutoFilename($string);
return $string;
}
function checkAutoFilename($filename)
{
global $m_var_list;
if(!$filename || $this->UniqueId() == 0 ) return $filename;
$db =& GetADODBConnection();
$sql = 'SELECT CategoryId FROM '.$this->tablename.' WHERE (Filename = '.$db->qstr($filename).') AND (ParentId = '.$m_var_list['cat'].')';
$found_category_ids = $db->GetCol($sql);
$has_page = preg_match('/(.*)_([\d]+)([a-z]*)$/', $filename, $rets);
$duplicates_found = (count($found_category_ids) > 1) || ($found_category_ids && $found_category_ids[0] != $this->UniqueId());
if ($duplicates_found || $has_page)
{
$append = $duplicates_found ? '_a' : '';
if($has_page)
{
$filename = $rets[1].'_'.$rets[2];
$append = $rets[3] ? $rets[3] : '_a';
}
$sql = 'SELECT CategoryId FROM '.$this->tablename.' WHERE (Filename = %s) AND (CategoryId != '.$this->UniqueId().') AND (ParentId = '.$m_var_list['cat'].')';
while ( $db->GetOne( sprintf($sql, $db->qstr($filename.$append)) ) > 0 )
{
if (substr($append, -1) == 'z') $append .= 'a';
$append = substr($append, 0, strlen($append) - 1) . chr( ord( substr($append, -1) ) + 1 );
}
return $filename.$append;
}
return $filename;
}
function GenerateFilename()
{
if ( !$this->Get('AutomaticFilename') && $this->Get('Filename') )
{
$name = $this->Get('Filename');
}
else
{
$name = $this->Get($this->TitleField);
}
$name = $this->StripDisallowed($name);
if ( $name != $this->Get('Filename') ) $this->Set('Filename', $name);
}
function ClearCacheData()
{
/*$env = "':m".$this->Get("CategoryId")."%'";
DeleteTagCache("m_list_cats","",$env); */
DeleteTagCache("m_itemcount","Category%");
DeleteModuleTagCache('kernel');
}
function DetectChanges($name, $value)
{
global $objSession;
//print_pre($_POST);
if (!isset($this->Data[$name]) ) return false;
if ($this->Data[$name] != $value) {
//echo "$name Modified tt ".$this->Data[$name]." tt $value<br>";
if (!stristr($name, 'Modif') && !stristr($name, 'Created')) {
if ($objSession->GetVariable("HasChanges") != 1) {
$objSession->SetVariable("HasChanges", 2);
}
}
}
}
function Delete()
{
global $CatDeleteList;
if(!is_array($CatDeleteList))
$CatDeleteList = array();
if($this->UsingTempTable()==FALSE)
{
$this->Permissions->Delete_CatPerms($this->Get("CategoryId"));
// TODO: find way to delete specific category cache only
/*$sql = "DELETE FROM ".GetTablePrefix()."CountCache WHERE CategoryId=".$this->Get("CategoryId");
$this->adodbConnection->Execute($sql);*/
$CatDeleteList[] = $this->Get("CategoryId");
if($this->Get("CreatedById")>0)
$this->SendUserEventMail("CATEGORY.DELETE",$this->Get("CreatedById"));
$this->SendAdminEventMail("CATEGORY.DELETE");
parent::Delete();
$this->ClearCacheData();
}
else
{
parent::Delete();
}
}
function Update($UpdatedBy=NULL)
{
parent::Update($UpdatedBy);
$this->GenerateFilename();
parent::Update($UpdatedBy);
if ($this->tablename == GetTablePrefix().'Category') $this->ClearCacheData();
}
function Create()
{
if( (int)$this->Get('CreatedOn') == 0 ) $this->Set('CreatedOn', adodb_date('U') );
parent::Create();
$this->GenerateFilename();
parent::Update();
if ($this->tablename == GetTablePrefix().'Category') $this->ClearCacheData();
}
function SetParentId($value)
{
//Before we set a parent verify that propsed parent is not our child.
//Otherwise it will cause recursion.
$id = $this->Get("CategoryId");
$path = $this->Get("ParentPath");
$sql = sprintf("SELECT CategoryId From ".GetTablePrefix()."Category WHERE ParentPath LIKE '$path%' AND CategoryId = %d ORDER BY ParentPath",$value);
$rs = $this->adodbConnection->SelectLimit($sql,1,0);
if(!$rs->EOF)
{
return;
}
$this->Set("ParentId",$value);
}
function Approve()
{
global $objSession;
if($this->Get("CreatedById")>0)
$this->SendUserEventMail("CATEGORY.APPROVE",$this->Get("CreatedById"));
$this->SendAdminEventMail("CATEGORY.APPROVE");
$this->Set("Status", 1);
$this->Update();
}
function Deny()
{
global $objSession;
if($this->Get("CreatedById")>0)
$this->SendUserEventMail("CATEGORY.DENY",$this->Get("CreatedById"));
$this->SendAdminEventMail("CATEGORY.DENY");
$this->Set("Status", 0);
$this->Update();
}
function IsEditorsPick()
{
return $this->Is("EditorsPick");
}
function SetEditorsPick($value)
{
$this->Set("EditorsPick", $value);
}
function GetSubCats($limit=NULL, $target_template=NULL, $separator=NULL, $anchor=NULL, $ending=NULL, $class=NULL)
{
global $m_var_list, $m_var_list_update, $var_list, $var_list_update;
$sql = " SELECT CategoryId, ".$this->TitleField."
FROM ".GetTablePrefix()."Category
WHERE ParentId=".$this->Get("CategoryId")." AND Status=1
ORDER BY Priority";
if(isset($limit))
{
$rs = $this->adodbConnection->SelectLimit($sql, $limit, 0);
}
else
{
$rs = $this->adodbConnection->Execute($sql);
}
$count=1;
$class_name = is_null($class)? "catsub" : $class;
while($rs && !$rs->EOF)
{
$var_list_update["t"] = !is_null($target_template)? $target_template : $var_list["t"];
$m_var_list_update["cat"] = $rs->fields["CategoryId"];
$m_var_list_update["p"] = "1";
$cat_name = $rs->fields[$this->TitleField];
if (!is_null($anchor))
$ret .= "<a class=\"$class_name\" href=\"". HREF_Wrapper() . "\">$cat_name</a>";
else
$ret .= "<span=\"$class_name\">$cat_name</span>";
$rs->MoveNext();
if(!$rs->EOF)
{
$ret.= is_null($separator)? ", " : $separator;
}
}
if(strlen($ret))
$ret .= is_null($ending)? " ..." : $ending;
unset($var_list_update["t"], $m_var_list_update["cat"], $m_var_list_update["p"]);
return $ret;
}
function Validate()
{
global $objSession;
$dataValid = true;
if(!isset($this->m_Type))
{
$Errors->AddError("error.fieldIsRequired",'Type',"","","clsCategory","Validate");
$dataValid = false;
}
if(!isset($this->m_Name))
{
$Errors->AddError("error.fieldIsRequired",'Name',"","","clsCategory","Validate");
$dataValid = false;
}
if(!isset($this->m_Description))
{
$Errors->AddError("error.fieldIsRequired",'Description',"","","clsCategory","Validate");
$dataValid = false;
}
if(!isset($this->m_Visible))
{
$Errors->AddError("error.fieldIsRequired",'Visible',"","","clsCategory","Validate");
$dataValid = false;
}
if(!isset($this->m_CreatedById))
{
$Errors->AddError("error.fieldIsRequired",'CreatedBy',"","","clsCategory","Validate");
$dataValid = false;
}
return $dataValid;
}
function UpdateCachedPath()
{
if( $this->UsingTempTable() == true) return ;
$Id = $this->Get('CategoryId');
$Id2 = $Id;
$path_parts = Array();
$nav_parts = Array();
$named_parts = Array();
$cateogry_template = '';
$item_template = '';
$ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
$language_count = $ml_helper->getLanguageCount();
$primary_lang_id = $this->Application->GetDefaultLanguageId();
do {
$rs = $this->adodbConnection->Execute('SELECT * FROM '.$this->tablename.' WHERE CategoryId = '.$Id2);
$path_parts[] = $Id2;
$named_parts[] = $rs->fields['Filename'];
$i = 1;
while ($i <= $language_count) {
$nav_parts[$i][] = $rs->fields['l'.$i.'_Name'] ? $rs->fields['l'.$i.'_Name'] : $rs->fields['l'.$primary_lang_id.'_Name'];
$i++;
}
if (!$cateogry_template && $rs->fields['CachedCategoryTemplate']) {
$cateogry_template = $rs->fields['CachedCategoryTemplate'];
}
$Id2 = ($rs && !$rs->EOF) ? $rs->fields['ParentId'] : '0';
} while ($Id2 != '0');
$parent_path = '|'.implode('|', array_reverse($path_parts) ).'|';
$named_path = implode('/', array_reverse($named_parts) );
$i = 1;
while ($i <= $language_count) {
$this->Set('l'.$i.'_CachedNavbar', implode('&|&', array_reverse($nav_parts[$i]) ));
$i++;
}
$this->Set('ParentPath', $parent_path);
$this->Set('NamedParentPath', $named_path);
$this->Set('CachedCategoryTemplate', $cateogry_template);
$this->Update();
}
function GetCachedNavBar()
{
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$navbar_field = $ml_formatter->LangFieldName('CachedNavbar');
$res = $this->Get($navbar_field);
if (!strlen($res)) {
$this->UpdateCachedPath();
$res = $this->Get($navbar_field);
}
return str_replace('&|&', ' > ', $res);
}
function Increment_Count()
{
$this->Increment("CachedDescendantCatsQty");
}
function Decrement_Count()
{
$this->Decrement("CachedDescendantCatsQty");
$this->Update();
}
function LoadFromDatabase($Id)
{
global $objSession, $Errors, $objConfig;
if($Id==0)
return FALSE;
if(!isset($Id))
{
$Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromDatabase");
return false;
}
$sql = sprintf("SELECT * FROM ".$this->tablename." WHERE CategoryId = '%s'",$Id);
$result = $this->adodbConnection->Execute($sql);
if ($result === false)
{
$Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase");
return false;
}
$data = $result->fields;
if(is_array($data))
{
$this->SetFromArray($data);
$this->Clean();
}
else
return false;
return true;
}
function SetNewItem()
{
global $objConfig;
$value = $this->Get("CreatedOn");
$cutoff = adodb_date("U") - ($objConfig->Get("Category_DaysNew") * 86400);
$this->IsNew = FALSE;
if($value>$cutoff)
$this->IsNew = TRUE;
return $this->IsNew;
}
function LoadFromResourceId($Id)
{
global $objSession, $Errors;
if(!isset($Id))
{
$Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromResourceId");
return false;
}
$sql = sprintf("SELECT * FROM ".$this->tablename." WHERE ResourceId = '%s'",$Id);
$result = $this->adodbConnection->Execute($sql);
if ($result === false)
{
$Errors->AddError("error.DatabaseError",NULL,$adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromResourceId");
return false;
}
$data = $result->fields;
if(is_array($data))
$this->SetFromArray($data);
else
return false;
return true;
}
function GetParentField($fieldname,$skipvalue,$default)
{
/* this function moves up the category tree until a value for $field other than
$skipvalue is returned. if no matches are made, then $default is returned */
$path = $this->Get("ParentPath");
$path = substr($path,1,-1); //strip off the first & last tokens
$aPath = explode("|",$path);
$aPath = array_slice($aPath,0,-1);
$ParentPath = implode("|",$aPath);
$sql = "SELECT $fieldname FROM ".GetTablePrefix()."Category WHERE $fieldname != '$skipvalue' AND ParentPath LIKE '$ParentPath' ORDER BY ParentPath DESC";
$rs = $this->adodbConnection->execute($sql);
if($rs && !$rs->EOF)
{
$ret = $rs->fields[$fieldname];
}
else
{
$ret = $default;
}
$update = "UPDATE ".$this->tablename." SET $fieldname='$ret' WHERE CategoryId=".$this->Get("CategoryId");
$this->adodbConnection->execute($update);
return $ret;
}
function GetCustomField($fieldName)
{
global $objSession, $Errors;
if(!isset($this->m_CategoryId))
{
$Errors->AddError("error.appError","Get field is required in order to set custom field values","","",get_class($this),"GetCustomField");
return false;
}
return GetCustomFieldValue($this->m_CategoryId,"category",$fieldName);
}
function SetCustomField($fieldName, $value)
{
global $objSession, $Errors;
if(!isset($this->m_CategoryId))
{
$Errors->AddError("error.appError","Set field is required in order to set custom field values","","",get_class($this),"SetCustomField");
return false;
}
return SetCustomFieldValue($this->m_CategoryId,"category",$fieldName,$value);
}
function LoadPermissions($first=1)
{
/* load all permissions for group on this category */
$this->Permissions->CatId=$this->Get("CategoryId");
if($this->Permissions->NumItems()==0)
{
$cats = explode("|",substr($this->Get("ParentPath"),1,-1));
if(is_array($cats))
{
$cats = array_reverse($cats);
$cats[] = 0;
foreach($cats as $catid)
{
$this->Permissions->LoadCategory($catid);
}
}
}
if($this->Permissions->NumItems()==0)
{
if($first==1)
{
$this->Permissions->GroupId=NULL;
$this->LoadPermissions(0);
}
}
}
function PermissionObject()
{
return $this->Permissions;
}
function PermissionItemObject($PermissionName)
{
$p = $this->Permissions->GetPermByName($PermissionName);
return $p;
}
function HasPermission($PermissionName,$GroupID)
{
global $objSession;
$perm = $this->PermissionValue($PermissionName,$GroupID);
// echo "Permission $PermissionName for $GroupID is $perm in ".$this->Get("CategoryId")."<br>\n";
if(!$perm)
{
$perm=$objSession->HasSystemPermission("ROOT");
}
return ($perm==1);
}
function PermissionValue($PermissionName,$GroupID)
{
//$this->LoadPermissions();
$ret=NULL;
//echo "Looping though ".count($this->Permissions)." permissions Looking for $PermissionName of $GroupID<br>\n";
if($this->Permissions->GroupId != $GroupID)
{
$this->Permissions->Clear();
$this->Permissions->GroupId = $GroupID;
}
$this->Permissions->CatId=$this->Get("CategoryId");
$ret = $this->Permissions->GetPermissionValue($PermissionName);
if($ret == NULL)
{
$cats = explode("|",substr($this->Get("ParentPath"),1,-1));
if(is_array($cats))
{
$cats = array_reverse($cats);
$cats[] = 0;
foreach($cats as $catid)
{
$this->Permissions->LoadCategory($catid);
$ret = $this->Permissions->GetPermissionValue($PermissionName);
if(is_numeric($ret))
break;
}
}
}
return $ret;
}
function SetPermission($PermName,$GroupID,$Value,$Type=0)
{
global $objSession, $objPermissions, $objGroups;
if($this->Permissions->GroupId != $GroupID)
{
$this->Permissions->Clear();
$this->Permissions->GroupId = $GroupID;
}
if($objSession->HasSystemPermission("GRANT"))
{
$current = $this->PermissionValue($PermName,$GroupID);
if($current == NULL)
{
$this->Permissions->Add_Permission($this->Get("CategoryId"),$GroupId,$PermName,$Value,$Type);
}
else
{
$p = $this->Permissions->GetPermByName($PermName);
if($p->Inherited==FALSE)
{
$p->Set("PermissionValue",$Value);
$p->Update();
}
else
$this->Permissions->Add_Permission($this->Get("CategoryId"),$GroupId,$PermName,$Value,$Type);
}
if($PermName == "CATEGORY.VIEW")
{
$Groups = $objGroups->GetAllGroupList();
$ViewList = $this->Permissions->GetGroupPermList($this,"CATEGORY.VIEW",$Groups);
$this->SetViewPerms("CATEGORY.VIEW",$ViewList,$Groups);
$this->Update();
}
}
}
function SetViewPerms($PermName,$acl,$allgroups)
{
global $objPermCache;
$dacl = array();
if(!is_array($allgroups))
{
global $objGroups;
$allgroups = $objGroups->GetAllGroupList();
}
for($i=0;$i<count($allgroups);$i++)
{
$g = $allgroups[$i];
if(!in_array($g,$acl))
$dacl[] = $g;
}
if(count($acl)<count($dacl))
{
$aval = implode(",",$acl);
$dval = "";
}
else
{
$dval = implode(",",$dacl);
$aval = "";
}
if(strlen($aval)==0 && strlen($dval)==0)
{
$aval = implode(",",$allgroups);
}
$PermId = $this->Permissions->GetPermId($PermName);
$pc = $objPermCache->GetPerm($this->Get("CategoryId"),$PermId);
if(is_object($pc))
{
$pc->Set("ACL",$aval);
$pc->Set("DACL",$dval);
$pc->Update();
}
else
$objPermCache->AddPermCache($this->Get("CategoryId"),$PermId,$aval,$dval);
//$this->Update();
}
function GetACL($PermName)
{
global $objPermCache;
$ret = "";
$PermId = $this->Permissions->GetPermId($PermName);
$pc = $objPermCache->GetPerm($this->Get("CategoryId"),$PermId);
if(is_object($pc))
{
$ret = $this->Get("ACL");
}
return $ret;
}
function UpdateACL()
{
$q = 'INSERT INTO '.TABLE_PREFIX.'PermCache (CategoryId, PermId, ACL, DACL)
SELECT '.$this->UniqueId().', PermId, ACL, DACL
FROM '.TABLE_PREFIX.'PermCache
WHERE CategoryId = '.$this->Get('ParentId');
$this->Conn->Query($q);
}
function Cat_Link()
{
global $m_var_list_update;
$m_var_list_update["cat"] = $this->Get("CategoryId");
$ret = HREF_Wrapper();
unset($m_var_list_update["cat"]);
return $ret;
}
function Parent_Link()
{
global $m_var_list_update;
$m_var_list_update["cat"] = $this->Get("ParentId");
$ret = HREF_Wrapper();
unset($m_var_list_update["cat"]);
return $ret;
}
function Admin_Parent_Link($page=NULL)
{
global $m_var_list_update;
if(!strlen($page))
$page = $_SERVER["PHP_SELF"];
$m_var_list_update["cat"] = $this->Get("ParentId");
$ret = $page."?env=".BuildEnv();
unset($m_var_list_update["cat"]);
return $ret;
}
function StatusIcon()
{
global $imagesURL;
$ret = $imagesURL."/itemicons/";
switch($this->Get("Status"))
{
case STATUS_DISABLED:
$ret .= "icon16_cat_disabled.gif";
break;
case STATUS_PENDING:
$ret .= "icon16_cat_pending.gif";
break;
case STATUS_ACTIVE:
$img = "icon16_cat.gif";
if($this->IsPopItem())
$img = "icon16_cat_pop.gif";
if($this->IsHotItem())
$img = "icon16_cat_hot.gif";
if($this->IsNewItem())
$img = "icon16_cat_new.gif";
if($this->Is("EditorsPick"))
$img = "icon16_car_pick.gif";
$ret .= $img;
break;
}
return $ret;
}
function SubCatCount()
{
$ret = $this->Get("CachedDescendantCatsQty");
$sql = "SELECT COUNT(*) as SubCount FROM ".$this->tablename." WHERE ParentPath LIKE '".$this->Get("ParentPath")."%' AND CategoryId !=".$this->Get("CategoryId");
$rs = $this->adodbConnection->Execute($sql);
if($rs && !$rs->EOF)
{
$val = $rs->fields["SubCount"];
if($val != $this->Get("CachedDescendantCatsQty"))
{
$this->Set("CachedDescendantCatsQty",$val);
$this->Update();
}
$ret = $this->Get("CachedDescendantCatsQty");
}
return $ret;
}
function GetSubCatIds()
{
$sql = "SELECT CategoryId FROM ".$this->tablename." WHERE ParentPath LIKE '".$this->Get("ParentPath")."%' AND CategoryId !=".$this->Get("CategoryId");
$rs = $this->adodbConnection->Execute($sql);
$ret = array();
while($rs && !$rs->EOF)
{
$ret[] = $rs->fields["CategoryId"];
$rs->MoveNext();
}
return $ret;
}
function GetParentIds()
{
$Parents = array();
$ParentPath = $this->Get("ParentPath");
if(strlen($ParentPath))
{
$ParentPath = substr($ParentPath,1,-1);
$Parents = explode("|",$ParentPath);
}
return $Parents;
}
function ItemCount($ItemType="")
{
global $objItemTypes,$objCatList,$objCountCache;
if(!is_numeric($ItemType))
{
$TypeId = $objItemTypes->GetItemTypeValue($ItemType);
}
else
$TypeId = (int)$ItemType;
//$path = $this->Get("ParentPath");
//$path = substr($path,1,-1);
//$path = str_replace("|",",",$path);
$path = implode(",",$this->GetSubCatIds());
if(strlen($path))
{
$path = $this->Get("CategoryId").",".$path;
}
else
$path = $this->Get("CategoryId");
$res = TableCount(GetTablePrefix()."CategoryItems","CategoryId IN ($path)",FALSE);
return $res;
}
function GetNavbar()
{
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
return str_replace('&|&', ' > ', $this->Get($ml_formatter->LangFieldName('CachedNavbar')));
}
function ParseObject($element)
{
global $objConfig, $objCatList, $rootURL, $var_list, $var_list_update, $m_var_list_update, $objItemTypes,$objCountCache, $objUsers;
$extra_attribs = ExtraAttributes($element->attributes);
//print_r($element);
if(strtolower($element->name)==$this->TagPrefix)
{
$field = strtolower( $element->GetAttributeByName('_field') );
switch($field)
{
case 'filename':
$ret = $this->Get('Filename');
break;
case 'm_language':
$ret = language( $element->GetAttributeByName('_Phrase') );
break;
case 'parentcategorylink':
$m_var_list_update['cat'] = $this->Get('ParentId');
$m_var_list_update['p'] = 1;
$ret = str_replace('advanced_view.php','browse.php',$_SERVER['PHP_SELF']).'?env='.BuildEnv();
unset($m_var_list_update['cat']);
unset($m_var_list_update['p']);
return $ret;
break;
case 'primarycategory':
$ret = $this->Get('CachedNavbar');
if($ret) // category not in root
{
$ret = explode('>',$ret);
array_pop($ret);
$ret = implode('>',$ret);
}
$ret = prompt_language($objConfig->Get("Root_Name")).($ret ? '>' : '').$ret;
break;
case "name":
case "Name":
/*
@field:cat.name
@description:Category name
*/
$ret = $this->HighlightField($this->TitleField);
break;
case "description":
/*
@field:cat.description
@description:Category Description
*/
$ret = ($this->Get($this->DescriptionField));
$ret = $this->HighlightText($ret);
break;
case "cachednavbar":
/*
@field:cat.cachednavbar
@description: Category cached navbar
*/
$this->Set('CachedNavbar', $this->GetNavbar());
$ret = $this->HighlightField("CachedNavbar");
if(!strlen($ret))
{
$this->UpdateCachedPath();
$ret = $this->HighlightField("CachedNavbar");
}
break;
case "image":
/*
@field:cat.image
@description:Return an image associated with the category
@attrib:_default:bool:If true, will return the default image if the requested image does not exist
@attrib:_name::Return the image with this name
@attrib:_thumbnail:bool:If true, return the thumbnail version of the image
@attrib:_imagetag:bool:If true, returns a complete image tag. exta html attributes are passed to the image tag
*/
$default = $element->GetAttributeByName('_primary');
$name = $element->GetAttributeByName('_name');
if(strlen($name))
{
$img = $this->GetImageByName($name);
}
else
{
if($default)
$img = $this->GetDefaultImage();
}
if($img)
{
if( $element->GetAttributeByName('_thumbnail') )
{
$url = $img->parsetag("thumb_url");
}
else
$url = $img->parsetag("image_url");
}
else
{
$url = $element->GetAttributeByName('_defaulturl');
}
if( $element->GetAttributeByName('_imagetag') )
{
if(strlen($url))
{
$ret = "<IMG src=\"$url\" $extra_attribs >";
}
else
$ret = "";
}
else
$ret = $url;
break;
case "createdby":
/*
@field:cat.createdby
@description:parse a user field of the user that created the category
@attrib:_usertag::User field to return (defaults to login ID)
*/
$field = $element->GetAttributeByName('_usertag');
if(!strlen($field))
{
$field = "user_login";
}
$userId = $this->Get("CreatedById");
if (!empty($userId) && ($userId > 0))
{
$u =& $objUsers->GetItem($userId);
if (is_object($u))
{
$ret = $u->parsetag($field);
}
}
else
$ret = " ";
break;
case "custom":
/*
@field:cat.custom
@description:Returns a custom field
@attrib:_customfield::field name to return
@attrib:_default::default value
*/
$field = $element->GetAttributeByName('_customfield');
$default = $element->GetAttributeByName('_default');
$ret = $this->GetCustomFieldValue($field,$default);
break;
case "catsubcats":
/*
@field:cat.catsubcats
@description:Returns a list of subcats of current category
@attrib:_limit:int:Number of categories to return
@attrib:_separator::Separator between categories
@attrib:_anchor:bool:Make an anchor (only if template is not specified)
@attrib:_TargetTemplate:tpl:Target template
@attrib:_Ending::Add special text at the end of subcategory list
@attrib:_Class::Specify stly sheet class for anchors (if used) or "span" object
*/
$limit = ((int)$element->attributes["_limit"]>0)? $element->attributes["_limit"] : NULL;
$separator = $element->attributes["_separator"];
$anchor = (int)($element->attributes["_anchor"])? 1 : NULL;
$templ = $element->GetAttributeByName("_TargetTemplate");
$template = !empty($templ)? $templ : NULL;
$ending = strlen($element->attributes["_ending"])? $element->attributes["_ending"] : NULL;
$class = strlen($element->attributes["_class"])? $element->attributes["_class"] : NULL;
$ret = $this->GetSubCats($limit, $template, $separator, $anchor, $ending, $class);
break;
case "date":
/*
@field:cat.date
@description:Returns the date/time the category was created
@attrib:_tz:bool:Convert the date to the user's local time
@attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr
*/
$d = $this->Get("CreatedOn");
if( $element->GetAttributeByName('_tz') )
{
$d = GetLocalTime($d,$objSession->Get("tz"));
}
$part = strtolower( $element->GetAttributeByName('_part') );
if(strlen($part))
{
$ret = ExtractDatePart($part,$d);
}
else
{
if(!is_numeric($d))
{
$ret = "";
}
else
$ret = LangDate($d);
}
break;
case "link":
/*
@field:cat.link
@description:Returns a URL setting the category to the current category
@attrib:_template:tpl:Template URL should point to
@attrib:_mod_template:tpl:Template INSIDE a module to which the category belongs URL should point to
*/
if ( strlen( $element->GetAttributeByName('_mod_template') ) ){
//will prefix the template with module template root path depending on category
$ids = $this->GetParentIds();
$tpath = GetModuleArray("template");
$roots = GetModuleArray("rootcat");
// get template path of module, by searching for moudle name
// in this categories first parent category
// and then using found moudle name as a key for module template paths array
$path = $tpath[array_search ($ids[0], $roots)];
$module_templates = explode(',', $element->GetAttributeByName('_mod_template'));
$m_templates = Array();
foreach($module_templates as $module_t)
{
$module_t = explode(':', $module_t);
if( isset($module_t[1]) )
{
$m_templates[$module_t[0]] = $module_t[1];
}
else
{
$m_templates['default'] = $module_t[0];
}
}
$db =& GetADODBConnection();
$sql = 'SELECT Name FROM '.GetTablePrefix().'Modules WHERE RootCat = '.$ids[0];
$module = $db->GetOne($sql);
if( isset($m_templates[$module]) )
{
$target_template = $m_templates[$module];
}
else
{
$target_template = $m_templates['default'];
}
$t = $path . $target_template;
}
else
{
$t = $element->GetAttributeByName('_template');
}
$url_params = Array();
if(strlen($t))
{
$var_list_update["t"] = $t;
}
else
{
$var_list_update["t"] = $var_list["t"];
}
$m_var_list_update["cat"] = $this->Get("CategoryId");
if( $element->GetAttributeByName('reset') ) $url_params['reset'] = 1;
$ret = HREF_Wrapper('', $url_params);
unset($m_var_list_update["cat"], $var_list_update["t"]);
break;
case "adminlink":
$m_var_list_update["cat"] = $this->Get("CategoryId");
$m_var_list_update["p"] = 1;
$ret = $_SERVER["PHP_SELF"]."?env=" . BuildEnv();
unset($m_var_list_update["cat"]);
unset($m_var_list_update["p"]);
return $ret;
break;
case "customlink":
$t = $this->GetCustomFieldValue("indextemplate","");
if(strlen($t))
{
$var_list_update["t"] = $t;
}
else
{
$var_list_update["t"] = $var_list["t"];
}
$m_var_list_update["cat"] = $this->Get("CategoryId");
$ret = HREF_Wrapper();
unset($m_var_list_update["cat"], $var_list_update["t"]);
break;
case "link_selector":
$m_var_list_update["cat"] = $this->Get("CategoryId");
$ret = $_SERVER["PHP_SELF"]."?env=" . BuildEnv();
$tmp = GetVar('Selector'); if($tmp) $ret .= '&Selector='.$tmp;
$tmp = GetVar('new'); if($tmp) $ret .= '&new='.$tmp;
$tmp = GetVar('destform'); if($tmp) $ret .= '&destform='.$tmp;
unset($m_var_list_update["cat"]);
return $ret;
break;
case "admin_icon":
if( $element->GetAttributeByName('fulltag') )
{
$ret = "<IMG $extra_attribs SRC=\"".$this->StatusIcon()."\">";
}
else
$ret = $this->StatusIcon();
break;
case "subcats":
/*
@field:cat.subcats
@description: Loads category's subcategories into a list and renders using the m_list_cats global tag
@attrib:_subcattemplate:tpl:Template used to render subcategory list elements
@attrib: _columns:int: Numver of columns to display the categories in (defaults to 1)
@attrib: _maxlistcount:int: Maximum number of categories to list
@attrib: _FirstItemTemplate:tpl: Template used for the first category listed
@attrib: _LastItemTemplate:tpl: Template used for the last category listed
@attrib: _NoTable:bool: If set to 1, the categories will not be listed in a table. If a table is used, all HTML attributes are passed to the TABLE tag
*/
$attr = array();
$attr["_catid"] = $this->Get("CategoryId");
$attr["_itemtemplate"] = $element->GetAttributeByName('_subcattemplate');
if( $element->GetAttributeByName('_notable') )
$attr["_notable"]=1;
$ret = m_list_cats($attr);
break;
case "subcatcount":
/*
@field:cat.subcatcount
@description:returns number of subcategories
*/
$GroupOnly = $element->GetAttributeByName('_grouponly') ? 1 : 0;
$txt = "<inp:m_itemcount _CatId=\"".$this->Get("CategoryId")."\" _SubCats=\"1\" ";
$txt .="_CategoryCount=\"1\" _ItemType=\"1\" _GroupOnly=\"$GroupOnly\" />";
$tag = new clsHtmlTag($txt);
$ret = $tag->Execute();
break;
case "itemcount":
/*
@field:cat.itemcount
@description:returns the number of items in the category
@attrib:_itemtype::name of item type to count, or all items if not set
*/
$typestr = $element->GetAttributeByName('_itemtype');
if(strlen($typestr))
{
$type = $objItemTypes->GetTypeByName($typestr);
if(is_object($type))
{
$ForceUpdate = 1;
$TypeId = $type->Get("ItemType");
$GroupOnly = $element->GetAttributeByName('_grouponly') ? 1 : 0;
$txt = "<inp:m_itemcount _CatId=\"".$this->Get("CategoryId")."\" _SubCats=\"1\" ";
$txt .=" _ListType=\"category\" _CountCurrent=\"1\" _ForceUpdate=\"$ForceUpdate\" _ItemType=\"$TypeId\" _GroupOnly=\"$GroupOnly\" />";
$tag = new clsHtmlTag($txt);
$ret = $tag->Execute();
//echo "Category parseobject: $ret<br>";
}
else
$ret = "";
}
else
{
$ret = (int)$objCountCache->GetCatListTotal($this->Get("CategoryId"));
}
break;
case "totalitems":
/*
@field:cat.totalitems
@description:returns the number of items in the category and all subcategories
*/
$ret = $this->ItemCount();
break;
case 'modified':
$ret = '';
$date = $this->Get('Modified');
if(!$date) $date = $this->Get('CreatedOn');
if( $element->GetAttributeByName('_tz') )
{
$date = GetLocalTime($date,$objSession->Get("tz"));
}
$part = strtolower($element->GetAttributeByName('_part') );
if(strlen($part))
{
$ret = ExtractDatePart($part,$date);
}
else
{
$ret = ($date <= 0) ? '' : LangDate($date);
}
break;
case "itemdate":
/*
@field:cat.itemdate
@description:Returns the date the cache count was last updated
@attrib:_itemtype:Item name to check
@attrib:_tz:bool:Convert the date to the user's local time
@attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr
*/
$typestr = $element->GetAttributeByName('_itemtype');
$type = $objItemTypes->GetTypeByName($typestr);
if(is_object($type))
{
$TypeId = $type->Get("ItemType");
$cc = $objCountCache->GetCountObject(1,$TypeId,$this->get("CategoryId"),0);
if(is_object($cc))
{
$date = $cc->Get("LastUpdate");
}
else
$date = "";
//$date = $this->GetCacheCountDate($TypeId);
if( $element->GetAttributeByName('_tz') )
{
$date = GetLocalTime($date,$objSession->Get("tz"));
}
$part = strtolower($element->GetAttributeByName('_part') );
if(strlen($part))
{
$ret = ExtractDatePart($part,$date);
}
else
{
if($date<=0)
{
$ret = "";
}
else
$ret = LangDate($date);
}
}
else
$ret = "";
break;
case "new":
/*
@field:cat.new
@description:returns text if category's status is "new"
@attrib:_label:lang: Text to return if status is new
*/
if($this->IsNewItem())
{
$ret = $element->GetAttributeByName('_label');
if(!strlen($ret))
$ret = "lu_new";
$ret = language($ret);
}
else
$ret = "";
break;
case "pick":
/*
@field:cat.pick
@description:returns text if article's status is "hot"
@attrib:_label:lang: Text to return if status is "hot"
*/
if($this->Get("EditorsPick")==1)
{
$ret = $element->GetAttributeByName('_label');
if(!strlen($ret))
$ret = "lu_pick";
$ret = language($ret);
}
else
$ret = "";
break;
case "parsetag":
/*
@field:cat.parsetag
@description:returns a tag output with this categoriy set as a current category
@attrib:_tag:: tag name
*/
$tag = new clsHtmlTag();
$tag->name = $element->GetAttributeByName('_tag');
$tag->attributes = $element->attributes;
$tag->attributes["_catid"] = $this->Get("CategoryId");
$ret = $tag->Execute();
break;
/*
@field:cat.relevance
@description:Displays the category relevance in search results
@attrib:_displaymode:: How the relevance should be displayed<br>
<UL>
<LI>"Numerical": Show the decimal value
<LI>"Bar": Show the HTML representing the relevance. Returns two HTML cells &lg;td&lt; with specified background colors
<LI>"Graphical":Show image representing the relevance
</UL>
@attrib:_onimage::Zero relevance image shown in graphical display mode. Also used as prefix to build other images (i.e. prefix+"_"+percentage+".file_extension"
@attrib:_OffBackGroundColor::Off background color of HTML cell in bar display mode
@attrib:_OnBackGroundColor::On background color of HTML cell in bar display mode
*/
}
if( !isset($ret) ) $ret = parent::ParseObject($element);
}
return $ret;
}
function parsetag($tag)
{
global $objConfig,$objUsers, $m_var_list, $m_var_list_update;
if(is_object($tag))
{
$tagname = $tag->name;
}
else
$tagname = $tag;
switch($tagname)
{
case "cat_id":
return $this->Get("CategoryId");
break;
case "cat_parent":
return $this->Get("ParentId");
break;
case "cat_fullpath":
return $this->GetNavbar();
break;
case "cat_name":
return $this->Get($this->TitleField);
break;
case "cat_desc":
return $this->Get($this->DescriptionField);
break;
case "cat_priority":
if($this->Get("Priority")!=0)
{
return (int)$this->Get("Priority");
}
else
return "";
break;
case "cat_pick":
if ($this->Get("EditorsPick"))
return "pick";
break;
case "cat_status":
return $this->Get("Status");
break;
case "cat_Pending":
return $this->Get($this->TitleField);
break;
case "cat_pop":
if($this->IsPopItem())
return "pop";
break;
case "cat_new":
if($this->IsNewItem())
return "new";
break;
case "cat_hot":
if($this->IsHotItem())
return "hot";
break;
case "cat_metakeywords":
return $this->Get("MetaKeywords");
break;
case "cat_metadesc":
return $this->Get("MetaDescription");
break;
case "cat_createdby":
return $objUsers->GetUserName($this->Get("CreatedById"));
break;
case "cat_resourceid":
return $this->Get("ResourceId");
break;
case "cat_sub_cats":
return $this->GetSubCats($objConfig->Get("SubCat_ListCount"));
break;
case "cat_link":
return $this->Cat_Link();
break;
case "subcat_count":
return $this->SubCatCount();
break;
case "cat_itemcount":
return (int)$this->GetTotalItemCount();
break;
case "cat_link_admin":
$m_var_list_update["cat"] = $this->Get("CategoryId");
$m_var_list_update["p"] = 1;
$ret = $_SERVER["PHP_SELF"]."?env=" . BuildEnv();
unset($m_var_list_update["cat"]);
unset($m_var_list_update["p"]);
return $ret;
break;
case "cat_admin_icon":
$ret = $this->StatusIcon();
return $ret;
break;
case "cat_link_selector":
$m_var_list_update["cat"] = $this->Get("CategoryId");
$ret = $_SERVER["PHP_SELF"]."?env=" . BuildEnv();
unset($m_var_list_update["cat"]);
return $ret;
break;
case "cat_link_edit":
$m_var_list_update["id"] = $this->Get("CategoryId");
$ret = "addcategory.php?env=" . BuildEnv();
unset($m_var_list_update["id"]);
return $ret;
break;
case "cat_date":
return LangDate($this->Get("CreatedOn"), 0, true);
break;
case "cat_num_cats":
return $this->Get("CachedDescendantCatsQty");
break;
case "cell_back":
if ($m_var_list_update["cat_cell"]=="#cccccc")
{
$m_var_list_update["cat_cell"]="#ffffff";
return "#ffffff";
}
else
{
$m_var_list_update["cat_cell"]="#cccccc";
return "#cccccc";
}
break;
default:
return "Undefined:$tagname";
}
}
/*function ParentNames()
{
global $objCatList;
if(strlen($this->Get("CachedNavbar"))==0)
{
$nav = "";
//echo "Rebuilding Navbar..<br>\n";
if(strlen($this->Get("ParentPath"))==0)
{
$this->UpdateCachedPath();
}
$cats = explode("|",substr($this->Get("ParentPath"),1,-1));
foreach($cats as $catid)
{
$cat =& $objCatList->GetCategory($catid);
if(is_object($cat))
{
if(strlen($cat->Get($this->TitleField)))
$names[] = $cat->Get($this->TitleField);
}
}
$nav = implode(">", $names);
$this->Set("CachedNavbar",$nav);
$this->Update();
}
$res = explode("&|&",$this->Get("CachedNavbar"));
return $res;
}*/
// not used anywhere
/* function UpdateCacheCounts()
{
global $objItemTypes;
$CatId = $this->Get("CategoryId");
if($CatId>0)
{
//echo "Updating count for ".$this->Get("CachedNavbar")."<br>\n";
UpdateCategoryCount(0,$CatId);
}
}*/
/**
* @return void
* @param int $date
* @desc Set Modified field for category & all it's parent categories
*/
function SetLastUpdate($date)
{
$parents = $this->Get('ParentPath');
if (!$parents) return false;
$parents = substr($parents, 1, strlen($parents) - 2 );
$parents = explode('|', $parents);
$db =&GetADODBConnection();
$sql = 'UPDATE '.$this->tablename.' SET Modified = '.$date.' WHERE CategoryId IN ('.implode(',', $parents).')';
$db->Execute($sql);
}
}
class clsCatList extends clsItemList //clsItemCollection
{
//var $Page; // no need because clsItemList class used instead of clsItemCollection
//var $PerPageVar;
var $TitleField = '';
var $DescriptionField = '';
function clsCatList()
{
global $m_var_list;
$this->clsItemCollection();
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$this->TitleField = $ml_formatter->LangFieldName('Name');
$this->DescriptionField = $ml_formatter->LangFieldName('Description');
$this->Prefix = 'c';
$this->classname="clsCategory";
$this->AdminSearchFields = array($this->TitleField, $this->DescriptionField);
$this->Page = (int)$m_var_list["p"];
$this->PerPageVar = "Perpage_Category";
$this->SourceTable = GetTablePrefix()."Category";
$this->BasePermission="CATEGORY";
$this->DefaultPerPage = 20;
}
function SaveNewPage()
{
global $m_var_list;
$m_var_list["p"] = $this->Page;
}
function GetCountSQL($PermName,$CatId=NULL, $GroupId=NULL, $AdditonalWhere="")
{
global $objSession, $objPermissions, $objCatList;
$ltable = $this->SourceTable;
$acl = $objSession->GetACLClause();
$cattable = GetTablePrefix()."CategoryItems";
$CategoryTable = GetTablePrefix()."Category";
$ptable = GetTablePrefix()."PermCache";
$VIEW = $objPermissions->GetPermId($PermName);
$sql = "SELECT count(*) as CacheVal FROM $ltable ";
$sql .="INNER JOIN $ptable ON ($ltable.CategoryId=$ptable.CategoryId) ";
$sql .="WHERE ($acl AND PermId=$VIEW AND $ltable.Status=1) ";
if(strlen($AdditonalWhere)>0)
{
$sql .= "AND (".$AdditonalWhere.")";
}
return $sql;
}
function CountCategories($attribs)
{
global $objSession;
$ParentWhere='';
$cat = getArrayValue($attribs,'_catid');
if(!is_numeric($cat))
{
$cat = $this->CurrentCategoryID();
}
if((int)$cat>0)
$c = $this->GetCategory($cat);
if( getArrayValue($attribs,'_subcats') && $cat>0)
{
$ParentWhere = "(ParentPath LIKE '".$c->Get("ParentPath")."%' AND ".$this->SourceTable.".CategoryId != $cat)";
}
if( getArrayValue($attribs,'_today') )
{
$today = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y"));
$TodayWhere = "(CreatedOn>=$today)";
}
else
{
$TodayWhere = '';
}
if( getArrayValue($attribs,'_grouponly') )
{
$GroupList = $objSession->Get("GroupList");
}
else
$GroupList = NULL;
$where = "";
if(strlen($ParentWhere))
{
$where = $ParentWhere;
}
if(strlen($TodayWhere))
{
if(strlen($where))
$where .=" AND ";
$where .= $TodayWhere;
}
$sql = $this->GetCountSQL("CATEGORY.VIEW",$cat,$GroupList,$where);
// echo "SQL: ".$sql."<BR>";
$rs = $this->adodbConnection->Execute($sql);
if($rs && !$rs->EOF)
{
$ret = $rs->fields["CacheVal"];
}
else
$ret = 0;
return $ret;
}
function CurrentCategoryID()
{
global $m_var_list;
return (int)$m_var_list["cat"];
}
function NumCategories()
{
return $this->NumItems();
}
function &CurrentCat()
{
//return $this->GetCategory($this->CurrentCategoryID());
return $this->GetItem($this->CurrentCategoryID());
}
function &GetCategory($CatID)
{
return $this->GetItem($CatID);
}
function GetByResource($ResId)
{
return $this->GetItemByField("ResourceId",$ResId);
}
function QueryOrderByClause($EditorsPick=FALSE,$Priority=FALSE,$UseTableName=FALSE)
{
global $objSession;
if($UseTableName)
{
$TableName = $this->SourceTable.".";
}
else
$TableName = "";
$Orders = array();
if($EditorsPick)
{
$Orders[] = $TableName."EditorsPick DESC";
}
if($Priority)
{
$Orders[] = $TableName."Priority DESC";
}
$FieldVar = "Category_Sortfield";
$OrderVar = "Category_Sortorder";
if(is_object($objSession))
{
if(strlen($objSession->GetPersistantVariable($FieldVar))>0)
{
$Orders[] = trim($TableName.$objSession->GetPersistantVariable($FieldVar) . " ".
$objSession->GetPersistantVariable($OrderVar));
}
}
$FieldVar = "Category_Sortfield2";
$OrderVar = "Category_Sortorder2";
if(is_object($objSession))
{
if(strlen($objSession->GetPersistantVariable($FieldVar))>0)
{
$Orders[] = trim($TableName.$objSession->GetPersistantVariable($FieldVar) . " ".
$objSession->GetPersistantVariable($OrderVar));
}
}
+ global $m_var_list;
+ foreach ($Orders as $key => $val) {
+ $Orders[$key] = preg_replace('/\.(Name|Description)/', '.l'.$m_var_list['lang'].'_$1', $Orders[$key]);
+ }
if(count($Orders)>0)
{
$OrderBy = "ORDER BY ".implode(", ",$Orders);
}
else
$OrderBy="";
return $OrderBy;
}
function LoadCategories($where="", $orderBy = "", $no_limit = true, $fix_method = 'set_first')
{
// load category list using $where clause
// apply ordering specified in $orderBy
// show all cats ($no_limit = true) or only from current page ($no_limit = false)
// in case if stored page is greather then page count issue page_fixing with
// method specified (see "FixInvalidPage" method for details)
$PerPage = $this->GetPerPage();
$this->QueryItemCount = TableCount($this->SourceTable,$where,0);
if($no_limit == false)
{
$this->FixInvalidPage($fix_method);
$Start = !empty($this->Page)? (($this->Page-1) * $PerPage) : 0;
$limit = "LIMIT ".$Start.",".$PerPage;
}
else
$limit = NULL;
return $this->Query_Category($where, $orderBy, $limit);
}
function Query_Category($whereClause="",$orderByClause="",$limit=NULL)
{
global $m_var_list, $objSession, $Errors, $objPermissions;
$GroupID = $objSession->Get("GroupID");
$resultset = array();
$table = $this->SourceTable;
$ptable = GetTablePrefix()."PermCache";
$CAT_VIEW = $objPermissions->GetPermId("CATEGORY.VIEW");
if(!$objSession->HasSystemPermission("ADMIN"))
{
$sql = "SELECT * FROM $table INNER JOIN $ptable ON ($ptable.CategoryId=$table.CategoryId)";
$acl_where = $objSession->GetACLClause();
if(strlen($whereClause))
{
$sql .= " WHERE ($acl_where) AND PermId=$CAT_VIEW AND ".$whereClause;
}
else
$sql .= " WHERE ($acl_where) AND PermId=$CAT_VIEW ";
}
else
{
$sql ="SELECT * FROM $table ".($whereClause ? "WHERE $whereClause" : '');
}
$sql .=" ".$orderByClause;
if(isset($limit) && strlen(trim($limit)))
$sql .= " ".$limit;
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo $sql;
//echo "SQL: $sql<br>";
return $this->Query_item($sql);
}
function CountPending()
{
return TableCount($this->SourceTable,"Status=".STATUS_PENDING,0);
}
function GetPageLinkList($dest_template=NULL,$page="",$PagesToList=10,$HideEmpty=TRUE, $extra_attributes = '')
{
global $objConfig, $m_var_list_update, $var_list_update, $var_list;
// if(!strlen($page)) $page = GetIndexURL(2);
$PerPage = $this->GetPerPage();
$NumPages = ceil( $this->GetNumPages($PerPage) );
if($NumPages == 1 && $HideEmpty) return '';
if(strlen($dest_template))
{
$var_list_update["t"] = $dest_template;
}
else
$var_list_update["t"] = $var_list["t"];
$o = "";
if($this->Page>$NumPages)
$this->Page=$NumPages;
$StartPage = (int)$this->Page - ($PagesToList/2);
if($StartPage<1)
$StartPage=1;
$EndPage = $StartPage+($PagesToList-1);
if($EndPage>$NumPages)
{
$EndPage = $NumPages;
$StartPage = $EndPage-($PagesToList-1);
if($StartPage<1)
$StartPage=1;
}
$o = "";
if($StartPage>1)
{
$m_var_list_update["p"] = $this->Page-$PagesToList;
$prev_url = HREF_Wrapper();
$o .= '<a href="'.$prev_url.'" '.$extra_attributes.'>&lt;&lt;</a>';
}
for($p=$StartPage;$p<=$EndPage;$p++)
{
if($p!=$this->Page)
{
$m_var_list_update["p"]=$p;
$href = HREF_Wrapper();
$o .= ' <a href="'.$href.'" '.$extra_attributes.'>'.$p.'</a> ';
}
else
{
$o .= "$p";
}
}
if($EndPage<$NumPages && $EndPage>0)
{
$m_var_list_update["p"]=$this->Page+$PagesToList;
$next_url = HREF_Wrapper();
$o .= '<a href="'.$next_url.'" '.$extra_attributes.'> &gt;&gt;</a>';
}
unset($m_var_list_update,$var_list_update["t"] );
return $o;
}
function GetAdminPageLinkList($url)
{
global $objConfig, $m_var_list_update, $var_list_update, $var_list;
$PerPage = $this->GetPerPage();
$NumPages = ceil($this->GetNumPages($PerPage));
$o = "";
if($this->Page>1)
{
$m_var_list_update["p"]=$this->Page-1;
$prev_url = $url."?env=".BuildEnv();
unset($m_var_list_update["p"]);
$o .= "<A HREF=\"$prev_url\" class=\"NAV_URL\"><<</A>";
}
if($this->Page<$NumPages)
{
$m_var_list_update["p"]=$this->Page+1;
$next_url = $url."?env=".BuildEnv();
unset($m_var_list_update["p"]);
}
for($p=1;$p<=$NumPages;$p++)
{
if($p != $this->Page)
{
$m_var_list_update["p"]=$p;
$href = $url."?env=".BuildEnv();
unset($m_var_list_update["p"]);
$o .= " <A HREF=\"$href\" class=\"NAV_URL\">$p</A> ";
}
else
$o .= "<SPAN class=\"CURRENT_PAGE\">$p</SPAN>";
}
if($this->Page < $NumPages)
$o .= "<A HREF=\"$next_url\" class=\"NAV_URL\">>></A>";
return $o;
}
function Search_Category($orderByClause)
{
global $objSession, $objConfig, $Errors;
$PerPage = $this->GetPerPage();
$Start = ($this->Page-1) * $PerPage;
$objResults = new clsSearchResults("Category","clsCategory");
$this->Clear();
$this->Categories = $objResults->LoadSearchResults($Start,$PerPage);
return $this->Categories;
}
function GetSubCats($ParentCat)
{
return $this->Query_Category("ParentId=".$ParentCat,"");
}
function AllSubCats($ParentCat)
{
$c =& $this->GetCategory($ParentCat);
$sql = "SELECT * FROM ".$this->SourceTable." WHERE ParentPath LIKE '".$c->Get("ParentPath")."%'";
$rs = $this->adodbConnection->Execute($sql);
$subcats = array();
while($rs && !$rs->EOF)
{
if($rs->fields["CategoryId"]!=$ParentCat)
{
$subcats[] = $rs->fields["CategoryId"];
}
$rs->MoveNext();
}
if($ParentCat>0)
{
if($c->Get("CachedDescendantCatsQty")!=count($subcats))
{
$c->Set("CachedDescendantCatsQty",count($subcats));
}
}
return $subcats;
}
function cat_navbar($admin=0, $cat, $target_template, $separator = " > ", $LinkLeaf = FALSE,
$root = 0,$RootTemplate="",$modcat=0, $ModTemplate="", $LinkRoot = FALSE)
{
// draw category navigation bar (at top)
global $Errors, $var_list_update, $var_list, $m_var_list_update, $m_var_list, $objConfig;
$url_params = Array('reset' => 1);
if( GetVar('Selector') ) $url_params['Selector'] = GetVar('Selector');
if( GetVar('new') ) $url_params['new'] = GetVar('new');
if( GetVar('destform') ) $url_params['destform'] = GetVar('destform');
if( GetVar('destfield') ) $url_params['destfield'] = GetVar('destfield');
$nav = "";
$m_var_list_update["p"]=1;
if(strlen($target_template)==0)
$target_template = $var_list["t"];
if($cat == 0)
{
$cat_name = language($objConfig->Get("Root_Name"));
if ($LinkRoot)
{
$var_list_update["t"] = strlen($RootTemplate)? $RootTemplate : $target_template;
$nav = "<a class=\"navbar\" href=\"" . HREF_Wrapper('', $url_params) . "\">$cat_name</a>"; }
else
$nav = "<span class=\"NAV_CURRENT_ITEM\">$cat_name</span>";
}
else
{
$nav = array();
$c =& $this->GetCategory($cat);
$nav_unparsed = $c->Get("ParentPath");
if(strlen($nav_unparsed)==0)
{
$c->UpdateCachedPath();
$nav_unparsed = $c->Get("ParentPath");
}
//echo " Before $nav_unparsed ";
if($root)
{
$r =& $this->GetCategory($root);
$rpath = $r->Get("ParentPath");
$nav_unparsed = substr($nav_unparsed,strlen($rpath),-1);
$cat_name = $r->Get($this->TitleField);
$m_var_list_update["cat"] = $root;
if($cat == $catid && !$LinkLeaf)
{
$nav[] = "<span class=\"NAV_CURRENT_ITEM\" >".$cat_name."</span>"; //href=\"browse.php?env=". BuildEnv() ."\"
}
else
{
if ($admin == 1)
{
$nav[] = "<a class=\"control_link\" href=\"".HREF_Wrapper('', $url_params)."\">".$cat_name."</a>";
}
else
{
if(strlen($RootTemplate))
{
$var_list_update["t"] = $RootTemplate;
}
else
{
$var_list_update["t"] = $target_template;
}
$nav[] = "<a class=\"navbar\" href=\"".HREF_Wrapper('', $url_params)."\">".$cat_name."</a>";
}
}
}
else
{
$nav_unparsed = substr($nav_unparsed,1,-1);
$cat_name = language($objConfig->Get("Root_Name"));
$m_var_list_update["cat"] = 0;
if($cat == 0)
{
$nav[] = "<span class=\"NAV_CURRENT_ITEM\" >".$cat_name."</span>"; //href=\"browse.php?env=". BuildEnv() ."\"
}
else
{
if ($admin == 1)
{
$nav[] = "<a class=\"control_link\" href=\"".HREF_Wrapper('', $url_params)."\">".$cat_name."</a>";
}
else
{
if(strlen($RootTemplate))
{
$var_list_update["t"] = $RootTemplate;
}
else
$var_list_update["t"] = $target_template;
$nav[] = "<a class=\"navbar\" href=\"".HREF_Wrapper('', $url_params)."\">".$cat_name."</a>";
}
}
}
//echo " After $nav_unparsed <br>\n";
if(strlen($target_template)==0)
$target_template = $var_list["t"];
$cats = explode("|", $nav_unparsed);
foreach($cats as $catid)
{
if($catid)
{
$c =& $this->GetCategory($catid);
if(is_object($c))
{
$cat_name = $c->Get($this->TitleField);
$m_var_list_update["cat"] = $catid;
if($catid==$modcat && strlen($ModTemplate)>0)
{
$t = $ModTemplate;
}
else
$t = $target_template;
if($cat == $catid && !$LinkLeaf)
{
$nav[] = "<span class=\"NAV_CURRENT_ITEM\" >".$cat_name."</span>";
}
else
{
if ($admin == 1)
{
$nav[] = "<a class=\"control_link\" href=\"".HREF_Wrapper('', $url_params)."\">".$cat_name."</a>";
}
else
{
$var_list_update["t"] = $t;
$nav[] = "<a class=\"navbar\" href=\"".HREF_Wrapper('', $url_params)."\">".$cat_name."</a>";
unset($var_list_update["t"]);
}
}
unset($m_var_list_update["cat"]);
}
}
}
$nav = implode($separator, $nav);
}
return $nav;
}
function &Add_NEW($fields_hash, $from_import = false)
{
global $objSession;
$fields_hash['CreatedById'] = $objSession->Get('PortalUserId');
$d = new clsCategory(NULL);
$fields_hash['Filename'] = $d->StripDisallowed($fields_hash['Filename']);
$d->tablename = $this->SourceTable;
if ( $d->UsingTempTable() ) {
$d->Set('CategoryId', -1);
}
$d->idfield = 'CategoryId';
foreach ($fields_hash as $field_name => $field_value) {
$d->Set($field_name, $field_value);
}
$d->Create();
if (!$from_import) {
if ($d->Get('Status') == STATUS_ACTIVE) {
$d->SendUserEventMail("CATEGORY.ADD", $objSession->Get("PortalUserId"));
$d->SendAdminEventMail("CATEGORY.ADD");
}
else
{
$d->SendUserEventMail("CATEGORY.ADD.PENDING", $objSession->Get("PortalUserId"));
$d->SendAdminEventMail("CATEGORY.ADD.PENDING");
}
$d->UpdateCachedPath();
}
return $d;
}
function &Add( $ParentId, $Name, $Description, $CreatedOn, $EditorsPick, $Status, $Hot, $New, $Pop,
$Priority, $MetaKeywords,$MetaDesc, $auto_filename = 1, $filename = '')
{
global $objSession;
$UserId = $objSession->Get('UserId');
$d = new clsCategory(NULL);
$filename = $d->StripDisallowed($filename);
$d->tablename = $this->SourceTable;
if( $d->UsingTempTable() ) $d->Set('CategoryId', -1);
$d->idfield = 'CategoryId';
$d->Set(Array( 'ParentId', $this->TitleField, $this->DescriptionField, 'CreatedOn', 'EditorsPick', 'Status', 'HotItem',
'NewItem','PopItem', 'Priority', 'MetaKeywords', 'MetaDescription', 'CreatedById',
'AutomaticFilename', 'Filename'),
Array( $ParentId, $Name, $Description, $CreatedOn, $EditorsPick, $Status, $Hot, $New,
$Pop, $Priority, $MetaKeywords,$MetaDesc, $UserId, $auto_filename, $filename) );
$d->Create();
if($Status == 1)
{
$d->SendUserEventMail("CATEGORY.ADD",$objSession->Get("PortalUserId"));
$d->SendAdminEventMail("CATEGORY.ADD");
}
else
{
$d->SendUserEventMail("CATEGORY.ADD.PENDING",$objSession->Get("PortalUserId"));
$d->SendAdminEventMail("CATEGORY.ADD.PENDING");
}
$d->UpdateCachedPath();
// RunUp($ParentId, 'Increment_Count');
return $d;
}
function &Edit_Category($category_id, $fields_hash)
{
$d =& $this->GetCategory($category_id);
$fields_hash['Filename'] = $d->StripDisallowed($fields_hash['Filename']);
foreach ($fields_hash as $field_name => $field_value) {
$d->Set($field_name, $field_value);
}
$d->Update();
$d->UpdateCachedPath();
return $d;
}
function Move_Category($Id, $ParentTo)
{
global $objCatList;
$d =& $this->GetCategory($Id);
$oldparent = $d->Get("ParentId");
$ChildList = $d->GetSubCatIds();
/*
echo "Target Parent Id: $ParentTo <br>\n";
echo "<PRE>";print_r($ChildList); echo "</PRE>";
echo "Old Parent: $oldparent <br>\n";
echo "ID: $Id <br>\n";
*/
/* sanity checks */
if(!in_array($ParentTo,$ChildList) && $oldparent != $ParentTo && $oldparent != $Id &&
$Id != $ParentTo)
{
$d->Set("ParentId", $ParentTo);
$d->Set('Filename', '');
$d->Update();
$d->UpdateCachedPath();
RunUp($oldparent, "Decrement_Count");
RunUp($ParentTo, "Increment_Count");
RunDown($ParentTo, "UpdateCachedPath");
return TRUE;
}
else
{
global $Errors;
$Errors->AddAdminUserError("la_error_move_subcategory");
return FALSE;
}
die();
}
function Copy_CategoryTree($Id, $ParentTo)
{
global $PastedCatIds;
$new = $this->Copy_Category($Id, $ParentTo);
if($new)
{
$PastedCatIds[$Id] = $new;
$sql = "SELECT CategoryId from ".GetTablePrefix()."Category where ParentId=$Id";
$result = $this->adodbConnection->Execute($sql);
if ($result && !$result->EOF)
{
while(!$result->EOF)
{
$this->Copy_CategoryTree($result->fields["CategoryId"], $new);
$result->MoveNext();
}
}
}
return $new;
}
function Copy_Category($Id, $ParentTo)
{
global $objGroups;
$src = $this->GetCategory($Id);
$Children = $src->GetSubCatIds();
if($Id==$ParentTo || in_array($ParentTo,$Children))
{
/* sanity error here */
global $Errors;
$Errors->AddAdminUserError("la_error_copy_subcategory");
return 0;
}
$dest = $src;
$dest->Set("ParentId", $ParentTo);
if ($src->get("ParentId") == $ParentTo)
{
$OldName = $src->Get($this->TitleField);
if(substr($OldName,0,5)=="Copy ")
{
$parts = explode(" ",$OldName,4);
if($parts[2]=="of" && is_numeric($parts[1]))
{
$Name = $parts[3];
}
else
if($parts[1]=="of")
{
$Name = $parts[2]." ".$parts[3];
}
else
$Name = $OldName;
}
else
$Name = $OldName;
//echo "New Name: $Name<br>";
$dest->Set($this->TitleField, $Name);
$Names = CategoryNameCount($ParentTo,$Name);
//echo "Names Count: ".count($Names)."<br>";
if(count($Names)>0)
{
$NameCount = count($Names);
$found = FALSE;
$NewName = "Copy of $Name";
if(!in_array($NewName,$Names))
{
//echo "Matched on $NewName in:<br>\n";
$found = TRUE;
}
else
{
for($x=2;$x<$NameCount+2;$x++)
{
$NewName = "Copy ".$x." of ".$Name;
if(!in_array($NewName,$Names))
{
$found = TRUE;
break;
}
}
}
if(!$found)
{
$NameCount++;
$NewName = "Copy $NameCount of $Name";
}
//echo "New Name: $NewName<br>";
$dest->Set($this->TitleField, $NewName);
}
}
$dest->UnsetIdField();
$dest->Set("CachedDescendantCatsQty",0);
$dest->Set("ResourceId",NULL);
$dest->Set('Filename', '');
$dest->Create();
$dest->UpdateCachedPath();
$p = new clsPermList();
$p->Copy_Permissions($src->Get("CategoryId"),$dest->Get("CategoryId"));
$glist = $objGroups->GetAllGroupList();
$view = $p->GetGroupPermList($dest, "CATEGORY.VIEW", $glist);
$dest->SetViewPerms("CATEGORY.VIEW",$view,$glist);
RunUp($ParentTo, "Increment_Count");
return $dest->Get("CategoryId");
}
function Delete_Category($Id, $check_perm = false)
{
global $objSession;
$d =& $this->GetCategory($Id);
if (is_object($d)) {
$perm_status = true;
if ($check_perm) {
if (defined('ADVANCED_VIEW') && ADVANCED_VIEW) {
// check by this cat parent category
$check_cat = $d->Get('ParentId');
}
else {
// check by current category
$check_cat = $this->CurrentCategoryID();
}
$perm_status = $objSession->HasCatPermission('CATEGORY.DELETE', $check_cat);
}
if (($d->Get("CategoryId") == $Id) && $perm_status) {
$d->SendUserEventMail("CATEGORY.DELETE",$objSession->Get("PortalUserId"));
$d->SendAdminEventMail("CATEGORY.DELETE");
$p =& $this->GetCategory($d->Get("ParentId"));
RunDown($d->Get("CategoryId"), "Delete");
RunUp($p->Get("CategoryId"), "Decrement_Count");
RunUp($d->Get("CategoryId"),"ClearCacheData");
}
}
}
function PasteFromClipboard($TargetCat)
{
global $objSession;
$clip = $objSession->GetVariable("ClipBoard");
if(strlen($clip))
{
$ClipBoard = ParseClipboard($clip);
$IsCopy = (substr($ClipBoard["command"],0,4)=="COPY") || ($ClipBoard["source"] == $TargetCat);
$item_ids = explode(",",$ClipBoard["ids"]);
for($i=0;$i<count($item_ids);$i++)
{
$ItemId = $item_ids[$i];
$item = $this->GetItem($item_ids[$i]);
if(!$IsCopy)
{
$this->Move_Category($ItemId, $TargetCat);
$clip = str_replace("CUT","COPY",$clip);
$objSession->SetVariable("ClipBoard",$clip);
}
else
{
$this->Copy_CategoryTree($ItemId,$TargetCat);
}
}
}
}
function NumChildren($ParentID)
{
$cat_filter = "m_cat_filter";
global $$cat_filter;
$filter = $$cat_filter;
$adodbConnection = &GetADODBConnection();
$sql = "SELECT COUNT(*) as children from ".$this->SourceTable." where ParentId=" . $ParentID . $filter;
$result = $adodbConnection->Execute($sql);
return $result->fields["children"];
}
function UpdateMissingCacheData()
{
$rs = $this->adodbConnection->Execute("SELECT * FROM ".$this->SourceTable." WHERE ParentPath IS NULL or ParentPath=''");
while($rs && !$rs->EOF)
{
$c = new clsCategory(NULL);
$data = $rs->fields;
$c->SetFromArray($data);
$c->UpdateCachedPath();
$rs->MoveNext();
}
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$navbar_field = $ml_formatter->LangFieldName('CachedNavbar');
$rs = $this->adodbConnection->Execute('SELECT * FROM '.$this->SourceTable.' WHERE '.$navbar_field.' IS NULL OR '.$navbar_field.' = ""');
while($rs && !$rs->EOF)
{
$c = new clsCategory(NULL);
$data = $rs->fields;
$c->SetFromArray($data);
$c->UpdateCachedPath();
$rs->MoveNext();
}
}
function CopyFromEditTable($idfield)
{
global $objGroups, $objSession, $objPermList;
$GLOBALS['_CopyFromEditTable']=1;
$objPermList = new clsPermList();
$edit_table = $objSession->GetEditTable($this->SourceTable);
$sql = "SELECT * FROM $edit_table";
$rs = $this->adodbConnection->Execute($sql);
$item_ids = Array();
while($rs && !$rs->EOF)
{
$data = $rs->fields;
$c = new $this->classname;
$c->SetFromArray($data);
$c->Dirty();
if($c->Get("CategoryId")>0)
{
$c->Update();
}
else
{
$c->UnsetIdField();
$c->Create();
$sql = "UPDATE ".GetTablePrefix()."Permissions SET CatId=".$c->Get("CategoryId")." WHERE CatId=-1";
$this->adodbConnection->Execute($sql);
}
$c->UpdateCachedPath();
$c->UpdateACL();
$c->SendUserEventMail("CATEGORY.MODIFY",$objSession->Get("PortalUserId"));
$c->SendAdminEventMail("CATEGORY.MODIFY");
$c->Related = new clsRelationshipList();
if(is_object($c->Related))
{
$r = $c->Related;
$r->CopyFromEditTable($c->Get("ResourceId"));
}
$item_ids[] = $c->UniqueId();
//RunDown($c->Get("CategoryId"),"UpdateCachedPath");
//RunDown($c->Get("CategoryId"),"UpdateACL");
unset($c);
unset($r);
$rs->MoveNext();
}
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
unset($GLOBALS['_CopyFromEditTable']);
return $item_ids;
//$this->UpdateMissingCacheData();
}
function PurgeEditTable($idfield)
{
parent::PurgeEditTable($idfield);
$sql = "DELETE FROM ".GetTablePrefix()."Permissions WHERE CatId=-1";
$this->adodbConnection->Execute($sql);
}
function GetExclusiveType($CatId)
{
global $objItemTypes, $objConfig;
$itemtype = NULL;
$c =& $this->GetItem($CatId);
$path = $c->Get("ParentPath");
foreach($objItemTypes->Items as $Type)
{
$RootVar = $Type->Get("ItemName")."_Root";
$RootId = $objConfig->Get($RootVar);
if((int)$RootId)
{
$rcat = $this->GetItem($RootId);
$rpath = $rcat->Get("ParentPath");
$p = substr($path,0,strlen($rpath));
//echo $rpath." vs. .$p [$path]<br>\n";
if($rpath==$p)
{
$itemtype = $Type;
break;
}
}
}
return $itemtype;
}
}
function RunUp($Id, $function, $Param=NULL)
{
global $objCatList;
$d = $objCatList->GetCategory($Id);
$ParentId = $d->Get("ParentId");
if ($ParentId == 0)
{
if($Param == NULL)
{
$d->$function();
}
else
{
$d->$function($Param);
}
}
else
{
RunUp($ParentId, $function, $Param);
if($Param == NULL)
{
$d->$function();
}
else
{
$d->$function($Param);
}
}
}
function RunDown($Id, $function, $Param=NULL)
{
global $objCatList;
$adodbConnection = &GetADODBConnection();
$sql = "select CategoryId from ".GetTablePrefix()."Category where ParentId='$Id'";
$rs = $adodbConnection->Execute($sql);
while($rs && !$rs->EOF)
{
RunDown($rs->fields["CategoryId"], $function, $Param);
$rs->MoveNext();
}
$d = $objCatList->GetCategory($Id);
if($Param == NULL)
{
$d->$function();
}
else
$d->$function($Param);
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/include/category.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.58
\ No newline at end of property
+1.59
\ No newline at end of property
Index: trunk/kernel/include/itemreview.php
===================================================================
--- trunk/kernel/include/itemreview.php (revision 7634)
+++ trunk/kernel/include/itemreview.php (revision 7635)
@@ -1,771 +1,788 @@
<?php
function ip_exists($ip,$id,$SourceTable)
{
$count = 0;
$sql = "SELECT count(*) as DupCount FROM $SourceTable WHERE IPAddress='$ip' and ItemId=$id";
- $adodbConnection = &GetADODBConnection();
+ $adodbConnection = &GetADODBConnection();
$rs = $adodbConnection->Execute($sql);
if($rs)
{
$count = $rs->fields["DupCount"];
}
- return ($count>0);
+ return ($count>0);
}
RegisterPrefix("clsItemReview","review","kernel/include/itemreview.php");
-
+
class clsItemReview extends clsParsedItem
{
function clsItemReview($ReviewId=NULL,$table="ItemReview")
{
$this->clsParsedItem();
$this->tablename = $table;
$this->id_field = "ReviewId";
$this->type=-20;
$this->NoResourceId=1;
$this->TagPrefix = "review";
if($ReviewId!=NULL)
$this->LoadFromDatabase($ReviewId);
}
function Validate()
{
global $Errors;
$dataValid = true;
if(!isset($this->m_CreatedOn))
{
$Errors->AddError("error.fieldIsRequired",'CreatedOn',"","",get_class($this),"Validate");
$dataValid = false;
}
if(!isset($this->m_ReviewText))
{
$Errors->AddError("error.fieldIsRequired",'ReviewText',"","",get_class($this),"Validate");
$dataValid = false;
}
-
+
if(!isset($this->m_Pending))
{
$Error->AddError("error.fieldIsRequired",'Pending',"","",get_class($this),"Validate");
$dataValid = false;
}
-
+
if(!isset($this->m_IPAddress))
{
$Error->AddError("error.fieldIsRequired",'IPAddress',"","",get_class($this),"Validate");
$dataValid = false;
}
-
+
if(!isset($this->m_ItemId))
{
$Error->AddError("error.fieldIsRequired",'ItemId',"","",get_class($this),"Validate");
$dataValid = false;
}
-
+
if(!isset($this->m_CreatedById))
{
$Error->AddError("error.fieldIsRequired",'CreatedBy',"","",get_class($this),"Validate");
$dataValid = false;
}
return $dataValid;
}
function LoadFromDatabase($Id)
{
global $objSession, $Errors;
if(!isset($Id))
{
$Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromDatabase");
return false;
}
-
+
$sql = sprintf("SELECT * FROM ".$this->tablename." WHERE ReviewId = '%s'",$Id);
if( $GLOBALS['debuglevel'] ) echo $sql."<br>";
$result = $this->adodbConnection->Execute($sql);
if ($result === false)
{
$Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase");
return false;
}
$data = $result->fields;
if(is_array($data))
$this->SetFromArray($data);
$this->Clean();
return TRUE;
- }
-
+ }
+
function MoveUp()
{
$this->Increment("Priority");
}
function MoveDown()
{
$this->Decrement("Priority");
}
function ParseObject($element)
- {
+ {
global $objConfig, $objCatList, $rootURL, $objUsers, $objModules;
$extra_attribs = ExtraAttributes($element->attributes);
-
+
if(strtolower($element->name)==$this->TagPrefix)
- {
- $field = strtolower($element->attributes["_field"]);
+ {
+ $field = strtolower($element->attributes["_field"]);
switch($field)
{
case 'itemname':
$db=&GetADODBConnection();
$module_info=$objModules->ExecuteFunction('GetModuleInfo','rel_list');
$module_info=$module_info[$this->Get('Module')];
$ret=$db->GetOne('SELECT '.$module_info['ItemNameField'].' FROM '.GetTablePrefix().$module_info['MainTable'].' WHERE ResourceId='.$this->Get('ItemId'));
break;
-
+
case 'itemlink':
$db=&GetADODBConnection();
$module_info=$objModules->ExecuteFunction('GetModuleInfo','rel_list');
$module_info=$module_info[$this->Get('Module')];
$prefix=$db->GetOne('SELECT Var FROM '.$objModules->SourceTable.' WHERE Name=\''.$this->Get('Module').'\'');
-
+
$id=$db->GetOne('SELECT '.$module_info['MainTable'].'Id FROM '.GetTablePrefix().$module_info['MainTable'].' WHERE ResourceId='.$this->Get('ItemId'));
$GLOBALS[$prefix.'_var_list_update'][ $module_info['EnvIDField'] ]=$id;
-
+
/*$env_unparsed=explode(':',$_REQUEST['env']);
m_ParseEnv($tmp[1]);*/
-
+
$url=rtrim(GetIndexUrl(2),'index.php');
-
+
$ret = $url.strtolower($this->Get('Module')).'/admin/'.$module_info['EditFile'].'?env='.BuildEnv();
unset($GLOBALS[$prefix.'_var_list_update'][ $module_info['EnvIDField'] ]);
break;
-
+
case "id":
/*
@field:review.id
@description: review id
*/
$ret = $this->Get("ReviewId");
break;
case "item_id":
/*
@field:review.item_id
@description: ID of the item being reviewed
*/
$ret = $this->Get("ItemId");
break;
case "text":
/*
@field:review.text
@description:Review text
*/
if($this->Get("TextFormat")==0 || $element->GetAttributeByName('_textonly') )
{
$ret = inp_htmlize($this->Get("ReviewText"));
}
- else
+ else
{
$ret = $this->Get("ReviewText");
}
-
+
$cut_first_chars=$element->GetAttributeByName('_CutFirst');
if($cut_first_chars && strlen($ret)>$cut_first_chars)
{
$ret=substr($ret,0,$cut_first_chars).' ...';
}
- break;
+ break;
case "ip":
/*
@field:review.ip
@description:IP address of remote host submitting the review
*/
$ret = $this->Get("IPAddress");
break;
case "pending":
/*
@field:review.pending
@description: Returns the review pening status
*/
$ret = $this->Get("Pending");
- break;
+ break;
case "item_type":
/*
@field:review.item_type
@description:Returns the name of the reviewed item type
*/
$type =& $objItemTypes->GetItem($this->Get("ItemType"));
if(is_object($type))
- $ret = $type->Get("ItemName");
+ $ret = $type->Get("ItemName");
break;
case "date":
/*
@field:review.date
@description:Returns the date/time the review was created
@attrib:_tz:bool:Convert the date to the user's local time
@attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr
- */
+ */
$d = $this->Get("CreatedOn");
if($element->GetAttributeByName('_tz'))
{
$d = GetLocalTime($d,$objSession->Get("tz"));
}
$part = strtolower( $element->GetAttributeByName('_part') );
if(strlen($part))
{
$ret = ExtractDatePart($part,$d);
}
else
- {
+ {
if($d<=0)
- {
+ {
$ret = "";
}
else
$ret = LangDate($d);
}
break;
case "reviewer":
/*
@field:revier.reviewer
@description:Parse a user tag for the user submitting the review
@attrib:_usertag::User tag to parse, defaults to the users login name
*/
$userfield = $element->GetAttributeByName('_usertag');
if(!strlen($userfield))
{
$userfield = "login";
}
if($this->Get("CreatedById")>0)
{
- $u =& $objUsers->GetItem($this->Get("CreatedById"));
- $e = new clsHtmlTag();
+ $u =& $objUsers->GetItem($this->Get("CreatedById"));
+ $e = new clsHtmlTag();
$e->name = $u->TagPrefix;
$e->attributes = $element->attributes;
$e->attributes["_field"] = $userfield;
$ret = $u->ParseObject($e);
}
- else
+ else
if($userfield=="login")
$ret = "root";
break;
-
+
case "admin_icon":
if( $element->GetAttributeByName('fulltag') )
{
$ret = "<IMG $extra_attribs SRC=\"".$this->StatusIcon()."\">";
}
else
{
$ret = $this->StatusIcon();
}
break;
-
+
default:
$tag = $this->TagPrefix."_".$field;
$ret = "Undefined: ".$tag->name;
break;
}
}
else
{
- $ret = $element->Execute();
+ $ret = $element->Execute();
}
return $ret;
}
function StatusIcon()
{
global $imagesURL;
$ret = $imagesURL.'/itemicons/';
switch($this->Get('Status'))
{
case STATUS_DISABLED:
$ret .= "icon16_review_disabled.gif";
break;
case STATUS_PENDING:
- $ret .= "icon16_review_pending.gif";
+ $ret .= "icon16_review_pending.gif";
break;
case STATUS_ACTIVE:
$ret .= "icon16_review.gif";
break;
}
return $ret;
}
-
+
function parsetag($tag)
- {
+ {
global $objConfig, $objUsers, $objItemTypes;
if(is_object($tag))
- {
+ {
$tagname = $tag->name;
}
else
$tagname = $tag;
switch($tagname)
- {
+ {
case "review_id":
return $this->Get("ReviewId");
break;
case "review_item_id":
return $this->Get("ItemId");
break;
case "review_text":
return $this->Get("ReviewText");
- break;
+ break;
case "review_ip_address":
return $this->Get("IPAddress");
break;
case "review_pending":
return $this->Get("Pending");
- break;
+ break;
case "review_item_type":
$type =& $objItemTypes->GetItem($this->Get("ItemType"));
$res = $type->Get("ItemName");
return $res;
break;
case "review_created_date":
return LangDate($this->Get('CreatedOn'), 0, true);
break;
-
+
case "review_created_time":
if ($this->Get('CreatedOn') <= 0) {
return '';
}
return LangTime($this->Get('CreatedOn'), 0, true);
break;
case "review_created_date_month":
return adodb_date("m", $this->Get("CreatedOn"));
- break;
+ break;
case "review_created_date_day":
return adodb_date("d", $this->Get("CreatedOn"));
- break;
+ break;
case "review_created_date_year":
return adodb_date("Y", $this->Get("CreatedOn"));
break;
default:
if (substr($tagname, 0, 16) == "review_createdby")
{
/* parse the created by user */
$u = $objUsers->GetUser($this->Get("CreatedById"));
$usertag = substr($tag,17);
return $u->parsetag($usertag);
}
else
return "Undefined:$tagname";
break;
}
}
function SendUserEventMail($Suffix,$ToUserId,$LangId=NULL)
{
global $objItemTypes, $objMessageList;
- $type =& $objItemTypes->GetItem($this->Get("ItemType"));
+ $types = array(
+ 'In-Link' => 4,
+ 'In-Bulletin' => 3,
+ 'In-Commerce' => 11,
+ 'In-News' => 2,
+ );
+ $type_id = $types[$this->Get('Module')];
+
+ $type =& $objItemTypes->GetItem($type_id);
$res = $type->Get("ItemName");
$EventName = $res.$Suffix;
$Event =& $objMessageList->GetEmailEventObject($EventName,0,$LangId);
if(is_object($Event))
{
if($Event->Get("Enabled")=="1")
{
$Event->Item = $this;
- return $Event->SendToUser($ToUserId);
+ return $Event->SendToUser($ToUserId);
}
}
}
function SendAdminEventMail($EventName,$LangId=NULL)
{
global $objItemTypes, $objMessageList;
- $type =& $objItemTypes->GetItem($this->Get("ItemType"));
+ $types = array(
+ 'In-Link' => 4,
+ 'In-Bulletin' => 3,
+ 'In-Commerce' => 11,
+ 'In-News' => 2,
+ );
+ $type_id = $types[$this->Get('Module')];
+
+ $type =& $objItemTypes->GetItem($type_id);
+
$res = $type->Get("ItemName");
$EventName = $res; //.$Suffix;
$Event =& $objMessageList->GetEmailEventObject($EventName,1,$LangId);
if(is_object($Event))
{
if($Event->Get("Enabled")=="1")
{
$Event->Item = $this;
return $Event->SendAdmin($ToUserId);
}
}
}
} /*clsIItemReview*/
class clsItemReviewList extends clsItemList // clsItemCollection
{
var $itemID;
//var $Page;
//var $PerPageVar;
function clsItemReviewList($id=NULL)
{
global $objConfig;
$this->clsItemCollection();
$this->classname = "clsItemReview";
$this->SetTable('live',GetTablePrefix().'ItemReview');
$this->Page = isset($_GET['lpn']) ? $_GET['lpn'] : 1;
$this->PerPageVar = 'Perpage_Reviews';
$this->PerPage = $objConfig->Get($this->PerPageVar);
if(isset($id))
$this->itemID=$id;
$this->AdminSearchFields = array("ReviewText");
}
function SaveNewPage()
{
$GLOBALS['m_var_list']['reviews_page']=$this->Page;
}
-
+
function ItemCount()
{
return $this->NumItems();
}
function GetReview($ID)
{
return $this->GetItem($ID);
}
function GetReviewList($StatusWhere = "Status=1", $OrderBy=NULL)
{
$this->Clear();
$where = "ItemId=".$this->itemID;
$sql = "SELECT * FROM ".$this->SourceTable." WHERE ";
if(strlen($StatusWhere))
$where .= " AND ".$StatusWhere;
$sql .= $where;
if(strlen($OrderBy))
$sql .= " ORDER BY ".$OrderBy;
$Limit = $this->GetLimitSQL();
if(strlen($Limit))
$sql .= " ".$Limit;
$this->QueryItemCount=TableCount($this->SourceTable,$where,0);
return $this->Query_item($sql);
}
function GetItemReviewCount($TodayOnly = false)
{
$sql = 'SELECT COUNT(*) FROM '.$this->SourceTable.' WHERE ItemId = '.$this->itemID.' AND Status = 1';
if($TodayOnly)
{
$today = adodb_mktime(0,0,0,adodb_date('m'),adodb_date('d'),adodb_date('Y'));
- $sql .= ' AND CreatedOn >= '.$today;
+ $sql .= ' AND CreatedOn >= '.$today;
}
return (int)$this->adodbConnection->GetOne($sql);
}
function ip_exists($ip,$id)
{
return ip_exists($ip,id,$this->SourceTable);
}
function GetLimitSQL()
{
global $objConfig;
if($this->Page<1)
$this->Page=1;
$PerPage = $objConfig->Get($this->PerPageVar);
if(is_numeric($PerPage))
{
$Start = ($this->Page-1)*$PerPage;
$limit = "LIMIT ".$Start.",".$PerPage;
}
else
$limit = NULL;
return $limit;
}
function Query_Review($whereClause=NULL,$orderByClause=NULL)
{
global $Errors;
$this->Clear();
$sql = "SELECT * FROM ".$this->SourceTable." ";
if(isset($whereClause) && strlen(trim($whereClause))>0)
$sql = sprintf("%s WHERE %s",$sql,$whereClause);
if(isset($orderByClause) && strlen(trim($orderByClause))>0)
$sql = sprintf("%s ORDER BY %s",$sql,$orderByClause);
return $this->Query_Item($sql);
}
function &AddReview($CreatedOn,$ReviewText, $Status, $IPAddress,
$Priority, $ItemId,$ItemType,$CreatedById,$TextFormat=0,$Module)
{
global $objSession;
-
- $r = new clsItemReview(NULL,$this->SourceTable);
-
- $ReviewText = str_replace("env=".$objSession->GetSessionKey(), "env=",$ReviewText);
+
+ $r = new clsItemReview(NULL,$this->SourceTable);
+
+ $ReviewText = str_replace("env=".$objSession->GetSessionKey(), "env=",$ReviewText);
//$r->debuglevel = 1;
$r->Set(array("CreatedOn","ReviewText","Status", "IPAddress",
"Priority","ItemId","ItemType","CreatedById","TextFormat","Module"),
array($CreatedOn,$ReviewText,$Status, $IPAddress,
- $Priority, $ItemId,$ItemType,$CreatedById,$TextFormat,$Module));
- $r->Create();
+ $Priority, $ItemId,$ItemType,$CreatedById,$TextFormat,$Module));
+ $r->Create();
array_push($this->Items,$r);
if($Status==1)
{
$r->SendUserEventMail("REVIEW.ADD",$CreatedById);
- $r->SendAdminEventMail("REVIEW.ADD");
+ $r->SendAdminEventMail("REVIEW.ADD");
}
else
{
$r->SendUserEventMail("REVIEW.ADD.PENDING",$CreatedById);
- $r->SendAdminEventMail("REVIEW.ADD.PENDING");
+ $r->SendAdminEventMail("REVIEW.ADD.PENDING");
}
return $r;
}
- function EditReview($ReviewId,$CreatedOn,$ReviewText, $Status,
+ function EditReview($ReviewId,$CreatedOn,$ReviewText, $Status,
$IPAddress, $Priority, $ItemId,$ItemType,$CreatedById,$TextFormat,$Module='')
{
global $objSession;
-
+
$r = $this->GetItem($ReviewId);
if($CreatedById==0)
$CreatedById = $r->Get("CreatedById");
- $r->Set(array("ReviewId","CreatedOn","ReviewText","Status",
+ $r->Set(array("ReviewId","CreatedOn","ReviewText","Status",
"IPAddress", "Priority", "ItemId","ItemType","CreatedById","TextFormat"),
array($ReviewId,$CreatedOn,$ReviewText,$Status,
$IPAddress, $Priority, $ItemId,$ItemType,$CreatedById,$TextFormat));
if($Module) $r->Set('Module',$Module);
-
+
$r->Update();
//$r->SendUserEventMail("REVIEW.MODIFY",$objSession->Get("PortalUserId"));
- $r->SendAdminEventMail("REVIEW.MODIFY");
+ $r->SendAdminEventMail("REVIEW.MODIFY");
return $r;
}
function DeleteReview($ReviewId)
{
$r = $this->GetItem($ReviewId);
$r->Delete();
}
function CopyToItemId($OldId,$NewId)
{
$this->Clear();
$this->Query_Review("ItemId=$OldId","");
if($this->NumItems()>0)
{
foreach($this->Items as $i)
{
$i->Set("ItemId",$NewId);
$i->UnsetIdField();
$i->Create();
}
}
}
function CopyFromEditTable_Direct($idfield=null)
{
global $objSession;
$GLOBALS['_CopyFromEditTable']=1;
//echo "ToLive [Reviews]<br>";
$edit_table = $objSession->GetEditTable($this->SourceTable);
$idlist = array();
$sql = 'SELECT * FROM '.$edit_table;
$this->Clear();
-
+
// get all items in edit-table
$rs = $this->adodbConnection->Execute($sql);
while($rs && !$rs->EOF)
{
$data =& $rs->fields;
$c = $this->AddItemFromArray($data);
$c->Dirty();
$c->Update();
-
+
$idlist[] = $c->Get("ReviewId");
$rs->MoveNext();
}
-
+
//echo "DEL REVIEW SQL: $sql<br>";
-
+
$this->PurgeEditTable();
-
+
unset($GLOBALS['_CopyFromEditTable']);
}
-
+
function CopyFromEditTable($ResourceId, $saveEditTable = false)
{
global $objSession;
$GLOBALS['_CopyFromEditTable']=1;
//echo "ToLive [Reviews]<br>";
$edit_table = $objSession->GetEditTable($this->SourceTable);
$idlist = array();
$sql = 'SELECT * FROM '.$edit_table.' WHERE ItemId = '.(int)$ResourceId;
$this->Clear();
// get all items in edit-table
$rs = $this->adodbConnection->Execute($sql);
while($rs && !$rs->EOF)
{
$data =& $rs->fields;
$c = $this->AddItemFromArray($data);
$c->Dirty();
if($data["ReviewId"]>0)
{
$c->Update();
}
else
{
$c->UnsetIdField();
$c->Create();
}
$idlist[] = $c->Get("ReviewId");
$rs->MoveNext();
}
//print_pre($idlist);
$sql = "DELETE FROM ".$this->SourceTable." WHERE ItemId=$ResourceId ".(count($idlist) > 0 ? "AND ReviewId NOT IN (".implode(",",$idlist).")" : "");
//echo "DEL REVIEW SQL: $sql<br>";
$this->adodbConnection->Execute($sql);
-
+
if(!$saveEditTable) $this->PurgeEditTable();
-
+
unset($GLOBALS['_CopyFromEditTable']);
}
function PurgeEditTable($idfield = null)
{
$edit_table = $GLOBALS['objSession']->GetEditTable($this->SourceTable);
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS ".$edit_table);
}
-
+
function GetPageLinkList(&$UpdateVar,$dest_template=NULL,$page = NULL,$PagesToList=10,$HideEmpty=TRUE)
{
global $objConfig, $var_list_update, $var_list;
// if( !strlen($page) ) $page = GetIndexURL(2);
$PerPage = $objConfig->Get($this->PerPageVar);
if($PerPage<1)
$PerPage=20;
$NumPages = ceil($this->GetNumPages($PerPage));
if($NumPages==1 && $HideEmpty)
return "";
if(strlen($dest_template))
{
$var_list_update["t"] = $dest_template;
}
else
$var_list_update["t"] = $var_list["t"];
$o = "";
if($this->Page>$NumPages)
$this->Page=$NumPages;
$StartPage = (int)$this->Page - ($PagesToList/2);
if($StartPage<1)
$StartPage=1;
$EndPage = $StartPage+($PagesToList-1);
if($EndPage>$NumPages)
{
$EndPage = $NumPages;
$StartPage = $EndPage-($PagesToList-1);
if($StartPage<1)
$StartPage=1;
}
$o = "";
if($StartPage>1)
{
$UpdateVar["rp"] = $this->Page-$PagesToList;
$prev_url = HREF_Wrapper();
$o .= "<A HREF=\"$prev_url\">&lt;&lt;</A>";
}
for($p=$StartPage;$p<=$EndPage;$p++)
{
if($p!=$this->Page)
{
$UpdateVar["rp"]=$p;
$href = HREF_Wrapper();
$o .= " <A HREF=\"$href\" >$p</A> ";
}
else
{
$o .= "$p";
}
}
if($EndPage<$NumPages && $EndPage>0)
{
$UpdateVar["rp"]=$this->Page+$PagesToList;
$next_url = HREF_Wrapper();
$o .= "<A HREF=\"$next_url\"> &gt;&gt;</A>";
- }
+ }
unset($UpdateVar,$var_list_update["t"] );
- return $o;
+ return $o;
}
-
+
function AdminPrintItems($template)
{
// prints item listing for admin (browse/advanced view) tabs
$o = '<table border="0" cellspacing="2" width="100%"><tbody><tr>';
-
+
$i = 1;
-
+
$topleft = 0;
$topright = 0;
$rightcount = 0;
$total_items = $this->NumItems();
$topleft = ceil($total_items / 2);
$topright = $total_items - $topleft;
-
- for($x = 0; $x < $topleft; $x++)
+
+ for($x = 0; $x < $topleft; $x++)
{
//printingleft
$item = $this->Items[$x];
if ($i > 2)
{
$o .= "</tr>\n<tr>";
$i = 1;
}
$o .= $item->AdminParseTemplate($template);
$i++;
-
+
//printingright
- if ($rightcount < $topright && ( ($x + $topleft) < $total_items) )
+ if ($rightcount < $topright && ( ($x + $topleft) < $total_items) )
{
$item = $this->Items[ $x + $topleft ];
if ($i > 2)
- {
+ {
$o.="</tr>\n<tr>";
$i = 1;
}
$o .= $item->AdminParseTemplate($template);
$i++;
$rightcount++;
}
}
- $o .= "\n</tr></tbody></table>\n";
+ $o .= "\n</tr></tbody></table>\n";
return $o;
}
} /*clsItemReviewList*/
?>
\ No newline at end of file
Property changes on: trunk/kernel/include/itemreview.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.22
\ No newline at end of property
+1.23
\ No newline at end of property
Index: trunk/kernel/include/globals.php
===================================================================
--- trunk/kernel/include/globals.php (revision 7634)
+++ trunk/kernel/include/globals.php (revision 7635)
@@ -1,2039 +1,2039 @@
<?php
if (!function_exists('parse_portal_ini')) {
function parse_portal_ini($file, $parse_section = false) {
if (!file_exists($file)) return false;
if(file_exists($file) && !is_readable($file))
die('Could Not Open Ini File');
$contents = file($file);
$retval = array();
$section = '';
$ln = 1;
$resave = false;
foreach($contents as $line) {
if ($ln == 1 && $line != '<'.'?'.'php die() ?'.">\n") {
$resave = true;
}
$ln++;
$line = trim($line);
$line = eregi_replace(';[.]*','',$line);
if(strlen($line) > 0) {
//echo $line . " - ";
if(eregi('^[[a-z]+]$',str_replace(' ', '', $line))) {
//echo 'section';
$section = substr($line,1,(strlen($line)-2));
if ($parse_section) {
$retval[$section] = array();
}
continue;
} elseif(eregi('=',$line)) {
//echo 'main element';
list($key,$val) = explode(' = ',$line);
if (!$parse_section) {
$retval[trim($key)] = str_replace('"', '', $val);
}
else {
$retval[$section][trim($key)] = str_replace('"', '', $val);
}
} //end if
//echo '<br />';
} //end if
} //end foreach
if ($resave) {
$fp = fopen($file, "w");
reset($contents);
fwrite($fp,'<'.'?'.'php die() ?'.">\n\n");
foreach($contents as $line) fwrite($fp,"$line");
fclose($fp);
}
return $retval;
}
}
$vars = parse_portal_ini(FULL_PATH.'/config.php');
if ($vars) {
foreach ($vars as $config_key => $config_value) {
$GLOBALS['g_'.$config_key] = $config_value;
}
unset($config_key, $config_value);
}
/*list the tables which contain item data */
$ItemTables = array();
$KeywordIgnore = array();
global $debuglevel;
$debuglevel = 0;
//$GLOBALS['debuglevel'] = 0;
/*New, Hot, Pop field values */
define('NEVER', 0);
define('ALWAYS', 1);
define('AUTO', 2);
/*Status Values */
if( !defined('STATUS_DISABLED') ) define('STATUS_DISABLED', 0);
if( !defined('STATUS_ACTIVE') ) define('STATUS_ACTIVE', 1);
if( !defined('STATUS_PENDING') ) define('STATUS_PENDING', 2);
$LogLevel = 0;
$LogFile = NULL;
/**
* Returns reference to database connection
*
* @param bool $new_type Return Kernel4 or in-portal connection object
* @return kDBConnection
*/
function &GetADODBConnection($new_type = false)
{
static $DB = null;
global $g_DBType, $g_DBHost, $g_DBUser, $g_DBUserPassword, $g_DBName, $g_DebugMode;
global $ADODB_FETCH_MODE, $ADODB_COUNTRECS, $ADODB_CACHE_DIR, $pathtoroot;
if ($new_type) {
$application =& kApplication::Instance();
return $application->GetADODBConnection();
}
if( !isset($DB) && strlen($g_DBType) > 0 )
{
$DB = ADONewConnection($g_DBType);
$connected = $DB->Connect($g_DBHost, $g_DBUser, $g_DBUserPassword, $g_DBName);
if(!$connected) die("Error connecting to database $g_DBHost <br>\n");
$ADODB_CACHE_DIR = $pathtoroot."cache";
$ADODB_FETCH_MODE = 2;
$ADODB_COUNTRECS = false;
$DB->debug = defined('ADODB_OUTP') ? 1 : 0;
$DB->cacheSecs = 3600;
$DB->Execute('SET SQL_BIG_SELECTS = 1');
}
elseif( !strlen($g_DBType) )
{
global $rootURL;
echo 'In-Portal is probably not installed, or configuration file is missing.<br>';
echo 'Please use the installation script to fix the problem.<br><br>';
if ( !preg_match('/admin/', __FILE__) ) $ins = 'admin/';
echo '<a href="'.$rootURL.$ins.'install.php">Go to installation script</a><br><br>';
flush();
exit;
}
return $DB;
}
function GetNextResourceId($Increment=1)
{
global $objModules, $pathtoroot;
$table_name = GetTablePrefix().'IdGenerator';
$db = &GetADODBConnection();
// dummy protection: get maximal resource id used actually and fix last_id used
$max_resourceid = 0;
$m = GetModuleArray();
foreach($m as $key=>$value)
{
$path = $pathtoroot. $value."admin/include/parser.php";
if(file_exists($path))
{
include_once($path);
}
}
$table_info = $objModules->ExecuteFunction('GetModuleInfo', 'dupe_resourceids');
$sql_template = 'SELECT MAX(ResourceId) FROM '.GetTablePrefix().'%s';
foreach($table_info as $module_name => $module_info)
{
foreach($module_info as $module_sub_info)
{
$sql = sprintf($sql_template,$module_sub_info['Table']);
$tmp_resourceid = $db->GetOne($sql);
if($tmp_resourceid > $max_resourceid) $max_resourceid = $tmp_resourceid;
}
}
// update lastid to be next resourceid available
$db->Execute('LOCK TABLES '.$table_name.' WRITE');
$last_id = $db->GetOne('SELECT lastid FROM '.$table_name);
if ($last_id - 1 > $max_resourceid) $max_resourceid = $last_id - 1;
$id_diff = $db->GetOne('SELECT '.$max_resourceid.' + 1 - lastid FROM '.$table_name);
if($id_diff) $Increment += $id_diff;
$sql = 'UPDATE '.$table_name.' SET lastid = lastid + '.$Increment; // set new id in db
$db->Execute($sql);
$val = $db->GetOne('SELECT lastid FROM '.$table_name);
if($val === false)
{
$db->Execute('INSERT INTO '.$table_name.' (lastid) VALUES ('.$Increment.')');
$val = $Increment;
}
$db->Execute('UNLOCK TABLES');
return $val - $Increment + $id_diff; // return previous free id (-1) ?
}
function AddSlash($s)
{
if(substr($s,-1) != "/")
{
return $s."/";
}
else
return $s;
}
function StripNewline($s)
{
$bfound = false;
while (strlen($s)>0 && !$bfound)
{
if(ord(substr($s,-1))<32)
{
$s = substr($s,0,-1);
}
else
$bfound = true;
}
return $s;
}
function DeleteElement($array, $indice)
{
for($i=$indice;$i<count($array)-1;$i++)
$array[$i] = $array[$i+1];
unset($array[count($array)-1]);
return $array;
}
function DeleteElementValue($needle, &$haystack)
{
while(($gotcha = array_search($needle,$haystack)) > -1)
unset($haystack[$gotcha]);
}
function TableCount($TableName, $where="",$JoinCats=1)
{
$db = &GetADODBConnection();
if(!$JoinCats)
{
$sql = "SELECT count(*) as TableCount FROM $TableName";
}
else
$sql = "SELECT count(*) as TableCount FROM $TableName INNER JOIN ".GetTablePrefix()."CategoryItems ON ".GetTablePrefix()."CategoryItems.ItemResourceId=$TableName.ResourceId";
if(strlen($where)>0)
$sql .= " WHERE ".$where;
$rs = $db->Execute($sql);
// echo "SQL TABLE COUNT: ".$sql."<br>\n";
$res = $rs->fields["TableCount"];
return $res;
}
Function QueryCount($sql)
{
$sql = preg_replace('/SELECT(.*)FROM[ \n\r](.*)/is','SELECT COUNT(*) AS TableCount FROM $2', $sql);
$sql = preg_replace('/(.*)[ \n\r]LIMIT[ \n\r](.*)/is','$1', $sql);
$sql = preg_replace('/(.*)ORDER BY(.*)/is','$1', $sql);
//echo $sql;
$db =& GetADODBConnection();
return $db->GetOne($sql);
}
function GetPageCount($ItemsPerPage,$NumItems)
{
if($ItemsPerPage==0 || $NumItems==0)
{
return 1;
}
$value = $NumItems/$ItemsPerPage;
return ceil($value);
}
/**
* @return string
* @desc Returns database table prefix entered while installation
*/
function GetTablePrefix()
{
global $g_TablePrefix;
return $g_TablePrefix;
}
function TableHasPrefix($t)
{
$pre = GetTablePrefix();
if(strlen($pre)>0)
{
if(substr($t,0,strlen($pre))==$pre)
{
return TRUE;
}
else
return FALSE;
}
else
return TRUE;
}
function AddTablePrefix($t)
{
if(!TableHasPrefix($t))
$t = GetTablePrefix().$t;
return $t;
}
function ThisDomain()
{
global $objConfig, $g_Domain;
if($objConfig->Get("DomainDetect"))
{
$d = $_SERVER['HTTP_HOST'];
}
else
$d = $g_Domain;
return $d;
}
function GetIndexUrl($secure=0)
{
global $indexURL, $rootURL, $secureURL;
if ( class_exists('kApplication') )
{
$application =& kApplication::Instance();
return $application->BaseURL().'index.php';
}
switch($secure)
{
case 0:
$ret = $indexURL;
break;
case 1:
$ret = $secureURL."index.php";
break;
case 2:
$ret = $rootURL."index.php";
break;
default:
$ret = $i;
break;
}
return $ret;
}
function GetLimitSQL($Page,$PerPage)
{
if($Page<1)
$Page=1;
if(is_numeric($PerPage))
{
if($PerPage==0)
$PerPage = 20;
$Start = ($Page-1)*$PerPage;
$limit = "LIMIT ".$Start.",".$PerPage;
}
else
$limit = NULL;
return $limit;
}
function filelist ($currentdir, $startdir=NULL,$ext=NULL)
{
global $pathchar;
//chdir ($currentdir);
// remember where we started from
if (!$startdir)
{
$startdir = $currentdir;
}
$d = @opendir($currentdir);
$files = array();
if(!$d)
return $files;
//list the files in the dir
while (false !== ($file = readdir($d)))
{
if ($file != ".." && $file != ".")
{
if (is_dir($currentdir."/".$file))
{
// If $file is a directory take a look inside
$a = filelist ($currentdir."/".$file, $startdir,$ext);
if(is_array($a))
$files = array_merge($files,$a);
}
else
{
if($ext!=NULL)
{
$extstr = stristr($file,".".$ext);
if(strlen($extstr))
$files[] = $currentdir."/".$file;
}
else
$files[] = $currentdir.'/'.$file;
}
}
}
closedir ($d);
return $files;
}
function DecimalToBin($dec,$WordLength=8)
{
$bits = array();
$str = str_pad(decbin($dec),$WordLength,"0",STR_PAD_LEFT);
for($i=$WordLength;$i>0;$i--)
{
$bits[$i-1] = (int)substr($str,$i-1,1);
}
return $bits;
}
/*
function inp_escape($in, $html_enable=0)
{
$out = stripslashes($in);
$out = str_replace("\n", "\n^br^", $out);
if($html_enable==0)
{
$out=ereg_replace("<","&lt;",$out);
$out=ereg_replace(">","&gt;",$out);
$out=ereg_replace("\"","&quot;",$out);
$out = str_replace("\n^br^", "\n<br />", $out);
}
else
$out = str_replace("\n^br^", "\n", $out);
$out=addslashes($out);
return $out;
}
*/
function inp_escape($var,$html=0)
{
if($html)return $var;
if(is_array($var))
foreach($var as $k=>$v)
$var[$k]=inp_escape($v);
else
// $var=htmlspecialchars($var,ENT_NOQUOTES);
$var=strtr($var,Array('<'=>'&lt;','>'=>'&gt;',));
return $var;
}
function inp_striptags($var,$html=0)
{
if($html)return $var;
if(is_array($var))
foreach($var as $k=>$v)
$var[$k]=inp_striptags($v);
else
$var=strip_tags($var);
return $var;
}
function inp_unescape($in)
{
// if (get_magic_quotes_gpc())
return $in;
$out=stripslashes($in);
return $out;
}
function inp_textarea_unescape($in)
{
// if (get_magic_quotes_gpc())
return $in;
$out=stripslashes($in);
$out = str_replace("\n<br />", "\n", $out);
return $out;
}
function HighlightKeywords($Keywords, $html, $OpenTag="", $CloseTag="")
{
global $objConfig;
if(!strlen($OpenTag))
$OpenTag = "<B>";
if(!strlen($CloseTag))
$CloseTag = "</B>";
$r = preg_split('((>)|(<))', $html, -1, PREG_SPLIT_DELIM_CAPTURE);
foreach ($Keywords as $k) {
for ($i = 0; $i < count($r); $i++) {
if ($r[$i] == "<") {
$i++; continue;
}
$r[$i] = preg_replace('/('.preg_quote($k, '/').')/i', "$OpenTag\\1$CloseTag", $r[$i]);
}
}
return join("", $r);
}
/*
function HighlightKeywords($Keywords,$html, $OpenTag="", $CloseTag="")
{
global $objConfig;
if(!strlen($OpenTag))
$OpenTag = "<B>";
if(!strlen($CloseTag))
$CloseTag = "</B>";
$ret = strip_tags($html);
foreach ($Keywords as $k)
{
if(strlen($k))
{
//$html = str_replace("<$k>", ":#:", $html);
//$html = str_replace("</$k>", ":##:", $html);
//$html = strip_tags($html);
if ($html = preg_replace("/($k)/Ui","$OpenTag\\1$CloseTag", $html))
//if ($html = preg_replace("/(>[^<]*)($k)([^<]*< )/Ui","$OpenTag\\1$CloseTag", $html))
$ret = $html;
//$ret = str_replace(":#:", "<$k>", $ret);
//$ret = str_replace(":##:", "</$k>", $ret);
}
}
return $ret;
}
*/
function ExtractDatePart($part, $datestamp)
{
if ($datestamp <= 0) return '';
$formats = Array( 'month' => 'm', 'day' => 'd', 'year' => 'Y',
'time_24hr' => 'H:i', 'time_12hr' => 'g:i a', 'time' => GetTimeFormat(), 'date' => GetDateFormat() );
$format = isset($formats[$part]) ? $formats[$part] : $part;
return adodb_date($format, $datestamp);
}
function GetLocalTime($TimeStamp, $TargetZone = null)
{
global $objConfig;
if ($TargetZone == null) {
$TargetZone = $objConfig->Get('Config_Site_Time');
}
$server = $objConfig->Get('Config_Server_Time');
if ($TargetZone != $server) {
$offset = ($server - $TargetZone) * -1;
$TimeStamp = $TimeStamp + (3600 * $offset);
}
return $TimeStamp;
}
function _unhtmlentities ($string)
{
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
return strtr ($string, $trans_tbl);
}
function getLastStr($hay, $need){
$getLastStr = 0;
$pos = strpos($hay, $need);
if (is_int ($pos)){ //this is to decide whether it is "false" or "0"
while($pos) {
$getLastStr = $getLastStr + $pos + strlen($need);
$hay = substr ($hay , $pos + strlen($need));
$pos = strpos($hay, $need);
}
return $getLastStr - strlen($need);
} else {
return -1; //if $need wasn´t found it returns "-1" , because it could return "0" if it´s found on position "0".
}
}
// --- bbcode processing function: begin ----
function PreformatBBCodes($text)
{
// convert phpbb url bbcode to valid in-bulletin's format
// 1. urls
$text = preg_replace('/\[url=(.*)\](.*)\[\/url\]/Ui','[url href="$1"]$2[/url]',$text);
$text = preg_replace('/\[url\](.*)\[\/url\]/Ui','[url href="$1"]$1[/url]',$text);
// 2. images
$text = preg_replace('/\[img\](.*)\[\/img\]/Ui','[img src="$1" border="0"][/img]',$text);
// 3. color
$text = preg_replace('/\[color=(.*)\](.*)\[\/color\]/Ui','[font color="$1"]$2[/font]',$text);
// 4. size
$text = preg_replace('/\[size=(.*)\](.*)\[\/size\]/Ui','[font size="$1"]$2[/font]',$text);
// 5. lists
$text = preg_replace('/\[list(.*)\](.*)\[\/list\]/Uis','[ul]$2[/ul]',$text);
// 6. email to link
$text = preg_replace('/\[email\](.*)\[\/email\]/Ui','[url href="mailto:$1"]$1[/url]',$text);
//7. b tag
$text = preg_replace('/\[(b|i|u):(.*)\](.*)\[\/(b|i|u):(.*)\]/Ui','[$1]$3[/$4]',$text);
//8. code tag
$text = preg_replace('/\[code:(.*)\](.*)\[\/code:(.*)\]/Uis','[code]$2[/code]',$text);
return $text;
}
/**
* @return string
* @param string $BBCode
* @param string $TagParams
* @param string $TextInside
* @param string $ParamsAllowed
* @desc Removes not allowed params from tag and returns result
*/
function CheckBBCodeAttribs($BBCode, $TagParams, $TextInside, $ParamsAllowed)
{
// $BBCode - bbcode to check, $TagParams - params string entered by user
// $TextInside - text between opening and closing bbcode tag
// $ParamsAllowed - list of allowed parameter names ("|" separated)
$TagParams=str_replace('\"','"',$TagParams);
$TextInside=str_replace('\"','"',$TextInside);
if( $ParamsAllowed && preg_match_all('/ +([^=]*)=["\']?([^ "\']*)["\']?/is',$TagParams,$params,PREG_SET_ORDER) )
{
$ret = Array();
foreach($params as $param)
{
// remove spaces in both parameter name & value & lowercase parameter name
$param[1] = strtolower(trim($param[1])); // name lowercased
if(($BBCode=='url')&&($param[1]=='href'))
if(false!==strpos(strtolower($param[2]),'script:'))
return $TextInside;
// $param[2]='about:blank';
if( isset($ParamsAllowed[ $param[1] ]) )
$ret[] = $param[1].'="'.$param[2].'"';
}
$ret = count($ret) ? ' '.implode(' ',$ret) : '';
return '<'.$BBCode.$ret.'>'.$TextInside.'</'.$BBCode.'>';
}
else
return '<'.$BBCode.'>'.$TextInside.'</'.$BBCode.'>';
return false;
}
function ReplaceBBCode($text)
{
global $objConfig;
// convert phpbb bbcodes to in-bulletin bbcodes
$text = PreformatBBCodes($text);
// $tag_defs = 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border';
$tags_defs = $objConfig->Get('BBTags');
foreach(explode(';',$tags_defs) as $tag)
{
$tag = explode(':',$tag);
$tag_name = $tag[0];
$tag_params = $tag[1]?array_flip(explode('|',$tag[1])):0;
$text = preg_replace('/\['.$tag_name.'(.*)\](.*)\[\/'.$tag_name.' *\]/Uise','CheckBBCodeAttribs("'.$tag_name.'",\'$1\',\'$2\',$tag_params);', $text);
}
// additional processing for [url], [*], [img] bbcode
$text = preg_replace('/<url>(.*)<\/url>/Usi','<url href="$1">$1</url>',$text);
$text = preg_replace('/<font>(.*)<\/font>/Usi','$1',$text); // skip empty fonts
$text = str_replace( Array('<url','</url>','[*]'),
Array('<a target="_blank"','</a>','<li>'),
$text);
// bbcode [code]xxx[/code] processing
$text = preg_replace('/\[code\](.*)\[\/code\]/Uise', "ReplaceCodeBBCode('$1')", $text);
return $text;
}
function leadSpace2nbsp($x)
{
return "\n".str_repeat('&nbsp;',strlen($x));
}
function ReplaceCodeBBCode($input_string)
{
$input_string=str_replace('\"','"',$input_string);
$input_string=$GLOBALS['objSmileys']->UndoSmileys(_unhtmlentities($input_string));
$input_string=trim($input_string);
$input_string=inp_htmlize($input_string);
$input_string=str_replace("\r",'',$input_string);
$input_string = str_replace("\t", " ", $input_string);
$input_string = preg_replace('/\n( +)/se',"leadSpace2nbsp('$1')",$input_string);
$input_string='<div style="border:1px solid #888888;width:100%;background-color:#eeeeee;margin-top:6px;margin-bottom:6px"><div style="padding:10px;"><code>'.$input_string.'</code></div></div>';
// $input_string='<textarea wrap="off" style="border:1px solid #888888;width:100%;height:200px;background-color:#eeeeee;">'.inp_htmlize($input_string).'</textarea>';
return $input_string;
if(false!==strpos($input_string,'<'.'?'))
{
$input_string=str_replace('<'.'?','<'.'?php',$input_string);
$input_string=str_replace('<'.'?phpphp','<'.'?php',$input_string);
$input_string=@highlight_string($input_string,1);
}
else
{
$input_string = @highlight_string('<'.'?php'.$input_string.'?'.'>',1);
$input_string = str_replace('&lt;?php', '', str_replace('?&gt;', '', $input_string));
}
return str_replace('<br />','',$input_string);
}
// --- bbcode processing function: end ----
function GetMinValue($Table,$Field, $Where=NULL)
{
$ret = 0;
$sql = "SELECT min($Field) as val FROM $Table ";
if(strlen($where))
$sql .= "WHERE $Where";
$ado = &GetADODBConnection();
$rs = $ado->execute($sql);
if($rs)
$ret = (int)$rs->fields["val"];
return $ret;
}
if (!function_exists( 'getmicrotime' ) ) {
function getmicrotime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
}
function SetMissingDataErrors($f)
{
global $FormError;
$count = 0;
if(is_array($_POST))
{
if(is_array($_POST["required"]))
{
foreach($_POST["required"] as $r)
{
$found = FALSE;
if(is_array($_FILES))
{
if( isset($_FILES[$r]) && $_FILES[$r]['size'] > 0 ) $found = TRUE;
}
if(!strlen(trim($_POST[$r])) && !$found)
{
$count++;
if (($r == "dob_day") || ($r == "dob_month") || ($r == "dob_year"))
$r = "dob";
$tag = isset($_POST["errors"]) ? $_POST["errors"][$r] : '';
if(!strlen($tag))
$tag = "lu_ferror_".$f."_".$r;
$FormError[$f][$r] = language($tag);
}
}
}
}
return $count;
}
function makepassword($length=10)
{
$pass_length=$length;
$p1=array('b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z');
$p2=array('a','e','i','o','u');
$p3=array('1','2','3','4','5','6','7','8','9');
$p4=array('(','&',')',';','%'); // if you need real strong stuff
// how much elements in the array
// can be done with a array count but counting once here is faster
$s1=21;// this is the count of $p1
$s2=5; // this is the count of $p2
$s3=9; // this is the count of $p3
$s4=5; // this is the count of $p4
// possible readable combinations
$c1='121'; // will be like 'bab'
$c2='212'; // will be like 'aba'
$c3='12'; // will be like 'ab'
$c4='3'; // will be just a number '1 to 9' if you dont like number delete the 3
// $c5='4'; // uncomment to active the strong stuff
$comb='4'; // the amount of combinations you made above (and did not comment out)
for ($p=0;$p<$pass_length;)
{
mt_srand((double)microtime()*1000000);
$strpart=mt_rand(1,$comb);
// checking if the stringpart is not the same as the previous one
if($strpart<>$previous)
{
$pass_structure.=${'c'.$strpart};
// shortcutting the loop a bit
$p=$p+strlen(${'c'.$strpart});
}
$previous=$strpart;
}
// generating the password from the structure defined in $pass_structure
for ($g=0;$g<strlen($pass_structure);$g++)
{
mt_srand((double)microtime()*1000000);
$sel=substr($pass_structure,$g,1);
$pass.=${'p'.$sel}[mt_rand(0,-1+${'s'.$sel})];
}
return $pass;
}
function LogEntry($text,$writefile=FALSE)
{
global $g_LogFile,$LogFile, $LogData, $LogLevel, $timestart;
static $last;
if(strlen($g_LogFile))
{
$el = str_pad(getmicrotime()- $timestart,10," ");
if($last>0)
$elapsed = getmicrotime() - $last;
if(strlen($el)>10)
$el = substr($el,0,10);
$indent = str_repeat(" ",$LogLevel);
$text = str_pad($text,$LogLevel,"==",STR_PAD_LEFT);
$LogData .= "$el:". round($elapsed,6).":$indent $text";
$last = getmicrotime();
if($writefile==TRUE && is_writable($g_LogFile))
{
if(!$LogFile)
{
if(file_exists($g_LogFile))
unlink($g_LogFile);
$LogFile=@fopen($g_LogFile,"w");
}
if($LogFile)
{
fputs($LogFile,$LogData);
}
}
}
}
function ValidEmail($email)
{
if (eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $email))
{
return TRUE;
}
else
{
return FALSE;
}
}
function language($phrase,$LangId=0)
{
global $objSession, $objLanguageCache, $objLanguages;
if ($LangId == 0) {
$LangId = $objSession->Get('Language');
}
if ($LangId == 0) {
$LangId = $objLanguages->GetPrimary();
}
return $objLanguageCache->GetTranslation($phrase,$LangId);
}
function admin_language($phrase,$lang=0,$LinkMissing=FALSE)
{
global $objSession, $objLanguageCache, $objLanguages;
//echo "Language passed: $lang<br>";
if($lang==0)
$lang = $objSession->Get("Language");
//echo "Language from session: $lang<br>";
if($lang==0)
$lang = $objLanguages->GetPrimary();
//echo "Language after primary: $lang<br>";
//echo "Phrase: $phrase<br>";
$translation = $objLanguageCache->GetTranslation($phrase,$lang);
if($LinkMissing && substr($translation,0,1)=="!" && substr($translation,-1)=="!")
{
$res = "<A href=\"javascript:OpenPhraseEditor('&direct=1&label=$phrase'); \">$translation</A>";
return $res;
}
else
return $translation;
}
function prompt_language($phrase,$lang=0)
{
return admin_language($phrase,$lang,TRUE);
}
function GetPrimaryTranslation($Phrase)
{
global $objLanguages;
$l = $objLanguages->GetPrimary();
return language($Phrase,$l);
}
function CategoryNameCount($ParentId,$Name)
{
$cat_table = GetTablePrefix()."Category";
$sql = "SELECT Name from $cat_table WHERE ParentId=$ParentId AND ";
$sql .="(Name LIKE '".addslashes($Name)."' OR Name LIKE 'Copy of ".addslashes($Name)."' OR Name LIKE 'Copy % of ".addslashes($Name)."')";
$ado = &GetADODBConnection();
$rs = $ado->Execute($sql);
$ret = array();
while($rs && !$rs->EOF)
{
$ret[] = $rs->fields["Name"];
$rs->MoveNext();
}
return $ret;
}
function CategoryItemNameCount($CategoryId,$Table,$Field,$Name)
{
$Name=addslashes($Name);
$cat_table = GetTablePrefix()."CategoryItems";
$sql = "SELECT $Field FROM $Table INNER JOIN $cat_table ON ($Table.ResourceId=$cat_table.ItemResourceId) ";
$sql .=" WHERE ($Field LIKE 'Copy % of $Name' OR $Field LIKE '$Name' OR $Field LIKE 'Copy of $Name') AND CategoryId=$CategoryId";
//echo $sql."<br>\n ";
$ado = &GetADODBConnection();
$rs = $ado->Execute($sql);
$ret = array();
while($rs && !$rs->EOF)
{
$ret[] = $rs->fields[$Field];
$rs->MoveNext();
}
return $ret;
}
function &GetItemCollection($ItemName)
{
global $objItemTypes;
if(is_numeric($ItemName))
{
$item = $objItemTypes->GetItem($ItemName);
}
else
$item = $objItemTypes->GetTypeByName($ItemName);
if(is_object($item))
{
$module = $item->Get("Module");
$prefix = ModuleTagPrefix($module);
$func = $prefix."_ItemCollection";
if(function_exists($func))
{
$var =& $func();
}
}
return $var;
}
function UpdateCategoryCount($item_type,$CategoriesIds,$ListType='')
{
global $objCountCache, $objItemTypes;
$db=&GetADODBConnection();
if( !is_numeric($item_type) )
{
$sql = 'SELECT ItemType FROM '.$objItemTypes->SourceTable.' WHERE ItemName=\''.$item_type.'\'';
$item_type=$db->GetOne($sql);
}
$objCountCache->EraseGlobalTypeCache($item_type);
if($item_type)
{
if(is_array($CategoriesIds))
{
$CategoriesIds=implode(',',$CategoriesIds);
}
if (!$CategoriesIds)
{
}
if(!is_array($ListType)) $ListType=Array($ListType=>'opa');
$sql = 'SELECT ParentPath FROM '.GetTablePrefix().'Category WHERE CategoryId IN ('.$CategoriesIds.')';
$rs = $db->Execute($sql);
$parents = Array();
while (!$rs->EOF)
{
$tmp=$rs->fields['ParentPath'];
$tmp=substr($tmp,1,strlen($tmp)-2);
$tmp=explode('|',$tmp);
foreach ($tmp as $tmp_cat_id) {
$parents[$tmp_cat_id]=1;
}
$rs->MoveNext();
}
$parents=array_keys($parents);
$list_types=array_keys($ListType);
foreach($parents as $ParentCategoryId)
{
foreach ($list_types as $list_type) {
$objCountCache->DeleteValue($list_type, $item_type, $ParentCategoryId, 0); // total count
$objCountCache->DeleteValue($list_type, $item_type, $ParentCategoryId, 1); // total count today
}
}
}
else
{
die('wrong item type passed to "UpdateCategoryCount"');
}
/* if(is_object($item))
{
$ItemType = $item->Get("ItemType");
$sql = "DELETE FROM ".$objCountCache->SourceTable." WHERE ItemType=$ItemType";
if( is_numeric($ListType) ) $sql .= " AND ListType=$ListType";
$objCountCache->adodbConnection->Execute($sql);
} */
}
function ResetCache($CategoryId)
{
global $objCountCache;
$db =& GetADODBConnection();
$sql = 'SELECT ParentPath FROM '.GetTablePrefix().'Category WHERE CategoryId = '.$CategoryId;
$parents = $db->GetOne($sql);
$parents = substr($parents,1,strlen($parents)-2);
$parents = explode('|',$parents);
foreach($parents as $ParentCategoryId)
{
$objCountCache->DeleteValue('_', TYPE_TOPIC, $ParentCategoryId, 0); // total topic count
$objCountCache->DeleteValue('_', TYPE_TOPIC, $ParentCategoryId, 1); // total
}
}
function UpdateModifiedCategoryCount($ItemTypeName,$CatId=NULL,$Modifier=0,$ExtraId=NULL)
{
}
function UpdateGroupCategoryCount($ItemTypeName,$CatId=NULL,$Modifier=0,$GroupId=NULL)
{
}
function GetTagCache($module,$tag,$attribs,$env)
{
global $objSystemCache, $objSession, $objConfig;
if($objConfig->Get("SystemTagCache") && !$objSession->Get('PortalUserId'))
{
$name = $tag;
if(is_array($attribs))
{
foreach($attribs as $n => $val)
{
$name .= "-".$val;
}
}
$CachedValue = $objSystemCache->GetContextValue($name,$module,$env, $objSession->Get("GroupList"));
}
else
$CachedValue="";
return $CachedValue;
}
function SaveTagCache($module, $tag, $attribs, $env, $newvalue)
{
global $objSystemCache, $objSession, $objConfig;
if($objConfig->Get("SystemTagCache"))
{
$name = $tag;
if(is_array($attribs))
{
foreach($attribs as $a => $val)
{
$name .= "-".$val;
}
}
$objSystemCache->EditCacheItem($name,$newvalue,$module,0,$env,$objSession->Get("GroupList"));
}
}
function DeleteTagCache($name,$extraparams, $env="")
{
global $objSystemCache, $objConfig;
if($objConfig->Get("SystemTagCache"))
{
$where = "Name LIKE '$name%".$extraparams."'";
if(strlen($env))
$where .= " AND Context LIKE $env";
$objSystemCache->DeleteCachedItem($where);
}
}
/**
* Deletes whole tag cache for
* selected module
*
* @param string $module
* @param string $name
* @access public
*/
function DeleteModuleTagCache($module, $tagname='')
{
global $objSystemCache, $objConfig;
if($objConfig->Get("SystemTagCache"))
{
$where = 'Module LIKE \''.$module.'\'';
if(strlen($tagname))
{
$where .= ' AND Name LIKE \''.$tagname.'\'';
}
$objSystemCache->DeleteCachedItem($where);
}
}
/*function ClearTagCache()
{
global $objSystemCache, $objConfig;
if($objConfig->Get("SystemTagCache"))
{
$where = '';
$objSystemCache->DeleteCachedItem($where);
}
}*/
/*function EraseCountCache()
{
// global $objSystemCache, $objConfig;
$db =& GetADODBConnection();
$sql = 'DELETE * FROM '.GetTablePrefix().'CountCache';
return $db->Execute($sql) ? true : false;
}*/
function ParseTagLibrary()
{
$objTagList = new clsTagList();
$objTagList->ParseInportalTags();
unset($objTagList);
}
function GetDateFormat($LangId = 0, $is_input = false)
{
global $objLanguages;
if (!$LangId) {
$LangId = $objLanguages->GetPrimary();
}
$l = $objLanguages->GetItem($LangId);
$fmt = is_object($l) ? $l->Get(($is_input ? 'Input' : '').'DateFormat') : 'm-d-Y';
if (getArrayValue($GLOBALS, 'FrontEnd')) {
return $fmt;
}
return preg_replace('/y+/i','Y', $fmt);
}
function GetTimeFormat($LangId = 0, $is_input = false)
{
global $objLanguages;
if (!$LangId) {
$LangId = $objLanguages->GetPrimary();
}
$l = $objLanguages->GetItem($LangId);
$fmt = is_object($l) ? $l->Get(($is_input ? 'Input' : '').'TimeFormat') : 'H:i:s';
return $fmt;
}
/**
* Gets one of currently selected language options
*
* @param string $optionName
* @param int $LangId
* @return string
* @access public
*/
function GetRegionalOption($optionName,$LangId=0)
{
global $objLanguages, $objSession;
if(!$LangId) $LangId=$objSession->Get('Language');
if(!$LangId) $LangId=$objLanguages->GetPrimary();
$l = $objLanguages->GetItem($LangId);
return is_object($l)?$l->Get($optionName):false;
}
/**
* Returns formatted timestamp
*
* @param int $TimeStamp
* @param int $LangId
* @param bool $is_input use input date format instead of display date format
* @return string
*/
function LangDate($TimeStamp = null, $LangId = 0, $is_input = false)
{
$fmt = GetDateFormat($LangId, $is_input);
return adodb_date($fmt, $TimeStamp);
}
/**
* Returns formatted timestamp
*
* @param int $TimeStamp
* @param int $LangId
* @param bool $is_input use input time format instead of display time format
* @return string
*/
function LangTime($TimeStamp = null, $LangId = 0, $is_input = false)
{
$fmt = GetTimeFormat($LangId, $is_input);
return adodb_date($fmt, $TimeStamp);
}
function LangNumber($Num,$DecPlaces=NULL,$LangId=0)
{
global $objLanguages;
if(!$LangId)
$LangId= $objLanguages->GetPrimary();
$l = $objLanguages->GetItem($LangId);
if(is_object($l))
{
$ret = number_format($Num,$DecPlaces,$l->Get("DecimalPoint"),$l->Get("ThousandSep"));
}
else
$ret = $num;
return $ret;
}
function replacePngTags($x, $spacer="images/spacer.gif")
{
global $rootURL,$pathtoroot;
// make sure that we are only replacing for the Windows versions of Internet
// Explorer 5+, and not Opera identified as MSIE
$msie='/msie\s([5-9])\.?[0-9]*.*(win)/i';
$opera='/opera\s+[0-9]+/i';
if(!isset($_SERVER['HTTP_USER_AGENT']) ||
!preg_match($msie,$_SERVER['HTTP_USER_AGENT']) ||
preg_match($opera,$_SERVER['HTTP_USER_AGENT']))
return $x;
// find all the png images in backgrounds
preg_match_all('/background-image:\s*url\(\'(.*\.png)\'\);/Uis',$x,$background);
for($i=0;$i<count($background[0]);$i++){
// simply replace:
// "background-image: url('image.png');"
// with:
// "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(
// enabled=true, sizingMethod=scale src='image.png');"
// haven't tested to see if background-repeat styles work...
$x=str_replace($background[0][$i],'filter:progid:DXImageTransform.'.
'Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale'.
' src=\''.$background[1][$i].'\');',$x);
}
// OK, time to find all the IMG tags with ".png" in them
preg_match_all('/(<img.*\.png.*>|<input.*type=([\'"])image\\2.*\.png.*>)/Uis',$x,$images);
while(list($imgnum,$v)=@each($images[0])){
$original=$v;
$atts=''; $width=0; $height=0;
// If the size is defined by styles, find
preg_match_all('/style=".*(width: ([0-9]+))px.*'.
'(height: ([0-9]+))px.*"/Ui',$v,$arr2);
if(is_array($arr2) && count($arr2[0])){
// size was defined by styles, get values
$width=$arr2[2][0];
$height=$arr2[4][0];
}
// size was not defined by styles, get values
preg_match_all('/width=\"?([0-9]+)\"?/i',$v,$arr2);
if(is_array($arr2) && count($arr2[0])){
$width=$arr2[1][0];
}
preg_match_all('/height=\"?([0-9]+)\"?/i',$v,$arr2);
if(is_array($arr2) && count($arr2[0])){
$height=$arr2[1][0];
}
preg_match_all('/src=\"([^\"]+\.png)\"/i',$v,$arr2);
if(isset($arr2[1][0]) && !empty($arr2[1][0]))
$image=$arr2[1][0];
else
$image=NULL;
// We do this so that we can put our spacer.gif image in the same
// directory as the image
$tmp=split('[\\/]',$image);
array_pop($tmp);
$image_path=join('/',$tmp);
if(substr($image,0,strlen($rootURL))==$rootURL)
{
$path = str_replace($rootURL,$pathtoroot,$image);
}
else
{
$path = $pathtoroot."themes/telestial/$image";
}
// echo "Sizing $path.. <br>\n";
// echo "Full Tag: ".htmlentities($image)."<br>\n";
//if(!$height || !$width)
//{
$g = imagecreatefrompng($path);
if($g)
{
$height = imagesy($g);
$width = imagesx($g);
}
//}
if(strlen($image_path)) $image_path.='/';
// end quote is already supplied by originial src attribute
$replace_src_with=$spacer.'" style="width: '.$width.
'px; height: '.$height.'px; filter: progid:DXImageTransform.'.
'Microsoft.AlphaImageLoader(src=\''.$image.'\', sizingMethod='.
'\'scale\')';
// now create the new tag from the old
$new_tag=str_replace($image,$replace_src_with,$original);
// now place the new tag into the content
$x=str_replace($original,$new_tag,$x);
}
return $x;
}
function GetOptions($field) // by Alex
{
// get dropdown values from custom field
$tmp =& new clsCustomField();
$tmp->LoadFromDatabase($field, 'FieldName');
$tmp_values = $tmp->Get('ValueList');
unset($tmp);
$tmp_values = explode(',', $tmp_values);
foreach($tmp_values as $mixed)
{
$elem = explode('=', trim($mixed));
$ret[ $elem[0] ] = $elem[1];
}
return $ret;
}
function ResetPage($module_prefix, $page_variable = 'p')
{
// resets page in specific module when category is changed
global $objSession;
if( !is_object($objSession) ) // when changing pages session doesn't exist -> InPortal BUG
{
global $var_list, $SessionQueryString, $FrontEnd;
$objSession = new clsUserSession($var_list["sid"],($SessionQueryString && $FrontEnd==1));
}
$last_cat = $objSession->GetVariable('last_category');
$prev_cat = $objSession->GetVariable('prev_category');
//echo "Resetting Page [$prev_cat] -> [$last_cat]<br>";
if($prev_cat != $last_cat) $GLOBALS[$module_prefix.'_var_list'][$page_variable] = 1;
}
if( !function_exists('GetVar') )
{
/**
* @return string
* @param string $name
* @param bool $post_priority
* @desc Get's variable from http query
*/
function GetVar($name, $post_priority = false)
{
if(!$post_priority) // follow gpc_order in php.ini
return isset($_REQUEST[$name]) ? $_REQUEST[$name] : false;
else // get variable from post 1stly if not found then from get
return isset($_POST[$name]) && $_POST[$name] !== false ? $_POST[$name] : ( isset($_GET[$name]) && $_GET[$name] ? $_GET[$name] : false );
}
}
function SetVar($VarName, $VarValue)
{
$_REQUEST[$VarName] = $VarValue;
$_POST[$VarName] = $VarValue;
$_GET[$VarName] = $VarValue;
}
function PassVar(&$source)
{
// source array + any count of key names in passed array
$params = func_get_args();
array_shift($params);
if( count($params) )
{
$ret = Array();
foreach($params as $var_name)
if( isset($source[$var_name]) )
$ret[] = $var_name.'='.$source[$var_name];
$ret = '&'.implode('&', $ret);
}
return $ret;
}
function GetSubmitVariable(&$array, $postfix)
{
// gets edit status of module
// used in case if some modules share
// common action parsed by kernel parser,
// but each module uses own EditStatus variable
$modules = Array('In-Link' => 'Link', 'In-News' => 'News', 'In-Bulletin' => 'Topic', 'In-Portal'=>'Review');
foreach($modules as $module => $prefix)
if( isset($array[$prefix.$postfix]) )
return Array('Module' => $module, 'variable' => $array[$prefix.$postfix]);
return false;
}
function GetModuleByAction()
{
$prefix2module = Array('m' => 'In-Portal', 'l' => 'In-Link', 'n' => 'In-News', 'bb' => 'In-Bulletin');
$action = GetVar('Action');
if($action)
{
$module_prefix = explode('_', $action);
return $prefix2module[ $module_prefix[0] ];
}
else
return false;
}
function dir_size($dir) {
// calculates folder size based on filesizes inside it (recursively)
$totalsize=0;
if ($dirstream = @opendir($dir)) {
while (false !== ($filename = readdir($dirstream))) {
if ($filename!="." && $filename!="..")
{
if (is_file($dir."/".$filename))
$totalsize+=filesize($dir."/".$filename);
if (is_dir($dir."/".$filename))
$totalsize+=dir_size($dir."/".$filename);
}
}
}
closedir($dirstream);
return $totalsize;
}
function size($bytes) {
// shows formatted file/directory size
$types = Array("la_bytes","la_kilobytes","la_megabytes","la_gigabytes","la_terabytes");
$current = 0;
while ($bytes > 1024) {
$current++;
$bytes /= 1024;
}
return round($bytes,2)." ".language($types[$current]);
}
function echod($str)
{
// echo debug output
echo str_replace( Array('[',']'), Array('[<b>', '</b>]'), $str).'<br>';
}
function PrepareParams($source, $to_lower, $mapping)
{
// prepare array with form values to use with item
$result = Array();
foreach($to_lower as $field)
$result[ $field ] = $source[ strtolower($field) ];
if( is_array($mapping) )
{
foreach($mapping as $field_from => $field_to)
$result[$field_to] = $source[$field_from];
}
return $result;
}
function GetELT($field, $phrases = Array())
{
// returns FieldOptions equivalent in In-Portal
$ret = Array();
foreach($phrases as $phrase)
$ret[] = admin_language($phrase);
$ret = "'".implode("','", $ret)."'";
return 'ELT('.$field.','.$ret.')';
}
function GetModuleImgPath($module)
{
global $rootURL, $admin;
return $rootURL.$module.'/'.$admin.'/images';
}
function ActionPostProcess($StatusField, $ListClass, $ListObjectName = '', $IDField = null)
{
// each action postprocessing stuff from admin
if( !isset($_REQUEST[$StatusField]) ) return false;
$list =& $GLOBALS[$ListObjectName];
if( !is_object($list) ) $list = new $ListClass();
$SFValue = $_REQUEST[$StatusField]; // status field value
switch($SFValue)
{
case 1: // User hit "Save" button
$list->CopyFromEditTable($IDField);
break;
case 2: // User hit "Cancel" button
$list->PurgeEditTable($IDField);
break;
}
if( function_exists('SpecificProcessing') ) SpecificProcessing($StatusField, $SFValue);
if($SFValue == 1 || $SFValue == 2) $list->Clear();
}
function MakeHTMLTag($element, $attrib_prefix)
{
$result = Array();
$ap_length = strlen($attrib_prefix);
foreach($element->attributes as $attib_name => $attr_value)
if( substr($attib_name, $ap_length) == $ap_length )
$result[] = substr($attib_name, $ap_length, strlen($attib_name)).'="'.$attr_value.'"';
return count($result) ? implode(' ', $result) : false;
}
function GetImportScripts()
{
// return currently installed import scripts
static $import_scripts = Array();
if( count($import_scripts) == 0 )
{
$sql = 'SELECT imp.* , m.LoadOrder
FROM '.TABLE_PREFIX.'ImportScripts imp
LEFT JOIN '.TABLE_PREFIX.'Modules m ON m.Name = imp.is_Module
WHERE m.Loaded = 1
ORDER BY m.LoadOrder';
$db =& GetADODBConnection();
$rs = $db->Execute($sql);
if ($rs && $rs->RecordCount() > 0) {
while (!$rs->EOF) {
$rec =& $rs->fields;
$import_scripts[ $rec['is_id'] ] = Array( 'label' => $rec['is_label'], 'url' => $rec['is_script'],
'enabled' => $rec['is_enabled'], 'field_prefix' => $rec['is_field_prefix'],
'id' => $rec['is_string_id'], 'required_fields' => $rec['is_requred_fields'],
'module' => strtolower($rec['is_Module']) );
$rs->MoveNext();
}
}
else {
$import_scripts = Array();
}
}
return $import_scripts;
}
function GetImportScript($id)
{
$scripts = GetImportScripts();
return isset($scripts[$id]) ? $scripts[$id] : false;
}
function GetNextTemplate($current_template)
{
// used on front, returns next template to make
// redirect to
$dest = GetVar('dest', true);
if(!$dest) $dest = GetVar('DestTemplate', true);
return $dest ? $dest : $current_template;
}
// functions for dealign with enviroment variable construction
function GenerateModuleEnv($prefix, $var_list)
{
// globalize module varible arrays
$main =& $GLOBALS[$prefix.'_var_list'];
$update =& $GLOBALS[$prefix.'_var_list_update'];
//echo "VAR: [$main]; VAR_UPDATE: [$update]<br>";
// if update var count is zero, then do nothing
if( !is_array($update) || count($update) == 0 ) return '';
// ensure that we have no empty values in enviroment variable
foreach($update as $vl_key => $vl_value) {
if(!$vl_value) $update[$vl_key] = '0'; // unset($update[$vl_key]);
}
foreach($main as $vl_key => $vl_value) {
if(!$vl_value) $main[$vl_key] = '0'; // unset($main[$vl_key]);
}
$ret = Array();
foreach($var_list as $var_name) {
$value = GetEnvVar($prefix, $var_name);
if(!$value && $var_name == 'id') $value = '0';
$ret[] = $value;
}
// Removing all var_list_udpate
$keys = array_keys($update);
foreach ($keys as $key) {
unset($update[$key]);
}
return ':'.$prefix.implode('-',$ret);
}
// functions for dealign with enviroment variable construction
function GenerateModuleEnv_NEW($prefix, $var_list)
{
// globalize module varible arrays
$main =& $GLOBALS[$prefix.'_var_list'];
$update =& $GLOBALS[$prefix.'_var_list_update'];
//echo "VAR: [$main]; VAR_UPDATE: [$update]<br>";
if ( isset($update) && $update )
{
// ensure that we have no empty values in enviroment variable
foreach($update as $vl_key => $vl_value) {
if(!$vl_value) $update[$vl_key] = '0'; // unset($update[$vl_key]);
}
$app =& kApplication::Instance();
$passed = $app->GetVar('prefixes_passed');
$passed[] = $prefix;
$app->SetVar('prefixes_passed', $passed);
}
else
{
return Array();
}
if ($main) {
foreach($main as $vl_key => $vl_value) {
if(!$vl_value) $main[$vl_key] = '0'; // unset($main[$vl_key]);
}
}
$ret = Array();
foreach($var_list as $src_name => $dst_name) {
$ret[$dst_name] = GetEnvVar($prefix, $src_name);
}
// Removing all var_list_udpate
if ( isset($update) && $update )
{
$keys = array_keys($update);
foreach ($keys as $key) unset($update[$key]);
}
return $ret;
}
function GetEnvVar($prefix, $name)
{
// get variable from template variable's list
// (used in module parsers to build env string)
$main =& $GLOBALS[$prefix.'_var_list'];
$update =& $GLOBALS[$prefix.'_var_list_update'];
// if part of env found in POST, then use it first
$submit_value = GetVar($prefix.'_'.$name);
if ($submit_value !== false) {
return $submit_value;
}
return isset($update[$name]) ? $update[$name] : ( isset($main[$name]) ? $main[$name] : '');
}
/**
* Checks if debug mode is active
*
* @return bool
*/
function IsDebugMode($check_debugger = true)
{
$application =& kApplication::Instance();
return $application->isDebugMode($check_debugger);
}
/**
* Checks if we are in admin
*
* @return bool
*/
function IsAdmin()
{
$application =& kApplication::Instance();
return $application->IsAdmin();
}
/**
* Two strings in-case-sensitive compare.
* Returns >0, when string1 > string2,
* <0, when string1 > string2,
* 0, when string1 = string2
*
* @param string $string1
* @param string $string2
* @return int
*/
function stricmp ($string1, $string2) {
return strcmp(strtolower($string1), strtolower($string2));
}
/**
* Generates unique code
*
* @return string
*/
function GenerateCode()
{
list($usec, $sec) = explode(" ",microtime());
$id_part_1 = substr($usec, 4, 4);
$id_part_2 = mt_rand(1,9);
$id_part_3 = substr($sec, 6, 4);
$digit_one = substr($id_part_1, 0, 1);
if ($digit_one == 0) {
$digit_one = mt_rand(1,9);
$id_part_1 = ereg_replace("^0","",$id_part_1);
$id_part_1=$digit_one.$id_part_1;
}
return $id_part_1.$id_part_2.$id_part_3;
}
function bracket_comp($elem1, $elem2)
{
if( ($elem1['End']>$elem2['End'] || $elem1['End'] == -1) && $elem2['End'] != -1 )
{
return 1;
}
elseif ( ($elem1['End']<$elem2['End'] || $elem2['End'] == -1) && $elem1['End'] != -1 )
{
return -1;
}
else
{
return 0;
}
}
function bracket_id_sort($first_id, $second_id)
{
$first_abs = abs($first_id);
$second_abs = abs($second_id);
$first_sign = ($first_id == 0) ? 0 : $first_id / $first_abs;
$second_sign = ($second_id == 0) ? 0 : $second_id / $second_abs;
if($first_sign != $second_sign)
{
if($first_id > $second_id) {
$bigger =& $first_abs;
$smaller =& $second_abs;
}
else {
$bigger =& $second_abs;
$smaller =& $first_abs;
}
$smaller = $bigger + $smaller;
}
if($first_abs > $second_abs) {
return 1;
}
elseif ($first_abs < $second_abs)
{
return -1;
}
else
{
return 0;
}
}
function ap_bracket_comp($elem1, $elem2)
{
if ($elem1['FromAmount']!="" && $elem1['ToAmount']=="" && $elem2['FromAmount']!="" && $elem2['ToAmount']!="") return 1;
if ($elem1['FromAmount']!="" && $elem1['ToAmount']=="" && $elem2['FromAmount']=="" && $elem2['ToAmount']=="") return -1;
if ($elem1['ToAmount']=="" && $elem2['ToAmount']!="") return 1;
if ($elem1['ToAmount']!="" && $elem2['ToAmount']=="") return -1;
if( ($elem1['ToAmount']>$elem2['ToAmount'] && $elem2['ToAmount']!=-1) || ($elem1['ToAmount'] == -1 && $elem2['ToAmount'] != -1 ))
{
return 1;
}
elseif ( ($elem1['ToAmount']<$elem2['ToAmount']) || ($elem2['ToAmount'] == -1 && $elem1['ToAmount'] != -1 ))
{
return -1;
}
else
{
return 0;
}
}
function inp_htmlize($var, $strip = 0)
{
if( is_array($var) )
{
foreach($var as $k => $v) $var[$k] = inp_htmlize($v, $strip);
}
else
{
$var = htmlspecialchars($strip ? stripslashes($var) : $var);
}
return $var;
}
/**
* Sets in-portal cookies, that will not harm K4 to breath free :)
*
* @param string $name
* @param mixed $value
* @param int $expire
* @author Alex
*/
function set_cookie($name, $value, $expire = 0, $cookie_path = null)
{
if (!isset($cookie_path))
{
$cookie_path = IsAdmin() ? rtrim(BASE_PATH, '/').'/admin' : BASE_PATH;
}
setcookie($name, $value, $expire, $cookie_path, $_SERVER['HTTP_HOST']);
}
/**
* If we are on login required template, but we are not logged in, then logout user
*
* @return bool
*/
function require_login($condition = null, $redirect_params = 'logout=1', $pass_env = false)
{
if( !isset($condition) ) $condition = !admin_login();
if(!$condition) return false;
global $objSession, $adminURL;
if( !headers_sent() ) set_cookie(SESSION_COOKIE_NAME, ' ', adodb_mktime() - 3600);
$objSession->Logout();
if($pass_env) $redirect_params = 'env='.BuildEnv().'&'.$redirect_params;
header('Location: '.$adminURL.'/index.php?'.$redirect_params);
exit;
}
/**
* Builds up K4 url from data supplied by in-portal
*
* @param string $t template
* @param Array $params
* @param string $index_file
* @return string
*/
function HREF_Wrapper($t = '', $params = null, $index_file = null)
{
$url_params = BuildEnv_NEW();
if( isset($params) ) $url_params = array_merge_recursive2($url_params, $params);
if(!$t)
{
$t = $url_params['t'];
unset($url_params['t']);
}
$app =& kApplication::Instance();
return $app->HREF($t, '', $url_params, $index_file);
}
/**
* Set url params based on tag params & mapping hash passed
*
* @param Array $url_params - url params before change
* @param Array $tag_attribs - tag attributes
* @param Array $params_map key - tag_param, value - url_param
*/
function MapTagParams(&$url_params, $tag_attribs, $params_map)
{
foreach ($params_map as $tag_param => $url_param)
{
if( getArrayValue($tag_attribs, $tag_param) ) $url_params[$url_param] = $tag_attribs[$tag_param];
}
}
function ExtractParams($params_str, $separator = '&')
{
if(!$params_str) return Array();
$ret = Array();
$parts = explode($separator, trim($params_str, $separator) );
foreach ($parts as $part)
{
list($var_name, $var_value) = explode('=', $part);
$ret[$var_name] = $var_value;
}
return $ret;
}
function &recallObject($var_name, $class_name)
{
if (!isset($GLOBALS[$var_name]) || !is_object($GLOBALS[$var_name]))
{
$GLOBALS[$var_name] = new $class_name();
}
return $GLOBALS[$var_name];
}
/**
* Returns true in case of AM/PM time
*
* @return bool
*/
function is12HourMode()
{
return preg_match('/(a|A)/', GetTimeFormat() );
}
/**
* Saves custom fields for old in-portal items
*
* @param string $prefix K4 prefix of item
* @param int $resource_id resource id of item
* @param int $item_type type of custom fields
*/
function saveCustomFields($prefix, $resource_id, $item_type)
{
- $objCustomEdit = new clsCustomDataList();
+ $objCustomEdit = new clsCustomDataList();
$CustomFields = new clsCustomFieldList($item_type);
- $data_changed = false;
- for ($i = 0; $i < $CustomFields->NumItems(); $i++) {
+ $data_changed = false;
+ for ($i = 0; $i < $CustomFields->NumItems(); $i++) {
$objField =& $CustomFields->GetItemRefByIndex($i);
$field_name = $objField->Get('FieldName');
$element_type = $objField->Get('ElementType');
-
+
$value = getCustomValue($field_name);
if ($element_type == 'checkbox' && $value === false) {
// unchecked checkboxes are not submitted
$value = 0;
}
-
+
if ($value !== false) {
$objCustomEdit->SetFieldValue($objField->Get('CustomFieldId'), $resource_id, $value);
$data_changed = true;
}
}
- if ($data_changed) {
- $objCustomEdit->SaveData($prefix, $resource_id);
- }
+ if ($data_changed) {
+ $objCustomEdit->SaveData($prefix, $resource_id);
+ }
}
/**
* Returns custom field value from submit
*
* @param string $field_name
* @return mixed
*/
function getCustomValue($field_name)
{
if (IsAdmin()) {
$field_name = '_'.$field_name;
}
elseif (isset($_POST[strtolower($field_name)])) {
$field_name = strtolower($field_name);
}
return GetVar($field_name);
}
-
+
function checkActionPermission($action_mapping, $action, $system = 0)
{
$application =& kApplication::Instance();
if (!isset($action_mapping[$action])) {
// if no permission mapping defined, then action is allowed in any case
return true;
}
$perm_status = false;
$action_mapping = explode('|', $action_mapping[$action]);
foreach ($action_mapping as $perm_name) {
$perm_status = $application->CheckPermission($perm_name, $system);
if ($perm_status) {
break;
}
}
if (!$perm_status) {
$application->Redirect($application->IsAdmin() ? 'no_permission' : $application->ConfigValue('NoPermissionTemplate'), null, '', 'index.php');
}
return true;
}
function checkViewPermission($section_name, $system = 1)
{
$application =& kApplication::Instance();
$application->InitParser();
$application->ProcessParsedTag('m', 'RequireLogin', Array('permissions' => $section_name.'.view', 'system' => $system, 'index_file' => 'index.php'));
}
?>
Property changes on: trunk/kernel/include/globals.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/kernel/include/customfield.php
===================================================================
--- trunk/kernel/include/customfield.php (revision 7634)
+++ trunk/kernel/include/customfield.php (revision 7635)
@@ -1,289 +1,289 @@
<?php
class clsCustomField extends clsItem
{
-
+
function clsCustomField($CustomFieldId=-1)
{
$this->clsItem();
- $this->tablename=GetTablePrefix()."CustomField";
+ $this->tablename=GetTablePrefix()."CustomField";
$this->type=10;
$this->BasePermission="";
$this->id_field = "CustomFieldId";
$this->NoResourceId=1; //set this to avoid using a resource ID
$this->debuglevel=0;
if($CustomFieldId>-1)
$this->LoadFromDatabase($CustomFieldId);
}
function GetAdminUI()
{
$a = new clsConfigAdminItem();
$a->name = "_".$this->Get("FieldName");
$a->heading = $this->Get("Heading");
$a->prompt = $this->Get("Prompt");
$a->ElementType = $this->Get("ElementType");
$a->ValidationRules="";
$a->default_value = "";
$a->ValueList=$this->Get("ValueList");
if(!strlen($a->ElementType))
$a->ElementType="text";
if(!strlen($a->prompt))
$a->prompt = "lu_fieldcustom__".strtolower($this->Get("FieldName"));
- return $a;
- }
-
+ return $a;
+ }
+
function parsetag($tag)
- {
+ {
if(is_object($tag))
- {
+ {
$tagname = $tag->name;
}
else
$tagname = $tag;
switch($tagname)
- {
+ {
case "fieldlabel":
return $this->Get("FieldLabel");
break;
-
+
case "fieldname":
return $this->Get("FieldName");
break;
-
+
case "customfieldid":
return $this->Get("CustomFieldId");
default:
return "Undefined:$tagname";
break;
}
}
}
class clsCustomFieldList extends clsItemCollection
{
var $Type;
function clsCustomFieldList($type = -1, $table = 'CustomField')
{
$this->clsItemCollection();
$this->Type = $type;
$this->classname = 'clsCustomField';
if ($table == 'CustomField') {
$table = GetTablePrefix().$table;
}
-
+
$this->SourceTable = $table;
if ($this->Type > 0) {
$this->LoadFields();
}
}
function LoadFields()
{
$this->Clear();
$sql = 'SELECT *
FROM '.$this->SourceTable.'
- WHERE Type = '.$this->Type.' AND IsSystem = 0
+ WHERE Type = '.$this->Type.' AND (IsSystem = 0 OR OnGeneralTab = 1)
ORDER BY DisplayOrder DESC, CustomFieldId ASC';
- if($this->debuglevel > 1)
+ if($this->debuglevel > 1)
echo $sql."<br>\n";
$rs = $this->adodbConnection->Execute($sql);
-
+
while($rs && !$rs->EOF)
{
$data = $rs->fields;
$this->AddItemFromArray($data);
$rs->MoveNext();
- }
+ }
}
function LoadFieldsAndValues($ResourceId, $main_prefix, $temp_table = false)
{
$this->Clear();
-
+
$table = $this->Application->getUnitOption($main_prefix.'-cdata', 'TableName');
if ($temp_table) {
$table = $this->Application->GetTempName($table, 'prefix:'.$main_prefix);
}
-
+
$sql = 'SELECT *
FROM '.$table.'
WHERE ResourceId = '.$ResourceId;
$custom_data = $this->adodbConnection->GetRow($sql);
-
+
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'CustomField
WHERE Type = '.$this->Application->getUnitOption($main_prefix, 'ItemType');
$custom_fields = $this->Conn->Query($sql, 'CustomFieldId');
-
+
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
foreach ($custom_fields as $custom_id => $custom_info) {
$custom_name = $ml_formatter->LangFieldName('cust_'.$custom_id);
$custom_info['Value'] = $custom_data[$custom_name];
$custom_info['CustomDataId'] = 0;
$this->AddItemFromArray($custom_info);
}
}
-
+
function GetFieldUIList($GeneralTab=FALSE)
{
$ret = new clsConfigAdmin();
if ($this->NumItems() > 0) {
foreach ($this->Items as $field) {
if ($GeneralTab == true && $field->Get('OnGeneralTab') == 1 || !$GeneralTab) {
$ui = $field->GetAdminUI();
array_push($ret->Items,$ui);
}
}
}
return $ret;
}
function GetFieldNames()
{
$res = array();
foreach($this->Items as $f)
$res[] = $f->Get("FieldName");
return $res;
}
function SaveFields()
{
foreach($this->Items as $i)
{
if($i->Get("CustomFieldId"))
{
$i->Update();
}
else
$i->Create();
}
}
function Query_CustomField($where=NULL,$orderby=NULL,$limit=NULL)
{
$this->Clear();
$sql = "SELECT * FROM ".$this->SourceTable;
if(isset($where))
$sql = sprintf('%s WHERE %s',$sql,$where);
if(isset($orderby) && strlen(trim($orderby))>0)
$sql = sprintf('%s ORDER BY %s',$sql,$orderby);
if(isset($limit) && strlen(trim($limit)))
$sql .= " ".$limit;
// $sql."<br>";
$this->Query_Item($sql);
return $this->Items;
}
function AddField($Type,$FieldName,$FieldLabel,$ShowGeneral=0,$Heading="", $Prompt="",
$ElementType="",$ValueList="")
{
global $objItemTypes,$objSearchConfig,$objLanguages;
-
+
//if(!is_numeric($Type))
- // {
+ // {
$f = new clsCustomField();
$f->tablename = $this->SourceTable;
$f->Set(array("Type","FieldName","FieldLabel","OnGeneralTab","Heading","Prompt",
"ElementType","ValueList"),
array($Type,$FieldName,$FieldLabel,$ShowGeneral,$Heading,$Prompt,
$ElementType,$ValueList));
$f->Create();
$Item = $objItemTypes->GetItem($Type);
if(is_object($Item))
{
//$Table = $Item->Get("SourceTable");
$Table = 'CustomField';
$Header = "la_text_".strtolower($Item->Get("ItemName"));
$Module = $Item->Get("Module");
// $Desc = $FieldLabel;
-
+
if(!is_object($objSearchConfig))
{
$objSearchConfig = new clsSearchConfigList();
}
-
+
$NextOrder = $objSearchConfig->GetNextDisplayOrder($Module);
$desc = "lu_fieldcustom__".strtolower($FieldName);
if(!strlen($FieldLabel))
{
$FieldLabel = $FieldName;
}
-
+
$l = $objLanguages->GetPrimary();
$phrases = new clsPhraseList();
- $phrases->AddPhrase($desc,$l,$FieldLabel,2, $Item->Get('Module') );
-
+ $phrases->AddPhrase($desc,$l,$FieldLabel,2, $Item->Get('Module') );
+
$dtable = GetTablePrefix()."CustomMetaData";
$Join = "($dtable.ResourceId={Table}.ResourceId)";
$objSearchConfig->AddSearchField($Table,$FieldName,$Module,$Type == 6 ? -1 : 0,0,
$FieldLabel,$desc,$Header,$NextOrder,0,
$ElementType, NULL, NULL, NULL, NULL, NULL,
$f->Get("CustomFieldId"), NULL);
- }
+ }
return $f;
//}
//else
// return FALSE;
}
-
+
function EditField($FieldId,$Type,$FieldName,$FieldLabel,$ShowGeneral=0,$Heading="", $Prompt="",$ElementType="",$ValueList="")
{
global $objSearchConfig;
-
+
$f = $this->GetItem($FieldId);
$f->Set(array("Type","FieldName","FieldLabel","OnGeneralTab","Heading","Prompt","ElementType","ValueList"),
array($Type,$FieldName,$FieldLabel,$ShowGeneral,$Heading,$Prompt,$ElementType,$ValueList));
$f->Update();
-
+
$db =& $this->adodbConnection;
-
- if (!$FieldLabel) $FieldLabel = $FieldName;
+
+ if (!$FieldLabel) $FieldLabel = $FieldName;
$sql = 'UPDATE '.GetTablePrefix().'SearchConfig
SET FieldType = '.$db->qstr($ElementType).',
DisplayName = '.$db->qstr('lu_fieldcustom__'.strtolower($FieldName)).',
FieldName = '.$db->qstr($FieldName).',
Description = '.$db->qstr($FieldLabel).'
WHERE CustomFieldId = '.$FieldId;
$this->adodbConnection->Execute($sql);
-
+
return $f;
}
function DeleteField($FieldId)
{
global $objItemTypes, $objSearchConfig;
//echo "<pre>"; print_r($objSearchConfig); echo "</pre>";
$f = $this->GetItem($FieldId);
$Type = $f->Get("Type");
$Item = $objItemTypes->GetItem($Type);
$Module = $Item->Get("Module");
if(is_object($Item))
{
//$table = $Item->Get("TableName");
$table = GetTablePrefix()."CustomField";
if(!is_object($objSearchConfig))
{
$objSearchConfig = new clsSearchConfigList($Module);
- }
-
+ }
+
$sql = 'DELETE FROM '.$objSearchConfig->SourceTable.' WHERE CustomFieldId = '.$FieldId;
$this->adodbConnection->Execute($sql);
-
+
$phrase_name = 'lu_fieldcustom__'.strtolower($f->Get('FieldName'));
$sql = 'DELETE FROM '.GetTablePrefix().'Phrase WHERE Phrase = '.$this->adodbConnection->qstr($phrase_name);
$this->adodbConnection->Execute($sql);
}
$f->Delete();
- }
+ }
}/*clsCustomFieldList*/
?>
Property changes on: trunk/kernel/include/customfield.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.15
\ No newline at end of property
+1.16
\ No newline at end of property
Index: trunk/kernel/admin_templates/categories/permissions_tab.tpl
===================================================================
--- trunk/kernel/admin_templates/categories/permissions_tab.tpl (revision 7634)
+++ trunk/kernel/admin_templates/categories/permissions_tab.tpl (revision 7635)
@@ -1,72 +1,74 @@
<inp2:m_if check="m_ParamEquals" name="tab_init" value="1">
<div id="<inp2:m_param name="item_prefix"/>_div" prefix="<inp2:m_param name="item_prefix"/>" group_id="-1" class="catalog-tab"></div>
<script type="text/javascript">$PermManager.registerTab('<inp2:m_param name="item_prefix"/>');</script>
<inp2:m_else/>
+ <inp2:lang.current_Field name="Charset" result_to_var="charset"/>
+ <inp2:m_Header data="Content-type: text/plain; charset=$charset"/>
if ($request_visible) {
document.getElementById('<inp2:m_get name="item_prefix"/>_div').setAttribute('group_id', <inp2:m_get name="group_id"/>);
}
<inp2:m_if check="c_SaveWarning">
document.getElementById('save_warning').style.display = 'block';
$edit_mode = true;
</inp2:m_if>
#separator#
<inp2:m_DefineElement name="permission_element">
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<td>
<inp2:m_phrase name="$Description"/> [<inp2:m_param name="PermissionName"/>]
</td>
-
+
<td>
<!-- Inherited checkbox -->
<input
type="hidden"
id="<inp2:PermInputName sub_key="inherited"/>"
name="<inp2:PermInputName sub_key="inherited"/>"
value="<inp2:m_if check="m_ParamEquals" name="Inherited" value="1">1<inp2:m_else/>0</inp2:m_if>" />
-
- <input
+
+ <input
type="checkbox"
- id="_cb_<inp2:PermInputName sub_key="inherited"/>"
+ id="_cb_<inp2:PermInputName sub_key="inherited"/>"
<inp2:m_if check="m_ParamEquals" name="Inherited" value="1">checked</inp2:m_if>
onchange="update_checkbox(this, document.getElementById('<inp2:PermInputName sub_key="inherited"/>'));"
onclick="inherited_click('<inp2:m_param name="PermissionName"/>', <inp2:m_param name="InheritedValue"/>, this.checked, '_cb_<inp2:PermInputName sub_key="value"/>')" />
</td>
-
+
<td>
<inp2:CategoryPath cat_id="$InheritedFrom"/>
</td>
-
+
<td>
<!-- Access checkbox -->
<input
type="hidden"
id="<inp2:PermInputName sub_key="value"/>"
name="<inp2:PermInputName sub_key="value"/>"
value="<inp2:m_if check="m_ParamEquals" name="Value" value="1">1<inp2:m_else/>0</inp2:m_if>" />
-
- <input
+
+ <input
type="checkbox"
- id="_cb_<inp2:PermInputName sub_key="value"/>"
+ id="_cb_<inp2:PermInputName sub_key="value"/>"
<inp2:m_if check="m_ParamEquals" name="Inherited" value="1">disabled="disabled"</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="Value" value="1">checked</inp2:m_if>
onchange="update_checkbox(this, document.getElementById('<inp2:PermInputName sub_key="value"/>'));"
onclick="update_light('<inp2:m_param name="PermissionName"/>', this.checked)" />
</td>
-
+
<td>
<img id="light_<inp2:m_param name="PermissionName"/>" src="img/perm_<inp2:m_if check="m_ParamEquals" name="Value" value="1">green<inp2:m_else/>red</inp2:m_if>.gif"/>
</td>
</tr>
</inp2:m_DefineElement>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder_full">
<inp2:m_set odd_even="table_color1"/>
<thead class="subsectiontitle">
<td><inp2:m_phrase name="la_col_Description"/></td>
<td><inp2:m_phrase name="la_col_Inherited"/></td>
<td><inp2:m_phrase name="la_col_InheritedFrom"/></td>
<td><inp2:m_phrase name="la_col_Access"/></td>
<td><inp2:m_phrase name="la_col_Effective"/></td>
</thead>
<inp2:c-perm_PrintPermissions render_as="permission_element"/>
</table>
</inp2:m_if>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/categories/permissions_tab.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.7
\ No newline at end of property
+1.8
\ No newline at end of property
Index: trunk/kernel/admin_templates/popups/translator.tpl
===================================================================
--- trunk/kernel/admin_templates/popups/translator.tpl (revision 7634)
+++ trunk/kernel/admin_templates/popups/translator.tpl (revision 7635)
@@ -1,90 +1,89 @@
<inp2:m_RequireLogin perm_event="trans:OnLoad"/>
<!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">-->
<html>
<head>
<title>In-Portal :: Administration Panel</title>
<meta http-equiv="content-type" content="text/html; charset=<inp2:trans_Field field="Charset"/>">
<meta name="keywords" content="...">
<meta name="description" content="...">
<meta name="robots" content="all">
<meta name="copyright" content="Copyright &#174; 2006 Test, Inc">
<meta name="author" content="Intechnic Inc.">
<inp2:m_base_ref/>
<link rel="icon" href="img/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" rev="stylesheet" href="incs/style.css" type="text/css" />
<script language="javascript" src="js/is.js"></script>
<script language="javascript" src="js/script.js"></script>
<script language="javascript" src="js/in-portal.js"></script>
<script language="javascript" src="js/toolbar.js"></script>
<script language="javascript" src="js/grid.js"></script>
-<script language="javascript" src="js/tabs.js"></script>
<script language="javascript">
var t = '<inp2:m_get param="t"/>';
var popups = '1';
var multiple_windows = '1';
var main_title = '<inp2:m_GetConfig var="Site_Name" escape="1"/>';
var tpl_changed = 0;
var base_url = '<inp2:m_BaseURL/>';
var $base_path = '<inp2:m_GetConst name="BASE_PATH"/>';
var img_path = '<inp2:m_TemplatesBase module="#MODULE#"/>/img/';
</script>
</head>
<inp2:m_include t="incs/blocks"/>
<inp2:m_include t="incs/in-portal"/>
<inp2:m_ParseBlock name="kernel_form"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
<inp2:m_ParseBlock name="blue_bar" prefix="trans" title_preset="trans_edit" module="in-commerce"/>
<!-- 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('trans','OnSaveAndClose');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
window.close();
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<input type="hidden" name="trans_prefix" value="<inp2:m_get var="trans_prefix"/>">
<input type="hidden" name="trans_field" value="<inp2:m_get var="trans_field"/>">
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<inp2:m_ParseBlock name="inp_edit_hidden" prefix="trans" field="Language"/>
<inp2:m_ParseBlock name="subsection" title="!la_section_Translation!"/>
<inp2:m_ParseBlock name="inp_label" prefix="trans" title="!la_fld_Original!" field="Original"/>
<inp2:m_ParseBlock name="inp_edit_options" prefix="trans" field="SwitchLanguage" title="!la_fld_Language!" size="50" onchange="submit_event('trans', 'OnChangeLanguage')"/>
<inp2:m_if check="m_get" var="trans_multi_line" value="1">
<inp2:m_ParseBlock name="inp_edit_textarea" prefix="trans" field="Translation" title="!la_fld_Translation!" cols="50" rows="10"/>
<inp2:m_else/>
<inp2:m_ParseBlock name="inp_edit_box" prefix="trans" field="Translation" title="!la_fld_Translation!" size="50"/>
</inp2:m_if>
</table>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/popups/translator.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.13
\ No newline at end of property
+1.14
\ No newline at end of property
Index: trunk/kernel/admin_templates/group_selector.tpl
===================================================================
--- trunk/kernel/admin_templates/group_selector.tpl (nonexistent)
+++ trunk/kernel/admin_templates/group_selector.tpl (revision 7635)
@@ -0,0 +1,46 @@
+<inp2:adm_SetPopupSize width="582" height="504"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+
+<inp2:m_ParseBlock name="blue_bar" prefix="g" title_preset="select_group" module="custom" 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"/>', edit) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ window.close();
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+
+ a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
+ show_viewmenu(a_toolbar,'view');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ function edit()
+ {
+ set_hidden_field('remove_specials[g.user]', 1);
+ submit_event('<inp2:m_recall name="main_prefix"/>', 'OnProcessSelected');
+ }
+ </script>
+
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_ParseBlock name="grid" PrefixSpecial="g.user" IdField="GroupId" grid="GroupSelector"/>
+<script type="text/javascript">
+ Grids['g.user'].SetDependantToolbarButtons( new Array('select') );
+</script>
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/group_selector.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/kernel/admin_templates/item_selector/item_selector_catalog.tpl
===================================================================
--- trunk/kernel/admin_templates/item_selector/item_selector_catalog.tpl (revision 7634)
+++ trunk/kernel/admin_templates/item_selector/item_selector_catalog.tpl (revision 7635)
@@ -1,112 +1,112 @@
<inp2:m_include t="incs/header" nobody="yes" noform="yes"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF" onload="$Catalog.Init();">
<inp2:m_ParseBlock name="section_header" prefix="c" icon="icon46_catalog" module="in-portal" title="!la_title_Browse!"/>
<inp2:m_include t="in-portal/item_selector/item_selector_tabs"/>
<inp2:m_ParseBlock name="blue_bar" prefix="c" title_preset="catalog" module="in-portal"/>
<!-- main kernel_form: begin -->
<inp2:m_RenderElement name="kernel_form"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<input type="hidden" name="m_cat_id" value="<inp2:m_get name="m_cat_id"/>"/>
<inp2:m_include t="in-portal/item_selector/item_selector_toolbar" is_catalog="1"/>
<script type="text/javascript">
var $Catalog = new Catalog('<inp2:m_Link template="#TEMPLATE_NAME#" m_cat_id="#CATEGORY_ID#" no_amp="1"/>', 'is_catalog_');
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="kernel_form_end"/>
<!-- main kernel_form: end -->
<!-- category list: begin -->
<table id="c_search_warning" width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_notop" style="display: none">
<tr>
<td valign="top" class="hint_red">
<inp2:m_phrase name="la_Warning_Filter"/>
</td>
</tr>
</table>
<inp2:m_set t="in-portal/xml/categories_list"/>
<inp2:m_RenderElement name="kernel_form" form_name="categories_form"/>
<table class="toolbar" cellspacing="0" cellpadding="2" width="100%" border="0" class="tableborder_full_a">
<tr bgcolor="#e0e0da" height="20">
<td width="100%" valign="middle">
<img height="15" src="img/arrow.gif" width="15" align="absmiddle" border="0"><span id="category_path"></span>
</td>
- <td align="right">
- <table cellspacing="0" cellpadding="0" border="0">
+ <td align="right" class="search-cell" >
+ <table cellspacing="0" cellpadding="0" border="0" style="width: 270px">
<tr>
<td>Search:&nbsp;</td>
<td>
<input type="text" id="c_search_keyword" name="c_search_keyword" value="" PrefixSpecial="c" Grid="Default" ajax="1" style="border: 1px solid grey;">
<input type="text" style="display: none"; />
</td>
<td id="search_buttons[c]">
<script type="text/javascript">
<inp2:m_RenderElement name="grid_search_buttons" PrefixSpecial="c" grid="Default" ajax="1"/>
</script>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div id="categories_div" prefix="c" view_template="in-portal/xml/categories_list" edit_template="in-portal/categories/categories_edit" dep_buttons="" class="catalog-tab" style="display: block;"></div>
<inp2:m_RenderElement name="kernel_form_end"/>
<inp2:m_set t="in-portal/catalog"/>
<script type="text/javascript">$Catalog.registerTab('categories');</script>
<!-- categories list: end -->
<!-- item tabs: begin -->
<table cellpadding="0" cellspacing="0">
<tr>
<inp2:m_DefineElement name="item_tab" title="">
<td nowrap="nowrap" width="140">
<table id="<inp2:m_param name="prefix"/>_tab" cellpadding="0" cellspacing="0" width="100%" class="catalog-tab-unselected" onclick="$Catalog.switchTab('<inp2:m_param name="prefix"/>');">
<tr>
<td class="catalog-tab-left">
<img src="img/spacer.gif" height="22" width="9" />
</td>
<td class="catalog-tab-middle" width="100%" valign="middle" nowrap="nowrap">
<inp2:m_phrase name="$title"/> <span class="cats_stats">(<span id="<inp2:m_param name="prefix"/>_item_count">?</span>)</span>
</td>
<td class="catalog-tab-right">
<img src="img/spacer.gif" height="22" width="9" />
</td>
<td style="background-color: #FFFFFF;">
<img src="img/spacer.gif" height="1" width="5" />
</td>
</tr>
</table>
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="tab_headers">
<inp2:adm_ListCatalogTabs render_as="item_tab" title_property="ViewMenuPhrase" skip_prefixes="$skip_prefixes"/>
</inp2:m_DefineElement>
<inp2:c_InitCatalog render_as="tab_headers" skip_prefixes="m"/>
</tr>
</table>
<!-- item tabs: end -->
<inp2:m_DefineElement name="tab_bodies">
<inp2:m_ModuleInclude template="catalog_tab" tab_init="2" skip_prefixes="$skip_prefixes"/>
</inp2:m_DefineElement>
<inp2:c_InitCatalog render_as="tab_bodies" skip_prefixes="m"/>
<inp2:m_include t="incs/footer" noform="yes"/>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/item_selector/item_selector_catalog.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/kernel/admin_templates/item_selector/item_selector_toolbar.tpl
===================================================================
--- trunk/kernel/admin_templates/item_selector/item_selector_toolbar.tpl (revision 7634)
+++ trunk/kernel/admin_templates/item_selector/item_selector_toolbar.tpl (revision 7635)
@@ -1,68 +1,68 @@
<script type="text/javascript" src="js/ajax.js"></script>
<link rel="stylesheet" rev="stylesheet" href="incs/nlsmenu.css" type="text/css" />
<script type="text/javascript" src="js/nlsmenu.js"></script>
<script type="text/javascript" src="js/nlsmenueffect_1_2_1.js"></script>
<script type="text/javascript" src="<inp2:m_TemplatesBase module="in-portal"/>/incs/catalog.js"></script>
<script type="text/javascript">
var menuMgr = new NlsMenuManager("mgr");
menuMgr.timeout = 500;
menuMgr.flowOverFormElement = true;
Request.progressText = '<inp2:m_phrase name="la_title_Loading" escape="1"/>';
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
<inp2:m_if check="m_ParamEquals" name="is_catalog" value="1">
active_selected = '';
if (Grids[$Catalog.ActivePrefix]) {
active_selected = Grids[$Catalog.ActivePrefix].GetSelected();
set_hidden_field('selected_ids[' + $Catalog.ActivePrefix + ']', active_selected);
}
if (active_selected.length == 0) {
var $category_ids = Grids['c'].GetSelected();
if ($category_ids.length == 0) {
// no categories selected, then use current category
$category_ids = get_hidden_field('m_cat_id');
}
set_hidden_field('selected_ids[c]', $category_ids);
}
<inp2:m_else/>
var $prefix = $Catalog.ActivePrefix.replace('.<inp2:m_get name="ts"/>', '');
set_hidden_field('selected_ids[' + $prefix + ']', Grids[$Catalog.ActivePrefix].GetSelected());
</inp2:m_if>
- submit_event('<inp2:m_get name="main_prefix"/>', 'OnProcessSelected');
+ submit_event('<inp2:m_Recall name="main_prefix"/>', 'OnProcessSelected');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
window.close();
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
<inp2:m_if check="m_ParamEquals" name="is_catalog" value="1">
a_toolbar.AddButton( new ToolBarButton('upcat', '<inp2:m_phrase label="la_ToolTip_Up" escape="1"/>', function() {
$Catalog.go_to_cat($Catalog.ParentCategoryID);
}
) );
a_toolbar.AddButton( new ToolBarButton('homecat', '<inp2:m_phrase label="la_ToolTip_Home" escape="1"/>', function() {
$Catalog.go_to_cat(0);
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
</inp2:m_if>
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar, 'view');
}
) );
a_toolbar.Render();
function edit()
{
}
</script>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/item_selector/item_selector_toolbar.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property
Index: trunk/kernel/frontaction.php
===================================================================
--- trunk/kernel/frontaction.php (revision 7634)
+++ trunk/kernel/frontaction.php (revision 7635)
@@ -1,1144 +1,1145 @@
<?php
switch($Action)
{
case "m_login":
// if($objSession->ValidSession()) $objSession->Logout();
//echo $objSession->GetSessionKey()."<br>\n";
$url_params = Array();
$application =& kApplication::Instance();
if ($objConfig->Get("CookieSessions") == 1 && $_COOKIE["cookies_on"] != "1") {
$FormError["login"]["login_user"] = language("lu_cookies_error");
}
else
{
$MissingCount = SetMissingDataErrors("login");
if($MissingCount==2)
{
$FormError["login"]["login_user"]= language("lu_ferror_loginboth");
unset($FormError["login"]["login_password"]);
}
if($MissingCount==0)
{
if($_POST["login_user"]=="root")
{
$FormError["login"]["login_user"]= language("lu_access_denied");
}
else
{
$LoginCheck = $objSession->Login( $_POST["login_user"], md5($_POST["login_password"]) );
if($LoginCheck === true)
{
if( !headers_sent() && GetVar('usercookie') == 1 )
{
$c = $_POST["login_user"]."|";
$pw = $_POST["login_password"];
if(strlen($pw) < 31) $pw = md5($pw);
$c .= $pw;
set_cookie('login', $c, adodb_mktime() + 2592000);
}
// set new destination template if passed
$dest = GetVar('dest', true);
if(!$dest) $dest = GetVar('DestTemplate', true);
if($dest) $var_list['t'] = $dest;
$next_template = $objSession->GetVariable('next_template');
if($next_template)
{
$objSession->SetVariable('next_template','');
$var_list_update['t'] = $next_template;
$url_params['pass'] = 'all';
header('Location: ' . HREF_Wrapper('', $url_params) );
exit;
$var_list['t'] = $next_template.'.tpl';
}
elseif($var_list['t'] == 'login')
{
$var_list['t'] = 'index';
}
$event_params = Array('user' => $_POST['login_user'], 'pass' => $_POST['login_password']);
$application->HandleEvent( new kEvent('u:OnInpLogin', $event_params) );
$redirect_template = getArrayValue($var_list_update, 't') ? $var_list_update['t'] : $var_list['t'];
$application->Redirect($redirect_template);
}
else
{
switch($LoginCheck)
{
case -1: // user or/and pass wrong
$FormError["login"]["login_password"] = language("lu_incorrect_login");
break;
case -2: // user ok, but has no permission
$FormError["login"]["login_password"] = language("la_text_nopermissions");
break;
}
}
}
}
}
break;
case "m_resetpw":
$passed_key = $_GET['user_key'];
$u = $objUsers->GetItemByField("PwResetConfirm", $passed_key);
$found = is_object($u);
if($found)
{
$exp_time = $u->Get('PwRequestTime') + 3600;
$u->Set("PwResetConfirm", '');
$u->Set("PwRequestTime", 0);
if ($exp_time > adodb_mktime())
{
$objSession->SetVariable('codevalidationresult', 'lu_resetpw_confirm_text');
$newpw = makepassword();
SetVar('user_password', $newpw);
$u->Set("Password",$newpw);
$u->Set("PassResetTime", adodb_mktime());
$u->Set("PwResetConfirm", '');
$u->Set("PwRequestTime", 0);
$u->Update();
$u->SendUserEventMail("USER.PSWD",$u->Get("PortalUserId"));
$u->SendAdminEventMail("USER.PSWD");
$u->Set("Password",md5($newpw));
$u->Update();
$u->Clean();
} else {
$objSession->SetVariable('codevalidationresult', 'lu_code_expired');
}
} else {
$objSession->SetVariable('codevalidationresult', 'lu_code_is_not_valid');
}
break;
case "m_forgotpw":
$MissingCount = SetMissingDataErrors("forgotpw");
// $pass_reset_add = $objConfig->Get("Users_AllowReset");
if($MissingCount==0)
{
$username = $_POST["username"];
$email = $_POST["email"];
$found = false;
$allow_reset = true;
if(strlen($username))
{
$u = $objUsers->GetItemByField("Login",$username);
if(is_object($u))
$found = ($u->Get("Login")==$username && $u->Get("Status")==1) && strlen($u->Get("Password"));
}
else if(strlen($email))
{
$u = $objUsers->GetItemByField("Email",$email);
if(is_object($u))
$found = ($u->Get("Email")==$email && $u->Get("Status")==1) && strlen($u->Get("Password"));
}
if(is_object($u))
{
$PwResetConfirm = $u->Get('PwResetConfirm');
$PwRequestTime = $u->Get('PwRequestTime');
$PassResetTime = $u->Get('PassResetTime');
$MinPwResetDelay = $u->Get('MinPwResetDelay');
$allow_reset = (strlen($PwResetConfirm) ?
adodb_mktime() > $PwRequestTime + $MinPwResetDelay :
adodb_mktime() > $PassResetTime + $MinPwResetDelay);
}
if($found && $allow_reset)
{
//$newpw = makepassword();
//$objSession->Set('password', $newpw);
$objSession->Set('tmp_user_id', $u->Get("PortalUserId"));
$objSession->Set('tmp_email', $u->Get("Email"));
//$u->Set("Password",$newpw);
//$u->Update();
$u->SendUserEventMail("USER.PSWDC",$u->Get("PortalUserId"));
//$u->SendAdminEventMail("USER.PSWDC");
//$u->Set("Password",md5($newpw));
//$u->Update();
$u->Clean();
$var_list['t'] = GetVar('Confirm');
}
else
{
if(!strlen($username) && !strlen($email))
{
$FormError["forgotpw"]["username"] = language("lu_ferror_forgotpw_nodata");
$MissingCount++;
}
else
{
$error_phrases=Array();
if($allow_reset)
{
$error_phrases['username']='lu_ferror_unknown_username';
$error_phrases['email']='lu_ferror_unknown_email';
}
else
{
$error_phrases['username']='lu_ferror_reset_denied';
$error_phrases['email']='lu_ferror_reset_denied';
}
foreach ($error_phrases as $field_name => $phrase_name) {
if(GetVar($field_name))
{
$FormError["forgotpw"][$field_name] = language($phrase_name);
break;
}
}
$MissingCount++;
}
if(strlen($_GET["error"]))
$var_list["t"] = $_GET["error"];
}
}
else
if(strlen($_GET["error"]))
$var_list["t"] = $_GET["error"];
break;
case "m_subscribe_confirm":
$t = "";
$_GET["subscribe_email"] = $_POST["subscribe_email"];
$SubscribeAddress = $_POST["subscribe_email"];
if(!ValidEmail($SubscribeAddress)&& strlen($SubscribeAddress))
{
$t = $_GET["Error"];
$objSession->SetVariable('SubscribeError', 'lu_invalid_emailaddress');
}
else
{
if((int)$objConfig->Get("User_SubscriberGroup")>0)
{
$g = $objGroups->GetItem($objConfig->Get("User_SubscriberGroup"));
if(is_object($g))
{
$email = $_POST["subscribe_email"];
if(strlen($email)>0)
{
$u = $objUsers->GetItemByField("Email",$email);
if(is_object($u))
{
if($u->CheckBanned())
{
$t = $_GET["Error"];
$objSession->SetVariable('SubscribeError', 'lu_subscribe_banned');
}
else
{
if($u->IsInGroup($g->Get("GroupId")))
{
$t = $_GET["Unsubscribe"];
}
else
$t = $_GET["Subscribe"];
}
}
else
$t = $_GET["Subscribe"];
}
else
{
$t = $_GET["Error"];
$objSession->SetVariable('SubscribeError', 'lu_subscribe_no_address');
}
}
else
{
$t = $_GET["Error"];
$objSession->SetVariable('SubscribeError', 'lu_subscribe_unknown_error');
}
}
}
if(strlen($t))
{
$var_list["t"] = $t;
$var_list_update["t"] = $t;
}
$objSession->SetVariable('SubscribeAddress', $SubscribeAddress);
break;
case "m_subscribe":
if($_POST["buttons"][0]==language("lu_button_yes"))
{
$SubscribeAddress = $_POST["subscribe_email"];
if(strlen($SubscribeAddress)>0)
{
if(ValidEmail($SubscribeAddress))
{
$GroupId = (int)$objConfig->Get("User_SubscriberGroup");
if ($GroupId)
{
$g = $objGroups->GetItem($GroupId);
$u = $objUsers->GetItemByField("Email",$SubscribeAddress);
if(is_object($u))
{
if(strtolower($u->Get("Email"))==strtolower($SubscribeAddress))
{
$bExists = TRUE;
}
else
$bExists = FALSE;
}
if($bExists)
{
$g->AddUser($u->Get("PortalUserId"),0,false);
}
else
{
$u = new clsPortalUser(NULL);
$u->Set("Email",$SubscribeAddress);
$u->Set("ip",$_SERVER['REMOTE_ADDR']);
$u->Set("CreatedOn",adodb_date("U"));
$u->Set("Status",1);
if(!$u->CheckBanned())
{
$u->Create();
$g->AddUser($u->Get("PortalUserId"),1,false);
}
else
$SubscribeResult = "lu_subscribe_banned";
}
$SubscribeResult = "lu_subscribe_success";
$u->SendUserEventMail("USER.SUBSCRIBE",$u->Get("PortalUserId"));
$u->SendAdminEventMail("USER.SUBSCRIBE");
if(strlen($_GET["Subscribe"])>0)
$var_list["t"] = $_GET["Subscribe"];
}
}
else
{
$SubscribeResult = "lu_invalid_emailaddress";
}
}
else
$SubscribeResult = "lu_subscribe_missing_address";
}
if(!strlen($SubscribeResult))
$SubscribeResult = "lu_subscribe_success";
break;
case "m_unsubscribe":
if($_POST["buttons"][0]==language("lu_button_yes"))
{
$MissingCount = SetMissingDataErrors("m_unsubscribe");
if($MissingCount==0)
{
$email = $_POST["subscribe_email"];
$u = $objUsers->GetItemByField("Email",$email);
if(is_object($u))
{
if(strtolower($u->Get("Email"))==strtolower($email))
{
$GroupId = (int)$objConfig->Get("User_SubscriberGroup");
if($u->PrimaryGroup()==$GroupId)
{
$u_gorup_list = $u->GetGroupList();
if (count($u_gorup_list) > 1) {
$u->RemoveFromGroup($GroupId);
}
else {
$u->RemoveFromAllGroups();
$u->Delete();
}
}
else
{
$u->RemoveFromGroup($GroupId);
}
}
}
if(strlen($_GET["Subscribe"])>0)
$var_list["t"] = $_GET["Subscribe"];
}
}
break;
case "m_register":
$_POST=inp_escape($_POST);
$MissingCount = SetMissingDataErrors("m_register");
if(!$objConfig->Get("User_Password_Auto"))
{
if(($_POST["password"] != $_POST["passwordverify"]) || !strlen($_POST["passwordverify"]))
{
$MissingCount++;
$FormError["m_register"]["passwordverify"] = language("lu_ferror_pswd_mismatch");
}
if(strlen($_POST["password"])>30)
{
// echo "VAR: ".$_POST["password"]; die();
$MissingCount++;
$FormError["m_register"]["password"] = language("lu_ferror_pswd_toolong");
}
if (strlen($_POST['password']) < $objConfig->Get("Min_Password"))
{
$MissingCount++;
$FormError["m_register"]["password"] = language("lu_ferror_pswd_tooshort");
}
}
if(($_POST["username"]=="root"))
{
$MissingCount++;
$FormError["m_register"]["username"] = language("lu_user_exists");
}
else
{
$u = $objUsers->GetItemByField("Login",$_POST["username"]);
if(is_object($u))
{
if($u->Get("Login")==$_POST["username"])
{
$MissingCount++;
$FormError["m_register"]["username"] = language("lu_user_exists");
}
}
}
if (strlen($_POST['username']) < $objConfig->Get("Min_UserName"))
{
$MissingCount++;
$FormError["m_register"]["username"] = language("lu_ferror_username_tooshort");
}
if(!$MissingCount)
{
$CreatedOn = adodb_date("U");
$GroupId = $objConfig->Get("User_NewGroup");
$Status=0;
/* determine the status of new users */
switch ($objConfig->Get("User_Allow_New"))
{
case "1":
$Status=1;
break;
case "3":
$Status=2;
break;
}
/* set Destination template */
$var_list["t"] = strlen($_GET["dest"])? $_GET["dest"] : "index";
if($Status>0)
{
if ($objConfig->Get("User_Password_Auto")) {
$password = makepassword();
// $objSession->Set("password", $password);
SetVar('user_password', $password);
}
else {
$password = $_POST["password"];
}
$dob = adodb_mktime(0, 0, 0, $_POST['dob_month'], $_POST['dob_day'], $_POST['dob_year']);
$ip = $_SERVER['REMOTE_ADDR'];
$fields_hash = Array('Login' => $_POST['username'],
'Password' => md5($password),
'FirstName' => $_POST['firstname'],
'LastName' => $_POST['lastname'],
'Company' => $_POST['company'],
'Email' => $_POST['email'],
'Status' => $Status,
'Phone' => $_POST['phone'],
'Fax' => $_POST['fax'],
'Street' => $_POST['street'],
'Street2' => $_POST['street2'],
'City' => $_POST['city'],
'State' => $_POST['state'],
'Zip' => $_POST['zip'],
'Country' => $_POST['country'],
'CreatedOn' => $CreatedOn,
'dob' => $dob,
'ip' => $ip);
$u =& $objUsers->Add_User_NEW($fields_hash, true);
if(!is_object($u))
{
$RuleId=$u;
$r = $objBanList->GetItem($RuleId);
$err = $r->Get("ErrorTag");
if(strlen($err))
{
$FormError["m_register"][$r->Get("ItemField")] = language($err);
$MissingCount++;
}
}
else
{
$u->Set("Password",$password);
$u->Clean();
if($GroupId>0)
{
$g = $objGroups->GetItem($GroupId);
$g->AddUser($u->Get("PortalUserId"),1,false);
}
$custom = $_POST["custom"];
if (is_array($custom)) {
for($x = 0; $x < count($custom); $x++) {
$u->SetCustomField($custom[$x],$_POST[$custom[$x]]);
}
$u->SaveCustomFields();
}
if($Status==1)
{
if($objConfig->Get("User_Password_Auto"))
{
$u->SendUserEventMail("USER.VALIDATE",$u->Get("PortalUserId"));
$u->SendAdminEventMail("USER.VALIDATE");
}
else
{
$doLoginNow = true;
$u->SendUserEventMail("USER.ADD",$u->Get("PortalUserId"));
$u->SendAdminEventMail("USER.ADD");
}
}
else
{
$u->SendUserEventMail("USER.ADD.PENDING",$u->Get("PortalUserId"));
$u->SendAdminEventMail("USER.ADD.PENDING");
}
if ($doLoginNow)
{
$login_ok = $objSession->Login($_POST["username"], md5($password));
if($login_ok)
{
$next_template = $objSession->GetVariable('next_template');
if($next_template)
{
$objSession->SetVariable('next_template','');
$var_list_update["t"] = $next_template;
header('Location: ' . HREF_Wrapper() );
exit;
$var_list['t'] = $next_template.'.tpl';
}
}
}
}
}
}
break;
case "m_add_friend":
$id = $_GET["UserId"];
$userid = $objSession->Get("PortalUserId");
if($id!=$userid)
{
$u =& $objUsers->GetItem($id);
$u->AddFavorite($userid);
}
DeleteModuleTagCache('kernel');
break;
case "m_del_friend":
$id = $_GET["UserId"];
$userid = $objSession->Get("PortalUserId");
$u =& $objUsers->GetItem($id);
$u->DeleteFavorite();
DeleteModuleTagCache('kernel');
break;
case 'm_acctinfo':
$_POST = inp_escape($_POST);
$MissingCount = SetMissingDataErrors("m_acctinfo");
$UserId = $_GET["UserId"];
if ($UserId != $objSession->Get("PortalUserId")) {
$MissingCount++;
$FormError["m_acctinfo"]["UserId"] = language("lu_ferror_m_profile_userid");
}
if ($_POST["password"]) {
if (($_POST["password"] != $_POST["passwordverify"]) || !strlen($_POST["passwordverify"])) {
$MissingCount++;
$FormError["m_acctinfo"]["passwordverify"] = language("lu_ferror_pswd_mismatch");
}
if (strlen($_POST["password"])>30) {
// echo "VAR: ".$_POST["password"]; die();
$MissingCount++;
$FormError["m_acctinfo"]["password"] = language("lu_ferror_pswd_toolong");
}
if (strlen($_POST['password']) < $objConfig->Get("Min_Password")) {
$MissingCount++;
$FormError["m_acctinfo"]["password"] = language("lu_ferror_pswd_tooshort");
}
}
$db =& GetADODBConnection();
$email = GetVar('email');
$test_id = $db->GetOne('SELECT PortalUserId FROM '.GetTablePrefix().'PortalUser WHERE Email = '.$db->qstr($email));
if ($test_id && ($test_id != $objSession->Get('PortalUserId')) ) {
$MissingCount++;
$FormError["m_acctinfo"]["email"] = language("lu_ferror_email_duplicate");
}
if (!$MissingCount) {
/* save profile */
$u =& $objUsers->GetItem($UserId);
$status = $u->Get("Status");
$dob = adodb_mktime(0, 0, 0, $_POST['dob_month'], $_POST['dob_day'], $_POST['dob_year']);
$password = strlen($_POST["password"]) > 0 ? md5($_POST["password"]) : '';
$fields_hash = Array( 'Login' => $_POST['username'],
'Password' => $password,
'FirstName' => $_POST['firstname'],
'LastName' => $_POST['lastname'],
'Company' => $_POST['company'],
'Email' => $_POST['email'],
'Status' => $status,
'Phone' => $_POST['phone'],
'Fax' => $_POST['fax'],
'Street' => $_POST['street'],
'Street2' => $_POST['street2'],
'City' => $_POST['city'],
'State' => $_POST['state'],
'Zip' => $_POST['zip'],
'Country' => $_POST['country'],
'dob' => $dob,
'MinPwResetDelay' => $_POST['minpwresetdelay'],
);
$user =& $objUsers->Edit_User_NEW($UserId, $fields_hash);
saveCustomFields('u', $u->Get('ResourceId'), 6);
}
DeleteModuleTagCache('kernel');
break;
case "m_profile":
$userid = $objSession->Get("PortalUserId");
if($userid>0)
{
$u = $objUsers->GetItem($userid);
foreach($_POST as $field=>$value)
{
if(substr($field,0,3)=="pp_")
{
$objSession->SetPersistantVariable($field,$value);
}
}
}
break;
case "m_set_lang":
$lang = $_GET["lang"];
$LangId = 0;
if(strlen($lang))
{
$l = $objLanguages->GetItemByField("PackName",$lang);
if(is_object($l))
{
$LangId = $l->Get("LanguageId");
}
}
if($LangId)
{
if($objSession->Get("PortalUserId")>0)
{
$objSession->SetPersistantVariable("Language",$LangId);
}
$objSession->Set("Language",$LangId);
$objSession->Update();
$m_var_list_update["lang"] = $LangId;
$m_var_list["lang"] = $LangId;
}
break;
case "m_set_theme":
$id = $_POST["ThemeId"];
if(!is_numeric($id))
$id = $_GET["ThemeId"];
if($id)
{
$objSession->SetThemeName($id);
$m_var_list["t"] = "index";
$m_var_list_update["theme"] = $id;
$m_var_list["theme"] = $id;
unset($CurrentTheme);
}
break;
case "m_sort_cats":
+ $_POST['Category_Sortfield'] = preg_replace('/^(Name$|^Description)$/', 'l'.$m_var_list['lang'].'_$1', $_POST['Category_Sortfield']);
$objSession->SetVariable("Category_Sortfield",$_POST["Category_Sortfield"]);
$objSession->SetVariable("Category_Sortorder",$_POST["Category_Sortorder"]);
$objSession->SetVariable("Perpage_Category",$_POST["Perpage_Category"]);
DeleteModuleTagCache('kernel');
break;
case "m_add_cat_confirm":
$perm = 0;
$CategoryId=$objCatList->CurrentCategoryID();
if ($objSession->HasCatPermission("CATEGORY.ADD.PENDING"))
$perm = 2;
if ($objSession->HasCatPermission("CATEGORY.ADD"))
$perm = 1;
if ($perm == 0)
{
$MissingCount++;
$FormError["m_addcat"]["name"] = language("lu_ferror_no_access");
}
else
{
$MissingCount = SetMissingDataErrors("m_addcat");
if(is_array($_FILES))
{
foreach($_FILES as $field => $file)
{
$allowed = TRUE;
if(strlen($_POST["imagetypes"][$field]))
{
$types = explode(",",strtolower($_POST["imagetypes"][$field]));
if(is_array($types))
{
if(count($types)>0)
{
$path_parts = pathinfo($file["name"]);
$ext = $path_parts["extension"];
$allowed = in_array($ext,$types);
if(!$allowed)
{
$MissingCount++;
$FormError["m_addcat"][$field] = language("lu_ferror_wrongtype");
}
}
}
}
$maxsize = (int)$_POST["maxsize"][$field];
if($maxsize>0 && $allowed && $file["size"]>$maxsize)
{
$allowed = FALSE;
$MissingCount++;
$FormError["m_addcat"][$field] = language("lu_ferror_toolarge");
}
}
}
if($MissingCount==0)
{
$_POST = inp_striptags($_POST);
$fields_hash = Array( 'ParentId' => $objCatList->CurrentCategoryID(),
$objCatList->TitleField => $_POST['name'],
$objCatList->DescriptionField => $_POST['description'],
'CreatedOn' => adodb_date('U'),
'EditorsPick' => 0,
'Status' => $perm,
'HotItem' => 2,
'NewItem' => 2,
'PopItem' => 2,
'Priority' => 0,
'MetaKeywords' => $_POST['meta_keywords'],
'MetaDescription' => $_POST['meta_description'],
'AutomaticFilename' => 1,
'Filename' => '',
'CategoryTemplate' => '',
);
$cat =& $objCatList->Add_NEW($fields_hash);
saveCustomFields('c', $cat->Get('ResourceId'), $cat->type);
$cat->UpdateCachedPath();
$cat->Update();
$cat->UpdateACL();
$objCatList->UpdateMissingCacheData();
if(strlen($_GET["Confirm"]))
{
$var_list["t"] = $_GET["Confirm"];
}
else
$var_list["t"] = $_GET["DestTemplate"];
}
}
DeleteModuleTagCache('kernel');
break;
case "m_front_review_add":
if($objSession->InSpamControl($_POST["ItemId"]))
{
$StatusMessage["review"] = language("la_Review_AlreadyReviewed");
}
else
{
$objReviews = new clsItemReviewList();
$Status = $objConfig->Get("Review_DefaultStatus");
$CreatedOn = adodb_date("U");
$html = (int)$objConfig->Get("Review_Html");
$ReviewText = inp_striptags($_POST["review_text"]);
$r = $objReviews->AddReview($CreatedOn,$ReviewText,$Status, $IPAddress,
0, $_POST["ItemId"], $_POST["ItemType"], $objSession->Get("PortalUserId"));
foreach($ItemTypes as $type=>$id)
{
if($id==$_POST["ItemType"])
{
$ValName = $type."_ReviewDelay_Value";
$IntName = $type."_ReviewDelay_Interval";
break;
}
}
if(strlen($ValName) && strlen($IntName))
{
$exp_secs = $objConfig->Get($ValName) * $objConfig->Get($IntName);
$objSession->AddToSpamControl($_POST["ItemId"],$exp_secs);
if(is_object($r))
{
if($Status)
{
$StatusMessage["review"] = language("la_Review_Added");
}
else
$StatusMessage["review"] = language("la_Review_Pending");
}
else
$StatusMessage["review"] = language("la_Review_Error");
}
else
$StatusMessage["error"] = language("la_ConfigError_Review");
}
DeleteModuleTagCache('kernel');
break;
case "m_suggest_email":
$cutoff = adodb_mktime()+(int)$objConfig->Get("Suggest_MinInterval");
$email = inp_striptags($_POST["suggest_email"]);
if (strlen($email))
{
if(ValidEmail($email))
{
$sql = "SELECT * FROM ".GetTablePrefix()."SuggestMail WHERE email='".$email."' and sent<".$cutoff;
$adodbConnection = &GetADODBConnection();
$rs = $adodbConnection->Execute($sql);
$rs = false;
if($rs && !$rs->EOF)
{
if(strlen($_GET["Error"])>0)
$var_list["t"] = $_GET["Error"];
$objSession->SetVariable('suggest_result', "$email ".language("lu_already_suggested ")." ".LangDate($rs->fields["sent"]) );
}
else
{
$application =& kApplication::Instance();
$got_string = $application->GetVar('captcha_string');
if ($objConfig->Get("Suggest_Captcha") && !$application->GetVar('check_captcha')) {
$captcha_helper = $application->recallObject('CaptchaHelper');
$captcha_code = $captcha_helper->GenerateCaptchaCode();
$objSession->SetVariable('suggest_captcha_code', $captcha_code);
$application->StoreVar('suggest_email', $email);
if ($var_list["DestTemplate"] != $_GET["Captcha"]) {
$var_list["DestTemplate"] = $var_list["t"];
}
$var_list["t"] = $_GET["Captcha"];
}
else {
// if no captcha or captcha Ok
if (!$objConfig->Get("Suggest_Captcha") || $got_string == $application->RecallVar('suggest_captcha_code')) {
$Event =& $objMessageList->GetEmailEventObject("USER.SUGGEST");
if(is_object($Event))
{
if($Event->Get("Enabled")=="1")
{
$Event->Item = null;
$Event->SendToAddress($email);
$sql = "INSERT INTO ".GetTablePrefix()."SuggestMail (email,sent) VALUES ('".$email."','".adodb_mktime()."')";
$rs = $adodbConnection->Execute($sql);
$objSession->SetVariable('suggest_result', language("lu_suggest_success")." ".$email);
}
}
$e =& $objMessageList->GetEmailEventObject("USER.SUGGEST",1);
if($e->Get("Enabled")==1)
$e->SendAdmin();
if(strlen($_GET["Confirm"])>0)
$var_list["t"] = $_GET["Confirm"];
$application->RemoveVar('suggest_captcha_code');
$application->RemoveVar('suggest_email');
}
elseif ($got_string != $application->RecallVar('suggest_captcha_code')) {
// generate new captcha code in case of error
$captcha_helper = $application->recallObject('CaptchaHelper');
$captcha_code = $captcha_helper->GenerateCaptchaCode();
$objSession->SetVariable('suggest_captcha_code', $captcha_code);
$objSession->SetVariable('suggest_result', language("lu_invalid_captcha"));
}
}
}
}
else
{
if(strlen($_GET["Error"])>0)
$var_list["t"] = $_GET["Error"];
$objSession->SetVariable('suggest_result', language("lu_invalid_emailaddress"));
}
}
else
{
if(strlen($_GET["Error"])>0)
$var_list["t"] = $_GET["Error"];
$objSession->SetVariable('suggest_result', language("lu_suggest_no_address"));
}
break;
case "m_simple_search":
$keywords = trim($_POST["keywords"]);
$type = $objItemTypes->GetTypeByName("Category");
$objSearch = new clsSearchResults("Category","clsCategory");
$length = $objConfig->Get('Search_MinKeyword_Length');
if(strlen($keywords))
{
$performSearch = false;
$isExact = (substr($keywords, 0, 2) == '\"' && substr($keywords, strlen($keywords) - 2, 2) == '\"');
if ($isExact) {
$performSearch = (strlen(trim(str_replace('\"', '', $keywords))) >= $length);
}
else {
$key_arr = explode(' ', $keywords);
/*foreach($key_arr as $value) {
if (strlen(str_replace("+", "", $value)) < $length || strlen(str_replace("-", "", $value)) < $length) {
$keywords = str_replace($value, '', $keywords);
//$keywords = str_replace($value, '', $keywords);
}
}
//$keywords = str_replace(' ', ' ', $keywords);
//$keywords = str_replace('\"', '', $keywords);
*/
$tmp_keywords = str_replace("+", "", $keywords);
$tmp_keywords = str_replace("-", "", $tmp_keywords);
$performSearch = (strlen($tmp_keywords) >= $length);
}
if ($performSearch) {
$objSearchList = new clsSearchLogList();
$objSearchList->UpdateKeyword($keywords,0);
$objSearch->SetKeywords($keywords);
$objSearch->AddSimpleFields('c');
if (is_numeric($objConfig->Get("SearchRel_Pop_category"))) {
$objSearch->PctPop = ($objConfig->Get("SearchRel_Pop_category")/100);
}
if (is_numeric($objConfig->Get("SearchRel_Keyword_category"))) {
$objSearch->PctRelevance = ($objConfig->Get("SearchRel_Keyword_category")/100);
}
if (is_numeric($objConfig->Get("SearchRel_Rating_category"))) {
$objSearch->PctRating = ($objConfig->Get("SearchRel_Rating_category")/100);
}
//echo "Searching On $keywords<br>\n";
$objSearch->PerformSearch(1,$SortOrder,TRUE);
$SearchPerformed = TRUE;
//$objSearch->SetRelevence($type->Get("ItemType"), "CategoryId");
//echo "Finished Setting Category Relevence<br>\n";
}
else {
if(strlen($_GET["Error"])>0)
$var_list["t"] = $_GET["Error"];
$MissingCount = SetMissingDataErrors("m_simplesearch");
$MissingCount++;
setSearchError(lu_keywords_tooshort);
}
}
else
{
if (strlen($_GET["Error"])>0) {
$var_list["t"] = $_GET["Error"];
}
$MissingCount = SetMissingDataErrors("m_simplesearch");
$MissingCount++;
setSearchError('lu_no_keyword');
}
break;
case "m_adv_search":
if ($_GET['type']) {
$modules = Array( 1 => 'In-Portal', 2 => 'In-News',
3 => 'In-Bulletin', 4 => 'In-Link',
11 => 'In-Commerce');
$module = $modules[$_GET["type"]];
}
else {
$module = 0;
}
if( !is_object($objSearchConfig) ) $objSearchConfig = new clsSearchConfigList($module);
switch($_GET["type"])
{
case 1: /* category */
//echo "Searching for categories<br>";
$objAdvSearch = new clsAdvancedSearchResults("Category","clsCategory", $_GET["type"]);
foreach($objSearchConfig->Items as $field)
{
$fld = $field->Get("FieldName");
$Verb = $_POST["verb"][$field->Get("FieldName")];
if(!strlen($Verb) && $field->Get("FieldType")=="boolean")
{
if($_POST["value"][$field->Get("FieldName")]!=-1)
{
$Value = $_POST["value"][$field->Get("FieldName")];
$Verb = "is";
}
}
else
{
$Value = $_POST["value"][$field->Get("FieldName")];
}
switch( $_POST["andor"][$field->Get("FieldName")])
{
case 1:
$Conjuction = "AND";
break;
case 2:
$Conjuction = "OR";
break;
default:
$Conjuction = "";
break;
}
if (strlen($Value) && $Verb=="any")
{
$Verb = 'contains';
}
if(strlen($Value) && strlen($Verb)>0 && $Verb!="any")
{
// echo "Adding CAT SearchField: [".$field->Get("TableName")."]; [".$field->Get("FieldName")."]; [$Verb]; [$Value]; [$Conjuction]<br>";
$objAdvSearch->AddAdvancedField($field->Get("TableName"),$field->Get("FieldName"),$Verb,$Value,$Conjuction, 'c');
}
}
$objAdvSearch->PerformSearch(1,NULL,TRUE);
break;
}
break;
case "m_id":
$application->ApplicationDie($Action.':'.$DownloadId);
break;
case "m_simple_subsearch":
$keywords = $_POST["keywords"];
$type = $objItemTypes->GetTypeByName("Category");
$objSearch = new clsSearchResults("Category","clsCategory");
$length = $objConfig->Get('Search_MinKeyword_Length');
if(strlen($keywords))
{
$performSearch = false;
$isExact = (substr($keywords, 0, 1) == '"' && substr($keywords, strlen($keywords) - 1, 1) == '"');
if ($isExact) {
$performSearch = (strlen(trim(str_replace('\"', '', $keywords))) >= $length);
}
else {
$key_arr = explode(' ', $keywords);
/*foreach($key_arr as $value) {
if (strlen($value) < $length) {
$keywords = str_replace(' '.$value, '', $keywords);
$keywords = str_replace($value.' ', '', $keywords);
}
}*/
//$keywords = str_replace(' ', ' ', $keywords);
$tmp_keywords = str_replace("+", "", $keywords);
$tmp_keywords = str_replace("-", "", $tmp_keywords);
$performSearch = (strlen($tmp_keywords) >= $length);
}
if ($performSearch) {
$objSearchList = new clsSearchLogList();
$objSearchList->UpdateKeyword($keywords,0);
$objSearch->SetKeywords($keywords);
$objSearch->AddSimpleFields('c');
if (is_numeric($objConfig->Get("SearchRel_Pop_category"))) {
$objSearch->PctPop = ($objConfig->Get("SearchRel_Pop_category")/100);
}
if (is_numeric($objConfig->Get("SearchRel_Keyword_category"))) {
$objSearch->PctRelevance = ($objConfig->Get("SearchRel_Keyword_category")/100);
}
if (is_numeric($objConfig->Get("SearchRel_Rating_category"))) {
$objSearch->PctRating = ($objConfig->Get("SearchRel_Rating_category")/100);
}
$SearchResultIdList = $objSearch->Result_IdList();
if(count($SearchResultIdList)>0)
{
$objSearch->PerformSearch(1,$SortOrder, TRUE,$SearchResultIdList);
//$objSearch->SetRelevence($type->Get("ItemType"), "CategoryId");
}
$SearchPerformed = TRUE;
}
else {
$MissingCount = SetMissingDataErrors("m_simplesearch");
$MissingCount++;
setSearchError('lu_keywords_tooshort');
}
}
else {
$MissingCount = SetMissingDataErrors("m_simplesearch");
$MissingCount++;
setSearchError('lu_no_keyword');
}
break;
}
function setSearchError($error_phrase)
{
$GLOBALS['FormError']['m_simplesearch']['keywords'] = language($error_phrase);
$GLOBALS['objSession']->SetVariable('search_error', $error_phrase);
}
?>
Property changes on: trunk/kernel/frontaction.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.77
\ No newline at end of property
+1.78
\ No newline at end of property
Index: trunk/tools/cron.php
===================================================================
--- trunk/tools/cron.php (revision 7634)
+++ trunk/tools/cron.php (revision 7635)
@@ -1,22 +1,25 @@
<?php
+// Use this line to invoke from cron.
+// wget http://<server_address>/tools/cron.php -O /dev/null > /dev/null 2>&1
+
define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
define('REL_PATH', 'tools/');
define('ADMIN', 1);
include_once(FULL_PATH.'/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
$event_manager =& $application->recallObject('EventManager');
$event_manager->RunRegularEvents(reBEFORE, true);
$event_manager->RunRegularEvents(reAFTER, true);
function getmicrotime()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
?>
\ No newline at end of file
Property changes on: trunk/tools/cron.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.7
\ No newline at end of property
Index: trunk/themes/default/common/footer.tpl
===================================================================
--- trunk/themes/default/common/footer.tpl (revision 7634)
+++ trunk/themes/default/common/footer.tpl (revision 7635)
@@ -1,20 +1,20 @@
<!-- start footer -->
<tr>
<td><img src="img/s.gif" width="1" height="1" alt="" /><br /></td>
</tr>
<tr>
<td>
<table WIDTH=770 border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="background: #009ff0 url('img/bgr_footer.jpg'); vertical-align:middle;" class="copyright">
- <img src="img/s.gif" width="740" height="1" alt="" /><br />&nbsp; Powered by <a href="http://www.in-portal.net" target="_blank" style="color: #FFFFFF; text-decoration : none;">In-portal</a>&nbsp;&#174; 1997-2006, <a href="http://www.intechnic.com" target="_blank" style="color: #FFFFFF; text-decoration : none;">Intechnic Corporation</a>. All rights reserved.
+ <img src="img/s.gif" width="740" height="1" alt="" /><br />&nbsp; Powered by <a href="http://www.in-portal.net" target="_blank" style="color: #FFFFFF; text-decoration : none;">In-portal</a>&nbsp;&#174; 1997-2007, <a href="http://www.intechnic.com" target="_blank" style="color: #FFFFFF; text-decoration : none;">Intechnic Corporation</a>. All rights reserved.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<inp:m_template_link _Template="sitemap" />" style="color: #FFFFFF; text-decoration : none;"><inp:m_language _Phrase="lu_site_map" /></a></td>
<td width="10000" bgcolor="#009ff0"><img src="img/s.gif" width="1" height="22" alt="" /><br /></td>
</tr>
</table>
</td>
</tr>
<!-- end footer -->
\ No newline at end of file
Property changes on: trunk/themes/default/common/footer.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.8
\ No newline at end of property
+1.9
\ No newline at end of property
Index: trunk/admin/browse/fw_menu.js
===================================================================
--- trunk/admin/browse/fw_menu.js (revision 7634)
+++ trunk/admin/browse/fw_menu.js (revision 7635)
@@ -1,762 +1,763 @@
/**
* fw_menu 24OCT2000 Version 4.0
* John Ahlquist, October 2000
* Copyright (c) 2000 Macromedia, Inc.
*
* based on menu.js
* by gary smith, July 1997
* Copyright (c) 1997-1999 Netscape Communications Corp.
*
* Netscape grants you a royalty free license to use or modify this
* software provided that this copyright notice appears on all copies.
* This software is provided "AS IS," without a warranty of any kind.
*
* Modified By Intechnic Corporation for use in In-Portal
* 6/28/02
*
- */
+ */
function Menu(label)
{
this.version = "990702 [xMenu; fw_menu.js]";
this.type = "Menu";
this.menuWidth = 0;
this.menuItemHeight = 0;
this.fontSize = 11;
this.fontWeight = "normal";
this.fontFamily = "helvetica, arial, verdana, helvetica";
this.fontColor = "#000000";
this.fontColorHilite = "#000000";
this.bgColor = "#555555";
this.menuBorder = 1;
this.menuItemBorder = 0;
this.menuItemBgColor = "#f0f1eb";
this.menuLiteBgColor = "#ffffff";
this.menuBorderBgColor = "#777777";
this.menuHiliteBgColor = "#e0e0da";
this.menuContainerBgColor = "#cccccc";
var $base_path = '';
var $base_tag = document.getElementsByTagName('BASE');
if ($base_tag.length) {
- $base_path = $base_tag[0].href.replace('kernel/admin_templates', 'admin');
+ $base_path = $base_tag[0].href.replace('kernel/admin_templates', 'admin').replace('core/admin_templates', 'admin');
}
+// alert('base: '+$base_tag[0].href+' => '+$base_path)
this.imagePath = $base_path + 'images/';
-
+
this.childMenuIcon = "menu_arrow.gif";
this.items = new Array();
this.actions = new Array();
this.types = new Array(); //for check/radio type to show pics
this.childMenus = new Array();
this.hideOnMouseOut = true;
this.addMenuItem = addMenuItem;
this.addMenuSeparator = addMenuSeparator;
this.writeMenus = writeMenus;
this.FW_showMenu = FW_showMenu;
this.onMenuItemOver = onMenuItemOver;
this.onMenuItemAction = onMenuItemAction;
this.hideMenu = hideMenu;
this.hideChildMenu = hideChildMenu;
label = RemoveTranslationLink(label);
if (!window.menus) window.menus = new Array();
this.label = label || "menuLabel" + window.menus.length;
window.menus[this.label] = this;
window.menus[window.menus.length] = this;
if (!window.activeMenus) window.activeMenus = new Array();
}
function RemoveTranslationLink($string)
{
return $string.match(/<a href="(.*)">(.*)<\/a>/) ? RegExp.$2 : $string;
}
function addMenuItem(label, action, type)
{
if( typeof(label) == 'string' ) label = RemoveTranslationLink(label);
if( isset(type) ) type = parseInt(type);
this.items[this.items.length] = label;
this.actions[this.actions.length] = action;
switch(type)
{
case 1:
this.types[this.types.length] = this.imagePath+'check_on.gif';
break;
case 2:
this.types[this.types.length] = this.imagePath+'menu_dot.gif';
break;
default:
this.types[this.types.length] = '';
}
-}
+}
function addMenuSeparator() {
this.items[this.items.length] = "separator";
this.actions[this.actions.length] = "";
this.types[this.types.length] = "";
this.menuItemBorder = 0;
}
-// For NS6.
+// For NS6.
function FIND(item,called_from)
{
if (document.all) return(document.all[item]);
if (document.getElementById) return(document.getElementById(item));
return(false);
}
function writeMenus(container_id) {
if (window.triedToWriteMenus) return;
var container = null;
if (!container_id && document.layers) {
window.delayWriteMenus = this.writeMenus;
var timer = setTimeout('delayWriteMenus()', 100);
container = new Layer(100);
clearTimeout(timer);
} else if (document.all || document.hasChildNodes) {
if( !isset(container_id) ) container_id = 'menuContainer';
container = FIND(container_id);
if (!container)
{
if( isset(document.body) )
{
container = document.createElement('SPAN');
container.id = container_id;
document.body.appendChild(container);
container = FIND(container_id);
}
else
{
- return false;
+ return false;
}
}
else
{
container.innerHTML = '';
}
}
window.fwHideMenuTimer = null;
- if (!container) return; window.triedToWriteMenus = true;
+ if (!container) return; window.triedToWriteMenus = true;
container.isContainer = true;
container.menus = new Array();
-
- for (var i=0; i<window.menus.length; i++)
+
+ for (var i=0; i<window.menus.length; i++)
container.menus[i] = window.menus[i];
window.menus.length = 0;
var countMenus = 0;
var countItems = 0;
var top = 0;
var content = '';
var lrs = false;
var theStat = "";
var tsc = 0;
if (document.layers) lrs = true;
for (var i=0; i<container.menus.length; i++, countMenus++) {
var menu = container.menus[i];
if (menu.bgImageUp) {
menu.menuBorder = 0;
menu.menuItemBorder = 0;
}
if (lrs) {
var menuLayer = new Layer(100, container);
var lite = new Layer(100, menuLayer);
lite.top = menu.menuBorder;
lite.left = menu.menuBorder;
var body = new Layer(100, lite);
body.top = menu.menuBorder;
body.left = menu.menuBorder;
} else {
content += ''+
'<DIV ID="menuLayer'+ countMenus +'" STYLE="position:absolute;z-index:100;left:10;top:'+ (i * 100) +';visibility:hidden;">\n'+
' <DIV ID="menuLite'+ countMenus +'" STYLE="position:absolute;z-index:100;left:'+ menu.menuBorder +';top:'+ menu.menuBorder +';visibility:hide;" onMouseOut="mouseoutMenu();">\n'+
' <DIV ID="menuFg'+ countMenus +'" STYLE="position:absolute;left:'+ menu.menuBorder +';top:'+ menu.menuBorder +';visibility:hide;">\n'+
'';
}
var x=i;
for (var i=0; i<menu.items.length; i++) {
var item = menu.items[i];
var type = menu.types[i];
var childMenu = false;
var defaultHeight = menu.fontSize+6;
var defaultIndent = menu.fontSize+7;
if (item.label) {
item = item.label;
childMenu = true;
}
menu.menuItemHeight = menu.menuItemHeight || defaultHeight;
menu.menuItemIndent = menu.menuItemIndent || defaultIndent;
var itemProps = 'font-family:' + menu.fontFamily +';font-weight:' + menu.fontWeight + ';fontSize:' + menu.fontSize + ';';
if (menu.fontStyle) itemProps += 'font-style:' + menu.fontStyle + ';';
- if (document.all)
+ if (document.all)
itemProps += 'font-size:' + menu.fontSize + ';" onMouseOver="onMenuItemOver(null,this);" onClick="onMenuItemAction(null,this);';
else if (!document.layers) {
itemProps += 'font-size:' + menu.fontSize + 'px;'; // zilla wants 12px.
}
var l;
if (lrs) {
l = new Layer(800,body);
}
var dTag = '<DIV ID="menuItem'+ countItems +'" STYLE="position:absolute;left:0;top:'+ (i * menu.menuItemHeight) +';'+ itemProps +'">';
var dClose = '</DIV>'
if (menu.bgImageUp) {
menu.menuBorder = 0;
menu.menuItemBorder = 0;
dTag = '<DIV ID="menuItem'+ countItems +'" STYLE="background:url('+menu.bgImageUp+');position:absolute;left:0;top:'+ (i * menu.menuItemHeight) +';'+ itemProps +'">';
if (document.layers) {
dTag = '<LAYER BACKGROUND="'+menu.bgImageUp+'" ID="menuItem'+ countItems +'" TOP="'+ (i * menu.menuItemHeight) +'" style="' + itemProps +'">';
dClose = '</LAYER>';
}
}
var textProps = 'position:absolute;left:' + menu.menuItemIndent + ';top:1;';
if (lrs) {
textProps +=itemProps;
dTag = "";
dClose = "";
}
var dText = '';
if (type != '' && childMenu == false)
{
dText = '&nbsp;<img border="0" src="' + type + '" valign="center">';
}
dText += '<DIV ID="menuItemText'+ countItems +'" STYLE="' + textProps + 'color:'+ menu.fontColor +';">' + item +'&nbsp</DIV>\n<DIV ID="menuItemHilite'+ countItems +'" STYLE="' + textProps + 'top:1;color:'+ menu.fontColorHilite +';visibility:hidden;">'+ item +'&nbsp</DIV>';
if (item == "separator") {
content += ( dTag + '<DIV ID="menuSeparator'+ countItems +'" STYLE="position:absolute;left:1;top:2;"></DIV>\n<DIV ID="menuSeparatorLite'+ countItems +'" STYLE="position:absolute;left:1;top:2;"></DIV>\n' + dClose);
} else if (childMenu) {
content += ( dTag + dText + '<DIV ID="childMenu'+ countItems +'" STYLE="position:absolute;left:0;top:3;"><IMG SRC="'+ menu.imagePath+menu.childMenuIcon +'"></DIV>\n' + dClose);
} else {
content += ( dTag + dText + dClose);
}
if (lrs) {
l.document.open("text/html");
l.document.writeln(content);
- l.document.close();
+ l.document.close();
content = '';
theStat += "-";
tsc++;
if (tsc > 50) {
tsc = 0;
theStat = "";
}
status = theStat;
}
- countItems++;
+ countItems++;
}
if (lrs) {
// focus layer
var focusItem = new Layer(100, body);
focusItem.visiblity="hidden";
focusItem.document.open("text/html");
focusItem.document.writeln("&nbsp;");
- focusItem.document.close();
+ focusItem.document.close();
} else {
content += ' <DIV ID="focusItem'+ countMenus +'" STYLE="position:absolute;left:0;top:0;visibility:hide;" onClick="onMenuItemAction(null,this);">&nbsp;</DIV>\n';
content += ' </DIV>\n </DIV>\n</DIV>\n';
}
i=x;
}
- if (document.layers) {
+ if (document.layers) {
container.clip.width = window.innerWidth;
container.clip.height = window.innerHeight;
container.onmouseout = mouseoutMenu;
container.menuContainerBgColor = this.menuContainerBgColor;
for (var i=0; i<container.document.layers.length; i++) {
proto = container.menus[i];
var menu = container.document.layers[i];
container.menus[i].menuLayer = menu;
container.menus[i].menuLayer.Menu = container.menus[i];
container.menus[i].menuLayer.Menu.container = container;
var body = menu.document.layers[0].document.layers[0];
body.clip.width = proto.menuWidth || body.clip.width;
body.clip.height = proto.menuHeight || body.clip.height;
for (var n=0; n<body.document.layers.length-1; n++) {
var l = body.document.layers[n];
l.Menu = container.menus[i];
l.menuHiliteBgColor = proto.menuHiliteBgColor;
l.document.bgColor = proto.menuItemBgColor;
l.saveColor = proto.menuItemBgColor;
l.onmouseover = proto.onMenuItemOver;
l.onclick = proto.onMenuItemAction;
l.action = container.menus[i].actions[n];
l.focusItem = body.document.layers[body.document.layers.length-1];
l.clip.width = proto.menuWidth || body.clip.width + proto.menuItemIndent;
l.clip.height = proto.menuItemHeight || l.clip.height;
if (n>0) l.top = body.document.layers[n-1].top + body.document.layers[n-1].clip.height + proto.menuItemBorder;
l.hilite = l.document.layers[1];
if (proto.bgImageUp) l.background.src = proto.bgImageUp;
l.document.layers[1].isHilite = true;
if (l.document.layers[0].id.indexOf("menuSeparator") != -1) {
l.hilite = null;
l.clip.height -= l.clip.height / 2;
l.document.layers[0].document.bgColor = proto.bgColor;
l.document.layers[0].clip.width = l.clip.width -2;
l.document.layers[0].clip.height = 1;
l.document.layers[1].document.bgColor = proto.menuLiteBgColor;
l.document.layers[1].clip.width = l.clip.width -2;
l.document.layers[1].clip.height = 1;
l.document.layers[1].top = l.document.layers[0].top + 1;
} else if (l.document.layers.length > 2) {
l.childMenu = container.menus[i].items[n].menuLayer;
l.document.layers[2].left = l.clip.width -13;
l.document.layers[2].top = (l.clip.height / 2) -4;
l.document.layers[2].clip.left += 3;
l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
}
}
body.document.bgColor = proto.bgColor;
body.clip.width = l.clip.width +proto.menuBorder;
body.clip.height = l.top + l.clip.height +proto.menuBorder;
var focusItem = body.document.layers[n];
focusItem.clip.width = body.clip.width;
focusItem.Menu = l.Menu;
focusItem.top = -30;
focusItem.captureEvents(Event.MOUSEDOWN);
focusItem.onmousedown = onMenuItemDown;
menu.document.bgColor = proto.menuBorderBgColor;
var lite = menu.document.layers[0];
lite.document.bgColor = proto.menuLiteBgColor;
lite.clip.width = body.clip.width +1;
lite.clip.height = body.clip.height +1;
menu.clip.width = body.clip.width + (proto.menuBorder * 3) ;
menu.clip.height = body.clip.height + (proto.menuBorder * 3);
}
} else {
if ((document.all) || (container.hasChildNodes)) {
container.innerHTML=content;
} else {
container.document.open("text/html");
container.document.writeln(content);
- container.document.close();
+ container.document.close();
}
if (!FIND("menuLayer0")) return;
var menuCount = 0;
for (var x=0; x<container.menus.length; x++) {
var menuLayer = FIND("menuLayer" + x);
container.menus[x].menuLayer = "menuLayer" + x;
menuLayer.Menu = container.menus[x];
menuLayer.Menu.container = "menuLayer" + x;
menuLayer.style.zIndex = 100;
var s = menuLayer.style;
s.top = s.pixelTop = -300;
s.left = s.pixelLeft = -300;
var menu = container.menus[x];
menu.menuItemWidth = menu.menuWidth || menu.menuIEWidth || 140;
menuLayer.style.backgroundColor = menu.menuBorderBgColor;
var top = 0;
for (var i=0; i<container.menus[x].items.length; i++) {
var l = FIND("menuItem" + menuCount);
l.Menu = container.menus[x];
if (l.addEventListener) { // ns6
- l.style.width = menu.menuItemWidth;
+ l.style.width = menu.menuItemWidth;
l.style.height = menu.menuItemHeight;
l.style.top = top;
l.addEventListener("mouseover", onMenuItemOver, false);
l.addEventListener("click", onMenuItemAction, false);
l.addEventListener("mouseout", mouseoutMenu, false);
} else { //ie
- l.style.pixelWidth = menu.menuItemWidth;
+ l.style.pixelWidth = menu.menuItemWidth;
l.style.pixelHeight = menu.menuItemHeight;
l.style.pixelTop = top;
}
top = top + menu.menuItemHeight+menu.menuItemBorder;
l.style.fontSize = menu.fontSize;
l.style.backgroundColor = menu.menuItemBgColor;
l.style.visibility = "inherit";
l.saveColor = menu.menuItemBgColor;
l.menuHiliteBgColor = menu.menuHiliteBgColor;
l.action = container.menus[x].actions[i];
l.hilite = FIND("menuItemHilite" + menuCount);
l.focusItem = FIND("focusItem" + x);
l.focusItem.style.pixelTop = l.focusItem.style.top = -30;
var childItem = FIND("childMenu" + menuCount);
if (childItem) {
l.childMenu = container.menus[x].items[i].menuLayer;
childItem.style.pixelLeft = childItem.style.left = menu.menuItemWidth -11;
childItem.style.pixelTop = childItem.style.top =(menu.menuItemHeight /2) -4;
//childItem.style.pixelWidth = 30 || 7;
//childItem.style.clip = "rect(0 7 7 3)";
l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
}
var sep = FIND("menuSeparator" + menuCount);
if (sep) {
sep.style.clip = "rect(0 " + (menu.menuItemWidth - 3) + " 1 0)";
- sep.style.width = sep.style.pixelWidth = menu.menuItemWidth;
+ sep.style.width = sep.style.pixelWidth = menu.menuItemWidth;
sep.style.backgroundColor = menu.bgColor;
sep = FIND("menuSeparatorLite" + menuCount);
sep.style.clip = "rect(1 " + (menu.menuItemWidth - 3) + " 2 0)";
- sep.style.width = sep.style.pixelWidth = menu.menuItemWidth;
+ sep.style.width = sep.style.pixelWidth = menu.menuItemWidth;
sep.style.backgroundColor = menu.menuLiteBgColor;
l.style.height = l.style.pixelHeight = menu.menuItemHeight/2;
l.isSeparator = true
top -= (menu.menuItemHeight - l.style.pixelHeight)
} else {
l.style.cursor = "hand"
}
menuCount++;
}
menu.menuHeight = top-1;
var lite = FIND("menuLite" + x);
var s = lite.style;
s.height = s.pixelHeight = menu.menuHeight +(menu.menuBorder * 2);
s.width = s.pixelWidth = menu.menuItemWidth + (menu.menuBorder * 2);
s.backgroundColor = menu.menuLiteBgColor;
var body = FIND("menuFg" + x);
s = body.style;
s.height = s.pixelHeight = menu.menuHeight + menu.menuBorder;
s.width = s.pixelWidth = menu.menuItemWidth + menu.menuBorder;
s.backgroundColor = menu.bgColor;
s = menuLayer.style;
s.width = s.pixelWidth = menu.menuItemWidth + (menu.menuBorder * 4);
s.height = s.pixelHeight = menu.menuHeight+(menu.menuBorder*4);
}
}
- if (document.captureEvents) {
+ if (document.captureEvents) {
document.captureEvents(Event.MOUSEUP);
}
- if (document.addEventListener) {
+ if (document.addEventListener) {
document.addEventListener("mouseup", onMenuItemOver, false);
}
if (document.layers && window.innerWidth) {
window.onresize = NS4resize;
window.NS4sIW = window.innerWidth;
window.NS4sIH = window.innerHeight;
}
document.onmouseup = mouseupMenu;
window.fwWroteMenu = true;
status = "";
}
function NS4resize() {
- if (NS4sIW < window.innerWidth ||
- NS4sIW > window.innerWidth ||
- NS4sIH > window.innerHeight ||
- NS4sIH < window.innerHeight )
+ if (NS4sIW < window.innerWidth ||
+ NS4sIW > window.innerWidth ||
+ NS4sIH > window.innerHeight ||
+ NS4sIH < window.innerHeight )
{
window.location.reload();
}
}
function onMenuItemOver(e, l) {
FW_clearTimeout();
l = l || this;
a = window.ActiveMenuItem;
if (document.layers) {
if (a) {
a.document.bgColor = a.saveColor;
if (a.hilite) a.hilite.visibility = "hidden";
if (a.Menu.bgImageOver) {
a.background.src = a.Menu.bgImageUp;
}
a.focusItem.top = -100;
a.clicked = false;
}
if (l.hilite) {
l.document.bgColor = l.menuHiliteBgColor;
l.zIndex = 100;
l.hilite.visibility = "inherit";
l.hilite.zIndex = 101;
l.document.layers[1].zIndex = 100;
l.focusItem.zIndex = this.zIndex +2;
}
if (l.Menu.bgImageOver) {
l.background.src = l.Menu.bgImageOver;
}
l.focusItem.top = this.top;
l.Menu.hideChildMenu(l);
} else if (l.style && l.Menu) {
if (a) {
a.style.backgroundColor = a.saveColor;
if (a.hilite) a.hilite.style.visibility = "hidden";
if (a.Menu.bgImageUp) {
a.style.background = "url(" + a.Menu.bgImageUp +")";;
}
- }
+ }
if (l.isSeparator) return;
l.style.backgroundColor = l.menuHiliteBgColor;
l.zIndex = 100; // magic IE 4.5 mac happy doohicky. jba
if (l.Menu.bgImageOver) {
l.style.background = "url(" + l.Menu.bgImageOver +")";
}
if (l.hilite) {
l.style.backgroundColor = l.menuHiliteBgColor;
l.hilite.style.visibility = "inherit";
}
l.focusItem.style.top = l.focusItem.style.pixelTop = l.style.pixelTop;
l.focusItem.style.zIndex = l.zIndex +1;
l.Menu.hideChildMenu(l);
} else {
return; // not a menu - magic IE 4.5 mac happy doohicky. jba
}
window.ActiveMenuItem = l;
}
function onMenuItemAction(e, l) {
l = window.ActiveMenuItem;
if (!l) return;
hideActiveMenus();
//alert(l.action);
if (l.action) {
eval("" + l.action);
}
window.ActiveMenuItem = 0;
}
function FW_clearTimeout()
{
if (fwHideMenuTimer) clearTimeout(fwHideMenuTimer);
fwHideMenuTimer = null;
fwDHFlag = false;
}
function FW_startTimeout()
{
fwStart = new Date();
fwDHFlag = true;
fwHideMenuTimer = setTimeout("fwDoHide()", 1000);
}
function fwDoHide()
{
if (!fwDHFlag) return;
var elapsed = new Date() - fwStart;
if (elapsed < 1000) {
fwHideMenuTimer = setTimeout("fwDoHide()", 1100-elapsed);
return;
}
fwDHFlag = false;
hideActiveMenus();
window.ActiveMenuItem = 0;
}
function FW_showMenu(menu, x, y, child) {
- if (!window.fwWroteMenu)
+ if (!window.fwWroteMenu)
{
alert('No Menu Written');
return;
}
FW_clearTimeout();
if (document.layers) {
if (menu) {
var l = menu.menuLayer || menu;
l.left = 1;
l.top = 1;
hideActiveMenus();
if (this.visibility) l = this;
window.ActiveMenu = l;
} else {
var l = child;
}
if (!l) return;
- for (var i=0; i<l.layers.length; i++) {
- if (!l.layers[i].isHilite)
+ for (var i=0; i<l.layers.length; i++) {
+ if (!l.layers[i].isHilite)
l.layers[i].visibility = "inherit";
- if (l.layers[i].document.layers.length > 0)
+ if (l.layers[i].document.layers.length > 0)
FW_showMenu(null, "relative", "relative", l.layers[i]);
}
if (l.parentLayer) {
- if (x != "relative")
+ if (x != "relative")
l.parentLayer.left = x || window.pageX || 0;
- if (l.parentLayer.left + l.clip.width > window.innerWidth)
+ if (l.parentLayer.left + l.clip.width > window.innerWidth)
l.parentLayer.left -= (l.parentLayer.left + l.clip.width - window.innerWidth);
- if (y != "relative")
+ if (y != "relative")
l.parentLayer.top = y || window.pageY || 0;
if (l.parentLayer.isContainer) {
l.Menu.xOffset = window.pageXOffset;
l.Menu.yOffset = window.pageYOffset;
l.parentLayer.clip.width = window.ActiveMenu.clip.width +2;
l.parentLayer.clip.height = window.ActiveMenu.clip.height +2;
if (l.parentLayer.menuContainerBgColor) l.parentLayer.document.bgColor = l.parentLayer.menuContainerBgColor;
}
}
l.visibility = "inherit";
if (l.Menu) l.Menu.container.visibility = "inherit";
} else if (FIND("menuItem0")) {
- var l = menu.menuLayer || menu;
+ var l = menu.menuLayer || menu;
hideActiveMenus();
if (typeof(l) == "string") {
l = FIND(l);
}
window.ActiveMenu = l;
var s = l.style;
s.visibility = "inherit";
- if (x != "relative")
+ if (x != "relative")
s.left = s.pixelLeft = x || (window.pageX + document.body.scrollLeft) || 0;
- if (y != "relative")
+ if (y != "relative")
s.top = s.pixelTop = y || (window.pageY + document.body.scrollTop) || 0;
l.Menu.xOffset = document.body.scrollLeft;
l.Menu.yOffset = document.body.scrollTop;
}
if (menu) {
window.activeMenus[window.activeMenus.length] = l;
}
}
function onMenuItemDown(e, l) {
var a = window.ActiveMenuItem;
if (document.layers) {
if (a) {
a.eX = e.pageX;
a.eY = e.pageY;
a.clicked = true;
}
}
}
function mouseupMenu(e)
{
hideMenu(true, e);
hideActiveMenus();
return true;
}
function mouseoutMenu()
{
hideMenu(false, false);
return true;
}
function hideMenu(mouseup, e) {
var a = window.ActiveMenuItem;
if (a && document.layers) {
a.document.bgColor = a.saveColor;
a.focusItem.top = -30;
if (a.hilite) a.hilite.visibility = "hidden";
if (mouseup && a.action && a.clicked && window.ActiveMenu) {
if (a.eX <= e.pageX+15 && a.eX >= e.pageX-15 && a.eY <= e.pageY+10 && a.eY >= e.pageY-10) {
setTimeout('window.ActiveMenu.Menu.onMenuItemAction();', 2);
}
}
a.clicked = false;
if (a.Menu.bgImageOver) {
a.background.src = a.Menu.bgImageUp;
}
} else if (window.ActiveMenu && FIND("menuItem0")) {
if (a) {
a.style.backgroundColor = a.saveColor;
if (a.hilite) a.hilite.style.visibility = "hidden";
if (a.Menu.bgImageUp) {
a.style.background = "url(" + a.Menu.bgImageUp +")";;
}
}
}
if (!mouseup && window.ActiveMenu) {
if (window.ActiveMenu.Menu) {
if (window.ActiveMenu.Menu.hideOnMouseOut) {
FW_startTimeout();
}
return(true);
}
}
return(true);
}
function PxToNum(pxStr)
{ // pxStr == 27px, we want 27.
if (pxStr.length > 2) {
n = Number(pxStr.substr(0, pxStr.length-2));
return(n);
}
return(0);
}
function hideChildMenu(hcmLayer) {
FW_clearTimeout();
var l = hcmLayer;
for (var i=0; i < l.Menu.childMenus.length; i++) {
var theLayer = l.Menu.childMenus[i];
if (document.layers) {
theLayer.visibility = "hidden";
} else {
theLayer = FIND(theLayer);
theLayer.style.visibility = "hidden";
}
theLayer.Menu.hideChildMenu(theLayer);
}
if (l.childMenu) {
var childMenu = l.childMenu;
if (document.layers) {
l.Menu.FW_showMenu(null,null,null,childMenu.layers[0]);
childMenu.zIndex = l.parentLayer.zIndex +1;
childMenu.top = l.top + l.parentLayer.top + l.Menu.menuLayer.top + l.Menu.menuItemHeight/3;
if (childMenu.left + childMenu.clip.width > window.innerWidth) {
childMenu.left = l.parentLayer.left - childMenu.clip.width + l.Menu.menuLayer.left + 15;
l.Menu.container.clip.left -= childMenu.clip.width;
} else {
childMenu.left = l.parentLayer.left + l.parentLayer.clip.width + l.Menu.menuLayer.left -5;
}
var w = childMenu.clip.width+childMenu.left-l.Menu.container.clip.left;
- if (w > l.Menu.container.clip.width)
+ if (w > l.Menu.container.clip.width)
l.Menu.container.clip.width = w;
var h = childMenu.clip.height+childMenu.top-l.Menu.container.clip.top;
if (h > l.Menu.container.clip.height) l.Menu.container.clip.height = h;
l.document.layers[1].zIndex = 0;
childMenu.visibility = "inherit";
} else if (FIND("menuItem0")) {
childMenu = FIND(l.childMenu);
var menuLayer = FIND(l.Menu.menuLayer);
var s = childMenu.style;
s.zIndex = menuLayer.style.zIndex+1;
if (document.all) { // ie case.
s.pixelTop = l.style.pixelTop + menuLayer.style.pixelTop + l.Menu.menuItemHeight/3;
left = s.pixelLeft = (menuLayer.style.pixelWidth) + menuLayer.style.pixelLeft -5;
// alert(left + parseInt(s.width) - document.body.scrollLeft)
if (left + parseInt(s.width) > document.body.scrollLeft + document.body.offsetWidth)
left -= parseInt(s.width) + l.offsetWidth - 5;
- s.left = left;
+ s.left = left;
} else { // zilla case
var top = PxToNum(l.style.top) + PxToNum(menuLayer.style.top) + l.Menu.menuItemHeight/3;
var left = (PxToNum(menuLayer.style.width)) + PxToNum(menuLayer.style.left) -5;
s.top = top;
// alert()
if (left + parseInt(s.width) > document.body.offsetWidth)
left -= parseInt(s.width) + l.offsetWidth - 5;
- s.left = left;
+ s.left = left;
}
childMenu.style.visibility = "inherit";
} else {
return;
}
window.activeMenus[window.activeMenus.length] = childMenu;
}
}
function hideActiveMenus() {
if (!window.activeMenus) return;
for (var i=0; i < window.activeMenus.length; i++) {
if (!activeMenus[i]) continue;
if (activeMenus[i].visibility && activeMenus[i].Menu) {
activeMenus[i].visibility = "hidden";
activeMenus[i].Menu.container.visibility = "hidden";
activeMenus[i].Menu.container.clip.left = 0;
} else if (activeMenus[i].style) {
var s = activeMenus[i].style;
s.visibility = "hidden";
s.left = -200;
s.top = -200;
}
}
if (window.ActiveMenuItem) {
hideMenu(false, false);
}
window.activeMenus.length = 0;
}
function isset(variable)
{
if(variable==null) return false;
return (typeof(variable)=='undefined')?false:true;
-}
+}
Property changes on: trunk/admin/browse/fw_menu.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.7
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/dialog/fck_document/excel.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/editor/cmseditor/editor/dialog/fck_document/excel.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/dialog/fck_document/xml.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/editor/cmseditor/editor/dialog/fck_document/xml.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/dialog/fck_document/audio.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/editor/cmseditor/editor/dialog/fck_document/audio.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/dialog/fck_document/image.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/editor/cmseditor/editor/dialog/fck_document/image.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/dialog/fck_document/ppt.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/editor/cmseditor/editor/dialog/fck_document/ppt.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/dialog/fck_document/doc.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/editor/cmseditor/editor/dialog/fck_document/doc.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/dialog/fck_document/video.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/editor/cmseditor/editor/dialog/fck_document/video.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/dialog/fck_document/pdf.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/editor/cmseditor/editor/dialog/fck_document/pdf.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/dialog/fck_document.html
===================================================================
--- trunk/admin/editor/cmseditor/editor/dialog/fck_document.html (revision 7634)
+++ trunk/admin/editor/cmseditor/editor/dialog/fck_document.html (revision 7635)
@@ -1,139 +1,139 @@
<html>
<head>
<title>Insert Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script src="fck_document/fck_document.js" type="text/javascript"></script>
<link href="common/fck_dialog_common.css" rel="stylesheet" type="text/css" />
</head>
-
+
<body scroll="no" style="OVERFLOW: hidden">
<div id="divInfo">
<table cellspacing="1" cellpadding="1" border="0" width="100%" height="100%">
<tr>
<td>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td width="100%" colspan="3">
<span fckLang="DlgDocURL">Document (address or file path)</span>
</td>
</tr>
<tr>
<td valign="top">
<input id="docUrl" style="WIDTH: 322px" type="text"">
</td>
<td>&nbsp;&nbsp;</td>
<td id="tdBrowse" nowrap>
<input id="btnBrowse" onClick="BrowseServer('docUrl');" type="button" value="Browse Server" fckLang="DlgBtnBrowseServer" NAME="btnBrowse">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td nowrap><span fckLang="DlgDocTitle2">Document title:</span></td>
<td>&nbsp;&nbsp;</td>
<td style="WIDTH: 248px"><input id="txtTitle" style="WIDTH: 100%" type="text"></td>
</tr>
<tr>
<td colspan='3'><img src="images/s.gif" width="1" height="3"><br></td>
</tr>
<tr>
<td><span fckLang="DlgLnkViewIn">View In:</span><br /></td>
<td>&nbsp;&nbsp;</td>
<td>
<select id="cmbTarget" onChange="SetTarget(this.value);">
<option value="" fckLang="DlgLnkTargetSelf">Same Window</option>
<option value="_blank" fckLang="DlgLnkTargetBlank">New Window</option>
<option value="popup" fckLang="DlgLnkTargetPopup">&lt;popup window&gt;</option>
</select>
</td>
</tr>
</tr>
</table>
<div id="divPopupSize" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" border="0">
<tr><td colspan='7'><img src='images/s.gif' width='1' height='5'></td></tr>
<tr>
<td><span fckLang="DlgLnkPopupWidth">PopUp Width:</span></td>
<td>&nbsp;&nbsp;</td>
- <td><input id="txtPopupWidth" style="WIDTH: 30" type="text" /></td>
+ <td><input id="txtPopupWidth" style="WIDTH: 30" type="text" /></td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td><span fckLang="DlgLnkPopupHeight">PopUp Height:</span></td>
<td>&nbsp;&nbsp;</td>
- <td><input id="txtPopupHeight" style="WIDTH: 30" type="text" /></td>
+ <td><input id="txtPopupHeight" style="WIDTH: 30" type="text" /></td>
</tr>
</table>
</div>
</td>
</tr>
-
-
-
+
+
+
<tr height="100%">
<td valign="top">
&nbsp;<br>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td colspan="10">&nbsp;&nbsp;&nbsp;&nbsp;<span fckLang="DlgDocICON">ICON</span></td>
</tr>
<tr>
- <td align='center' style="WIDTH: 50px"><img width="16" height="16" alt="Word" src="../../../templates/UserFiles/icons/doc.gif">&nbsp;<input name="image_type" type="radio" id="doc" value="doc" OnClick="SetImageType(this.value)"></td>
- <td align='center' style="WIDTH: 50px"><img width="16" height="16" alt="PDF" src="../../../templates/UserFiles/icons/pdf.gif">&nbsp;<input name="image_type" type="radio" id="pdf" value="pdf" OnClick="SetImageType(this.value)"></td>
- <td align='center' style="WIDTH: 50px"><img width="16" height="16" alt="Image" src="../../../templates/UserFiles/icons/image.gif">&nbsp;<input name="image_type" type="radio" id="image" value="image" OnClick="SetImageType(this.value)"></td>
- <td align='center' style="WIDTH: 50px"><img width="16" height="16" alt="Excel" src="../../../templates/UserFiles/icons/excel.gif">&nbsp;<input name="image_type" type="radio" id="excel" value="excel" OnClick="SetImageType(this.value)"></td>
- <td align='center' style="WIDTH: 50px"><img width="16" height="16" alt="PowerPoint" src="../../../templates/UserFiles/icons/ppt.gif">&nbsp;<input name="image_type" type="radio" id="ppt" value="ppt" OnClick="SetImageType(this.value)"></td>
- <td align='center' style="WIDTH: 50px"><img width="16" height="16" alt="Audio" src="../../../templates/UserFiles/icons/audio.gif">&nbsp;<input name="image_type" type="radio" id="audio" value="audio" OnClick="SetImageType(this.value)"></td>
- <td align='center' style="WIDTH: 50px"><img width="16" height="16" alt="Video" src="../../../templates/UserFiles/icons/video.gif">&nbsp;<input name="image_type" type="radio" id="video" value="video" OnClick="SetImageType(this.value)"></td>
+ <td align='center' style="WIDTH: 50px"><img width="16" height="16" alt="Word" src="fck_document/doc.gif">&nbsp;<input name="image_type" type="radio" id="doc" value="doc" OnClick="SetImageType(this.value)"></td>
+ <td align='center' style="WIDTH: 50px"><img width="16" height="16" alt="PDF" src="fck_document/pdf.gif">&nbsp;<input name="image_type" type="radio" id="pdf" value="pdf" OnClick="SetImageType(this.value)"></td>
+ <td align='center' style="WIDTH: 50px"><img width="16" height="16" alt="Image" src="fck_document/image.gif">&nbsp;<input name="image_type" type="radio" id="image" value="image" OnClick="SetImageType(this.value)"></td>
+ <td align='center' style="WIDTH: 50px"><img width="16" height="16" alt="Excel" src="fck_document/excel.gif">&nbsp;<input name="image_type" type="radio" id="excel" value="excel" OnClick="SetImageType(this.value)"></td>
+ <td align='center' style="WIDTH: 50px"><img width="16" height="16" alt="PowerPoint" src="fck_document/ppt.gif">&nbsp;<input name="image_type" type="radio" id="ppt" value="ppt" OnClick="SetImageType(this.value)"></td>
+ <td align='center' style="WIDTH: 50px"><img width="16" height="16" alt="Audio" src="fck_document/audio.gif">&nbsp;<input name="image_type" type="radio" id="audio" value="audio" OnClick="SetImageType(this.value)"></td>
+ <td align='center' style="WIDTH: 50px"><img width="16" height="16" alt="Video" src="fck_document/video.gif">&nbsp;<input name="image_type" type="radio" id="video" value="video" OnClick="SetImageType(this.value)"></td>
<td>&nbsp;&nbsp;</td>
<td align='center' style="WIDTH: 50px"><input name="image_type" type="radio" id="none" value="none" OnClick="SetImageType(this.value)"></td>
<td style="WIDTH: 30px">&nbsp;</td>
</tr>
<tr>
<td align='center' style="WIDTH: 50px"><span fckLang="DlgDocWord">Word</span></td>
<td align='center' style="WIDTH: 50px"><span fckLang="DlgDocPDF">PDF</span></td>
<td align='center' style="WIDTH: 50px"><span fckLang="DlgDocImage">Image</span></td>
<td align='center' style="WIDTH: 50px"><span fckLang="DlgDocExcel">Excel</span></td>
<td align='center' style="WIDTH: 50px"><span fckLang="DlgDocPP">PowerPoint</span></td>
<td align='center' style="WIDTH: 50px"><span fckLang="DlgDocAudio">Audio</span></td>
<td align='center' style="WIDTH: 50px"><span fckLang="DlgDocVideo">Video</span></td>
<td>&nbsp;&nbsp;</td>
<td align='center'><span fckLang="DlgDocNone">None</span></td>
</tr>
</table>
<br>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align='center'><img src="images/s.gif" width="12" height="1"><br></td>
<td><input name="image_type" type="radio" value="other" id="other" OnClick="SetImageType(this.value)"></td>
<td align='center' style="WIDTH: 25px"><span fckLang="DlgDocOther">Other</span></td>
<td>&nbsp;&nbsp;</td>
<td align='center'><input id="otherUrl" style="WIDTH: 248px" type="text"></td>
<td>&nbsp;&nbsp;</td>
<td id="tdBrowse" nowrap>
<input id="btnBrowse2" onClick="BrowseServer('otherUrl'); " type="button" value="Browse Server" fckLang="DlgBtnBrowseServer" NAME="btnBrowse">
</td>
</tr>
</table>
<br>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/s.gif" width="14" height="1"><br></td>
<td><input id="display_size" type="checkbox"></td>
<td>&nbsp;</td>
<td><span fckLang="DlgDocDisplayFSize">Display File Size</span></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>
Property changes on: trunk/admin/editor/cmseditor/editor/dialog/fck_document.html
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/commands.php
===================================================================
--- trunk/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/commands.php (revision 7634)
+++ trunk/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/commands.php (revision 7635)
@@ -1,569 +1,585 @@
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: commands.php
* This is the File Manager Connector for ASP.
*
* Version: 2.0 RC3
* Modified: 2005-02-19 16:02:38
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
function GetFolders( $resourceType, $currentFolder )
{
// Map the virtual path to the local server path.
$sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ;
// Open the "Folders" node.
$aFolders = array();
echo "<Folders>" ;
$oCurrentFolder = opendir( $sServerDir ) ;
while ( $sFile = readdir( $oCurrentFolder ) )
{
if ( $sFile != '.' && $sFile != '..' && $sFile != 'CVS' && is_dir( $sServerDir . $sFile ) )
$aFolders[] = $sFile;
//echo '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ;
}
if (count($aFolders) > 0) {
natcasesort($aFolders);
foreach($aFolders AS $k=>$v) {
echo '<Folder name="' . ConvertToXmlAttribute($v) . '" />' ;
}
}
closedir( $oCurrentFolder ) ;
// Close the "Folders" node.
echo "</Folders>" ;
}
function ValidateSID()
{
if (isset($Config['K4Mode']))
return true;
else {
$conn = GetADODbConnection();
$session_time = GetConfigValue('ses_timeout')+0;
$sid = $_COOKIE['admin_sid'];
$sql = "SELECT count( sd.sid )
FROM session_data AS sd
LEFT JOIN sessions AS s ON s.sid = sd.sid
WHERE sd.`name` = 'admin_mode'
AND sd.`value` = '1'
AND sd.sid = '".$sid."'
AND s.expire + '".$session_time."' > unix_timestamp()";
if ($conn->GetOne($sql) > 0) {
return true;
} else {
echo "SESSION Validation FALSE";
}
}
return false;
}
function GetCmsTree()
{
global $Config;
$ret = "<CmsPages>";
if (isset($Config['K4Mode'])) {
$ret.= K4ReadCmsTree(0);
}
else {
$ret.= ReadCmsTree(0);
}
$ret.= "</CmsPages>";
echo $ret;
}
function K4ReadCmsTree($cat_id, $level = 0)
{
$application =& kApplication::Instance();
$application->Init();
- $lang = $application->GetVar('m_lang');
+ if ($application->isModuleEnabled('Proj-CMS')) {
+ $lang = $application->GetVar('m_lang');
- $query = 'SELECT PageId, Path, l'.$lang.'_Title AS Title FROM '.TABLE_PREFIX.'Pages ORDER By l'.$lang.'_Title';
- $pages = $application->Conn->Query($query);
+ $query = 'SELECT CategoryId, NamedParentPath, l'.$lang.'_Title AS Title FROM '.TABLE_PREFIX.'Category ORDER By l'.$lang.'_Title';
+ $pages = $application->Conn->Query($query);
- $res = '';
- foreach ($pages as $page) {
- $page_path = $page['Path'].'.html';
- $title = $page['Title'].' ('.$page_path.')';
- $res .= '<CmsPage path="'.$page_path.'" title="'.$prefix.htmlspecialchars($title,ENT_QUOTES).'" st_id="'.$rs->fields['PageId'].'" serverpath="'.BASE_PATH.'/" />';
+ $res = '';
+ foreach ($pages as $page) {
+ $page_path = preg_replace('/^content\//', '', strtolower($page['NamedParentPath']).'.html');
+ $title = $page['Title'].' ('.$page_path.')';
+ $res .= '<CmsPage path="'.$page_path.'" title="'.$prefix.htmlspecialchars($title,ENT_QUOTES).'" st_id="'.$page['CategoryId'].'" serverpath="'.BASE_PATH.'/" />';
+ }
+ }
+ else {
+
+ $lang = $application->GetVar('m_lang');
+
+ $query = 'SELECT PageId, Path, l'.$lang.'_Title AS Title FROM '.TABLE_PREFIX.'Pages ORDER By l'.$lang.'_Title';
+ $pages = $application->Conn->Query($query);
+
+ $res = '';
+ foreach ($pages as $page) {
+ $page_path = $page['Path'].'.html';
+ $title = $page['Title'].' ('.$page_path.')';
+ $res .= '<CmsPage path="'.$page_path.'" title="'.$prefix.htmlspecialchars($title,ENT_QUOTES).'" st_id="'.$page['PageId'].'" serverpath="'.BASE_PATH.'/" />';
+ }
}
return $res;
}
function ReadCmsTree($st_id, $level = 0)
{
$conn = GetADODbConnection();
$query = "SELECT value FROM config WHERE name = 'default_lang_prefix'";
$rs = $conn->Execute($query);
if ($rs && !$rs->EOF)
{
$default_lang_prefix = $rs->fields['value'];
$lang_prefix = GetLangFromSid();
}
$query = "SELECT value FROM config WHERE name = 'cms_direct_mode'";
$rs = $conn->Execute($query);
if ($rs && !$rs->EOF)
{
$cms_mode = $rs->fields['value'];
}
$query = "SELECT value FROM config WHERE name = 'email_templates_folder_id'";
$rs = $conn->Execute($query);
if ($rs && !$rs->EOF)
{
$email_templates_folder_id = $rs->fields['value'];
}
/*
$query = "SELECT value FROM config WHERE name = 'custom_cms'";
$rs = $conn->Execute($query);
if ($rs && !$rs->EOF)
{
$custom_cms = $rs->fields['value'];
}
*/
if (GetConfigValue('custom_cms')) {
$filter = 'AND st.st_name NOT IN (' . GetConfigValue('custom_cms') . ')';
}
else {
$filter = '';
}
if ( $email_templates_folder_id == "" ) $email_templates_folder_id = 0;
$system_tpl_ids = GetConfigValue('system_tpl_ids');
if (!$system_tpl_ids)
$system_tpl_ids = '0';
if ( $cms_mode == 1 ) {
$query = "
SELECT st.*,
IF(lb.".$lang_prefix."_content='' OR lb.".$lang_prefix."_content IS NULL,
st.st_path,
lb.".$lang_prefix."_content
) AS page_title
FROM
structure_templates AS st
LEFT JOIN
live_blocks AS lb
ON
(st.st_id = lb.template_id) AND (lb.block_type = 3)
WHERE st.st_parent_id = ".$st_id."
AND st_id != ".$email_templates_folder_id."
AND st.st_id NOT IN ($system_tpl_ids)
AND st_path != '/cms' " . $filter . "
ORDER BY st.st_order";
}
else {
$query = "
SELECT st.*,
IF(wb.".$default_lang_prefix."_content='' OR wb.".$default_lang_prefix."_content IS NULL,
st.st_path,
wb.".$default_lang_prefix."_content
) AS page_title
FROM
structure_templates AS st
LEFT JOIN
working_blocks AS wb
ON
(st.st_id = wb.template_id) AND (wb.block_type = 3)
WHERE
st.st_parent_id = ".$st_id."
AND st_id != ".$email_templates_folder_id."
AND st.st_id NOT IN ($system_tpl_ids)
AND st_path != '/cms%' " . $filter . "
ORDER BY st.st_order";
}
$rs = $conn->Execute($query);
if ($rs && !$rs->EOF)
{
while ($rs && !$rs->EOF)
{
$page_path = ltrim($rs->fields['st_path'], '/');
//$page_path = SERVER_NAME.BASE_PATH.'/index.php?t='.$page_path;
//$page_path = $page_path;
$prefix='';
for ($i = 0; $i < $level; $i++)
$prefix .= '--';
if ($level > 0)
$prefix=$prefix.'- ';
/*
$page = ereg_replace("&","&amp;",$rs->fields['page_title']);
$page = ereg_replace("\"","&quot;",$page);
$page = ereg_replace("'","&#039;",$page);
$page = ereg_replace("<","&lt;",$page);
$page = ereg_replace(">","&gt;",$page);
// echo $page." <br>";
//$page = htmlentities($rs->fields['page_title'],ENT_QUOTES);
$page = $rs->fields['page_title'];
$page = ereg_replace("&atilde;","a",$page);
*/
$page = $rs->fields['page_title'];
$page = @html_entity_decode($page,ENT_NOQUOTES,'UTF-8');
$page = @htmlspecialchars($page);
//$page = ereg_replace("&atilde;","a",$page);
$res .= '<CmsPage path="'.$page_path.'" title="'.$prefix.$page.'" st_id="'.$rs->fields['st_id'].'" serverpath="'.BASE_PATH.'/index.php?t=" />';
$res .= ReadCmsTree($rs->fields['st_id'], $level+1);
$rs->MoveNext();
}
return $res;
}
}
/*
$res .= '<CmsPage>
<path><![CDATA['.$page_path.']]></path>
<title><![CDATA['.$prefix.$page.']]></title>
<st_id><![CDATA['.$rs->fields['st_id'].']]></st_id>
<serverpath><![CDATA['.BASE_PATH.'/index.php?t=.]]></serverpath>
</CmsPage>';
*/
function GetConfigValue($var)
{
$conn = GetADODbConnection();
$query = "SELECT `value` FROM config WHERE `name` = '".$var."'";
return $conn->GetOne($query);
}
function GetFoldersAndFiles( $resourceType, $currentFolder, $aParams = array('name','asc'))
{
// Map the virtual path to the local server path.
if (isset($Config['K4Mode']))
$date_format = "m/d/Y h:i A";
else
$date_format = GetConfigValue('date_format').' '.GetConfigValue('time_format');
$sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ;
// Initialize the output buffers for "Folders" and "Files".
$aFolders = array();
$aFiles = array();
$aFileSizes = array();
$sFolders = '<Folders>' ;
$sFiles = '<Files>' ;
$oCurrentFolder = opendir( $sServerDir ) ;
while ( $sFile = readdir( $oCurrentFolder ) )
{
if ( $sFile != '.' && $sFile != '..' && $sFile != 'CVS')
{
if ( is_dir( $sServerDir . $sFile ) )
$aFolders[]=$sFile;
else
{
$iFileSize = filesize( $sServerDir . $sFile ) ;
//$iFileSize[] = filesize( $sServerDir . $sFile ) ;
if ( $iFileSize > 0 )
{
$size = round( $iFileSize / 1024 );
$aFileSizes[] = ($size < 1)? 1:$size;// round( $iFileSize / 1024 ) ;
} else
$aFileSizes[] = $iFileSize;
$aFiles[] = $sFile;
$aFileDate[] = filectime($sServerDir.$sFile);
//$sFiles .= '<File name="' . ConvertToXmlAttribute( $sFile ) . '" size="' . $iFileSize . '" />' ;
}
}
}
if (count($aFolders) > 0) {
natcasesort($aFolders);
switch ($aParams[1])
{
case 'desc' :
$aFolders = array_reverse($aFolders, true);
break ;
}
foreach($aFolders AS $k=>$v) {
$sFolders .= '<Folder name="' . ConvertToXmlAttribute($v) . '" />' ;
}
}
if (count($aFiles) > 0) {
if ($aParams[0] == 'name')
{
natcasesort($aFiles);
if ($aParams[1] == 'desc')
{
$aFiles = array_reverse($aFiles, true);
}
foreach($aFiles AS $fk=>$fv) {
$sFiles .= '<File name="' . ConvertToXmlAttribute( $fv ) . '" size="' . $aFileSizes[$fk] . '" date="' . date($date_format,$aFileDate[$fk]) . '" />' ;
}
}elseif ($aParams[0] == 'size') {
natcasesort($aFileSizes);
if ($aParams[1] == 'desc')
{
$aFileSizes = array_reverse($aFileSizes, true);
}
foreach($aFileSizes AS $fk=>$fv) {
$sFiles .= '<File name="' . ConvertToXmlAttribute( $aFiles[$fk] ) . '" size="' . $fv . '" date="' . date($date_format,$aFileDate[$fk]) . '" />' ;
}
} elseif ($aParams[0] == 'date') {
natcasesort($aFileDate);
if ($aParams[1] == 'desc')
{
$aFileDate = array_reverse($aFileDate, true);
}
foreach($aFileDate AS $fk=>$fv) {
$sFiles .= '<File name="' . ConvertToXmlAttribute( $aFiles[$fk] ) . '" size="' . $aFileSizes[$fk] . '" date="' . date($date_format,$fv) . '" />' ;
}
}
}
/* while ( $sFile = readdir( $oCurrentFolder ) )
{
if ( $sFile != '.' && $sFile != '..' && $sFile != 'CVS')
{
if ( is_dir( $sServerDir . $sFile ) )
//$sFolders .= '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ;
else
{
$iFileSize = filesize( $sServerDir . $sFile ) ;
if ( $iFileSize > 0 )
{
$iFileSize = round( $iFileSize / 1024 ) ;
if ( $iFileSize < 1 ) $iFileSize = 1 ;
}
$sFiles .= '<File name="' . ConvertToXmlAttribute( $sFile ) . '" size="' . $iFileSize . '" />' ;
}
}
*/
if ($aParams[1] == "desc")
{
echo $sFiles ;
echo '</Files>' ;
echo $sFolders ;
echo '</Folders>' ;
} else {
echo $sFolders ;
echo '</Folders>' ;
echo $sFiles ;
echo '</Files>' ;
}
}
function CreateFolder( $resourceType, $currentFolder )
{
$sErrorNumber = '0' ;
$sErrorMsg = '' ;
if ( isset( $_GET['NewFolderName'] ) )
{
$sNewFolderName = $_GET['NewFolderName'] ;
// Map the virtual path to the local server path of the current folder.
$sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ;
if ( is_writable( $sServerDir ) )
{
$sServerDir .= $sNewFolderName ;
$sErrorMsg = CreateServerFolder( $sServerDir ) ;
switch ( $sErrorMsg )
{
case '' :
$sErrorNumber = '0' ;
break ;
case 'Invalid argument' :
case 'No such file or directory' :
$sErrorNumber = '102' ; // Path too long.
break ;
default :
$sErrorNumber = '110' ;
break ;
}
}
else
$sErrorNumber = '103' ;
}
else
$sErrorNumber = '102' ;
// Create the "Error" node.
echo '<Error number="' . $sErrorNumber . '" originalDescription="' . ConvertToXmlAttribute( $sErrorMsg ) . '" />' ;
}
function UpdateCmsBlocksK3($resourceType,$currentFolder,$file_from,$file_to)
{ global $Config ;
$Config['UserFilesPathNoBase'];
$original_str = $Config['UserFilesPathNoBase'].$resourceType.$currentFolder.addslashes($file_from);
$new_str = $Config['UserFilesPathNoBase'].$resourceType.$currentFolder.addslashes($file_to);
$conn = GetADODbConnection();
if ( GetConfigValue('multilingual_mode') == 1) {
$query="SELECT lang_prefix FROM lang ORDER BY lang_id";
$rs = $conn->Execute($query);
while ($rs && !$rs->EOF) {
$sql = "UPDATE live_blocks SET ".$rs->fields['lang_prefix']."_content = replace(".$rs->fields['lang_prefix']."_content,'".$original_str."','".$new_str."')";
$conn->Execute($sql);
$rs->MoveNext();
}
} else {
$lang_prefix = GetConfigValue('default_lang_prefix');
$sql = "UPDATE live_blocks SET ".$lang_prefix."_content = replace(".$lang_prefix."_content,'".$original_str."','".$new_str."')";
$conn->Execute($sql);
}
}
function RenameFile( $resourceType, $currentFolder , $aFilenames = array())
{ global $Config ;
if (count($aFilenames) == 2)
{
$sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ;
$sExtension = substr( $aFilenames[1], ( strrpos($aFilenames[1], '.') + 1 ) ) ;
$arAllowed = $Config['AllowedExtensions'][$resourceType] ;
$arDenied = $Config['DeniedExtensions'][$resourceType] ;
if (file_exists($sServerDir.$aFilenames[1]) && is_file($sServerDir.$aFilenames[1]))
{
$sErrorNumber = '204' ;
} else {
if ( ( count($arAllowed) == 0 || in_array( $sExtension, $arAllowed ) ) && ( count($arDenied) == 0 || !in_array( $sExtension, $arDenied ) ) )
{
if (rename($sServerDir.$aFilenames[0],$sServerDir.$aFilenames[1])) {
if (isset($Config['K4Mode'])) {
// Update CMS Blocks
} else
UpdateCmsBlocksK3($resourceType,$currentFolder,$aFilenames[0],$aFilenames[1]);
$sErrorNumber = "0";
} else
$sErrorNumber = '205' ;
} else
$sErrorNumber = '203' ;
}
$sErrorMsg = '';
echo '<Error number="' . $sErrorNumber . '" originalDescription="' . ConvertToXmlAttribute( $sErrorMsg ) . '" />' ;
}
}
function FileUpload( $resourceType, $currentFolder )
{
$sErrorNumber = '0' ;
$sFileName = '' ;
if ( isset( $_FILES['NewFile'] ) && !is_null( $_FILES['NewFile']['tmp_name'] ) )
{
$oFile = $_FILES['NewFile'] ;
// Map the virtual path to the local server path.
$sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ;
// Get the uploaded file name.
$sFileName = $oFile['name'] ;
$sOriginalFileName = $sFileName ;
$sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ;
global $Config ;
$arAllowed = $Config['AllowedExtensions'][$resourceType] ;
$arDenied = $Config['DeniedExtensions'][$resourceType] ;
if ( ( count($arAllowed) == 0 || in_array( $sExtension, $arAllowed ) ) && ( count($arDenied) == 0 || !in_array( $sExtension, $arDenied ) ) )
{
$iCounter = 0 ;
while ( true )
{
$sFilePath = $sServerDir . $sFileName ;
if ( is_file( $sFilePath ) )
{
$iCounter++ ;
$sFileName = RemoveExtension( $sOriginalFileName ) . '(' . $iCounter . ').' . $sExtension ;
$sErrorNumber = '201' ;
}
else
{
move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ;
if ( is_file( $sFilePath ) )
{
$oldumask = umask(0) ;
chmod( $sFilePath, 0666 ) ;
umask( $oldumask ) ;
}
break ;
}
}
}
else
$sErrorNumber = '202' ;
}
else
$sErrorNumber = '202' ;
echo '<script type="text/javascript">' ;
echo 'window.parent.frames["frmUpload"].OnUploadCompleted(' . $sErrorNumber . ',"' . str_replace( '"', '\\"', $sFileName ) . '") ;' ;
echo '</script>' ;
exit ;
}
function DeleteConfirmedFiles($resourceType, $currentFolder, $aFiles)
{ global $Config;
$sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ;
foreach ($aFiles AS $k=>$v) {
@unlink($sServerDir.$v);
}
}
function DeleteFiles($resourceType, $currentFolder, $files = '', $confirm=0)
{ global $Config ;
if ($files == '')
return;
//$files = rtrim("|",$files);
$aFiles=explode("|",$files);
if (count($aFiles) == 0)
return;
$conn = GetADODbConnection();
$aLangs = array();
$multilang = GetConfigValue('multilingual_mode');
$def_lang_prefix = GetConfigValue('default_lang_prefix');
if ($multilang)
{
$query="SELECT lang_prefix FROM lang ORDER BY lang_id";
$rs = $conn->Execute($query);
while ($rs && !$rs->EOF) {
$aLangs[] = $rs->fields['lang_prefix'];
$rs->MoveNext();
}
} else
$aLangs[] = $def_lang_prefix;
$sErrorNumber = 230;
if ($confirm == 1) {
DeleteConfirmedFiles($resourceType, $currentFolder, $aFiles);
echo '<Error number="100" originalDescription="" />' ;
}
if (!$confirm) {
foreach ($aFiles AS $k=>$v) {
$add_sql = '';
if ($v == '')
continue;
$deleted_file = $Config['UserFilesPathNoBase'].$resourceType.$currentFolder.addslashes($v);
for($i=0; $i<count($aLangs); $i++)
$add_sql.= " lb1.".$aLangs[$i]."_content LIKE '%".$deleted_file."%' OR";
if (strlen($add_sql) > 0) {
$add_sql = rtrim($add_sql," OR");
$sql = "SELECT lb1.template_id, lb2.".$def_lang_prefix."_content FROM live_blocks AS lb1
LEFT JOIN live_blocks AS lb2 ON lb2.template_id = lb1.template_id AND lb2.block_num = 20
WHERE".$add_sql;
$rs = $conn->Execute($sql);
while ($rs && !$rs->EOF) {
$used = 1;
$page = $rs->fields[$def_lang_prefix.'_content'];
$page = @html_entity_decode($page,ENT_NOQUOTES,'UTF-8');
$page = @htmlspecialchars($page);
$ret_xml.= '<Error number="' . $sErrorNumber . '" originalDescription="' . ConvertToXmlAttribute("File '".$v."'; Template: '".$page."'") . '" />' ;
$rs->MoveNext();
}
}
}
if ($ret_xml && !$confirm)
echo $ret_xml;
if (!$ret_xml && !$confirm) {
DeleteConfirmedFiles($resourceType, $currentFolder, $aFiles);
echo '<Error number="100" originalDescription="" />' ;
}
}
}
function GetLangFromSid() {
$sid = $_COOKIE['admin_sid'];
$conn = GetADODbConnection();
$sql = "SELECT value FROM session_data WHERE name = 'old_translation_language' AND sid = $sid";
$translation_language = $conn->GetOne($sql);
return $translation_language;
}
?>
Property changes on: trunk/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/commands.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.48
\ No newline at end of property
+1.49
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/config.php
===================================================================
--- trunk/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/config.php (revision 7634)
+++ trunk/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/config.php (revision 7635)
@@ -1,62 +1,63 @@
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: config.php
* Configuration file for the File Manager Connector for PHP.
*
* Version: 2.0 RC3
* Modified: 2005-02-08 12:01:53
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
ini_set('display_errors', 0);
global $Config ;
// Path to user files relative to the document root.
// SECURITY TIP: Uncomment the following line to set a fixed path.
define('K3_FULL_PATH', dirname(realpath(__FILE__)));
define('K3_BASE_PATH', str_replace('/cmseditor/editor/filemanager/browser/default/connectors/php', '', ereg_replace($_SERVER['DOCUMENT_ROOT'], '', K3_FULL_PATH) ) );
$kernel3_config = $_SERVER['DOCUMENT_ROOT'].K3_BASE_PATH."/config/config.php";
if (file_exists($kernel3_config)) {
define('FULL_PATH', K3_FULL_PATH);
define('BASE_PATH', K3_BASE_PATH);
include_once($kernel3_config);
$Config['UserFilesPathNoBase'] = '/templates/UserFiles/' ;
$Config['UserFilesPath'] = BASE_PATH.'/templates/UserFiles/';
if (defined('SID_TYPE'))
$Config['validate_type'] = SID_TYPE;
else
$Config['validate_type'] = 'admin';
}
else {
- $fp = realpath(dirname(__FILE__).'/../../../../../../../../../');
+ $fp = realpath(dirname(__FILE__).'/../../../../../../../../');
define('FULL_PATH', $fp);
define('DEBUG_MODE', 0);
- define('REL_PATH', 'admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php');
+ define('DBG_SKIP_REPORTING', 1);
+ define('REL_PATH', 'core/cmseditor/editor/filemanager/browser/default/connectors/php');
$kernel4_startup = $fp."/core/kernel/startup.php";
$Config['K4Mode'] = 1;
include_once($kernel4_startup);
$Config['validate_type'] = 'admin';
}
$Config['AllowedExtensions']['Files'] = array('jpg','gif','jpeg','png','swf','fla','jpg','gif','jpeg','png','avi','mpg','mpeg','zip','rar','arj','gz','tar','doc','pdf','ppt','rdp','swf','swt','txt','vsd','xls','csv','odt') ;
$Config['DeniedExtensions']['Files'] = array('php','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','dll','reg') ;
$Config['AllowedExtensions']['Images'] = array('jpg','gif','jpeg','png', 'bmp') ;
$Config['DeniedExtensions']['Images'] = array('php','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','dll','reg');
$Config['AllowedExtensions']['Flash'] = array('swf','fla') ;
$Config['DeniedExtensions']['Flash'] = array('php','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','dll','reg') ;
$Config['AllowedExtensions']['Media'] = array('asf','asx','avi','wav','wax','wma','wm','wmv','m3u','mp2v','mpg','mpeg','m1v','mp2','mp3','mpa','mpe','mpv2','mp4','mid','midi','rmi','qt','aif','aifc','aiff','mov','flv','rm','svcd','swf','vcd') ;
$Config['DeniedExtensions']['Media'] = array('php','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','dll','reg');
$Config['AllowedExtensions']['Documents'] = array('doc','pdf','ppt','rdp','swf','swt','txt','vsd','xls','csv','zip','odt') ;
$Config['DeniedExtensions']['Documents'] = array('php','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','dll','reg');
?>
\ No newline at end of file
Property changes on: trunk/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.18
\ No newline at end of property
+1.19
\ No newline at end of property
Index: trunk/admin/install.php
===================================================================
--- trunk/admin/install.php (revision 7634)
+++ trunk/admin/install.php (revision 7635)
@@ -1,2035 +1,2036 @@
<?php
error_reporting(E_ALL);
set_time_limit(0);
ini_set('memory_limit', -1);
define('BACKUP_NAME', 'dump(.*).txt'); // how backup dump files are named
$general_error = '';
// new path detection without K4 init: begin
define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
define('BASE_PATH', rtrim(preg_replace('#/admin$#', '', str_replace('\\', '/', dirname($_SERVER['PHP_SELF']))), '/'));
$rootURL = 'http://'.$_SERVER['HTTP_HOST'].rtrim(BASE_PATH, '/').'/admin/';
// new path detection without K4 init: end
$pathtoroot = FULL_PATH.'/';
$admin = 'admin';
ini_set('include_path', '.');
if (!defined('IS_INSTALL')) define('IS_INSTALL',1);
if( file_exists($pathtoroot.'debug.php') && !(defined('DEBUG_MODE') && DEBUG_MODE) ) include_once($pathtoroot.'debug.php');
$state = isset($_GET["state"]) ? $_GET["state"] : '';
if(!strlen($state))
{
$state = isset($_POST['state']) ? $_POST['state'] : '';
}
if (!defined("GET_LICENSE_URL")) {
define("GET_LICENSE_URL", "http://www.intechnic.com/myaccount/license.php");
}
require_once $pathtoroot.$admin.'/install/install_lib.php';
$install_type = GetVar('install_type', true);
$force_finish = isset($_REQUEST['ff']) ? true : false;
$ini_file = $pathtoroot."config.php";
if(file_exists($ini_file))
{
$write_access = is_writable($ini_file);
$ini_vars = inst_parse_portal_ini($ini_file,TRUE);
foreach($ini_vars as $secname => $section)
{
foreach($section as $key => $value)
{
$key = "g_".str_replace('-', '', $key);
global $$key;
$$key = $value;
}
}
}
else
{
$state="";
$write_access = is_writable($pathtoroot);
if($write_access)
{
set_ini_value("Database", "DBType", "");
set_ini_value("Database", "DBHost", "");
set_ini_value("Database", "DBUser", "");
set_ini_value("Database", "DBUserPassword", "");
set_ini_value("Database", "DBName", "");
set_ini_value("Module Versions", "In-Portal", "");
save_values();
}
}
$titles[1] = "General Site Setup";
$configs[1] = "in-portal:configure_general";
$mods[1] = "In-Portal";
$titles[2] = "User Setup";
$configs[2] = "in-portal:configure_users";
$mods[2] = "In-Portal:Users";
$titles[3] = "Category Display Setup";
$configs[3] = "in-portal:configure_categories";
$mods[3] = "In-Portal";
// simulate rootURL variable: begin
$rootURL = 'http://'.dirname($_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']);
$tmp = explode('/', $rootURL);
if( $tmp[ count($tmp) - 1 ] == $admin) unset( $tmp[ count($tmp) - 1 ] );
$rootURL = implode('/', $tmp).'/';
unset($tmp);
//echo "RU: $rootURL<br>";
// simulate rootURL variable: end
$db_savings = Array('dbinfo', 'db_config_save', 'db_reconfig_save'); //, 'reinstall_process'
if( isset($g_DBType) && $g_DBType && strlen($state)>0 && !in_array($state, $db_savings) )
{
define('REL_PATH', 'admin');
require_once($pathtoroot."kernel/startup.php");
$localURL=$rootURL."kernel/";
$adminURL = $rootURL.$admin;
$imagesURL = $adminURL."/images";
//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_cookie(SESSION_COOKIE_NAME, '', adodb_mktime() - 3600, rtrim(BASE_PATH, '/') );
}
function GetPathChar($path = null)
{
if( !isset($path) ) $path = $GLOBALS['pathtoroot'];
$pos = strpos($path, ':');
return ($pos === false) ? "/" : "\\";
}
function SuperStrip($str, $inverse = false)
{
$str = $inverse ? str_replace("%5C","\\",$str) : str_replace("\\","%5C",$str);
return stripslashes($str);
}
$skip_step = false;
require_once($pathtoroot.$admin."/install/inst_ado.php");
$helpURL = $rootURL.$admin.'/help/install_help.php?destform=popup&help_usage=install';
?>
<html>
<head>
<title>In-Portal Installation</title>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Notepad">
<link rel="stylesheet" type="text/css" href="include/style.css">
<LINK REL="stylesheet" TYPE="text/css" href="install/2col.css">
<SCRIPT LANGUAGE="JavaScript1.2">
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function swap(imgid, src){
var ob = document.getElementById(imgid);
ob.src = 'images/' + src;
}
function Continue() {
document.iform1.submit();
}
function CreatePopup(window_name, url, width, height)
{
// creates a popup window & returns it
if(url == null && typeof(url) == 'undefined' ) url = '';
if(width == null && typeof(width) == 'undefined' ) width = 750;
if(height == null && typeof(height) == 'undefined' ) height = 400;
return window.open(url,window_name,'width='+width+',height='+height+',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no');
}
function ShowHelp(section)
{
var frm = document.getElementById('help_form');
frm.section.value = section;
frm.method = 'POST';
CreatePopup('HelpPopup','<?php echo $rootURL.$admin; ?>/help/blank.html'); // , null, 600);
frm.target = 'HelpPopup';
frm.submit();
}
</SCRIPT>
</head>
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" style="height: 100%">
<form name="help_form" id="help_form" action="<?php echo $helpURL; ?>" method="post"><input type="hidden" id="section" name="section" value=""></form>
<form enctype="multipart/form-data" name="iform1" id="iform1" method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
<tr>
<td height="90">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="90">
<tr>
<td rowspan="3" valign="top"><a href="http://www.in-portal.net" target="_top"><img title="In-portal" src="images/globe.gif" width="84" height="91" border="0"></a></td>
<td rowspan="3" valign="top"><a href="http://www.in-portal.net" target="_top"><img title="In-portal" src="images/logo.gif" width="150" height="91" border="0"></a></td>
<td rowspan="3" width="100000" align="right">&nbsp;</td>
<td width="400"><img title="" src="images/blocks.gif" width="400" height="73"></td>
</tr>
<tr><td align="right" background="images/version_bg.gif" class="head_version" valign="top"><img title="" src="images/spacer.gif" width="1" height="14">In-Portal Version <?php echo GetMaxPortalVersion($pathtoroot.$admin)?>: English US</td></tr>
<tr><td><img title="" src="images/blocks2.gif" width="400" height="2"><br></td></tr>
<tr><td bgcolor="black" colspan="4"><img title="" src="images/spacer.gif" width="1" height="1"><br></td></tr>
</table>
</td>
</tr>
<?php
require_once($pathtoroot."kernel/include/adodb/adodb.inc.php");
if(!strlen($state))
$state = @$_POST["state"];
//echo $state;
if(strlen($state)==0)
{
$ado =& inst_GetADODBConnection();
$installed = $ado ? TableExists($ado,"ConfigurationAdmin,Category,Permissions") : false;
if(!minimum_php_version("4.1.2"))
{
$general_error = "You have version ".phpversion()." - please upgrade!";
//die();
}
if(!$write_access)
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "Install cannot write to config.php in the root directory of your in-portal installation ($pathtoroot).";
//die();
}
if(!is_writable($pathtoroot."themes/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's Theme directory must be writable (".$pathtoroot."themes/).";
//die();
}
if(!is_writable($pathtoroot."kernel/images/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's Image Upload directory must be writable (".$pathtoroot."kernel/images/).";
//die();
}
if(!is_writable($pathtoroot."kernel/images/pending"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's Pending Image Upload directory must be writable (".$pathtoroot."kernel/images/pending).";
//die();
}
if(!is_writable($pathtoroot."admin/backupdata/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's Backup directory must be writable (".$pathtoroot."admin/backupdata/).";
//die();
}
if(!is_writable($pathtoroot."admin/export/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's Export directory must be writable (".$pathtoroot."admin/export/).";
//die();
}
if(!is_writable($pathtoroot."kernel/stylesheets/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's stylesheets directory must be writable (".$pathtoroot."kernel/stylesheets/).";
//die();
}
if(!is_writable($pathtoroot."kernel/user_files/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's CMS images directory must be writable (".$pathtoroot."kernel/user_files/).";
//die();
}
if(!is_writable($pathtoroot."kernel/cache/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's templates cache directory must be writable (".$pathtoroot."kernel/cache/).";
//die();
}
if($installed)
{
$state="reinstall";
}
else {
$state="dbinfo";
}
}
if($state=="reinstall_process")
{
$login_err_mesg = ''; // always init vars before use
if( !isset($g_License) ) $g_License = '';
$lic = base64_decode($g_License);
if(strlen($lic))
{
a83570933e44bc66b31dd7127cf3f23a($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
$LoggedIn = FALSE;
if($_POST["UserName"]=="root")
{
$ado =& inst_GetADODBConnection();
$sql = "SELECT * FROM ".$g_TablePrefix."ConfigurationValues WHERE VariableName='RootPass'";
$rs = $ado->Execute($sql);
if($rs && !$rs->EOF)
{
$RootPass = $rs->fields["VariableValue"];
if(strlen($RootPass)>0) {
if (ConvertVersion($g_InPortal) >= ConvertVersion("1.3.0")) {
$LoggedIn = ($RootPass==md5(md5($_POST["UserPass"]).'b38'));
}
else {
$LoggedIn = ($RootPass==md5($_POST["UserPass"]));
}
}
}
else {
$login_err_mesg = 'Invalid username or password';
}
}
else
{
$act = '';
if (ConvertVersion($g_InPortal) >= ConvertVersion("1.0.5")) {
$act = 'check';
}
$rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['UserName'])."&password=".md5($_POST['UserPass'])."&action=$act&license_code=".base64_encode($g_LicenseCode)."&version=".GetMaxPortalVersion($pathtoroot.$admin)."&domain=".base64_encode($_SERVER['HTTP_HOST']), "r");
if (!$rfile) {
$login_err_mesg = "Unable to connect to the Intechnic server!";
$LoggedIn = false;
}
else {
$rcontents = '';
while (!feof($rfile)) {
$line = fgets($rfile, 10000);
$rcontents .= $line;
}
@fclose($rfile);
if (substr($rcontents, 0, 5) == 'Error') {
$login_err_mesg = substr($rcontents, 6);
$LoggedIn = false;
}
else {
$LoggedIn = true;
}
}
//$LoggedIn = ($i_User == $_POST["UserName"] && ($i_Pswd == $_POST["UserPass"]) && strlen($i_User)>0) || strlen($i_User)==0;
}
if($LoggedIn)
{
if (!(int)$_POST["inp_opt"]) {
$state="reinstall";
$inst_error = "Please select one of the options above!";
}
else {
switch((int)$_POST["inp_opt"])
{
case 0:
$inst_error = "Please select an option above";
break;
case 1:
/* clean out all tables */
$install_type = 4;
$ado =& inst_GetADODBConnection();
$filename = $pathtoroot.$admin."/install/inportal_remove.sql";
RunSchemaFile($ado,$filename);
// removing other tables
$tables = $ado->MetaTables();
foreach($tables as $tab_name) {
if (stristr($tab_name, $g_TablePrefix."ses_")) {
$sql = "DROP TABLE IF EXISTS $tab_name";
$ado->Execute($sql);
}
}
/* run install again */
$state="license";
break;
case 2:
$install_type = 3;
$state="dbinfo";
break;
case 3:
$install_type = 5;
$state="license";
break;
case 4:
$install_type = 6;
/* clean out all tables */
$ado =& inst_GetADODBConnection();
//$filename = $pathtoroot.$admin."/install/inportal_remove.sql";
//RunSchemaFile($ado,$filename);
/* run install again */
$state="restore_select";
break;
case 5:
$install_type = 7;
/* change DB config */
$state="db_reconfig";
break;
case 6:
$install_type = 8;
$state = "upgrade";
break;
case 7:
$install_type = 9;
$state = "fix_paths";
break;
}
}
}
else
{
$state="reinstall";
$login_error = $login_err_mesg;//"Invalid Username or Password - Try Again";
}
}
if ($state == "upgrade") {
$ado =& inst_GetADODBConnection();
$Modules = array();
$Texts = array();
if (ConvertVersion(GetMaxPortalVersion($pathtoroot.$admin)) >= ConvertVersion("1.0.5") && ($g_LicenseCode == '' && $g_License != '')) {
$state = 'reinstall';
$inst_error = "Your license must be updated before you can upgrade. Please don't use 'Existing License' option, instead either Download from Intechnic or Upload a new license file!";
}
else {
$sql = "SELECT Name, Version, Path FROM ".$g_TablePrefix."Modules ORDER BY LoadOrder asc";
$rs = $ado->Execute($sql);
$i = 0;
while ($rs && !$rs->EOF) {
$p = $rs->fields['Path'];
if ($rs->fields['Name'] == 'In-Portal') {
$p = '';
}
$dir_name = $pathtoroot.$p."admin";///install/upgrades/";
if($rs->fields['Version'] != $newver = GetMaxPortalVersion($dir_name))
{
////////////////////
$mod_path = $rs->fields['Path'];
$current_version = $rs->fields['Version'];
if ($rs->fields['Name'] == 'In-Portal') $mod_path = '';
$dir_name = $pathtoroot.$mod_path."/admin/install/upgrades/";
$dir = @dir($dir_name);
if (!$dir) {
$rs->MoveNext();
continue;
}
$upgrades_arr = Array();
$new_version = '';
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) {
if (strstr($file, 'inportal_check_v')) {
$upgrades_arr[] = $file;
}
}
}
usort($upgrades_arr, "VersionSort");
$result=0;
$failCheck=1;
$stopCheck=2;
$CheckErrors = Array();
foreach($upgrades_arr as $file)
{
$file_tmp = str_replace("inportal_check_v", "", $file);
$file_tmp = str_replace(".php", "", $file_tmp);
if (ConvertVersion($file_tmp) > ConvertVersion($current_version)) {
$filename = $pathtoroot.$mod_path."/admin/install/upgrades/$file";
if(file_exists($filename))
{
include($filename);
if( $result & 2 ) break;
}
}
}
////////////////////
$Modules[] = Array('module'=>$rs->fields['Name'],'curver'=>$rs->fields['Version'],'newver'=>$newver,'error'=>$result!='pass');
// $Texts[] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".GetMaxPortalVersion($dir_name).")";
}
/*$dir = @dir($dir_name);
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file))
{
if (strstr($file, 'inportal_upgrade_v')) {
$file = str_replace("inportal_upgrade_v", "", $file);
$file = str_replace(".sql", "", $file);
//$sql = "SELECT count(*) AS count FROM ".$g_TablePrefix."Modules WHERE Name = '".$rs->fields['Name']."' AND Version = '$file'";
//$rs1 = $ado->Execute($sql);
if ($rs1->fields['count'] == 0 && ConvertVersion($file) > ConvertVersion($rs->fields['Version'])) {
if ($Modules[$i-1] == $rs->fields['Name']) {
$Texts[$i-1] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".$file.")";
$i--;
}
else {
$Texts[$i] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".$file.")";
$Modules[$i] = $rs->fields['Name'];
}
$i++;
}
}
}
}*/
$rs->MoveNext();
}
$sql = 'DELETE FROM '.$g_TablePrefix.'Cache WHERE VarName IN ("config_files","configs_parsed","sections_parsed")';
$ado->Execute($sql);
$include_file = $pathtoroot.$admin."/install/upgrade.php";
}
}
if ($state == "upgrade_process") {
// K4 applition is now always available during upgrade process
if (!defined('FULL_PATH')) {
define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
}
include_once(FULL_PATH.'/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
// force rereading of configs
$unit_config_reader =& $application->recallObject('kUnitConfigReader');
$unit_config_reader->scanModules(MODULES_PATH);
$ado =& inst_GetADODBConnection();
$mod_arr = $_POST['modules'];
$mod_str = '';
foreach ($mod_arr as $tmp_mod) {
$mod_str .= "'$tmp_mod',";
}
$mod_str = substr($mod_str, 0, strlen($mod_str) - 1);
$sql = "SELECT Name FROM ".$g_TablePrefix."Modules WHERE Name IN ($mod_str) ORDER BY LoadOrder";
$rs = $ado->Execute($sql);
$mod_arr = array();
while ($rs && !$rs->EOF) {
$mod_arr[] = $rs->fields['Name'];
$rs->MoveNext();
}
foreach($mod_arr as $p)
{
$mod_name = strtolower($p);
$sql = "SELECT Version, Path FROM ".$g_TablePrefix."Modules WHERE Name = '$p'";
$rs = $ado->Execute($sql);
$current_version = $rs->fields['Version'];
if ($mod_name == 'in-portal') {
$mod_path = '';
}
else {
$mod_path = $rs->fields['Path'];
}
$dir_name = $pathtoroot.$mod_path."/admin/install/upgrades/";
$dir = @dir($dir_name);
$upgrades_arr = Array();
$new_version = '';
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) {
if (strstr($file, 'inportal_upgrade_v')) {
$upgrades_arr[] = $file;
}
}
}
usort($upgrades_arr, "VersionSort");
foreach($upgrades_arr as $file)
{
preg_match('/inportal_upgrade_v(.*).(php|sql)$/', $file, $rets);
$tmp_version = $rets[1];
$tmp_extension = $rets[2];
if (ConvertVersion($tmp_version) > ConvertVersion($current_version) )
{
$filename = $pathtoroot.$mod_path."/admin/install/upgrades/$file";
//echo "Running: $filename<br>";
// SQL is processed FIRST (before corresponding PHP according to the sorting order in VersionSort()
if( file_exists($filename) )
{
if($tmp_extension == 'sql')
{
RunSQLFile($ado, $filename);
}
else
{
include_once $filename;
}
}
}
}
set_ini_value("Module Versions", $p, GetMaxPortalVersion($pathtoroot.$mod_path."/admin/"));
save_values();
}
// compile stylesheets: begin
define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
include_once(FULL_PATH.'/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
$objThemes->CreateMissingThemes(false);
$css_hash = $application->Conn->GetCol('SELECT LOWER(Name) AS Name, StylesheetId FROM '.TABLE_PREFIX.'Stylesheets', 'StylesheetId');
$css_table = $application->getUnitOption('css','TableName');
$css_idfield = $application->getUnitOption('css','IDField');
$theme_table = $application->getUnitOption('theme', 'TableName');
$theme_idfield = $application->getUnitOption('theme', 'IDField');
$theme_update_sql = 'UPDATE '.$theme_table.' SET '.$css_idfield.' = %s WHERE LOWER(Name) = %s';
foreach($css_hash as $stylesheet_id => $theme_name)
{
$css_item =& $application->recallObject('css', null, Array('skip_autoload' => true));
$css_item->Load($stylesheet_id);
$css_item->Compile();
$application->Conn->Query( sprintf($theme_update_sql, $stylesheet_id, $application->Conn->qstr( getArrayValue($css_hash,$stylesheet_id) ) ) );
}
// do redirect, because upgrade scripts can eat a lot or memory used for language pack upgrade operation
$application->Redirect('install', Array('state' => 'languagepack_upgrade'), '', 'install.php');
// compile stylesheets: end
$state = 'languagepack_upgrade';
}
// upgrade language pack
if($state=='languagepack_upgrade')
{
$state = 'lang_install_init';
if( is_object($application) ) $application->SetVar('lang', Array('english.lang') );
$force_finish = true;
}
if ($state == 'fix_paths') {
$ado = inst_GetADODBConnection();
$sql = "SELECT * FROM ".$g_TablePrefix."ConfigurationValues WHERE VariableName = 'Site_Name' OR VariableName LIKE '%Path%'";
$path_rs = $ado->Execute($sql);
$include_file = $pathtoroot.$admin."/install/fix_paths.php";
}
if ($state == 'fix_paths_process') {
$ado = inst_GetADODBConnection();
//$state = 'fix_paths';
//$include_file = $pathtoroot.$admin."/install/fix_paths.php";
foreach($_POST["values"] as $key => $value) {
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '".$value."' WHERE VariableName = '".$key."'";
$ado->Execute($sql);
}
$state = "finish";
}
if($state=="db_reconfig_save")
{
$ini_vars = inst_parse_portal_ini($ini_file,TRUE);
foreach($ini_vars as $secname => $section)
{
foreach($section as $key => $value)
{
$key = "g_".str_replace("-", "", $key);
global $$key;
$$key = $value;
}
}
unset($ado);
$ado = VerifyDB('db_reconfig', 'finish', 'SaveDBConfig', true);
}
if($state=="db_reconfig")
{
$include_file = $pathtoroot.$admin."/install/db_reconfig.php";
}
if($state=="restore_file")
{
if($_POST["submit"]=="Update")
{
$filepath = $_POST["backupdir"];
$state="restore_select";
}
else
{
$filepath = stripslashes($_POST['backupdir']);
$backupfile = $filepath.$path_char.str_replace('(.*)', $_POST['backupdate'], BACKUP_NAME);
if(file_exists($backupfile) && is_readable($backupfile))
{
$ado =& inst_GetADODBConnection();
$show_warning = false;
if (!$_POST['warning_ok']) {
// Here we comapre versions between backup and config
$file_contents = file_get_contents($backupfile);
$file_tmp_cont = explode("#------------------------------------------", $file_contents);
$tmp_vers = $file_tmp_cont[0];
$vers_arr = explode(";", $tmp_vers);
$ini_values = inst_parse_portal_ini($ini_file);
foreach ($ini_values as $key => $value) {
foreach ($vers_arr as $k) {
if (strstr($k, $key)) {
if (!strstr($k, $value)) {
$show_warning = true;
}
}
}
}
//$show_warning = true;
}
if (!$show_warning) {
$filename = $pathtoroot.$admin.$path_char.'install'.$path_char.'inportal_remove.sql';
RunSchemaFile($ado,$filename);
$state="restore_run";
}
else {
$state = "warning";
$include_file = $pathtoroot.$admin."/install/warning.php";
}
}
else {
if ($_POST['backupdate'] != '') {
$include_file = $pathtoroot.$admin."/install/restore_select.php";
$restore_error = "$backupfile not found or could not be read";
}
else {
$include_file = $pathtoroot.$admin."/install/restore_select.php";
$restore_error = "No backup selected!!!";
}
}
}
//echo $restore_error;
}
if($state=="restore_select")
{
if( isset($_POST['backupdir']) ) $filepath = stripslashes($_POST['backupdir']);
$include_file = $pathtoroot.$admin."/install/restore_select.php";
}
if($state=="restore_run")
{
$ado =& inst_GetADODBConnection();
$FileOffset = (int)$_GET["Offset"];
if(!strlen($backupfile))
$backupfile = SuperStrip($_GET['File'], true);
$include_file = $pathtoroot.$admin."/install/restore_run.php";
}
if($state=="db_config_save")
{
set_ini_value("Database", "DBType",$_POST["ServerType"]);
set_ini_value("Database", "DBHost",$_POST["ServerHost"]);
set_ini_value("Database", "DBName",$_POST["ServerDB"]);
set_ini_value("Database", "DBUser",$_POST["ServerUser"]);
set_ini_value("Database", "DBUserPassword",$_POST["ServerPass"]);
set_ini_value("Database","TablePrefix",$_POST["TablePrefix"]);
save_values();
$ini_vars = inst_parse_portal_ini($ini_file,TRUE);
foreach($ini_vars as $secname => $section)
{
foreach($section as $key => $value)
{
$key = "g_".str_replace("-", "", $key);
global $$key;
$$key = $value;
}
}
unset($ado);
$ado = VerifyDB('dbinfo', 'license');
}
if($state=="dbinfo")
{
if ($install_type == '') {
$install_type = 1;
}
$include_file = $pathtoroot.$admin."/install/dbinfo.php";
}
if ($state == "download_license") {
$ValidLicense = FALSE;
$lic_login = isset($_POST['login']) ? $_POST['login'] : '';
$lic_password = isset($_POST['password']) ? $_POST['password'] : '';
if ($lic_login != '' && $lic_password != '') {
// Here we determine weather login is ok & check available licenses
$rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['login'])."&password=".md5($_POST['password'])."&version=".GetMaxPortalVersion($pathtoroot.$admin)."&domain=".base64_encode($_SERVER['HTTP_HOST']), "r");
if (!$rfile) {
$get_license_error = "Unable to connect to the Intechnic server! Please try again later!";
$state = "get_license";
$include_file = $pathtoroot.$admin."/install/get_license.php";
}
else {
$rcontents = '';
while (!feof($rfile)) {
$line = fgets($rfile, 10000);
$rcontents .= $line;
}
@fclose($rfile);
if (substr($rcontents, 0, 5) == 'Error') {
$get_license_error = substr($rcontents, 6);
$state = "get_license";
$include_file = $pathtoroot.$admin."/install/get_license.php";
}
else {
if (substr($rcontents, 0, 3) == "SEL") {
$state = "download_license";
$license_select = substr($rcontents, 4);
$include_file = $pathtoroot.$admin."/install/download_license.php";
}
else {
// Here we get one license
$tmp_data = explode('Code==:', $rcontents);
$data = base64_decode(str_replace("In-Portal License File - do not edit!\n", "", $tmp_data[0]));
a83570933e44bc66b31dd7127cf3f23a($data);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
{
set_ini_value("Intechnic","License",base64_encode($data));
set_ini_value("Intechnic","LicenseCode",$tmp_data[1]);
save_values();
$state="domain_select";
$got_license = 1;
}
else {
$license_error="Invalid License File";
}
if(!$ValidLicense)
{
$state="license";
}
}
}
}
}
else if ($_POST['licenses'] == '') {
$state = "get_license";
$get_license_error = "Username and / or password not specified!!!";
$include_file = $pathtoroot.$admin."/install/get_license.php";
}
else {
// Here we download license
$rfile = @fopen(GET_LICENSE_URL."?license_id=".md5($_POST['licenses'])."&dlog=".md5($_POST['dlog'])."&dpass=".md5($_POST['dpass'])."&version=".GetMaxPortalVersion($pathtoroot.$admin)."&domain=".base64_encode($_POST['domain']), "r");
if (!$rfile) {
$get_license_error = "Unable to connect to the Intechnic server! Please try again later!";
$state = "get_license";
$include_file = $pathtoroot.$admin."/install/get_license.php";
}
else {
$rcontents = '';
while (!feof($rfile)) {
$line = fgets($rfile, 10000);
$rcontents .= $line;
}
@fclose($rfile);
if (substr($rcontents, 0, 5) == 'Error') {
$download_license_error = substr($rcontents, 6);
$state = "download_license";
$include_file = $pathtoroot.$admin."/install/download_license.php";
}
else {
$tmp_data = explode('Code==:', $rcontents);
$data = base64_decode(str_replace("In-Portal License File - do not edit!\n", "", $tmp_data[0]));
a83570933e44bc66b31dd7127cf3f23a($data);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
{
set_ini_value("Intechnic","License",base64_encode($data));
// old licensing script doen't return 2nd parameter (licanse code)
if( isset($tmp_data[1]) ) set_ini_value("Intechnic","LicenseCode",$tmp_data[1]);
save_values();
$state="domain_select";
}
else {
$license_error="Invalid License File";
}
if(!$ValidLicense)
{
$state="license";
}
}
}
}
}
if($state=="license_process")
{
$ValidLicense = FALSE;
$tmp_lic_opt = GetVar('lic_opt', true);
switch($tmp_lic_opt)
{
case 1: /* download from intechnic */
$include_file = $pathtoroot.$admin."/install/get_license.php";
$state = "get_license";
//if(!$ValidLicense)
//{
// $state="license";
//}
break;
case 2: /* upload file */
$file = $_FILES["licfile"];
if(is_array($file))
{
move_uploaded_file($file["tmp_name"],$pathtoroot."themes/tmp.lic");
@chmod($pathtoroot."themes/tmp.lic", 0666);
$fp = @fopen($pathtoroot."themes/tmp.lic","rb");
if($fp)
{
$lic = fread($fp,filesize($pathtoroot."themes/tmp.lic"));
fclose($fp);
}
$tmp_data = ae666b1b8279502f4c4b570f133d513e(FALSE,$pathtoroot."themes/tmp.lic");
$data = $tmp_data[0];
@unlink($pathtoroot."themes/tmp.lic");
a83570933e44bc66b31dd7127cf3f23a($data);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
{
set_ini_value("Intechnic","License",base64_encode($data));
set_ini_value("Intechnic","LicenseCode",$tmp_data[1]);
save_values();
$state="domain_select";
}
else
$license_error="Invalid License File";
}
if(!$ValidLicense)
{
$state="license";
}
break;
case 3: /* existing */
if(strlen($g_License))
{
$lic = base64_decode($g_License);
a83570933e44bc66b31dd7127cf3f23a($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
{
$state="domain_select";
}
else
{
$state="license";
$license_error="Invalid or corrupt license detected";
}
}
else
{
$state="license";
$license_error="Missing License File";
}
if(!$ValidLicense)
{
$state="license";
}
break;
case 4:
//set_ini_value("Intechnic","License",base64_encode("local"));
//set_ini_value("Intechnic","LicenseCode",base64_encode("local"));
//save_values();
$state="domain_select";
break;
}
if($ValidLicense)
$state="domain_select";
}
if($state=="license")
{
$include_file = $pathtoroot.$admin."/install/sel_license.php";
}
if($state=="reinstall")
{
$ado =& inst_GetADODBConnection();
$show_upgrade = false;
$sql = "SELECT Name FROM ".$g_TablePrefix."Modules";
$rs = $ado->Execute($sql);
$modules = '';
while ($rs && !$rs->EOF) {
$modules .= strtolower($rs->fields['Name']).',';
$rs->MoveNext();
}
$mod_arr = explode(",", substr($modules, 0, strlen($modules) - 1));
foreach($mod_arr as $p)
{
if ($p == 'in-portal') {
$p = '';
}
$dir_name = $pathtoroot.$p."/admin/install/upgrades/";
$dir = @dir($dir_name);
//echo "<pre>"; print_r($dir); echo "</pre>";
if ($dir === false) continue;
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file))
{
if( preg_match('/inportal_upgrade_v(.*).(php|sql)$/', $file, $rets) )
{
if($p == '') $p = 'in-portal';
$sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = '".$p."'";
$rs = $ado->Execute($sql);
if( ConvertVersion($rs->fields['Version']) < ConvertVersion( $rets[1] ) )
{
$show_upgrade = true;
}
}
}
}
}
if ( !isset($install_type) || $install_type == '') {
$install_type = 2;
}
$include_file = $pathtoroot.$admin."/install/reinstall.php";
}
if($state=="login")
{
$lic = base64_decode($g_License);
if(strlen($lic))
{
a83570933e44bc66b31dd7127cf3f23a($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
if(!$ValidLicense)
{
$state="license";
}
else
if($i_User == $_POST["UserName"] || $i_Pswd == $_POST["UserPass"])
{
$state = "domain_select";
}
else
{
$state="getuser";
$login_error = "Invalid User Name or Password. If you don't know your username or password, contact Intechnic Support";
}
//die();
}
if($state=="getuser")
{
$include_file = $pathtoroot.$admin."/install/login.php";
}
if($state=="set_domain")
{
if( !is_array($i_Keys) || !count($i_Keys) )
{
$lic = base64_decode($g_License);
if(strlen($lic))
{
a83570933e44bc66b31dd7127cf3f23a($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
}
if($_POST["domain"]==1)
{
$domain = $_SERVER['HTTP_HOST'];
if (strstr($domain, $i_Keys[0]['domain']) || de3ec1b7a142cccd0d51f03d24280744($domain)) {
set_ini_value("Intechnic","Domain",$domain);
save_values();
$state="runsql";
}
else {
$DomainError = 'Domain name selected does not match domain name in the license!';
$state = "domain_select";
}
}
else
{
$domain = str_replace(" ", "", $_POST["other"]);
if ($domain != '') {
if (strstr($domain, $i_Keys[0]['domain']) || de3ec1b7a142cccd0d51f03d24280744($domain)) {
set_ini_value("Intechnic","Domain",$domain);
save_values();
$state="runsql";
}
else {
$DomainError = 'Domain name entered does not match domain name in the license!';
$state = "domain_select";
}
}
else {
$DomainError = 'Please enter valid domain!';
$state = "domain_select";
}
}
}
if($state=="domain_select")
{
if(!is_array($i_Keys))
{
$lic = base64_decode($g_License);
if(strlen($lic))
{
a83570933e44bc66b31dd7127cf3f23a($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
}
$include_file = $pathtoroot.$admin."/install/domain.php";
}
if($state=="runsql")
{
$ado =& inst_GetADODBConnection();
$installed = TableExists($ado,"ConfigurationAdmin,Category,Permissions");
if(!$installed)
{
// run core install script
K4_RunSQL('/core/install/install_schema.sql');
K4_RunSQL('/core/install/install_data.sql');
-
+ K4_SetModuleVersion('Core');
+
// run in-portal install script
$filename = $pathtoroot.$admin."/install/inportal_schema.sql";
RunSchemaFile($ado,$filename);
$filename = $pathtoroot.$admin."/install/inportal_data.sql";
RunSQLFile($ado,$filename);
$sql = 'UPDATE '.$g_TablePrefix.'ConfigurationValues SET VariableValue = %s WHERE VariableName = %s';
$ado->Execute( sprintf($sql, $ado->qstr('portal@'.$ini_vars['Intechnic']['Domain']), $ado->qstr('Smtp_AdminMailFrom') ) );
$sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = 'In-Portal'";
$rs = $ado->Execute($sql);
set_ini_value("Module Versions", "In-Portal", $rs->fields['Version']);
save_values();
require_once $pathtoroot.'kernel/include/tag-class.php';
if( !is_object($objTagList) ) $objTagList = new clsTagList();
// install kernel specific tags
$objTagList->DeleteTags(); // delete all existing tags in db
// create 3 predifined tags (because there no functions with such names
$t = new clsTagFunction();
$t->Set("name","include");
$t->Set("description","insert template output into the current template");
$t->Create();
$t->AddAttribute("_template","tpl","Template to insert","",TRUE);
$t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE);
$t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE);
$t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
unset($t);
$t = new clsTagFunction();
$t->Set("name","perm_include");
$t->Set("description","insert template output into the current template if permissions are set");
$t->Create();
$t->AddAttribute("_template","tpl","Template to insert","",TRUE);
$t->AddAttribute("_noaccess","tpl","Template to insert if access is denied","",FALSE);
$t->AddAttribute("_permission","","Comma-separated list of permissions, any of which will grant access","",FALSE);
$t->AddAttribute("_module","","Used in place of the _permission attribute, this attribute verifies the module listed is enabled","",FALSE);
$t->AddAttribute("_system","bool","Must be set to true if any permissions in _permission list is a system permission","",FALSE);
$t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE);
$t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE);
$t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
unset($t);
$t = new clsTagFunction();
$t->Set("name","mod_include");
$t->Set("description","insert templates from all enabled modules. No error occurs if the template does not exist.");
$t->Create();
$t->AddAttribute("_template","tpl","Template to insert. This template path should be relative to the module template root directory","",TRUE);
$t->AddAttribute("_modules","","Comma-separated list of modules. Defaults to all enabled modules if not set","",FALSE);
$t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE);
$t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE);
$t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
$objTagList->ParseFile($pathtoroot.'kernel/parser.php'); // insert module tags
if( is_array($ItemTagFiles) )
foreach($ItemTagFiles as $file)
$objTagList->ParseItemFile($pathtoroot.$file);
$state="RootPass";
}
else {
$include_file = $pathtoroot.$admin."/install/install_finish.php";
$state="finish";
}
}
if($state=="RootSetPass")
{
$pass = $_POST["RootPass"];
if(strlen($pass)<4)
{
$PassError = "Root Password must be at least 4 characters";
$state = "RootPass";
}
else if ($pass != $_POST["RootPassConfirm"]) {
$PassError = "Passwords does not match";
$state = "RootPass";
}
else
{
$pass = md5(md5($pass).'b38');
$sql = ' UPDATE '.$g_TablePrefix.'ConfigurationValues
SET VariableValue = '.$ado->qstr($pass).'
WHERE VariableName = "RootPass";';
$ado =& inst_GetADODBConnection();
$ado->Execute($sql);
$state="modselect";
}
}
if($state=="RootPass")
{
$include_file = $pathtoroot.$admin."/install/rootpass.php";
}
if($state=="lang_install_init")
{
$ado =& inst_GetADODBConnection();
if( TableExists($ado, 'Language,Phrase') )
{
// KERNEL 4 INIT: BEGIN
define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
include_once(FULL_PATH.'/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
// KERNEL 4 INIT: END
$lang_xml =& $application->recallObject('LangXML');
if (defined('DBG_FAST_INSTALL') && DBG_FAST_INSTALL) {
$lang_xml->tables['phrases'] = TABLE_PREFIX.'Phrase';
$lang_xml->tables['emailmessages'] = TABLE_PREFIX.'EmailMessage';
}
else {
$lang_xml->renameTable('phrases', TABLE_PREFIX.'ImportPhrases');
$lang_xml->renameTable('emailmessages', TABLE_PREFIX.'ImportEvents');
}
$lang_xml->lang_object->TableName = $application->getUnitOption('lang','TableName');
$languages = $application->GetVar('lang');
if($languages)
{
$kernel_db =& $application->GetADODBConnection();
$modules_table = $application->getUnitOption('mod','TableName');
$modules = $kernel_db->GetCol('SELECT Path, Name FROM '.$modules_table, 'Name');
$modules['In-Portal'] = '';
foreach($languages as $lang_file)
{
foreach($modules as $module_name => $module_folder)
{
$lang_path = MODULES_PATH.'/'.$module_folder.'admin/install/langpacks';
$lang_xml->Parse($lang_path.'/'.$lang_file, '|0|1|2|', '');
if($force_finish) $lang_xml->lang_object->Update();
}
}
if (defined('DBG_FAST_INSTALL') && DBG_FAST_INSTALL) {
$state = 'lang_default';
}
else {
$state = 'lang_install';
}
}
else
{
$state = 'lang_select';
}
$application->Done();
}
else
{
$general_error = 'Database error! No language tables found!';
}
}
if($state=="lang_install")
{
define('FORCE_CONFIG_CACHE', 1);
/* do pack install */
$Offset = (int)$_GET["Offset"];
$Status = (int)$_GET["Status"];
$PhraseTable = $g_TablePrefix."ImportPhrases";
$EventTable = $g_TablePrefix."ImportEvents";
$Total = TableCount($Status == 0 ? $PhraseTable : $EventTable, '', 0);
if($Status == 0)
{
$Offset = $objLanguages->ReadImportTable($PhraseTable, 1,"0,1,2", $force_finish ? false : true, 200,$Offset);
if($Offset >= $Total)
{
$Offset=0;
$Status=1;
}
$next_step = GetVar('next_step', true);
if($force_finish == true) $next_step = 3;
$NextUrl = $_SERVER['PHP_SELF']."?Offset=$Offset&Status=$Status&state=lang_install&next_step=$next_step&install_type=$install_type";
if($force_finish == true) $NextUrl .= '&ff=1';
$include_file = $pathtoroot.$admin."/install/lang_run.php";
}
else
{
if(!is_object($objMessageList))
$objMessageList = new clsEmailMessageList();
$Offset = $objMessageList->ReadImportTable($EventTable, $force_finish ? false : true,100,$Offset);
if($Offset > $Total)
{
$next_step = GetVar('next_step', true);
if($force_finish == true) $next_step = 3;
$NextUrl = $_SERVER['PHP_SELF']."?Offset=$Offset&Status=$Status&State=lang_install&next_step=$next_step&install_type=$install_type";
if($force_finish == true) $NextUrl .= '&ff=1';
$include_file = $pathtoroot.$admin."/install/lang_run.php";
}
else
{
$db =& GetADODBConnection();
$prefix = $g_TablePrefix;
$db->Execute('DROP TABLE IF EXISTS '.$PhraseTable);
$db->Execute('DROP TABLE IF EXISTS '.$EventTable);
if(!$force_finish)
{
$state = 'lang_default';
}
else
{
$_POST['next_step'] = 4;
$state = 'finish';
$include_file = $pathtoroot.$admin."/install/install_finish.php";
}
}
}
}
if($state=="lang_default_set")
{
// phpinfo(INFO_VARIABLES);
/*$ado =& inst_GetADODBConnection();
$PhraseTable = GetTablePrefix()."ImportPhrases";
$EventTable = GetTablePrefix()."ImportEvents";
$ado->Execute("DROP TABLE IF EXISTS $PhraseTable");
$ado->Execute("DROP TABLE IF EXISTS $EventTable");*/
$Id = $_POST["lang"];
$objLanguages->SetPrimary($Id);
if (defined('DBG_FAST_INSTALL')) {
$state = 'theme_sel';
}
else {
$state="postconfig_1";
}
}
if($state=="lang_default")
{
$Packs = Array();
$objLanguages->Clear();
$objLanguages->LoadAllLanguages();
foreach($objLanguages->Items as $l)
{
$Packs[$l->Get("LanguageId")] = $l->Get("PackName");
}
$include_file = $pathtoroot.$admin."/install/lang_default.php";
}
if($state=="modinstall")
{
$doms = $_POST["domain"];
if(is_array($doms))
{
$ado =& inst_GetADODBConnection();
require_once $pathtoroot.'kernel/include/tag-class.php';
if( !isset($objTagList) || !is_object($objTagList) ) $objTagList = new clsTagList();
foreach($doms as $p)
{
$filename = $pathtoroot.$p.'/admin/install.php';
if(file_exists($filename) )
{
include($filename);
}
}
}
/* $sql = "SELECT Name FROM ".GetTablePrefix()."Modules";
$rs = $ado->Execute($sql);
while($rs && !$rs->EOF)
{
$p = $rs->fields['Name'];
$mod_name = strtolower($p);
if ($mod_name == 'in-portal') {
$mod_name = '';
}
$dir_name = $pathtoroot.$mod_name."/admin/install/upgrades/";
$dir = @dir($dir_name);
$new_version = '';
$tmp1 = 0;
$tmp2 = 0;
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file))
{
$file = str_replace("inportal_upgrade_v", "", $file);
$file = str_replace(".sql", "", $file);
if ($file != '' && !strstr($file, 'changelog') && !strstr($file, 'readme')) {
$tmp1 = str_replace(".", "", $file);
if ($tmp1 > $tmp2) {
$new_version = $file;
}
}
}
$tmp2 = $tmp1;
}
$version_nrs = explode(".", $new_version);
for ($i = 0; $i < $version_nrs[0] + 1; $i++) {
for ($j = 0; $j < $version_nrs[1] + 1; $j++) {
for ($k = 0; $k < $version_nrs[2] + 1; $k++) {
$try_version = "$i.$j.$k";
$filename = $pathtoroot.$mod_name."/admin/install/upgrades/inportal_upgrade_v$try_version.sql";
if(file_exists($filename))
{
RunSQLFile($ado, $filename);
set_ini_value("Module Versions", $p, $try_version);
save_values();
}
}
}
}
$rs->MoveNext();
}
*/
$state="lang_select";
}
if($state=="modselect")
{
/* /admin/install.php */
$UrlLen = (strlen($admin) + 12)*-1;
$pathguess =substr($_SERVER["SCRIPT_NAME"],0,$UrlLen);
$sitepath = $pathguess;
$esc_path = str_replace("\\","/",$pathtoroot);
$esc_path = str_replace("/","\\",$esc_path);
//set_ini_value("Site","DomainName",$_SERVER["HTTP_HOST"]);
//$g_DomainName= $_SERVER["HTTP_HOST"];
save_values();
$ado =& inst_GetADODBConnection();
if(substr($sitepath,0,1)!="/")
$sitepath="/".$sitepath;
if(substr($sitepath,-1)!="/")
$sitepath .= "/";
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$sitepath' WHERE VariableName='Site_Path'";
$ado->Execute($sql);
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$g_Domain' WHERE VariableName='Server_Name'";
$ado->Execute($sql);
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '".$_SERVER['DOCUMENT_ROOT'].$sitepath."admin/backupdata' WHERE VariableName='Backup_Path'";
$ado->Execute($sql);
$Modules = a48d819089308a9aeb447e7248b2587f();
if (count($Modules) > 0) {
$include_file = $pathtoroot.$admin."/install/modselect.php";
}
else {
$state = "lang_select";
$skip_step = true;
}
}
if($state=="lang_select")
{
$Packs = GetLanguageList();
$include_file = $pathtoroot.$admin."/install/lang_select.php";
}
if(substr($state,0,10)=="postconfig")
{
$p = explode("_",$state);
$step = $p[1];
if ($_POST['Site_Path'] != '') {
$sql = "SELECT Name, Version FROM ".$g_TablePrefix."Modules";
$rs = $ado->Execute($sql);
$modules_str = '';
while ($rs && !$rs->EOF) {
$modules_str .= $rs->fields['Name'].' ('.$rs->fields['Version'].'),';
$rs->MoveNext();
}
$modules_str = substr($modules_str, 0, strlen($modules_str) - 1);
$rfile = @fopen(GET_LICENSE_URL."?url=".base64_encode($_SERVER['HTTP_HOST'].$_POST['Site_Path'])."&modules=".base64_encode($modules_str)."&license_code=".base64_encode($g_LicenseCode)."&version=".GetMaxPortalVersion($pathtoroot.$admin)."&domain=".md5($_SERVER['HTTP_HOST']), "r");
if (!$rfile) {
//$get_license_error = "Unable to connect to the Intechnic server! Please try again later!";
//$state = "postconfig_1";
//$include_file = $pathtoroot.$admin."/install/postconfig.php";
}
else {
$rcontents = '';
while (!feof($rfile)) {
$line = fgets($rfile, 10000);
$rcontents .= $line;
}
@fclose($rfile);
}
}
if(strlen($_POST["oldstate"])>0)
{
$s = explode("_",$_POST["oldstate"]);
$oldstep = $s[1];
if($oldstep<count($configs))
{
$section = $configs[$oldstep];
$module = $mods[$oldstep];
$title = $titles[$oldstep];
$objAdmin = new clsConfigAdmin($module,$section,TRUE);
$objAdmin->SaveItems($_POST,TRUE);
}
}
$section = $configs[$step];
$module = $mods[$step];
$title = $titles[$step];
$step++;
if($step <= count($configs)+1)
{
$include_file = $pathtoroot.$admin."/install/postconfig.php";
}
else
$state = "theme_sel";
}
if($state=="theme_sel")
{
$objThemes->CreateMissingThemes(true);
$include_file = $pathtoroot.$admin."/install/theme_select.php";
}
if($state=="theme_set")
{
## get & define Non-Blocking & Blocking versions ##
$blocking_sockets = minimum_php_version("4.3.0")? 0 : 1;
$ado =& inst_GetADODBConnection();
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$blocking_sockets' WHERE VariableName='SocketBlockingMode'";
$ado->Execute($sql);
## get & define Non-Blocking & Blocking versions ##
$theme_id = $_POST["theme"];
$pathchar="/";
//$objThemes->SetPrimaryTheme($theme_id);
$t = $objThemes->GetItem($theme_id);
$t->Set("Enabled",1);
$t->Set("PrimaryTheme",1);
$t->Update();
$t->VerifyTemplates();
$include_file = $pathtoroot.$admin."/install/install_finish.php";
$state="finish";
}
if ($state == "adm_login") {
echo "<script>window.location='index.php';</script>";
}
if ($state == "finish") {
$ado =& inst_GetADODBConnection();
$PhraseTable = $g_TablePrefix."ImportPhrases";
$EventTable = $g_TablePrefix."ImportEvents";
$ado->Execute("DROP TABLE IF EXISTS $PhraseTable");
$ado->Execute("DROP TABLE IF EXISTS $EventTable");
$ado->Execute('INSERT INTO '.$g_TablePrefix.'Cache (VarName, Data) VALUES (\'ForcePermCacheUpdate\', \'1\')');
$include_file = $pathtoroot.$admin."/install/install_finish.php";
}
// init variables
$vars = Array('db_error','restore_error','PassError','DomainError','login_error','inst_error');
foreach($vars as $var_name) ReSetVar($var_name);
switch($state)
{
case "modselect":
$title = "Select Modules";
$help = "<p>Select the In-Portal modules you wish to install. The modules listed to the right ";
$help .="are all modules included in this installation that are licensed to run on this server. </p>";
break;
case "reinstall":
$title = "Installation Maintenance";
$help = "<p>A Configuration file has been detected on your system and it appears In-Portal is correctly installed. ";
$help .="In order to work with the maintenance functions provided to the left you must provide the Intechnic ";
$help .="Username and Password you used when obtaining the license file residing on the server, or your admin Root password. ";
$help .=" <i>(Use Username 'root' if using your root password)</i></p>";
$help .= "<p>To removing your existing database and start with a fresh installation, select the first option ";
$help .= "provided. Note that this operation cannot be undone and no backups are made! Use at your own risk.</p>";
$help .="<p>If you wish to scrap your current installation and install to a new location, choose the second option. ";
$help .="If this option is selected you will be prompted for new database configuration information.</p>";
$help .="<p>The <i>Update License Information</i> option is used to update your In-Portal license data. Select this option if you have ";
$help .="modified your licensing status with Intechnic, or you have received new license data via email</p>";
$help .="<p>The <i>Fix Paths</i> option should be used when the location of the In-portal files has changed. For example, if you moved them from one folder to another. It will update all settings and ensure the program is operational at the new location.</p>";
break;
case "fix_paths":
$title = "Fix Paths";
$help = "<p>The <i>Fix Paths</i> option should be used when the location of the In-portal files has changed. For example, if you moved them from one folder to another. It will update all settings and ensure the program is operational at the new location.<p>";
break;
case "RootPass":
$title = "Set Admin Root Password";
$help = "<p>The Root Password is initially required to access the admin sections of In-Portal. ";
$help .="The root user cannot be used to access the front-end of the system, so it is recommended that you ";
$help .="create additional users with admin privlidges.</p>";
break;
case "finish":
$title = "Thank You!";
$help ="<P>Thanks for using In-Portal! Be sure to visit <A TARGET=\"_new\" HREF=\"http://www.in-portal.net\">www.in-portal.net</A> ";
$help.=" for the latest news, module releases and support. </p>";
$help.="<p>*Make sure to clean your browser' cache after upgrading In-portal version</p>";
break;
case "license":
$title = "License Configuration";
$help ="<p>A License is required to run In-Portal on a server connected to the Internet. You ";
$help.="can run In-Portal on localhost, non-routable IP addresses, or other computers on your LAN. ";
$help.="If Intechnic has provided you with a license file, upload it here. Otherwise select the first ";
$help.="option to allow Install to download your license for you.</p>";
$help.="<p>If a valid license has been detected on your server, you can choose the <i>Use Existing License</i> ";
$help.="and continue the installation process</p>";
break;
case "domain_select":
$title="Select Licensed Domain";
$help ="<p>Select the domain you wish to configure In-Portal for. The <i>Other</i> option ";
$help.=" can be used to configure In-Portal for use on a local domain.</p>";
$help.="<p>For local domains, enter the hostname or LAN IP Address of the machine running In-Portal.</p>";
break;
case "db_reconfig":
case "dbinfo":
$title="Database Configuration";
$help = "<p>In-Portal needs to connect to your Database Server. Please provide the database server type*, ";
$help .="host name (<i>normally \"localhost\"</i>), Database user name, and database Password. ";
$help .="These fields are required to connect to the database.</p><p>If you would like In-Portal ";
$help .="to use a table prefix, enter it in the field provided. This prefix can be any ";
$help .=" text which can be used in the names of tables on your system. The characters entered in this field ";
$help .=" are placed <i>before</i> the names of the tables used by In-Portal. For example, if you enter \"inp_\"";
$help .=" into the prefix field, the table named Category will be named inp_Category.</p>";
break;
case "lang_select":
$title="Language Pack Installation";
$help = "<p>Select the language packs you wish to install. Each language pack contains all the phrases ";
$help .="used by the In-Portal administration and the default template set. Note that at least one ";
$help .="pack <b>must</b> be installed.</p>";
break;
case "lang_default":
$title="Select Default Language";
$help = "<p>Select which language should be considered the \"default\" language. This is the language ";
$help .="used by In-Portal when a language has not been selected by the user. This selection is applicable ";
$help .="to both the administration and front-end.</p>";
break;
case "lang_install":
$title="Installing Language Packs";
$help = "<p>The language packs you have selected are being installed. You may install more languages at a ";
$help.="later time from the Regional admin section.</p>";
break;
case "postconfig_1":
$help = "<P>These options define the general operation of In-Portal. Items listed here are ";
$help .="required for In-Portal's operation.</p><p>When you have finished, click <i>save</i> to continue.</p>";
break;
case "postconfig_2":
$help = "<P>User Management configuration options determine how In-Portal manages your user base.</p>";
$help .="<p>The groups listed to the right are pre-defined by the installation process and may be changed ";
$help .="through the Groups section of admin.</p>";
break;
case "postconfig_3":
$help = "<P>The options listed here are used to control the category list display functions of In-Portal. </p>";
break;
case "theme_sel":
$title="Select Default Theme";
$help = "<P>This theme will be used whenever a front-end session is started. ";
$help .="If you intend to upload a new theme and use that as default, you can do so through the ";
$help .="admin at a later date. A default theme is required for session management.</p>";
break;
case "get_license":
$title="Download License from Intechnic";
$help ="<p>A License is required to run In-Portal on a server connected to the Internet. You ";
$help.="can run In-Portal on localhost, non-routable IP addresses, or other computers on your LAN.</p>";
$help.="<p>Here as you have selected download license from Intechnic you have to input your username and ";
$help.="password of your In-Business account in order to download all your available licenses.</p>";
break;
case "download_license":
$title="Download License from Intechnic";
$help ="<p>A License is required to run In-Portal on a server connected to the Internet. You ";
$help.="can run In-Portal on localhost, non-routable IP addresses, or other computers on your LAN.</p>";
$help.="<p>Please choose the license from the drop down for this site! </p> ";
break;
case "restore_select":
$title="Select Restore File";
$help = "<P>Select the restore file to use to reinstall In-Portal. If your backups are not performed ";
$help .= "in the default location, you can enter the location of the backup directory and click the ";
$help .="<i>Update</i> button.</p>";
case "restore_run":
$title= "Restore in Progress";
$help = "<P>Restoration of your system is in progress. When the restore has completed, the installation ";
$help .="will continue as normal. Hitting the <i>Cancel</i> button will restart the entire installation process. ";
break;
case "warning":
$title = "Restore in Progress";
$help = "<p>Please approve that you understand that you are restoring your In-Portal data base from other version of In-Portal.</p>";
break;
case "update":
$title = "Update In-Portal";
$help = "<p>Select modules from the list, you need to update to the last downloaded version of In-Portal</p>";
break;
}
$tmp_step = GetVar('next_step', true);
if (!$tmp_step) {
$tmp_step = 1;
}
if ( isset($got_license) && $got_license == 1) {
$tmp_step++;
}
$next_step = $tmp_step + 1;
if ($general_error != '') {
$state = '';
$title = '';
$help = '';
$general_error = $general_error.'<br /><br />Installation cannot continue!';
}
if ($include_file == '' && $general_error == '' && $state == '') {
$state = '';
$title = '';
$help = '';
$filename = $pathtoroot.$admin."/install/inportal_remove.sql";
RunSQLFile($ado,$filename);
$general_error = 'Unexpected installation error! <br /><br />Installation has been stopped!';
}
if ($restore_error != '') {
$next_step = 3;
$tmp_step = 2;
}
if ($PassError != '') {
$tmp_step = 4;
$next_step = 5;
}
if ($DomainError != '') {
$tmp_step--;
$next_step = $tmp_step + 1;
}
if ($db_error != '') {
$tmp_step--;
$next_step = $tmp_step + 1;
}
if ($state == "warning") {
$tmp_step--;
$next_step = $tmp_step + 1;
}
if ($skip_step) {
$tmp_step++;
$next_step = $tmp_step + 1;
}
?>
<tr height="100%">
<td valign="top">
<table cellpadding=10 cellspacing=0 border=0 width="100%" height="100%">
<tr valign="top">
<td style="width: 200px; background: #009ff0 url(images/bg_install_menu.gif) no-repeat bottom right; border-right: 1px solid #000">
<img src="images/spacer.gif" width="180" height="1" border="0" title=""><br>
<span class="admintitle-white">Installation</span>
<!--<ol class="install">
<li class="current">Licence Verification
<li>Configuration
<li>File Permissions
<li>Security
<li>Integrity Check
</ol>
</td>-->
<?php
$lic_opt = isset($_POST['lic_opt']) ? $_POST['lic_opt'] : false;
if ($general_error == '') {
?>
<?php if ($install_type == 1) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1) { ?>class="current"<?php } ?>>Database Configuration
<li <?php if ($tmp_step == 2 || $lic_opt == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 3 && $lic_opt != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 4 ) { ?>class="current"<?php } ?>>Set Root Password
<li <?php if ($tmp_step == 5) { ?>class="current"<?php } ?>>Select Modules to Install
<li <?php if ($tmp_step == 6) { ?>class="current"<?php } ?>>Install Language Packs
<li <?php if ($tmp_step == 7) { ?>class="current"<?php } ?>>Post-Install Configuration
<li <?php if ($tmp_step == 8) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 2) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<!--<li <?php if (($tmp_step == 2 && $login_error == '' && $inst_error == '') || $_POST['lic_opt'] == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 3 && $_POST['lic_opt'] != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 4) { ?>class="current"<?php } ?>>Set Root Password
<li <?php if ($tmp_step == 5) { ?>class="current"<?php } ?>>Select Modules to Install
<li <?php if ($tmp_step == 6) { ?>class="current"<?php } ?>>Install Language Packs
<li <?php if ($tmp_step == 7) { ?>class="current"<?php } ?>>Post-Install Configuration
<li <?php if ($tmp_step == 8) { ?>class="current"<?php } ?>>Finish-->
</ol>
<?php } else if ($install_type == 3) { ?>
<ol class="install">
<li>License Verification
<li <?php if ($tmp_step == 2) { ?>class="current"<?php } ?>>Database Configuration
<li <?php if ($tmp_step == 3 || $_POST['lic_opt'] == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 4 && $_POST['lic_opt'] != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 5) { ?>class="current"<?php } ?>>Set Root Password
<li <?php if ($tmp_step == 6) { ?>class="current"<?php } ?>>Select Modules to Install
<li <?php if ($tmp_step == 7) { ?>class="current"<?php } ?>>Install Language Packs
<li <?php if ($tmp_step == 8) { ?>class="current"<?php } ?>>Post-Install Configuration
<li <?php if ($tmp_step == 9) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 4) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if (($tmp_step == 2 && $login_error == '' && $inst_error == '') || $lic_opt == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 3 && $_POST['lic_opt'] != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 4) { ?>class="current"<?php } ?>>Set Root Password
<li <?php if ($tmp_step == 5) { ?>class="current"<?php } ?>>Select Modules to Install
<li <?php if ($tmp_step == 6) { ?>class="current"<?php } ?>>Install Language Packs
<li <?php if ($tmp_step == 7) { ?>class="current"<?php } ?>>Post-Install Configuration
<li <?php if ($tmp_step == 8) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 5) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if (($tmp_step == 2 && $login_error == '' && $inst_error == '') || $lic_opt == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 3 && $lic_opt != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 4) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 6) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if (($tmp_step == 2 && $login_error == '' && $inst_error == '') || $_GET['show_prev'] == 1 || $_POST['backupdir']) { ?>class="current"<?php } ?>>Select Backup File
<li <?php if ($tmp_step == 3 && $_POST['lic_opt'] != 1 && $_GET['show_prev'] != 1 && !$_POST['backupdir']) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 7) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if ($tmp_step == 2 && $login_error == '' && $inst_error == '') { ?>class="current"<?php } ?>>Database Configuration
<li <?php if ($tmp_step == 3) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 8) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if ($tmp_step == 2 && $login_error == '' && $inst_error == '') { ?>class="current"<?php } ?>>Select Modules to Upgrade
<li <?php if ($tmp_step == 3) { ?>class="current"<?php } ?>>Language Pack Upgrade
<li <?php if ($tmp_step == 4) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 9) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if ($tmp_step == 2 && $login_error == '' && $inst_error == '') { ?>class="current"<?php } ?>>Fix Paths
<li <?php if ($tmp_step == 3) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } ?>
<?php include($include_file); ?>
<?php } else { ?>
<?php include("install/general_error.php"); ?>
<?php } ?>
<td width="40%" style="border-left: 1px solid #000; background: #f0f0f0">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td class="subsectiontitle" style="border-bottom: 1px solid #000000; background-color:#999"><?php if( isset($title) ) echo $title;?></td>
</tr>
<tr>
<td class="text"><?php if( isset($help) ) echo $help;?></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="footer">
Powered by In-portal &copy; 1997-2006, Intechnic Corporation. All rights reserved.
<br><img src="images/spacer.gif" width="1" height="10" title="">
</td>
</tr>
</table>
</form>
</body>
</html>
\ No newline at end of file
Property changes on: trunk/admin/install.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.111
\ No newline at end of property
+1.112
\ No newline at end of property
Index: trunk/admin/install/install_lib.php
===================================================================
--- trunk/admin/install/install_lib.php (revision 7634)
+++ trunk/admin/install/install_lib.php (revision 7635)
@@ -1,1124 +1,1166 @@
<?php
function minimum_php_version( $vercheck )
{
$minver = explode(".", $vercheck);
$curver = explode(".", phpversion());
if (($curver[0] < $minver[0])
|| (($curver[0] == $minver[0])
&& ($curver[1] < $minver[1]))
|| (($curver[0] == $minver[0]) && ($curver[1] == $minver[1])
&& ($curver[2][0] < $minver[2][0])))
return false;
else
return true;
}
function VersionSort($a, $b)
{
if( preg_match('/inportal_upgrade_v(.*).(php|sql)$/', $a, $rets) )
{
$a_version = $rets[1];
$a_extension = $rets[2];
}
if( preg_match('/inportal_upgrade_v(.*).(php|sql)$/', $b, $rets) )
{
$b_version = $rets[1];
$b_extension = $rets[2];
}
if( !isset($a_version) || !isset($b_version) ) return 0; // not php or sql file
if($a_version == $b_version) // got PHP and SQL file for one version
{
if($a_extension == $b_extension)
{
return 0;
}
else
{
return ($a_extension == 'php') ? 1 : -1; // this makes .php extension go AFTER .sql in the sorting
}
}
else
{
return (ConvertVersion($a_version) < ConvertVersion($b_version)) ? -1 : 1;
}
}
function GetMaxPortalVersion($admindirname)
{
$dir = @dir($admindirname.'/install/upgrades');
if (!$dir) return '';
$upgrades_arr = Array();
$version = '';
while($file = $dir->read())
{
if ($file != "." && $file != ".." && !is_dir($admindirname.$file))
{
if (strstr($file, 'inportal_upgrade_v')) $upgrades_arr[] = $file;
}
}
usort($upgrades_arr, "VersionSort");
foreach($upgrades_arr as $file)
{
if( preg_match('/inportal_upgrade_v(.*).(php|sql)$/', $file, $rets) )
{
$a_version = $rets[1];
if (ConvertVersion($a_version) > ConvertVersion($version)) {
$version = $a_version;
}
}
}
return $version;
}
function ConvertVersion($version)
{
$parts = explode('.', $version);
$bin = '';
foreach ($parts as $part) {
$bin .= str_pad(decbin($part), 8, '0', STR_PAD_LEFT);
}
$dec = bindec($bin);
return $dec;
}
function TableExists(&$ado, $tables)
{
global $g_TablePrefix;
$t = explode(",",$tables);
$i = $ado->MetaTables();
for($x=0;$x<count($i);$x++)
$i[$x] = strtolower($i[$x]);
$AllFound = TRUE;
for($tIndex=0;$tIndex<count($t);$tIndex++)
{
$table = $g_TablePrefix.$t[$tIndex];
$table = strtolower($table);
if(!in_array($table,$i))
{
$AllFound = FALSE;
}
}
return $AllFound;
}
function set_ini_value($section, $key, $newvalue)
{
global $ini_vars;
$ini_vars[$section][$key] = $newvalue;
}
function save_values()
{
// Should write something to somwere, but it doesn't :(
global $ini_file,$ini_vars;
//if( file_exists($ini_file) )
//{
$fp = fopen($ini_file, "w");
fwrite($fp,'<'.'?'.'php die() ?'.">\n\n");
foreach($ini_vars as $secname => $section)
{
fwrite($fp,"[".$secname."]\n");
foreach($section as $key => $value) fwrite($fp,"$key = \"$value\"\n");
fwrite($fp,"\n");
}
fclose($fp);
//}
}
function getConnectionInterface($action, $dbo_type='adodb')
{
if($dbo_type == 'adodb')
{
switch($action)
{
case 'query': return 'Execute'; break;
case 'errorno': return 'ErrorNo'; break;
case 'errormsg': return 'ErrorMsg'; break;
}
}
if($dbo_type == 'dbconnection')
{
switch($action)
{
case 'query': return 'Query'; break;
case 'errorno': return 'getErrorCode'; break;
case 'errormsg': return 'getErrorMsg'; break;
}
}
}
function RunSchemaFile(&$ado, $filename, $dbo_type='adodb')
{
if( file_exists($filename) )
{
$sql = file_get_contents($filename);
if($sql) RunSchemaText($ado,$sql,$dbo_type);
}
}
function RunSchemaText(&$ado, $sql, $dbo_type='adodb')
{
global $g_TablePrefix;
if(strlen($g_TablePrefix))
{
$what = "CREATE TABLE ";
$replace = "CREATE TABLE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "DROP TABLE ";
$replace = "DROP TABLE IF EXISTS ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "INSERT INTO ";
$replace = "INSERT INTO ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "UPDATE ";
$replace = "UPDATE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "ALTER TABLE ";
$replace = "ALTER TABLE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
}
$commands = explode("# --------------------------------------------------------",$sql);
if(count($commands)>0)
{
$query_func = getConnectionInterface('query',$dbo_type);
$errorno_func = getConnectionInterface('errorno',$dbo_type);
$errormsg_func = getConnectionInterface('errormsg',$dbo_type);
for($i = 0; $i < count($commands); $i++)
{
$cmd = $commands[$i];
$cmd = trim($cmd);
if(strlen($cmd)>0)
{
$ado->$query_func($cmd);
if($ado->$errorno_func() != 0)
{
$db_error = $ado->$errormsg_func()." COMMAND:<PRE>$cmd</PRE>";
}
}
}
}
}
function RunSQLText(&$ado, $allsql, $dbo_type='adodb')
{
global $g_TablePrefix;
$line = 0;
$query_func = getConnectionInterface('query',$dbo_type);
$errorno_func = getConnectionInterface('errorno',$dbo_type);
$errormsg_func = getConnectionInterface('errormsg',$dbo_type);
while($line<count($allsql))
{
$sql = $allsql[$line];
if(strlen(trim($sql))>0 && substr($sql,0,1)!="#")
{
if(strlen($g_TablePrefix))
{
$what = "CREATE TABLE ";
$replace = "CREATE TABLE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "DELETE FROM ";
$replace = "DELETE FROM ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "DROP TABLE ";
$replace = "DROP TABLE IF EXISTS ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "DROP TABLE IF EXISTS ";
$replace = "DROP TABLE IF EXISTS ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "INSERT INTO ";
$replace = "INSERT INTO ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "UPDATE ";
$replace = "UPDATE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "ALTER TABLE ";
$replace = "ALTER TABLE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
}
$sql = trim($sql);
if(strlen($sql)>0)
{
$ado->$query_func($sql);
if($ado->$errorno_func()!=0)
{
$db_error = $ado->$errormsg_func()." COMMAND:<PRE>$sql</PRE>";
$error = TRUE;
}
}
}
$line++;
}
}
function RunSQLFile(&$ado, $filename, $dbo_type='adodb')
{
if(file_exists($filename))
{
$allsql = file($filename);
RunSQLText($ado,$allsql,$dbo_type);
}
}
/**
* Executes all sqls in selected file (in K4 style)
*
* @param string $filename
* @param kDBConnection $db
* @param mixed $replace_from
* @param mixed $replace_to
*/
function K4_RunSQL($filename, $replace_from = null, $replace_to = null)
{
if (!file_exists(FULL_PATH.$filename)) {
return ;
}
$db =& inst_GetADODBConnection(true);
$sqls = file_get_contents(FULL_PATH.$filename);
// add prefix to all tables
if (strlen(TABLE_PREFIX) > 0) {
$replacements = Array ('CREATE TABLE ', 'INSERT INTO ', 'UPDATE ', 'ALTER TABLE ');
foreach ($replacements as $replacement) {
$sqls = str_replace($replacement, $replacement.TABLE_PREFIX, $sqls);
}
$sqls = str_replace('DROP TABLE ', 'DROP TABLE IF EXISTS '.TABLE_PREFIX, $sqls);
}
if (isset($replace_from) && isset($replace_to)) {
// replace something additionally, e.g. module root category
$sqls = str_replace($replace_from, $replace_to, $sqls);
}
- $sqls = str_replace("\r\n", "\n", $sqls);
+ $sqls = str_replace("\r\n", "\n", $sqls); // convert to linux line endings
+ $sqls = preg_replace("/#(.*?)\n/", '', $sqls); // remove all comments
$sqls = explode(";\n", $sqls);
foreach ($sqls as $sql) {
$sql = trim($sql);
- if (!$sql || substr($sql, 0, 1) == '#') {
- continue; // usually last line || comment
+ if (!$sql) {
+ continue; // usually last line
}
$db->Query($sql);
if ($db->getErrorCode() != 0) {
$db_error = $db->getErrorMsg()." COMMAND:<PRE>$sql</PRE>";
$error = true;
// break;
}
}
}
+
+/**
+ * Sets module version to passed
+ *
+ * @param string $module_name
+ * @param string $version
+ */
+function K4_SetModuleVersion($module_name, $version = false)
+{
+ if ($version === false) {
+ $version = K4_GetMaxModuleVersion($module_name);
+ }
+
+ $sql = 'UPDATE '.TABLE_PREFIX.'Modules
+ SET Version = "'.$version.'"
+ WHERE Name = "'.$module_name.'"';
+
+ $db =& inst_GetADODBConnection(true);
+ $db->Query($sql);
+}
+
+function K4_GetMaxModuleVersion($module_name)
+{
+ define('UPGRADES_FILE', FULL_PATH.'/%sinstall/upgrades.sql');
+ define('VERSION_MARK', '# ===== v ([\d]+\.[\d]+\.[\d]+) =====');
+
+ $upgrades_file = sprintf(UPGRADES_FILE, strtolower($module_name).'/');
+ if (!file_exists($upgrades_file)) {
+ // no upgrade file
+ return '4.0.1';
+ }
+
+ $sqls = file_get_contents($upgrades_file);
+ $versions_found = preg_match_all('/'.VERSION_MARK.'/s', $sqls, $regs);
+ if (!$versions_found) {
+ // upgrades file doesn't contain version definitions
+ return '4.0.1';
+ }
+
+ return end($regs[1]);
+}
function RunRestoreFile($ado,$filename,$FileOffset,$MaxLines)
{
$size = filesize($filename);
if($FileOffset > $size)
return -2;
$fp = fopen($filename,"r");
if(!$fp)
return -1;
if($FileOffset>0)
{
fseek($fp,$FileOffset);
}
else
{
$EndOfSQL = FALSE;
$sql = "";
while(!feof($fp) && !$EndOfSQL)
{
$l = fgets($fp,16384);
if(substr($l,0,11)=="INSERT INTO")
{
$EndOfSQL = TRUE;
}
else
{
$sql .= $l;
$FileOffset = ftell($fp) - strlen($l);
}
}
if(strlen($sql))
{
RunSchemaText($ado,$sql);
}
fseek($fp,$FileOffset);
}
$LinesRead = 0;
$sql = "";
$AllSql = array();
while($LinesRead < $MaxLines && !feof($fp))
{
$sql = fgets($fp, 16384);
if(strlen($sql))
{
$AllSql[] = $sql;
$LinesRead++;
}
}
if(!feof($fp))
{
$FileOffset = ftell($fp);
}
else
{
$FileOffset = $TotalSize;
}
fclose($fp);
if(count($AllSql)>0)
RunSQLText($ado,$AllSql);
return (int)$FileOffset;
}
function _inst_keyED($txt,$encrypt_key)
{
$encrypt_key = md5($encrypt_key);
$ctr=0;
$tmp = "";
for ($i=0;$i<strlen($txt);$i++)
{
if ($ctr==strlen($encrypt_key)) $ctr=0;
$tmp.= substr($txt,$i,1) ^ substr($encrypt_key,$ctr,1);
$ctr++;
}
return $tmp;
}
function _inst_decrypt($txt,$key)
{
$txt = _inst_keyED($txt,$key);
$tmp = "";
for ($i=0;$i<strlen($txt);$i++)
{
$md5 = substr($txt,$i,1);
$i++;
$tmp.= (substr($txt,$i,1) ^ $md5);
}
return $tmp;
}
function inst_LoadFromRemote()
{
return "";
}
function mod_DLid()
{
global $DownloadId;
echo $DownloadId."\n";
die();
}
function ae666b1b8279502f4c4b570f133d513e($LoadRemote=FALSE,$file="")
{
return _inst_LoadLicense($LoadRemote,$file);
}
function _inst_LoadLicense($LoadRemote=FALSE,$file="")
{
global $path,$admin;
$data = Array();
if(!strlen($file))
{
$f = $path.$admin."/include/inportal.dat";
}
else
$f = $file;
if(file_exists($f))
{
$contents = file($f);
$data[0] = base64_decode($contents[1]);
$data[1] = $contents[2];
}
else
if($LoadRemote)
return $LoadFromRemote;
return $data;
}
function inst_SaveLicense($data)
{
}
function _inst_VerifyKey($domain,$k)
{
$key = md5($domain);
$lkey = substr($key,0,strlen($key)/2);
$rkey = substr($key,strlen($key)/2);
$r = $rkey.$lkey;
if($k==$r)
return TRUE;
return FALSE;
}
function a83570933e44bc66b31dd7127cf3f23a($txt)
{
return _inst_ParseLicense($txt);
}
function _inst_ParseLicense($txt)
{
global $i_User, $i_Pswd, $i_Keys;
$data = _inst_decrypt($txt,"beagle");
$i_Keys = array();
$lines = explode("\n",$data);
for($x=0;$x<count($lines);$x++)
{
$l = $lines[$x];
$p = explode("=",$l,2);
switch($p[0])
{
case "Username":
$i_User = $p[1];
break;
case "UserPass":
$i_Pswd = $p[1];
break;
default:
if(substr($p[0],0,3)=="key")
{
$parts = explode("|",$p[1]);
if(_inst_VerifyKey($parts[0],$parts[1]))
{
unset($K);
$k["domain"]=$parts[0];
$k["key"]=$parts[1];
$k["desc"]=$parts[2];
$k["mod"]=$parts[3];
$i_Keys[] = $k;
}
}
break;
}
}
}
function de3ec1b7a142cccd0d51f03d24280744($domain)
{
_inst_falseIsLocalSite($domain);
return _inst_IsLocalSite($domain);
}
function _inst_GetObscureValue($i)
{
$z = null;
if ($i == 'x') return 0254;
if ($i == 'z') return 0x7F.'.';
if ($i >= 5 && $i < 7) return _inst_GetObscureValue($z)*_inst_GetObscureValue('e');
if ($i > 30) return Array(0x6c,0x6f,0x63,0x61,0x6c,0x68,0x6f,0x73,0x74);
if ($i > 20) return 99;
if ($i > 10) return '.'.(_inst_GetObscureValue(6.5)+1);
if ($i == 'a') return 0xa;
}
function _inst_Chr($val)
{
$x = _inst_GetObscureValue(25);
$f = chr($x).chr($x+5).chr($x+15);
return $f($val);
}
function _inst_IsLocalSite($domain)
{
$yy = '';
$ee = _inst_GetObscureValue(35);
foreach ($ee as $e) {
$yy .= _inst_Chr($e);
}
$localb = FALSE;
if(substr($domain,0,3)==_inst_GetObscureValue('x'))
{
$b = substr($domain,0,6);
$p = explode(".",$domain);
$subnet = $p[1];
if($p[1]>15 && $p[1]<32)
$localb=TRUE;
}
$zz = _inst_GetObscureValue('z')._inst_GetObscureValue(5).'.'.(int)_inst_GetObscureValue(7)._inst_GetObscureValue(12);
$ff = _inst_GetObscureValue('z')+65;
$hh = $ff-0x18;
if($domain==$yy || $domain==$zz || substr($domain,0,7)==$ff._inst_Chr(46).$hh ||
substr($domain,0,3)==_inst_GetObscureValue('a')._inst_Chr(46) || $localb || strpos($domain,".")==0)
{
return TRUE;
}
return FALSE;
}
function _inst_falseIsLocalSite($domain)
{
$localb = FALSE;
if(substr($domain,0,3)=="172" || $domain == '##code##')
{
$b = substr($domain,0,6);
$p = explode(".",$domain);
$subnet = $p[1];
if($p[1]>15 && $p[1]<32)
$localb=TRUE;
}
if($domain=="localhost" || $domain=="127.0.0.1" || substr($domain,0,7)=="192.168" ||
substr($domain,0,3)=="10." || $localb || strpos($domain,".")==0)
{
return TRUE;
}
return FALSE;
}
function ed592fe427e1ce60e32ffcb0c82d8557($name)
{
return _inst_ModuleLicensed($name);
}
function _inst_ModuleLicensed($name)
{
global $i_Keys, $objConfig, $g_License, $g_Domain;
$lic = base64_decode($g_License);
_inst_ParseLicense($lic);
$modules = array();
if(!_inst_IsLocalSite($g_Domain))
{
for($x=0;$x<count($i_Keys);$x++)
{
$key = $i_Keys[$x];
if (strlen(stristr($g_Domain,$key["domain"])))
{
$modules = explode(",",strtolower($key["mod"]));
}
}
if(in_array(strtolower($name),$modules))
{
return TRUE;
}
else
{
return FALSE;
}
}
else
return TRUE;
return FALSE;
}
function inst_parse_portal_ini($file, $parse_section = false) {
if(!file_exists($file) && !is_readable($file))
die("Could Not Open Ini File $file");
$contents = file($file);
$retval = array();
$section = '';
$ln = 1;
$resave = false;
foreach($contents as $line) {
if ($ln == 1 && $line != '<'.'?'.'php die() ?'.">\n") {
$resave = true;
}
$ln++;
$line = trim($line);
$line = eregi_replace(';[.]*','',$line);
if(strlen($line) > 0) {
if(eregi('^[[a-z]+]$',str_replace(' ', '', $line))) {
$section = substr($line,1,(strlen($line)-2));
if ($parse_section) {
$retval[$section] = array();
}
continue;
} elseif(eregi('=',$line)) {
list($key,$val) = explode(' = ',$line);
if (!$parse_section) {
$retval[trim($key)] = str_replace('"', '', $val);
}
else {
$retval[$section][trim($key)] = str_replace('"', '', $val);
}
} //end if
} //end if
} //end foreach
if ($resave) {
$fp = fopen($file, "w");
reset($contents);
fwrite($fp,'<'.'?'.'php die() ?'.">\n\n");
foreach($contents as $line) fwrite($fp,"$line");
fclose($fp);
}
return $retval;
}
function a48d819089308a9aeb447e7248b2587f()
{
return _inst_GetModuleList();
}
function _inst_GetModuleList()
{
global $rootpath,$pathchar,$admin, $pathtoroot;
$path = $pathtoroot;
$new = array();
if ($dir = @opendir($path))
{
while (($file = readdir($dir)) !== false)
{
if($file !="." && $file !=".." && substr($file,0,1)!="_")
{
if(is_dir($path."/".$file))
{
$ModuleAdminDir = $path.$file.'/admin/';
$inst_file = $ModuleAdminDir.'install.php';
if( file_exists($inst_file) && file_exists($ModuleAdminDir.'install/inportal_schema.sql') )
{
if(_inst_ModuleLicensed($file)) {
$new[$file] = $inst_file;
}
}
}
}
}
closedir($dir);
}
return array_keys($new);
}
function GetDirList ($dirName)
{
$filedates = array();
$d = dir($dirName);
while($entry = $d->read())
{
if ($entry != "." && $entry != "..")
{
if (!is_dir($dirName."/".$entry))
{
$filedate[]=$entry;
}
}
}
$d->close();
return $filedate;
}
function GetLanguageList()
{
global $pathtoroot, $admin;
$packs = array();
$dir = $pathtoroot.$admin."/install/langpacks";
$files = GetDirList($dir);
if(is_array($files))
{
foreach($files as $f)
{
$p = pathinfo($f);
if($p["extension"]=="lang")
{
$packs[] = $f;
}
}
}
return $packs;
}
function section_header($title, $return_result = false)
{
$ret = '<table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">'.
'<tr><td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;'.$title.'</span>'.
'</td><td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%">'.
"<a class=\"link\" onclick=\"ShowHelp('in-portal:install');\"><img src=\"images/blue_bar_help.gif\" border=\"0\"></A>".
'</td></tr></table>';
if( $return_result )
return $ret;
else
echo $ret;
}
function &VerifyDB($error_state, $next_state, $success_func = null, $db_must_exist = false)
{
// perform various check type to database specified
// 1. user is allowed to connect to database
// 2. user has all types of permissions in database
global $state, $db_error;
// enshure we use data from post & not from config
$GLOBALS['g_DBType'] = $_POST["ServerType"];
$GLOBALS['g_DBHost'] = $_POST["ServerHost"];
$GLOBALS['g_DBName'] = $_POST["ServerDB"];
$GLOBALS['g_DBUser'] = $_POST["ServerUser"];
$GLOBALS['g_DBUserPassword'] = $_POST["ServerPass"];
if (strlen($_POST['TablePrefix']) > 7) {
$db_error = 'Table prefix should not be longer than 7 characters';
$state = $error_state;
return false;
}
// connect to database
$ado =& inst_GetADODBConnection();
if($ado->ErrorNo() != 0)
{
// was error while connecting
$db_error = "Connection Error: (".$ado->ErrorNo().") ".$ado->ErrorMsg();
$state = $error_state;
}
elseif( $ado->ErrorNo() == 0 )
{
// if connected, then check if all sql statements work
$test_result = 1;
$sql_tests[] = 'DROP TABLE IF EXISTS test_table';
$sql_tests[] = 'CREATE TABLE test_table(test_col mediumint(6))';
$sql_tests[] = 'LOCK TABLES test_table WRITE';
$sql_tests[] = 'INSERT INTO test_table(test_col) VALUES (5)';
$sql_tests[] = 'UPDATE test_table SET test_col = 12';
$sql_tests[] = 'UNLOCK TABLES';
$sql_tests[] = 'ALTER TABLE test_table ADD COLUMN new_col varchar(10)';
$sql_tests[] = 'SELECT * FROM test_table';
$sql_tests[] = 'DELETE FROM test_table';
$sql_tests[] = 'DROP TABLE IF EXISTS test_table';
foreach($sql_tests as $sql_test)
{
$ado->Execute($sql_test);
if( $ado->ErrorNo()!=0 )
{
$test_result = 0;
break;
}
}
if($test_result == 1)
{
// if statements work & connection made, then check table existance
$db_exists = TableExists($ado,"ConfigurationAdmin,Category,Permissions");
if($db_exists != $db_must_exist)
{
$state = $error_state;
$db_error = $db_must_exist ? 'An In-Portal Database already exists at this location' : 'An In-Portal Database was not found at this location';
}
else
{
$state = $next_state;
if( isset($success_func) ) $success_func();
}
}
else
{
// user has insufficient permissions in database specified
$db_error = "Permission Error: (".$ado->ErrorNo().") ".$ado->ErrorMsg();
$state = $error_state;
}
}
return $ado;
}
function SaveDBConfig()
{
// save new database configuration
set_ini_value("Database", "DBType",$_POST["ServerType"]);
set_ini_value("Database", "DBHost",$_POST["ServerHost"]);
set_ini_value("Database", "DBName",$_POST["ServerDB"]);
set_ini_value("Database", "DBUser",$_POST["ServerUser"]);
set_ini_value("Database", "DBUserPassword",$_POST["ServerPass"]);
set_ini_value("Database","TablePrefix",$_POST["TablePrefix"]);
save_values();
$GLOBALS['include_file'] = 'install/install_finish.php';
}
function ReSetVar($var)
{
// define varible if not defined before
if( !isset($GLOBALS[$var]) ) $GLOBALS[$var] = '';
}
// if globals.php not yet included (1st steps of install),
// then define GetVar function
if( !function_exists('GetVar') )
{
function GetVar($name, $post_priority = false)
{
if(!$post_priority) // follow gpc_order in php.ini
return isset($_REQUEST[$name]) ? $_REQUEST[$name] : false;
else // get variable from post 1stly if not found then from get
return isset($_POST[$name]) && $_POST[$name] ? $_POST[$name] : ( isset($_GET[$name]) && $_GET[$name] ? $_GET[$name] : false );
}
}
function RadioChecked($name, $value)
{
// return " checked" word in case if radio is checked
$submit_value = GetVar($name);
return $submit_value == $value ? ' checked' : '';
}
function StripDisallowed($string, $item_info)
{
$not_allowed = Array( ' ', '\\', '/', ':', '*', '?', '"', '<', '>', '|',
'~', '!', '@', '#', '$', '%', '^', '&', '(', ')',
'+', '=', '-', '{', '}', ']', '[', "'", ';', '.', ',');
$string = str_replace($not_allowed, '_', $string);
$string = preg_replace('/(_+)/', '_', $string);
$string = checkAutoFilename($string, $item_info);
return $string;
}
function checkAutoFilename($filename, $item_info)
{
// 'table' => 'Category', 'id_field' => 'CategoryId', 'title_field' => 'Name'
$item_id = $item_info['item_id'];
$prefix = GetTablePrefix();
$db =& inst_GetADODBConnection();
$sql = 'SELECT '.$item_info['id_field'].' FROM '.$prefix.$item_info['table'].' WHERE Filename = '.$db->qstr($filename);
$found_item_id = $db->GetOne($sql);
$has_page = preg_match('/(.*)_([\d]+)([a-z]*)$/', $filename, $rets);
if( ($found_item_id != $item_id) || $has_page ) // other category has same filename as ours OR we have filename, that ends with _number
{
$append = $found_item_id ? 'a' : '';
if($has_page)
{
$filename = $rets[1].'_'.$rets[2];
$append = $rets[3] ? $rets[3] : 'a';
}
$sql = 'SELECT '.$item_info['id_field'].' FROM '.$prefix.$item_info['table'].' WHERE (Filename = %s) AND ('.$item_info['id_field'].' != '.$item_id.')';
while ( $db->GetOne( sprintf($sql, $db->qstr($filename.$append)) ) > 0 )
{
if (substr($append, -1) == 'z') $append .= 'a';
$append = substr($append, 0, strlen($append) - 1) . chr( ord( substr($append, -1) ) + 1 );
}
return $filename.$append;
}
return $filename;
}
/**
* [INSTALL] Perform operations required for each module separate install (from admin)
*
* @param string $module_name
* @param bool $has_theme
* @return bool
*/
function finalizeModuleInstall($module_name, $has_theme = true)
{
global $objThemes;
$app =& kApplication::Instance();
if (!$app->GetVar('redirect')) return false;
if ($has_theme)
{
$objThemes->CreateMissingThemes(true);
}
// 2. import languagepack in case of separate install
$lang_xml =& $app->recallObject('LangXML');
$lang_xml->tables['phrases'] = TABLE_PREFIX.'Phrase';
$lang_xml->tables['emailmessages'] = TABLE_PREFIX.'EmailMessage';
$lang_path = FULL_PATH.'/'.$module_name.'/admin/install/langpacks';
$lang_xml->Parse($lang_path.'/english.lang', '|0|1|2|', '');
$app->Redirect('in-portal/modules/modules_list', Array('pass' => 'all', 'admin' => 1, 'RefreshTree' => 1), '', 'index.php');
}
/**
* [UPGRADE] Initializes [cached] category/item templates with default values for each module
*
* @param string $module
* @param string $category_template
* @param string $item_template
*/
function updateItemCategoryTemplate($module, $category_template, $item_template)
{
$table_prefix = GetTablePrefix();
$inst_ado =& inst_GetADODBConnection();
// get module root category by module name
$sql = 'SELECT RootCat
FROM '.$table_prefix.'Modules
WHERE Name = '.$inst_ado->qstr($module);
$module_root = $inst_ado->GetOne($sql);
// set category & item template to module root category
$sql = 'UPDATE '.$table_prefix.'Category
SET CategoryTemplate = '.$inst_ado->qstr($category_template).'
WHERE CategoryId = '.$module_root;
$inst_ado->Execute($sql);
// set cached category & item templates to all sub-categories of module root category
$sql = 'UPDATE '.$table_prefix.'Category
SET CachedCategoryTemplate = '.$inst_ado->qstr($category_template).'
WHERE ParentPath LIKE "|'.$module_root.'|%';
$inst_ado->Execute($sql);
}
/**
* [UPGRADE] Moves custom field values for prefix specified from CustomMetaData table to prefix dependant separate table
*
* @param string $prefix
*/
function convertCustomFields($prefix)
{
$application =& kApplication::Instance();
$ml_helper =& $application->recallObject('kMultiLanguageHelper');
$ml_helper->createFields($prefix.'-cdata', true);
$db =& $application->GetADODBConnection();
$custom_fields = $application->getUnitOption($prefix, 'CustomFields');
if (!$custom_fields) {
return true;
}
$custom_table = $application->getUnitOption($prefix.'-cdata', 'TableName');
// copy value from Value field to l<lang_id>_Value field, where destination field is empty
$m_lang = $application->GetVar('m_lang');
$sql = 'UPDATE '.TABLE_PREFIX.'CustomMetaData
SET l'.$m_lang.'_Value = Value
WHERE LENGTH(l'.$m_lang.'_Value) = 0';
$db->Query($sql);
$i = 1;
$field_mask = '';
$language_count = $ml_helper->getLanguageCount();
while ($i <= $language_count) {
$field_mask .= 'cdata%1$s.l'.$i.'_Value AS l'.$i.'_cust_%1$s, ';
$i++;
}
$field_mask = preg_replace('/(.*), $/', '\\1', $field_mask);
$join_mask = 'LEFT JOIN '.TABLE_PREFIX.'CustomMetaData cdata%1$s ON main_table.ResourceId = cdata%1$s.ResourceId AND cdata%1$s.CustomFieldId = %1$s';
$fields_sql = Array();
$joins_sql = Array();
foreach ($custom_fields as $custom_id => $custom_name) {
array_push($fields_sql, sprintf($field_mask, $custom_id) );
array_push($joins_sql, sprintf($join_mask, $custom_id));
}
$sql = 'INSERT INTO '.$custom_table.'
SELECT 0 AS CustomDataId, main_table.ResourceId, '.implode(', ', $fields_sql).'
FROM '.$application->getUnitOption($prefix, 'TableName').' main_table '.implode(' ', $joins_sql);
$db->Query($sql);
}
/**
* [INSTALL] Link custom field records with search config records + create custom field columns
*
* @param string $module_name
* @param int $item_type
*/
function linkCustomFields($module_name, $prefix, $item_type)
{
$application =& kApplication::Instance();
$db =& $application->GetADODBConnection();
$sql = 'SELECT FieldName, CustomFieldId
FROM '.TABLE_PREFIX.'CustomField
WHERE Type = '.$item_type.' AND IsSystem = 0'; // config is not read here yet :( $application->getUnitOption('p', 'ItemType');
$custom_fields = $db->GetCol($sql, 'CustomFieldId');
foreach ($custom_fields as $cf_id => $cf_name) {
$sql = 'UPDATE '.TABLE_PREFIX.'SearchConfig
SET CustomFieldId = '.$cf_id.'
WHERE (TableName = "CustomField") AND (LOWER(ModuleName) = "'.strtolower($module_name).'") AND (FieldName = '.$db->qstr($cf_name).')';
$db->Query($sql);
}
$application->refreshModuleInfo(); // this module configs are now processed
// because of configs was read only from installed before modules (in-portal), then reread configs
$unit_config_reader =& $application->recallObject('kUnitConfigReader');
$unit_config_reader->scanModules(MODULES_PATH.'/'.strtolower($module_name));
// create correct columns in ProductsCustomData table
$ml_helper =& $application->recallObject('kMultiLanguageHelper');
$ml_helper->createFields($prefix.'-cdata', true);
}
function moveItemTemplatesToCustom($module_name, $prefix)
{
$application =& kApplication::Instance();
$root_parent_path = $application->Conn->GetOne(
'SELECT ParentPath FROM '.TABLE_PREFIX.'Category
WHERE CategoryId = '.$application->ModuleInfo[$module_name]['RootCat']);
$item_t_customfield = $application->Conn->GetOne('SELECT CustomFieldId FROM '.TABLE_PREFIX.'CustomField WHERE FieldName = \''.$prefix.'_ItemTemplate\'');
$item_t_customfield = 'l1_cust_'.$item_t_customfield;
$current_item_tpls = $application->Conn->Query(
'SELECT ResourceId, ItemTemplate FROM '.TABLE_PREFIX.'Category
WHERE ParentPath LIKE "'.$root_parent_path.'%" AND ItemTemplate != "" AND ItemTemplate IS NOT NULL');
foreach ($current_item_tpls as $a_cat) {
$has_cdata = $application->Conn->GetOne(
'SELECT CustomDataId FROM '.TABLE_PREFIX.'CategoryCustomData
WHERE ResourceId = '.$a_cat['ResourceId']);
if (!$has_cdata) {
$query = 'INSERT INTO '.TABLE_PREFIX.'CategoryCustomData (ResourceId) VALUES ('.$a_cat['ResourceId'].')';
$application->Conn->Query($query);
}
$query = 'UPDATE '.TABLE_PREFIX.'CategoryCustomData
SET '.$item_t_customfield.' = '.$application->Conn->qstr($a_cat['ItemTemplate']).'
WHERE ResourceId = '.$a_cat['ResourceId'];
$application->Conn->Query($query);
}
}
?>
Property changes on: trunk/admin/install/install_lib.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.47
\ No newline at end of property
+1.48
\ No newline at end of property
Index: trunk/admin/install/upgrades/readme_1_4_0.txt
===================================================================
--- trunk/admin/install/upgrades/readme_1_4_0.txt (revision 7634)
+++ trunk/admin/install/upgrades/readme_1_4_0.txt (revision 7635)
@@ -1,20 +1,18 @@
Readme notes for In-Portal 1.4.0
Intechnic Corporation, Feb 23, 2007
This release primarily includes major backend improvements and current bug fixes. New improvements are fundamental for system optimization as well as flexibility in customizing and developing in new and improving already existing features. Significant changes were made to the file system structure - in-portal/kernel/kernel4 folder has moved to in-portal/core folder. For complete list of file change refer to changelog_1_4_0.txt
New Features:
- Improved Regional Number formating
- Security code for Subscribe to mailing list feature
Bugs:
- Review listings in Admin
- Category sorting
- Overwriting Auto FileName option in Mod-rewrite mode
- Updating Modification date for items
-- Shortcuts to Pending items on Section Overview
-
-
+- Shortcuts to Pending items on Section Overview
\ No newline at end of file
Property changes on: trunk/admin/install/upgrades/readme_1_4_0.txt
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/upgrades/changelog_1_4_0.txt
===================================================================
--- trunk/admin/install/upgrades/changelog_1_4_0.txt (revision 7634)
+++ trunk/admin/install/upgrades/changelog_1_4_0.txt (revision 7635)
@@ -1,806 +1,851 @@
File in-portal/compat.php is removed; release_1_3_1 revision 1.2
File in-portal/globals.php is removed; release_1_3_1 revision 1.109
File in-portal/html_parse.php is removed; release_1_3_1 revision 1.1
File in-portal/index.php changed
File in-portal/new_phrases.txt is removed; release_1_3_1 revision 1.11
File in-portal/obscure.php is removed; release_1_3_1 revision 1.8
File in-portal/png_replace.php is removed; release_1_3_1 revision 1.1
File in-portal/robots_list.txt is removed; release_1_3_1 revision 1.1
File in-portal/root.flg is removed; release_1_3_1 revision 1.1
File in-portal/sql.error is removed; release_1_3_1 revision 1.1
File in-portal/admin/index.php changed
File in-portal/admin/index4_direct.php changed
File in-portal/admin/install.php changed
File in-portal/admin/install_over_kx.php is new; release_1_4_0 revision 1.1.2.9
File in-portal/admin/relation_select.php changed
+File in-portal/admin/browse/fw_menu.js changed
File in-portal/admin/help/install_help.php changed
File in-portal/admin/import/step2.php changed
File in-portal/admin/include/mainscript.php changed
File in-portal/admin/include/sections.php changed
File in-portal/admin/install/inportal_data.sql changed
File in-portal/admin/install/inportal_remove.sql changed
File in-portal/admin/install/inportal_schema.sql changed
File in-portal/admin/install/inst_ado.php changed
File in-portal/admin/install/install_lib.php changed
File in-portal/admin/install/prerequisit_errors.php changed
File in-portal/admin/install/upgrade_errors.php changed
+File in-portal/admin/install/langpacks/english.lang changed
File in-portal/admin/install/upgrades/changelog_1_3_0.txt changed
-File in-portal/admin/install/upgrades/changelog_1_4_0.txt is new; release_1_4_0 revision 1.1.2.7
+File in-portal/admin/install/upgrades/changelog_1_4_0.txt is new; release_1_4_0 revision 1.1.2.15
File in-portal/admin/install/upgrades/inportal_upgrade_v1.3.2.sql is new; release_1_4_0 revision 1.1.2.2
File in-portal/admin/install/upgrades/inportal_upgrade_v1.4.0.sql is new; release_1_4_0 revision 1.1.2.1
File in-portal/admin/users/adduser.php changed
File in-portal/admin/users/user_list.php changed
File in-portal/compat/array_change_key_case.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/array_chunk.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/array_combine.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/array_diff_assoc.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/array_key_exists.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/array_search.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/array_udiff.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/array_udiff_assoc.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/call_user_func_array.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/constant.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/file_get_contents.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/file_put_contents.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/fprintf.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/html_entity_decode.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/http_build_query.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/image_type_to_mime_type.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/is_a.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/ob_clean.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/ob_flush.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/ob_get_clean.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/ob_get_flush.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/scandir.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/str_ireplace.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/str_split.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/stripos.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/strripos.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/var_export.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/version_compare.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/vprintf.php is removed; release_1_3_1 revision 1.1
File in-portal/compat/vsprintf.php is removed; release_1_3_1 revision 1.1
File in-portal/core/dummy is new; release_1_4_0 revision 1.1
File in-portal/kernel/action.php changed
File in-portal/kernel/constants.php is removed; release_1_3_1 revision 1.8
File in-portal/kernel/frontaction.php changed
File in-portal/kernel/parser.php changed
File in-portal/kernel/startup.php changed
File in-portal/kernel/admin_templates/advanced_view.tpl changed
File in-portal/kernel/admin_templates/catalog.tpl changed
File in-portal/kernel/admin_templates/catalog_tab.tpl changed
+File in-portal/kernel/admin_templates/group_selector.tpl is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/admin_templates/head.tpl is removed; release_1_3_1 revision 1.4
File in-portal/kernel/admin_templates/index.tpl is removed; release_1_3_1 revision 1.8
File in-portal/kernel/admin_templates/login.tpl is removed; release_1_3_1 revision 1.4
File in-portal/kernel/admin_templates/logout.tpl is removed; release_1_3_1 revision 1.2
File in-portal/kernel/admin_templates/sections_list.tpl is removed; release_1_3_1 revision 1.9.2.1
File in-portal/kernel/admin_templates/tree.tpl is removed; release_1_3_1 revision 1.17
File in-portal/kernel/admin_templates/categories/cache_updater.tpl changed
File in-portal/kernel/admin_templates/categories/categories_edit.tpl changed
File in-portal/kernel/admin_templates/categories/categories_edit_custom.tpl changed
File in-portal/kernel/admin_templates/categories/categories_edit_images.tpl changed
File in-portal/kernel/admin_templates/categories/categories_edit_permissions.tpl changed
File in-portal/kernel/admin_templates/categories/categories_edit_properties.tpl changed
File in-portal/kernel/admin_templates/categories/categories_edit_relations.tpl changed
File in-portal/kernel/admin_templates/categories/categories_tabs.tpl changed
File in-portal/kernel/admin_templates/categories/ci_blocks.tpl changed
File in-portal/kernel/admin_templates/categories/images_edit.tpl changed
+File in-portal/kernel/admin_templates/categories/permissions_tab.tpl changed
File in-portal/kernel/admin_templates/categories/relations_edit.tpl changed
File in-portal/kernel/admin_templates/custom_fields/custom_fields_edit.tpl changed
File in-portal/kernel/admin_templates/custom_fields/custom_fields_list.tpl changed
File in-portal/kernel/admin_templates/groups/groups_edit.tpl changed
File in-portal/kernel/admin_templates/groups/groups_edit_permissions.tpl changed
File in-portal/kernel/admin_templates/groups/groups_edit_tabs.tpl changed
File in-portal/kernel/admin_templates/groups/groups_edit_users.tpl changed
File in-portal/kernel/admin_templates/groups/groups_list.tpl changed
File in-portal/kernel/admin_templates/img/ajax_progress.gif is removed; release_1_3_1 revision 1.1
File in-portal/kernel/admin_templates/img/arrow.gif is removed; release_1_3_1 revision 1.2
File in-portal/kernel/admin_templates/img/list_arrow_2_asc.gif is removed; release_1_3_1 revision 1.2
File in-portal/kernel/admin_templates/img/list_arrow_2_desc.gif is removed; release_1_3_1 revision 1.2
File in-portal/kernel/admin_templates/img/list_arrow_asc.gif is removed; release_1_3_1 revision 1.2
File in-portal/kernel/admin_templates/img/list_arrow_desc.gif is removed; release_1_3_1 revision 1.2
File in-portal/kernel/admin_templates/img/list_arrow_no.gif is removed; release_1_3_1 revision 1.2
File in-portal/kernel/admin_templates/img/tabnav_back.gif is removed; release_1_3_1 revision 1.2
File in-portal/kernel/admin_templates/img/tabnav_left.gif is removed; release_1_3_1 revision 1.2
File in-portal/kernel/admin_templates/img/itemtabs/tab_left.gif is removed; release_1_3_1 revision 1.1
File in-portal/kernel/admin_templates/img/itemtabs/tab_middle.gif is removed; release_1_3_1 revision 1.1
File in-portal/kernel/admin_templates/img/itemtabs/tab_right.gif is removed; release_1_3_1 revision 1.1
File in-portal/kernel/admin_templates/incs/ajax.js is removed; release_1_3_1 revision 1.16.2.1
File in-portal/kernel/admin_templates/incs/blocks.tpl is removed; release_1_3_1 revision 1.6
File in-portal/kernel/admin_templates/incs/calendar.js is removed; release_1_3_1 revision 1.2
File in-portal/kernel/admin_templates/incs/catalog.js changed
File in-portal/kernel/admin_templates/incs/custom_blocks.tpl changed
File in-portal/kernel/admin_templates/incs/footer.tpl is removed; release_1_3_1 revision 1.7
File in-portal/kernel/admin_templates/incs/form_blocks.tpl is removed; release_1_3_1 revision 1.46.2.1
File in-portal/kernel/admin_templates/incs/fw_menu.js changed
File in-portal/kernel/admin_templates/incs/grid.js is removed; release_1_3_1 revision 1.12
File in-portal/kernel/admin_templates/incs/grid_blocks.tpl is removed; release_1_3_1 revision 1.38.2.1
File in-portal/kernel/admin_templates/incs/header.tpl is removed; release_1_3_1 revision 1.19.2.1
File in-portal/kernel/admin_templates/incs/header_mini.tpl changed
File in-portal/kernel/admin_templates/incs/in-portal.js is removed; release_1_3_1 revision 1.2
File in-portal/kernel/admin_templates/incs/in-portal.tpl is removed; release_1_3_1 revision 1.2
File in-portal/kernel/admin_templates/incs/is.js is removed; release_1_3_1 revision 1.3
File in-portal/kernel/admin_templates/incs/script.js is removed; release_1_3_1 revision 1.42.2.1
File in-portal/kernel/admin_templates/incs/style.css is removed; release_1_3_1 revision 1.18
File in-portal/kernel/admin_templates/incs/tab_blocks.tpl is removed; release_1_3_1 revision 1.5
File in-portal/kernel/admin_templates/incs/toolbar.js is removed; release_1_3_1 revision 1.11
File in-portal/kernel/admin_templates/incs/tree.js is removed; release_1_3_1 revision 1.11
File in-portal/kernel/admin_templates/item_selector/item_selector_advanced_view.tpl changed
File in-portal/kernel/admin_templates/item_selector/item_selector_catalog.tpl changed
File in-portal/kernel/admin_templates/item_selector/item_selector_tabs.tpl changed
File in-portal/kernel/admin_templates/item_selector/item_selector_toolbar.tpl changed
File in-portal/kernel/admin_templates/modules/modules_list.tpl changed
File in-portal/kernel/admin_templates/popups/translator.tpl changed
File in-portal/kernel/admin_templates/stylesheets/base_style_edit.tpl changed
File in-portal/kernel/admin_templates/stylesheets/block_style_edit.tpl changed
File in-portal/kernel/admin_templates/stylesheets/style_editor.tpl changed
File in-portal/kernel/admin_templates/stylesheets/stylesheets_edit.tpl changed
File in-portal/kernel/admin_templates/stylesheets/stylesheets_edit_base.tpl changed
File in-portal/kernel/admin_templates/stylesheets/stylesheets_edit_block.tpl changed
File in-portal/kernel/admin_templates/stylesheets/stylesheets_list.tpl changed
File in-portal/kernel/admin_templates/stylesheets/stylesheets_tabs.tpl changed
File in-portal/kernel/admin_templates/summary/root.tpl changed
File in-portal/kernel/admin_templates/tools/system_tools.tpl is removed; release_1_3_1 revision 1.3
File in-portal/kernel/admin_templates/visits/visits_list.tpl changed
File in-portal/kernel/admin_templates/xml/cache_updater.tpl changed
File in-portal/kernel/admin_templates/xml/categories_list.tpl changed
File in-portal/kernel/admin_templates/xml/tree_categories.tpl changed
+File in-portal/kernel/include/category.php changed
File in-portal/kernel/include/compat.php is new; release_1_4_0 revision 1.1.2.2
File in-portal/kernel/include/customfield.php changed
-File in-portal/kernel/include/globals.php is new; release_1_4_0 revision 1.1.2.2
+File in-portal/kernel/include/custommetadata.php changed
+File in-portal/kernel/include/globals.php is new; release_1_4_0 revision 1.1.2.3
File in-portal/kernel/include/item.php changed
+File in-portal/kernel/include/itemreview.php changed
File in-portal/kernel/include/modules.php changed
File in-portal/kernel/include/obscure.php is new; release_1_4_0 revision 1.1.2.2
File in-portal/kernel/include/robots_list.txt is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/usersession.php changed
File in-portal/kernel/include/compat/array_change_key_case.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/array_chunk.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/array_combine.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/array_diff_assoc.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/array_key_exists.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/array_search.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/array_udiff.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/array_udiff_assoc.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/call_user_func_array.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/constant.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/file_get_contents.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/file_put_contents.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/fprintf.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/html_entity_decode.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/http_build_query.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/image_type_to_mime_type.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/is_a.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/ob_clean.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/ob_flush.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/ob_get_clean.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/ob_get_flush.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/scandir.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/str_ireplace.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/str_split.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/stripos.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/strripos.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/var_export.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/version_compare.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/vprintf.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/include/compat/vsprintf.php is new; release_1_4_0 revision 1.1.2.1
File in-portal/kernel/units/admin/admin_config.php is removed; release_1_3_1 revision 1.16
File in-portal/kernel/units/admin/admin_events_handler.php is removed; release_1_3_1 revision 1.2
File in-portal/kernel/units/admin/admin_tag_processor.php is removed; release_1_3_1 revision 1.25.2.5
File in-portal/kernel/units/categories/cache_updater.php is removed; release_1_3_1 revision 1.7.2.1
File in-portal/kernel/units/categories/categories_config.php is removed; release_1_3_1 revision 1.51.2.1
File in-portal/kernel/units/categories/categories_event_handler.php is removed; release_1_3_1 revision 1.23.2.1
File in-portal/kernel/units/categories/categories_item.php is removed; release_1_3_1 revision 1.10
File in-portal/kernel/units/categories/categories_tag_processor.php is removed; release_1_3_1 revision 1.30.2.1
File in-portal/kernel/units/category_items/category_items_config.php is removed; release_1_3_1 revision 1.12
File in-portal/kernel/units/category_items/category_items_dbitem.php is removed; release_1_3_1 revision 1.4
File in-portal/kernel/units/category_items/category_items_event_handler.php is removed; release_1_3_1 revision 1.8
File in-portal/kernel/units/category_items/category_items_tag_processor.php is removed; release_1_3_1 revision 1.6
File in-portal/kernel/units/config_search/config_search_event_handler.php changed
File in-portal/kernel/units/configuration/configuration.php is removed; release_1_3_1 revision 1.1
File in-portal/kernel/units/configuration/configuration_config.php is removed; release_1_3_1 revision 1.15
File in-portal/kernel/units/configuration/configuration_event_handler.php is removed; release_1_3_1 revision 1.17
File in-portal/kernel/units/configuration/configuration_tag_processor.php is removed; release_1_3_1 revision 1.14
File in-portal/kernel/units/custom_data/custom_data_config.php is removed; release_1_3_1 revision 1.9
File in-portal/kernel/units/custom_data/custom_data_event_handler.php is removed; release_1_3_1 revision 1.1
File in-portal/kernel/units/custom_fields/custom_fields_config.php is removed; release_1_3_1 revision 1.11.2.1
File in-portal/kernel/units/custom_fields/custom_fields_event_handler.php is removed; release_1_3_1 revision 1.15
File in-portal/kernel/units/custom_fields/custom_fields_tag_processor.php is removed; release_1_3_1 revision 1.3.2.1
File in-portal/kernel/units/email_events/email_events_config.php is removed; release_1_3_1 revision 1.5.22.2
File in-portal/kernel/units/email_events/email_events_event_handler.php is removed; release_1_3_1 revision 1.26.2.1
File in-portal/kernel/units/email_messages/email_messages_config.php is removed; release_1_3_1 revision 1.2
File in-portal/kernel/units/email_messages/email_messages_event_handler.php is removed; release_1_3_1 revision 1.3.52.1
File in-portal/kernel/units/general/brackets.php is removed; release_1_3_1 revision 1.4
File in-portal/kernel/units/general/cat_dbitem.php is removed; release_1_3_1 revision 1.33.2.1
File in-portal/kernel/units/general/cat_dbitem_export.php is removed; release_1_3_1 revision 1.21.2.2
File in-portal/kernel/units/general/cat_dblist.php is removed; release_1_3_1 revision 1.4
File in-portal/kernel/units/general/cat_event_handler.php is removed; release_1_3_1 revision 1.66.2.2
File in-portal/kernel/units/general/cat_tag_processor.php is removed; release_1_3_1 revision 1.13.2.1
File in-portal/kernel/units/general/country_states.php is removed; release_1_3_1 revision 1.4
File in-portal/kernel/units/general/custom_fields.php is removed; release_1_3_1 revision 1.8
File in-portal/kernel/units/general/general_config.php is removed; release_1_3_1 revision 1.8.2.1
File in-portal/kernel/units/general/inp1_parser.php is removed; release_1_3_1 revision 1.16
File in-portal/kernel/units/general/inp_db_event_handler.php is removed; release_1_3_1 revision 1.10
File in-portal/kernel/units/general/inp_ses_storage.php is removed; release_1_3_1 revision 1.21
File in-portal/kernel/units/general/inp_temp_handler.php is removed; release_1_3_1 revision 1.5
File in-portal/kernel/units/general/main_event_handler.php is removed; release_1_3_1 revision 1.15
File in-portal/kernel/units/general/my_application.php is removed; release_1_3_1 revision 1.32.2.1
File in-portal/kernel/units/general/xml_helper.php is removed; release_1_3_1 revision 1.6
File in-portal/kernel/units/general/helpers/clipboard_helper.php is removed; release_1_3_1 revision 1.2
File in-portal/kernel/units/general/helpers/filenames_helper.php is removed; release_1_3_1 revision 1.2.2.1
File in-portal/kernel/units/general/helpers/helpers_config.php is removed; release_1_3_1 revision 1.3
File in-portal/kernel/units/general/helpers/mod_rewrite_helper.php is removed; release_1_3_1 revision 1.6.2.1
File in-portal/kernel/units/general/helpers/modules.php is removed; release_1_3_1 revision 1.6
File in-portal/kernel/units/general/helpers/multilanguage.php is removed; release_1_3_1 revision 1.8
File in-portal/kernel/units/general/helpers/permissions_helper.php is removed; release_1_3_1 revision 1.19.2.1
File in-portal/kernel/units/general/helpers/recursive_helper.php is removed; release_1_3_1 revision 1.3
File in-portal/kernel/units/general/helpers/search_helper.php is removed; release_1_3_1 revision 1.2
File in-portal/kernel/units/general/helpers/sections_helper.php is removed; release_1_3_1 revision 1.9
File in-portal/kernel/units/groups/groups_config.php is removed; release_1_3_1 revision 1.13
File in-portal/kernel/units/groups/groups_event_handler.php is removed; release_1_3_1 revision 1.1
File in-portal/kernel/units/groups/groups_item.php is removed; release_1_3_1 revision 1.1
File in-portal/kernel/units/help/help_event_handler.php changed
File in-portal/kernel/units/images/image_event_handler.php changed
File in-portal/kernel/units/languages/import_xml.php is removed; release_1_3_1 revision 1.20.2.1
File in-portal/kernel/units/languages/languages_config.php is removed; release_1_3_1 revision 1.16.2.1
File in-portal/kernel/units/languages/languages_event_handler.php is removed; release_1_3_1 revision 1.27
File in-portal/kernel/units/languages/languages_item.php is removed; release_1_3_1 revision 1.6.2.1
File in-portal/kernel/units/languages/languages_tag_processor.php is removed; release_1_3_1 revision 1.6
File in-portal/kernel/units/modules/modules_config.php changed
File in-portal/kernel/units/modules/modules_event_handler.php changed
File in-portal/kernel/units/permissions/permissions_config.php is removed; release_1_3_1 revision 1.3
File in-portal/kernel/units/permissions/permissions_event_handler.php is removed; release_1_3_1 revision 1.7
File in-portal/kernel/units/permissions/permissions_tag_processor.php is removed; release_1_3_1 revision 1.9
File in-portal/kernel/units/phrases/phrases_config.php is removed; release_1_3_1 revision 1.9
File in-portal/kernel/units/phrases/phrases_event_handler.php is removed; release_1_3_1 revision 1.10.2.2
File in-portal/kernel/units/relationship/relationship_event_handler.php changed
+File in-portal/kernel/units/reviews/reviews_config.php changed
File in-portal/kernel/units/reviews/reviews_event_handler.php changed
File in-portal/kernel/units/reviews/reviews_tag_processor.php changed
-File in-portal/kernel/units/sections/sections_config.php is new; release_1_4_0 revision 1.1.2.4
+File in-portal/kernel/units/sections/sections_config.php is new; release_1_4_0 revision 1.1.2.5
File in-portal/kernel/units/selectors/selectors_event_handler.php changed
File in-portal/kernel/units/statistics/statistics_event_handler.php changed
File in-portal/kernel/units/stylesheets/stylesheets_config.php changed
File in-portal/kernel/units/stylesheets/stylesheets_event_handler.php changed
File in-portal/kernel/units/themes/themes_config.php is removed; release_1_3_1 revision 1.5
File in-portal/kernel/units/themes/themes_tag_processor.php is removed; release_1_3_1 revision 1.7
File in-portal/kernel/units/translator/translator_config.php is removed; release_1_3_1 revision 1.4
File in-portal/kernel/units/translator/translator_event_handler.php is removed; release_1_3_1 revision 1.8
File in-portal/kernel/units/user_groups/user_groups_config.php is removed; release_1_3_1 revision 1.2
File in-portal/kernel/units/users/users_config.php is removed; release_1_3_1 revision 1.30.2.1
File in-portal/kernel/units/users/users_event_handler.php is removed; release_1_3_1 revision 1.65.2.2
File in-portal/kernel/units/users/users_item.php is removed; release_1_3_1 revision 1.11.2.2
File in-portal/kernel/units/users/users_syncronize.php is removed; release_1_3_1 revision 1.4
File in-portal/kernel/units/users/users_tag_processor.php is removed; release_1_3_1 revision 1.14
File in-portal/kernel/units/visits/visits_config.php changed
File in-portal/kernel/units/visits/visits_event_handler.php changed
File in-portal/kernel/units/visits/visits_tag_processor.php changed
File in-portal/themes/default/captcha_image.tpl is new; release_1_4_0 revision 1.1.2.1
+File in-portal/themes/default/common/footer.tpl changed
File in-portal/themes/default/misc/right_recommend.tpl changed
File in-portal/themes/default/recommend/captcha.tpl is new; release_1_4_0 revision 1.1.2.1
File in-portal/themes/default/search_results/cat_search_results.tpl changed
File kernel4_dev/kernel4/application.php changed
File kernel4_dev/kernel4/constants.php is new; release_1_4_0 revision 1.3.4.2
File kernel4_dev/kernel4/event_handler.php changed
File kernel4_dev/kernel4/event_manager.php changed
File kernel4_dev/kernel4/globals.php changed
File kernel4_dev/kernel4/kbase.php changed
File kernel4_dev/kernel4/startup.php changed
File kernel4_dev/kernel4/db/db_connection.php changed
File kernel4_dev/kernel4/db/db_event_handler.php changed
File kernel4_dev/kernel4/db/db_tag_processor.php changed
File kernel4_dev/kernel4/db/dbitem.php changed
File kernel4_dev/kernel4/db/dblist.php changed
File kernel4_dev/kernel4/fonts/monofont.ttf is new; release_1_4_0 revision 1.1.2.1
File kernel4_dev/kernel4/fonts/monofont_read_me.txt is new; release_1_4_0 revision 1.1.2.1
+File kernel4_dev/kernel4/languages/phrases_cache.php changed
File kernel4_dev/kernel4/parser/tags.php changed
File kernel4_dev/kernel4/parser/template.php changed
File kernel4_dev/kernel4/parser/template_parser.php changed
File kernel4_dev/kernel4/processors/main_processor.php changed
File kernel4_dev/kernel4/processors/tag_processor.php changed
File kernel4_dev/kernel4/session/session.php changed
File kernel4_dev/kernel4/utility/debugger.php changed
File kernel4_dev/kernel4/utility/event.php changed
+File kernel4_dev/kernel4/utility/http_query.php changed
File kernel4_dev/kernel4/utility/temp_handler.php changed
File kernel4_dev/kernel4/utility/unit_config_reader.php changed
File kernel4_dev/kernel4/utility/debugger/debugger.css changed
File kernel4_dev/kernel4/utility/debugger/debugger.js changed
File kernel4_dev/kernel4/utility/debugger/debugger_responce.php changed
File kernel4_dev/kernel4/utility/formatters/formatter.php changed
+File kernel4_dev/kernel4/utility/formatters/multilang_formatter.php changed
File kernel4_dev/kernel4/utility/formatters/password_formatter.php changed
+File kernel4_dev/kernel4/utility/formatters/unit_formatter.php changed
File kernel.X/core/admin_templates/dummy is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/head.tpl is new; release_1_4_0 revision 1.2.2.3
File kernel.X/core/admin_templates/index.tpl is new; release_1_4_0 revision 1.2.2.3
File kernel.X/core/admin_templates/login.tpl is new; release_1_4_0 revision 1.1.2.5
File kernel.X/core/admin_templates/logout.tpl is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/no_permission.tpl is new; release_1_4_0 revision 1.1.2.2
File kernel.X/core/admin_templates/sections_list.tpl is new; release_1_4_0 revision 1.2.2.4
-File kernel.X/core/admin_templates/tree.tpl is new; release_1_4_0 revision 1.2.2.4
+File kernel.X/core/admin_templates/tree.tpl is new; release_1_4_0 revision 1.2.2.6
File kernel.X/core/admin_templates/ajax/popup_manager.tpl is new; release_1_4_0 revision 1.1.2.1
-File kernel.X/core/admin_templates/config/config_email.tpl is new; release_1_4_0 revision 1.1.2.3
+File kernel.X/core/admin_templates/config/config_email.tpl is new; release_1_4_0 revision 1.1.2.4
File kernel.X/core/admin_templates/config/config_general.tpl is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/config/config_search.tpl is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/config/config_search_edit.tpl is new; release_1_4_0 revision 1.1.2.1
-File kernel.X/core/admin_templates/config/config_universal.tpl is new; release_1_4_0 revision 1.1.2.2
+File kernel.X/core/admin_templates/config/config_universal.tpl is new; release_1_4_0 revision 1.1.2.4
File kernel.X/core/admin_templates/custom_fields/custom_fields_edit.tpl is new; release_1_4_0 revision 1.1.2.2
File kernel.X/core/admin_templates/custom_fields/custom_fields_list.tpl is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/ajax_progress.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/arrow.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/blank.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/blocks.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/blue_bar_help.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/blue_bar_logout.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/button_back.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/button_back_disabled.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/calendar_icon.gif is new; release_1_4_0 revision 1.1.2.2
File kernel.X/core/admin_templates/img/check_on.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/favicon.ico is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/globe.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/link_arrow.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/list_arrow_2_asc.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/list_arrow_2_desc.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/list_arrow_asc.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/list_arrow_desc.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/list_arrow_no.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/logo.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/logo_bg.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/menu_arrow.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/menu_bar.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/menu_dot.gif is new; release_1_4_0 revision 1.1
+File kernel.X/core/admin_templates/img/perm_green.gif is new; release_1_4_0 revision 1.1.2.1
+File kernel.X/core/admin_templates/img/perm_red.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/progress_done.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/progress_left.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/spacer.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/submenu.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/submenuovr.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/tab.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tab_active_back.jpg is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tab_active_back2.jpg is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tab_active_back3.jpg is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tab_active_left.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tab_active_right.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tab_back.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tab_back.jpg is new; release_1_4_0 revision 1.1.2.1
+File kernel.X/core/admin_templates/img/tab_back3.jpg is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/tab_left.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tab_right.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tabnav_back.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tabnav_left.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/version_bg.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/icons/icon24_cat.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/icons/icon24_conf.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/icons/icon24_conf_general.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/icons/icon24_conf_regional.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/icons/icon24_e-mail.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/icons/icon24_help.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/icons/icon24_link_editor.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/icons/icon24_lock_login.gif is new; release_1_4_0 revision 1.1
+File kernel.X/core/admin_templates/img/icons/icon24_modules.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/icons/icon24_site.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/icons/icon24_translate.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/icons/icon46_conf.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/icons/icon46_conf_general.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/icons/icon46_conf_regional.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/icons/icon46_help.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/icons/icon46_list_conf.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/icons/icon46_list_conf_general.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/icons/icon46_list_conf_regional.gif is new; release_1_4_0 revision 1.1
+File kernel.X/core/admin_templates/img/icons/icon46_list_modules.gif is new; release_1_4_0 revision 1.1.2.1
+File kernel.X/core/admin_templates/img/icons/icon46_modules.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/icons/icon46_settings_general.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/icons/icon46_site.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/icons/icon_left.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/icons/icon_right.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_cat.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_cat_attn.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_cat_deleted.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_cat_denied.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_cat_disabled.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_cat_hot.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_cat_new.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_cat_pending.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_cat_pick.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_cat_top.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_custom.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/itemicons/icon16_custom_disabled.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/itemicons/icon16_group.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_group_disabled.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_image.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_image_disabled.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_image_primary.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_language.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/itemicons/icon16_language_disabled.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/itemicons/icon16_language_primary.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/itemicons/icon16_language_var.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/itemicons/icon16_permission.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_relation_one-way.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_relation_one-way_disabled.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_relation_reciprocal.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_relation_reciprocal_disabled.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_review.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_review_disabled.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_review_pending.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_search.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_search_dropdown.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_search_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_search_reset.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_search_reset_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_selector.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_style.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_style_disabled.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_template.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_theme.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_theme_disabled.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_theme_primary.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_user.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_user_attn.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_user_deleted.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_user_denied.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_user_disabled.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icon16_user_pending.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemicons/icons16_permissions_inherited.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/itemtabs/tab_left.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/itemtabs/tab_middle.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/itemtabs/tab_right.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/arrow16.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/arrow16_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/icon16_search.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/icon16_search_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/icon16_search_reset.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/icon16_search_reset_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_add.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_add_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_add_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_approve.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_approve_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_approve_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_archive.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_archive_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_archive_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_arrange.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_arrange_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_cancel.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_cancel_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_cancel_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_clear_all.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_clear_all_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_clone.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_clone_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_clone_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_decline.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_decline_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_decline_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_delete.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_delete_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_delete_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_deny.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_deny_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_deny_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_divider.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_e-mail.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_e-mail_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_e-mail_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_edit.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_edit_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_edit_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_export_language.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_export_language_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_export_language_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_flip.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_flip_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_frontend_mail.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_frontend_mail_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_frontend_mail_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_goto_order.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_goto_order_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_goto_order_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_homecat.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_homecat_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_homecat_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_import_language.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_import_language_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_import_language_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_infinity.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_infinity_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_modify.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_modify_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_modify_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_more_brackets.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_more_brackets_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_move_down.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_move_down_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_move_down_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_move_up.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_move_up_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_move_up_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_affiliate.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_affiliate_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_affiliate_payment_type.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_affiliate_payment_type_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_affiliate_plan.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_affiliate_plan_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_cat.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_cat_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_cat_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_group.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_group_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_group_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_image.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_image_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_image_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_item.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_item_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_item_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_language.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_language_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_language_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_language_var.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_language_var_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_language_var_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_manufacturer.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_manufacturer_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_option.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_option_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_option_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_order.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_order_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_order_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_relation.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_relation_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_relation_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_review.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_review_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_review_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_selector.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_selector_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_shipping.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_shipping_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_style.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_new_style_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_next.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_next_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_next_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_place_order.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_place_order_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_place_order_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_prev.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_prev_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_prev_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_affiliate_payment_type.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_affiliate_payment_type_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_affiliate_payment_type_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_affiliate_plan.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_affiliate_plan_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_affiliate_plan_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_cat.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_cat_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_cat_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_currency.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_currency_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_currency_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_image.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_image_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_image_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_language.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_language_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_language_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_paymenttype.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_paymenttype_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_primary_paymenttype_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_print.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_print_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_print_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_process.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_process_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_process_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_recalculate_order.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_recalculate_order_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_recalculate_order_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_refresh.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_refresh_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_refresh_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_reset.gif is new; release_1_4_0 revision 1.1.2.2
+File kernel.X/core/admin_templates/img/toolbar/tool_reset_edit.gif is new; release_1_4_0 revision 1.1.2.1
+File kernel.X/core/admin_templates/img/toolbar/tool_reset_edit_f2.gif is new; release_1_4_0 revision 1.1.2.1
+File kernel.X/core/admin_templates/img/toolbar/tool_reset_edit_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_reset_f2.gif is new; release_1_4_0 revision 1.1.2.2
File kernel.X/core/admin_templates/img/toolbar/tool_reset_f3.gif is new; release_1_4_0 revision 1.1.2.2
File kernel.X/core/admin_templates/img/toolbar/tool_reset_to_base.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_reset_to_base_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_reset_to_base_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_reset_to_billing.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_reset_to_billing_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_reset_to_pending.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_reset_to_pending_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_reset_to_pending_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_reset_to_shipping.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_reset_to_shipping_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_reset_to_user.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_reset_to_user_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_search.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_search_a.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_search_a_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_search_b.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_search_b_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_search_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_search_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_search_reset.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_search_reset_alt.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_search_reset_alt_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_search_reset_alt_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_search_reset_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_search_reset_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_select.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_select_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_select_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_ship.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_ship_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_ship_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_upcat.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_upcat_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_upcat_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_update_rates.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_update_rates_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_update_rates_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_usertogroup.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_usertogroup2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_usertogroup2_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_usertogroup2_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_usertogroup_f2.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_usertogroup_f3.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/img/toolbar/tool_view.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_view_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/toolbar/tool_view_f3.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tree/ftv2blank.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tree/ftv2lastnode.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tree/ftv2mlastnode.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tree/ftv2mnode.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tree/ftv2node.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tree/ftv2plastnode.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tree/ftv2pnode.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/img/tree/ftv2vertline.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/incs/blocks.tpl is new; release_1_4_0 revision 1.1.2.4
File kernel.X/core/admin_templates/incs/close_popup.tpl is new; release_1_4_0 revision 1.1.2.7
File kernel.X/core/admin_templates/incs/config_blocks.tpl is new; release_1_4_0 revision 1.1
-File kernel.X/core/admin_templates/incs/footer.tpl is new; release_1_4_0 revision 1.1.2.6
-File kernel.X/core/admin_templates/incs/form_blocks.tpl is new; release_1_4_0 revision 1.4.2.9
+File kernel.X/core/admin_templates/incs/footer.tpl is new; release_1_4_0 revision 1.1.2.8
+File kernel.X/core/admin_templates/incs/form_blocks.tpl is new; release_1_4_0 revision 1.4.2.12
File kernel.X/core/admin_templates/incs/fw_menu.js is new; release_1_4_0 revision 1.1
-File kernel.X/core/admin_templates/incs/grid_blocks.tpl is new; release_1_4_0 revision 1.1.2.14
-File kernel.X/core/admin_templates/incs/header.tpl is new; release_1_4_0 revision 1.1.2.8
+File kernel.X/core/admin_templates/incs/grid_blocks.tpl is new; release_1_4_0 revision 1.1.2.16
+File kernel.X/core/admin_templates/incs/header.tpl is new; release_1_4_0 revision 1.1.2.10
File kernel.X/core/admin_templates/incs/in-portal.tpl is new; release_1_4_0 revision 1.1
File kernel.X/core/admin_templates/incs/menu_blocks.tpl is new; release_1_4_0 revision 1.1.2.5
File kernel.X/core/admin_templates/incs/nlsmenu.css is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/incs/sections_list.css is new; release_1_4_0 revision 1.1.2.1
-File kernel.X/core/admin_templates/incs/style.css is new; release_1_4_0 revision 1.2.2.9
-File kernel.X/core/admin_templates/incs/tab_blocks.tpl is new; release_1_4_0 revision 1.2.2.2
-File kernel.X/core/admin_templates/js/ajax.js is new; release_1_4_0 revision 1.1.2.6
+File kernel.X/core/admin_templates/incs/style.css is new; release_1_4_0 revision 1.2.2.10
+File kernel.X/core/admin_templates/incs/tab_blocks.tpl is new; release_1_4_0 revision 1.2.2.3
+File kernel.X/core/admin_templates/js/ajax.js is new; release_1_4_0 revision 1.1.2.7
File kernel.X/core/admin_templates/js/calendar.js is new; release_1_4_0 revision 1.1.2.3
-File kernel.X/core/admin_templates/js/grid.js is new; release_1_4_0 revision 1.1.2.3
-File kernel.X/core/admin_templates/js/grid_scroller.js is new; release_1_4_0 revision 1.1.2.14
+File kernel.X/core/admin_templates/js/grid.js is new; release_1_4_0 revision 1.1.2.4
+File kernel.X/core/admin_templates/js/grid_scroller.js is new; release_1_4_0 revision 1.1.2.17
File kernel.X/core/admin_templates/js/in-portal.js is new; release_1_4_0 revision 1.1
-File kernel.X/core/admin_templates/js/inp_fckconfig.js is new; release_1_4_0 revision 1.1.2.1
+File kernel.X/core/admin_templates/js/inp_fckconfig.js is new; release_1_4_0 revision 1.1.2.2
File kernel.X/core/admin_templates/js/inp_styles.xml is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/js/is.js is new; release_1_4_0 revision 1.1
-File kernel.X/core/admin_templates/js/nlsmenu.js is new; release_1_4_0 revision 1.1.2.3
+File kernel.X/core/admin_templates/js/nlsmenu.js is new; release_1_4_0 revision 1.1.2.4
File kernel.X/core/admin_templates/js/nlsmenueffect_1_2_1.js is new; release_1_4_0 revision 1.1.2.1
-File kernel.X/core/admin_templates/js/script.js is new; release_1_4_0 revision 1.2.2.18
-File kernel.X/core/admin_templates/js/toolbar.js is new; release_1_4_0 revision 1.3.2.7
-File kernel.X/core/admin_templates/js/tree.js is new; release_1_4_0 revision 1.1.2.3
+File kernel.X/core/admin_templates/js/script.js is new; release_1_4_0 revision 1.2.2.27
+File kernel.X/core/admin_templates/js/toolbar.js is new; release_1_4_0 revision 1.3.2.9
+File kernel.X/core/admin_templates/js/tree.js is new; release_1_4_0 revision 1.1.2.7
File kernel.X/core/admin_templates/js/calendar/calendar-blue.css is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/js/calendar/calendar-en.js is new; release_1_4_0 revision 1.1.2.2
File kernel.X/core/admin_templates/js/calendar/calendar-setup.js is new; release_1_4_0 revision 1.1.2.2
File kernel.X/core/admin_templates/js/calendar/calendar.js is new; release_1_4_0 revision 1.1.2.1
-File kernel.X/core/admin_templates/popups/column_picker.tpl is new; release_1_4_0 revision 1.1.2.7
-File kernel.X/core/admin_templates/popups/editor.tpl is new; release_1_4_0 revision 1.1.2.2
+File kernel.X/core/admin_templates/modules/modules_list.tpl is new; release_1_4_0 revision 1.1.2.1
+File kernel.X/core/admin_templates/popups/column_picker.tpl is new; release_1_4_0 revision 1.1.2.9
+File kernel.X/core/admin_templates/popups/editor.tpl is new; release_1_4_0 revision 1.1.2.3
File kernel.X/core/admin_templates/popups/translator.tpl is new; release_1_4_0 revision 1.1.2.3
File kernel.X/core/admin_templates/regional/email_messages_edit.tpl is new; release_1_4_0 revision 1.1.2.3
File kernel.X/core/admin_templates/regional/languages_edit.tpl is new; release_1_4_0 revision 1.1.2.6
File kernel.X/core/admin_templates/regional/languages_edit_email_events.tpl is new; release_1_4_0 revision 1.1.2.4
File kernel.X/core/admin_templates/regional/languages_edit_phrases.tpl is new; release_1_4_0 revision 1.1.2.5
File kernel.X/core/admin_templates/regional/languages_edit_tabs.tpl is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/admin_templates/regional/languages_export.tpl is new; release_1_4_0 revision 1.1.2.3
File kernel.X/core/admin_templates/regional/languages_export_step2.tpl is new; release_1_4_0 revision 1.1.2.2
File kernel.X/core/admin_templates/regional/languages_import.tpl is new; release_1_4_0 revision 1.1.2.2
File kernel.X/core/admin_templates/regional/languages_import_step2.tpl is new; release_1_4_0 revision 1.1.2.2
-File kernel.X/core/admin_templates/regional/languages_list.tpl is new; release_1_4_0 revision 1.1.2.3
-File kernel.X/core/admin_templates/regional/phrases_edit.tpl is new; release_1_4_0 revision 1.1.2.5
+File kernel.X/core/admin_templates/regional/languages_list.tpl is new; release_1_4_0 revision 1.1.2.4
+File kernel.X/core/admin_templates/regional/phrases_edit.tpl is new; release_1_4_0 revision 1.1.2.7
File kernel.X/core/admin_templates/tools/system_tools.tpl is new; release_1_4_0 revision 1.1.2.2
File kernel.X/core/units/dummy is new; release_1_4_0 revision 1.1
-File kernel.X/core/units/admin/admin_config.php is new; release_1_4_0 revision 1.20.2.5
-File kernel.X/core/units/admin/admin_events_handler.php is new; release_1_4_0 revision 1.4.2.5
-File kernel.X/core/units/admin/admin_tag_processor.php is new; release_1_4_0 revision 1.27.2.16
-File kernel.X/core/units/categories/cache_updater.php is new; release_1_4_0 revision 1.8.2.3
-File kernel.X/core/units/categories/categories_config.php is new; release_1_4_0 revision 1.54
-File kernel.X/core/units/categories/categories_event_handler.php is new; release_1_4_0 revision 1.25.2.12
-File kernel.X/core/units/categories/categories_item.php is new; release_1_4_0 revision 1.10.2.4
-File kernel.X/core/units/categories/categories_tag_processor.php is new; release_1_4_0 revision 1.31.2.4
+File kernel.X/core/units/admin/admin_config.php is new; release_1_4_0 revision 1.20.2.6
+File kernel.X/core/units/admin/admin_events_handler.php is new; release_1_4_0 revision 1.4.2.6
+File kernel.X/core/units/admin/admin_tag_processor.php is new; release_1_4_0 revision 1.27.2.22
+File kernel.X/core/units/categories/cache_updater.php is new; release_1_4_0 revision 1.8.2.5
+File kernel.X/core/units/categories/categories_config.php is new; release_1_4_0 revision 1.54.2.1
+File kernel.X/core/units/categories/categories_event_handler.php is new; release_1_4_0 revision 1.25.2.16
+File kernel.X/core/units/categories/categories_item.php is new; release_1_4_0 revision 1.10.2.6
+File kernel.X/core/units/categories/categories_tag_processor.php is new; release_1_4_0 revision 1.31.2.5
File kernel.X/core/units/category_items/category_items_config.php is new; release_1_4_0 revision 1.12
File kernel.X/core/units/category_items/category_items_dbitem.php is new; release_1_4_0 revision 1.4
-File kernel.X/core/units/category_items/category_items_event_handler.php is new; release_1_4_0 revision 1.9.2.1
+File kernel.X/core/units/category_items/category_items_event_handler.php is new; release_1_4_0 revision 1.9.2.2
File kernel.X/core/units/category_items/category_items_tag_processor.php is new; release_1_4_0 revision 1.6
File kernel.X/core/units/configuration/configuration.php is new; release_1_4_0 revision 1.1
File kernel.X/core/units/configuration/configuration_config.php is new; release_1_4_0 revision 1.15
File kernel.X/core/units/configuration/configuration_event_handler.php is new; release_1_4_0 revision 1.18
File kernel.X/core/units/configuration/configuration_tag_processor.php is new; release_1_4_0 revision 1.14
File kernel.X/core/units/custom_data/custom_data_event_handler.php changed
File kernel.X/core/units/custom_fields/custom_fields_event_handler.php changed
-File kernel.X/core/units/email_events/email_events_config.php is new; release_1_4_0 revision 1.6
+File kernel.X/core/units/email_events/email_events_config.php is new; release_1_4_0 revision 1.6.2.1
File kernel.X/core/units/email_events/email_events_event_handler.php is new; release_1_4_0 revision 1.28.2.1
-File kernel.X/core/units/email_messages/email_messages_config.php is new; release_1_4_0 revision 1.2
-File kernel.X/core/units/email_messages/email_messages_event_handler.php is new; release_1_4_0 revision 1.5
+File kernel.X/core/units/email_messages/email_messages_config.php is new; release_1_4_0 revision 1.2.52.1
+File kernel.X/core/units/email_messages/email_messages_event_handler.php is new; release_1_4_0 revision 1.5.2.1
File kernel.X/core/units/general/brackets.php is new; release_1_4_0 revision 1.4
-File kernel.X/core/units/general/cat_dbitem.php is new; release_1_4_0 revision 1.34.2.2
+File kernel.X/core/units/general/cat_dbitem.php is new; release_1_4_0 revision 1.34.2.5
File kernel.X/core/units/general/cat_dbitem_export.php is new; release_1_4_0 revision 1.22.2.1
File kernel.X/core/units/general/cat_dblist.php is new; release_1_4_0 revision 1.4
File kernel.X/core/units/general/cat_event_handler.php is new; release_1_4_0 revision 1.68.2.3
-File kernel.X/core/units/general/cat_tag_processor.php is new; release_1_4_0 revision 1.15.2.1
+File kernel.X/core/units/general/cat_tag_processor.php is new; release_1_4_0 revision 1.15.2.2
File kernel.X/core/units/general/country_states.php is new; release_1_4_0 revision 1.4
File kernel.X/core/units/general/custom_fields.php is new; release_1_4_0 revision 1.8
File kernel.X/core/units/general/general_config.php is new; release_1_4_0 revision 1.10.2.1
File kernel.X/core/units/general/inp1_parser.php is new; release_1_4_0 revision 1.16
-File kernel.X/core/units/general/inp_ses_storage.php is new; release_1_4_0 revision 1.22
+File kernel.X/core/units/general/inp_ses_storage.php is new; release_1_4_0 revision 1.22.2.1
File kernel.X/core/units/general/main_event_handler.php is new; release_1_4_0 revision 1.15
File kernel.X/core/units/general/xml_helper.php is new; release_1_4_0 revision 1.6
File kernel.X/core/units/general/helpers/captcha_helper.php is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/units/general/helpers/clipboard_helper.php is new; release_1_4_0 revision 1.2
File kernel.X/core/units/general/helpers/col_picker_helper.php is new; release_1_4_0 revision 1.1.2.3
File kernel.X/core/units/general/helpers/filenames_helper.php is new; release_1_4_0 revision 1.3
File kernel.X/core/units/general/helpers/helpers_config.php is new; release_1_4_0 revision 1.3.2.3
-File kernel.X/core/units/general/helpers/mod_rewrite_helper.php is new; release_1_4_0 revision 1.7.2.1
-File kernel.X/core/units/general/helpers/modules.php is new; release_1_4_0 revision 1.6.2.2
-File kernel.X/core/units/general/helpers/multilanguage.php is new; release_1_4_0 revision 1.8.2.2
+File kernel.X/core/units/general/helpers/mod_rewrite_helper.php is new; release_1_4_0 revision 1.7.2.4
+File kernel.X/core/units/general/helpers/modules.php is new; release_1_4_0 revision 1.6.2.3
+File kernel.X/core/units/general/helpers/multilanguage.php is new; release_1_4_0 revision 1.8.2.3
File kernel.X/core/units/general/helpers/permissions_helper.php is new; release_1_4_0 revision 1.20.2.3
-File kernel.X/core/units/general/helpers/recursive_helper.php is new; release_1_4_0 revision 1.3.2.3
+File kernel.X/core/units/general/helpers/recursive_helper.php is new; release_1_4_0 revision 1.3.2.4
File kernel.X/core/units/general/helpers/search_helper.php is new; release_1_4_0 revision 1.4.2.6
File kernel.X/core/units/general/helpers/sections_helper.php is new; release_1_4_0 revision 1.11.2.4
File kernel.X/core/units/general/helpers/themes_helper.php is new; release_1_4_0 revision 1.1.2.1
-File kernel.X/core/units/groups/groups_config.php is new; release_1_4_0 revision 1.15.2.1
-File kernel.X/core/units/groups/groups_event_handler.php is new; release_1_4_0 revision 1.2
+File kernel.X/core/units/groups/groups_config.php is new; release_1_4_0 revision 1.15.2.2
+File kernel.X/core/units/groups/groups_event_handler.php is new; release_1_4_0 revision 1.2.2.1
File kernel.X/core/units/groups/groups_item.php is new; release_1_4_0 revision 1.1
File kernel.X/core/units/languages/import_xml.php is new; release_1_4_0 revision 1.22.2.1
-File kernel.X/core/units/languages/languages_config.php is new; release_1_4_0 revision 1.19.2.2
-File kernel.X/core/units/languages/languages_event_handler.php is new; release_1_4_0 revision 1.28.2.1
+File kernel.X/core/units/languages/languages_config.php is new; release_1_4_0 revision 1.19.2.3
+File kernel.X/core/units/languages/languages_event_handler.php is new; release_1_4_0 revision 1.28.2.3
File kernel.X/core/units/languages/languages_item.php is new; release_1_4_0 revision 1.8.2.1
-File kernel.X/core/units/languages/languages_tag_processor.php is new; release_1_4_0 revision 1.7.2.3
+File kernel.X/core/units/languages/languages_tag_processor.php is new; release_1_4_0 revision 1.7.2.7
+File kernel.X/core/units/modules/modules_config.php changed
+File kernel.X/core/units/modules/modules_event_handler.php changed
+File kernel.X/core/units/permissions/permissions_config.php changed
File kernel.X/core/units/permissions/permissions_event_handler.php changed
File kernel.X/core/units/permissions/permissions_tag_processor.php changed
File kernel.X/core/units/phrases/phrases_config.php is new; release_1_4_0 revision 1.9.2.3
File kernel.X/core/units/phrases/phrases_event_handler.php is new; release_1_4_0 revision 1.12.2.2
File kernel.X/core/units/themes/themes_config.php is new; release_1_4_0 revision 1.8
File kernel.X/core/units/themes/themes_tag_processor.php is new; release_1_4_0 revision 1.7
File kernel.X/core/units/translator/translator_config.php is new; release_1_4_0 revision 1.4
File kernel.X/core/units/translator/translator_event_handler.php is new; release_1_4_0 revision 1.9
-File kernel.X/core/units/user_groups/user_groups_config.php is new; release_1_4_0 revision 1.3
-File kernel.X/core/units/users/users_config.php is new; release_1_4_0 revision 1.32.2.2
-File kernel.X/core/units/users/users_event_handler.php is new; release_1_4_0 revision 1.68.2.8
+File kernel.X/core/units/user_groups/user_groups_config.php is new; release_1_4_0 revision 1.3.2.2
+File kernel.X/core/units/user_groups/user_groups_dbitem.php is new; release_1_4_0 revision 1.1.4.1
+File kernel.X/core/units/user_groups/user_groups_eh.php is new; release_1_4_0 revision 1.1.2.1
+File kernel.X/core/units/users/users_config.php is new; release_1_4_0 revision 1.32.2.5
+File kernel.X/core/units/users/users_event_handler.php is new; release_1_4_0 revision 1.68.2.15
File kernel.X/core/units/users/users_item.php is new; release_1_4_0 revision 1.13
File kernel.X/core/units/users/users_syncronize.php is new; release_1_4_0 revision 1.4
File kernel.X/core/units/users/users_tag_processor.php is new; release_1_4_0 revision 1.14.2.2
File kernel.X/core/install/english.lang is new; release_1_4_0 revision 1.1
-File kernel.X/core/install/install_data.sql is new; release_1_4_0 revision 1.3.2.4
-File kernel.X/core/install/install_schema.sql is new; release_1_4_0 revision 1.3.2.7
-File kernel.X/core/install/steps_db.xml is new; release_1_4_0 revision 1.2
-File kernel.X/core/install/incs/install.tpl is new; release_1_4_0 revision 1.2
+File kernel.X/core/install/install_data.sql is new; release_1_4_0 revision 1.3.2.7
+File kernel.X/core/install/install_schema.sql is new; release_1_4_0 revision 1.3.2.8
+File kernel.X/core/install/steps_db.xml is new; release_1_4_0 revision 1.2.2.1
+File kernel.X/core/install/upgrades.sql is new; release_1_4_0 revision 1.1.2.2
+File kernel.X/core/install/incs/install.tpl is new; release_1_4_0 revision 1.2.2.2
File kernel.X/core/install/incs/script.js is new; release_1_4_0 revision 1.1
-File kernel.X/core/install/incs/style.css is new; release_1_4_0 revision 1.1
+File kernel.X/core/install/incs/style.css is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/install/incs/img/bg_install_menu.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/blocks.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/blocks2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/blue_bar_help.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/button_back.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/globe.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/icon_install.gif is new; release_1_4_0 revision 1.1
+File kernel.X/core/install/incs/img/icon_warning.gif is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/install/incs/img/logo.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/spacer.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/tab_middle.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/tabnav_back.jpg is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/tabnav_left.jpg is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/version_bg.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/toolbar/tool_cancel.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/toolbar/tool_cancel_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/toolbar/tool_select.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/install/incs/img/toolbar/tool_select_f2.gif is new; release_1_4_0 revision 1.1
File kernel.X/core/install/step_templates/check_paths.tpl is new; release_1_4_0 revision 1.1
-File kernel.X/core/install/step_templates/choose_modules.tpl is new; release_1_4_0 revision 1.1
+File kernel.X/core/install/step_templates/choose_modules.tpl is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/install/step_templates/db_config.tpl is new; release_1_4_0 revision 1.1
File kernel.X/core/install/step_templates/finish.tpl is new; release_1_4_0 revision 1.1
-File kernel.X/core/install/step_templates/install_setup.tpl is new; release_1_4_0 revision 1.1
+File kernel.X/core/install/step_templates/install_setup.tpl is new; release_1_4_0 revision 1.1.2.1
File kernel.X/core/install/step_templates/root_password.tpl is new; release_1_4_0 revision 1.1
+File kernel.X/core/install/step_templates/upgrade_modules.tpl is new; release_1_4_0 revision 1.1.2.1
+File cmseditor/editor/dialog/fck_document.html changed
+File cmseditor/editor/dialog/fck_document/audio.gif is new; release_1_4_0 revision 1.1.2.1
+File cmseditor/editor/dialog/fck_document/doc.gif is new; release_1_4_0 revision 1.1.2.1
+File cmseditor/editor/dialog/fck_document/excel.gif is new; release_1_4_0 revision 1.1.2.1
+File cmseditor/editor/dialog/fck_document/image.gif is new; release_1_4_0 revision 1.1.2.1
+File cmseditor/editor/dialog/fck_document/pdf.gif is new; release_1_4_0 revision 1.1.2.1
+File cmseditor/editor/dialog/fck_document/ppt.gif is new; release_1_4_0 revision 1.1.2.1
+File cmseditor/editor/dialog/fck_document/video.gif is new; release_1_4_0 revision 1.1.2.1
+File cmseditor/editor/dialog/fck_document/xml.gif is new; release_1_4_0 revision 1.1.2.1
File cmseditor/editor/filemanager/browser/default/frmresourceslist.html changed
File cmseditor/editor/filemanager/browser/default/frmupload.html changed
+File cmseditor/editor/filemanager/browser/default/connectors/php/commands.php changed
File cmseditor/editor/filemanager/browser/default/connectors/php/config.php changed
Changes in phrases and events:
+! <LANGUAGE PackName="English" Encoding="base64"><DATEFORMAT>m/d/Y</DATEFORMAT><TIMEFORMAT>g:i:s A</TIMEFORMAT><INPUTDATEFORMAT>m/d/Y</INPUTDATEFORMAT><INPUTTIMEFORMAT>g:i:s A</INPUTTIMEFORMAT><DECIMAL>.</DECIMAL><THOUSANDS>,</THOUSANDS><CHARSET>iso-8859-1</CHARSET><UNITSYSTEM>2</UNITSYSTEM>
+! <LANGUAGE PackName="English" Encoding="base64"><DATEFORMAT>m/d/Y</DATEFORMAT><TIMEFORMAT>g:i:s A</TIMEFORMAT><INPUTDATEFORMAT>m/d/Y</INPUTDATEFORMAT><INPUTTIMEFORMAT>g:i:s A</INPUTTIMEFORMAT><DECIMAL>,</DECIMAL><THOUSANDS>.</THOUSANDS><CHARSET>iso-8859-1</CHARSET><UNITSYSTEM>2</UNITSYSTEM>
+Changed event "USER.VALIDATE" of type "0"
+Changed event "USER.VALIDATE" of type "0"
Property changes on: trunk/admin/install/upgrades/changelog_1_4_0.txt
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/admin/install/langpacks/english.lang
===================================================================
--- trunk/admin/install/langpacks/english.lang (revision 7634)
+++ trunk/admin/install/langpacks/english.lang (revision 7635)
@@ -1,2346 +1,2355 @@
<LANGUAGES>
- <LANGUAGE PackName="English" Encoding="base64"><DATEFORMAT>m/d/Y</DATEFORMAT><TIMEFORMAT>g:i:s A</TIMEFORMAT><INPUTDATEFORMAT>m/d/Y</INPUTDATEFORMAT><INPUTTIMEFORMAT>g:i:s A</INPUTTIMEFORMAT><DECIMAL>.</DECIMAL><THOUSANDS>,</THOUSANDS><CHARSET>iso-8859-1</CHARSET><UNITSYSTEM>2</UNITSYSTEM>
+ <LANGUAGE PackName="English" Encoding="base64"><DATEFORMAT>m/d/Y</DATEFORMAT><TIMEFORMAT>g:i:s A</TIMEFORMAT><INPUTDATEFORMAT>m/d/Y</INPUTDATEFORMAT><INPUTTIMEFORMAT>g:i:s A</INPUTTIMEFORMAT><DECIMAL>,</DECIMAL><THOUSANDS>.</THOUSANDS><CHARSET>iso-8859-1</CHARSET><UNITSYSTEM>2</UNITSYSTEM>
<PHRASES>
<PHRASE Label=" lu_resetpw_confirm_text" Module="In-Portal" Type="0">WW91ciBwYXNzd29yZCBoYXMgYmVlbiByZXNldC4gWW91IHdpbGwgcmVjZWl2ZSB5b3VyIG5ldyBwYXNzd29yZCBpbiB0aGUgZW1haWwgc2hvcnRseS4=</PHRASE>
+ <PHRASE Label="cust_shipping_addr_block" Module="In-Portal" Type="1">QmxvY2sgU2hpcHBpbmcgQWRkcmVzcyBFZGl0aW5n</PHRASE>
<PHRASE Label="la_Active" Module="In-Portal" Type="1">QWN0aXZl</PHRASE>
<PHRASE Label="la_added" Module="In-Portal" Type="1">QWRkZWQ=</PHRASE>
<PHRASE Label="la_AddTo" Module="In-Portal" Type="1">QWRkIFRv</PHRASE>
+ <PHRASE Label="la_AdministrativeConsole" Module="In-Portal" Type="1">QWRtaW5pc3RyYXRpdmUgQ29uc29sZQ==</PHRASE>
<PHRASE Label="la_Always" Module="In-Portal" Type="1">QWx3YXlz</PHRASE>
<PHRASE Label="la_and" Module="In-Portal" Type="1">YW5k</PHRASE>
<PHRASE Label="la_approve_description" Module="In-Portal" Type="1">QWN0aXZl</PHRASE>
<PHRASE Label="la_Article_Author" Module="In-Portal" Type="1">QXV0aG9y</PHRASE>
<PHRASE Label="la_Article_Date" Module="In-Portal" Type="1">RGF0ZQ==</PHRASE>
<PHRASE Label="la_Article_Excerpt" Module="In-Portal" Type="1">QXJ0aWNsZSBFeGNlcnB0</PHRASE>
<PHRASE Label="la_Article_Hits" Module="In-Portal" Type="1">SGl0cw==</PHRASE>
<PHRASE Label="la_Article_Rating" Module="In-Portal" Type="1">UmF0aW5n</PHRASE>
<PHRASE Label="la_article_reviewed" Module="In-Portal" Type="1">QXJ0aWNsZSByZXZpZXdlZA==</PHRASE>
<PHRASE Label="la_Article_Title" Module="In-Portal" Type="1">QXJ0aWNsZSBUaXRsZQ==</PHRASE>
<PHRASE Label="la_Auto" Module="In-Portal" Type="1">QXV0bw==</PHRASE>
<PHRASE Label="la_Automatic" Module="In-Portal" Type="1">QXV0b21hdGlj</PHRASE>
+ <PHRASE Label="la_AvailableColumns" Module="In-Portal" Type="1">QXZhaWxhYmxlIENvbHVtbnM=</PHRASE>
<PHRASE Label="la_Background" Module="In-Portal" Type="1">QmFja2dyb3VuZA==</PHRASE>
<PHRASE Label="la_ban_email" Module="In-Portal" Type="1">QmFuIGVtYWlsIGFkZHJlc3M=</PHRASE>
<PHRASE Label="la_ban_ip" Module="In-Portal" Type="1">QmFuIElQIGFkZHJlc3M=</PHRASE>
<PHRASE Label="la_ban_login" Module="In-Portal" Type="1">QmFuIHVzZXIgbmFtZQ==</PHRASE>
<PHRASE Label="la_bb" Module="In-Portal" Type="1">SW1wb3J0ZWQ=</PHRASE>
<PHRASE Label="la_Borders" Module="In-Portal" Type="1">Qm9yZGVycw==</PHRASE>
<PHRASE Label="la_btn_Change" Module="In-Portal" Type="1">Q2hhbmdl</PHRASE>
<PHRASE Label="la_btn_Down" Module="In-Portal" Type="1">RG93bg==</PHRASE>
<PHRASE Label="la_btn_Up" Module="In-Portal" Type="1">VXA=</PHRASE>
<PHRASE Label="la_button_ok" Module="In-Portal" Type="1">T0s=</PHRASE>
<PHRASE Label="la_bytes" Module="In-Portal" Type="1">Ynl0ZXM=</PHRASE>
<PHRASE Label="la_by_theme" Module="In-Portal" Type="1">QnkgdGhlbWU=</PHRASE>
<PHRASE Label="la_Cancel" Module="In-Portal" Type="1">Q2FuY2Vs</PHRASE>
<PHRASE Label="la_category" Module="In-Portal" Type="1">Q2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_Category_Date" Module="In-Portal" Type="1">RGF0ZQ==</PHRASE>
<PHRASE Label="la_category_daysnew_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGRheXMgZm9yIGEgY2F0LiB0byBiZSBORVc=</PHRASE>
<PHRASE Label="la_Category_Description" Module="In-Portal" Type="1">Q2F0ZWdvcnkgRGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="la_category_metadesc" Module="In-Portal" Type="1">RGVmYXVsdCBNRVRBIGRlc2NyaXB0aW9u</PHRASE>
<PHRASE Label="la_category_metakey" Module="In-Portal" Type="1">RGVmYXVsdCBNRVRBIEtleXdvcmRz</PHRASE>
<PHRASE Label="la_Category_Name" Module="In-Portal" Type="1">Q2F0ZWdvcnkgTmFtZQ==</PHRASE>
<PHRASE Label="la_category_perpage_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGNhdGVnb3JpZXMgcGVyIHBhZ2U=</PHRASE>
<PHRASE Label="la_category_perpage__short_prompt" Module="In-Portal" Type="1">Q2F0ZWdvcmllcyBQZXIgUGFnZSAoU2hvcnRsaXN0KQ==</PHRASE>
<PHRASE Label="la_Category_Pick" Module="In-Portal" Type="1">UGljaw==</PHRASE>
<PHRASE Label="la_Category_Pop" Module="In-Portal" Type="1">UG9wdWxhcml0eQ==</PHRASE>
<PHRASE Label="la_category_showpick_prompt" Module="In-Portal" Type="1">RGlzcGxheSBlZGl0b3IgUElDS3MgYWJvdmUgcmVndWxhciBjYXRlZ29yaWVz</PHRASE>
<PHRASE Label="la_category_sortfield2_prompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_category_sortfield_prompt" Module="In-Portal" Type="1">T3JkZXIgY2F0ZWdvcmllcyBieQ==</PHRASE>
<PHRASE Label="la_Close" Module="In-Portal" Type="1">Q2xvc2U=</PHRASE>
<PHRASE Label="la_ColHeader_AltValue" Module="In-Portal" Type="1">QWx0IFZhbHVl</PHRASE>
<PHRASE Label="la_ColHeader_BadWord" Module="In-Portal" Type="1">Q2Vuc29yZWQgV29yZA==</PHRASE>
<PHRASE Label="la_ColHeader_CreatedOn" Module="In-Portal" Type="2">Q3JlYXRlZCBPbg==</PHRASE>
<PHRASE Label="la_ColHeader_Date" Module="In-Portal" Type="1">RGF0ZS9UaW1l</PHRASE>
<PHRASE Label="la_ColHeader_Enabled" Module="In-Portal" Type="1">U3RhdHVz</PHRASE>
<PHRASE Label="la_ColHeader_FieldLabel" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_ColHeader_FieldName" Module="In-Portal" Type="1">RmllbGQgTmFtZQ==</PHRASE>
<PHRASE Label="la_Colheader_GroupType" Module="In-Portal" Type="1">VHlwZQ==</PHRASE>
<PHRASE Label="la_ColHeader_Image" Module="In-Portal" Type="1">SW1hZ2U=</PHRASE>
<PHRASE Label="la_ColHeader_InheritFrom" Module="In-Portal" Type="1">SW5oZXJpdGVkIEZyb20=</PHRASE>
<PHRASE Label="la_ColHeader_Item" Module="In-Portal" Type="1">SXRlbQ==</PHRASE>
<PHRASE Label="la_Colheader_ItemField" Module="In-Portal" Type="1">SXRlbSBGaWVsZA==</PHRASE>
<PHRASE Label="la_ColHeader_ItemType" Module="In-Portal" Type="1">SXRlbSBUeXBl</PHRASE>
<PHRASE Label="la_Colheader_ItemValue" Module="In-Portal" Type="1">SXRlbSBWYWx1ZQ==</PHRASE>
<PHRASE Label="la_ColHeader_ItemVerb" Module="In-Portal" Type="1">Q29tcGFyaXNvbiBPcGVyYXRvcg==</PHRASE>
<PHRASE Label="la_ColHeader_Name" Module="In-Portal" Type="2">TGluayBOYW1l</PHRASE>
<PHRASE Label="la_ColHeader_PermAccess" Module="In-Portal" Type="1">QWNjZXNz</PHRASE>
<PHRASE Label="la_ColHeader_PermInherited" Module="In-Portal" Type="1">SW5oZXJpdGVk</PHRASE>
<PHRASE Label="la_ColHeader_Poster" Module="In-Portal" Type="1">UG9zdGVy</PHRASE>
<PHRASE Label="la_ColHeader_Preview" Module="In-Portal" Type="1">UHJldmlldw==</PHRASE>
<PHRASE Label="la_ColHeader_Replacement" Module="In-Portal" Type="1">UmVwbGFjZW1lbnQ=</PHRASE>
<PHRASE Label="la_ColHeader_Reply" Module="In-Portal" Type="1">UmVwbGllcw==</PHRASE>
<PHRASE Label="la_ColHeader_RuleType" Module="In-Portal" Type="1">UnVsZSBUeXBl</PHRASE>
<PHRASE Label="la_ColHeader_Status" Module="In-Portal" Type="1">U3RhdHVz</PHRASE>
<PHRASE Label="la_ColHeader_Topic" Module="In-Portal" Type="1">VG9waWM=</PHRASE>
<PHRASE Label="la_ColHeader_Url" Module="In-Portal" Type="1">VVJM</PHRASE>
<PHRASE Label="la_ColHeader_ValidationStatus" Module="In-Portal" Type="2">U3RhdHVz</PHRASE>
<PHRASE Label="la_ColHeader_ValidationTime" Module="In-Portal" Type="2">VmFsaWRhdGVkIE9u</PHRASE>
<PHRASE Label="la_ColHeader_Value" Module="In-Portal" Type="1">VmFsdWU=</PHRASE>
<PHRASE Label="la_ColHeader_Views" Module="In-Portal" Type="1">Vmlld3M=</PHRASE>
<PHRASE Label="la_col_Access" Module="In-Portal" Type="1">QWNjZXNz</PHRASE>
<PHRASE Label="la_col_AdditionalPermissions" Module="In-Portal" Type="1">QWRkaXRpb25hbA==</PHRASE>
<PHRASE Label="la_col_Basedon" Module="In-Portal" Type="1">QmFzZWQgT24=</PHRASE>
<PHRASE Label="la_col_Category" Module="In-Portal" Type="1">Q2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_col_CategoryName" Module="In-Portal" Type="1">Q2F0ZWdvcnkgTmFtZQ==</PHRASE>
<PHRASE Label="la_col_CreatedOn" Module="In-Portal" Type="1">Q3JlYXRlZCBPbg==</PHRASE>
<PHRASE Label="la_col_Description" Module="In-Portal" Type="1">RGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="la_col_Duration" Module="In-Portal" Type="1">RHVyYXRpb24=</PHRASE>
<PHRASE Label="la_col_DurationType" Module="In-Portal" Type="1">RHVyYXRpb24gVHlwZQ==</PHRASE>
<PHRASE Label="la_col_Effective" Module="In-Portal" Type="1">RWZmZWN0aXZl</PHRASE>
<PHRASE Label="la_col_Email" Module="In-Portal" Type="1">RW1haWw=</PHRASE>
+ <PHRASE Label="la_col_Error" Module="In-Portal" Type="1">Jm5ic3A7</PHRASE>
<PHRASE Label="la_col_Event" Module="In-Portal" Type="1">RXZlbnQ=</PHRASE>
<PHRASE Label="la_col_FieldName" Module="In-Portal" Type="1">RmllbGQgTmFtZQ==</PHRASE>
<PHRASE Label="la_col_FirstName" Module="In-Portal" Type="1">Rmlyc3QgTmFtZQ==</PHRASE>
<PHRASE Label="la_col_GroupName" Module="In-Portal" Type="1">R3JvdXAgTmFtZQ==</PHRASE>
<PHRASE Label="la_col_Id" Module="In-Portal" Type="1">SUQ=</PHRASE>
<PHRASE Label="la_col_ImageEnabled" Module="In-Portal" Type="1">U3RhdHVz</PHRASE>
<PHRASE Label="la_col_ImageName" Module="In-Portal" Type="1">SW1hZ2U=</PHRASE>
<PHRASE Label="la_col_ImageUrl" Module="In-Portal" Type="1">VVJM</PHRASE>
<PHRASE Label="la_col_Inherited" Module="In-Portal" Type="1">SW5oZXJpdGVk</PHRASE>
<PHRASE Label="la_col_InheritedFrom" Module="In-Portal" Type="1">SW5oZXJpdGVkIEZyb20=</PHRASE>
<PHRASE Label="la_col_IsSystem" Module="In-Portal" Type="1">U3lzdGVt</PHRASE>
<PHRASE Label="la_col_Label" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_col_LastChanged" Module="In-Portal" Type="1">TGFzdCBDaGFuZ2Vk</PHRASE>
<PHRASE Label="la_col_LastCompiled" Module="In-Portal" Type="1">TGFzdCBDb21waWxlZA==</PHRASE>
<PHRASE Label="la_col_LastName" Module="In-Portal" Type="1">TGFzdCBOYW1l</PHRASE>
<PHRASE Label="la_col_LinkUrl" Module="In-Portal" Type="1">TGluayBVUkw=</PHRASE>
<PHRASE Label="la_col_LocalName" Module="In-Portal" Type="1">TmFtZQ==</PHRASE>
<PHRASE Label="la_col_Module" Module="In-Portal" Type="1">TW9kdWxl</PHRASE>
<PHRASE Label="la_col_Name" Module="In-Portal" Type="1">TmFtZQ==</PHRASE>
<PHRASE Label="la_col_PackName" Module="In-Portal" Type="1">UGFjayBOYW1l</PHRASE>
<PHRASE Label="la_col_PermAdd" Module="In-Portal" Type="1">QWRk</PHRASE>
<PHRASE Label="la_col_PermDelete" Module="In-Portal" Type="1">RGVsZXRl</PHRASE>
<PHRASE Label="la_col_PermEdit" Module="In-Portal" Type="1">RWRpdA==</PHRASE>
<PHRASE Label="la_col_PermissionName" Module="In-Portal" Type="1">UGVybWlzc2lvbiBOYW1l</PHRASE>
<PHRASE Label="la_col_PermissionValue" Module="In-Portal" Type="1">QWNjZXNz</PHRASE>
<PHRASE Label="la_col_PermView" Module="In-Portal" Type="1">Vmlldw==</PHRASE>
<PHRASE Label="la_col_PhraseType" Module="In-Portal" Type="1">VHlwZQ==</PHRASE>
<PHRASE Label="la_col_Preview" Module="In-Portal" Type="1">UHJldmlldw==</PHRASE>
<PHRASE Label="la_col_PrimaryGroup" Module="In-Portal" Type="1">UHJpbWFyeSBHcm91cA==</PHRASE>
<PHRASE Label="la_col_PrimaryValue" Module="In-Portal" Type="1">UHJpbWFyeSBWYWx1ZQ==</PHRASE>
<PHRASE Label="la_col_Prompt" Module="In-Portal" Type="1">RmllbGQgUHJvbXB0</PHRASE>
+ <PHRASE Label="la_col_PurchaseDate" Module="In-Portal" Type="1">RGF0ZQ==</PHRASE>
+ <PHRASE Label="la_col_RebateAmount" Module="In-Portal" Type="1">JA==</PHRASE>
+ <PHRASE Label="la_col_RebatePercent" Module="In-Portal" Type="1">JQ==</PHRASE>
<PHRASE Label="la_col_RelationshipType" Module="In-Portal" Type="1">UmVsYXRpb24gVHlwZQ==</PHRASE>
<PHRASE Label="la_col_ReviewedBy" Module="In-Portal" Type="1">UmV2aWV3ZWQgQnk=</PHRASE>
<PHRASE Label="la_col_ReviewText" Module="In-Portal" Type="1">UmV2aWV3IFRleHQ=</PHRASE>
<PHRASE Label="la_col_SelectorName" Module="In-Portal" Type="1">U2VsZWN0b3I=</PHRASE>
<PHRASE Label="la_col_Status" Module="In-Portal" Type="1">U3RhdHVz</PHRASE>
<PHRASE Label="la_col_TargetId" Module="In-Portal" Type="1">SXRlbQ==</PHRASE>
<PHRASE Label="la_col_TargetType" Module="In-Portal" Type="1">SXRlbSBUeXBl</PHRASE>
<PHRASE Label="la_col_Title" Module="In-Portal" Type="1">VGl0bGU=</PHRASE>
<PHRASE Label="la_col_Translation" Module="In-Portal" Type="1">VmFsdWU=</PHRASE>
<PHRASE Label="la_col_Type" Module="In-Portal" Type="1">VHlwZQ==</PHRASE>
<PHRASE Label="la_col_UserCount" Module="In-Portal" Type="1">VXNlciBDb3VudA==</PHRASE>
<PHRASE Label="la_col_Value" Module="In-Portal" Type="1">RmllbGQgVmFsdWU=</PHRASE>
<PHRASE Label="la_col_VisitDate" Module="In-Portal" Type="1">VmlzaXQgRGF0ZQ==</PHRASE>
<PHRASE Label="la_common_ascending" Module="In-Portal" Type="1">QXNjZW5kaW5n</PHRASE>
<PHRASE Label="la_common_CreatedOn" Module="In-Portal" Type="1">RGF0ZQ==</PHRASE>
<PHRASE Label="la_common_descending" Module="In-Portal" Type="1">RGVzY2VuZGluZw==</PHRASE>
<PHRASE Label="la_common_ReviewText" Module="In-Portal" Type="1">UmV2aWV3IFRleHQ=</PHRASE>
<PHRASE Label="la_configerror_review" Module="In-Portal" Type="1">UmV2aWV3IG5vdCBhZGRlZCBkdWUgdG8gYSBzeXN0ZW0gZXJyb3I=</PHRASE>
<PHRASE Label="la_config_backup_path" Module="In-Portal" Type="1">QmFja3VwIFBhdGg=</PHRASE>
<PHRASE Label="la_config_company" Module="In-Portal" Type="1">Q29tcGFueQ==</PHRASE>
<PHRASE Label="la_config_error_template" Module="In-Portal" Type="1">RmlsZSBub3QgZm91bmQgKDQwNCkgdGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_config_first_day_of_week" Module="In-Portal" Type="1">Rmlyc3QgRGF5IE9mIFdlZWs=</PHRASE>
<PHRASE Label="la_config_force_http" Module="In-Portal" Type="1">UmVkaXJlY3QgdG8gSFRUUCB3aGVuIFNTTCBpcyBub3QgcmVxdWlyZWQ=</PHRASE>
<PHRASE Label="la_config_name" Module="In-Portal" Type="1">TmFtZQ==</PHRASE>
<PHRASE Label="la_config_nopermission_template" Module="In-Portal" Type="1">SW5zdWZmaWNlbnQgcGVybWlzc2lvbnMgdGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_config_OutputCompressionLevel" Module="In-Portal" Type="1">R1pJUCBjb21wcmVzc2lvbiBsZXZlbCAwLTk=</PHRASE>
<PHRASE Label="la_config_PerpageReviews" Module="In-Portal" Type="1">UmV2aWV3cyBwZXIgcGFnZQ==</PHRASE>
<PHRASE Label="la_config_reg_number" Module="In-Portal" Type="1">UmVnaXN0cmF0aW9uIE51bWJlcg==</PHRASE>
<PHRASE Label="la_config_require_ssl" Module="In-Portal" Type="1">UmVxdWlyZSBTU0wgZm9yIGxvZ2luICYgY2hlY2tvdXQ=</PHRASE>
<PHRASE Label="la_config_server_name" Module="In-Portal" Type="1">U2VydmVyIE5hbWU=</PHRASE>
<PHRASE Label="la_config_server_path" Module="In-Portal" Type="1">U2VydmVyIFBhdGg=</PHRASE>
<PHRASE Label="la_config_site_zone" Module="In-Portal" Type="1">VGltZSB6b25lIG9mIHRoZSBzaXRl</PHRASE>
<PHRASE Label="la_config_ssl_url" Module="In-Portal" Type="1">U1NMIEZ1bGwgVVJMIChodHRwczovL3d3dy5kb21haW4uY29tL3BhdGgp</PHRASE>
<PHRASE Label="la_config_time_server" Module="In-Portal" Type="1">VGltZSB6b25lIG9mIHRoZSBzZXJ2ZXI=</PHRASE>
<PHRASE Label="la_config_UseOutputCompression" Module="In-Portal" Type="1">RW5hYmxlIEhUTUwgR1pJUCBjb21wcmVzc2lvbg==</PHRASE>
<PHRASE Label="la_config_use_js_redirect" Module="In-Portal" Type="1">VXNlIEphdmFTY3JpcHQgcmVkaXJlY3Rpb24gYWZ0ZXIgbG9naW4vbG9nb3V0IChmb3IgSUlTKQ==</PHRASE>
<PHRASE Label="la_config_use_modrewrite" Module="In-Portal" Type="1">VXNlIE1PRCBSRVdSSVRF</PHRASE>
<PHRASE Label="la_config_use_modrewrite_with_ssl" Module="In-Portal" Type="1">RW5hYmxlIE1PRF9SRVdSSVRFIGZvciBTU0w=</PHRASE>
<PHRASE Label="la_config_website_address" Module="In-Portal" Type="1">V2Vic2l0ZSBhZGRyZXNz</PHRASE>
<PHRASE Label="la_config_website_name" Module="In-Portal" Type="1">V2Vic2l0ZSBuYW1l</PHRASE>
<PHRASE Label="la_config_web_address" Module="In-Portal" Type="1">V2ViIGFkZHJlc3M=</PHRASE>
<PHRASE Label="la_ConfirmDeleteExportPreset" Module="In-Portal" Type="1">QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSBzZWxlY3RlZCBFeHBvcnQgUHJlc2V0Pw==</PHRASE>
<PHRASE Label="la_confirm_maintenance" Module="In-Portal" Type="1">VGhlIGNhdGVnb3J5IHRyZWUgbXVzdCBiZSB1cGRhdGVkIHRvIHJlZmxlY3QgdGhlIGxhdGVzdCBjaGFuZ2Vz</PHRASE>
<PHRASE Label="la_Continue" Module="In-Portal" Type="1">Q29udGludWU=</PHRASE>
<PHRASE Label="la_CreatedOn" Module="In-Portal" Type="1">Q3JlYXRlZCBPbg==</PHRASE>
<PHRASE Label="la_Credits_Title" Module="In-Portal" Type="1">Q3JlZGl0cw==</PHRASE>
<PHRASE Label="la_days" Module="In-Portal" Type="1">ZGF5cw==</PHRASE>
<PHRASE Label="la_Delete_Confirm" Module="In-Portal" Type="1">QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGUgaXRlbShzKT8gVGhpcyBhY3Rpb24gY2Fubm90IGJlIHVuZG9uZS4=</PHRASE>
<PHRASE Label="la_Description_in-bulletin" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tQnVsbGV0aW4gc2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_Description_in-bulletin:configuration_censorship" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgY2Vuc29yZWQgd29yZHMgYW5kIHRoZWlyIHJlcGxhY2VtZW50cw==</PHRASE>
<PHRASE Label="la_Description_in-bulletin:configuration_custom" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgY3VzdG9tIGZpZWxkcw==</PHRASE>
<PHRASE Label="la_Description_in-bulletin:configuration_email" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tYnVsbHRlaW4gZW1haWwgc2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_Description_in-bulletin:configuration_emoticon" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2Ugc2ltbGV5cw==</PHRASE>
<PHRASE Label="la_Description_in-bulletin:configuration_output" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tYnVsbHRlaW4gb3V0cHV0IHNldHRpbmdz</PHRASE>
<PHRASE Label="la_Description_in-bulletin:configuration_search" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tYnVsbHRlaW4gZGVmYXVsdCBzZWFyY2ggc2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_Description_in-bulletin:inbulletin_general" Module="In-Portal" Type="2">SW4tYnVsbGV0aW4gZ2VuZXJhbCBjb25maWd1cmF0aW9uIG9wdGlvbnM=</PHRASE>
<PHRASE Label="la_Description_in-link" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbGluayBzZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_Description_in-link:configuration_custom" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgY3VzdG9tIGZpZWxkcw==</PHRASE>
<PHRASE Label="la_Description_in-link:configuration_email" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgZW1haWwgZXZlbnRz</PHRASE>
<PHRASE Label="la_Description_in-link:configuration_output" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbGluayBvdXRwdXQgc2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_Description_in-link:configuration_search" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2Ugc2VhcmNoIHNldHRpbmdzIGFuZCBmaWVsZHM=</PHRASE>
<PHRASE Label="la_Description_in-link:inlink_general" Module="In-Portal" Type="2">SW4tTGluayBHZW5lcmFsIENvbmZpZ3VyYXRpb24gT3B0aW9ucw==</PHRASE>
<PHRASE Label="la_Description_in-link:validation_list" Module="In-Portal" Type="2">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBydW4gdmFsaWRhdGlvbiBvbiB0aGUgbGlua3M=</PHRASE>
<PHRASE Label="la_Description_in-news" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBzZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_Description_in-news:configuration_custom" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBjdXN0b20gZmllbGRz</PHRASE>
<PHRASE Label="la_Description_in-news:configuration_email" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBlbWFpbCBjb25maWd1cmF0aW9u</PHRASE>
<PHRASE Label="la_Description_in-news:configuration_output" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBvdXRwdXQgc2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_Description_in-news:configuration_search" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBkZWZhdWx0IHNlYXJjaCBjb25maWd1cmF0aW9u</PHRASE>
<PHRASE Label="la_Description_in-news:innews_general" Module="In-Portal" Type="2">SW4tTmV3eiBnZW5lcmFsIGNvbmZpZ3VyYXRpb24gb3B0aW9ucw==</PHRASE>
<PHRASE Label="la_Description_in-portal:addmodule" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBpbnN0YWxsIG5ldyBtb2R1bGVz</PHRASE>
<PHRASE Label="la_Description_in-portal:advanced_view" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gbWFuYWdlIGNhdGVnb3JpZXMgYW5kIGl0ZW1zIGFjcm9zcyBhbGwgY2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_Description_in-portal:backup" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBwZXJmb3JtIHN5c3RlbSBiYWNrdXBz</PHRASE>
<PHRASE Label="la_Description_in-portal:browse" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gYnJvd3NlIHRoZSBjYXRhbG9nIGFuZCBtYW5hZ2UgY2F0ZWdvcmllcyBhbmQgaXRlbXM=</PHRASE>
<PHRASE Label="la_Description_in-portal:configuration_custom" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gY29uZmlndXJlIGNhdGVnb3J5IGN1c3RvbSBmaWVsZHM=</PHRASE>
<PHRASE Label="la_Description_in-portal:configuration_email" Module="In-Portal" Type="2">Q29uZmlndXJlIENhdGVnb3J5IEVtYWlsIEV2ZW50cw==</PHRASE>
<PHRASE Label="la_Description_in-portal:configuration_search" Module="In-Portal" Type="2">Q29uZmlndXJlIENhdGVnb3J5IHNlYXJjaCBvcHRpb25z</PHRASE>
<PHRASE Label="la_Description_in-portal:configure_categories" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gY29uZmlndXJlIGdlbmVyYWwgY2F0ZWdvcnkgc2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_Description_in-portal:configure_general" Module="In-Portal" Type="1">VGhpcyBpcyBhIGdlbmVyYWwgY29uZmd1cmF0aW9uIHNlY3Rpb24=</PHRASE>
<PHRASE Label="la_Description_in-portal:configure_lang" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgcmVnaW9uYWwgc2V0dGluZ3MsIG1hbmFnZSBhbmQgZWRpdCBsYW5ndWFnZXM=</PHRASE>
<PHRASE Label="la_Description_in-portal:configure_styles" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgQ1NTIHN0eWxlc2hlZXRzIGZvciB0aGVtZXMu</PHRASE>
<PHRASE Label="la_Description_in-portal:configure_themes" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgdGhlbWVzIGFuZCBlZGl0IHRoZSBpbmRpdmlkdWFsIHRlbXBsYXRlcw==</PHRASE>
<PHRASE Label="la_Description_in-portal:configure_users" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gY29uZmlndXJlIGdlbmVyYWwgdXNlciBzZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_Description_in-portal:emaillog" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIHNob3dzIGFsbCBlLW1haWxzIHNlbnQgYnkgSW4tUG9ydGFs</PHRASE>
<PHRASE Label="la_Description_in-portal:export" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBleHBvcnQgSW4tcG9ydGFsIGRhdGE=</PHRASE>
<PHRASE Label="la_Description_in-portal:help" Module="In-Portal" Type="1">SGVscCBzZWN0aW9uIGZvciBJbi1wb3J0YWwgYW5kIGFsbCBvZiBpdHMgbW9kdWxlcy4gQWxzbyBhY2Nlc3NpYmxlIHZpYSB0aGUgc2VjdGlvbi1zcGVjaWZpYyBpbnRlcmFjdGl2ZSBoZWxwIGZlYXR1cmUu</PHRASE>
<PHRASE Label="la_Description_in-portal:inlink_inport" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBpbXBvcnQgZGF0YSBmcm9tIG90aGVyIHByb2dyYW1zIGludG8gSW4tcG9ydGFs</PHRASE>
<PHRASE Label="la_Description_in-portal:log_summary" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIHNob3dzIHN1bW1hcnkgc3RhdGlzdGljcw==</PHRASE>
<PHRASE Label="la_Description_in-portal:main_import" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBwZXJmb3JtIGRhdGEgaW1wb3J0IGZyb20gb3RoZXIgc3lzdGVtcw==</PHRASE>
<PHRASE Label="la_Description_in-portal:modules" Module="In-Portal" Type="1">TWFuYWdlIHN0YXR1cyBvZiBhbGwgbW9kdWxlcyB3aGljaCBhcmUgaW5zdGFsbGVkIG9uIHlvdXIgSW4tcG9ydGFsIHN5c3RlbS4=</PHRASE>
<PHRASE Label="la_Description_in-portal:mod_status" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBlbmFibGVkIGFuZCBkaXNhYmxlIG1vZHVsZXM=</PHRASE>
<PHRASE Label="la_Description_in-portal:reports" Module="In-Portal" Type="1">VmlldyBzeXN0ZW0gc3RhdGlzdGljcywgbG9ncyBhbmQgcmVwb3J0cw==</PHRASE>
<PHRASE Label="la_Description_in-portal:restore" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBwZXJmb3JtIGRhdGFiYXNlIHJlc3RvcmVz</PHRASE>
<PHRASE Label="la_Description_in-portal:reviews" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGRpc3BsYXlzIGEgbGlzdCBvZiBhbGwgcmV2aWV3cyBpbiB0aGUgc3lzdGVtLg==</PHRASE>
<PHRASE Label="la_Description_in-portal:searchlog" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIHNob3dzIHRoZSBzZWFyY2ggbG9nIGFuZCBhbGxvd3MgdG8gbWFuYWdlIGl0</PHRASE>
<PHRASE Label="la_Description_in-portal:server_info" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byB2aWV3IFBIUCBjb25maWd1cmF0aW9u</PHRASE>
<PHRASE Label="la_Description_in-portal:sessionlog" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIHNob3dzIGFsbCBhY3RpdmUgc2Vzc2lvbnMgYW5kIGFsbG93cyB0byBtYW5hZ2UgdGhlbQ==</PHRASE>
<PHRASE Label="la_Description_in-portal:site" Module="In-Portal" Type="1">TWFuYWdlIHRoZSBzdHJ1Y3R1cmUgb2YgeW91ciBzaXRlLCBpbmNsdWRpbmcgY2F0ZWdvcmllcywgaXRlbXMgYW5kIGNhdGVnb3J5IHNldHRpbmdzLg==</PHRASE>
<PHRASE Label="la_Description_in-portal:sql_query" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBwZXJmb3JtIGRpcmVjdCBTUUwgcXVlcmllcyBvbiBJbi1wb3J0YWwgZGF0YWJhc2U=</PHRASE>
<PHRASE Label="la_Description_in-portal:system" Module="In-Portal" Type="1">TWFuYWdlIHN5c3RlbS13aWRlIHNldHRpbmdzLCBlZGl0IHRoZW1lcyBhbmQgbGFuZ3VhZ2Vz</PHRASE>
<PHRASE Label="la_Description_in-portal:tag_library" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIHNob3dzIGF2YWlsYWJsZSB0YWdzIGZvciB1c2luZyBpbiB0ZW1wbGF0ZXM=</PHRASE>
<PHRASE Label="la_Description_in-portal:tools" Module="In-Portal" Type="1">VXNlIHZhcmlvdXMgSW4tcG9ydGFsIGRhdGEgbWFuYWdlbWVudCB0b29scywgaW5jbHVkaW5nIGJhY2t1cCwgcmVzdG9yZSwgaW1wb3J0IGFuZCBleHBvcnQ=</PHRASE>
<PHRASE Label="la_Description_in-portal:users" Module="In-Portal" Type="1">TWFuYWdlIHVzZXJzIGFuZCBncm91cHMsIHNldCB1c2VyICYgZ3JvdXAgcGVybWlzc2lvbnMgYW5kIGRlZmluZSB1c2VyIHNldHRpbmdzLg==</PHRASE>
<PHRASE Label="la_Description_in-portal:user_banlist" Module="In-Portal" Type="2">TWFuYWdlIFVzZXIgQmFuIFJ1bGVz</PHRASE>
<PHRASE Label="la_Description_in-portal:user_custom" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gY29uZmlndXJlIHVzZXIgY3VzdG9tIGZpZWxkcw==</PHRASE>
<PHRASE Label="la_Description_in-portal:user_email" Module="In-Portal" Type="2">Q29uZmlndXJlIFVzZXIgZW1haWwgZXZlbnRz</PHRASE>
<PHRASE Label="la_Description_in-portal:user_groups" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYWdhbmUgZ3JvdXBzLCBhc3NpZ24gdXNlcnMgdG8gZ3JvdXBzIGFuZCBwZXJmb3JtIG1hc3MgZW1haWwgc2VuZGluZw==</PHRASE>
<PHRASE Label="la_Description_in-portal:user_list" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9ucyBhbGxvd3MgdG8gbWFuYWdlIHVzZXJzLCB0aGVpciBwZXJtaXNzaW9ucyBhbmQgcGVyZm9ybSBtYXNzIGVtYWls</PHRASE>
<PHRASE Label="la_Description_in-portal:visits" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIHNob3dzIHRoZSBzaXRlIHZpc2l0b3JzIGxvZw==</PHRASE>
<PHRASE Label="la_Disabled" Module="In-Portal" Type="1">RGlzYWJsZWQ=</PHRASE>
<PHRASE Label="la_DownloadExportFile" Module="In-Portal" Type="1">RG93bmxvYWQgRXhwb3J0IEZpbGU=</PHRASE>
<PHRASE Label="la_DownloadLanguageExport" Module="In-Portal" Type="1">RG93bmxvYWQgTGFuZ3VhZ2UgRXhwb3J0</PHRASE>
<PHRASE Label="la_EditingInProgress" Module="In-Portal" Type="1">WW91IGhhdmUgbm90IHNhdmVkIGNoYW5nZXMgdG8gdGhlIGl0ZW0geW91IGFyZSBlZGl0aW5nITxiciAvPkNsaWNrIE9LIHRvIGxvb3NlIGNoYW5nZXMgYW5kIGdvIHRvIHRoZSBzZWxlY3RlZCBzZWN0aW9uPGJyIC8+b3IgQ2FuY2VsIHRvIHN0YXkgaW4gdGhlIGN1cnJlbnQgc2VjdGlvbi4=</PHRASE>
<PHRASE Label="la_EmptyFile" Module="In-Portal" Type="1">RmlsZSBpcyBlbXB0eQ==</PHRASE>
<PHRASE Label="la_EmptyValue" Module="In-Portal" Type="1">IA==</PHRASE>
<PHRASE Label="la_Enabled" Module="In-Portal" Type="1">RW5hYmxlZA==</PHRASE>
<PHRASE Label="la_error_cant_save_file" Module="In-Portal" Type="1">Q2FuJ3Qgc2F2ZSBhIGZpbGU=</PHRASE>
<PHRASE Label="la_error_copy_subcategory" Module="In-Portal" Type="1">RXJyb3IgY29weWluZyBzdWJjYXRlZ29yaWVz</PHRASE>
<PHRASE Label="la_error_CustomExists" Module="In-Portal" Type="1">Q3VzdG9tIGZpZWxkIHdpdGggaWRlbnRpY2FsIG5hbWUgYWxyZWFkeSBleGlzdHM=</PHRASE>
<PHRASE Label="la_error_duplicate_username" Module="In-Portal" Type="1">VXNlcm5hbWUgeW91IGhhdmUgZW50ZXJlZCBhbHJlYWR5IGV4aXN0cyBpbiB0aGUgc3lzdGVtLCBwbGVhc2UgY2hvb3NlIGFub3RoZXIgdXNlcm5hbWUu</PHRASE>
<PHRASE Label="la_error_FileTooLarge" Module="In-Portal" Type="1">RmlsZSBpcyB0b28gbGFyZ2U=</PHRASE>
<PHRASE Label="la_error_InvalidFileFormat" Module="In-Portal" Type="1">SW52YWxpZCBGaWxlIEZvcm1hdA==</PHRASE>
<PHRASE Label="la_error_move_subcategory" Module="In-Portal" Type="1">RXJyb3IgbW92aW5nIHN1YmNhdGVnb3J5</PHRASE>
<PHRASE Label="la_error_PasswordMatch" Module="In-Portal" Type="1">UGFzc3dvcmRzIGRvIG5vdCBtYXRjaCE=</PHRASE>
<PHRASE Label="la_error_RequiredColumnsMissing" Module="In-Portal" Type="1">cmVxdWlyZWQgY29sdW1ucyBtaXNzaW5n</PHRASE>
<PHRASE Label="la_error_unique_category_field" Module="In-Portal" Type="1">Q2F0ZWdvcnkgZmllbGQgbm90IHVuaXF1ZQ==</PHRASE>
<PHRASE Label="la_error_unknown_category" Module="In-Portal" Type="1">VW5rbm93biBjYXRlZ29yeQ==</PHRASE>
<PHRASE Label="la_err_bad_date_format" Module="In-Portal" Type="1">SW5jb3JyZWN0IGRhdGUgZm9ybWF0LCBwbGVhc2UgdXNlICglcykgZXguICglcyk=</PHRASE>
<PHRASE Label="la_err_bad_type" Module="In-Portal" Type="1">SW5jb3JyZWN0IGRhdGEgZm9ybWF0LCBwbGVhc2UgdXNlICVz</PHRASE>
<PHRASE Label="la_err_invalid_format" Module="In-Portal" Type="1">SW52YWxpZCBGb3JtYXQ=</PHRASE>
<PHRASE Label="la_err_length_out_of_range" Module="In-Portal" Type="1">RmllbGQgaXMgb3V0IG9mIHJhbmdl</PHRASE>
<PHRASE Label="la_err_required" Module="In-Portal" Type="1">RmllbGQgaXMgcmVxdWlyZWQ=</PHRASE>
<PHRASE Label="la_err_unique" Module="In-Portal" Type="1">RmllbGQgdmFsdWUgbXVzdCBiZSB1bmlxdWU=</PHRASE>
<PHRASE Label="la_err_value_out_of_range" Module="In-Portal" Type="1">RmllbGQgaXMgb3V0IG9mIHJhbmdlLCBwb3NzaWJsZSB2YWx1ZXMgZnJvbSAlcyB0byAlcw==</PHRASE>
<PHRASE Label="la_event_article.add" Module="In-Portal" Type="1">QWRkIEFydGljbGU=</PHRASE>
<PHRASE Label="la_event_article.approve" Module="In-Portal" Type="1">QXBwcm92ZSBBcnRpY2xl</PHRASE>
<PHRASE Label="la_event_article.deny" Module="In-Portal" Type="1">RGVjbGluZSBBcnRpY2xl</PHRASE>
<PHRASE Label="la_event_article.modify" Module="In-Portal" Type="1">TW9kaWZ5IEFydGljbGU=</PHRASE>
<PHRASE Label="la_event_article.modify.approve" Module="In-Portal" Type="1">QXBwcm92ZSBBcnRpY2xlIE1vZGlmaWNhdGlvbg==</PHRASE>
<PHRASE Label="la_event_article.modify.deny" Module="In-Portal" Type="1">RGVjbGluZSBBcnRpY2xlIE1vZGlmaWNhdGlvbg==</PHRASE>
<PHRASE Label="la_event_article.review.add" Module="In-Portal" Type="1">QXJ0aWNsZSBSZXZpZXcgQWRkZWQ=</PHRASE>
<PHRASE Label="la_event_article.review.add.pending" Module="In-Portal" Type="1">UGVuZGluZyBBcnRpY2xlIFJldmlldyBBZGRlZA==</PHRASE>
<PHRASE Label="la_event_article.review.approve" Module="In-Portal" Type="1">QXBwcm92ZSBBcnRpY2xlIFJldmlldw==</PHRASE>
<PHRASE Label="la_event_article.review.deny" Module="In-Portal" Type="1">RGVjbGluZSBBcnRpY2xlIFJldmlldw==</PHRASE>
<PHRASE Label="la_event_category.add" Module="In-Portal" Type="1">QWRkIENhdGVnb3J5</PHRASE>
<PHRASE Label="la_event_category.add.pending" Module="In-Portal" Type="1">QWRkIFBlbmRpbmcgQ2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_event_category.approve" Module="In-Portal" Type="1">QXBwcm92ZSBDYXRlZ29yeQ==</PHRASE>
<PHRASE Label="la_event_category.deny" Module="In-Portal" Type="1">RGVueSBDYXRlZ29yeQ==</PHRASE>
<PHRASE Label="la_event_category.modify" Module="In-Portal" Type="1">TW9kaWZ5IENhdGVnb3J5</PHRASE>
<PHRASE Label="la_event_category_delete" Module="In-Portal" Type="1">RGVsZXRlIENhdGVnb3J5</PHRASE>
<PHRASE Label="la_event_common.footer" Module="In-Portal" Type="1">Q29tbW9uIEZvb3RlciBUZW1wbGF0ZQ==</PHRASE>
<PHRASE Label="la_event_import_progress" Module="In-Portal" Type="1">RW1haWwgZXZlbnRzIGltcG9ydCBwcm9ncmVzcw==</PHRASE>
<PHRASE Label="la_event_link.add" Module="In-Portal" Type="1">QWRkIExpbms=</PHRASE>
<PHRASE Label="la_event_link.add.pending" Module="In-Portal" Type="1">QWRkIFBlbmRpbmcgTGluaw==</PHRASE>
<PHRASE Label="la_event_link.approve" Module="In-Portal" Type="1">QXBwcm92ZSBQZW5kaW5nIExpbms=</PHRASE>
<PHRASE Label="la_event_link.deny" Module="In-Portal" Type="1">RGVueSBMaW5r</PHRASE>
<PHRASE Label="la_event_link.modify" Module="In-Portal" Type="1">TW9kaWZ5IExpbms=</PHRASE>
<PHRASE Label="la_event_link.modify.approve" Module="In-Portal" Type="1">QXBwcm92ZSBMaW5rIE1vZGlmaWNhdGlvbg==</PHRASE>
<PHRASE Label="la_event_link.modify.deny" Module="In-Portal" Type="1">RGVjbGluZSBsaW5rIG1vZGlmaWNhdGlvbg==</PHRASE>
<PHRASE Label="la_event_link.modify.pending" Module="In-Portal" Type="1">TGluayBNb2RpZmljYXRpb24gUGVuZGluZw==</PHRASE>
<PHRASE Label="la_event_link.review.add" Module="In-Portal" Type="1">TGluayBSZXZpZXcgQWRkZWQ=</PHRASE>
<PHRASE Label="la_event_link.review.add.pending" Module="In-Portal" Type="1">UGVuZGluZyBSZXZpZXcgQWRkZWQ=</PHRASE>
<PHRASE Label="la_event_link.review.approve" Module="In-Portal" Type="1">QXBwcm92ZSBMaW5rIFJldmlldw==</PHRASE>
<PHRASE Label="la_event_link.review.deny" Module="In-Portal" Type="1">RGVjbGluZSBMaW5rIFJldmlldw==</PHRASE>
<PHRASE Label="la_event_pm.add" Module="In-Portal" Type="1">TmV3IFByaXZhdGUgTWVzc2FnZQ==</PHRASE>
<PHRASE Label="la_event_post.add" Module="In-Portal" Type="1">UG9zdCBBZGRlZA==</PHRASE>
<PHRASE Label="la_event_post.modify" Module="In-Portal" Type="1">UG9zdCBNb2RpZmllZA==</PHRASE>
<PHRASE Label="la_event_topic.add" Module="In-Portal" Type="1">VG9waWMgQWRkZWQ=</PHRASE>
<PHRASE Label="la_event_user.add" Module="In-Portal" Type="1">QWRkIFVzZXI=</PHRASE>
<PHRASE Label="la_event_user.add.pending" Module="In-Portal" Type="1">QWRkIFBlbmRpbmcgVXNlcg==</PHRASE>
<PHRASE Label="la_event_user.approve" Module="In-Portal" Type="1">QXBwcm92ZSBVc2Vy</PHRASE>
<PHRASE Label="la_event_user.deny" Module="In-Portal" Type="1">RGVueSBVc2Vy</PHRASE>
<PHRASE Label="la_event_user.forgotpw" Module="In-Portal" Type="1">Rm9yZ290IFBhc3N3b3Jk</PHRASE>
<PHRASE Label="la_event_user.membership_expiration_notice" Module="In-Portal" Type="1">TWVtYmVyc2hpcCBleHBpcmF0aW9uIG5vdGljZQ==</PHRASE>
<PHRASE Label="la_event_user.membership_expired" Module="In-Portal" Type="1">TWVtYmVyc2hpcCBleHBpcmVk</PHRASE>
<PHRASE Label="la_event_user.pswd_confirm" Module="In-Portal" Type="1">UGFzc3dvcmQgQ29uZmlybWF0aW9u</PHRASE>
<PHRASE Label="la_event_user.subscribe" Module="In-Portal" Type="1">VXNlciBzdWJzY3JpYmVk</PHRASE>
<PHRASE Label="la_event_user.suggest" Module="In-Portal" Type="1">U3VnZ2VzdCB0byBhIGZyaWVuZA==</PHRASE>
<PHRASE Label="la_event_user.unsubscribe" Module="In-Portal" Type="1">VXNlciB1bnN1YnNjcmliZWQ=</PHRASE>
<PHRASE Label="la_event_user.validate" Module="In-Portal" Type="1">VmFsaWRhdGUgVXNlcg==</PHRASE>
<PHRASE Label="la_Field" Module="In-Portal" Type="1">RmllbGQ=</PHRASE>
<PHRASE Label="la_field_displayorder" Module="In-Portal" Type="1">RGlzcGxheSBPcmRlcg==</PHRASE>
<PHRASE Label="la_fld_AddressLine" Module="In-Portal" Type="1">QWRkcmVzcyBMaW5l</PHRASE>
<PHRASE Label="la_fld_AdvancedCSS" Module="In-Portal" Type="1">QWR2YW5jZWQgQ1NT</PHRASE>
<PHRASE Label="la_fld_AltValue" Module="In-Portal" Type="1">QWx0IFZhbHVl</PHRASE>
+ <PHRASE Label="la_fld_AssignedCoupon" Module="In-Portal" Type="1">QXNzaWduZWQgQ291cG9u</PHRASE>
<PHRASE Label="la_fld_AutomaticFilename" Module="In-Portal" Type="1">QXV0b21hdGljIEZpbGVuYW1l</PHRASE>
<PHRASE Label="la_fld_AvailableColumns" Module="In-Portal" Type="1">QXZhaWxhYmxlIENvbHVtbnM=</PHRASE>
<PHRASE Label="la_fld_Background" Module="In-Portal" Type="1">QmFja2dyb3VuZA==</PHRASE>
<PHRASE Label="la_fld_BackgroundAttachment" Module="In-Portal" Type="1">QmFja2dyb3VuZCBBdHRhY2htZW50</PHRASE>
<PHRASE Label="la_fld_BackgroundColor" Module="In-Portal" Type="1">QmFja2dyb3VuZCBDb2xvcg==</PHRASE>
<PHRASE Label="la_fld_BackgroundImage" Module="In-Portal" Type="1">QmFja2dyb3VuZCBJbWFnZQ==</PHRASE>
<PHRASE Label="la_fld_BackgroundPosition" Module="In-Portal" Type="1">QmFja2dyb3VuZCBQb3NpdGlvbg==</PHRASE>
<PHRASE Label="la_fld_BackgroundRepeat" Module="In-Portal" Type="1">QmFja2dyb3VuZCBSZXBlYXQ=</PHRASE>
<PHRASE Label="la_fld_BorderBottom" Module="In-Portal" Type="1">Qm9yZGVyIEJvdHRvbQ==</PHRASE>
<PHRASE Label="la_fld_BorderLeft" Module="In-Portal" Type="1">Qm9yZGVyIExlZnQ=</PHRASE>
<PHRASE Label="la_fld_BorderRight" Module="In-Portal" Type="1">Qm9yZGVyIFJpZ2h0</PHRASE>
<PHRASE Label="la_fld_Borders" Module="In-Portal" Type="1">Qm9yZGVycw==</PHRASE>
<PHRASE Label="la_fld_BorderTop" Module="In-Portal" Type="1">Qm9yZGVyIFRvcA==</PHRASE>
<PHRASE Label="la_fld_Category" Module="In-Portal" Type="1">Q2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_fld_CategoryAutomaticFilename" Module="In-Portal" Type="1">QXV0b21hdGljIERpcmVjdG9yeSBOYW1l</PHRASE>
<PHRASE Label="la_fld_CategoryFilename" Module="In-Portal" Type="1">RGlyZWN0b3J5IE5hbWU=</PHRASE>
<PHRASE Label="la_fld_CategoryFormat" Module="In-Portal" Type="1">Q2F0ZWdvcnkgRm9ybWF0</PHRASE>
<PHRASE Label="la_fld_CategoryId" Module="In-Portal" Type="1">Q2F0ZWdvcnkgSUQ=</PHRASE>
<PHRASE Label="la_fld_CategorySeparator" Module="In-Portal" Type="1">Q2F0ZWdvcnkgc2VwYXJhdG9y</PHRASE>
<PHRASE Label="la_fld_CategoryTemplate" Module="In-Portal" Type="1">Q2F0ZWdvcnkgVGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_fld_Charset" Module="In-Portal" Type="1">Q2hhcnNldA==</PHRASE>
<PHRASE Label="la_fld_CheckDuplicatesMethod" Module="In-Portal" Type="1">Q2hlY2sgRHVwbGljYXRlcyBieQ==</PHRASE>
<PHRASE Label="la_fld_Company" Module="In-Portal" Type="1">Q29tcGFueQ==</PHRASE>
<PHRASE Label="la_fld_CopyLabels" Module="In-Portal" Type="1">Q29weSBMYWJlbHMgZnJvbSB0aGlzIExhbmd1YWdl</PHRASE>
<PHRASE Label="la_fld_CreatedById" Module="In-Portal" Type="1">Q3JlYXRlZCBCeQ==</PHRASE>
<PHRASE Label="la_fld_CreatedOn" Module="In-Portal" Type="1">Q3JlYXRlZCBPbg==</PHRASE>
<PHRASE Label="la_fld_Cursor" Module="In-Portal" Type="1">Q3Vyc29y</PHRASE>
<PHRASE Label="la_fld_DateFormat" Module="In-Portal" Type="1">RGF0ZSBGb3JtYXQ=</PHRASE>
<PHRASE Label="la_fld_DecimalPoint" Module="In-Portal" Type="1">RGVjaW1hbCBQb2ludA==</PHRASE>
<PHRASE Label="la_fld_Description" Module="In-Portal" Type="1">RGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="la_fld_Display" Module="In-Portal" Type="1">RGlzcGxheQ==</PHRASE>
<PHRASE Label="la_fld_DoNotEncode" Module="In-Portal" Type="1">QXMgUGxhaW4gVGV4dA==</PHRASE>
<PHRASE Label="la_fld_Duration" Module="In-Portal" Type="1">RHVyYXRpb24=</PHRASE>
<PHRASE Label="la_fld_EditorsPick" Module="In-Portal" Type="1">RWRpdG9ycyBQaWNr</PHRASE>
<PHRASE Label="la_fld_ElapsedTime" Module="In-Portal" Type="1">RWxhcHNlZCBUaW1l</PHRASE>
<PHRASE Label="la_fld_Enabled" Module="In-Portal" Type="1">RW5hYmxlZA==</PHRASE>
<PHRASE Label="la_fld_EstimatedTime" Module="In-Portal" Type="1">RXN0aW1hdGVkIFRpbWU=</PHRASE>
<PHRASE Label="la_fld_Expire" Module="In-Portal" Type="1">RXhwaXJl</PHRASE>
<PHRASE Label="la_fld_ExportColumns" Module="In-Portal" Type="1">RXhwb3J0IGNvbHVtbnM=</PHRASE>
<PHRASE Label="la_fld_ExportFileName" Module="In-Portal" Type="1">RXhwb3J0IEZpbGVuYW1l</PHRASE>
<PHRASE Label="la_fld_ExportFormat" Module="In-Portal" Type="1">RXhwb3J0IGZvcm1hdA==</PHRASE>
<PHRASE Label="la_fld_ExportModules" Module="In-Portal" Type="1">RXhwb3J0IE1vZHVsZXM=</PHRASE>
<PHRASE Label="la_fld_ExportPhraseTypes" Module="In-Portal" Type="1">RXhwb3J0IFBocmFzZSBUeXBlcw==</PHRASE>
<PHRASE Label="la_fld_ExportPresetName" Module="In-Portal" Type="1">RXhwb3J0IFByZXNldCBUaXRsZQ==</PHRASE>
<PHRASE Label="la_fld_ExportPresets" Module="In-Portal" Type="1">RXhwb3J0IFByZXNldA==</PHRASE>
<PHRASE Label="la_fld_ExportSavePreset" Module="In-Portal" Type="1">U2F2ZS9VcGRhdGUgRXhwb3J0IFByZXNldA==</PHRASE>
<PHRASE Label="la_fld_ExtraHeaders" Module="In-Portal" Type="1">RXh0cmEgSGVhZGVycw==</PHRASE>
<PHRASE Label="la_fld_Fax" Module="In-Portal" Type="1">RmF4</PHRASE>
<PHRASE Label="la_fld_FieldsEnclosedBy" Module="In-Portal" Type="1">RmllbGRzIGVuY2xvc2VkIGJ5</PHRASE>
<PHRASE Label="la_fld_FieldsSeparatedBy" Module="In-Portal" Type="1">RmllbGRzIHNlcGFyYXRlZCBieQ==</PHRASE>
<PHRASE Label="la_fld_FieldTitles" Module="In-Portal" Type="1">RmllbGQgVGl0bGVz</PHRASE>
<PHRASE Label="la_fld_Filename" Module="In-Portal" Type="1">RmlsZW5hbWU=</PHRASE>
<PHRASE Label="la_fld_Font" Module="In-Portal" Type="1">Rm9udA==</PHRASE>
<PHRASE Label="la_fld_FontColor" Module="In-Portal" Type="1">Rm9udCBDb2xvcg==</PHRASE>
<PHRASE Label="la_fld_FontFamily" Module="In-Portal" Type="1">Rm9udCBGYW1pbHk=</PHRASE>
<PHRASE Label="la_fld_FontSize" Module="In-Portal" Type="1">Rm9udCBTaXpl</PHRASE>
<PHRASE Label="la_fld_FontStyle" Module="In-Portal" Type="1">Rm9udCBTdHlsZQ==</PHRASE>
<PHRASE Label="la_fld_FontWeight" Module="In-Portal" Type="1">Rm9udCBXZWlnaHQ=</PHRASE>
<PHRASE Label="la_fld_GroupId" Module="In-Portal" Type="1">SUQ=</PHRASE>
<PHRASE Label="la_fld_GroupName" Module="In-Portal" Type="1">R3JvdXAgTmFtZQ==</PHRASE>
<PHRASE Label="la_fld_Height" Module="In-Portal" Type="1">SGVpZ2h0</PHRASE>
<PHRASE Label="la_fld_Hits" Module="In-Portal" Type="1">SGl0cw==</PHRASE>
<PHRASE Label="la_fld_Hot" Module="In-Portal" Type="1">SG90</PHRASE>
<PHRASE Label="la_fld_IconURL" Module="In-Portal" Type="1">SWNvbiBVUkw=</PHRASE>
<PHRASE Label="la_fld_Id" Module="In-Portal" Type="1">SUQ=</PHRASE>
<PHRASE Label="la_fld_ImageId" Module="In-Portal" Type="1">SW1hZ2UgSUQ=</PHRASE>
<PHRASE Label="la_fld_ImportCategory" Module="In-Portal" Type="1">SW1wb3J0IENhdGVnb3J5</PHRASE>
<PHRASE Label="la_fld_ImportFilename" Module="In-Portal" Type="1">SW1wb3J0IEZpbGVuYW1l</PHRASE>
<PHRASE Label="la_fld_IncludeFieldTitles" Module="In-Portal" Type="1">SW5jbHVkZSBmaWVsZCB0aXRsZXM=</PHRASE>
<PHRASE Label="la_fld_InputDateFormat" Module="In-Portal" Type="1">SW5wdXQgRGF0ZSBGb3JtYXQ=</PHRASE>
<PHRASE Label="la_fld_InputTimeFormat" Module="In-Portal" Type="1">SW5wdXQgVGltZSBGb3JtYXQ=</PHRASE>
<PHRASE Label="la_fld_InstallModules" Module="In-Portal" Type="1">SW5zdGFsbCBNb2R1bGVz</PHRASE>
<PHRASE Label="la_fld_InstallPhraseTypes" Module="In-Portal" Type="1">SW5zdGFsbCBQaHJhc2UgVHlwZXM=</PHRASE>
<PHRASE Label="la_fld_IsBaseCategory" Module="In-Portal" Type="1">VXNlIGN1cnJlbnQgY2F0ZWdvcnkgYXMgcm9vdCBmb3IgdGhlIGV4cG9ydA==</PHRASE>
<PHRASE Label="la_fld_IsPrimary" Module="In-Portal" Type="1">UHJpbWFyeQ==</PHRASE>
<PHRASE Label="la_fld_IsSystem" Module="In-Portal" Type="1">SXMgU3lzdGVt</PHRASE>
<PHRASE Label="la_fld_ItemTemplate" Module="In-Portal" Type="1">SXRlbSBUZW1wbGF0ZQ==</PHRASE>
<PHRASE Label="la_fld_LanguageFile" Module="In-Portal" Type="1">TGFuZ3VhZ2UgRmlsZQ==</PHRASE>
<PHRASE Label="la_fld_LanguageId" Module="In-Portal" Type="1">TGFuZ3VhZ2UgSUQ=</PHRASE>
<PHRASE Label="la_fld_Left" Module="In-Portal" Type="1">TGVmdA==</PHRASE>
<PHRASE Label="la_fld_LineEndings" Module="In-Portal" Type="1">TGluZSBlbmRpbmdz</PHRASE>
<PHRASE Label="la_fld_LineEndingsInside" Module="In-Portal" Type="1">TGluZSBFbmRpbmdzIEluc2lkZSBGaWVsZHM=</PHRASE>
<PHRASE Label="la_fld_LocalName" Module="In-Portal" Type="1">TG9jYWwgTmFtZQ==</PHRASE>
<PHRASE Label="la_fld_Location" Module="In-Portal" Type="1">TG9jYXRpb24=</PHRASE>
<PHRASE Label="la_fld_MarginBottom" Module="In-Portal" Type="1">TWFyZ2luIEJvdHRvbQ==</PHRASE>
<PHRASE Label="la_fld_MarginLeft" Module="In-Portal" Type="1">TWFyZ2luIExlZnQ=</PHRASE>
<PHRASE Label="la_fld_MarginRight" Module="In-Portal" Type="1">TWFyZ2luIFJpZ2h0</PHRASE>
<PHRASE Label="la_fld_Margins" Module="In-Portal" Type="1">TWFyZ2lucw==</PHRASE>
<PHRASE Label="la_fld_MarginTop" Module="In-Portal" Type="1">TWFyZ2luIFRvcA==</PHRASE>
<PHRASE Label="la_fld_MessageBody" Module="In-Portal" Type="1">TWVzc2FnZSBCb2R5</PHRASE>
<PHRASE Label="la_fld_MessageType" Module="In-Portal" Type="1">TWVzc2FnZSBUeXBl</PHRASE>
- <PHRASE Label="la_fld_MetaDescription" Module="In-Portal" Type="1">TWV0YSBEZXNjcmlwdGlvbg==</PHRASE>
- <PHRASE Label="la_fld_MetaKeywords" Module="In-Portal" Type="1">TWV0YSBLZXl3b3Jkcw==</PHRASE>
<PHRASE Label="la_fld_Modified" Module="In-Portal" Type="1">TW9kaWZpZWQ=</PHRASE>
<PHRASE Label="la_fld_Module" Module="In-Portal" Type="1">TW9kdWxl</PHRASE>
<PHRASE Label="la_fld_Name" Module="In-Portal" Type="1">TmFtZQ==</PHRASE>
<PHRASE Label="la_fld_New" Module="In-Portal" Type="1">TmV3</PHRASE>
<PHRASE Label="la_fld_PackName" Module="In-Portal" Type="1">UGFjayBOYW1l</PHRASE>
<PHRASE Label="la_fld_PaddingBottom" Module="In-Portal" Type="1">UGFkZGluZyBCb3R0b20=</PHRASE>
<PHRASE Label="la_fld_PaddingLeft" Module="In-Portal" Type="1">UGFkZGluZyBMZWZ0</PHRASE>
<PHRASE Label="la_fld_PaddingRight" Module="In-Portal" Type="1">UGFkZGluZyBSaWdodA==</PHRASE>
<PHRASE Label="la_fld_Paddings" Module="In-Portal" Type="1">UGFkZGluZ3M=</PHRASE>
<PHRASE Label="la_fld_PaddingTop" Module="In-Portal" Type="1">UGFkZGluZyBUb3A=</PHRASE>
<PHRASE Label="la_fld_PercentsCompleted" Module="In-Portal" Type="1">UGVyY2VudHMgQ29tcGxldGVk</PHRASE>
<PHRASE Label="la_fld_Phrase" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_fld_PhraseType" Module="In-Portal" Type="1">UGhyYXNlIFR5cGU=</PHRASE>
<PHRASE Label="la_fld_Pop" Module="In-Portal" Type="1">UG9w</PHRASE>
<PHRASE Label="la_fld_Position" Module="In-Portal" Type="1">UG9zaXRpb24=</PHRASE>
<PHRASE Label="la_fld_Primary" Module="In-Portal" Type="1">UHJpbWFyeQ==</PHRASE>
<PHRASE Label="la_fld_PrimaryLang" Module="In-Portal" Type="1">UHJpbWFyeQ==</PHRASE>
<PHRASE Label="la_fld_PrimaryTranslation" Module="In-Portal" Type="1">UHJpbWFyeSBUcmFuc2xhdGlvbg==</PHRASE>
<PHRASE Label="la_fld_Priority" Module="In-Portal" Type="1">UHJpb3JpdHk=</PHRASE>
<PHRASE Label="la_fld_Rating" Module="In-Portal" Type="1">UmF0aW5n</PHRASE>
<PHRASE Label="la_fld_RelationshipId" Module="In-Portal" Type="1">UmVsYXRpb24gSUQ=</PHRASE>
<PHRASE Label="la_fld_RelationshipType" Module="In-Portal" Type="1">VHlwZQ==</PHRASE>
<PHRASE Label="la_fld_RemoteUrl" Module="In-Portal" Type="1">UmVtb3RlIFVSTA==</PHRASE>
<PHRASE Label="la_fld_ReplaceDuplicates" Module="In-Portal" Type="1">UmVwbGFjZSBEdXBsaWNhdGVz</PHRASE>
<PHRASE Label="la_fld_ReviewId" Module="In-Portal" Type="0">UmV2aWV3IElE</PHRASE>
<PHRASE Label="la_fld_ReviewText" Module="In-Portal" Type="1">UmV2aWV3IFRleHQ=</PHRASE>
<PHRASE Label="la_fld_SameAsThumb" Module="In-Portal" Type="1">U2FtZSBBcyBUaHVtYg==</PHRASE>
<PHRASE Label="la_fld_SelectorBase" Module="In-Portal" Type="1">QmFzZWQgT24=</PHRASE>
<PHRASE Label="la_fld_SelectorData" Module="In-Portal" Type="1">U3R5bGU=</PHRASE>
<PHRASE Label="la_fld_SelectorId" Module="In-Portal" Type="1">U2VsZWN0b3IgSUQ=</PHRASE>
<PHRASE Label="la_fld_SelectorName" Module="In-Portal" Type="1">U2VsZWN0b3IgTmFtZQ==</PHRASE>
<PHRASE Label="la_fld_SkipFirstRow" Module="In-Portal" Type="1">U2tpcCBGaXJzdCBSb3c=</PHRASE>
<PHRASE Label="la_fld_Status" Module="In-Portal" Type="1">U3RhdHVz</PHRASE>
<PHRASE Label="la_fld_StylesheetId" Module="In-Portal" Type="1">U3R5bGVzaGVldCBJRA==</PHRASE>
<PHRASE Label="la_fld_Subject" Module="In-Portal" Type="1">U3ViamVjdA==</PHRASE>
<PHRASE Label="la_fld_TargetId" Module="In-Portal" Type="1">SXRlbQ==</PHRASE>
<PHRASE Label="la_fld_TextAlign" Module="In-Portal" Type="1">VGV4dCBBbGlnbg==</PHRASE>
<PHRASE Label="la_fld_TextDecoration" Module="In-Portal" Type="1">VGV4dCBEZWNvcmF0aW9u</PHRASE>
<PHRASE Label="la_fld_ThousandSep" Module="In-Portal" Type="1">VGhvdXNhbmRzIFNlcGFyYXRvcg==</PHRASE>
<PHRASE Label="la_fld_TimeFormat" Module="In-Portal" Type="1">VGltZSBGb3JtYXQ=</PHRASE>
<PHRASE Label="la_fld_Title" Module="In-Portal" Type="1">VGl0bGU=</PHRASE>
<PHRASE Label="la_fld_Top" Module="In-Portal" Type="1">VG9w</PHRASE>
<PHRASE Label="la_fld_Translation" Module="In-Portal" Type="1">VmFsdWU=</PHRASE>
<PHRASE Label="la_fld_UnitSystem" Module="In-Portal" Type="1">TWVhc3VyZXMgU3lzdGVt</PHRASE>
<PHRASE Label="la_fld_Upload" Module="In-Portal" Type="1">VXBsb2FkIEZpbGUgRnJvbSBMb2NhbCBQQw==</PHRASE>
<PHRASE Label="la_fld_URL" Module="In-Portal" Type="1">VVJM</PHRASE>
<PHRASE Label="la_fld_Visibility" Module="In-Portal" Type="1">VmlzaWJpbGl0eQ==</PHRASE>
<PHRASE Label="la_fld_Votes" Module="In-Portal" Type="1">Vm90ZXM=</PHRASE>
<PHRASE Label="la_fld_Width" Module="In-Portal" Type="1">V2lkdGg=</PHRASE>
<PHRASE Label="la_fld_Z-Index" Module="In-Portal" Type="1">Wi1JbmRleA==</PHRASE>
<PHRASE Label="la_Font" Module="In-Portal" Type="1">Rm9udCBQcm9wZXJ0aWVz</PHRASE>
<PHRASE Label="la_from_date" Module="In-Portal" Type="1">RnJvbSBEYXRl</PHRASE>
<PHRASE Label="la_front_end" Module="In-Portal" Type="1">RnJvbnQgZW5k</PHRASE>
<PHRASE Label="la_gigabytes" Module="In-Portal" Type="1">Z2lnYWJ5dGUocyk=</PHRASE>
<PHRASE Label="la_help_in_progress" Module="In-Portal" Type="1">VGhpcyBoZWxwIHNlY3Rpb24gZG9lcyBub3QgeWV0IGV4aXN0LCBpdCdzIGNvbWluZyBzb29uIQ==</PHRASE>
<PHRASE Label="la_Html" Module="In-Portal" Type="1">aHRtbA==</PHRASE>
<PHRASE Label="la_IDField" Module="In-Portal" Type="1">SUQgRmllbGQ=</PHRASE>
<PHRASE Label="la_ImportingEmailEvents" Module="In-Portal" Type="1">SW1wb3J0aW5nIEVtYWlsIEV2ZW50cyAuLi4=</PHRASE>
<PHRASE Label="la_ImportingLanguages" Module="In-Portal" Type="1">SW1wb3J0aW5nIExhbmd1YWdlcyAuLi4=</PHRASE>
<PHRASE Label="la_ImportingPhrases" Module="In-Portal" Type="1">SW1wb3J0aW5nIFBocmFzZXMgLi4u</PHRASE>
<PHRASE Label="la_importlang_phrasewarning" Module="In-Portal" Type="2">RW5hYmxpbmcgdGhpcyBvcHRpb24gd2lsbCB1bmRvIGFueSBjaGFuZ2VzIHlvdSBoYXZlIG1hZGUgdG8gZXhpc3RpbmcgcGhyYXNlcw==</PHRASE>
<PHRASE Label="la_importPhrases" Module="In-Portal" Type="1">SW1wb3J0aW5nIFBocmFzZXM=</PHRASE>
<PHRASE Label="la_inlink" Module="In-Portal" Type="1">SW4tbGluaw==</PHRASE>
<PHRASE Label="la_invalid_integer" Module="In-Portal" Type="1">SW5jb3JyZWN0IGRhdGEgZm9ybWF0LCBwbGVhc2UgdXNlIGludGVnZXI=</PHRASE>
<PHRASE Label="la_invalid_license" Module="In-Portal" Type="1">TWlzc2luZyBvciBpbnZhbGlkIEluLVBvcnRhbCBMaWNlbnNl</PHRASE>
+ <PHRASE Label="la_Invalid_Password" Module="In-Portal" Type="1">SW52YWxpZCB1c2VybmFtZSBvciBwYXNzd29yZA==</PHRASE>
<PHRASE Label="la_invalid_state" Module="In-Portal" Type="0">SW52YWxpZCBzdGF0ZQ==</PHRASE>
<PHRASE Label="la_ItemTab_Categories" Module="In-Portal" Type="1">Q2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_ItemTab_Links" Module="In-Portal" Type="1">TGlua3M=</PHRASE>
<PHRASE Label="la_ItemTab_News" Module="In-Portal" Type="1">QXJ0aWNsZXM=</PHRASE>
<PHRASE Label="la_ItemTab_Topics" Module="In-Portal" Type="1">VG9waWNz</PHRASE>
<PHRASE Label="la_K4_AdvancedView" Module="In-Portal" Type="1">SzQgQWR2YW5jZWQgVmlldw==</PHRASE>
<PHRASE Label="la_K4_Catalog" Module="In-Portal" Type="1">SzQgQ2F0YWxvZw==</PHRASE>
<PHRASE Label="la_kilobytes" Module="In-Portal" Type="1">S0I=</PHRASE>
<PHRASE Label="la_language" Module="In-Portal" Type="1">TGFuZ3VhZ2U=</PHRASE>
<PHRASE Label="la_lang_import_progress" Module="In-Portal" Type="1">SW1wb3J0IHByb2dyZXNz</PHRASE>
<PHRASE Label="la_LastUpdate" Module="In-Portal" Type="1">TGFzdCBVcGRhdGVk</PHRASE>
<PHRASE Label="la_Link_Date" Module="In-Portal" Type="1">RGF0ZQ==</PHRASE>
<PHRASE Label="la_Link_Description" Module="In-Portal" Type="1">TGluayBEZXNjcmlwdGlvbg==</PHRASE>
<PHRASE Label="la_link_editorspick_prompt" Module="In-Portal" Type="1">RGlzcGxheSBlZGl0b3IgUElDS3MgYWJvdmUgcmVndWxhciBsaW5rcw==</PHRASE>
<PHRASE Label="la_Link_Hits" Module="In-Portal" Type="1">SGl0cw==</PHRASE>
<PHRASE Label="la_Link_Name" Module="In-Portal" Type="1">TGluayBOYW1l</PHRASE>
<PHRASE Label="la_link_newdays_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGRheXMgZm9yIGEgbGluayB0byBiZSBORVc=</PHRASE>
<PHRASE Label="la_link_perpage_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGxpbmtzIHBlciBwYWdl</PHRASE>
<PHRASE Label="la_link_perpage_short_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGxpbmtzIHBlciBwYWdlIG9uIGEgc2hvcnQgbGlzdGluZw==</PHRASE>
<PHRASE Label="la_Link_Rating" Module="In-Portal" Type="1">UmF0aW5n</PHRASE>
<PHRASE Label="la_link_reviewed" Module="In-Portal" Type="1">TGluayByZXZpZXdlZA==</PHRASE>
<PHRASE Label="la_link_sortfield2_prompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_link_sortfield_prompt" Module="In-Portal" Type="1">T3JkZXIgbGlua3MgYnk=</PHRASE>
<PHRASE Label="la_link_sortreviews2_prompt" Module="In-Portal" Type="1">YW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_link_sortreviews_prompt" Module="In-Portal" Type="1">U29ydCByZXZpZXdzIGJ5</PHRASE>
<PHRASE Label="la_Link_URL" Module="In-Portal" Type="1">VVJM</PHRASE>
<PHRASE Label="la_link_urlstatus_prompt" Module="In-Portal" Type="1">RGlzcGxheSBsaW5rIFVSTCBpbiBzdGF0dXMgYmFy</PHRASE>
<PHRASE Label="la_LocalImage" Module="In-Portal" Type="1">TG9jYWwgSW1hZ2U=</PHRASE>
<PHRASE Label="la_Logged_in_as" Module="In-Portal" Type="1">TG9nZ2VkIGluIGFz</PHRASE>
<PHRASE Label="la_login" Module="In-Portal" Type="1">TG9naW4=</PHRASE>
<PHRASE Label="la_m0" Module="In-Portal" Type="1">KEdNVCk=</PHRASE>
<PHRASE Label="la_m1" Module="In-Portal" Type="1">KEdNVCAtMDE6MDAp</PHRASE>
<PHRASE Label="la_m10" Module="In-Portal" Type="1">KEdNVCAtMTA6MDAp</PHRASE>
<PHRASE Label="la_m11" Module="In-Portal" Type="1">KEdNVCAtMTE6MDAp</PHRASE>
<PHRASE Label="la_m12" Module="In-Portal" Type="1">KEdNVCAtMTI6MDAp</PHRASE>
<PHRASE Label="la_m2" Module="In-Portal" Type="1">KEdNVCAtMDI6MDAp</PHRASE>
<PHRASE Label="la_m3" Module="In-Portal" Type="1">KEdNVCAtMDM6MDAp</PHRASE>
<PHRASE Label="la_m4" Module="In-Portal" Type="1">KEdNVCAtMDQ6MDAp</PHRASE>
<PHRASE Label="la_m5" Module="In-Portal" Type="1">KEdNVCAtMDU6MDAp</PHRASE>
<PHRASE Label="la_m6" Module="In-Portal" Type="1">KEdNVCAtMDY6MDAp</PHRASE>
<PHRASE Label="la_m7" Module="In-Portal" Type="1">KEdNVCAtMDc6MDAp</PHRASE>
<PHRASE Label="la_m8" Module="In-Portal" Type="1">KEdNVCAtMDg6MDAp</PHRASE>
<PHRASE Label="la_m9" Module="In-Portal" Type="1">KEdNVCAtMDk6MDAp</PHRASE>
<PHRASE Label="la_Margins" Module="In-Portal" Type="1">TWFyZ2lucw==</PHRASE>
<PHRASE Label="la_megabytes" Module="In-Portal" Type="1">TUI=</PHRASE>
<PHRASE Label="la_MembershipExpirationReminder" Module="In-Portal" Type="1">R3JvdXAgTWVtYmVyc2hpcCBFeHBpcmF0aW9uIFJlbWluZGVyIChkYXlzKQ==</PHRASE>
<PHRASE Label="la_MenuTreeTitle" Module="In-Portal" Type="1">TWFpbiBNZW51</PHRASE>
<PHRASE Label="la_Metric" Module="In-Portal" Type="1">TWV0cmlj</PHRASE>
<PHRASE Label="la_missing_theme" Module="In-Portal" Type="1">TWlzc2luZyBJbiBUaGVtZQ==</PHRASE>
<PHRASE Label="la_MixedCategoryPath" Module="In-Portal" Type="1">Q2F0ZWdvcnkgcGF0aCBpbiBvbmUgZmllbGQ=</PHRASE>
<PHRASE Label="la_module_not_licensed" Module="In-Portal" Type="1">TW9kdWxlIG5vdCBsaWNlbnNlZA==</PHRASE>
<PHRASE Label="la_monday" Module="In-Portal" Type="1">TW9uZGF5</PHRASE>
<PHRASE Label="la_Never" Module="In-Portal" Type="1">TmV2ZXI=</PHRASE>
<PHRASE Label="la_NeverExpires" Module="In-Portal" Type="1">TmV2ZXIgRXhwaXJlcw==</PHRASE>
<PHRASE Label="la_New" Module="In-Portal" Type="1">TmV3</PHRASE>
<PHRASE Label="la_news_daysarchive_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGRheXMgdG8gYXJjaGl2ZSBhcnRpY2xlcyBhdXRvbWF0aWNhbGx5</PHRASE>
<PHRASE Label="la_news_editorpicksabove_prompt" Module="In-Portal" Type="1">RGlzcGxheSBlZGl0b3IgUElDS3MgYWJvdmUgcmVndWxhciBhcnRpY2xlcw==</PHRASE>
<PHRASE Label="la_news_newdays_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGRheXMgZm9yIGEgYXJ0aWNsZSB0byBiZSBORVc=</PHRASE>
<PHRASE Label="la_news_perpage_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGFydGljbGVzIHBlciBwYWdl</PHRASE>
<PHRASE Label="la_news_perpage_short_prompt" Module="In-Portal" Type="1">QXJ0aWNsZXMgUGVyIFBhZ2UgKFNob3J0bGlzdCk=</PHRASE>
<PHRASE Label="la_news_sortfield2_pompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_news_sortfield_pompt" Module="In-Portal" Type="1">T3JkZXIgYXJ0aWNsZXMgYnk=</PHRASE>
<PHRASE Label="la_news_sortreviews2_prompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_news_sortreviews_prompt" Module="In-Portal" Type="1">U29ydCByZXZpZXdzIGJ5</PHRASE>
<PHRASE Label="la_nextcategory" Module="In-Portal" Type="1">TmV4dCBjYXRlZ29yeQ==</PHRASE>
<PHRASE Label="la_nextgroup" Module="In-Portal" Type="1">TmV4dCBncm91cA==</PHRASE>
<PHRASE Label="la_NextUser" Module="In-Portal" Type="1">TmV4dCBVc2Vy</PHRASE>
<PHRASE Label="la_No" Module="In-Portal" Type="1">Tm8=</PHRASE>
<PHRASE Label="la_none" Module="In-Portal" Type="1">Tm9uZQ==</PHRASE>
<PHRASE Label="la_NoSubject" Module="In-Portal" Type="1">Tm8gU3ViamVjdA==</PHRASE>
<PHRASE Label="la_no_topics" Module="In-Portal" Type="1">Tm8gdG9waWNz</PHRASE>
<PHRASE Label="la_Number_of_Posts" Module="In-Portal" Type="1">TnVtYmVyIG9mIFBvc3Rz</PHRASE>
<PHRASE Label="la_of" Module="In-Portal" Type="1">b2Y=</PHRASE>
<PHRASE Label="la_Off" Module="In-Portal" Type="1">T2Zm</PHRASE>
<PHRASE Label="la_On" Module="In-Portal" Type="1">T24=</PHRASE>
<PHRASE Label="la_OneWay" Module="In-Portal" Type="1">T25lIFdheQ==</PHRASE>
<PHRASE Label="la_opt_day" Module="In-Portal" Type="1">ZGF5KHMp</PHRASE>
<PHRASE Label="la_opt_hour" Module="In-Portal" Type="1">aG91cihzKQ==</PHRASE>
<PHRASE Label="la_opt_min" Module="In-Portal" Type="1">bWludXRlKHMp</PHRASE>
<PHRASE Label="la_opt_month" Module="In-Portal" Type="1">bW9udGgocyk=</PHRASE>
<PHRASE Label="la_opt_sec" Module="In-Portal" Type="1">c2Vjb25kKHMp</PHRASE>
<PHRASE Label="la_opt_week" Module="In-Portal" Type="1">d2VlayhzKQ==</PHRASE>
<PHRASE Label="la_opt_year" Module="In-Portal" Type="1">eWVhcihzKQ==</PHRASE>
<PHRASE Label="la_original_values" Module="In-Portal" Type="1">T3JpZ2luYWwgVmFsdWVz</PHRASE>
<PHRASE Label="la_origional_value" Module="In-Portal" Type="1">T3JpZ2luYWwgVmFsdWU=</PHRASE>
<PHRASE Label="la_origional_values" Module="In-Portal" Type="1">T3JpZ2luYWwgVmFsdWVz</PHRASE>
<PHRASE Label="la_OtherFields" Module="In-Portal" Type="1">T3RoZXIgRmllbGRz</PHRASE>
<PHRASE Label="la_p1" Module="In-Portal" Type="1">KEdNVCArMDE6MDAp</PHRASE>
<PHRASE Label="la_p10" Module="In-Portal" Type="1">KEdNVCArMTA6MDAp</PHRASE>
<PHRASE Label="la_p11" Module="In-Portal" Type="1">KEdNVCArMTE6MDAp</PHRASE>
<PHRASE Label="la_p12" Module="In-Portal" Type="1">KEdNVCArMTI6MDAp</PHRASE>
<PHRASE Label="la_p13" Module="In-Portal" Type="1">KEdNVCArMTM6MDAp</PHRASE>
<PHRASE Label="la_p2" Module="In-Portal" Type="1">KEdNVCArMDI6MDAp</PHRASE>
<PHRASE Label="la_p3" Module="In-Portal" Type="1">KEdNVCArMDM6MDAp</PHRASE>
<PHRASE Label="la_p4" Module="In-Portal" Type="1">KEdNVCArMDQ6MDAp</PHRASE>
<PHRASE Label="la_p5" Module="In-Portal" Type="1">KEdNVCArMDU6MDAp</PHRASE>
<PHRASE Label="la_p6" Module="In-Portal" Type="1">KEdNVCArMDY6MDAp</PHRASE>
<PHRASE Label="la_p7" Module="In-Portal" Type="1">KEdNVCArMDc6MDAp</PHRASE>
<PHRASE Label="la_p8" Module="In-Portal" Type="1">KEdNVCArMDg6MDAp</PHRASE>
<PHRASE Label="la_p9" Module="In-Portal" Type="1">KEdNVCArMDk6MDAp</PHRASE>
<PHRASE Label="la_Paddings" Module="In-Portal" Type="1">UGFkZGluZ3M=</PHRASE>
<PHRASE Label="la_Page" Module="In-Portal" Type="1">UGFnZQ==</PHRASE>
<PHRASE Label="la_password_info" Module="In-Portal" Type="2">VG8gY2hhbmdlIHRoZSBwYXNzd29yZCwgZW50ZXIgdGhlIHBhc3N3b3JkIGhlcmUgYW5kIGluIHRoZSBib3ggYmVsb3c=</PHRASE>
<PHRASE Label="la_Pending" Module="In-Portal" Type="0">UGVuZGluZw==</PHRASE>
<PHRASE Label="la_performing_backup" Module="In-Portal" Type="1">UGVyZm9ybWluZyBCYWNrdXA=</PHRASE>
<PHRASE Label="la_performing_export" Module="In-Portal" Type="1">UGVyZm9ybWluZyBFeHBvcnQ=</PHRASE>
<PHRASE Label="la_performing_import" Module="In-Portal" Type="1">UGVyZm9ybWluZyBJbXBvcnQ=</PHRASE>
<PHRASE Label="la_performing_restore" Module="In-Portal" Type="1">UGVyZm9ybWluZyBSZXN0b3Jl</PHRASE>
<PHRASE Label="la_PermName_Admin_desc" Module="In-Portal" Type="1">QWxsb3dzIGFjY2VzcyB0byB0aGUgQWRtaW5pc3RyYXRpb24gdXRpbGl0eQ==</PHRASE>
<PHRASE Label="la_PermName_SystemAccess.ReadOnly_desc" Module="In-Portal" Type="1">UmVhZC1Pbmx5IEFjY2VzcyBUbyBEYXRhYmFzZQ==</PHRASE>
<PHRASE Label="la_PermTab_category" Module="In-Portal" Type="1">Q2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_PermTab_link" Module="In-Portal" Type="1">TGlua3M=</PHRASE>
<PHRASE Label="la_PermTab_news" Module="In-Portal" Type="1">QXJ0aWNsZXM=</PHRASE>
<PHRASE Label="la_PermTab_topic" Module="In-Portal" Type="1">VG9waWNz</PHRASE>
<PHRASE Label="la_PermType_Admin" Module="In-Portal" Type="1">UGVybWlzc2lvbiBUeXBlIEFkbWlu</PHRASE>
<PHRASE Label="la_PermType_AdminSection" Module="In-Portal" Type="1">QWRtaW5pc3RyYXRpb24=</PHRASE>
<PHRASE Label="la_PermType_Front" Module="In-Portal" Type="1">UGVybWlzc2lvbiBUeXBlIEZyb250IEVuZA==</PHRASE>
<PHRASE Label="la_PermType_FrontEnd" Module="In-Portal" Type="1">RnJvbnQgRW5k</PHRASE>
<PHRASE Label="la_PhraseNotTranslated" Module="In-Portal" Type="1">Tm90IFRyYW5zbGF0ZWQ=</PHRASE>
<PHRASE Label="la_PhraseTranslated" Module="In-Portal" Type="1">VHJhbnNsYXRlZA==</PHRASE>
<PHRASE Label="la_PhraseType_Admin" Module="In-Portal" Type="1">QWRtaW4=</PHRASE>
<PHRASE Label="la_PhraseType_Both" Module="In-Portal" Type="2">Qm90aA==</PHRASE>
<PHRASE Label="la_PhraseType_Front" Module="In-Portal" Type="1">RnJvbnQ=</PHRASE>
<PHRASE Label="la_Pick" Module="In-Portal" Type="1">RWRpdG9yJ3MgcGljaw==</PHRASE>
+ <PHRASE Label="la_PickedColumns" Module="In-Portal" Type="1">U2VsZWN0ZWQgQ29sdW1ucw==</PHRASE>
<PHRASE Label="la_Pop" Module="In-Portal" Type="1">UG9w</PHRASE>
<PHRASE Label="la_PositionAndVisibility" Module="In-Portal" Type="1">UG9zaXRpb24gQW5kIFZpc2liaWxpdHk=</PHRASE>
<PHRASE Label="la_posts_newdays_prompt" Module="In-Portal" Type="1">TmV3IHBvc3RzIChkYXlzKQ==</PHRASE>
<PHRASE Label="la_posts_perpage_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIHBvc3RzIHBlciBwYWdl</PHRASE>
<PHRASE Label="la_posts_subheading" Module="In-Portal" Type="1">UG9zdHM=</PHRASE>
<PHRASE Label="la_prevcategory" Module="In-Portal" Type="1">UHJldmlvdXMgY2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_prevgroup" Module="In-Portal" Type="1">UHJldmlvdXMgZ3JvdXA=</PHRASE>
<PHRASE Label="la_PrevUser" Module="In-Portal" Type="1">UHJldmlvdXMgVXNlcg==</PHRASE>
<PHRASE Label="la_PrimaryCategory" Module="In-Portal" Type="1">UHJpbWFyeQ==</PHRASE>
<PHRASE Label="la_prompt_ActiveArticles" Module="In-Portal" Type="1">QWN0aXZlIEFydGljbGVz</PHRASE>
<PHRASE Label="la_prompt_ActiveCategories" Module="In-Portal" Type="1">QWN0aXZlIENhdGVnb3JpZXM=</PHRASE>
<PHRASE Label="la_prompt_ActiveLinks" Module="In-Portal" Type="1">QWN0aXZlIExpbmtz</PHRASE>
<PHRASE Label="la_prompt_ActiveTopics" Module="In-Portal" Type="1">QWN0aXZlIFRvcGljcw==</PHRASE>
<PHRASE Label="la_prompt_ActiveUsers" Module="In-Portal" Type="1">QWN0aXZlIFVzZXJz</PHRASE>
<PHRASE Label="la_prompt_addmodule" Module="In-Portal" Type="1">QWRkIE1vZHVsZQ==</PHRASE>
<PHRASE Label="la_prompt_AddressTo" Module="In-Portal" Type="1">U2VudCBUbw==</PHRASE>
<PHRASE Label="la_prompt_AdminId" Module="In-Portal" Type="1">QWRtaW4gZ3JvdXA=</PHRASE>
<PHRASE Label="la_prompt_AdminMailFrom" Module="In-Portal" Type="1">TWVzc2FnZXMgZnJvbSBTaXRlIEFkbWluIGFyZSBmcm9t</PHRASE>
<PHRASE Label="la_prompt_AdvancedSearch" Module="In-Portal" Type="1">QWR2YW5jZWQgU2VhcmNo</PHRASE>
<PHRASE Label="la_prompt_allow_reset" Module="In-Portal" Type="1">QWxsb3cgcGFzc3dvcmQgcmVzZXQgYWZ0ZXI=</PHRASE>
<PHRASE Label="la_prompt_all_templates" Module="In-Portal" Type="1">QWxsIHRlbXBsYXRlcw==</PHRASE>
<PHRASE Label="la_prompt_AltName" Module="In-Portal" Type="1">QWx0IHZhbHVl</PHRASE>
<PHRASE Label="la_prompt_applyingbanlist" Module="In-Portal" Type="2">QXBwbHlpbmcgQmFuIExpc3QgdG8gRXhpc3RpbmcgVXNlcnMuLg==</PHRASE>
<PHRASE Label="la_prompt_approve_warning" Module="In-Portal" Type="1">Q29udGludWUgdG8gcmVzdG9yZSBhdCBteSBvd24gcmlzaz8=</PHRASE>
<PHRASE Label="la_prompt_Archived" Module="In-Portal" Type="1">QXJjaGl2ZWQ=</PHRASE>
<PHRASE Label="la_prompt_ArchiveDate" Module="In-Portal" Type="1">QXJjaGl2YXRpb24gRGF0ZQ==</PHRASE>
<PHRASE Label="la_prompt_ArticleAverageRating" Module="In-Portal" Type="1">QXZlcmFnZSBSYXRpbmcgb2YgQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="la_prompt_ArticleBody" Module="In-Portal" Type="1">QXJ0aWNsZSBCb2R5</PHRASE>
<PHRASE Label="la_prompt_ArticleExcerpt" Module="In-Portal" Type="1">QXJ0aWNsZSBFeGNlcnB0</PHRASE>
<PHRASE Label="la_prompt_ArticleExcerpt!" Module="In-Portal" Type="1">QXJ0aWNsZSBFeGNlcnB0</PHRASE>
<PHRASE Label="la_prompt_ArticleReviews" Module="In-Portal" Type="1">VG90YWwgQXJ0aWNsZSBSZXZpZXdz</PHRASE>
<PHRASE Label="la_prompt_ArticlesActive" Module="In-Portal" Type="1">QWN0aXZlIEFydGljbGVz</PHRASE>
<PHRASE Label="la_prompt_ArticlesArchived" Module="In-Portal" Type="1">QXJjaGl2ZWQgQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="la_prompt_ArticlesPending" Module="In-Portal" Type="1">UGVuZGluZyBBcnRpY2xlcw==</PHRASE>
<PHRASE Label="la_prompt_ArticlesTotal" Module="In-Portal" Type="1">VG90YWwgQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="la_prompt_Attatchment" Module="In-Portal" Type="1">QXR0YWNobWVudA==</PHRASE>
<PHRASE Label="la_Prompt_Attention" Module="In-Portal" Type="1">QXR0ZW50aW9uIQ==</PHRASE>
<PHRASE Label="la_prompt_Author" Module="In-Portal" Type="1">QXV0aG9y</PHRASE>
<PHRASE Label="la_prompt_AutoGen_Excerpt" Module="In-Portal" Type="1">R2VuZXJhdGUgZnJvbSB0aGUgYXJ0aWNsZSBib2R5</PHRASE>
<PHRASE Label="la_prompt_AutomaticDirectoryName" Module="In-Portal" Type="1">QXV0b21hdGljIERpcmVjdG9yeSBOYW1l</PHRASE>
<PHRASE Label="la_prompt_AutomaticFilename" Module="In-Portal" Type="1">QXV0b21hdGljIEZpbGVuYW1l</PHRASE>
<PHRASE Label="la_prompt_Available_Modules" Module="In-Portal" Type="1">TW9kdWxlcw==</PHRASE>
<PHRASE Label="la_Prompt_Backup_Date" Module="In-Portal" Type="1">QmFjayBVcCBEYXRl</PHRASE>
<PHRASE Label="la_prompt_Backup_Path" Module="In-Portal" Type="1">QmFja3VwIFBhdGg=</PHRASE>
<PHRASE Label="la_Prompt_Backup_Status" Module="In-Portal" Type="1">QmFja3VwIHN0YXR1cw==</PHRASE>
<PHRASE Label="la_prompt_BannedUsers" Module="In-Portal" Type="1">QmFubmVkIFVzZXJz</PHRASE>
<PHRASE Label="la_prompt_birthday" Module="In-Portal" Type="1">RGF0ZSBvZiBCaXJ0aA==</PHRASE>
<PHRASE Label="la_prompt_CacheTimeout" Module="In-Portal" Type="1">Q2FjaGUgVGltZW91dCAoc2Vjb25kcyk=</PHRASE>
<PHRASE Label="la_prompt_CategoryEditorsPick" Module="In-Portal" Type="1">RWRpdG9yJ3MgUGljayBDYXRlZ29yaWVz</PHRASE>
<PHRASE Label="la_prompt_CategoryId" Module="In-Portal" Type="1">Q2F0ZWdvcnkgSUQ=</PHRASE>
<PHRASE Label="la_prompt_CategoryLeadStoryArticles" Module="In-Portal" Type="1">Q2F0ZWdvcnkgTGVhZCBTdG9yeSBBcnRpY2xlcw==</PHRASE>
<PHRASE Label="la_Prompt_CategoryPermissions" Module="In-Portal" Type="1">Q2F0ZWdvcnkgUGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_prompt_CatLead" Module="In-Portal" Type="1">Q2F0ZWdvcnkgTGVhZCBTdG9yeQ==</PHRASE>
<PHRASE Label="la_prompt_CensorhipId" Module="In-Portal" Type="1">Q2Vuc29yc2hpcCBJZA==</PHRASE>
<PHRASE Label="la_prompt_CensorWord" Module="In-Portal" Type="1">Q2Vuc29yc2hpcCBXb3Jk</PHRASE>
<PHRASE Label="la_prompt_charset" Module="In-Portal" Type="1">Q2hhcnNldA==</PHRASE>
<PHRASE Label="la_prompt_City" Module="In-Portal" Type="1">Q2l0eQ==</PHRASE>
<PHRASE Label="la_prompt_Comments" Module="In-Portal" Type="1">Q29tbWVudHM=</PHRASE>
<PHRASE Label="la_prompt_continue" Module="In-Portal" Type="1">Q29udGludWU=</PHRASE>
<PHRASE Label="la_prompt_CopyLabels" Module="In-Portal" Type="1">Q29weSBMYWJlbHMgZnJvbSB0aGlzIExhbmd1YWdl</PHRASE>
<PHRASE Label="la_prompt_Country" Module="In-Portal" Type="1">Q291bnRyeQ==</PHRASE>
<PHRASE Label="la_prompt_CreatedBy" Module="In-Portal" Type="1">Q3JlYXRlZCBieQ==</PHRASE>
<PHRASE Label="la_prompt_CreatedOn" Module="In-Portal" Type="1">Q3JlYXRlZCBvbg==</PHRASE>
<PHRASE Label="la_prompt_CreatedOn_Time" Module="In-Portal" Type="1">Q3JlYXRlZCBhdA==</PHRASE>
<PHRASE Label="la_prompt_CurrentSessions" Module="In-Portal" Type="1">Q3VycmVudCBTZXNzaW9ucw==</PHRASE>
<PHRASE Label="la_prompt_CustomFilename" Module="In-Portal" Type="1">Q3VzdG9tIEZpbGVuYW1l</PHRASE>
<PHRASE Label="la_prompt_DatabaseSettings" Module="In-Portal" Type="1">RGF0YWJhc2UgU2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_prompt_DataSize" Module="In-Portal" Type="1">VG90YWwgU2l6ZSBvZiB0aGUgRGF0YWJhc2U=</PHRASE>
<PHRASE Label="la_prompt_DateFormat" Module="In-Portal" Type="1">KG1tLWRkLXl5eXkp</PHRASE>
<PHRASE Label="la_prompt_DbName" Module="In-Portal" Type="1">U2VydmVyIERhdGFiYXNl</PHRASE>
<PHRASE Label="la_prompt_DbPass" Module="In-Portal" Type="1">U2VydmVyIFBhc3N3b3Jk</PHRASE>
<PHRASE Label="la_prompt_DbUsername" Module="In-Portal" Type="1">RGF0YWJhc2UgVXNlciBOYW1l</PHRASE>
<PHRASE Label="la_prompt_decimal" Module="In-Portal" Type="2">RGVjaW1hbCBQb2ludA==</PHRASE>
<PHRASE Label="la_prompt_Default" Module="In-Portal" Type="1">RGVmYXVsdA==</PHRASE>
<PHRASE Label="la_prompt_delete" Module="In-Portal" Type="1">RGVsZXRl</PHRASE>
<PHRASE Label="la_prompt_Description" Module="In-Portal" Type="1">RGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="la_prompt_DirectoryName" Module="In-Portal" Type="1">RGlyZWN0b3J5IE5hbWU=</PHRASE>
<PHRASE Label="la_prompt_DisabledArticles" Module="In-Portal" Type="1">RGlzYWJsZWQgQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="la_prompt_DisabledCategories" Module="In-Portal" Type="1">RGlzYWJsZWQgQ2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_prompt_DisabledLinks" Module="In-Portal" Type="1">RGlzYWJsZWQgTGlua3M=</PHRASE>
<PHRASE Label="la_prompt_DisplayOrder" Module="In-Portal" Type="1">RGlzcGxheSBPcmRlcg==</PHRASE>
<PHRASE Label="la_prompt_download_export" Module="In-Portal" Type="2">RG93bmxvYWQgTGFuZ3VhZ2UgRXhwb3J0Og==</PHRASE>
<PHRASE Label="la_prompt_DupRating" Module="In-Portal" Type="2">QWxsb3cgRHVwbGljYXRlIFJhdGluZyBWb3Rlcw==</PHRASE>
<PHRASE Label="la_prompt_DupReviews" Module="In-Portal" Type="2">QWxsb3cgRHVwbGljYXRlIFJldmlld3M=</PHRASE>
<PHRASE Label="la_prompt_edit" Module="In-Portal" Type="1">RWRpdA==</PHRASE>
<PHRASE Label="la_prompt_EditorsPick" Module="In-Portal" Type="1">RWRpdG9yJ3MgUGljaw==</PHRASE>
<PHRASE Label="la_prompt_EditorsPickArticles" Module="In-Portal" Type="1">RWRpdG9yJ3MgUGljayBBcnRpY2xlcw==</PHRASE>
<PHRASE Label="la_prompt_EditorsPickLinks" Module="In-Portal" Type="1">RWRpdG9yJ3MgUGljayBMaW5rcw==</PHRASE>
<PHRASE Label="la_prompt_EditorsPickTopics" Module="In-Portal" Type="1">RWRpdG9yIFBpY2sgVG9waWNz</PHRASE>
<PHRASE Label="la_prompt_edit_query" Module="In-Portal" Type="1">RWRpdCBRdWVyeQ==</PHRASE>
<PHRASE Label="la_prompt_Email" Module="In-Portal" Type="1">RW1haWw=</PHRASE>
<PHRASE Label="la_prompt_EmailBody" Module="In-Portal" Type="1">RW1haWwgQm9keQ==</PHRASE>
<PHRASE Label="la_prompt_EmailCancelMessage" Module="In-Portal" Type="1">RW1haWwgZGVsaXZlcnkgYWJvcnRlZA==</PHRASE>
<PHRASE Label="la_prompt_EmailCompleteMessage" Module="In-Portal" Type="1">VGhlIEVtYWlsIE1lc3NhZ2UgaGFzIGJlZW4gc2VudA==</PHRASE>
<PHRASE Label="la_prompt_EmailInitMessage" Module="In-Portal" Type="1">UGxlYXNlIFdhaXQgd2hpbGUgSW4tUG9ydGFsIHByZXBhcmVzIHRvIHNlbmQgdGhlIG1lc3NhZ2UuLg==</PHRASE>
<PHRASE Label="la_prompt_EmailSubject" Module="In-Portal" Type="1">RW1haWwgU3ViamVjdA==</PHRASE>
<PHRASE Label="la_prompt_EmoticonId" Module="In-Portal" Type="1">RW1vdGlvbiBJZA==</PHRASE>
<PHRASE Label="la_prompt_EnableCache" Module="In-Portal" Type="1">RW5hYmxlIFRlbXBsYXRlIENhY2hpbmc=</PHRASE>
<PHRASE Label="la_prompt_Enabled" Module="In-Portal" Type="1">RW5hYmxlZA==</PHRASE>
<PHRASE Label="la_prompt_Enable_HTML" Module="In-Portal" Type="1">RW5hYmxlIEhUTUw/</PHRASE>
<PHRASE Label="la_prompt_ErrorTag" Module="In-Portal" Type="2">RXJyb3IgVGFn</PHRASE>
<PHRASE Label="la_prompt_Event" Module="In-Portal" Type="1">RXZlbnQ=</PHRASE>
<PHRASE Label="la_prompt_Expired" Module="In-Portal" Type="0">RXhwaXJhdGlvbiBEYXRl</PHRASE>
<PHRASE Label="la_prompt_ExportFileName" Module="In-Portal" Type="2">RXhwb3J0IEZpbGVuYW1l</PHRASE>
<PHRASE Label="la_prompt_export_error" Module="In-Portal" Type="1">R2VuZXJhbCBlcnJvcjogdW5hYmxlIHRvIGV4cG9ydA==</PHRASE>
<PHRASE Label="la_prompt_FieldId" Module="In-Portal" Type="1">RmllbGQgSWQ=</PHRASE>
<PHRASE Label="la_prompt_FieldLabel" Module="In-Portal" Type="1">RmllbGQgTGFiZWw=</PHRASE>
<PHRASE Label="la_prompt_FieldName" Module="In-Portal" Type="1">RmllbGQgTmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_FieldPrompt" Module="In-Portal" Type="1">RmllbGQgUHJvbXB0</PHRASE>
<PHRASE Label="la_prompt_FileId" Module="In-Portal" Type="1">RmlsZSBJZA==</PHRASE>
<PHRASE Label="la_prompt_FileName" Module="In-Portal" Type="1">RmlsZSBuYW1l</PHRASE>
<PHRASE Label="la_prompt_FirstName" Module="In-Portal" Type="1">Rmlyc3QgTmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_First_Name" Module="In-Portal" Type="1">Rmlyc3QgTmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_Frequency" Module="In-Portal" Type="1">RnJlcXVlbmN5</PHRASE>
<PHRASE Label="la_prompt_FromUser" Module="In-Portal" Type="1">RnJvbS9UbyBVc2Vy</PHRASE>
<PHRASE Label="la_prompt_FromUsername" Module="In-Portal" Type="1">RnJvbQ==</PHRASE>
<PHRASE Label="la_prompt_FrontLead" Module="In-Portal" Type="1">RnJvbnQgcGFnZSBsZWFkIGFydGljbGU=</PHRASE>
<PHRASE Label="la_Prompt_GeneralPermissions" Module="In-Portal" Type="1">R2VuZXJhbCBQZXJtaXNzaW9ucw==</PHRASE>
<PHRASE Label="la_prompt_GroupName" Module="In-Portal" Type="1">R3JvdXAgTmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_headers" Module="In-Portal" Type="1">RXh0cmEgTWFpbCBIZWFkZXJz</PHRASE>
<PHRASE Label="la_prompt_heading" Module="In-Portal" Type="1">SGVhZGluZw==</PHRASE>
<PHRASE Label="la_prompt_HitLimits" Module="In-Portal" Type="1">KE1pbmltdW0gNCk=</PHRASE>
<PHRASE Label="la_prompt_Hits" Module="In-Portal" Type="1">SGl0cw==</PHRASE>
<PHRASE Label="la_prompt_Hot" Module="In-Portal" Type="1">SG90</PHRASE>
<PHRASE Label="la_prompt_HotArticles" Module="In-Portal" Type="1">SG90IEFydGljbGVz</PHRASE>
<PHRASE Label="la_prompt_HotLinks" Module="In-Portal" Type="1">SG90IExpbmtz</PHRASE>
<PHRASE Label="la_prompt_HotTopics" Module="In-Portal" Type="1">SG90IFRvcGljcw==</PHRASE>
<PHRASE Label="la_prompt_html" Module="In-Portal" Type="1">SFRNTA==</PHRASE>
<PHRASE Label="la_prompt_html_version" Module="In-Portal" Type="1">SFRNTCBWZXJzaW9u</PHRASE>
<PHRASE Label="la_prompt_icon_url" Module="In-Portal" Type="1">SWNvbiBVUkw=</PHRASE>
<PHRASE Label="la_prompt_Image" Module="In-Portal" Type="1">SW1hZ2U=</PHRASE>
<PHRASE Label="la_prompt_ImageId" Module="In-Portal" Type="1">SW1hZ2UgSUQ=</PHRASE>
<PHRASE Label="la_prompt_import_error" Module="In-Portal" Type="1">SW1wb3J0IGVuY291bnRlcmVkIGFuIGVycm9yIGFuZCBkaWQgbm90IGNvbXBsZXRlLg==</PHRASE>
<PHRASE Label="la_prompt_Import_ImageName" Module="In-Portal" Type="1">TGluayBJbWFnZSBOYW1l</PHRASE>
<PHRASE Label="la_prompt_Import_Prefix" Module="In-Portal" Type="1">VGFibGUgTmFtZSBQcmVmaXg=</PHRASE>
<PHRASE Label="la_prompt_InitImportCat" Module="In-Portal" Type="1">SW5pdGlhbCBJbXBvcnQgQ2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_prompt_InlinkDbName" Module="In-Portal" Type="1">SW4tTGluayBEYXRhYmFzZSBOYW1l</PHRASE>
<PHRASE Label="la_prompt_InlinkDbPass" Module="In-Portal" Type="1">SW4tTGluayBEYXRhYmFzZSBQYXNzd29yZA==</PHRASE>
<PHRASE Label="la_prompt_InlinkDbUsername" Module="In-Portal" Type="1">SW4tTGluayBEYXRhYmFzZSBVc2VybmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_InlinkServer" Module="In-Portal" Type="1">SW4tTGluayBTZXJ2ZXIgTmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_InlinkSqlType" Module="In-Portal" Type="1">SW4tTGluayBTUUwgVHlwZQ==</PHRASE>
<PHRASE Label="la_prompt_InputType" Module="In-Portal" Type="1">SW5wdXQgVHlwZQ==</PHRASE>
<PHRASE Label="la_prompt_Install_Status" Module="In-Portal" Type="1">SW5zdGFsbGF0aW9uIFN0YXR1cw==</PHRASE>
<PHRASE Label="la_prompt_ip" Module="In-Portal" Type="1">SVAgQWRkcmVzcw==</PHRASE>
<PHRASE Label="la_prompt_IPAddress" Module="In-Portal" Type="1">SVAgQWRkcmVzcw==</PHRASE>
<PHRASE Label="la_prompt_Item" Module="In-Portal" Type="1">SXRlbQ==</PHRASE>
<PHRASE Label="la_prompt_ItemField" Module="In-Portal" Type="2">SXRlbSBGaWVsZA==</PHRASE>
<PHRASE Label="la_prompt_ItemValue" Module="In-Portal" Type="2">RmllbGQgVmFsdWU=</PHRASE>
<PHRASE Label="la_prompt_ItemVerb" Module="In-Portal" Type="2">RmllbGQgQ29tcGFyaXNvbg==</PHRASE>
<PHRASE Label="la_prompt_KeyStroke" Module="In-Portal" Type="1">S2V5IFN0cm9rZQ==</PHRASE>
<PHRASE Label="la_prompt_Keyword" Module="In-Portal" Type="1">S2V5d29yZA==</PHRASE>
<PHRASE Label="la_prompt_Label" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_prompt_LanguageFile" Module="In-Portal" Type="1">TGFuZ3VhZ2UgRmlsZQ==</PHRASE>
<PHRASE Label="la_prompt_LanguageId" Module="In-Portal" Type="1">TGFuZ3VhZ2UgSWQ=</PHRASE>
<PHRASE Label="la_prompt_lang_cache_timeout" Module="In-Portal" Type="1">TGFuZ3VhZ2UgQ2FjaGUgVGltZW91dA==</PHRASE>
<PHRASE Label="la_prompt_lang_dateformat" Module="In-Portal" Type="2">RGF0ZSBGb3JtYXQ=</PHRASE>
<PHRASE Label="la_prompt_lang_timeformat" Module="In-Portal" Type="0">VGltZSBGb3JtYXQ=</PHRASE>
<PHRASE Label="la_prompt_LastArticleUpdate" Module="In-Portal" Type="1">TGFzdCBVcGRhdGVkIEFydGljbGU=</PHRASE>
<PHRASE Label="la_prompt_LastCategoryUpdate" Module="In-Portal" Type="1">TGFzdCBDYXRlZ29yeSBVcGRhdGU=</PHRASE>
<PHRASE Label="la_prompt_LastLinkUpdate" Module="In-Portal" Type="1">TGFzdCBVcGRhdGVkIExpbms=</PHRASE>
<PHRASE Label="la_prompt_LastName" Module="In-Portal" Type="1">TGFzdCBOYW1l</PHRASE>
<PHRASE Label="la_prompt_LastUpdatedPostDate" Module="In-Portal" Type="1">TGFzdCBVcGRhdGVkIFBvc3QgRGF0ZQ==</PHRASE>
<PHRASE Label="la_prompt_LastUpdatedPostTime" Module="In-Portal" Type="1">TGFzdCBVcGRhdGVkIFBvc3QgVGltZQ==</PHRASE>
<PHRASE Label="la_prompt_LastUpdatedTopicDate" Module="In-Portal" Type="1">TGFzdCBVcGRhdGVkIFRvcGljIERhdGU=</PHRASE>
<PHRASE Label="la_prompt_LastUpdatedTopicTime" Module="In-Portal" Type="1">TGFzdCBVcGRhdGVkIFRvcGljIFRpbWU=</PHRASE>
<PHRASE Label="la_prompt_Last_Name" Module="In-Portal" Type="1">TGFzdCBOYW1l</PHRASE>
<PHRASE Label="la_prompt_LeadArticle" Module="In-Portal" Type="1">U2l0ZSBMZWFkIFN0b3J5</PHRASE>
<PHRASE Label="la_prompt_LeadCat" Module="In-Portal" Type="1">Q2F0ZWdvcnkgbGVhZCBhcnRpY2xl</PHRASE>
<PHRASE Label="la_prompt_LeadStoryArticles" Module="In-Portal" Type="1">TGVhZCBTdG9yeSBBcnRpY2xlcw==</PHRASE>
<PHRASE Label="la_prompt_LinkId" Module="In-Portal" Type="1">TGluayBJZA==</PHRASE>
<PHRASE Label="la_prompt_LinkReviews" Module="In-Portal" Type="1">VG90YWwgTGluayBSZXZpZXdz</PHRASE>
<PHRASE Label="la_prompt_LinksAverageRating" Module="In-Portal" Type="1">QXZlcmFnZSBSYXRpbmcgb2YgTGlua3M=</PHRASE>
<PHRASE Label="la_prompt_link_owner" Module="In-Portal" Type="1">TGluayBPd25lcg==</PHRASE>
<PHRASE Label="la_prompt_LoadLangTypes" Module="In-Portal" Type="1">SW5zdGFsbCBQaHJhc2UgVHlwZXM6</PHRASE>
<PHRASE Label="la_prompt_LocalName" Module="In-Portal" Type="1">TG9jYWwgTmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_Location" Module="In-Portal" Type="1">TG9jYXRpb24=</PHRASE>
<PHRASE Label="la_prompt_mailauthenticate" Module="In-Portal" Type="1">U2VydmVyIFJlcXVpcmVzIEF1dGhlbnRpY2F0aW9u</PHRASE>
<PHRASE Label="la_prompt_mailhtml" Module="In-Portal" Type="1">U2VuZCBIVE1MIGVtYWls</PHRASE>
<PHRASE Label="la_prompt_mailport" Module="In-Portal" Type="1">UG9ydCAoZS5nLiBwb3J0IDI1KQ==</PHRASE>
<PHRASE Label="la_prompt_mailserver" Module="In-Portal" Type="1">TWFpbCBTZXJ2ZXIgQWRkcmVzcw==</PHRASE>
<PHRASE Label="la_prompt_MaxHitsArticles" Module="In-Portal" Type="1">TWF4aW11bSBIaXRzIG9mIGFuIEFydGljbGU=</PHRASE>
<PHRASE Label="la_prompt_MaxLinksHits" Module="In-Portal" Type="1">TWF4aW11bSBIaXRzIG9mIGEgTGluaw==</PHRASE>
<PHRASE Label="la_prompt_MaxLinksVotes" Module="In-Portal" Type="1">TWF4aW11bSBWb3RlcyBvZiBhIExpbms=</PHRASE>
<PHRASE Label="la_prompt_MaxTopicHits" Module="In-Portal" Type="1">VG9waWMgTWF4aW11bSBIaXRz</PHRASE>
<PHRASE Label="la_prompt_MaxTopicVotes" Module="In-Portal" Type="1">VG9waWMgTWF4aW11bSBWb3Rlcw==</PHRASE>
<PHRASE Label="la_prompt_MaxVotesArticles" Module="In-Portal" Type="1">TWF4aW11bSBWb3RlcyBvZiBhbiBBcnRpY2xl</PHRASE>
<PHRASE Label="la_prompt_max_import_category_levels" Module="In-Portal" Type="1">TWF4aW1hbCBpbXBvcnRlZCBjYXRlZ29yeSBsZXZlbA==</PHRASE>
<PHRASE Label="la_prompt_MembershipExpires" Module="In-Portal" Type="1">TWVtYmVyc2hpcCBFeHBpcmVz</PHRASE>
<PHRASE Label="la_prompt_MessageType" Module="In-Portal" Type="1">Rm9ybWF0</PHRASE>
<PHRASE Label="la_prompt_MetaDescription" Module="In-Portal" Type="1">TWV0YSBEZXNjcmlwdGlvbg==</PHRASE>
<PHRASE Label="la_prompt_MetaKeywords" Module="In-Portal" Type="1">TWV0YSBLZXl3b3Jkcw==</PHRASE>
<PHRASE Label="la_prompt_minkeywordlength" Module="In-Portal" Type="1">TWluaW11bSBrZXl3b3JkIGxlbmd0aA==</PHRASE>
<PHRASE Label="la_prompt_ModifedOn" Module="In-Portal" Type="1">TW9kaWZpZWQgT24=</PHRASE>
<PHRASE Label="la_prompt_ModifedOn_Time" Module="In-Portal" Type="1">TW9kaWZpZWQgYXQ=</PHRASE>
<PHRASE Label="la_prompt_Module" Module="In-Portal" Type="1">TW9kdWxl</PHRASE>
<PHRASE Label="la_prompt_movedown" Module="In-Portal" Type="1">TW92ZSBkb3du</PHRASE>
<PHRASE Label="la_prompt_moveup" Module="In-Portal" Type="1">TW92ZSB1cA==</PHRASE>
<PHRASE Label="la_prompt_multipleshow" Module="In-Portal" Type="1">U2hvdyBtdWx0aXBsZQ==</PHRASE>
<PHRASE Label="la_prompt_Name" Module="In-Portal" Type="1">TmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_New" Module="In-Portal" Type="1">TmV3</PHRASE>
<PHRASE Label="la_prompt_NewArticles" Module="In-Portal" Type="1">TmV3IEFydGljbGVz</PHRASE>
<PHRASE Label="la_prompt_NewCategories" Module="In-Portal" Type="1">TmV3IENhdGVnb3JpZXM=</PHRASE>
<PHRASE Label="la_prompt_NewestArticleDate" Module="In-Portal" Type="1">TmV3ZXN0IEFydGljbGUgRGF0ZQ==</PHRASE>
<PHRASE Label="la_prompt_NewestCategoryDate" Module="In-Portal" Type="1">TmV3ZXN0IENhdGVnb3J5IERhdGU=</PHRASE>
<PHRASE Label="la_prompt_NewestLinkDate" Module="In-Portal" Type="1">TmV3ZXN0IExpbmsgRGF0ZQ==</PHRASE>
<PHRASE Label="la_prompt_NewestPostDate" Module="In-Portal" Type="1">TmV3ZXN0IFBvc3QgRGF0ZQ==</PHRASE>
<PHRASE Label="la_prompt_NewestPostTime" Module="In-Portal" Type="1">TmV3ZXN0IFBvc3QgVGltZQ==</PHRASE>
<PHRASE Label="la_prompt_NewestTopicDate" Module="In-Portal" Type="1">TmV3ZXN0IFRvcGljIERhdGU=</PHRASE>
<PHRASE Label="la_prompt_NewestTopicTime" Module="In-Portal" Type="1">TmV3ZXN0IFRvcGljIFRpbWU=</PHRASE>
<PHRASE Label="la_prompt_NewestUserDate" Module="In-Portal" Type="1">TmV3ZXN0IFVzZXIgRGF0ZQ==</PHRASE>
<PHRASE Label="la_prompt_NewLinks" Module="In-Portal" Type="1">TmV3IExpbmtz</PHRASE>
<PHRASE Label="la_prompt_NewsId" Module="In-Portal" Type="1">TmV3cyBBcnRpY2xlIElE</PHRASE>
<PHRASE Label="la_prompt_NewTopics" Module="In-Portal" Type="1">TmV3IFRvcGljcw==</PHRASE>
<PHRASE Label="la_prompt_NonExpiredSessions" Module="In-Portal" Type="1">Q3VycmVudGx5IEFjdGl2ZSBVc2VyIFNlc3Npb25z</PHRASE>
<PHRASE Label="la_prompt_NotifyOwner" Module="In-Portal" Type="1">Tm90aWZ5IE93bmVy</PHRASE>
<PHRASE Label="la_prompt_NotRegUsers" Module="In-Portal" Type="1">TGluayBwZXJtaXNzaW9uIElEIGZvciBhbGwgdW5yZWdpc3RlcmVkIHVzZXJzIHRvIHZpZXcgaXQ=</PHRASE>
<PHRASE Label="la_prompt_overwritephrases" Module="In-Portal" Type="2">T3ZlcndyaXRlIEV4aXN0aW5nIFBocmFzZXM=</PHRASE>
<PHRASE Label="la_prompt_PackName" Module="In-Portal" Type="1">UGFjayBOYW1l</PHRASE>
<PHRASE Label="la_prompt_Parameter" Module="In-Portal" Type="1">UGFyYW1ldGVy</PHRASE>
<PHRASE Label="la_prompt_parent_templates" Module="In-Portal" Type="1">UGFyZW50IHRlbXBsYXRlcw==</PHRASE>
<PHRASE Label="la_prompt_Password" Module="In-Portal" Type="1">UGFzc3dvcmQ=</PHRASE>
<PHRASE Label="la_prompt_PasswordRepeat" Module="In-Portal" Type="1">UmVwZWF0IFBhc3N3b3Jk</PHRASE>
<PHRASE Label="la_prompt_Pending" Module="In-Portal" Type="1">UGVuZGluZw==</PHRASE>
<PHRASE Label="la_prompt_PendingCategories" Module="In-Portal" Type="1">UGVuZGluZyBDYXRlZ29yaWVz</PHRASE>
<PHRASE Label="la_prompt_PendingItems" Module="In-Portal" Type="1">UGVuZGluZyBJdGVtcw==</PHRASE>
<PHRASE Label="la_prompt_PendingLinks" Module="In-Portal" Type="1">UGVuZGluZyBMaW5rcw==</PHRASE>
<PHRASE Label="la_prompt_perform_now" Module="In-Portal" Type="1">UGVyZm9ybSB0aGlzIG9wZXJhdGlvbiBub3c/</PHRASE>
<PHRASE Label="la_prompt_PerPage" Module="In-Portal" Type="1">UGVyIFBhZ2U=</PHRASE>
<PHRASE Label="la_prompt_PersonalInfo" Module="In-Portal" Type="1">UGVyc29uYWwgSW5mb3JtYXRpb24=</PHRASE>
<PHRASE Label="la_prompt_Phone" Module="In-Portal" Type="1">UGhvbmU=</PHRASE>
<PHRASE Label="la_prompt_PhraseId" Module="In-Portal" Type="1">UGhyYXNlIElk</PHRASE>
<PHRASE Label="la_prompt_Phrases" Module="In-Portal" Type="1">UGhyYXNlcw==</PHRASE>
<PHRASE Label="la_prompt_PhraseType" Module="In-Portal" Type="1">UGhyYXNlIFR5cGU=</PHRASE>
<PHRASE Label="la_prompt_plaintext" Module="In-Portal" Type="1">UGxhaW4gVGV4dA==</PHRASE>
<PHRASE Label="la_prompt_Pop" Module="In-Portal" Type="1">UG9wdWxhcml0eQ==</PHRASE>
<PHRASE Label="la_prompt_PopularArticles" Module="In-Portal" Type="1">UG9wdWxhciBBcnRpY2xlcw==</PHRASE>
<PHRASE Label="la_prompt_PopularLinks" Module="In-Portal" Type="1">UG9wdWxhciBMaW5rcw==</PHRASE>
<PHRASE Label="la_prompt_PopularTopics" Module="In-Portal" Type="1">UG9wdWxhciBUb3BpY3M=</PHRASE>
<PHRASE Label="la_prompt_PostedBy" Module="In-Portal" Type="1">UG9zdGVkIGJ5</PHRASE>
<PHRASE Label="la_prompt_PostsToLock" Module="In-Portal" Type="1">UG9zdHMgdG8gbG9jaw==</PHRASE>
<PHRASE Label="la_prompt_PostsTotal" Module="In-Portal" Type="1">VG90YWwgUG9zdHM=</PHRASE>
<PHRASE Label="la_prompt_Primary" Module="In-Portal" Type="1">UHJpbWFyeQ==</PHRASE>
<PHRASE Label="la_prompt_PrimaryGroup" Module="In-Portal" Type="1">UHJpbWFyeSBHcm91cA==</PHRASE>
<PHRASE Label="la_prompt_PrimaryValue" Module="In-Portal" Type="1">UHJpbWFyeSBWYWx1ZQ==</PHRASE>
<PHRASE Label="la_prompt_Priority" Module="In-Portal" Type="1">UHJpb3JpdHk=</PHRASE>
<PHRASE Label="la_prompt_Properties" Module="In-Portal" Type="1">UHJvcGVydGllcw==</PHRASE>
<PHRASE Label="la_prompt_Rating" Module="In-Portal" Type="1">UmF0aW5n</PHRASE>
<PHRASE Label="la_prompt_RatingLimits" Module="In-Portal" Type="1">KE1pbmltdW0gMCwgTWF4aW11bSA1KQ==</PHRASE>
<PHRASE Label="la_prompt_RecordsCount" Module="In-Portal" Type="1">TnVtYmVyIG9mIERhdGFiYXNlIFJlY29yZHM=</PHRASE>
<PHRASE Label="la_prompt_RegionsCount" Module="In-Portal" Type="1">TnVtYmVyIG9mIFJlZ2lvbiBQYWNrcw==</PHRASE>
<PHRASE Label="la_prompt_RegUserId" Module="In-Portal" Type="1">UmVndWxhciBVc2VyIEdyb3Vw</PHRASE>
<PHRASE Label="la_prompt_RegUsers" Module="In-Portal" Type="1">TGluayBwZXJtaXNzaW9uIElEIGZvciBhbGwgcmVnaXN0ZXJlZCB1c2VycyB0byB2aWV3IGl0</PHRASE>
<PHRASE Label="la_prompt_RelationId" Module="In-Portal" Type="1">UmVsYXRpb24gSUQ=</PHRASE>
<PHRASE Label="la_prompt_RelationType" Module="In-Portal" Type="1">UmVsYXRpb24gVHlwZQ==</PHRASE>
<PHRASE Label="la_prompt_relevence_percent" Module="In-Portal" Type="1">U2VhcmNoIFJlbGV2YW5jZSBkZXBlbmRzIG9u</PHRASE>
<PHRASE Label="la_prompt_relevence_settings" Module="In-Portal" Type="1">U2VhcmNoIFJlbGV2ZW5jZSBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_prompt_remote_url" Module="In-Portal" Type="1">VXNlIHJlbW90ZSBpbWFnZSAoVVJMKQ==</PHRASE>
<PHRASE Label="la_prompt_ReplacementWord" Module="In-Portal" Type="1">UmVwbGFjZW1lbnQgV29yZA==</PHRASE>
<PHRASE Label="la_prompt_required_field_increase" Module="In-Portal" Type="1">SW5jcmVhc2UgaW1wb3J0YW5jZSBpZiBmaWVsZCBjb250YWlucyBhIHJlcXVpcmVkIGtleXdvcmQgYnk=</PHRASE>
<PHRASE Label="la_Prompt_Restore_Failed" Module="In-Portal" Type="1">UmVzdG9yZSBoYXMgZmFpbGVkIGFuIGVycm9yIG9jY3VyZWQ6</PHRASE>
<PHRASE Label="la_Prompt_Restore_Filechoose" Module="In-Portal" Type="1">Q2hvb3NlIG9uZSBvZiB0aGUgZm9sbG93aW5nIGJhY2t1cCBkYXRlcyB0byByZXN0b3JlIG9yIGRlbGV0ZQ==</PHRASE>
<PHRASE Label="la_Prompt_Restore_Status" Module="In-Portal" Type="1">UmVzdG9yZSBTdGF0dXM=</PHRASE>
<PHRASE Label="la_Prompt_Restore_Success" Module="In-Portal" Type="1">UmVzdG9yZSBoYXMgYmVlbiBjb21wbGV0ZWQgc3VjY2Vzc2Z1bGx5</PHRASE>
<PHRASE Label="la_Prompt_ReviewedBy" Module="In-Portal" Type="1">UmV2aWV3ZWQgQnk=</PHRASE>
<PHRASE Label="la_prompt_ReviewId" Module="In-Portal" Type="1">UmV2aWV3IElE</PHRASE>
<PHRASE Label="la_prompt_ReviewText" Module="In-Portal" Type="1">UmV2aWV3IFRleHQ=</PHRASE>
<PHRASE Label="la_prompt_RootCategory" Module="In-Portal" Type="1">U2VsZWN0IE1vZHVsZSBSb290IENhdGVnb3J5Og==</PHRASE>
<PHRASE Label="la_prompt_root_name" Module="In-Portal" Type="1">Um9vdCBjYXRlZ29yeSBuYW1lIChsYW5ndWFnZSB2YXJpYWJsZSk=</PHRASE>
<PHRASE Label="la_prompt_root_pass" Module="In-Portal" Type="1">Um9vdCBQYXNzd29yZA==</PHRASE>
<PHRASE Label="la_prompt_Root_Password" Module="In-Portal" Type="1">UGxlYXNlIGVudGVyIHRoZSBSb290IHBhc3N3b3Jk</PHRASE>
<PHRASE Label="la_prompt_root_pass_verify" Module="In-Portal" Type="1">VmVyaWZ5IFJvb3QgUGFzc3dvcmQ=</PHRASE>
<PHRASE Label="la_prompt_RuleType" Module="In-Portal" Type="2">UnVsZSBUeXBl</PHRASE>
<PHRASE Label="la_prompt_runlink_validation" Module="In-Portal" Type="2">VmFsaWRhdGlvbiBQcm9ncmVzcw==</PHRASE>
<PHRASE Label="la_prompt_Search" Module="In-Portal" Type="1">U2VhcmNo</PHRASE>
<PHRASE Label="la_prompt_SearchType" Module="In-Portal" Type="1">U2VhcmNoIFR5cGU=</PHRASE>
<PHRASE Label="la_prompt_Select_Source" Module="In-Portal" Type="1">U2VsZWN0IFNvdXJjZSBMYW5ndWFnZQ==</PHRASE>
<PHRASE Label="la_prompt_sendmethod" Module="In-Portal" Type="1">U2VuZCBFbWFpbCBBcw==</PHRASE>
<PHRASE Label="la_prompt_SentOn" Module="In-Portal" Type="1">U2VudCBPbg==</PHRASE>
<PHRASE Label="la_prompt_Server" Module="In-Portal" Type="1">U2VydmVyIEhvc3RuYW1l</PHRASE>
<PHRASE Label="la_prompt_SessionKey" Module="In-Portal" Type="1">U0lE</PHRASE>
<PHRASE Label="la_prompt_session_cookie_name" Module="In-Portal" Type="1">U2Vzc2lvbiBDb29raWUgTmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_session_management" Module="In-Portal" Type="1">U2Vzc2lvbiBNYW5hZ2VtZW50IE1ldGhvZA==</PHRASE>
<PHRASE Label="la_prompt_session_timeout" Module="In-Portal" Type="1">U2Vzc2lvbiBJbmFjdGl2aXR5IFRpbWVvdXQgKHNlY29uZHMp</PHRASE>
<PHRASE Label="la_prompt_showgeneraltab" Module="In-Portal" Type="1">U2hvdyBvbiB0aGUgZ2VuZXJhbCB0YWI=</PHRASE>
<PHRASE Label="la_prompt_SimpleSearch" Module="In-Portal" Type="1">U2ltcGxlIFNlYXJjaA==</PHRASE>
<PHRASE Label="la_prompt_smtpheaders" Module="In-Portal" Type="1">QWRkaXRpb25hbCBNZXNzYWdlIEhlYWRlcnM=</PHRASE>
<PHRASE Label="la_prompt_smtp_pass" Module="In-Portal" Type="1">TWFpbCBTZXJ2ZXIgUGFzc3dvcmQ=</PHRASE>
<PHRASE Label="la_prompt_smtp_user" Module="In-Portal" Type="1">TWFpbCBTZXJ2ZXIgVXNlcm5hbWU=</PHRASE>
<PHRASE Label="la_prompt_socket_blocking_mode" Module="In-Portal" Type="1">VXNlIG5vbi1ibG9ja2luZyBzb2NrZXQgbW9kZQ==</PHRASE>
<PHRASE Label="la_prompt_sqlquery" Module="In-Portal" Type="1">U1FMIFF1ZXJ5Og==</PHRASE>
<PHRASE Label="la_prompt_sqlquery_error" Module="In-Portal" Type="1">QW4gU1FMIGVycm9yIGhhcyBvY2N1cmVk</PHRASE>
<PHRASE Label="la_prompt_sqlquery_header" Module="In-Portal" Type="1">UGVyZm9ybSBTUUwgUXVlcnk=</PHRASE>
<PHRASE Label="la_prompt_sqlquery_result" Module="In-Portal" Type="1">U1FMIFF1ZXJ5IFJlc3VsdHM=</PHRASE>
<PHRASE Label="la_prompt_SqlType" Module="In-Portal" Type="1">U2VydmVyIFR5cGU=</PHRASE>
<PHRASE Label="la_prompt_StartDate" Module="In-Portal" Type="1">U3RhcnQgRGF0ZQ==</PHRASE>
<PHRASE Label="la_prompt_State" Module="In-Portal" Type="1">U3RhdGU=</PHRASE>
<PHRASE Label="la_prompt_Status" Module="In-Portal" Type="1">U3RhdHVz</PHRASE>
<PHRASE Label="la_Prompt_Step_One" Module="In-Portal" Type="1">U3RlcCBPbmU=</PHRASE>
<PHRASE Label="la_prompt_Street" Module="In-Portal" Type="1">U3RyZWV0</PHRASE>
<PHRASE Label="la_prompt_Stylesheet" Module="In-Portal" Type="1">U3R5bGVzaGVldA==</PHRASE>
<PHRASE Label="la_prompt_Subject" Module="In-Portal" Type="1">U3ViamVjdA==</PHRASE>
<PHRASE Label="la_prompt_SubSearch" Module="In-Portal" Type="1">U3ViIFNlYXJjaA==</PHRASE>
<PHRASE Label="la_prompt_syscache_enable" Module="In-Portal" Type="1">RW5hYmxlIFRhZyBDYWNoaW5n</PHRASE>
<PHRASE Label="la_prompt_SystemFileSize" Module="In-Portal" Type="1">VG90YWwgU2l6ZSBvZiBTeXN0ZW0gRmlsZXM=</PHRASE>
<PHRASE Label="la_Prompt_SystemPermissions" Module="In-Portal" Type="1">U3lzdGVtIHByZW1pc3Npb25z</PHRASE>
<PHRASE Label="la_prompt_TablesCount" Module="In-Portal" Type="1">TnVtYmVyIG9mIERhdGFiYXNlIFRhYmxlcw==</PHRASE>
<PHRASE Label="la_prompt_Template" Module="In-Portal" Type="1">VGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_prompt_text_version" Module="In-Portal" Type="1">VGV4dCBWZXJzaW9u</PHRASE>
<PHRASE Label="la_prompt_Theme" Module="In-Portal" Type="1">VGhlbWU=</PHRASE>
<PHRASE Label="la_prompt_ThemeCount" Module="In-Portal" Type="1">TnVtYmVyIG9mIFRoZW1lcw==</PHRASE>
<PHRASE Label="la_prompt_ThemeId" Module="In-Portal" Type="1">VGhlbWUgSWQ=</PHRASE>
<PHRASE Label="la_prompt_thousand" Module="In-Portal" Type="2">VGhvdXNhbmRzIFNlcGFyYXRvcg==</PHRASE>
<PHRASE Label="la_prompt_ThumbURL" Module="In-Portal" Type="1">UmVtb3RlIFVSTA==</PHRASE>
<PHRASE Label="la_prompt_TimeFormat" Module="In-Portal" Type="1">KGhoOm1tOnNzKQ==</PHRASE>
<PHRASE Label="la_Prompt_Title" Module="In-Portal" Type="1">VGl0bGU=</PHRASE>
<PHRASE Label="la_prompt_To" Module="In-Portal" Type="1">VG8=</PHRASE>
<PHRASE Label="la_prompt_TopicAverageRating" Module="In-Portal" Type="1">VG9waWNzIEF2ZXJhZ2UgUmF0aW5n</PHRASE>
<PHRASE Label="la_prompt_TopicId" Module="In-Portal" Type="1">VG9waWMgSUQ=</PHRASE>
<PHRASE Label="la_prompt_TopicLocked" Module="In-Portal" Type="1">VG9waWMgTG9ja2Vk</PHRASE>
<PHRASE Label="la_prompt_TopicReviews" Module="In-Portal" Type="1">VG90YWwgVG9waWMgUmV2aWV3cw==</PHRASE>
<PHRASE Label="la_prompt_TopicsActive" Module="In-Portal" Type="1">QWN0aXZlIFRvcGljcw==</PHRASE>
<PHRASE Label="la_prompt_TopicsDisabled" Module="In-Portal" Type="1">RGlzYWJsZWQgVG9waWNz</PHRASE>
<PHRASE Label="la_prompt_TopicsPending" Module="In-Portal" Type="1">UGVuZGluZyBUb3BpY3M=</PHRASE>
<PHRASE Label="la_prompt_TopicsTotal" Module="In-Portal" Type="1">VG90YWwgVG9waWNz</PHRASE>
<PHRASE Label="la_prompt_TopicsUsers" Module="In-Portal" Type="1">VG90YWwgVXNlcnMgd2l0aCBUb3BpY3M=</PHRASE>
<PHRASE Label="la_prompt_TotalCategories" Module="In-Portal" Type="1">VG90YWwgQ2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_prompt_TotalLinks" Module="In-Portal" Type="1">VG90YWwgTGlua3M=</PHRASE>
<PHRASE Label="la_prompt_TotalUserGroups" Module="In-Portal" Type="1">VG90YWwgVXNlciBHcm91cHM=</PHRASE>
<PHRASE Label="la_prompt_Type" Module="In-Portal" Type="1">VHlwZQ==</PHRASE>
<PHRASE Label="la_prompt_updating" Module="In-Portal" Type="1">VXBkYXRpbmc=</PHRASE>
<PHRASE Label="la_prompt_upload" Module="In-Portal" Type="1">VXBsb2FkIGltYWdlIGZyb20gbG9jYWwgUEM=</PHRASE>
<PHRASE Label="la_prompt_URL" Module="In-Portal" Type="1">VVJM</PHRASE>
<PHRASE Label="la_prompt_UserCount" Module="In-Portal" Type="1">VXNlciBDb3VudA==</PHRASE>
<PHRASE Label="la_prompt_Usermame" Module="In-Portal" Type="1">VXNlcm5hbWU=</PHRASE>
<PHRASE Label="la_prompt_Username" Module="In-Portal" Type="1">VXNlcm5hbWU=</PHRASE>
<PHRASE Label="la_prompt_UsersActive" Module="In-Portal" Type="1">QWN0aXZlIFVzZXJz</PHRASE>
<PHRASE Label="la_prompt_UsersDisabled" Module="In-Portal" Type="1">RGlzYWJsZWQgVXNlcnM=</PHRASE>
<PHRASE Label="la_prompt_UsersPending" Module="In-Portal" Type="1">UGVuZGluZyBVc2Vycw==</PHRASE>
<PHRASE Label="la_prompt_UsersUniqueCountries" Module="In-Portal" Type="1">TnVtYmVyIG9mIFVuaXF1ZSBDb3VudHJpZXMgb2YgVXNlcnM=</PHRASE>
<PHRASE Label="la_prompt_UsersUniqueStates" Module="In-Portal" Type="1">TnVtYmVyIG9mIFVuaXF1ZSBTdGF0ZXMgb2YgVXNlcnM=</PHRASE>
<PHRASE Label="la_prompt_Value" Module="In-Portal" Type="1">VmFsdWU=</PHRASE>
<PHRASE Label="la_prompt_valuelist" Module="In-Portal" Type="1">TGlzdCBvZiBWYWx1ZXM=</PHRASE>
<PHRASE Label="la_prompt_Views" Module="In-Portal" Type="1">Vmlld3M=</PHRASE>
<PHRASE Label="la_prompt_Visible" Module="In-Portal" Type="1">VmlzaWJsZQ==</PHRASE>
<PHRASE Label="la_prompt_VoteLimits" Module="In-Portal" Type="1">KE1pbmltdW0gMSk=</PHRASE>
<PHRASE Label="la_prompt_Votes" Module="In-Portal" Type="1">Vm90ZXM=</PHRASE>
<PHRASE Label="la_Prompt_Warning" Module="In-Portal" Type="1">V2FybmluZyE=</PHRASE>
<PHRASE Label="la_prompt_weight" Module="In-Portal" Type="1">V2VpZ2h0</PHRASE>
<PHRASE Label="la_prompt_Zip" Module="In-Portal" Type="1">Wmlw</PHRASE>
<PHRASE Label="la_promt_ReferrerCheck" Module="In-Portal" Type="1">U2Vzc2lvbiBSZWZlcnJlciBDaGVja2luZw==</PHRASE>
<PHRASE Label="la_Rating" Module="In-Portal" Type="1">bGFfUmF0aW5n</PHRASE>
<PHRASE Label="la_rating_alreadyvoted" Module="In-Portal" Type="1">QWxyZWFkeSB2b3RlZA==</PHRASE>
<PHRASE Label="la_Reciprocal" Module="In-Portal" Type="1">UmVjaXByb2NhbA==</PHRASE>
<PHRASE Label="la_RemoveFrom" Module="In-Portal" Type="1">UmVtb3ZlIEZyb20=</PHRASE>
<PHRASE Label="la_RequiredWarning" Module="In-Portal" Type="1">Tm90IGFsbCByZXF1aXJlZCBmaWVsZHMgYXJlIGZpbGxlZC4gUGxlYXNlIGZpbGwgdGhlbSBmaXJzdC4=</PHRASE>
<PHRASE Label="la_restore_access_denied" Module="In-Portal" Type="1">QWNjZXNzIGRlbmllZA==</PHRASE>
<PHRASE Label="la_restore_file_error" Module="In-Portal" Type="1">RmlsZSBlcnJvcg==</PHRASE>
<PHRASE Label="la_restore_file_not_found" Module="In-Portal" Type="1">RmlsZSBub3QgZm91bmQ=</PHRASE>
<PHRASE Label="la_restore_read_error" Module="In-Portal" Type="1">VW5hYmxlIHRvIHJlYWQgZnJvbSBmaWxl</PHRASE>
<PHRASE Label="la_restore_unknown_error" Module="In-Portal" Type="1">QW4gdW5kZWZpbmVkIGVycm9yIGhhcyBvY2N1cmVk</PHRASE>
<PHRASE Label="la_reviewer" Module="In-Portal" Type="1">UmV2aWV3ZXI=</PHRASE>
<PHRASE Label="la_review_added" Module="In-Portal" Type="1">UmV2aWV3IGFkZGVkIHN1Y2Nlc3NmdWxseQ==</PHRASE>
<PHRASE Label="la_review_alreadyreviewed" Module="In-Portal" Type="1">VGhpcyBpdGVtIGhhcyBhbHJlYWR5IGJlZW4gcmV2aWV3ZWQ=</PHRASE>
<PHRASE Label="la_review_error" Module="In-Portal" Type="1">RXJyb3IgYWRkaW5nIHJldmlldw==</PHRASE>
<PHRASE Label="la_review_perpage_prompt" Module="In-Portal" Type="1">UmV2aWV3cyBQZXIgUGFnZQ==</PHRASE>
<PHRASE Label="la_review_perpage_short_prompt" Module="In-Portal" Type="1">UmV2aWV3cyBQZXIgUGFnZSAoU2hvcnRsaXN0KQ==</PHRASE>
<PHRASE Label="la_rootpass_verify_error" Module="In-Portal" Type="1">RXJyb3IgdmVyaWZ5aW5nIHBhc3N3b3Jk</PHRASE>
<PHRASE Label="la_running_query" Module="In-Portal" Type="1">UnVubmluZyBRdWVyeQ==</PHRASE>
<PHRASE Label="la_SampleText" Module="In-Portal" Type="1">U2FtcGxlIFRleHQ=</PHRASE>
<PHRASE Label="la_Save" Module="In-Portal" Type="1">U2F2ZQ==</PHRASE>
<PHRASE Label="la_Search" Module="In-Portal" Type="1">U2VhcmNo</PHRASE>
<PHRASE Label="la_SearchLabel" Module="In-Portal" Type="1">U2VhcmNo</PHRASE>
<PHRASE Label="la_SearchLabel_Categories" Module="In-Portal" Type="1">U2VhcmNoIENhdGVnb3JpZXM=</PHRASE>
<PHRASE Label="la_SearchLabel_Links" Module="In-Portal" Type="1">U2VhcmNoIExpbmtz</PHRASE>
<PHRASE Label="la_SearchLabel_News" Module="In-Portal" Type="1">U2VhcmNoIEFydGljbGVz</PHRASE>
<PHRASE Label="la_SearchLabel_Topics" Module="In-Portal" Type="1">U2VhcmNoIFRvcGljcw==</PHRASE>
<PHRASE Label="la_SearchMenu_Categories" Module="In-Portal" Type="1">Q2F0ZWdvcmllczE=</PHRASE>
<PHRASE Label="la_SearchMenu_Clear" Module="In-Portal" Type="1">Q2xlYXIgU2VhcmNo</PHRASE>
<PHRASE Label="la_SearchMenu_New" Module="In-Portal" Type="1">TmV3IFNlYXJjaA==</PHRASE>
<PHRASE Label="la_Sectionheader_MetaInformation" Module="In-Portal" Type="1">TUVUQSBJbmZvcm1hdGlvbg==</PHRASE>
<PHRASE Label="la_section_Category" Module="In-Portal" Type="1">Q2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_section_Counters" Module="In-Portal" Type="1">Q291bnRlcnM=</PHRASE>
<PHRASE Label="la_section_CustomFields" Module="In-Portal" Type="1">Q3VzdG9tIEZpZWxkcw==</PHRASE>
<PHRASE Label="la_section_FullSizeImage" Module="In-Portal" Type="1">RnVsbCBTaXplIEltYWdl</PHRASE>
<PHRASE Label="la_section_General" Module="In-Portal" Type="1">R2VuZXJhbA==</PHRASE>
<PHRASE Label="la_section_Image" Module="In-Portal" Type="1">SW1hZ2U=</PHRASE>
<PHRASE Label="la_section_Message" Module="In-Portal" Type="1">TWVzc2FnZQ==</PHRASE>
<PHRASE Label="la_section_overview" Module="In-Portal" Type="1">U2VjdGlvbiBPdmVydmlldw==</PHRASE>
<PHRASE Label="la_section_Properties" Module="In-Portal" Type="1">UHJvcGVydGllcw==</PHRASE>
<PHRASE Label="la_section_QuickLinks" Module="In-Portal" Type="1">UXVpY2sgTGlua3M=</PHRASE>
<PHRASE Label="la_section_Relation" Module="In-Portal" Type="1">UmVsYXRpb24=</PHRASE>
<PHRASE Label="la_section_Templates" Module="In-Portal" Type="1">VGVtcGxhdGVz</PHRASE>
<PHRASE Label="la_section_ThumbnailImage" Module="In-Portal" Type="1">VGh1bWJuYWlsIEltYWdl</PHRASE>
<PHRASE Label="la_section_Translation" Module="In-Portal" Type="1">VHJhbnNsYXRpb24=</PHRASE>
<PHRASE Label="la_section_UsersSearch" Module="In-Portal" Type="1">U2VhcmNoIFVzZXJz</PHRASE>
+ <PHRASE Label="la_SelectColumns" Module="In-Portal" Type="1">U2VsZWN0IENvbHVtbnM=</PHRASE>
<PHRASE Label="la_selecting_categories" Module="In-Portal" Type="1">U2VsZWN0aW5nIENhdGVnb3JpZXM=</PHRASE>
<PHRASE Label="la_Selection_Empty" Module="In-Portal" Type="1">RW1wdHkgc2VsZWN0aW9u</PHRASE>
<PHRASE Label="la_SeparatedCategoryPath" Module="In-Portal" Type="1">T25lIGZpZWxkIGZvciBlYWNoIGNhdGVnb3J5IGxldmVs</PHRASE>
<PHRASE Label="la_Showing_Logs" Module="In-Portal" Type="1">U2hvd2luZyBMb2dz</PHRASE>
<PHRASE Label="la_Showing_Stats" Module="In-Portal" Type="1">U2hvd2luZyBTdGF0aXN0aWNz</PHRASE>
<PHRASE Label="la_Show_EmailLog" Module="In-Portal" Type="1">U2hvdyBFbWFpbCBMb2c=</PHRASE>
<PHRASE Label="la_Show_Log" Module="In-Portal" Type="1">U2hvd2luZyBMb2dz</PHRASE>
<PHRASE Label="la_sortfield2_prompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_step" Module="In-Portal" Type="1">U3RlcA==</PHRASE>
<PHRASE Label="la_StyleDefinition" Module="In-Portal" Type="1">RGVmaW5pdGlvbg==</PHRASE>
<PHRASE Label="la_StylePreview" Module="In-Portal" Type="1">UHJldmlldw==</PHRASE>
<PHRASE Label="la_sunday" Module="In-Portal" Type="1">U3VuZGF5</PHRASE>
<PHRASE Label="la_tab_AdminUI" Module="In-Portal" Type="1">QWRtaW5pc3RyYXRpb24gUGFuZWwgVUk=</PHRASE>
<PHRASE Label="la_tab_AdvancedView" Module="In-Portal" Type="1">QWR2YW5jZWQgVmlldw==</PHRASE>
<PHRASE Label="la_tab_Backup" Module="In-Portal" Type="1">QmFja3Vw</PHRASE>
<PHRASE Label="la_tab_BanList" Module="In-Portal" Type="1">VXNlciBCYW4gTGlzdA==</PHRASE>
<PHRASE Label="la_tab_BaseStyles" Module="In-Portal" Type="1">QmFzZSBTdHlsZXM=</PHRASE>
<PHRASE Label="la_tab_BlockStyles" Module="In-Portal" Type="1">QmxvY2sgU3R5bGVz</PHRASE>
<PHRASE Label="la_tab_Browse" Module="In-Portal" Type="1">Q2F0YWxvZw==</PHRASE>
<PHRASE Label="la_tab_Categories" Module="In-Portal" Type="1">Q2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_tab_Category_RelationSelect" Module="In-Portal" Type="1">U2VsZWN0IEl0ZW0=</PHRASE>
<PHRASE Label="la_tab_Category_Select" Module="In-Portal" Type="1">Q2F0ZWdvcnkgU2VsZWN0</PHRASE>
<PHRASE Label="la_tab_Censorship" Module="In-Portal" Type="1">Q2Vuc29yc2hpcA==</PHRASE>
<PHRASE Label="la_tab_Community" Module="In-Portal" Type="1">Q29tbXVuaXR5</PHRASE>
<PHRASE Label="la_tab_ConfigCategories" Module="In-Portal" Type="1">R2VuZXJhbCBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_tab_ConfigCensorship" Module="In-Portal" Type="1">Q2Vuc29yc2hpcA==</PHRASE>
<PHRASE Label="la_tab_ConfigCustom" Module="In-Portal" Type="1">Q3VzdG9tIEZpZWxkcw==</PHRASE>
<PHRASE Label="la_tab_ConfigE-mail" Module="In-Portal" Type="1">RS1tYWlsIFNldHRpbmdz</PHRASE>
<PHRASE Label="la_tab_ConfigGeneral" Module="In-Portal" Type="1">R2VuZXJhbCBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_tab_ConfigOutput" Module="In-Portal" Type="1">T3V0cHV0IFNldHRpbmdz</PHRASE>
<PHRASE Label="la_tab_ConfigSearch" Module="In-Portal" Type="1">U2VhcmNoIFNldHRpbmdz</PHRASE>
<PHRASE Label="la_tab_ConfigSettings" Module="In-Portal" Type="1">R2VuZXJhbCBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_tab_ConfigSmileys" Module="In-Portal" Type="1">U21pbGV5cw==</PHRASE>
<PHRASE Label="la_tab_ConfigUsers" Module="In-Portal" Type="1">R2VuZXJhbCBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_tab_Custom" Module="In-Portal" Type="1">Q3VzdG9t</PHRASE>
<PHRASE Label="la_tab_Editing_Review" Module="In-Portal" Type="1">RWRpdGluZyBSZXZpZXc=</PHRASE>
<PHRASE Label="la_tab_EmailEvents" Module="In-Portal" Type="1">RW1haWwgRXZlbnRz</PHRASE>
<PHRASE Label="la_tab_EmailLog" Module="In-Portal" Type="1">RW1haWwgTG9n</PHRASE>
<PHRASE Label="la_tab_EmailMessage" Module="In-Portal" Type="1">RW1haWwgTWVzc2FnZQ==</PHRASE>
<PHRASE Label="la_tab_ExportData" Module="In-Portal" Type="1">RXhwb3J0IERhdGE=</PHRASE>
<PHRASE Label="la_tab_ExportLang" Module="In-Portal" Type="1">RXhwb3J0IExhbmd1YWdlIFBhY2s=</PHRASE>
<PHRASE Label="la_tab_General" Module="In-Portal" Type="1">R2VuZXJhbA==</PHRASE>
<PHRASE Label="la_tab_GeneralSettings" Module="In-Portal" Type="1">R2VuZXJhbCBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_tab_Group" Module="In-Portal" Type="1">R3JvdXA=</PHRASE>
<PHRASE Label="la_tab_Groups" Module="In-Portal" Type="1">R3JvdXBz</PHRASE>
<PHRASE Label="la_tab_GroupSelect" Module="In-Portal" Type="1">U2VsZWN0IEdyb3Vw</PHRASE>
<PHRASE Label="la_tab_Help" Module="In-Portal" Type="1">SGVscA==</PHRASE>
<PHRASE Label="la_tab_Images" Module="In-Portal" Type="1">SW1hZ2Vz</PHRASE>
<PHRASE Label="la_tab_ImportData" Module="In-Portal" Type="1">SW1wb3J0IERhdGE=</PHRASE>
<PHRASE Label="la_tab_ImportLang" Module="In-Portal" Type="1">SW1wb3J0IExhbmd1YWdlIFBhY2s=</PHRASE>
<PHRASE Label="la_tab_inlinkimport" Module="In-Portal" Type="1">SW4tbGluayBpbXBvcnQ=</PHRASE>
<PHRASE Label="la_tab_Install" Module="In-Portal" Type="1">SW5zdGFsbA==</PHRASE>
<PHRASE Label="la_tab_ItemList" Module="In-Portal" Type="1">SXRlbSBMaXN0</PHRASE>
<PHRASE Label="la_tab_Items" Module="In-Portal" Type="1">SXRlbXM=</PHRASE>
<PHRASE Label="la_tab_label" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_tab_Labels" Module="In-Portal" Type="1">TGFiZWxz</PHRASE>
<PHRASE Label="la_tab_LinkValidation" Module="In-Portal" Type="2">TGluayBWYWxpZGF0aW9u</PHRASE>
<PHRASE Label="la_tab_Mail_List" Module="In-Portal" Type="1">TWFpbCBMaXN0</PHRASE>
<PHRASE Label="la_tab_Message" Module="In-Portal" Type="1">TWVzc2FnZQ==</PHRASE>
<PHRASE Label="la_tab_MissingLabels" Module="In-Portal" Type="1">TWlzc2luZyBMYWJlbHM=</PHRASE>
<PHRASE Label="la_tab_modules" Module="In-Portal" Type="1">TW9kdWxlcw==</PHRASE>
<PHRASE Label="la_tab_ModulesManagement" Module="In-Portal" Type="1">TW9kdWxlcyBNYW5hZ2VtZW50</PHRASE>
<PHRASE Label="la_tab_ModulesSettings" Module="In-Portal" Type="1">TW9kdWxlcyAmIFNldHRpbmdz</PHRASE>
<PHRASE Label="la_tab_Overview" Module="In-Portal" Type="1">T3ZlcnZpZXc=</PHRASE>
<PHRASE Label="la_tab_PackageContent" Module="In-Portal" Type="1">UGFja2FnZSBDb250ZW50</PHRASE>
<PHRASE Label="la_tab_Permissions" Module="In-Portal" Type="1">UGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_tab_phpbbimport" Module="In-Portal" Type="1">cGhwQkIgSW1wb3J0</PHRASE>
<PHRASE Label="la_tab_Properties" Module="In-Portal" Type="1">UHJvcGVydGllcw==</PHRASE>
<PHRASE Label="la_tab_QueryDB" Module="In-Portal" Type="1">UXVlcnkgRGF0YWJhc2U=</PHRASE>
<PHRASE Label="la_tab_Regional" Module="In-Portal" Type="1">UmVnaW9uYWw=</PHRASE>
<PHRASE Label="la_tab_Relations" Module="In-Portal" Type="1">UmVsYXRpb25z</PHRASE>
<PHRASE Label="la_tab_Reports" Module="In-Portal" Type="1">U3VtbWFyeSAmIExvZ3M=</PHRASE>
<PHRASE Label="la_tab_Restore" Module="In-Portal" Type="1">UmVzdG9yZQ==</PHRASE>
<PHRASE Label="la_tab_Review" Module="In-Portal" Type="1">UmV2aWV3</PHRASE>
<PHRASE Label="la_tab_Reviews" Module="In-Portal" Type="1">UmV2aWV3cw==</PHRASE>
<PHRASE Label="la_tab_Rule" Module="In-Portal" Type="2">UnVsZSBQcm9wZXJ0aWVz</PHRASE>
<PHRASE Label="la_Tab_Search" Module="In-Portal" Type="1">U2VhcmNo</PHRASE>
<PHRASE Label="la_tab_SearchLog" Module="In-Portal" Type="1">U2VhcmNoIExvZw==</PHRASE>
<PHRASE Label="la_tab_Search_Groups" Module="In-Portal" Type="1">U2VhcmNoIEdyb3Vwcw==</PHRASE>
<PHRASE Label="la_tab_Search_Users" Module="In-Portal" Type="1">U2VhcmNoIFVzZXJz</PHRASE>
<PHRASE Label="la_tab_SendMail" Module="In-Portal" Type="1">U2VuZCBlLW1haWw=</PHRASE>
<PHRASE Label="la_tab_ServerInfo" Module="In-Portal" Type="1">U2VydmVyIEluZm9ybWF0aW9u</PHRASE>
<PHRASE Label="la_tab_SessionLog" Module="In-Portal" Type="1">U2Vzc2lvbiBMb2c=</PHRASE>
<PHRASE Label="la_tab_Settings" Module="In-Portal" Type="1">R2VuZXJhbCBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_tab_Site_Structure" Module="In-Portal" Type="1">U3RydWN0dXJlICYgRGF0YQ==</PHRASE>
<PHRASE Label="la_tab_Stats" Module="In-Portal" Type="1">U3RhdGlzdGljcw==</PHRASE>
<PHRASE Label="la_tab_Stylesheets" Module="In-Portal" Type="1">U3R5bGVzaGVldHM=</PHRASE>
<PHRASE Label="la_tab_Summary" Module="In-Portal" Type="1">U3VtbWFyeQ==</PHRASE>
<PHRASE Label="la_tab_Sys_Config" Module="In-Portal" Type="1">Q29uZmlndXJhdGlvbg==</PHRASE>
<PHRASE Label="la_tab_taglibrary" Module="In-Portal" Type="1">VGFnIGxpYnJhcnk=</PHRASE>
<PHRASE Label="la_tab_Template" Module="In-Portal" Type="1">VGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_tab_Templates" Module="In-Portal" Type="1">VGVtcGxhdGVz</PHRASE>
<PHRASE Label="la_tab_Themes" Module="In-Portal" Type="1">VGhlbWVz</PHRASE>
<PHRASE Label="la_tab_Tools" Module="In-Portal" Type="1">VG9vbHM=</PHRASE>
<PHRASE Label="la_tab_upgrade_license" Module="In-Portal" Type="1">VXBkYXRlIExpY2Vuc2U=</PHRASE>
<PHRASE Label="la_tab_userban" Module="In-Portal" Type="1">QmFuIHVzZXI=</PHRASE>
<PHRASE Label="la_tab_UserBanList" Module="In-Portal" Type="1">VXNlciBCYW4gTGlzdA==</PHRASE>
<PHRASE Label="la_tab_Users" Module="In-Portal" Type="1">VXNlcnM=</PHRASE>
<PHRASE Label="la_tab_UserSelect" Module="In-Portal" Type="1">VXNlciBTZWxlY3Q=</PHRASE>
<PHRASE Label="la_tab_User_Groups" Module="In-Portal" Type="1">R3JvdXBz</PHRASE>
<PHRASE Label="la_tab_User_List" Module="In-Portal" Type="1">VXNlcnM=</PHRASE>
<PHRASE Label="la_tab_Visits" Module="In-Portal" Type="1">VmlzaXRz</PHRASE>
<PHRASE Label="la_taglib_link" Module="In-Portal" Type="1">VGFnIExpYnJhcnk=</PHRASE>
<PHRASE Label="la_tag_library" Module="In-Portal" Type="1">VGFnIExpYnJhcnk=</PHRASE>
<PHRASE Label="la_terabytes" Module="In-Portal" Type="1">dGVyYWJ5dGUocyk=</PHRASE>
<PHRASE Label="la_Text" Module="In-Portal" Type="1">dGV4dA==</PHRASE>
<PHRASE Label="la_Text_Access_Denied" Module="In-Portal" Type="1">SW52YWxpZCB1c2VyIG5hbWUgb3IgcGFzc3dvcmQ=</PHRASE>
<PHRASE Label="la_Text_Active" Module="In-Portal" Type="1">QWN0aXZl</PHRASE>
<PHRASE Label="la_Text_Adding" Module="In-Portal" Type="1">QWRkaW5n</PHRASE>
<PHRASE Label="la_Text_Address" Module="In-Portal" Type="1">QWRkcmVzcw==</PHRASE>
<PHRASE Label="la_text_address_denied" Module="In-Portal" Type="1">TG9naW4gbm90IGFsbG93ZWQgZnJvbSB0aGlzIGFkZHJlc3M=</PHRASE>
<PHRASE Label="la_Text_Admin" Module="In-Portal" Type="1">QWRtaW4=</PHRASE>
<PHRASE Label="la_Text_AdminEmail" Module="In-Portal" Type="1">QWRtaW5pc3RyYXRvciBSZWNlaXZlIE5vdGljZXMgV2hlbg==</PHRASE>
<PHRASE Label="la_text_advanced" Module="In-Portal" Type="1">QWR2YW5jZWQ=</PHRASE>
<PHRASE Label="la_Text_All" Module="In-Portal" Type="1">QWxs</PHRASE>
<PHRASE Label="la_Text_Allow" Module="In-Portal" Type="1">QWxsb3c=</PHRASE>
<PHRASE Label="la_Text_Any" Module="In-Portal" Type="1">QW55</PHRASE>
<PHRASE Label="la_Text_Archived" Module="In-Portal" Type="1">QXJjaGl2ZWQ=</PHRASE>
<PHRASE Label="la_Text_Article" Module="In-Portal" Type="1">QXJ0aWNsZQ==</PHRASE>
<PHRASE Label="la_Text_Articles" Module="In-Portal" Type="1">QXJ0aWNsZXM=</PHRASE>
<PHRASE Label="la_text_As" Module="In-Portal" Type="1">YXM=</PHRASE>
<PHRASE Label="la_Text_backing_up" Module="In-Portal" Type="1">QmFja2luZyB1cA==</PHRASE>
<PHRASE Label="la_Text_BackupComplete" Module="In-Portal" Type="1">QmFjayB1cCBoYXMgYmVlbiBjb21wbGV0ZWQuIFRoZSBiYWNrdXAgZmlsZSBpczo=</PHRASE>
<PHRASE Label="la_Text_BackupPath" Module="In-Portal" Type="1">QmFja3VwIFBhdGg=</PHRASE>
<PHRASE Label="la_Text_backup_access" Module="In-Portal" Type="2">SW4tUG9ydGFsIGRvZXMgbm90IGhhdmUgYWNjZXNzIHRvIHdyaXRlIHRvIHRoaXMgZGlyZWN0b3J5</PHRASE>
<PHRASE Label="la_Text_Backup_Info" Module="In-Portal" Type="1">VGhpcyB1dGlsaXR5IGFsbG93cyB5b3UgdG8gYmFja3VwIHlvdXIgY3VycmVudCBkYXRhIGZyb20gSW4tUG9ydGFsIGRhdGFiYXNlLg==</PHRASE>
<PHRASE Label="la_text_Backup_in_progress" Module="In-Portal" Type="1">QmFja3VwIGluIHByb2dyZXNz</PHRASE>
<PHRASE Label="la_Text_Ban" Module="In-Portal" Type="1">QmFu</PHRASE>
<PHRASE Label="la_Text_BanRules" Module="In-Portal" Type="2">VXNlciBCYW4gUnVsZXM=</PHRASE>
<PHRASE Label="la_Text_BanUserFields" Module="In-Portal" Type="1">QmFuIFVzZXIgSW5mb3JtYXRpb24=</PHRASE>
<PHRASE Label="la_Text_Blank_Field" Module="In-Portal" Type="1">QmxhbmsgdXNlcm5hbWUgb3IgcGFzc3dvcmQ=</PHRASE>
<PHRASE Label="la_Text_Both" Module="In-Portal" Type="1">Qm90aA==</PHRASE>
<PHRASE Label="la_Text_BuiltIn" Module="In-Portal" Type="1">QnVpbHQgSW4=</PHRASE>
<PHRASE Label="la_text_Bytes" Module="In-Portal" Type="1">Ynl0ZXM=</PHRASE>
<PHRASE Label="la_Text_Catalog" Module="In-Portal" Type="1">Q2F0YWxvZw==</PHRASE>
<PHRASE Label="la_Text_Categories" Module="In-Portal" Type="1">Q2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_Text_Category" Module="In-Portal" Type="1">Q2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_Text_Censorship" Module="In-Portal" Type="1">Q2Vuc29yc2hpcA==</PHRASE>
<PHRASE Label="la_Text_City" Module="In-Portal" Type="1">Q2l0eQ==</PHRASE>
<PHRASE Label="la_text_ClearClipboardWarning" Module="In-Portal" Type="1">WW91IGFyZSBhYm91dCB0byBjbGVhciBjbGlwYm9hcmQgY29udGVudCENClByZXNzIE9LIHRvIGNvbnRpbnVlIG9yIENhbmNlbCB0byByZXR1cm4gdG8gcHJldmlvdXMgc2NyZWVuLg==</PHRASE>
<PHRASE Label="la_Text_ComingSoon" Module="In-Portal" Type="1">U2VjdGlvbiBDb21pbmcgU29vbg==</PHRASE>
<PHRASE Label="la_Text_Complete" Module="In-Portal" Type="1">Q29tcGxldGU=</PHRASE>
<PHRASE Label="la_Text_Configuration" Module="In-Portal" Type="1">Q29uZmlndXJhdGlvbg==</PHRASE>
<PHRASE Label="la_text_Contains" Module="In-Portal" Type="1">Q29udGFpbnM=</PHRASE>
<PHRASE Label="la_Text_Counters" Module="In-Portal" Type="1">Q291bnRlcnM=</PHRASE>
<PHRASE Label="la_Text_Current" Module="In-Portal" Type="1">Q3VycmVudA==</PHRASE>
<PHRASE Label="la_text_custom" Module="In-Portal" Type="1">Q3VzdG9t</PHRASE>
<PHRASE Label="la_Text_CustomField" Module="In-Portal" Type="1">Q3VzdG9tIEZpZWxk</PHRASE>
<PHRASE Label="la_Text_CustomFields" Module="In-Portal" Type="1">Q3VzdG9tIEZpZWxkcw==</PHRASE>
<PHRASE Label="la_Text_DatabaseSettings" Module="In-Portal" Type="1">RGF0YWJhc2UgU2V0dGluZ3MgLSBJbnRlY2huaWMgSW4tTGluayAyLng=</PHRASE>
<PHRASE Label="la_Text_DataType_1" Module="In-Portal" Type="1">Y2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_Text_DataType_2" Module="In-Portal" Type="1">RGF0YSBUeXBlIDI=</PHRASE>
<PHRASE Label="la_Text_DataType_3" Module="In-Portal" Type="1">cG9zdA==</PHRASE>
<PHRASE Label="la_Text_DataType_4" Module="In-Portal" Type="1">bGlua3M=</PHRASE>
<PHRASE Label="la_Text_DataType_6" Module="In-Portal" Type="1">dXNlcnM=</PHRASE>
<PHRASE Label="la_Text_Date_Time_Settings" Module="In-Portal" Type="1">RGF0ZS9UaW1lIFNldHRpbmdz</PHRASE>
<PHRASE Label="la_Text_Day" Module="In-Portal" Type="1">RGF5</PHRASE>
<PHRASE Label="la_text_db_warning" Module="In-Portal" Type="1">UnVubmluZyB0aGlzIHV0aWxpdHkgd2lsbCBhZmZlY3QgeW91ciBkYXRhYmFzZS4gIFBsZWFzZSBiZSBhZHZpc2VkIHRoYXQgeW91IGNhbiB1c2UgdGhpcyB1dGlsaXR5IGF0IHlvdXIgb3duIHJpc2suICBJbnRlY2huaWMgQ29ycG9yYXRpb24gY2FuIG5vdCBiZSBoZWxkIGxpYWJsZSBmb3IgYW55IGNvcnJ1cHQgZGF0YSBvciBkYXRhIGxvc3Mu</PHRASE>
<PHRASE Label="la_Text_Default" Module="In-Portal" Type="1">RGVmYXVsdA==</PHRASE>
<PHRASE Label="la_Text_Delete" Module="In-Portal" Type="1">RGVsZXRl</PHRASE>
<PHRASE Label="la_text_denied" Module="In-Portal" Type="1">RGVuaWVk</PHRASE>
<PHRASE Label="la_Text_Deny" Module="In-Portal" Type="1">RGVueQ==</PHRASE>
<PHRASE Label="la_Text_Disable" Module="In-Portal" Type="1">RGlzYWJsZQ==</PHRASE>
<PHRASE Label="la_Text_Disabled" Module="In-Portal" Type="1">RGlzYWJsZWQ=</PHRASE>
<PHRASE Label="la_text_disclaimer_part1" Module="In-Portal" Type="1">UnVubmluZyB0aGlzIHV0aWxpdHkgd2lsbCBhZmZlY3QgeW91ciBkYXRhYmFzZS4gUGxlYXNlIGJlIGFkdmlzZWQgdGhhdCB5b3UgY2FuIHVzZSB0aGlzIHV0aWxpdHkgYXQgeW91ciBvd24gcmlzay4gSW50ZWNobmljIENvcnBvcmF0aW9uIGNhbiBub3QgYmUgaGVsZCBsaWFibGUgZm9yIGFueSBjb3JydXB0IGRhdGEgb3IgZGF0YSBsb3NzLg==</PHRASE>
<PHRASE Label="la_text_disclaimer_part2" Module="In-Portal" Type="1">UGxlYXNlIG1ha2Ugc3VyZSB0byBiYWNrIHVwIHlvdXIgZGF0YWJhc2UocykgYmVmb3JlIHJ1bm5pbmcgdGhpcyB1dGlsaXR5Lg==</PHRASE>
<PHRASE Label="la_Text_Edit" Module="In-Portal" Type="1">RWRpdA==</PHRASE>
<PHRASE Label="la_Text_Editing" Module="In-Portal" Type="1">RWRpdGluZw==</PHRASE>
<PHRASE Label="la_Text_Editor" Module="In-Portal" Type="1">RWRpdG9y</PHRASE>
<PHRASE Label="la_Text_Email" Module="In-Portal" Type="1">RW1haWw=</PHRASE>
<PHRASE Label="la_Text_Emoticons" Module="In-Portal" Type="1">RW1vdGlvbiBJY29ucw==</PHRASE>
<PHRASE Label="la_Text_Enable" Module="In-Portal" Type="1">RW5hYmxl</PHRASE>
<PHRASE Label="la_Text_Enabled" Module="In-Portal" Type="1">RW5hYmxlZA==</PHRASE>
<PHRASE Label="la_Text_Events" Module="In-Portal" Type="1">RXZlbnRz</PHRASE>
<PHRASE Label="la_Text_example" Module="In-Portal" Type="2">RXhhbXBsZQ==</PHRASE>
<PHRASE Label="la_Text_Exists" Module="In-Portal" Type="1">RXhpc3Rz</PHRASE>
<PHRASE Label="la_Text_Expired" Module="In-Portal" Type="1">RXhwaXJlZA==</PHRASE>
<PHRASE Label="la_Text_Export" Module="In-Portal" Type="2">RXhwb3J0</PHRASE>
<PHRASE Label="la_Text_Fields" Module="In-Portal" Type="1">RmllbGRz</PHRASE>
<PHRASE Label="la_Text_Filter" Module="In-Portal" Type="1">RmlsdGVy</PHRASE>
<PHRASE Label="la_Text_FirstName" Module="In-Portal" Type="1">Rmlyc3QgTmFtZQ==</PHRASE>
<PHRASE Label="la_text_for" Module="In-Portal" Type="1">Zm9y</PHRASE>
<PHRASE Label="la_Text_Front" Module="In-Portal" Type="1">RnJvbnQ=</PHRASE>
<PHRASE Label="la_Text_FrontEnd" Module="In-Portal" Type="1">RnJvbnQgRW5k</PHRASE>
<PHRASE Label="la_Text_FrontOnly" Module="In-Portal" Type="1">RnJvbnQtZW5kIE9ubHk=</PHRASE>
<PHRASE Label="la_Text_Full" Module="In-Portal" Type="1">RnVsbA==</PHRASE>
<PHRASE Label="la_Text_Full_Size_Image" Module="In-Portal" Type="1">RnVsbCBTaXplIEltYWdl</PHRASE>
<PHRASE Label="la_Text_General" Module="In-Portal" Type="1">R2VuZXJhbA==</PHRASE>
<PHRASE Label="la_Text_GreaterThan" Module="In-Portal" Type="1">R3JlYXRlciBUaGFu</PHRASE>
<PHRASE Label="la_Text_Group" Module="In-Portal" Type="1">R3JvdXA=</PHRASE>
<PHRASE Label="la_Text_Groups" Module="In-Portal" Type="1">R3JvdXBz</PHRASE>
<PHRASE Label="la_Text_Group_Name" Module="In-Portal" Type="1">R3JvdXAgTmFtZQ==</PHRASE>
<PHRASE Label="la_Text_Guest" Module="In-Portal" Type="1">R3Vlc3Q=</PHRASE>
<PHRASE Label="la_Text_GuestUsers" Module="In-Portal" Type="1">R3Vlc3QgVXNlcnM=</PHRASE>
<PHRASE Label="la_Text_Hot" Module="In-Portal" Type="1">SG90</PHRASE>
<PHRASE Label="la_Text_Hour" Module="In-Portal" Type="1">SG91cg==</PHRASE>
<PHRASE Label="la_Text_IAgree" Module="In-Portal" Type="1">SSBhZ3JlZSB0byB0aGUgdGVybXMgYW5kIGNvbmRpdGlvbnM=</PHRASE>
<PHRASE Label="la_Text_Image" Module="In-Portal" Type="1">SW1hZ2U=</PHRASE>
<PHRASE Label="la_Text_Images" Module="In-Portal" Type="1">SW1hZ2Vz</PHRASE>
<PHRASE Label="la_Text_Inactive" Module="In-Portal" Type="1">SW5hY3RpdmU=</PHRASE>
<PHRASE Label="la_Text_InDevelopment" Module="In-Portal" Type="1">SW4gRGV2ZWxvcG1lbnQ=</PHRASE>
<PHRASE Label="la_Text_Install" Module="In-Portal" Type="1">SW5zdGFsbA==</PHRASE>
<PHRASE Label="la_Text_Installed" Module="In-Portal" Type="1">SW5zdGFsbGVk</PHRASE>
<PHRASE Label="la_Text_Invalid" Module="In-Portal" Type="2">SW52YWxpZA==</PHRASE>
<PHRASE Label="la_Text_Invert" Module="In-Portal" Type="1">SW52ZXJ0</PHRASE>
<PHRASE Label="la_Text_IPAddress" Module="In-Portal" Type="1">SVAgQWRkcmVzcw==</PHRASE>
<PHRASE Label="la_Text_Is" Module="In-Portal" Type="1">SXM=</PHRASE>
<PHRASE Label="la_Text_IsNot" Module="In-Portal" Type="1">SXMgTm90</PHRASE>
<PHRASE Label="la_Text_Items" Module="In-Portal" Type="1">SXRlbXM=</PHRASE>
<PHRASE Label="la_text_keyword" Module="In-Portal" Type="1">S2V5d29yZA==</PHRASE>
<PHRASE Label="la_Text_Label" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_Text_LangImport" Module="In-Portal" Type="1">TGFuZ3VhZ2UgSW1wb3J0</PHRASE>
<PHRASE Label="la_Text_Languages" Module="In-Portal" Type="2">TGFuZ3VhZ2U=</PHRASE>
<PHRASE Label="la_Text_LastName" Module="In-Portal" Type="1">TGFzdCBOYW1l</PHRASE>
<PHRASE Label="la_text_leading" Module="In-Portal" Type="1">TGVhZGluZw==</PHRASE>
<PHRASE Label="la_Text_LessThan" Module="In-Portal" Type="1">TGVzcyBUaGFu</PHRASE>
<PHRASE Label="la_Text_Licence" Module="In-Portal" Type="1">TGljZW5zZQ==</PHRASE>
<PHRASE Label="la_Text_Link" Module="In-Portal" Type="1">TGluaw==</PHRASE>
<PHRASE Label="la_Text_Links" Module="In-Portal" Type="1">TGlua3M=</PHRASE>
<PHRASE Label="la_Text_Link_Validation" Module="In-Portal" Type="2">VmFsaWRhdGluZyBMaW5rcw==</PHRASE>
<PHRASE Label="la_Text_Local" Module="In-Portal" Type="1">TG9jYWw=</PHRASE>
<PHRASE Label="la_Text_Locked" Module="In-Portal" Type="1">TG9ja2Vk</PHRASE>
<PHRASE Label="la_Text_Login" Module="In-Portal" Type="1">VXNlcm5hbWU=</PHRASE>
<PHRASE Label="la_Text_MailEvent" Module="In-Portal" Type="1">RW1haWwgRXZlbnQ=</PHRASE>
<PHRASE Label="la_Text_MetaInfo" Module="In-Portal" Type="1">RGVmYXVsdCBNRVRBIGtleXdvcmRz</PHRASE>
<PHRASE Label="la_text_minkeywordlength" Module="In-Portal" Type="1">TWluaW11bSBrZXl3b3JkIGxlbmd0aA==</PHRASE>
<PHRASE Label="la_Text_Minute" Module="In-Portal" Type="1">TWludXRl</PHRASE>
<PHRASE Label="la_text_min_password" Module="In-Portal" Type="1">TWluaW11bSBwYXNzd29yZCBsZW5ndGg=</PHRASE>
<PHRASE Label="la_text_min_username" Module="In-Portal" Type="1">TWluaW11bSB1c2VyIG5hbWUgbGVuZ3Ro</PHRASE>
<PHRASE Label="la_Text_Missing_Password" Module="In-Portal" Type="1">QmxhbmsgcGFzc3dvcmRzIGFyZSBub3QgYWxsb3dlZA==</PHRASE>
<PHRASE Label="la_Text_Missing_Username" Module="In-Portal" Type="1">QmxhbmsgdXNlciBuYW1l</PHRASE>
<PHRASE Label="la_Text_Modules" Module="In-Portal" Type="1">TW9kdWxlcw==</PHRASE>
<PHRASE Label="la_Text_Month" Module="In-Portal" Type="1">TW9udGhz</PHRASE>
<PHRASE Label="la_text_multipleshow" Module="In-Portal" Type="1">U2hvdyBtdWx0aXBsZQ==</PHRASE>
<PHRASE Label="la_Text_New" Module="In-Portal" Type="1">TmV3</PHRASE>
<PHRASE Label="la_Text_NewCensorWord" Module="In-Portal" Type="1">TmV3IENlbnNvciBXb3Jk</PHRASE>
<PHRASE Label="la_Text_NewField" Module="In-Portal" Type="1">TmV3IEZpZWxk</PHRASE>
<PHRASE Label="la_Text_NewTheme" Module="In-Portal" Type="1">TmV3IFRoZW1l</PHRASE>
<PHRASE Label="la_text_NoCategories" Module="In-Portal" Type="1">Tm8gQ2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_Text_None" Module="In-Portal" Type="1">Tm9uZQ==</PHRASE>
<PHRASE Label="la_text_nopermissions" Module="In-Portal" Type="1">Tm8gcGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_Text_NotContains" Module="In-Portal" Type="1">RG9lcyBOb3QgQ29udGFpbg==</PHRASE>
<PHRASE Label="la_Text_Not_Validated" Module="In-Portal" Type="2">Tm90IFZhbGlkYXRlZA==</PHRASE>
<PHRASE Label="la_Text_No_permissions" Module="In-Portal" Type="1">Tm8gcGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_Text_OneWay" Module="In-Portal" Type="1">T25lIFdheQ==</PHRASE>
<PHRASE Label="la_Text_Pack" Module="In-Portal" Type="1">UGFjaw==</PHRASE>
<PHRASE Label="la_Text_Pending" Module="In-Portal" Type="1">UGVuZGluZw==</PHRASE>
<PHRASE Label="la_text_Permission" Module="In-Portal" Type="1">UGVybWlzc2lvbg==</PHRASE>
<PHRASE Label="la_Text_Phone" Module="In-Portal" Type="1">UGhvbmU=</PHRASE>
<PHRASE Label="la_Text_Pop" Module="In-Portal" Type="1">UG9wdWxhcg==</PHRASE>
<PHRASE Label="la_text_popularity" Module="In-Portal" Type="1">UG9wdWxhcml0eQ==</PHRASE>
<PHRASE Label="la_Text_PostBody" Module="In-Portal" Type="1">UG9zdCBCb2R5</PHRASE>
<PHRASE Label="la_Text_Posts" Module="In-Portal" Type="1">UG9zdHM=</PHRASE>
<PHRASE Label="la_text_prerequisit_not_passed" Module="In-Portal" Type="1">UHJlcmVxdWlzaXRlIG5vdCBmdWxmaWxsZWQsIGluc3RhbGxhdGlvbiBjYW5ub3QgY29udGludWUh</PHRASE>
<PHRASE Label="la_Text_Primary" Module="In-Portal" Type="1">UHJpbWFyeQ==</PHRASE>
<PHRASE Label="la_text_quicklinks" Module="In-Portal" Type="1">UXVpY2sgbGlua3M=</PHRASE>
<PHRASE Label="la_text_ReadOnly" Module="In-Portal" Type="1">UmVhZCBPbmx5</PHRASE>
<PHRASE Label="la_text_ready_to_install" Module="In-Portal" Type="1">UmVhZHkgdG8gSW5zdGFsbA==</PHRASE>
<PHRASE Label="la_Text_Reciprocal" Module="In-Portal" Type="1">UmVjaXByb2NhbA==</PHRASE>
<PHRASE Label="la_Text_Relation" Module="In-Portal" Type="1">UmVsYXRpb24=</PHRASE>
<PHRASE Label="la_Text_Relations" Module="In-Portal" Type="1">UmVsYXRpb25z</PHRASE>
<PHRASE Label="la_Text_Replies" Module="In-Portal" Type="1">UmVwbGllcw==</PHRASE>
<PHRASE Label="la_text_restore warning" Module="In-Portal" Type="1">VGhlIHZlcnNpb25zIG9mIHRoZSBiYWNrdXAgYW5kIHlvdXIgY29kZSBkb24ndCBtYXRjaC4gWW91ciBpbnN0YWxsYXRpb24gd2lsbCBwcm9iYWJseSBiZSBub24gb3BlcmF0aW9uYWwu</PHRASE>
<PHRASE Label="la_Text_Restore_Heading" Module="In-Portal" Type="1">SGVyZSB5b3UgY2FuIHJlc3RvcmUgeW91ciBkYXRhYmFzZSBmcm9tIGEgcHJldmlvdXNseSBiYWNrZWQgdXAgc25hcHNob3QuIFJlc3RvcmluZyB5b3VyIGRhdGFiYXNlIHdpbGwgZGVsZXRlIGFsbCBvZiB5b3VyIGN1cnJlbnQgZGF0YSBhbmQgbG9nIHlvdSBvdXQgb2YgdGhlIHN5c3RlbS4=</PHRASE>
<PHRASE Label="la_text_Restore_in_progress" Module="In-Portal" Type="1">UmVzdG9yZSBpcyBpbiBwcm9ncmVzcw==</PHRASE>
<PHRASE Label="la_Text_Restore_Warning" Module="In-Portal" Type="1">IFJ1bm5pbmcgdGhpcyB1dGlsaXR5IHdpbGwgYWZmZWN0IHlvdXIgZGF0YWJhc2UuICBQbGVhc2UgYmUgYWR2aXNlZCB0aGF0IHlvdSBjYW4gdXNlIHRoaXMgdXRpbGl0eSBhdCB5b3VyIG93biByaXNrLiAgSW50ZWNobmljIGNvcnBvcmF0aW9uIGNhbiBub3QgYmUgaGVsZCBsaWFibGUgZm9yIGFueSBjb3JydXB0IGRhdGEgb3IgZGF0YSBsb3NzLiAgUGxlYXNlIG1ha2Ugc3VyZSB0byBiYWNrIHVwIHlvdXIgZGF0YWJhc2UocykgYmVmb3JlIHJ1bm5p</PHRASE>
<PHRASE Label="la_Text_Restrictions" Module="In-Portal" Type="1">UmVzdHJpY3Rpb25z</PHRASE>
<PHRASE Label="la_Text_Results" Module="In-Portal" Type="2">UmVzdWx0cw==</PHRASE>
<PHRASE Label="la_text_review" Module="In-Portal" Type="1">UmV2aWV3</PHRASE>
<PHRASE Label="la_Text_Reviews" Module="In-Portal" Type="1">UmV2aWV3cw==</PHRASE>
<PHRASE Label="la_Text_Root" Module="In-Portal" Type="1">Um9vdA==</PHRASE>
<PHRASE Label="la_Text_RootCategory" Module="In-Portal" Type="1">TW9kdWxlIFJvb3QgQ2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_text_Rows" Module="In-Portal" Type="1">cm93KHMp</PHRASE>
<PHRASE Label="la_Text_Rule" Module="In-Portal" Type="2">UnVsZQ==</PHRASE>
<PHRASE Label="la_text_Same" Module="In-Portal" Type="1">U2FtZQ==</PHRASE>
<PHRASE Label="la_text_Same_As_Thumbnail" Module="In-Portal" Type="1">U2FtZSBhcyB0aHVtYm5haWw=</PHRASE>
<PHRASE Label="la_text_Save" Module="In-Portal" Type="1">U2F2ZQ==</PHRASE>
<PHRASE Label="la_Text_Scanning" Module="In-Portal" Type="1">U2Nhbm5pbmc=</PHRASE>
<PHRASE Label="la_Text_Search_Results" Module="In-Portal" Type="1">U2VhcmNoIFJlc3VsdHM=</PHRASE>
<PHRASE Label="la_Text_Second" Module="In-Portal" Type="1">U2Vjb25kcw==</PHRASE>
<PHRASE Label="la_Text_Select" Module="In-Portal" Type="1">U2VsZWN0</PHRASE>
<PHRASE Label="la_Text_Send" Module="In-Portal" Type="1">U2VuZA==</PHRASE>
<PHRASE Label="la_Text_Sessions" Module="In-Portal" Type="1">U2Vzc2lvbnM=</PHRASE>
<PHRASE Label="la_text_sess_expired" Module="In-Portal" Type="0">U2Vzc2lvbiBFeHBpcmVk</PHRASE>
<PHRASE Label="la_Text_Settings" Module="In-Portal" Type="1">U2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_Text_ShowingGroups" Module="In-Portal" Type="1">U2hvd2luZyBHcm91cHM=</PHRASE>
<PHRASE Label="la_Text_ShowingUsers" Module="In-Portal" Type="1">U2hvd2luZyBVc2Vycw==</PHRASE>
<PHRASE Label="la_Text_Simple" Module="In-Portal" Type="1">U2ltcGxl</PHRASE>
<PHRASE Label="la_Text_Size" Module="In-Portal" Type="1">U2l6ZQ==</PHRASE>
<PHRASE Label="la_Text_Smiley" Module="In-Portal" Type="1">U21pbGV5</PHRASE>
<PHRASE Label="la_Text_smtp_server" Module="In-Portal" Type="1">U01UUCAobWFpbCkgU2VydmVy</PHRASE>
<PHRASE Label="la_Text_Sort" Module="In-Portal" Type="1">U29ydA==</PHRASE>
<PHRASE Label="la_Text_State" Module="In-Portal" Type="1">U3RhdGU=</PHRASE>
<PHRASE Label="la_Text_Step" Module="In-Portal" Type="1">U3RlcA==</PHRASE>
<PHRASE Label="la_Text_SubCats" Module="In-Portal" Type="1">U3ViQ2F0cw==</PHRASE>
<PHRASE Label="la_Text_Subitems" Module="In-Portal" Type="1">U3ViSXRlbXM=</PHRASE>
<PHRASE Label="la_Text_Table" Module="In-Portal" Type="1">VGFibGU=</PHRASE>
<PHRASE Label="la_Text_Template" Module="In-Portal" Type="1">VGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_Text_Templates" Module="In-Portal" Type="1">VGVtcGxhdGVz</PHRASE>
<PHRASE Label="la_Text_Theme" Module="In-Portal" Type="1">VGhlbWU=</PHRASE>
<PHRASE Label="la_text_Thumbnail" Module="In-Portal" Type="1">VGh1bWJuYWls</PHRASE>
<PHRASE Label="la_text_Thumbnail_Image" Module="In-Portal" Type="1">VGh1bWJuYWlsIEltYWdl</PHRASE>
<PHRASE Label="la_Text_to" Module="In-Portal" Type="1">dG8=</PHRASE>
<PHRASE Label="la_Text_Topic" Module="In-Portal" Type="1">VG9waWM=</PHRASE>
<PHRASE Label="la_Text_Topics" Module="In-Portal" Type="1">VG9waWNz</PHRASE>
<PHRASE Label="la_Text_Type" Module="In-Portal" Type="1">VHlwZQ==</PHRASE>
<PHRASE Label="la_text_types" Module="In-Portal" Type="1">dHlwZXM=</PHRASE>
<PHRASE Label="la_Text_Unique" Module="In-Portal" Type="1">SXMgVW5pcXVl</PHRASE>
<PHRASE Label="la_Text_Unselect" Module="In-Portal" Type="1">VW5zZWxlY3Q=</PHRASE>
<PHRASE Label="la_Text_Update_Licence" Module="In-Portal" Type="1">VXBkYXRlIExpY2Vuc2U=</PHRASE>
<PHRASE Label="la_text_upgrade_disclaimer" Module="In-Portal" Type="1">WW91ciBkYXRhIHdpbGwgYmUgbW9kaWZpZWQgZHVyaW5nIHRoZSB1cGdyYWRlLiBXZSBzdHJvbmdseSByZWNvbW1lbmQgdGhhdCB5b3UgbWFrZSBhIGJhY2t1cCBvZiB5b3VyIGRhdGFiYXNlLiBQcm9jZWVkIHdpdGggdGhlIHVwZ3JhZGU/</PHRASE>
<PHRASE Label="la_Text_Upload" Module="In-Portal" Type="1">VXBsb2Fk</PHRASE>
<PHRASE Label="la_Text_User" Module="In-Portal" Type="1">VXNlcg==</PHRASE>
<PHRASE Label="la_Text_UserEmail" Module="In-Portal" Type="1">VXNlciBSZWNlaXZlcyBOb3RpY2VzIFdoZW4=</PHRASE>
<PHRASE Label="la_Text_Users" Module="In-Portal" Type="1">VXNlcnM=</PHRASE>
<PHRASE Label="la_Text_User_Count" Module="In-Portal" Type="1">VXNlciBDb3VudA==</PHRASE>
<PHRASE Label="la_Text_Valid" Module="In-Portal" Type="1">VmFsaWQ=</PHRASE>
<PHRASE Label="la_Text_Version" Module="In-Portal" Type="1">VmVyc2lvbg==</PHRASE>
<PHRASE Label="la_Text_View" Module="In-Portal" Type="1">Vmlldw==</PHRASE>
<PHRASE Label="la_Text_Views" Module="In-Portal" Type="1">Vmlld3M=</PHRASE>
<PHRASE Label="la_Text_Website" Module="In-Portal" Type="1">V2Vic2l0ZQ==</PHRASE>
<PHRASE Label="la_Text_Week" Module="In-Portal" Type="1">V2Vla3M=</PHRASE>
<PHRASE Label="la_Text_Within" Module="In-Portal" Type="1">V2l0aGlu</PHRASE>
<PHRASE Label="la_Text_Year" Module="In-Portal" Type="1">WWVhcnM=</PHRASE>
<PHRASE Label="la_Text_Zip" Module="In-Portal" Type="1">Wmlw</PHRASE>
<PHRASE Label="la_title_addingCustom" Module="In-Portal" Type="1">QWRkaW5nIEN1c3RvbSBGaWVsZA==</PHRASE>
<PHRASE Label="la_title_Adding_BaseStyle" Module="In-Portal" Type="1">QWRkaW5nIEJhc2UgU3R5bGU=</PHRASE>
<PHRASE Label="la_title_Adding_BlockStyle" Module="In-Portal" Type="1">QWRkaW5nIEJsb2NrIFN0eWxl</PHRASE>
<PHRASE Label="la_title_Adding_Category" Module="In-Portal" Type="1">QWRkaW5nIENhdGVnb3J5</PHRASE>
<PHRASE Label="la_title_Adding_Group" Module="In-Portal" Type="1">QWRkaW5nIEdyb3Vw</PHRASE>
<PHRASE Label="la_title_Adding_Image" Module="In-Portal" Type="1">QWRkaW5nIEltYWdl</PHRASE>
<PHRASE Label="la_title_Adding_Language" Module="In-Portal" Type="1">QWRkaW5nIExhbmd1YWdl</PHRASE>
<PHRASE Label="la_title_Adding_Phrase" Module="In-Portal" Type="1">QWRkaW5nIFBocmFzZQ==</PHRASE>
<PHRASE Label="la_title_Adding_Relationship" Module="In-Portal" Type="1">QWRkaW5nIFJlbGF0aW9uc2hpcA==</PHRASE>
<PHRASE Label="la_title_Adding_Review" Module="In-Portal" Type="1">QWRkaW5nIFJldmlldw==</PHRASE>
<PHRASE Label="la_title_Adding_Stylesheet" Module="In-Portal" Type="1">QWRkaW5nIFN0eWxlc2hlZXQ=</PHRASE>
<PHRASE Label="la_title_AdditionalPermissions" Module="In-Portal" Type="1">QWRkaXRpb25hbCBQZXJtaXNzaW9ucw==</PHRASE>
<PHRASE Label="la_title_Add_Module" Module="In-Portal" Type="1">QWRkIE1vZHVsZQ==</PHRASE>
<PHRASE Label="la_title_AdvancedView" Module="In-Portal" Type="1">QWR2YW5jZWQgVmlldw==</PHRASE>
<PHRASE Label="la_title_Backup" Module="In-Portal" Type="1">QmFja3Vw</PHRASE>
<PHRASE Label="la_title_BaseStyles" Module="In-Portal" Type="1">QmFzZSBTdHlsZXM=</PHRASE>
<PHRASE Label="la_title_BlockStyles" Module="In-Portal" Type="1">QmxvY2sgU3R5bGVz</PHRASE>
<PHRASE Label="la_title_Browse" Module="In-Portal" Type="1">Q2F0YWxvZw==</PHRASE>
<PHRASE Label="la_title_Categories" Module="In-Portal" Type="1">Q2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_title_category_relationselect" Module="In-Portal" Type="1">U2VsZWN0IHJlbGF0aW9u</PHRASE>
<PHRASE Label="la_title_category_select" Module="In-Portal" Type="1">U2VsZWN0IGNhdGVnb3J5</PHRASE>
<PHRASE Label="la_title_Censorship" Module="In-Portal" Type="1">Q2Vuc29yc2hpcA==</PHRASE>
+ <PHRASE Label="la_title_ColumnPicker" Module="In-Portal" Type="1">Q29sdW1uIFBpY2tlcg==</PHRASE>
<PHRASE Label="la_title_Community" Module="In-Portal" Type="1">Q29tbXVuaXR5</PHRASE>
<PHRASE Label="la_title_Configuration" Module="In-Portal" Type="1">Q29uZmlndXJhdGlvbg==</PHRASE>
+ <PHRASE Label="la_title_CouponSelector" Module="In-Portal" Type="1">Q291cG9uIFNlbGVjdG9y</PHRASE>
<PHRASE Label="la_title_Custom" Module="In-Portal" Type="1">Q3VzdG9t</PHRASE>
<PHRASE Label="la_title_CustomFields" Module="In-Portal" Type="1">Q3VzdG9tIEZpZWxkcw==</PHRASE>
<PHRASE Label="la_title_Done" Module="In-Portal" Type="1">RG9uZQ==</PHRASE>
<PHRASE Label="la_title_EditingEmailEvent" Module="In-Portal" Type="1">RWRpdGluZyBFbWFpbCBFdmVudA==</PHRASE>
<PHRASE Label="la_title_EditingGroup" Module="In-Portal" Type="1">RWRpdGluZyBHcm91cA==</PHRASE>
<PHRASE Label="la_title_EditingStyle" Module="In-Portal" Type="1">RWRpdGluZyBTdHlsZQ==</PHRASE>
<PHRASE Label="la_title_EditingTranslation" Module="In-Portal" Type="1">RWRpdGluZyBUcmFuc2xhdGlvbg==</PHRASE>
<PHRASE Label="la_title_Editing_BaseStyle" Module="In-Portal" Type="1">RWRpdGluZyBCYXNlIFN0eWxl</PHRASE>
<PHRASE Label="la_title_Editing_BlockStyle" Module="In-Portal" Type="1">RWRpdGluZyBCbG9jayBTdHlsZQ==</PHRASE>
<PHRASE Label="la_title_Editing_Category" Module="In-Portal" Type="1">RWRpdGluZyBDYXRlZ29yeQ==</PHRASE>
<PHRASE Label="la_title_Editing_CustomField" Module="In-Portal" Type="1">RWRpdGluZyBDdXN0b20gRmllbGQ=</PHRASE>
<PHRASE Label="la_title_Editing_Group" Module="In-Portal" Type="1">RWRpdGluZyBHcm91cA==</PHRASE>
<PHRASE Label="la_title_Editing_Image" Module="In-Portal" Type="1">RWRpdGluZyBJbWFnZQ==</PHRASE>
<PHRASE Label="la_title_Editing_Language" Module="In-Portal" Type="1">RWRpdGluZyBMYW5ndWFnZQ==</PHRASE>
<PHRASE Label="la_title_Editing_Phrase" Module="In-Portal" Type="1">RWRpdGluZyBQaHJhc2U=</PHRASE>
<PHRASE Label="la_title_Editing_Relationship" Module="In-Portal" Type="1">RWRpdGluZyBSZWxhdGlvbnNoaXA=</PHRASE>
<PHRASE Label="la_title_Editing_Review" Module="In-Portal" Type="1">RWRpdGluZyBSZXZpZXc=</PHRASE>
<PHRASE Label="la_title_Editing_Stylesheet" Module="In-Portal" Type="1">RWRpdGluZyBTdHlsZXNoZWV0</PHRASE>
<PHRASE Label="la_title_Edit_Article" Module="In-Portal" Type="1">U2l0ZSBTdHJ1Y3R1cmU=</PHRASE>
<PHRASE Label="la_title_edit_category" Module="In-Portal" Type="1">RWRpdCBDYXRlZ29yeQ==</PHRASE>
<PHRASE Label="la_title_Edit_Group" Module="In-Portal" Type="1">RWRpdCBHcm91cA==</PHRASE>
<PHRASE Label="la_title_Edit_Link" Module="In-Portal" Type="1">U2l0ZSBTdHJ1Y3R1cmU=</PHRASE>
<PHRASE Label="la_title_Edit_Topic" Module="In-Portal" Type="1">U2l0ZSBTdHJ1Y3R1cmU=</PHRASE>
<PHRASE Label="la_title_Edit_User" Module="In-Portal" Type="1">RWRpdCBVc2Vy</PHRASE>
<PHRASE Label="la_title_EmailEvents" Module="In-Portal" Type="1">RS1tYWlsIEV2ZW50cw==</PHRASE>
<PHRASE Label="la_title_EmailSettings" Module="In-Portal" Type="1">RS1tYWlsIFNldHRpbmdz</PHRASE>
<PHRASE Label="la_title_ExportData" Module="In-Portal" Type="1">RXhwb3J0IERhdGE=</PHRASE>
<PHRASE Label="la_title_ExportLanguagePack" Module="In-Portal" Type="1">RXhwb3J0IExhbmd1YWdlIFBhY2s=</PHRASE>
<PHRASE Label="la_title_ExportLanguagePackResults" Module="In-Portal" Type="1">RXhwb3J0IExhbmd1YWdlIFBhY2sgLSBSZXN1bHRz</PHRASE>
<PHRASE Label="la_title_ExportLanguagePackStep1" Module="In-Portal" Type="1">RXhwb3J0IExhbmd1YWdlIFBhY2sgLSBTdGVwMQ==</PHRASE>
<PHRASE Label="la_title_General" Module="In-Portal" Type="1">R2VuZXJhbA==</PHRASE>
<PHRASE Label="la_title_General_Configuration" Module="In-Portal" Type="1">R2VuZXJhbCBDb25maWd1cmF0aW9u</PHRASE>
<PHRASE Label="la_title_Groups" Module="In-Portal" Type="1">R3JvdXBz</PHRASE>
<PHRASE Label="la_title_groupselect" Module="In-Portal" Type="1">U2VsZWN0IGdyb3Vw</PHRASE>
<PHRASE Label="la_title_Help" Module="In-Portal" Type="1">SGVscA==</PHRASE>
<PHRASE Label="la_title_Images" Module="In-Portal" Type="1">SW1hZ2Vz</PHRASE>
<PHRASE Label="la_title_ImportData" Module="In-Portal" Type="1">SW1wb3J0IERhdGE=</PHRASE>
<PHRASE Label="la_title_ImportLanguagePack" Module="In-Portal" Type="1">SW1wb3J0IExhbmd1YWdlIFBhY2s=</PHRASE>
<PHRASE Label="la_title_In-Bulletin" Module="In-Portal" Type="1">SW4tYnVsbGV0aW4=</PHRASE>
<PHRASE Label="la_title_In-Link" Module="In-Portal" Type="1">SW4tbGluaw==</PHRASE>
<PHRASE Label="la_title_In-News" Module="In-Portal" Type="1">SW4tbmV3eg==</PHRASE>
<PHRASE Label="la_title_Install" Module="In-Portal" Type="1">SW5zdGFsbGF0aW9uIEhlbHA=</PHRASE>
<PHRASE Label="la_title_InstallLanguagePackStep1" Module="In-Portal" Type="1">SW5zdGFsbCBMYW5ndWFnZSBQYWNrIC0gU3RlcCAx</PHRASE>
<PHRASE Label="la_title_InstallLanguagePackStep2" Module="In-Portal" Type="1">SW5zdGFsbCBMYW5ndWFnZSBQYWNrIC0gU3RlcCAy</PHRASE>
<PHRASE Label="la_title_Items" Module="In-Portal" Type="1">SXRlbXM=</PHRASE>
<PHRASE Label="la_title_label" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_title_Labels" Module="In-Portal" Type="1">TGFiZWxz</PHRASE>
<PHRASE Label="la_Title_LanguageImport" Module="In-Portal" Type="1">SW5zdGFsbCBMYW5ndWFnZSBQYWNr</PHRASE>
<PHRASE Label="la_title_LanguagePacks" Module="In-Portal" Type="1">TGFuZ3VhZ2UgUGFja3M=</PHRASE>
<PHRASE Label="la_title_Loading" Module="In-Portal" Type="1">TG9hZGluZyAuLi4=</PHRASE>
<PHRASE Label="la_title_Module_Status" Module="In-Portal" Type="1">TW9kdWxlIFN0YXR1cw==</PHRASE>
<PHRASE Label="la_title_NewCustomField" Module="In-Portal" Type="1">TmV3IEN1c3RvbSBGaWVsZA==</PHRASE>
<PHRASE Label="la_title_New_BaseStyle" Module="In-Portal" Type="1">TmV3IEJhc2UgU3R5bGU=</PHRASE>
<PHRASE Label="la_title_New_BlockStyle" Module="In-Portal" Type="1">TmV3IEJsb2NrIFN0eWxl</PHRASE>
<PHRASE Label="la_title_New_Category" Module="In-Portal" Type="1">TmV3IENhdGVnb3J5</PHRASE>
<PHRASE Label="la_title_New_Group" Module="In-Portal" Type="1">TmV3IEdyb3Vw</PHRASE>
<PHRASE Label="la_title_New_Image" Module="In-Portal" Type="1">TmV3IEltYWdl</PHRASE>
<PHRASE Label="la_title_New_Language" Module="In-Portal" Type="1">TmV3IExhbmd1YWdl</PHRASE>
<PHRASE Label="la_title_New_Phrase" Module="In-Portal" Type="1">TmV3IFBocmFzZQ==</PHRASE>
<PHRASE Label="la_title_New_Relationship" Module="In-Portal" Type="1">TmV3IFJlbGF0aW9uc2hpcA==</PHRASE>
<PHRASE Label="la_title_New_Review" Module="In-Portal" Type="1">TmV3IFJldmlldw==</PHRASE>
<PHRASE Label="la_title_New_Stylesheet" Module="In-Portal" Type="1">TmV3IFN0eWxlc2hlZXQ=</PHRASE>
<PHRASE Label="la_title_NoPermissions" Module="In-Portal" Type="1">Tm8gUGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_title_Permissions" Module="In-Portal" Type="1">UGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_Title_PleaseWait" Module="In-Portal" Type="1">UGxlYXNlIFdhaXQ=</PHRASE>
<PHRASE Label="la_title_Properties" Module="In-Portal" Type="1">UHJvcGVydGllcw==</PHRASE>
<PHRASE Label="la_title_Regional" Module="In-Portal" Type="1">UmVnaW9uYWw=</PHRASE>
<PHRASE Label="la_title_RegionalSettings" Module="In-Portal" Type="1">UmVnaW9uYWwgU2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_title_Relations" Module="In-Portal" Type="1">UmVsYXRpb25z</PHRASE>
<PHRASE Label="la_title_Reports" Module="In-Portal" Type="1">U3VtbWFyeSAmIExvZ3M=</PHRASE>
<PHRASE Label="la_title_Restore" Module="In-Portal" Type="1">UmVzdG9yZQ==</PHRASE>
<PHRASE Label="la_title_reviews" Module="In-Portal" Type="1">UmV2aWV3cw==</PHRASE>
<PHRASE Label="la_title_SearchLog" Module="In-Portal" Type="1">U2VhcmNoIExvZw==</PHRASE>
<PHRASE Label="la_title_searchresults" Module="In-Portal" Type="1">U2VhcmNoIFJlc3VsdHM=</PHRASE>
<PHRASE Label="la_title_SelectUser" Module="In-Portal" Type="1">U2VsZWN0IFVzZXI=</PHRASE>
<PHRASE Label="la_title_select_item" Module="In-Portal" Type="1">U2VsZWN0IGl0ZW0=</PHRASE>
<PHRASE Label="la_title_select_target_item" Module="In-Portal" Type="1">U2VsZWN0IGl0ZW0=</PHRASE>
<PHRASE Label="la_Title_SendInit" Module="In-Portal" Type="1">UHJlcGFyaW5nIHRvIFNlbmQgTWFpbA==</PHRASE>
<PHRASE Label="la_title_sendmail" Module="In-Portal" Type="1">U2VuZCBlbWFpbA==</PHRASE>
<PHRASE Label="la_title_sendmailcancel" Module="In-Portal" Type="1">Q2FuY2VsIHNlbmRpbmcgbWFpbA==</PHRASE>
<PHRASE Label="la_Title_SendMailComplete" Module="In-Portal" Type="1">TWFpbCBoYXMgYmVlbiBzZW50IFN1Y2Nlc3NmdWxseQ==</PHRASE>
<PHRASE Label="la_Title_SendMailInit" Module="In-Portal" Type="1">UHJlcGFyaW5nIHRvIFNlbmQgTWVzc2FnZXM=</PHRASE>
<PHRASE Label="la_Title_SendMailProgress" Module="In-Portal" Type="1">U2VuZGluZyBNZXNzYWdlLi4=</PHRASE>
<PHRASE Label="la_title_SessionLog" Module="In-Portal" Type="1">U2Vzc2lvbiBMb2c=</PHRASE>
<PHRASE Label="la_title_Settings" Module="In-Portal" Type="1">TW9kdWxlcyAmIFNldHRpbmdz</PHRASE>
<PHRASE Label="la_title_Site_Structure" Module="In-Portal" Type="1">U3RydWN0dXJlICYgRGF0YQ==</PHRASE>
<PHRASE Label="la_title_Stylesheets" Module="In-Portal" Type="1">U3R5bGVzaGVldHM=</PHRASE>
<PHRASE Label="la_title_Summary" Module="In-Portal" Type="1">U3VtbWFyeQ==</PHRASE>
<PHRASE Label="la_title_Sys_Config" Module="In-Portal" Type="1">Q29uZmlndXJhdGlvbg==</PHRASE>
<PHRASE Label="la_title_Tools" Module="In-Portal" Type="1">VG9vbHM=</PHRASE>
<PHRASE Label="la_title_UpdatingCategories" Module="In-Portal" Type="1">VXBkYXRpbmcgQ2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_title_Users" Module="In-Portal" Type="1">VXNlcnM=</PHRASE>
<PHRASE Label="la_title_userselect" Module="In-Portal" Type="1">U2VsZWN0IHVzZXI=</PHRASE>
<PHRASE Label="la_title_Visits" Module="In-Portal" Type="1">VmlzaXRz</PHRASE>
<PHRASE Label="la_to" Module="In-Portal" Type="1">dG8=</PHRASE>
<PHRASE Label="la_ToolTip_AddToGroup" Module="In-Portal" Type="1">QWRkIFVzZXIgdG8gR3JvdXA=</PHRASE>
<PHRASE Label="la_ToolTip_AddUserToGroup" Module="In-Portal" Type="1">QWRkIFVzZXIgVG8gR3JvdXA=</PHRASE>
<PHRASE Label="la_ToolTip_Apply_Rules" Module="In-Portal" Type="1">QXBwbHkgUnVsZXM=</PHRASE>
<PHRASE Label="la_ToolTip_Approve" Module="In-Portal" Type="1">QXBwcm92ZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Back" Module="In-Portal" Type="1">QmFjaw==</PHRASE>
<PHRASE Label="la_ToolTip_Ban" Module="In-Portal" Type="1">QmFu</PHRASE>
<PHRASE Label="la_tooltip_cancel" Module="In-Portal" Type="1">Q2FuY2Vs</PHRASE>
<PHRASE Label="la_ToolTip_ClearClipboard" Module="In-Portal" Type="1">Q2xlYXIgQ2xpcGJvYXJk</PHRASE>
<PHRASE Label="la_ToolTip_Clone" Module="In-Portal" Type="1">Q2xvbmU=</PHRASE>
<PHRASE Label="la_tooltip_close" Module="In-Portal" Type="1">Q2xvc2U=</PHRASE>
<PHRASE Label="la_ToolTip_ContinueValidation" Module="In-Portal" Type="1">Q29udGludWUgTGluayBWYWxpZGF0aW9u</PHRASE>
<PHRASE Label="la_ToolTip_Copy" Module="In-Portal" Type="1">Q29weQ==</PHRASE>
<PHRASE Label="la_ToolTip_Cut" Module="In-Portal" Type="1">Q3V0</PHRASE>
<PHRASE Label="la_ToolTip_Decline" Module="In-Portal" Type="1">RGVjbGluZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Delete" Module="In-Portal" Type="1">RGVsZXRl</PHRASE>
<PHRASE Label="la_ToolTip_DeleteAll" Module="In-Portal" Type="1">RGVsZXRlIEFsbA==</PHRASE>
<PHRASE Label="la_ToolTip_DeleteFromGroup" Module="In-Portal" Type="1">RGVsZXRlIFVzZXIgRnJvbSBHcm91cA==</PHRASE>
<PHRASE Label="la_ToolTip_Deny" Module="In-Portal" Type="1">RGVueQ==</PHRASE>
<PHRASE Label="la_ToolTip_Disable" Module="In-Portal" Type="1">RGlzYWJsZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Edit" Module="In-Portal" Type="1">RWRpdA==</PHRASE>
<PHRASE Label="la_ToolTip_Edit_Current_Category" Module="In-Portal" Type="1">RWRpdCBDdXJyZW50IENhdGVnb3J5</PHRASE>
<PHRASE Label="la_ToolTip_Email_Disable" Module="In-Portal" Type="1">RGlzYWJsZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Email_Enable" Module="In-Portal" Type="1">RW5hYmxl</PHRASE>
<PHRASE Label="la_ToolTip_Email_FrontOnly" Module="In-Portal" Type="1">RnJvbnQgT25seQ==</PHRASE>
<PHRASE Label="la_ToolTip_Email_UserSelect" Module="In-Portal" Type="1">U2VsZWN0IFVzZXI=</PHRASE>
<PHRASE Label="la_ToolTip_Enable" Module="In-Portal" Type="1">RW5hYmxl</PHRASE>
<PHRASE Label="la_ToolTip_Export" Module="In-Portal" Type="0">RXhwb3J0</PHRASE>
<PHRASE Label="la_tooltip_ExportLanguage" Module="In-Portal" Type="1">RXhwb3J0IExhbmd1YWdl</PHRASE>
<PHRASE Label="la_ToolTip_Home" Module="In-Portal" Type="1">SG9tZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Import" Module="In-Portal" Type="1">SW1wb3J0</PHRASE>
<PHRASE Label="la_tooltip_ImportLanguage" Module="In-Portal" Type="1">SW1wb3J0IExhbmd1YWdl</PHRASE>
<PHRASE Label="la_ToolTip_Import_Langpack" Module="In-Portal" Type="1">SW1wb3J0IGEgTGFnbnVhZ2UgUGFja2FnZQ==</PHRASE>
<PHRASE Label="la_tooltip_movedown" Module="In-Portal" Type="0">TW92ZSBEb3du</PHRASE>
<PHRASE Label="la_tooltip_moveup" Module="In-Portal" Type="0">TW92ZSBVcA==</PHRASE>
<PHRASE Label="la_ToolTip_Move_Down" Module="In-Portal" Type="1">TW92ZSBEb3du</PHRASE>
<PHRASE Label="la_ToolTip_Move_Up" Module="In-Portal" Type="1">TW92ZSBVcA==</PHRASE>
<PHRASE Label="la_tooltip_NewBaseStyle" Module="In-Portal" Type="1">TmV3IEJhc2UgU3R5bGU=</PHRASE>
<PHRASE Label="la_tooltip_NewBlockStyle" Module="In-Portal" Type="1">TmV3IEJsb2NrIFN0eWxl</PHRASE>
<PHRASE Label="la_ToolTip_NewGroup" Module="In-Portal" Type="1">TmV3IEdyb3Vw</PHRASE>
<PHRASE Label="la_tooltip_newlabel" Module="In-Portal" Type="1">TmV3IGxhYmVs</PHRASE>
<PHRASE Label="la_tooltip_NewLanguage" Module="In-Portal" Type="1">TmV3IExhbmd1YWdl</PHRASE>
<PHRASE Label="la_tooltip_NewReview" Module="In-Portal" Type="1">TmV3IFJldmlldw==</PHRASE>
<PHRASE Label="la_tooltip_newstylesheet" Module="In-Portal" Type="1">TmV3IFN0eWxlc2hlZXQ=</PHRASE>
<PHRASE Label="la_ToolTip_NewValidation" Module="In-Portal" Type="1">U3RhcnQgTmV3IFZhbGlkYXRpb24=</PHRASE>
<PHRASE Label="la_ToolTip_New_Category" Module="In-Portal" Type="1">TmV3IENhdGVnb3J5</PHRASE>
<PHRASE Label="la_ToolTip_New_CensorWord" Module="In-Portal" Type="1">TmV3IENlbnNvciBXb3Jk</PHRASE>
<PHRASE Label="la_tooltip_New_Coupon" Module="In-Portal" Type="0">TmV3IENvdXBvbg==</PHRASE>
<PHRASE Label="la_ToolTip_New_CustomField" Module="In-Portal" Type="1">TmV3IEN1c3RvbSBGaWVsZA==</PHRASE>
<PHRASE Label="la_tooltip_New_Discount" Module="In-Portal" Type="0">TmV3IERpc2NvdW50</PHRASE>
<PHRASE Label="la_ToolTip_New_Emoticon" Module="In-Portal" Type="1">TmV3IEVtb3Rpb24gSWNvbg==</PHRASE>
<PHRASE Label="la_ToolTip_New_Image" Module="In-Portal" Type="1">TmV3IEltYWdl</PHRASE>
<PHRASE Label="la_tooltip_new_images" Module="In-Portal" Type="1">TmV3IEltYWdlcw==</PHRASE>
<PHRASE Label="la_ToolTip_New_label" Module="In-Portal" Type="1">QWRkIG5ldyBsYWJlbA==</PHRASE>
<PHRASE Label="la_ToolTip_New_LangPack" Module="In-Portal" Type="1">TmV3IExhbmd1YWdlIFBhY2s=</PHRASE>
<PHRASE Label="la_ToolTip_New_Permission" Module="In-Portal" Type="1">TmV3IFBlcm1pc3Npb24=</PHRASE>
<PHRASE Label="la_ToolTip_New_Relation" Module="In-Portal" Type="1">TmV3IFJlbGF0aW9u</PHRASE>
<PHRASE Label="la_ToolTip_New_Review" Module="In-Portal" Type="1">TmV3IFJldmlldw==</PHRASE>
<PHRASE Label="la_ToolTip_New_Rule" Module="In-Portal" Type="1">TmV3IFJ1bGU=</PHRASE>
<PHRASE Label="la_ToolTip_New_Template" Module="In-Portal" Type="1">TmV3IFRlbXBsYXRl</PHRASE>
<PHRASE Label="la_ToolTip_New_Theme" Module="In-Portal" Type="1">TmV3IFRoZW1l</PHRASE>
<PHRASE Label="la_ToolTip_New_User" Module="In-Portal" Type="1">TmV3IFVzZXI=</PHRASE>
<PHRASE Label="la_ToolTip_Next" Module="In-Portal" Type="1">TmV4dA==</PHRASE>
<PHRASE Label="la_tooltip_nextstep" Module="In-Portal" Type="1">TmV4dCBzdGVw</PHRASE>
<PHRASE Label="la_ToolTip_Paste" Module="In-Portal" Type="1">UGFzdGU=</PHRASE>
<PHRASE Label="la_ToolTip_Preview" Module="In-Portal" Type="1">UHJldmlldw==</PHRASE>
<PHRASE Label="la_ToolTip_Previous" Module="In-Portal" Type="1">UHJldmlvdXM=</PHRASE>
<PHRASE Label="la_tooltip_previousstep" Module="In-Portal" Type="1">UHJldmlvdXMgc3RlcA==</PHRASE>
<PHRASE Label="la_ToolTip_Primary" Module="In-Portal" Type="1">U2V0IFByaW1hcnkgVGhlbWU=</PHRASE>
<PHRASE Label="la_ToolTip_PrimaryGroup" Module="In-Portal" Type="1">U2V0IFByaW1hcnkgR3JvdXA=</PHRASE>
<PHRASE Label="la_ToolTip_Print" Module="In-Portal" Type="1">UHJpbnQ=</PHRASE>
<PHRASE Label="la_ToolTip_RebuildCategoryCache" Module="In-Portal" Type="1">UmVidWlsZCBDYXRlZ29yeSBDYWNoZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Refresh" Module="In-Portal" Type="1">UmVmcmVzaA==</PHRASE>
<PHRASE Label="la_ToolTip_RemoveUserFromGroup" Module="In-Portal" Type="1">RGVsZXRlIFVzZXIgRnJvbSBHcm91cA==</PHRASE>
<PHRASE Label="la_ToolTip_RescanThemes" Module="In-Portal" Type="1">UmVzY2FuIFRoZW1lcw==</PHRASE>
<PHRASE Label="la_ToolTip_Reset" Module="In-Portal" Type="1">UmVzZXQ=</PHRASE>
<PHRASE Label="la_ToolTip_ResetToBase" Module="In-Portal" Type="1">UmVzZXQgVG8gQmFzZQ==</PHRASE>
<PHRASE Label="la_ToolTip_ResetValidationStatus" Module="In-Portal" Type="1">UmVzZXQgVmFsaWRhdGlvbiBTdGF0dXM=</PHRASE>
<PHRASE Label="la_ToolTip_Restore" Module="In-Portal" Type="1">UmVzdG9yZQ==</PHRASE>
<PHRASE Label="la_tooltip_save" Module="In-Portal" Type="1">U2F2ZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Search" Module="In-Portal" Type="1">U2VhcmNo</PHRASE>
<PHRASE Label="la_ToolTip_SearchReset" Module="In-Portal" Type="1">UmVzZXQ=</PHRASE>
<PHRASE Label="la_ToolTip_Select" Module="In-Portal" Type="1">U2VsZWN0</PHRASE>
<PHRASE Label="la_tooltip_SelectUser" Module="In-Portal" Type="1">U2VsZWN0IFVzZXI=</PHRASE>
<PHRASE Label="la_ToolTip_SendEmail" Module="In-Portal" Type="1">U2VuZCBFLW1haWw=</PHRASE>
<PHRASE Label="la_ToolTip_SendMail" Module="In-Portal" Type="1">U2VuZCBFLW1haWw=</PHRASE>
<PHRASE Label="la_tooltip_setPrimary" Module="In-Portal" Type="1">U2V0IFByaW1hcnk=</PHRASE>
<PHRASE Label="la_tooltip_setprimarycategory" Module="In-Portal" Type="1">U2V0IFByaW1hcnkgQ2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_ToolTip_SetPrimaryLanguage" Module="In-Portal" Type="1">U2V0IFByaW1hcnkgTGFuZ3VhZ2U=</PHRASE>
<PHRASE Label="la_ToolTip_Stop" Module="In-Portal" Type="1">Q2FuY2Vs</PHRASE>
<PHRASE Label="la_ToolTip_Up" Module="In-Portal" Type="1">VXAgYSBDYXRlZ29yeQ==</PHRASE>
<PHRASE Label="la_ToolTip_ValidateSelected" Module="In-Portal" Type="1">VmFsaWRhdGU=</PHRASE>
<PHRASE Label="la_ToolTip_View" Module="In-Portal" Type="1">Vmlldw==</PHRASE>
<PHRASE Label="la_topic_editorpicksabove_prompt" Module="In-Portal" Type="1">RGlzcGxheSBlZGl0b3IgcGlja3MgYWJvdmUgcmVndWxhciB0b3BpY3M=</PHRASE>
<PHRASE Label="la_topic_newdays_prompt" Module="In-Portal" Type="1">TmV3IFRvcGljcyAoRGF5cyk=</PHRASE>
<PHRASE Label="la_topic_perpage_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIHRvcGljcyBwZXIgcGFnZQ==</PHRASE>
<PHRASE Label="la_topic_perpage_short_prompt" Module="In-Portal" Type="1">VG9waWNzIFBlciBQYWdlIChTaG9ydGxpc3Qp</PHRASE>
<PHRASE Label="la_Topic_Pick" Module="In-Portal" Type="1">UGljaw==</PHRASE>
<PHRASE Label="la_topic_reviewed" Module="In-Portal" Type="1">VG9waWMgcmV2aWV3ZWQ=</PHRASE>
<PHRASE Label="la_topic_sortfield2_pompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_topic_sortfield2_prompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_topic_sortfield2_prompt!" Module="In-Portal" Type="1">YW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_topic_sortfield_pompt" Module="In-Portal" Type="1">T3JkZXIgVG9waWNzIEJ5</PHRASE>
<PHRASE Label="la_topic_sortfield_prompt" Module="In-Portal" Type="1">U29ydCB0b3BpY3MgYnk=</PHRASE>
<PHRASE Label="la_topic_sortoder2_prompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_topic_sortoder_prompt" Module="In-Portal" Type="1">T3JkZXIgdG9waWNzIGJ5</PHRASE>
<PHRASE Label="la_Topic_Text" Module="In-Portal" Type="1">VG9waWMgVGV4dA==</PHRASE>
<PHRASE Label="la_Topic_Views" Module="In-Portal" Type="1">Vmlld3M=</PHRASE>
<PHRASE Label="la_to_date" Module="In-Portal" Type="1">VG8gRGF0ZQ==</PHRASE>
<PHRASE Label="la_translate" Module="In-Portal" Type="1">VHJhbnNsYXRl</PHRASE>
<PHRASE Label="la_type_checkbox" Module="In-Portal" Type="1">Q2hlY2tib3hlcw==</PHRASE>
<PHRASE Label="la_type_date" Module="In-Portal" Type="1">RGF0ZQ==</PHRASE>
<PHRASE Label="la_type_datetime" Module="In-Portal" Type="1">RGF0ZSAmIFRpbWU=</PHRASE>
<PHRASE Label="la_type_label" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_type_password" Module="In-Portal" Type="1">UGFzc3dvcmQgZmllbGQ=</PHRASE>
<PHRASE Label="la_type_radio" Module="In-Portal" Type="1">UmFkaW8gYnV0dG9ucw==</PHRASE>
<PHRASE Label="la_type_select" Module="In-Portal" Type="1">RHJvcCBkb3duIGZpZWxk</PHRASE>
<PHRASE Label="la_type_SingleCheckbox" Module="In-Portal" Type="1">Q2hlY2tib3g=</PHRASE>
<PHRASE Label="la_type_text" Module="In-Portal" Type="1">VGV4dCBmaWVsZA==</PHRASE>
<PHRASE Label="la_type_textarea" Module="In-Portal" Type="1">VGV4dCBhcmVh</PHRASE>
<PHRASE Label="la_Unchanged" Module="In-Portal" Type="1">VW5jaGFuZ2Vk</PHRASE>
<PHRASE Label="la_updating_config" Module="In-Portal" Type="1">VXBkYXRpbmcgQ29uZmlndXJhdGlvbg==</PHRASE>
<PHRASE Label="la_updating_rules" Module="In-Portal" Type="1">VXBkYXRpbmcgUnVsZXM=</PHRASE>
<PHRASE Label="la_UseCronForRegularEvent" Module="In-Portal" Type="1">VXNlIENyb24gZm9yIFJ1bm5pbmcgUmVndWxhciBFdmVudHM=</PHRASE>
<PHRASE Label="la_users_allow_new" Module="In-Portal" Type="1">QWxsb3cgbmV3IHVzZXIgcmVnaXN0cmF0aW9u</PHRASE>
<PHRASE Label="la_users_assign_all_to" Module="In-Portal" Type="1">QXNzaWduIEFsbCBVc2VycyBUbyBHcm91cA==</PHRASE>
<PHRASE Label="la_users_email_validate" Module="In-Portal" Type="1">VmFsaWRhdGUgZS1tYWlsIGFkZHJlc3M=</PHRASE>
<PHRASE Label="la_users_guest_group" Module="In-Portal" Type="1">QXNzaWduIHVzZXJzIG5vdCBsb2dnZWQgaW4gdG8gZ3JvdXA=</PHRASE>
<PHRASE Label="la_users_new_group" Module="In-Portal" Type="1">QXNzaWduIHJlZ2lzdGVyZWQgdXNlcnMgdG8gZ3JvdXA=</PHRASE>
<PHRASE Label="la_users_password_auto" Module="In-Portal" Type="1">QXNzaWduIHBhc3N3b3JkIGF1dG9tYXRpY2FsbHk=</PHRASE>
<PHRASE Label="la_users_review_deny" Module="In-Portal" Type="1">TnVtYmVyIG9mIGRheXMgdG8gZGVueSBtdWx0aXBsZSByZXZpZXdzIGZyb20gdGhlIHNhbWUgdXNlcg==</PHRASE>
<PHRASE Label="la_users_subscriber_group" Module="In-Portal" Type="2">QXNzaWduIG1haWxpbmcgbGlzdCBzdWJzY3JpYmVycyB0byBncm91cA==</PHRASE>
<PHRASE Label="la_users_votes_deny" Module="In-Portal" Type="1">TnVtYmVyIG9mIGRheXMgdG8gZGVueSBtdWx0aXBsZSB2b3RlcyBmcm9tIHRoZSBzYW1lIHVzZXI=</PHRASE>
<PHRASE Label="la_User_Instant" Module="In-Portal" Type="1">SW5zdGFudA==</PHRASE>
<PHRASE Label="la_User_Not_Allowed" Module="In-Portal" Type="1">Tm90IEFsbG93ZWQ=</PHRASE>
<PHRASE Label="la_User_Upon_Approval" Module="In-Portal" Type="1">VXBvbiBBcHByb3ZhbA==</PHRASE>
<PHRASE Label="la_use_emails_as_login" Module="In-Portal" Type="1">VXNlIEVtYWlscyBBcyBMb2dpbg==</PHRASE>
<PHRASE Label="la_US_UK" Module="In-Portal" Type="1">VVMvVUs=</PHRASE>
<PHRASE Label="la_validation_AlertMsg" Module="In-Portal" Type="1">UGxlYXNlIGNoZWNrIHRoZSByZXF1aXJlZCBmaWVsZHMgYW5kIHRyeSBhZ2FpbiE=</PHRASE>
<PHRASE Label="la_Value" Module="In-Portal" Type="1">VmFsdWU=</PHRASE>
<PHRASE Label="la_valuelist_help" Module="In-Portal" Type="1">RW50ZXIgbGlzdCBvZiB2YWx1ZXMgYW5kIHRoZWlyIGRlc2NyaXB0aW9ucywgbGlrZSAxPU9uZSwgMj1Ud28=</PHRASE>
<PHRASE Label="la_val_Active" Module="In-Portal" Type="1">QWN0aXZl</PHRASE>
<PHRASE Label="la_val_Always" Module="In-Portal" Type="1">QWx3YXlz</PHRASE>
<PHRASE Label="la_val_Auto" Module="In-Portal" Type="1">QXV0bw==</PHRASE>
<PHRASE Label="la_val_Disabled" Module="In-Portal" Type="1">RGlzYWJsZWQ=</PHRASE>
<PHRASE Label="la_val_Enabled" Module="In-Portal" Type="1">RW5hYmxlZA==</PHRASE>
<PHRASE Label="la_val_Never" Module="In-Portal" Type="1">TmV2ZXI=</PHRASE>
<PHRASE Label="la_val_Password" Module="In-Portal" Type="1">SW52YWxpZCBQYXNzd29yZA==</PHRASE>
<PHRASE Label="la_val_Pending" Module="In-Portal" Type="1">UGVuZGluZw==</PHRASE>
<PHRASE Label="la_val_RequiredField" Module="In-Portal" Type="1">UmVxdWlyZWQgRmllbGQ=</PHRASE>
<PHRASE Label="la_val_Username" Module="In-Portal" Type="1">SW52YWxpZCBVc2VybmFtZQ==</PHRASE>
<PHRASE Label="la_visit_DirectReferer" Module="In-Portal" Type="1">RGlyZWN0IGFjY2VzcyBvciBib29rbWFyaw==</PHRASE>
<PHRASE Label="la_vote_added" Module="In-Portal" Type="1">Vm90ZSBzdWJtaXR0ZWQgc3VjY2Vzc2Z1bGx5</PHRASE>
<PHRASE Label="la_Warning_Enable_HTML" Module="In-Portal" Type="1">V2FybmluZzogRW5hYmxpbmcgSFRNTCBpcyBhIHNlY3VyaXR5IHJpc2sgYW5kIGNvdWxkIGRhbWFnZSB0aGUgc3lzdGVtIGlmIHVzZWQgaW1wcm9wZXJseSE=</PHRASE>
<PHRASE Label="la_Warning_Filter" Module="In-Portal" Type="1">QSBzZWFyY2ggb3IgYSBmaWx0ZXIgaXMgaW4gZWZmZWN0LiBZb3UgbWF5IG5vdCBiZSBzZWVpbmcgYWxsIG9mIHRoZSBkYXRhLg==</PHRASE>
<PHRASE Label="la_warning_primary_delete" Module="In-Portal" Type="1">WW91IGFyZSBhYm91dCB0byBkZWxldGUgdGhlIHByaW1hcnkgdGhlbWUuIENvbnRpbnVlPw==</PHRASE>
<PHRASE Label="la_Warning_Save_Item" Module="In-Portal" Type="1">TW9kaWZpY2F0aW9ucyB3aWxsIG5vdCB0YWtlIGVmZmVjdCB1bnRpbCB5b3UgY2xpY2sgdGhlIFNhdmUgYnV0dG9uIQ==</PHRASE>
<PHRASE Label="la_week" Module="In-Portal" Type="1">d2Vlaw==</PHRASE>
<PHRASE Label="la_year" Module="In-Portal" Type="1">eWVhcg==</PHRASE>
<PHRASE Label="la_Yes" Module="In-Portal" Type="1">WWVz</PHRASE>
<PHRASE Label="lu_access_denied" Module="In-Portal" Type="0">WW91IGRvIG5vdCBoYXZlIGFjY2VzcyB0byBwZXJmb3JtIHRoaXMgb3BlcmF0aW9u</PHRASE>
<PHRASE Label="lu_account_info" Module="In-Portal" Type="0">QWNjb3VudCBJbmZvcm1hdGlvbg==</PHRASE>
<PHRASE Label="lu_action" Module="In-Portal" Type="0">QWN0aW9u</PHRASE>
<PHRASE Label="lu_action_box_title" Module="In-Portal" Type="0">QWN0aW9uIEJveA==</PHRASE>
<PHRASE Label="lu_action_prompt" Module="In-Portal" Type="0">SGVyZSBZb3UgQ2FuOg==</PHRASE>
<PHRASE Label="lu_add" Module="In-Portal" Type="0">QWRk</PHRASE>
<PHRASE Label="lu_addcat_confirm" Module="In-Portal" Type="0">U3VnZ2VzdCBDYXRlZ29yeSBSZXN1bHRz</PHRASE>
<PHRASE Label="lu_addcat_confirm_pending" Module="In-Portal" Type="0">Q2F0ZWdvcnkgQWRkZWQgUGVuZGluZyBBcHByb3ZhbA==</PHRASE>
<PHRASE Label="lu_addcat_confirm_pending_text" Module="In-Portal" Type="0">WW91ciBjYXRlZ29yeSBzdWdnZXN0aW9uIGhhcyBiZWVuIGFjY2VwdGVkIGFuZCBpcyBwZW5kaW5nIGFkbWluaXN0cmF0aXZlIGFwcHJvdmFsLg==</PHRASE>
<PHRASE Label="lu_addcat_confirm_text" Module="In-Portal" Type="0">VGhlIENhdGVnb3J5IHlvdSBzdWdnZXN0ZWQgaGFzIGJlZW4gYWRkZWQgdG8gdGhlIHN5c3RlbS4=</PHRASE>
<PHRASE Label="lu_added" Module="In-Portal" Type="0">QWRkZWQ=</PHRASE>
<PHRASE Label="lu_added_today" Module="In-Portal" Type="0">QWRkZWQgVG9kYXk=</PHRASE>
<PHRASE Label="lu_additional_cats" Module="In-Portal" Type="0">QWRkaXRpb25hbCBjYXRlZ29yaWVz</PHRASE>
<PHRASE Label="lu_addlink_confirm" Module="In-Portal" Type="0">QWRkIExpbmsgUmVzdWx0cw==</PHRASE>
<PHRASE Label="lu_addlink_confirm_pending" Module="In-Portal" Type="0">QWRkIFBlbmRpbmcgTGluayBSZXN1bHRz</PHRASE>
<PHRASE Label="lu_addlink_confirm_pending_text" Module="In-Portal" Type="0">WW91ciBsaW5rIGhhcyBiZWVuIGFkZGVkIHBlbmRpbmcgYWRtaW5pc3RyYXRpdmUgYXBwcm92YWwu</PHRASE>
<PHRASE Label="lu_addlink_confirm_text" Module="In-Portal" Type="0">VGhlIGxpbmsgeW91IGhhdmUgc3VnZ2VzdGVkIGhhcyBiZWVuIGFkZGVkIHRvIHRoZSBkYXRhYmFzZS4=</PHRASE>
<PHRASE Label="lu_address" Module="In-Portal" Type="0">QWRkcmVzcw==</PHRASE>
<PHRASE Label="lu_address_line" Module="In-Portal" Type="0">QWRkcmVzcyBMaW5l</PHRASE>
<PHRASE Label="lu_Address_Line1" Module="In-Portal" Type="0">QWRkcmVzcyBMaW5lIDE=</PHRASE>
<PHRASE Label="lu_Address_Line2" Module="In-Portal" Type="0">QWRkcmVzcyBMaW5lIDI=</PHRASE>
<PHRASE Label="lu_add_friend" Module="In-Portal" Type="0">QWRkIEZyaWVuZA==</PHRASE>
<PHRASE Label="lu_add_link" Module="In-Portal" Type="0">QWRkIExpbms=</PHRASE>
<PHRASE Label="lu_add_pm" Module="In-Portal" Type="0">U2VuZCBQcml2YXRlIE1lc3NhZ2U=</PHRASE>
<PHRASE Label="lu_add_review" Module="In-Portal" Type="0">QWRkIFJldmlldw==</PHRASE>
<PHRASE Label="lu_add_topic" Module="In-Portal" Type="0">QWRkIFRvcGlj</PHRASE>
<PHRASE Label="lu_add_to_favorites" Module="In-Portal" Type="0">QWRkIHRvIEZhdm9yaXRlcw==</PHRASE>
<PHRASE Label="lu_AdvancedSearch" Module="In-Portal" Type="0">QWR2YW5jZWQgU2VhcmNo</PHRASE>
<PHRASE Label="lu_advanced_search" Module="In-Portal" Type="0">QWR2YW5jZWQgU2VhcmNo</PHRASE>
<PHRASE Label="lu_advanced_search_link" Module="In-Portal" Type="0">QWR2YW5jZWQ=</PHRASE>
<PHRASE Label="lu_advsearch_any" Module="In-Portal" Type="0">QW55</PHRASE>
<PHRASE Label="lu_advsearch_contains" Module="In-Portal" Type="0">Q29udGFpbnM=</PHRASE>
<PHRASE Label="lu_advsearch_is" Module="In-Portal" Type="0">SXMgRXF1YWwgVG8=</PHRASE>
<PHRASE Label="lu_advsearch_isnot" Module="In-Portal" Type="0">SXMgTm90IEVxdWFsIFRv</PHRASE>
<PHRASE Label="lu_advsearch_notcontains" Module="In-Portal" Type="0">RG9lcyBOb3QgQ29udGFpbg==</PHRASE>
<PHRASE Label="lu_AllRightsReserved" Module="In-Portal" Type="0">QWxsIHJpZ2h0cyByZXNlcnZlZC4=</PHRASE>
<PHRASE Label="lu_already_suggested" Module="In-Portal" Type="0">IGhhcyBhbHJlYWR5IGJlZW4gc3VnZ2VzdGVkIHRvIHRoaXMgc2l0ZSBvbg==</PHRASE>
<PHRASE Label="lu_and" Module="In-Portal" Type="0">QW5k</PHRASE>
<PHRASE Label="lu_aol_im" Module="In-Portal" Type="0">QU9MIElN</PHRASE>
<PHRASE Label="lu_Apr" Module="In-Portal" Type="0">QXBy</PHRASE>
<PHRASE Label="lu_AProblemInForm" Module="In-Portal" Type="0">VGhlcmUgaXMgYSBwcm9ibGVtIHdpdGggdGhlIGZvcm0sIHBsZWFzZSBjaGVjayB0aGUgZXJyb3IgbWVzc2FnZXMgYmVsb3cu</PHRASE>
<PHRASE Label="lu_AProblemWithForm" Module="In-Portal" Type="0">VGhlcmUgaXMgYSBwcm9ibGVtIHdpdGggdGhlIGZvcm0sIHBsZWFzZSBjaGVjayB0aGUgZXJyb3IgbWVzc2FnZXMgYmVsb3c=</PHRASE>
<PHRASE Label="lu_articles" Module="In-Portal" Type="0">QXJ0aWNsZXM=</PHRASE>
<PHRASE Label="lu_article_details" Module="In-Portal" Type="0">QXJ0aWNsZSBEZXRhaWxz</PHRASE>
<PHRASE Label="lu_article_name" Module="In-Portal" Type="0">QXJ0aWNsZSBuYW1l</PHRASE>
<PHRASE Label="lu_article_reviews" Module="In-Portal" Type="0">QXJ0aWNsZSBSZXZpZXdz</PHRASE>
<PHRASE Label="lu_ascending" Module="In-Portal" Type="0">QXNjZW5kaW5n</PHRASE>
<PHRASE Label="lu_Aug" Module="In-Portal" Type="0">QXVn</PHRASE>
<PHRASE Label="lu_author" Module="In-Portal" Type="0">QXV0aG9y</PHRASE>
<PHRASE Label="lu_auto" Module="In-Portal" Type="1">QXV0b21hdGlj</PHRASE>
<PHRASE Label="lu_avatar_disabled" Module="In-Portal" Type="0">RGlzYWJsZWQgYXZhdGFy</PHRASE>
<PHRASE Label="lu_back" Module="In-Portal" Type="0">QmFjaw==</PHRASE>
<PHRASE Label="lu_bbcode" Module="In-Portal" Type="0">QkJDb2Rl</PHRASE>
<PHRASE Label="lu_birth_date" Module="In-Portal" Type="0">QmlydGggRGF0ZQ==</PHRASE>
<PHRASE Label="lu_blank_password" Module="In-Portal" Type="0">QmxhbmsgcGFzc3dvcmQ=</PHRASE>
<PHRASE Label="lu_box" Module="In-Portal" Type="0">Ym94</PHRASE>
<PHRASE Label="lu_btn_NewLink" Module="In-Portal" Type="0">TmV3IExpbms=</PHRASE>
<PHRASE Label="lu_btn_newtopic" Module="In-Portal" Type="0">TmV3IHRvcGlj</PHRASE>
<PHRASE Label="lu_button_forgotpw" Module="In-Portal" Type="0">U2VuZCBQYXNzd29yZA==</PHRASE>
<PHRASE Label="lu_button_go" Module="In-Portal" Type="0">R28=</PHRASE>
<PHRASE Label="lu_button_join" Module="In-Portal" Type="0">Sm9pbg==</PHRASE>
<PHRASE Label="lu_button_mailinglist" Module="In-Portal" Type="0">U3Vic2NyaWJl</PHRASE>
<PHRASE Label="lu_button_no" Module="In-Portal" Type="0">Tm8=</PHRASE>
<PHRASE Label="lu_button_ok" Module="In-Portal" Type="0">T2s=</PHRASE>
<PHRASE Label="lu_button_rate" Module="In-Portal" Type="0">UmF0ZQ==</PHRASE>
<PHRASE Label="lu_button_search" Module="In-Portal" Type="0">U2VhcmNo</PHRASE>
<PHRASE Label="lu_button_unsubscribe" Module="In-Portal" Type="0">VW5zdWJzY3JpYmU=</PHRASE>
<PHRASE Label="lu_button_yes" Module="In-Portal" Type="0">WWVz</PHRASE>
<PHRASE Label="lu_by" Module="In-Portal" Type="0">Ynk=</PHRASE>
<PHRASE Label="lu_cancel" Module="In-Portal" Type="0">Q2FuY2Vs</PHRASE>
<PHRASE Label="lu_cat" Module="In-Portal" Type="0">Q2F0ZWdvcnk=</PHRASE>
<PHRASE Label="lu_categories" Module="In-Portal" Type="0">Q2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="lu_categories_updated" Module="In-Portal" Type="0">Y2F0ZWdvcmllcyB1cGRhdGVk</PHRASE>
<PHRASE Label="lu_category" Module="In-Portal" Type="0">Q2F0ZWdvcnk=</PHRASE>
<PHRASE Label="lu_category_information" Module="In-Portal" Type="0">Q2F0ZWdvcnkgSW5mb3JtYXRpb24=</PHRASE>
<PHRASE Label="lu_category_search_results" Module="In-Portal" Type="0">Q2F0ZWdvcnkgU2VhcmNoIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_CatLead_Story" Module="In-Portal" Type="0">Q2F0ZWdvcnkgTGVhZCBTdG9yeQ==</PHRASE>
<PHRASE Label="lu_cats" Module="In-Portal" Type="0">Q2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="lu_city" Module="In-Portal" Type="0">Q2l0eQ==</PHRASE>
<PHRASE Label="lu_ClickHere" Module="In-Portal" Type="0">Y2xpY2sgaGVyZQ==</PHRASE>
<PHRASE Label="lu_close" Module="In-Portal" Type="0">Q2xvc2U=</PHRASE>
<PHRASE Label="lu_close_window" Module="In-Portal" Type="0">Q2xvc2UgV2luZG93</PHRASE>
<PHRASE Label="lu_code_expired" Module="In-Portal" Type="0">UGFzc3dvcmQgcmVzZXQgaGFzIGNvZGUgZXhwaXJlZA==</PHRASE>
<PHRASE Label="lu_code_is_not_valid" Module="In-Portal" Type="0">UGFzc3dvcmQgcmVzZXQgY29kZSBpcyBub3QgdmFsaWQ=</PHRASE>
<PHRASE Label="lu_comm_CartChangedAfterLogin" Module="In-Portal" Type="0">UHJpY2VzIG9mIG9uZSBvciBtb3JlIGl0ZW1zIGluIHlvdXIgc2hvcHBpbmcgY2FydCBoYXZlIGJlZW4gY2hhbmdlZCBkdWUgdG8geW91ciBsb2dpbiwgcGxlYXNlIHJldmlldyBjaGFuZ2VzLg==</PHRASE>
<PHRASE Label="lu_comm_EmailAddress" Module="In-Portal" Type="0">RW1haWxBZGRyZXNz</PHRASE>
- <PHRASE Label="lu_comm_Images" Module="In-Portal" Type="0">QWRkaXRpb25hbCBJbWFnZXM=</PHRASE>
- <PHRASE Label="lu_comm_ImagesHeader" Module="In-Portal" Type="0">QURESVRJT05BTCBJTUFHRVM=</PHRASE>
<PHRASE Label="lu_comm_NoPermissions" Module="In-Portal" Type="0">Tm8gUGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="lu_comm_ProductDescription" Module="In-Portal" Type="0">UHJvZHVjdCBEZXNjcmlwdGlvbg==</PHRASE>
<PHRASE Label="lu_company" Module="In-Portal" Type="0">Q29tcGFueQ==</PHRASE>
<PHRASE Label="lu_confirm" Module="In-Portal" Type="0">Y29uZmlybQ==</PHRASE>
<PHRASE Label="lu_confirmation_title" Module="In-Portal" Type="0">Q29uZmlybWF0aW9uIFRpdGxl</PHRASE>
<PHRASE Label="lu_confirm_link_delete_subtitle" Module="In-Portal" Type="0">WW91IGFyZSBhYm91dCB0byBkZWxldGUgdGhlIGxpbmsgYmVsb3cu</PHRASE>
<PHRASE Label="lu_confirm_subtitle" Module="In-Portal" Type="0">Q29uZmlybWF0aW9uIFN1YnRpdGxl</PHRASE>
<PHRASE Label="lu_confirm_text" Module="In-Portal" Type="0">Q29uZmlybWF0aW9uIHRleHQ=</PHRASE>
<PHRASE Label="lu_ContactUs" Module="In-Portal" Type="0">Q29udGFjdCBVcw==</PHRASE>
<PHRASE Label="lu_contact_information" Module="In-Portal" Type="0">Q29udGFjdCBJbmZvcm1hdGlvbg==</PHRASE>
<PHRASE Label="lu_continue" Module="In-Portal" Type="0">Q29udGludWU=</PHRASE>
<PHRASE Label="lu_cookies" Module="In-Portal" Type="1">Q29va2llcw==</PHRASE>
<PHRASE Label="lu_cookies_error" Module="In-Portal" Type="0">UGxlYXNlIGVuYWJsZSBjb29raWVzIHRvIGxvZ2luIQ==</PHRASE>
<PHRASE Label="lu_country" Module="In-Portal" Type="0">Q291bnRyeQ==</PHRASE>
<PHRASE Label="lu_created" Module="In-Portal" Type="0">Y3JlYXRlZA==</PHRASE>
<PHRASE Label="lu_create_password" Module="In-Portal" Type="0">Q3JlYXRlIFBhc3N3b3Jk</PHRASE>
<PHRASE Label="lu_CreditCards" Module="In-Portal" Type="0">Q3JlZGl0IENhcmRz</PHRASE>
<PHRASE Label="lu_current_value" Module="In-Portal" Type="0">Q3VycmVudCBWYWx1ZQ==</PHRASE>
<PHRASE Label="lu_date" Module="In-Portal" Type="0">RGF0ZQ==</PHRASE>
<PHRASE Label="lu_date_created" Module="In-Portal" Type="0">RGF0ZSBjcmVhdGVk</PHRASE>
<PHRASE Label="lu_Dec" Module="In-Portal" Type="0">RGVj</PHRASE>
<PHRASE Label="lu_default_bbcode" Module="In-Portal" Type="0">RW5hYmxlIEJCQ29kZQ==</PHRASE>
<PHRASE Label="lu_default_notify_owner" Module="In-Portal" Type="0">Tm90aWZ5IG1lIG9uIGNoYW5nZXMgdG8gdG9waWNzIEkgY3JlYXRl</PHRASE>
<PHRASE Label="lu_default_notify_pm" Module="In-Portal" Type="0">UmVjZWl2ZSBQcml2YXRlIE1lc3NhZ2UgTm90aWZpY2F0aW9ucw==</PHRASE>
<PHRASE Label="lu_default_signature" Module="In-Portal" Type="0">QXR0YXRjaCBNeSBTaWduYXR1cmUgdG8gUG9zdHM=</PHRASE>
<PHRASE Label="lu_default_smileys" Module="In-Portal" Type="0">U2ltbGllcyBvbiBieSBkZWZhdWx0</PHRASE>
<PHRASE Label="lu_default_user_signatures" Module="In-Portal" Type="0">U2lnbmF0dXJlcyBvbiBieSBkZWZhdWx0</PHRASE>
<PHRASE Label="lu_delete" Module="In-Portal" Type="0">RGVsZXRl</PHRASE>
<PHRASE Label="lu_delete_confirm_title" Module="In-Portal" Type="0">Q29uZmlybSBEZWxldGU=</PHRASE>
<PHRASE Label="lu_delete_friend" Module="In-Portal" Type="0">RGVsZXRlIEZyaWVuZA==</PHRASE>
<PHRASE Label="lu_delete_link_question" Module="In-Portal" Type="0">QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGlzIGxpbms/</PHRASE>
<PHRASE Label="lu_del_favorites" Module="In-Portal" Type="0">VGhlIGxpbmsgd2FzIHN1Y2Nlc3NmdWxseSByZW1vdmVkIGZyb20gIEZhdm9yaXRlcy4=</PHRASE>
<PHRASE Label="lu_descending" Module="In-Portal" Type="0">RGVzY2VuZGluZw==</PHRASE>
<PHRASE Label="lu_details" Module="In-Portal" Type="0">RGV0YWlscw==</PHRASE>
<PHRASE Label="lu_details_updated" Module="In-Portal" Type="0">ZGV0YWlscyB1cGRhdGVk</PHRASE>
<PHRASE Label="lu_directory" Module="In-Portal" Type="0">RGlyZWN0b3J5</PHRASE>
<PHRASE Label="lu_disable" Module="In-Portal" Type="0">RGlzYWJsZQ==</PHRASE>
<PHRASE Label="lu_edit" Module="In-Portal" Type="0">TW9kaWZ5</PHRASE>
<PHRASE Label="lu_editedby" Module="In-Portal" Type="0">RWRpdGVkIEJ5</PHRASE>
<PHRASE Label="lu_editors_pick" Module="In-Portal" Type="0">RWRpdG9ycyBQaWNr</PHRASE>
<PHRASE Label="lu_editors_picks" Module="In-Portal" Type="0">RWRpdG9yJ3MgUGlja3M=</PHRASE>
<PHRASE Label="lu_edittopic_confirm" Module="In-Portal" Type="0">RWRpdCBUb3BpYyBSZXN1bHRz</PHRASE>
<PHRASE Label="lu_edittopic_confirm_pending" Module="In-Portal" Type="0">VG9waWMgbW9kaWZpZWQ=</PHRASE>
<PHRASE Label="lu_edittopic_confirm_pending_text" Module="In-Portal" Type="0">VG9waWMgaGFzIGJlZW4gbW9kaWZpZWQgcGVuZGluZyBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbA==</PHRASE>
<PHRASE Label="lu_edittopic_confirm_text" Module="In-Portal" Type="0">Q2hhbmdlcyBtYWRlIHRvIHRoZSB0b3BpYyBoYXZlIGJlZW4gc2F2ZWQu</PHRASE>
<PHRASE Label="lu_edit_post" Module="In-Portal" Type="0">TW9kaWZ5IFBvc3Q=</PHRASE>
<PHRASE Label="lu_edit_topic" Module="In-Portal" Type="0">TW9kaWZ5IFRvcGlj</PHRASE>
<PHRASE Label="LU_EMAIL" Module="In-Portal" Type="0">RS1NYWls</PHRASE>
<PHRASE Label="lu_email_already_exist" Module="In-Portal" Type="0">QSB1c2VyIHdpdGggc3VjaCBlLW1haWwgYWxyZWFkeSBleGlzdHMu</PHRASE>
<PHRASE Label="lu_email_send_error" Module="In-Portal" Type="0">TWFpbCBzZW5kaW5nIGZhaWxlZA==</PHRASE>
<PHRASE Label="lu_enabled" Module="In-Portal" Type="0">RW5hYmxlZA==</PHRASE>
<PHRASE Label="lu_end_on" Module="In-Portal" Type="0">RW5kIE9u</PHRASE>
<PHRASE Label="lu_enlarge_picture" Module="In-Portal" Type="0">Wm9vbSBpbg==</PHRASE>
<PHRASE Label="lu_enter" Module="In-Portal" Type="0">RW50ZXI=</PHRASE>
<PHRASE Label="lu_EnterEmailToRecommend" Module="In-Portal" Type="0">RW50ZXIgeW91ciBmcmllbmQgZS1tYWlsIGFkZHJlc3MgdG8gcmVjb21tZW5kIHRoaXMgc2l0ZQ==</PHRASE>
<PHRASE Label="lu_EnterEmailToSubscribe" Module="In-Portal" Type="0">RW50ZXIgeW91ciBlLW1haWwgYWRkcmVzcyB0byBzdWJzY3JpYmUgdG8gdGhlIG1haWxpbmcgbGlzdC4=</PHRASE>
<PHRASE Label="lu_EnterForgotUserEmail" Module="In-Portal" Type="0">RW50ZXIgeW91ciBVc2VybmFtZSBvciBFbWFpbCBBZGRyZXNzIGJlbG93IHRvIGhhdmUgeW91ciBhY2NvdW50IGluZm9ybWF0aW9uIHNlbnQgdG8gdGhlIGVtYWlsIGFkZHJlc3Mgb2YgeW91ciBhY2NvdW50Lg==</PHRASE>
<PHRASE Label="lu_errors_on_form" Module="In-Portal" Type="0">TWlzc2luZyBvciBpbnZhbGlkIHZhbHVlcy4gUGxlYXNlIGNoZWNrIGFsbCB0aGUgZmllbGRzIGFuZCB0cnkgYWdhaW4u</PHRASE>
<PHRASE Label="lu_error_404_description" Module="In-Portal" Type="0">U29ycnksIHRoZSByZXF1ZXN0ZWQgVVJMIHdhcyBub3QgZm91bmQgb24gb3VyIHNlcnZlci4=</PHRASE>
<PHRASE Label="lu_error_404_title" Module="In-Portal" Type="0">RXJyb3IgNDA0IC0gTm90IEZvdW5k</PHRASE>
<PHRASE Label="lu_error_subtitle" Module="In-Portal" Type="0">RXJyb3I=</PHRASE>
<PHRASE Label="lu_error_title" Module="In-Portal" Type="0">RXJyb3I=</PHRASE>
<PHRASE Label="lu_existing_users" Module="In-Portal" Type="0">RXhpc3RpbmcgVXNlcnM=</PHRASE>
<PHRASE Label="lu_expires" Module="In-Portal" Type="0">RXhwaXJlcw==</PHRASE>
<PHRASE Label="lu_false" Module="In-Portal" Type="0">RmFsc2U=</PHRASE>
<PHRASE Label="lu_favorite" Module="In-Portal" Type="0">RmF2b3JpdGU=</PHRASE>
<PHRASE Label="lu_favorite_denied" Module="In-Portal" Type="0">VW5hYmxlIHRvIGFkZCBmYXZvcml0ZSwgYWNjZXNzIGRlbmllZA==</PHRASE>
<PHRASE Label="lu_Feb" Module="In-Portal" Type="0">RmVi</PHRASE>
<PHRASE Label="lu_ferror_forgotpw_nodata" Module="In-Portal" Type="1">WW91IG11c3QgZW50ZXIgYSBVc2VybmFtZSBvciBFbWFpbCBBZGRyZXNzIHRvIHJldHJpdmUgeW91ciBhY2NvdW50IGluZm9ybWF0aW9u</PHRASE>
<PHRASE Label="lu_ferror_loginboth" Module="In-Portal" Type="1">Qm90aCBhIFVzZXJuYW1lIGFuZCBQYXNzd29yZCBpcyByZXF1aXJlZA==</PHRASE>
<PHRASE Label="lu_ferror_login_login_password" Module="In-Portal" Type="1">UGxlYXNlIGVudGVyIHlvdXIgcGFzc3dvcmQgYW5kIHRyeSBhZ2Fpbg==</PHRASE>
<PHRASE Label="lu_ferror_login_login_user" Module="In-Portal" Type="1">WW91IGRpZCBub3QgZW50ZXIgeW91ciBVc2VybmFtZQ==</PHRASE>
<PHRASE Label="lu_ferror_m_acctinfo_dob" Module="In-Portal" Type="0">RGF0ZSBvZiBiaXJ0aCBpcyByZXF1aXJlZA==</PHRASE>
<PHRASE Label="lu_ferror_m_acctinfo_firstname" Module="In-Portal" Type="0">TWlzc2luZyBmaXJzdCBuYW1l</PHRASE>
<PHRASE Label="lu_ferror_m_profile_userid" Module="In-Portal" Type="0">TWlzc2luZyB1c2Vy</PHRASE>
<PHRASE Label="lu_ferror_m_register_dob" Module="In-Portal" Type="0">RGF0ZSBvZiBiaXJ0aCBpcyByZXF1aXJlZA==</PHRASE>
<PHRASE Label="lu_ferror_m_register_email" Module="In-Portal" Type="0">RW1haWwgaXMgcmVxdWlyZWQ=</PHRASE>
<PHRASE Label="lu_ferror_m_register_firstname" Module="In-Portal" Type="0">Rmlyc3QgbmFtZSBpcyByZXF1aXJlZA==</PHRASE>
<PHRASE Label="lu_ferror_m_register_password" Module="In-Portal" Type="0">UGFzc3dvcmQgcmVxdWlyZWQ=</PHRASE>
<PHRASE Label="lu_ferror_no_access" Module="In-Portal" Type="0">QWNjZXNzIGRlbmllZA==</PHRASE>
<PHRASE Label="lu_ferror_pswd_mismatch" Module="In-Portal" Type="0">UGFzc3dvcmRzIGRvIG5vdCBtYXRjaA==</PHRASE>
<PHRASE Label="lu_ferror_pswd_toolong" Module="In-Portal" Type="0">VGhlIHBhc3N3b3JkIGlzIHRvbyBsb25n</PHRASE>
<PHRASE Label="lu_ferror_pswd_tooshort" Module="In-Portal" Type="0">UGFzc3dvcmQgaXMgdG9vIHNob3J0</PHRASE>
<PHRASE Label="lu_ferror_reset_denied" Module="In-Portal" Type="0">Tm90IHJlc2V0</PHRASE>
<PHRASE Label="lu_ferror_review_duplicate" Module="In-Portal" Type="0">WW91IGhhdmUgYWxyZWFkeSByZXZpZXdlZCB0aGlzIGl0ZW0u</PHRASE>
<PHRASE Label="lu_ferror_toolarge" Module="In-Portal" Type="0">RmlsZSBpcyB0b28gbGFyZ2U=</PHRASE>
<PHRASE Label="lu_ferror_unknown_email" Module="In-Portal" Type="1">VXNlciBhY2NvdW50IHdpdGggZ2l2ZW4gRS1tYWlsIG5vdCBmb3VuZA==</PHRASE>
<PHRASE Label="lu_ferror_unknown_username" Module="In-Portal" Type="1">VXNlciBhY2NvdW50IHdpdGggZ2l2ZW4gVXNlcm5hbWUgbm90IGZvdW5k</PHRASE>
<PHRASE Label="lu_ferror_username_tooshort" Module="In-Portal" Type="0">VXNlciBuYW1lIGlzIHRvbyBzaG9ydA==</PHRASE>
<PHRASE Label="lu_ferror_wrongtype" Module="In-Portal" Type="0">V3JvbmcgZmlsZSB0eXBl</PHRASE>
<PHRASE Label="lu_fieldcustom__cc1" Module="In-Portal" Type="2">Y2Mx</PHRASE>
<PHRASE Label="lu_fieldcustom__cc2" Module="In-Portal" Type="2">Y2My</PHRASE>
<PHRASE Label="lu_fieldcustom__cc3" Module="In-Portal" Type="2">Y2Mz</PHRASE>
<PHRASE Label="lu_fieldcustom__cc4" Module="In-Portal" Type="2">Y2M0</PHRASE>
<PHRASE Label="lu_fieldcustom__cc5" Module="In-Portal" Type="2">Y2M1</PHRASE>
<PHRASE Label="lu_fieldcustom__cc6" Module="In-Portal" Type="2">Y2M2</PHRASE>
<PHRASE Label="lu_fieldcustom__lc1" Module="In-Portal" Type="2">bGMx</PHRASE>
<PHRASE Label="lu_fieldcustom__lc2" Module="In-Portal" Type="2">bGMy</PHRASE>
<PHRASE Label="lu_fieldcustom__lc3" Module="In-Portal" Type="2">bGMz</PHRASE>
<PHRASE Label="lu_fieldcustom__lc4" Module="In-Portal" Type="2">bGM0</PHRASE>
<PHRASE Label="lu_fieldcustom__lc5" Module="In-Portal" Type="2">bGM1</PHRASE>
<PHRASE Label="lu_fieldcustom__lc6" Module="In-Portal" Type="2">bGM2</PHRASE>
<PHRASE Label="lu_fieldcustom__uc1" Module="In-Portal" Type="2">dWMx</PHRASE>
<PHRASE Label="lu_fieldcustom__uc2" Module="In-Portal" Type="2">dWMy</PHRASE>
<PHRASE Label="lu_fieldcustom__uc3" Module="In-Portal" Type="2">dWMz</PHRASE>
<PHRASE Label="lu_fieldcustom__uc4" Module="In-Portal" Type="2">dWM0</PHRASE>
<PHRASE Label="lu_fieldcustom__uc5" Module="In-Portal" Type="2">dWM1</PHRASE>
<PHRASE Label="lu_fieldcustom__uc6" Module="In-Portal" Type="2">dWM2</PHRASE>
<PHRASE Label="lu_field_archived" Module="In-Portal" Type="0">QXJjaGl2ZSBEYXRl</PHRASE>
<PHRASE Label="lu_field_author" Module="In-Portal" Type="0">QXJ0aWNsZSBBdXRob3I=</PHRASE>
<PHRASE Label="lu_field_body" Module="In-Portal" Type="0">QXJ0aWNsZSBCb2R5</PHRASE>
<PHRASE Label="lu_field_cacheddescendantcatsqty" Module="In-Portal" Type="0">TnVtYmVyIG9mIERlc2NlbmRhbnRz</PHRASE>
<PHRASE Label="lu_field_cachednavbar" Module="In-Portal" Type="0">Q2F0ZWdvcnkgUGF0aA==</PHRASE>
<PHRASE Label="lu_field_cachedrating" Module="In-Portal" Type="2">UmF0aW5n</PHRASE>
<PHRASE Label="lu_field_cachedreviewsqty" Module="In-Portal" Type="2">TnVtYmVyIG9mIFJldmlld3M=</PHRASE>
<PHRASE Label="lu_field_cachedvotesqty" Module="In-Portal" Type="2">TnVtYmVyIG9mIFJhdGluZyBWb3Rlcw==</PHRASE>
<PHRASE Label="lu_field_categoryid" Module="In-Portal" Type="0">Q2F0ZWdvcnkgSWQ=</PHRASE>
<PHRASE Label="lu_field_city" Module="In-Portal" Type="0">Q2l0eQ==</PHRASE>
<PHRASE Label="lu_field_country" Module="In-Portal" Type="0">Q291bnRyeQ==</PHRASE>
<PHRASE Label="lu_field_createdbyid" Module="In-Portal" Type="2">Q3JlYXRlZCBCeSBVc2VyIElE</PHRASE>
<PHRASE Label="lu_field_createdon" Module="In-Portal" Type="2">RGF0ZSBDcmVhdGVk</PHRASE>
<PHRASE Label="lu_field_description" Module="In-Portal" Type="2">RGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="lu_field_dob" Module="In-Portal" Type="0">RGF0ZSBvZiBCaXJ0aA==</PHRASE>
<PHRASE Label="lu_field_editorspick" Module="In-Portal" Type="0">RWRpdG9yJ3MgcGljaw==</PHRASE>
<PHRASE Label="lu_field_email" Module="In-Portal" Type="0">RS1tYWls</PHRASE>
<PHRASE Label="lu_field_endon" Module="In-Portal" Type="0">RW5kcyBPbg==</PHRASE>
<PHRASE Label="lu_field_excerpt" Module="In-Portal" Type="0">QXJ0aWNsZSBFeGNlcnB0</PHRASE>
<PHRASE Label="lu_field_firstname" Module="In-Portal" Type="0">Rmlyc3QgTmFtZQ==</PHRASE>
<PHRASE Label="lu_field_hits" Module="In-Portal" Type="2">SGl0cw==</PHRASE>
<PHRASE Label="lu_field_hotitem" Module="In-Portal" Type="2">SXRlbSBJcyBIb3Q=</PHRASE>
<PHRASE Label="lu_field_lastname" Module="In-Portal" Type="0">TGFzdCBOYW1l</PHRASE>
<PHRASE Label="lu_field_lastpostid" Module="In-Portal" Type="2">TGFzdCBQb3N0IElE</PHRASE>
<PHRASE Label="lu_field_leadcatstory" Module="In-Portal" Type="0">Q2F0ZWdvcnkgTGVhZCBTdG9yeT8=</PHRASE>
<PHRASE Label="lu_field_leadstory" Module="In-Portal" Type="0">TGVhZCBTdG9yeT8=</PHRASE>
<PHRASE Label="lu_field_linkid" Module="In-Portal" Type="2">TGluayBJRA==</PHRASE>
<PHRASE Label="lu_field_login" Module="In-Portal" Type="0">TG9naW4gKFVzZXIgbmFtZSk=</PHRASE>
<PHRASE Label="lu_field_metadescription" Module="In-Portal" Type="0">TWV0YSBEZXNjcmlwdGlvbg==</PHRASE>
<PHRASE Label="lu_field_metakeywords" Module="In-Portal" Type="0">TWV0YSBLZXl3b3Jkcw==</PHRASE>
<PHRASE Label="lu_field_modified" Module="In-Portal" Type="2">TGFzdCBNb2RpZmllZCBEYXRl</PHRASE>
<PHRASE Label="lu_field_modifiedbyid" Module="In-Portal" Type="2">TW9kaWZpZWQgQnkgVXNlciBJRA==</PHRASE>
<PHRASE Label="lu_field_name" Module="In-Portal" Type="2">TmFtZQ==</PHRASE>
<PHRASE Label="lu_field_newitem" Module="In-Portal" Type="2">SXRlbSBJcyBOZXc=</PHRASE>
<PHRASE Label="lu_field_newsid" Module="In-Portal" Type="0">QXJ0aWNsZSBJRA==</PHRASE>
<PHRASE Label="lu_field_notifyowneronchanges" Module="In-Portal" Type="2">Tm90aWZ5IE93bmVyIG9mIENoYW5nZXM=</PHRASE>
<PHRASE Label="lu_field_orgid" Module="In-Portal" Type="2">T3JpZ2luYWwgSXRlbSBJRA==</PHRASE>
<PHRASE Label="lu_field_ownerid" Module="In-Portal" Type="2">T3duZXIgVXNlciBJRA==</PHRASE>
<PHRASE Label="lu_field_parentid" Module="In-Portal" Type="0">UGFyZW50IElk</PHRASE>
<PHRASE Label="lu_field_parentpath" Module="In-Portal" Type="0">UGFyZW50IENhdGVnb3J5IFBhdGg=</PHRASE>
<PHRASE Label="lu_field_password" Module="In-Portal" Type="0">UGFzc3dvcmQ=</PHRASE>
<PHRASE Label="lu_field_phone" Module="In-Portal" Type="0">VGVsZXBob25l</PHRASE>
<PHRASE Label="lu_field_popitem" Module="In-Portal" Type="2">SXRlbSBJcyBQb3B1bGFy</PHRASE>
<PHRASE Label="lu_field_portaluserid" Module="In-Portal" Type="0">VXNlciBJRA==</PHRASE>
<PHRASE Label="lu_field_postedby" Module="In-Portal" Type="2">UG9zdGVkIEJ5</PHRASE>
<PHRASE Label="lu_field_posts" Module="In-Portal" Type="0">VG9waWMgUG9zdHM=</PHRASE>
<PHRASE Label="lu_field_priority" Module="In-Portal" Type="2">UHJpb3JpdHk=</PHRASE>
<PHRASE Label="lu_field_qtysold" Module="In-Portal" Type="1">UXR5IFNvbGQ=</PHRASE>
<PHRASE Label="lu_field_resourceid" Module="In-Portal" Type="2">UmVzb3VyY2UgSUQ=</PHRASE>
<PHRASE Label="lu_field_startdate" Module="In-Portal" Type="0">U3RhcnQgRGF0ZQ==</PHRASE>
<PHRASE Label="lu_field_state" Module="In-Portal" Type="0">U3RhdGU=</PHRASE>
<PHRASE Label="lu_field_status" Module="In-Portal" Type="2">U3RhdHVz</PHRASE>
<PHRASE Label="lu_field_street" Module="In-Portal" Type="0">U3RyZWV0IEFkZHJlc3M=</PHRASE>
<PHRASE Label="lu_field_textformat" Module="In-Portal" Type="0">QXJ0aWNsZSBUZXh0</PHRASE>
<PHRASE Label="lu_field_title" Module="In-Portal" Type="0">QXJ0aWNsZSBUaXRsZQ==</PHRASE>
<PHRASE Label="lu_field_topicid" Module="In-Portal" Type="2">VG9waWMgSUQ=</PHRASE>
<PHRASE Label="lu_field_topictext" Module="In-Portal" Type="2">VG9waWMgVGV4dA==</PHRASE>
<PHRASE Label="lu_field_topictype" Module="In-Portal" Type="0">VG9waWMgVHlwZQ==</PHRASE>
<PHRASE Label="lu_field_topseller" Module="In-Portal" Type="1">SXRlbSBJcyBhIFRvcCBTZWxsZXI=</PHRASE>
<PHRASE Label="lu_field_tz" Module="In-Portal" Type="0">VGltZSBab25l</PHRASE>
<PHRASE Label="lu_field_url" Module="In-Portal" Type="2">VVJM</PHRASE>
<PHRASE Label="lu_field_views" Module="In-Portal" Type="0">Vmlld3M=</PHRASE>
<PHRASE Label="lu_field_zip" Module="In-Portal" Type="0">WmlwIChQb3N0YWwpIENvZGU=</PHRASE>
<PHRASE Label="lu_first_name" Module="In-Portal" Type="0">Rmlyc3QgTmFtZQ==</PHRASE>
<PHRASE Label="lu_fld_module" Module="In-Portal" Type="0">TW9kdWxl</PHRASE>
<PHRASE Label="lu_fld_phrase" Module="In-Portal" Type="0">UGhyYXNl</PHRASE>
<PHRASE Label="lu_fld_primary_translation" Module="In-Portal" Type="0">UHJpbWFyeSBUcmFuc2xhdGlvbg==</PHRASE>
<PHRASE Label="lu_fld_translation" Module="In-Portal" Type="0">VHJhbnNsYXRpb24=</PHRASE>
<PHRASE Label="lu_ForgotPassword" Module="In-Portal" Type="0">Rm9yZ290IHBhc3N3b3Jk</PHRASE>
<PHRASE Label="lu_forgotpw_confirm" Module="In-Portal" Type="0">UGFzc3dvcmQgUmVxdWVzdCBDb25maXJtYXRpb24=</PHRASE>
<PHRASE Label="lu_forgotpw_confirm_reset" Module="In-Portal" Type="0">Q29uZmlybSBwYXNzd29yZCByZXNldA==</PHRASE>
<PHRASE Label="lu_forgotpw_confirm_text" Module="In-Portal" Type="0">WW91IGhhdmUgY2hvc2VkIHRvIHJlc2V0IHlvdXIgcGFzc3dvcmQuIEEgbmV3IHBhc3N3b3JkIGhhcyBiZWVuIGF1dG9tYXRpY2FsbHkgZ2VuZXJhdGVkIGJ5IHRoZSBzeXN0ZW0uIEl0IGhhcyBiZWVuIGVtYWlsZWQgdG8geW91ciBhZGRyZXNzIG9uIGZpbGUu</PHRASE>
<PHRASE Label="lu_forgotpw_confirm_text_reset" Module="In-Portal" Type="0">UGxlYXNlIGNvbmZpcm0gdGhhdCB5b3Ugd2FudCB0byByZXNldCB5b3VyIHBhc3N3b3JkLg==</PHRASE>
<PHRASE Label="lu_forgot_password" Module="In-Portal" Type="0">Rm9yZ290IFBhc3N3b3Jk</PHRASE>
<PHRASE Label="lu_forgot_password_link" Module="In-Portal" Type="0">Rm9yZ290IFBhc3N3b3Jk</PHRASE>
<PHRASE Label="lu_forgot_pw_description" Module="In-Portal" Type="1">RW50ZXIgeW91ciBVc2VybmFtZSBvciBFbWFpbCBBZGRyZXNzIGJlbG93IHRvIGhhdmUgeW91ciBhY2NvdW50IGluZm9ybWF0aW9uIHNlbnQgdG8gdGhlIGVtYWlsIGFkZHJlc3Mgb2YgeW91ciBhY2NvdW50Lg==</PHRASE>
<PHRASE Label="lu_forums" Module="In-Portal" Type="0">Rm9ydW1z</PHRASE>
<PHRASE Label="lu_forum_hdrtext" Module="In-Portal" Type="0">V2VsY29tZSB0byBJbi1wb3J0YWwgZm9ydW1zIQ==</PHRASE>
<PHRASE Label="lu_forum_hdrwelcometext" Module="In-Portal" Type="0">V2VsY29tZSB0byBJbi1idWxsZXRpbiBGb3J1bXMh</PHRASE>
<PHRASE Label="lu_forum_locked_for_posting" Module="In-Portal" Type="0">Rm9ydW0gaXMgbG9ja2VkIGZvciBwb3N0aW5n</PHRASE>
<PHRASE Label="lu_found" Module="In-Portal" Type="0">Rm91bmQ6</PHRASE>
<PHRASE Label="lu_from" Module="In-Portal" Type="0">RnJvbQ==</PHRASE>
<PHRASE Label="lu_full_story" Module="In-Portal" Type="0">RnVsbCBTdG9yeQ==</PHRASE>
<PHRASE Label="lu_getting_rated" Module="In-Portal" Type="0">R2V0dGluZyBSYXRlZA==</PHRASE>
<PHRASE Label="lu_getting_rated_text" Module="In-Portal" Type="0">WW91IG1heSBwbGFjZSB0aGUgZm9sbG93aW5nIEhUTUwgY29kZSBvbiB5b3VyIHdlYiBzaXRlIHRvIGFsbG93IHlvdXIgc2l0ZSB2aXNpdG9ycyB0byB2b3RlIGZvciB0aGlzIHJlc291cmNl</PHRASE>
<PHRASE Label="lu_guest" Module="In-Portal" Type="0">R3Vlc3Q=</PHRASE>
<PHRASE Label="lu_help" Module="In-Portal" Type="0">SGVscA==</PHRASE>
<PHRASE Label="lu_Here" Module="In-Portal" Type="0">SGVyZQ==</PHRASE>
<PHRASE Label="lu_hits" Module="In-Portal" Type="0">SGl0cw==</PHRASE>
<PHRASE Label="lu_home" Module="In-Portal" Type="0">SG9tZQ==</PHRASE>
<PHRASE Label="lu_hot" Module="In-Portal" Type="0">SG90</PHRASE>
<PHRASE Label="lu_hot_links" Module="In-Portal" Type="0">SG90IExpbmtz</PHRASE>
<PHRASE Label="lu_in" Module="In-Portal" Type="0">aW4=</PHRASE>
<PHRASE Label="lu_inbox" Module="In-Portal" Type="0">SW5ib3g=</PHRASE>
<PHRASE Label="lu_incorrect_login" Module="In-Portal" Type="0">VXNlcm5hbWUvUGFzc3dvcmQgSW5jb3JyZWN0</PHRASE>
<PHRASE Label="lu_IndicatesRequired" Module="In-Portal" Type="0">SW5kaWNhdGVzIFJlcXVpcmVkIGZpZWxkcw==</PHRASE>
<PHRASE Label="lu_InvalidEmail" Module="In-Portal" Type="0">SW52YWxpZCBlLW1haWwgYWRkcmVzcw==</PHRASE>
<PHRASE Label="lu_invalid_emailaddress" Module="In-Portal" Type="0">RS1tYWlsIGFkZHJlc3MgbWlzc2luZyBvciBpbnZhbGlk</PHRASE>
<PHRASE Label="lu_invalid_password" Module="In-Portal" Type="0">SW52YWxpZCBQYXNzd29yZA==</PHRASE>
<PHRASE Label="lu_in_this_message" Module="In-Portal" Type="0">SW4gdGhpcyBtZXNzYWdl</PHRASE>
<PHRASE Label="lu_items_since_last" Module="In-Portal" Type="0">SXRlbXMgc2luY2UgbGFzdCBsb2dpbg==</PHRASE>
<PHRASE Label="lu_Jan" Module="In-Portal" Type="0">SmFu</PHRASE>
<PHRASE Label="lu_joined" Module="In-Portal" Type="0">Sm9pbmVk</PHRASE>
<PHRASE Label="lu_Jul" Module="In-Portal" Type="0">SnVs</PHRASE>
<PHRASE Label="lu_Jun" Module="In-Portal" Type="0">SnVu</PHRASE>
<PHRASE Label="lu_keywords_tooshort" Module="In-Portal" Type="0">S2V5d29yZCBpcyB0b28gc2hvcnQ=</PHRASE>
<PHRASE Label="lu_lastpost" Module="In-Portal" Type="0">TGFzdCBQb3N0</PHRASE>
<PHRASE Label="lu_lastposter" Module="In-Portal" Type="0">TGFzdCBQb3N0IEJ5</PHRASE>
<PHRASE Label="lu_lastupdate" Module="In-Portal" Type="0">TGFzdCBVcGRhdGU=</PHRASE>
<PHRASE Label="lu_last_name" Module="In-Portal" Type="0">TGFzdCBOYW1l</PHRASE>
<PHRASE Label="lu_legend" Module="In-Portal" Type="0">TGVnZW5k</PHRASE>
<PHRASE Label="lu_links" Module="In-Portal" Type="0">TGlua3M=</PHRASE>
<PHRASE Label="lu_links_updated" Module="In-Portal" Type="0">bGlua3MgdXBkYXRlZA==</PHRASE>
<PHRASE Label="lu_link_addreview_confirm_pending_text" Module="In-Portal" Type="0">WW91ciByZXZpZXcgaGFzIGJlZW4gYWRkZWQgcGVuZGluZyBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbA==</PHRASE>
<PHRASE Label="lu_link_addreview_confirm_text" Module="In-Portal" Type="0">WW91ciByZXZpZXcgaGFzIGJlZW4gYWRkZWQ=</PHRASE>
<PHRASE Label="lu_link_details" Module="In-Portal" Type="0">TGluayBEZXRhaWxz</PHRASE>
<PHRASE Label="lu_link_information" Module="In-Portal" Type="0">TGluayBJbmZvcm1hdGlvbg==</PHRASE>
<PHRASE Label="lu_link_name" Module="In-Portal" Type="0">TGluayBOYW1l</PHRASE>
<PHRASE Label="lu_link_rate_confirm" Module="In-Portal" Type="0">TGluayBSYXRpbmcgUmVzdWx0cw==</PHRASE>
<PHRASE Label="lu_link_rate_confirm_duplicate_text" Module="In-Portal" Type="0">WW91IGhhdmUgYWxyZWFkeSByYXRlZCB0aGlzIGxpbmsu</PHRASE>
<PHRASE Label="lu_link_rate_confirm_text" Module="In-Portal" Type="0">VGhhbmsgZm9yIHJhdGluZyB0aGlzIGxpbmsuICBZb3VyIGlucHV0IGhhcyBiZWVuIHJlY29yZGVkLg==</PHRASE>
<PHRASE Label="lu_link_reviews" Module="In-Portal" Type="0">TGluayBSZXZpZXdz</PHRASE>
<PHRASE Label="lu_link_review_confirm" Module="In-Portal" Type="0">TGluayBSZXZpZXcgUmVzdWx0cw==</PHRASE>
<PHRASE Label="lu_link_review_confirm_pending" Module="In-Portal" Type="0">TGluayBSZXZpZXcgUGVuZGluZw==</PHRASE>
<PHRASE Label="lu_link_search_results" Module="In-Portal" Type="0">TGluayBTZWFyY2ggUmVzdWx0cw==</PHRASE>
<PHRASE Label="lu_location" Module="In-Portal" Type="0">TG9jYXRpb24=</PHRASE>
<PHRASE Label="lu_locked_topic" Module="In-Portal" Type="0">TG9ja2VkIHRvcGlj</PHRASE>
<PHRASE Label="lu_lock_unlock" Module="In-Portal" Type="0">TG9jay9VbmxvY2s=</PHRASE>
<PHRASE Label="lu_login" Module="In-Portal" Type="0">TG9naW4=</PHRASE>
<PHRASE Label="lu_login_information" Module="In-Portal" Type="0">TG9naW4gSW5mb3JtYXRpb24=</PHRASE>
<PHRASE Label="lu_login_name" Module="In-Portal" Type="0">TG9naW4gTmFtZQ==</PHRASE>
<PHRASE Label="lu_login_title" Module="In-Portal" Type="0">TG9naW4=</PHRASE>
<PHRASE Label="lu_logout" Module="In-Portal" Type="0">TG9nIE91dA==</PHRASE>
<PHRASE Label="lu_LogoutText" Module="In-Portal" Type="0">TG9nb3V0IG9mIHlvdXIgYWNjb3VudA==</PHRASE>
<PHRASE Label="lu_logout_description" Module="In-Portal" Type="0">TG9nIG91dCBvZiB0aGUgc3lzdGVt</PHRASE>
<PHRASE Label="lu_mailinglist" Module="In-Portal" Type="0">TWFpbGluZyBMaXN0</PHRASE>
<PHRASE Label="lu_Mar" Module="In-Portal" Type="0">TWFy</PHRASE>
<PHRASE Label="lu_May" Module="In-Portal" Type="0">TWF5</PHRASE>
<PHRASE Label="lu_message" Module="In-Portal" Type="0">TWVzc2FnZQ==</PHRASE>
<PHRASE Label="lu_message_body" Module="In-Portal" Type="0">TWVzc2FnZSBCb2R5</PHRASE>
<PHRASE Label="lu_min_pw_reset_interval" Module="In-Portal" Type="0">UGFzc3dvcmQgcmVzZXQgaW50ZXJ2YWw=</PHRASE>
<PHRASE Label="lu_missing_error" Module="In-Portal" Type="0">TWlzc2luZyBUZW1wbGF0ZQ==</PHRASE>
<PHRASE Label="lu_modified" Module="In-Portal" Type="0">TW9kaWZpZWQ=</PHRASE>
<PHRASE Label="lu_modifylink_confirm" Module="In-Portal" Type="0">TGluayBNb2RpZmljYXRpb24gQ29uZmlybWF0aW9u</PHRASE>
<PHRASE Label="lu_modifylink_confirm_text" Module="In-Portal" Type="0">WW91ciBsaW5rIGhhcyBiZWVuIG1vZGlmaWVkLg==</PHRASE>
<PHRASE Label="lu_modifylink_pending_confirm" Module="In-Portal" Type="0">TGluayBtb2RpZmljYXRpb24gY29tcGxldGU=</PHRASE>
<PHRASE Label="lu_modifylink_pending_confirm_text" Module="In-Portal" Type="0">WW91ciBsaW5rIG1vZGlmaWNhdGlvbiBoYXMgYmVlbiBzdWJtaXR0ZWQgcGVuZGluZyBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbA==</PHRASE>
<PHRASE Label="lu_modify_link" Module="In-Portal" Type="0">TW9kaWZ5IExpbms=</PHRASE>
<PHRASE Label="lu_more" Module="In-Portal" Type="0">TW9yZQ==</PHRASE>
<PHRASE Label="lu_MoreDetails" Module="In-Portal" Type="0">TW9yZSBkZXRhaWxz</PHRASE>
<PHRASE Label="lu_more_info" Module="In-Portal" Type="0">TW9yZSBJbmZv</PHRASE>
<PHRASE Label="lu_msg_welcome" Module="In-Portal" Type="0">V2VsY29tZQ==</PHRASE>
<PHRASE Label="lu_myaccount" Module="In-Portal" Type="0">TXkgQWNjb3VudA==</PHRASE>
<PHRASE Label="lu_my_articles" Module="In-Portal" Type="0">TXkgQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="lu_my_articles_description" Module="In-Portal" Type="0">TmV3cyBBcnRpY2xlcyB5b3UgaGF2ZSB3cml0dGVu</PHRASE>
<PHRASE Label="lu_my_favorites" Module="In-Portal" Type="0">TXkgRmF2b3JpdGVz</PHRASE>
<PHRASE Label="lu_my_favorites_description" Module="In-Portal" Type="0">SXRlbXMgeW91IGhhdmUgbWFya2VkIGFzIGZhdm9yaXRl</PHRASE>
<PHRASE Label="lu_my_friends" Module="In-Portal" Type="0">TXkgRnJpZW5kcw==</PHRASE>
<PHRASE Label="lu_my_friends_description" Module="In-Portal" Type="0">VmlldyB5b3VyIGxpc3Qgb2YgZnJpZW5kcw==</PHRASE>
<PHRASE Label="lu_my_info" Module="In-Portal" Type="0">TXkgUHJvZmlsZQ==</PHRASE>
<PHRASE Label="lu_my_info_description" Module="In-Portal" Type="0">WW91ciBBY2NvdW50IEluZm9ybWF0aW9u</PHRASE>
<PHRASE Label="lu_my_items_title" Module="In-Portal" Type="0">TXkgSXRlbXM=</PHRASE>
<PHRASE Label="lu_my_links" Module="In-Portal" Type="0">TXkgTGlua3M=</PHRASE>
<PHRASE Label="lu_my_links_description" Module="In-Portal" Type="0">TGlua3MgeW91IGhhdmUgYWRkZWQgdG8gdGhlIHN5c3RlbQ==</PHRASE>
<PHRASE Label="lu_my_link_favorites" Module="In-Portal" Type="0">TXkgRmF2b3JpdGVz</PHRASE>
<PHRASE Label="lu_my_news" Module="In-Portal" Type="0">TXkgTmV3cw==</PHRASE>
<PHRASE Label="lu_my_news_favorites" Module="In-Portal" Type="0">RmF2b3JpdGUgQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="lu_my_preferences" Module="In-Portal" Type="0">TXkgUHJlZmVyZW5jZXM=</PHRASE>
<PHRASE Label="lu_my_preferences_description" Module="In-Portal" Type="0">RWRpdCB5b3VyIEluLVBvcnRhbCBQcmVmZXJlbmNlcw==</PHRASE>
<PHRASE Label="lu_my_profile" Module="In-Portal" Type="0">TXkgUHJvZmlsZQ==</PHRASE>
<PHRASE Label="lu_my_topics" Module="In-Portal" Type="0">TXkgVG9waWNz</PHRASE>
<PHRASE Label="lu_my_topics_description" Module="In-Portal" Type="0">RGlzY3Vzc2lvbnMgeW91IGhhdmUgY3JlYXRlZA==</PHRASE>
<PHRASE Label="lu_my_topic_favorites" Module="In-Portal" Type="0">TXkgVG9waWNz</PHRASE>
<PHRASE Label="lu_Name" Module="In-Portal" Type="0">TmFtZQ==</PHRASE>
<PHRASE Label="lu_nav_addlink" Module="In-Portal" Type="0">QWRkIExpbms=</PHRASE>
<PHRASE Label="lu_new" Module="In-Portal" Type="0">TmV3</PHRASE>
<PHRASE Label="lu_NewCustomers" Module="In-Portal" Type="0">TmV3IEN1c3RvbWVycw==</PHRASE>
<PHRASE Label="lu_newpm_confirm" Module="In-Portal" Type="0">TmV3IFByaXZhdGUgTWVzc2FnZSBDb25maXJtYXRpb24=</PHRASE>
<PHRASE Label="lu_newpm_confirm_text" Module="In-Portal" Type="0">WW91ciBwcml2YXRlIG1lc3NhZ2UgaGFzIGJlZW4gc2VudC4=</PHRASE>
<PHRASE Label="lu_news" Module="In-Portal" Type="0">TmV3cw==</PHRASE>
<PHRASE Label="lu_news_addreview_confirm_text" Module="In-Portal" Type="0">VGhlIGFydGljbGUgcmV2aWV3IGhhcyBiZWVuIGFkZGVkIHRvIHRoZSBkYXRhYmFzZS4=</PHRASE>
<PHRASE Label="lu_news_addreview_confirm__pending_text" Module="In-Portal" Type="0">QXJ0aWNsZSByZXZpZXcgaGFzIGJlZW4gc3VibWl0dGVkIHBlbmRpbmcgYWRtaW5pc3RyYXRpdmUgYXBwcm92YWw=</PHRASE>
<PHRASE Label="lu_news_details" Module="In-Portal" Type="0">TmV3cyBEZXRhaWxz</PHRASE>
<PHRASE Label="lu_news_rate_confirm" Module="In-Portal" Type="0">UmF0ZSBBcnRpY2xlIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_news_rate_confirm_duplicate_text" Module="In-Portal" Type="0">WW91IGhhdmUgYWxyZWFkeSByYXRlZCB0aGlzIGFydGljbGU=</PHRASE>
<PHRASE Label="lu_news_rate_confirm_text" Module="In-Portal" Type="0">VGhhbmsgeW91IGZvciByYXRpbmcgdGhpcyBhcnRpY2xlLiBZb3VyIHZvdGUgaGFzIGJlZW4gcmVjb3JkZWQu</PHRASE>
<PHRASE Label="lu_news_review_confirm" Module="In-Portal" Type="0">VGhlIHJldmlldyBoYXMgYmVlbiBhZGRlZA==</PHRASE>
<PHRASE Label="lu_news_review_confirm_pending" Module="In-Portal" Type="0">QXJ0aWNsZSByZXZpZXcgc3VibWl0dGVk</PHRASE>
<PHRASE Label="lu_news_search_results" Module="In-Portal" Type="0">U2VhcmNoIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_news_updated" Module="In-Portal" Type="0">bmV3cyB1cGRhdGVk</PHRASE>
<PHRASE Label="lu_newtopic_confirm" Module="In-Portal" Type="0">QWRkIFRvcGljIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_newtopic_confirm_pending" Module="In-Portal" Type="0">WW91ciB0b3BpYyBoYXMgYmVlbiBhZGRlZA==</PHRASE>
<PHRASE Label="lu_newtopic_confirm_pending_text" Module="In-Portal" Type="0">VGhlIHN5c3RlbSBhZG1pbmlzdHJhdG9yIG11c3QgYXBwcm92ZSB5b3VyIHRvcGljIGJlZm9yZSBpdCBpcyBwdWJsaWNseSBhdmFpbGFibGUu</PHRASE>
<PHRASE Label="lu_newtopic_confirm_text" Module="In-Portal" Type="0">VGhlIFRvcGljIHlvdSBoYXZlIGNyZWF0ZWQgaGFzIGJlZW4gYWRkZWQgdG8gdGhlIHN5c3RlbQ==</PHRASE>
<PHRASE Label="lu_new_articles" Module="In-Portal" Type="0">TmV3IGFydGljbGVz</PHRASE>
<PHRASE Label="lu_new_links" Module="In-Portal" Type="0">TmV3IExpbmtz</PHRASE>
<PHRASE Label="lu_new_news" Module="In-Portal" Type="0">TmV3IGFydGljbGVz</PHRASE>
<PHRASE Label="lu_new_pm" Module="In-Portal" Type="0">TmV3IFByaXZhdGUgTWVzc2FnZQ==</PHRASE>
<PHRASE Label="lu_new_posts" Module="In-Portal" Type="0">Rm9ydW0gaGFzIG5ldyBwb3N0cw==</PHRASE>
<PHRASE Label="lu_new_private_message" Module="In-Portal" Type="0">TmV3IHByaXZhdGUgbWVzc2FnZQ==</PHRASE>
<PHRASE Label="lu_new_since_links" Module="In-Portal" Type="0">TmV3IGxpbmtz</PHRASE>
<PHRASE Label="lu_new_since_news" Module="In-Portal" Type="0">TmV3IGFydGljbGVz</PHRASE>
<PHRASE Label="lu_new_since_topics" Module="In-Portal" Type="0">TmV3IHRvcGljcw==</PHRASE>
<PHRASE Label="lu_new_topic" Module="In-Portal" Type="0">TmV3IFRvcGlj</PHRASE>
<PHRASE Label="lu_new_users" Module="In-Portal" Type="0">TmV3IFVzZXJz</PHRASE>
<PHRASE Label="lu_no" Module="In-Portal" Type="0">Tm8=</PHRASE>
<PHRASE Label="lu_NoAccess" Module="In-Portal" Type="0">U29ycnksIHlvdSBoYXZlIG5vIGFjY2VzcyB0byB0aGlzIHBhZ2Uh</PHRASE>
<PHRASE Label="lu_none" Module="In-Portal" Type="0">Tm9uZQ==</PHRASE>
<PHRASE Label="lu_notify_owner" Module="In-Portal" Type="0">Tm90aWZ5IG1lIHdoZW4gcG9zdHMgYXJlIG1hZGUgaW4gdGhpcyB0b3BpYw==</PHRASE>
<PHRASE Label="lu_not_logged_in" Module="In-Portal" Type="0">Tm90IGxvZ2dlZCBpbg==</PHRASE>
<PHRASE Label="lu_Nov" Module="In-Portal" Type="0">Tm92</PHRASE>
<PHRASE Label="lu_no_articles" Module="In-Portal" Type="0">Tm8gQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="lu_no_categories" Module="In-Portal" Type="0">Tm8gQ2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="lu_no_expiration" Module="In-Portal" Type="0">Tm8gZXhwaXJhdGlvbg==</PHRASE>
<PHRASE Label="lu_no_favorites" Module="In-Portal" Type="0">Tm8gZmF2b3JpdGVz</PHRASE>
<PHRASE Label="lu_no_items" Module="In-Portal" Type="0">Tm8gSXRlbXM=</PHRASE>
<PHRASE Label="lu_no_keyword" Module="In-Portal" Type="0">S2V5d29yZCBtaXNzaW5n</PHRASE>
<PHRASE Label="lu_no_links" Module="In-Portal" Type="0">Tm8gTGlua3M=</PHRASE>
<PHRASE Label="lu_no_new_posts" Module="In-Portal" Type="0">Rm9ydW0gaGFzIG5vIG5ldyBwb3N0cw==</PHRASE>
<PHRASE Label="lu_no_permissions" Module="In-Portal" Type="0">Tm8gUGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="lu_no_related_categories" Module="In-Portal" Type="0">Tm8gUmVsYXRlZCBDYXRlZ29yaWVz</PHRASE>
<PHRASE Label="lu_no_session_error" Module="In-Portal" Type="0">RXJyb3I6IG5vIHNlc3Npb24=</PHRASE>
<PHRASE Label="lu_no_template_error" Module="In-Portal" Type="0">TWlzc2luZyB0ZW1wbGF0ZQ==</PHRASE>
<PHRASE Label="lu_no_topics" Module="In-Portal" Type="0">Tm8gVG9waWNz</PHRASE>
<PHRASE Label="lu_Oct" Module="In-Portal" Type="0">T2N0</PHRASE>
<PHRASE Label="lu_of" Module="In-Portal" Type="2">b2Y=</PHRASE>
<PHRASE Label="lu_offline" Module="In-Portal" Type="0">T2ZmbGluZQ==</PHRASE>
<PHRASE Label="lu_ok" Module="In-Portal" Type="0">T2s=</PHRASE>
<PHRASE Label="lu_on" Module="In-Portal" Type="0">b24=</PHRASE>
<PHRASE Label="lu_online" Module="In-Portal" Type="0">T25saW5l</PHRASE>
<PHRASE Label="lu_on_this_post" Module="In-Portal" Type="0">b24gdGhpcyBwb3N0</PHRASE>
<PHRASE Label="lu_operation_notallowed" Module="In-Portal" Type="0">WW91IGRvIG5vdCBoYXZlIGFjY2VzcyB0byBwZXJmb3JtIHRoaXMgb3BlcmF0aW9u</PHRASE>
<PHRASE Label="lu_optional" Module="In-Portal" Type="0">T3B0aW9uYWw=</PHRASE>
<PHRASE Label="lu_options" Module="In-Portal" Type="0">T3B0aW9ucw==</PHRASE>
<PHRASE Label="lu_or" Module="In-Portal" Type="0">b3I=</PHRASE>
<PHRASE Label="lu_page" Module="In-Portal" Type="0">UGFnZQ==</PHRASE>
<PHRASE Label="lu_page_label" Module="In-Portal" Type="0">UGFnZTo=</PHRASE>
<PHRASE Label="lu_password" Module="In-Portal" Type="0">UGFzc3dvcmQ=</PHRASE>
<PHRASE Label="lu_passwords_do_not_match" Module="In-Portal" Type="0">UGFzc3dvcmRzIGRvIG5vdCBtYXRjaA==</PHRASE>
<PHRASE Label="lu_passwords_too_short" Module="In-Portal" Type="0">UGFzc3dvcmQgaXMgdG9vIHNob3J0LCBwbGVhc2UgZW50ZXIgYXQgbGVhc3QgJXMgY2hhcmFjdGVycw==</PHRASE>
<PHRASE Label="lu_password_again" Module="In-Portal" Type="0">UGFzc3dvcmQgQWdhaW4=</PHRASE>
<PHRASE Label="lu_pending_approval" Module="In-Portal" Type="0">UGVuZGluZyBBcHByb3ZhbA==</PHRASE>
<PHRASE Label="lu_PermName_Admin_desc" Module="In-Portal" Type="1">QWRtaW4gTG9naW4=</PHRASE>
<PHRASE Label="lu_PermName_Category.AddPending_desc" Module="In-Portal" Type="0">QWRkIFBlbmRpbmcgQ2F0ZWdvcnk=</PHRASE>
<PHRASE Label="lu_PermName_Category.Add_desc" Module="In-Portal" Type="0">QWRkIENhdGVnb3J5</PHRASE>
<PHRASE Label="lu_PermName_Category.Delete_desc" Module="In-Portal" Type="0">RGVsZXRlIENhdGVnb3J5</PHRASE>
<PHRASE Label="lu_PermName_Category.Modify_desc" Module="In-Portal" Type="0">TW9kaWZ5IENhdGVnb3J5</PHRASE>
<PHRASE Label="lu_PermName_Category.View_desc" Module="In-Portal" Type="0">VmlldyBDYXRlZ29yeQ==</PHRASE>
<PHRASE Label="lu_PermName_Debug.Info_desc" Module="In-Portal" Type="1">QXBwZW5kIHBocGluZm8gdG8gYWxsIHBhZ2VzIChEZWJ1Zyk=</PHRASE>
<PHRASE Label="lu_PermName_Debug.Item_desc" Module="In-Portal" Type="1">RGlzcGxheSBJdGVtIFF1ZXJpZXMgKERlYnVnKQ==</PHRASE>
<PHRASE Label="lu_PermName_Debug.List_desc" Module="In-Portal" Type="1">RGlzcGxheSBJdGVtIExpc3QgUXVlcmllcyAoRGVidWcp</PHRASE>
<PHRASE Label="lu_PermName_favorites_desc" Module="In-Portal" Type="2">QWxsb3cgZmF2b3JpdGVz</PHRASE>
<PHRASE Label="lu_PermName_Link.Add.Pending_desc" Module="In-Portal" Type="0">UGVuZGluZyBMaW5r</PHRASE>
<PHRASE Label="lu_PermName_Link.Add_desc" Module="In-Portal" Type="0">QWRkIExpbms=</PHRASE>
<PHRASE Label="lu_PermName_Link.Delete_desc" Module="In-Portal" Type="0">RGVsZXRlIExpbms=</PHRASE>
<PHRASE Label="lu_PermName_Link.Modify.Pending_desc" Module="In-Portal" Type="2">TW9kaWZ5IExpbmsgUGVuZGluZw==</PHRASE>
<PHRASE Label="lu_PermName_Link.Modify_desc" Module="In-Portal" Type="0">TW9kaWZ5IExpbms=</PHRASE>
<PHRASE Label="lu_PermName_Link.Owner.Delete_desc" Module="In-Portal" Type="2">TGluayBEZWxldGUgYnkgT3duZXI=</PHRASE>
<PHRASE Label="lu_PermName_Link.Owner.Modify.Pending_desc" Module="In-Portal" Type="2">TGluayBNb2RpZnkgUGVuZGluZyBieSBPd25lcg==</PHRASE>
<PHRASE Label="lu_PermName_Link.Owner.Modify_desc" Module="In-Portal" Type="2">TGluayBNb2RpZnkgYnkgT3duZXI=</PHRASE>
<PHRASE Label="lu_PermName_Link.Rate_desc" Module="In-Portal" Type="0">UmF0ZSBMaW5r</PHRASE>
<PHRASE Label="lu_PermName_Link.Review_desc" Module="In-Portal" Type="0">UmV2aWV3IExpbms=</PHRASE>
<PHRASE Label="lu_PermName_Link.Review_Pending_desc" Module="In-Portal" Type="2">UmV2aWV3IExpbmsgUGVuZGluZw==</PHRASE>
<PHRASE Label="lu_PermName_Link.View_desc" Module="In-Portal" Type="0">VmlldyBMaW5r</PHRASE>
<PHRASE Label="lu_PermName_Login_desc" Module="In-Portal" Type="1">QWxsb3cgTG9naW4=</PHRASE>
<PHRASE Label="lu_PermName_News.Add.Pending_desc" Module="In-Portal" Type="0">QWRkIFBlbmRpbmcgTmV3cw==</PHRASE>
<PHRASE Label="lu_PermName_News.Add_desc" Module="In-Portal" Type="0">QWRkIE5ld3M=</PHRASE>
<PHRASE Label="lu_PermName_News.Delete_desc" Module="In-Portal" Type="0">RGVsZXRlIE5ld3M=</PHRASE>
<PHRASE Label="lu_PermName_News.Modify_desc" Module="In-Portal" Type="0">TW9kaWZ5IE5ld3M=</PHRASE>
<PHRASE Label="lu_PermName_News.Rate_desc" Module="In-Portal" Type="0">UmF0ZSBOZXdz</PHRASE>
<PHRASE Label="lu_PermName_News.Review.Pending_desc" Module="In-Portal" Type="2">UmV2aWV3IE5ld3MgUGVuZGluZw==</PHRASE>
<PHRASE Label="lu_PermName_News.Review_desc" Module="In-Portal" Type="0">UmV2aWV3IE5ld3M=</PHRASE>
<PHRASE Label="lu_PermName_News.View_desc" Module="In-Portal" Type="0">VmlldyBOZXdz</PHRASE>
<PHRASE Label="lu_PermName_Profile.Modify_desc" Module="In-Portal" Type="1">Q2hhbmdlIFVzZXIgUHJvZmlsZXM=</PHRASE>
<PHRASE Label="lu_PermName_ShowLang_desc" Module="In-Portal" Type="1">U2hvdyBMYW5ndWFnZSBUYWdz</PHRASE>
<PHRASE Label="lu_PermName_Topic.Add.Pending_desc" Module="In-Portal" Type="0">QWRkIFBlbmRpbmcgVG9waWM=</PHRASE>
<PHRASE Label="lu_PermName_Topic.Add_desc" Module="In-Portal" Type="0">QWRkIFRvcGlj</PHRASE>
<PHRASE Label="lu_PermName_Topic.Delete_desc" Module="In-Portal" Type="0">RGVsZXRlIFRvcGlj</PHRASE>
<PHRASE Label="lu_PermName_Topic.Lock_desc" Module="In-Portal" Type="1">TG9jay9VbmxvY2sgVG9waWNz</PHRASE>
<PHRASE Label="lu_PermName_Topic.Modify.Pending_desc" Module="In-Portal" Type="1">TW9kaWZ5IFRvcGljIFBlbmRpbmc=</PHRASE>
<PHRASE Label="lu_PermName_Topic.Modify_desc" Module="In-Portal" Type="0">TW9kaWZ5IFRvcGlj</PHRASE>
<PHRASE Label="lu_PermName_Topic.Owner.Delete_desc" Module="In-Portal" Type="1">VG9waWMgT3duZXIgRGVsZXRl</PHRASE>
<PHRASE Label="lu_PermName_Topic.Owner.Modify.Pending_desc" Module="In-Portal" Type="1">T3duZXIgTW9kaWZ5IFRvcGljIFBlbmRpbmc=</PHRASE>
<PHRASE Label="lu_PermName_Topic.Owner.Modify_desc" Module="In-Portal" Type="1">VG9waWMgT3duZXIgTW9kaWZ5</PHRASE>
<PHRASE Label="lu_PermName_Topic.Rate_desc" Module="In-Portal" Type="0">UmF0ZSBUb3BpYw==</PHRASE>
<PHRASE Label="lu_PermName_Topic.Reply.Add_desc" Module="In-Portal" Type="0">QWRkIFRvcGljIFJlcGx5</PHRASE>
<PHRASE Label="lu_PermName_Topic.Reply.Delete_desc" Module="In-Portal" Type="0">RGVsZXRlIFRvcGlj</PHRASE>
<PHRASE Label="lu_PermName_Topic.Reply.Modify_desc" Module="In-Portal" Type="0">UmVwbHkgVG9waWMgTW9kaWZ5</PHRASE>
<PHRASE Label="lu_PermName_Topic.Reply.Owner.Delete_desc" Module="In-Portal" Type="1">UG9zdCBPd25lciBEZWxldGU=</PHRASE>
<PHRASE Label="lu_PermName_Topic.Reply.Owner.Modify_desc" Module="In-Portal" Type="1">UG9zdCBPd25lciBNb2RpZnk=</PHRASE>
<PHRASE Label="lu_PermName_Topic.Reply.View_desc" Module="In-Portal" Type="0">VmlldyBUb3BpYyBSZXBseQ==</PHRASE>
<PHRASE Label="lu_PermName_Topic.Review_desc" Module="In-Portal" Type="0">UmV2aWV3IFRvcGlj</PHRASE>
<PHRASE Label="lu_PermName_Topic.View_desc" Module="In-Portal" Type="0">VmlldyBUb3BpYw==</PHRASE>
<PHRASE Label="lu_phone" Module="In-Portal" Type="0">UGhvbmU=</PHRASE>
<PHRASE Label="lu_pick" Module="In-Portal" Type="0">UGljaw==</PHRASE>
<PHRASE Label="lu_pick_links" Module="In-Portal" Type="0">RWRpdG9yJ3MgUGljayBMaW5rcw==</PHRASE>
<PHRASE Label="lu_pick_news" Module="In-Portal" Type="0">RWRpdG9yJ3MgUGljayBBcnRpY2xlcw==</PHRASE>
<PHRASE Label="lu_pick_topics" Module="In-Portal" Type="0">RWRpdG9yJ3MgcGljayB0b3BpY3M=</PHRASE>
<PHRASE Label="lu_PleaseRegister" Module="In-Portal" Type="0">UGxlYXNlIFJlZ2lzdGVy</PHRASE>
<PHRASE Label="lu_pm_delete_confirm" Module="In-Portal" Type="0">QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGlzIHByaXZhdGUgbWVzc2FnZT8=</PHRASE>
<PHRASE Label="lu_pm_list" Module="In-Portal" Type="0">UHJpdmF0ZSBNZXNzYWdlcw==</PHRASE>
<PHRASE Label="lu_pm_list_description" Module="In-Portal" Type="0">UHJpdmF0ZSBNZXNzYWdlcw==</PHRASE>
<PHRASE Label="lu_Pop" Module="In-Portal" Type="0">UG9wdWxhcg==</PHRASE>
<PHRASE Label="lu_pop_links" Module="In-Portal" Type="0">TW9zdCBQb3B1bGFyIExpbmtz</PHRASE>
<PHRASE Label="lu_post" Module="In-Portal" Type="0">UG9zdA==</PHRASE>
<PHRASE Label="lu_posted" Module="In-Portal" Type="0">UG9zdGVk</PHRASE>
<PHRASE Label="lu_poster" Module="In-Portal" Type="0">UG9zdGVy</PHRASE>
<PHRASE Label="lu_posts" Module="In-Portal" Type="0">cG9zdHM=</PHRASE>
<PHRASE Label="lu_posts_updated" Module="In-Portal" Type="0">cG9zdHMgdXBkYXRlZA==</PHRASE>
<PHRASE Label="lu_PoweredBy" Module="In-Portal" Type="0">UG93ZXJlZCBieQ==</PHRASE>
<PHRASE Label="lu_pp_city" Module="In-Portal" Type="0">Q2l0eQ==</PHRASE>
<PHRASE Label="lu_pp_company" Module="In-Portal" Type="0">Q29tcGFueQ==</PHRASE>
<PHRASE Label="lu_pp_country" Module="In-Portal" Type="0">Q291bnRyeQ==</PHRASE>
<PHRASE Label="lu_pp_dob" Module="In-Portal" Type="0">QmlydGhkYXRl</PHRASE>
<PHRASE Label="lu_pp_email" Module="In-Portal" Type="0">RS1tYWls</PHRASE>
<PHRASE Label="lu_pp_fax" Module="In-Portal" Type="0">RmF4</PHRASE>
<PHRASE Label="lu_pp_firstname" Module="In-Portal" Type="0">Rmlyc3QgTmFtZQ==</PHRASE>
<PHRASE Label="lu_pp_lastname" Module="In-Portal" Type="0">TGFzdCBOYW1l</PHRASE>
<PHRASE Label="lu_pp_phone" Module="In-Portal" Type="0">UGhvbmU=</PHRASE>
<PHRASE Label="lu_pp_state" Module="In-Portal" Type="0">U3RhdGU=</PHRASE>
<PHRASE Label="lu_pp_street" Module="In-Portal" Type="0">U3RyZWV0</PHRASE>
<PHRASE Label="lu_pp_street2" Module="In-Portal" Type="0">U3RyZWV0IDI=</PHRASE>
<PHRASE Label="lu_pp_zip" Module="In-Portal" Type="0">Wmlw</PHRASE>
<PHRASE Label="lu_privacy" Module="In-Portal" Type="0">UHJpdmFjeQ==</PHRASE>
<PHRASE Label="lu_privatemessages_updated" Module="In-Portal" Type="0">UHJpdmF0ZSBtZXNzYWdlcyB1cGRhdGVk</PHRASE>
<PHRASE Label="lu_private_messages" Module="In-Portal" Type="0">UHJpdmF0ZSBNZXNzYWdlcw==</PHRASE>
<PHRASE Label="lu_profile" Module="In-Portal" Type="0">UHJvZmlsZQ==</PHRASE>
<PHRASE Label="lu_profile_field" Module="In-Portal" Type="0">UHJvZmlsZQ==</PHRASE>
<PHRASE Label="lu_profile_updated" Module="In-Portal" Type="0">cHJvZmlsZSB1cGRhdGVk</PHRASE>
<PHRASE Label="lu_prompt_avatar" Module="In-Portal" Type="0">QXZhdGFyIEltYWdl</PHRASE>
<PHRASE Label="lu_prompt_catdesc" Module="In-Portal" Type="0">RGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="lu_prompt_catname" Module="In-Portal" Type="0">Q2F0ZWdvcnkgTmFtZQ==</PHRASE>
<PHRASE Label="lu_prompt_email" Module="In-Portal" Type="0">RW1haWw=</PHRASE>
<PHRASE Label="lu_prompt_fullimage" Module="In-Portal" Type="0">RnVsbC1TaXplIEltYWdlOg==</PHRASE>
<PHRASE Label="lu_prompt_linkdesc" Module="In-Portal" Type="0">RGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="lu_prompt_linkname" Module="In-Portal" Type="0">TGluayBOYW1l</PHRASE>
<PHRASE Label="lu_prompt_linkurl" Module="In-Portal" Type="0">VVJM</PHRASE>
<PHRASE Label="lu_prompt_metadesc" Module="In-Portal" Type="0">TWV0YSBUYWcgRGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="lu_prompt_metakeywords" Module="In-Portal" Type="0">TWV0YSBUYWcgS2V5d29yZHM=</PHRASE>
<PHRASE Label="lu_prompt_password" Module="In-Portal" Type="0">UGFzc3dvcmQ=</PHRASE>
<PHRASE Label="lu_prompt_perpage_posts" Module="In-Portal" Type="0">UG9zdHMgUGVyIFBhZ2U=</PHRASE>
<PHRASE Label="lu_prompt_perpage_topics" Module="In-Portal" Type="0">VG9waWNzIFBlciBQYWdl</PHRASE>
<PHRASE Label="lu_prompt_post_subject" Module="In-Portal" Type="0">UG9zdCBTdWJqZWN0</PHRASE>
<PHRASE Label="lu_prompt_recommend" Module="In-Portal" Type="0">UmVjb21tZW5kIHRoaXMgc2l0ZSB0byBhIGZyaWVuZA==</PHRASE>
<PHRASE Label="lu_prompt_review" Module="In-Portal" Type="0">UmV2aWV3Og==</PHRASE>
<PHRASE Label="lu_prompt_signature" Module="In-Portal" Type="0">U2lnbmF0dXJl</PHRASE>
<PHRASE Label="lu_prompt_subscribe" Module="In-Portal" Type="0">RW50ZXIgeW91ciBlLW1haWwgYWRkcmVzcyB0byBzdWJzY3JpYmUgdG8gdGhlIG1haWxpbmcgbGlzdC4=</PHRASE>
<PHRASE Label="lu_prompt_thumbnail" Module="In-Portal" Type="0">VGh1bWJuYWlsIEltYWdlOg==</PHRASE>
<PHRASE Label="lu_prompt_username" Module="In-Portal" Type="0">VXNlcm5hbWU=</PHRASE>
<PHRASE Label="lu_public_display" Module="In-Portal" Type="0">RGlzcGxheSB0byBQdWJsaWM=</PHRASE>
<PHRASE Label="lu_query_string" Module="In-Portal" Type="1">UXVlcnkgU3RyaW5n</PHRASE>
<PHRASE Label="lu_QuickSearch" Module="In-Portal" Type="0">UXVpY2sgU2VhcmNo</PHRASE>
<PHRASE Label="lu_quick_links" Module="In-Portal" Type="0">UXVpY2sgTGlua3M=</PHRASE>
<PHRASE Label="lu_quote_reply" Module="In-Portal" Type="0">UmVwbHkgUXVvdGVk</PHRASE>
<PHRASE Label="lu_rateit" Module="In-Portal" Type="0">UmF0ZSBUaGlzIExpbms=</PHRASE>
<PHRASE Label="lu_rate_access_denied" Module="In-Portal" Type="0">VW5hYmxlIHRvIHJhdGUsIGFjY2VzcyBkZW5pZWQ=</PHRASE>
<PHRASE Label="lu_rate_article" Module="In-Portal" Type="0">UmF0ZSB0aGlzIGFydGljbGU=</PHRASE>
<PHRASE Label="lu_rate_link" Module="In-Portal" Type="0">UmF0ZSBMaW5r</PHRASE>
<PHRASE Label="lu_rate_news" Module="In-Portal" Type="0">UmF0ZSBBcnRpY2xl</PHRASE>
<PHRASE Label="lu_rate_this_article" Module="In-Portal" Type="0">UmF0ZSB0aGlzIGFydGljbGU=</PHRASE>
<PHRASE Label="lu_rate_topic" Module="In-Portal" Type="0">UmF0ZSBUb3BpYw==</PHRASE>
<PHRASE Label="lu_rating" Module="In-Portal" Type="0">UmF0aW5n</PHRASE>
<PHRASE Label="lu_rating_0" Module="In-Portal" Type="0">UG9vcg==</PHRASE>
<PHRASE Label="lu_rating_1" Module="In-Portal" Type="0">RmFpcg==</PHRASE>
<PHRASE Label="lu_rating_2" Module="In-Portal" Type="0">QXZlcmFnZQ==</PHRASE>
<PHRASE Label="lu_rating_3" Module="In-Portal" Type="0">R29vZA==</PHRASE>
<PHRASE Label="lu_rating_4" Module="In-Portal" Type="0">VmVyeSBHb29k</PHRASE>
<PHRASE Label="lu_rating_5" Module="In-Portal" Type="0">RXhjZWxsZW50</PHRASE>
<PHRASE Label="lu_rating_alreadyvoted" Module="In-Portal" Type="0">QWxyZWFkeSB2b3RlZA==</PHRASE>
<PHRASE Label="lu_read_error" Module="In-Portal" Type="0">VW5hYmxlIHRvIHJlYWQgZnJvbSBmaWxl</PHRASE>
<PHRASE Label="lu_recipent_required" Module="In-Portal" Type="0">VGhlIHJlY2lwaWVudCBpcyByZXF1aXJlZA==</PHRASE>
<PHRASE Label="lu_recipient_doesnt_exist" Module="In-Portal" Type="0">VXNlciBkb2VzIG5vdCBleGlzdA==</PHRASE>
<PHRASE Label="lu_recipient_doesnt_exit" Module="In-Portal" Type="0">VGhlIHJlY2lwaWVudCBkb2VzIG5vdCBleGlzdA==</PHRASE>
<PHRASE Label="lu_recommend" Module="In-Portal" Type="0">UmVjb21tZW5k</PHRASE>
<PHRASE Label="lu_RecommendToFriend" Module="In-Portal" Type="0">UmVjb21tZW5kIHRvIGEgRnJpZW5k</PHRASE>
<PHRASE Label="lu_recommend_confirm" Module="In-Portal" Type="0">UmVjb21tZW5kYXRpb24gQ29uZmlybWF0aW9u</PHRASE>
<PHRASE Label="lu_recommend_confirm_text" Module="In-Portal" Type="0">VGhhbmtzIGZvciByZWNvbW1lbmRpbmcgb3VyIHNpdGUgdG8geW91ciBmcmllbmQuIFRoZSBlbWFpbCBoYXMgYmVlbiBzZW50IG91dC4=</PHRASE>
<PHRASE Label="lu_recommend_title" Module="In-Portal" Type="0">UmVjb21tZW5kIHRvIGEgZnJpZW5k</PHRASE>
<PHRASE Label="lu_redirecting_text" Module="In-Portal" Type="0">Q2xpY2sgaGVyZSBpZiB5b3VyIGJyb3dzZXIgZG9lcyBub3QgYXV0b21hdGljYWxseSByZWRpcmVjdCB5b3Uu</PHRASE>
<PHRASE Label="lu_redirecting_title" Module="In-Portal" Type="0">UmVkaXJlY3RpbmcgLi4u</PHRASE>
<PHRASE Label="lu_register" Module="In-Portal" Type="0">UmVnaXN0ZXI=</PHRASE>
<PHRASE Label="lu_RegisterConfirm" Module="In-Portal" Type="0">UmVnaXN0cmF0aW9uIENvbmZpcm1hdGlvbg==</PHRASE>
<PHRASE Label="lu_register_confirm" Module="In-Portal" Type="0">UmVnaXN0cmF0aW9uIENvbXBsZXRl</PHRASE>
<PHRASE Label="lu_register_confirm_text" Module="In-Portal" Type="0">VGhhbmsgeW91IGZvciBSZWdpc3RlcmluZyEgIFBsZWFzZSBlbnRlciB5b3VyIHVzZXJuYW1lIGFuZCBwYXNzd29yZCBiZWxvdw==</PHRASE>
<PHRASE Label="lu_register_text" Module="In-Portal" Type="2">UmVnaXN0ZXIgd2l0aCBJbi1Qb3J0YWwgZm9yIGNvbnZlbmllbnQgYWNjZXNzIHRvIHVzZXIgYWNjb3VudCBzZXR0aW5ncyBhbmQgcHJlZmVyZW5jZXMu</PHRASE>
<PHRASE Label="lu_RegistrationCompleted" Module="In-Portal" Type="0">VGhhbmsgWW91LiBSZWdpc3RyYXRpb24gY29tcGxldGVkLg==</PHRASE>
<PHRASE Label="lu_related_articles" Module="In-Portal" Type="0">UmVsYXRlZCBhcnRpY2xlcw==</PHRASE>
<PHRASE Label="lu_related_categories" Module="In-Portal" Type="0">UmVsYXRlZCBDYXRlZ29yaWVz</PHRASE>
<PHRASE Label="lu_related_cats" Module="In-Portal" Type="0">UmVsYXRlZCBDYXRlZ29yaWVz</PHRASE>
<PHRASE Label="lu_related_links" Module="In-Portal" Type="0">UmVsYXRlZCBMaW5rcw==</PHRASE>
<PHRASE Label="lu_related_news" Module="In-Portal" Type="0">UmVsYXRlZCBOZXdz</PHRASE>
<PHRASE Label="lu_remember_login" Module="In-Portal" Type="0">UmVtZW1iZXIgTG9naW4=</PHRASE>
<PHRASE Label="lu_remove" Module="In-Portal" Type="0">UmVtb3Zl</PHRASE>
<PHRASE Label="lu_remove_from_favorites" Module="In-Portal" Type="0">UmVtb3ZlIEZyb20gRmF2b3JpdGVz</PHRASE>
<PHRASE Label="lu_repeat_password" Module="In-Portal" Type="0">UmVwZWF0IFBhc3N3b3Jk</PHRASE>
<PHRASE Label="lu_replies" Module="In-Portal" Type="0">UmVwbGllcw==</PHRASE>
<PHRASE Label="lu_reply" Module="In-Portal" Type="0">UmVwbHk=</PHRASE>
<PHRASE Label="lu_required_field" Module="In-Portal" Type="0">UmVxdWlyZWQgRmllbGQ=</PHRASE>
<PHRASE Label="lu_reset" Module="In-Portal" Type="0">UmVzZXQ=</PHRASE>
<PHRASE Label="lu_resetpw_confirm_text" Module="In-Portal" Type="0">QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIHJlc2V0IHRoZSBwYXNzd29yZD8=</PHRASE>
<PHRASE Label="lu_reset_confirm_text" Module="In-Portal" Type="0">UGxlYXNlIGNvbmZpcm0gdGhhdCB5b3Ugd2FudCB0byByZXNldCB5b3VyIHBhc3N3b3JkLg==</PHRASE>
<PHRASE Label="lu_reviews" Module="In-Portal" Type="0">UmV2aWV3cw==</PHRASE>
<PHRASE Label="lu_reviews_updated" Module="In-Portal" Type="0">cmV2aWV3cyB1cGRhdGVk</PHRASE>
<PHRASE Label="lu_review_access_denied" Module="In-Portal" Type="0">VW5hYmxlIHRvIHJldmlldywgYWNjZXNzIGRlbmllZA==</PHRASE>
<PHRASE Label="lu_review_article" Module="In-Portal" Type="0">UmV2aWV3IGFydGljbGU=</PHRASE>
<PHRASE Label="lu_review_link" Module="In-Portal" Type="0">UmV2aWV3IExpbms=</PHRASE>
<PHRASE Label="lu_review_news" Module="In-Portal" Type="0">UmV2aWV3IG5ld3MgYXJ0aWNsZQ==</PHRASE>
<PHRASE Label="lu_review_this_article" Module="In-Portal" Type="0">UmV2aWV3IHRoaXMgYXJ0aWNsZQ==</PHRASE>
<PHRASE Label="lu_rootcategory_name" Module="In-Portal" Type="0">SG9tZQ==</PHRASE>
<PHRASE Label="lu_search" Module="In-Portal" Type="0">U2VhcmNo</PHRASE>
<PHRASE Label="lu_searched_for" Module="In-Portal" Type="0">U2VhcmNoZWQgRm9yOg==</PHRASE>
<PHRASE Label="lu_SearchProducts" Module="In-Portal" Type="0">U2VhcmNoIFByb2R1Y3Rz</PHRASE>
<PHRASE Label="lu_searchtitle_article" Module="In-Portal" Type="0">U2VhcmNoIEFydGljbGVz</PHRASE>
<PHRASE Label="lu_searchtitle_category" Module="In-Portal" Type="0">U2VhcmNoIENhdGVnb3JpZXM=</PHRASE>
<PHRASE Label="lu_searchtitle_link" Module="In-Portal" Type="0">U2VhcmNoIExpbmtz</PHRASE>
<PHRASE Label="lu_searchtitle_topic" Module="In-Portal" Type="0">U2VhcmNoIFRvcGljcw==</PHRASE>
<PHRASE Label="lu_search_again" Module="In-Portal" Type="0">U2VhcmNoIEFnYWlu</PHRASE>
<PHRASE Label="lu_search_error" Module="In-Portal" Type="0">Rm9ybSBFcnJvcg==</PHRASE>
<PHRASE Label="lu_search_results" Module="In-Portal" Type="0">U2VhcmNoIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_search_tips_link" Module="In-Portal" Type="0">U2VhcmNoIFRpcHM=</PHRASE>
<PHRASE Label="lu_search_type" Module="In-Portal" Type="0">U2VhcmNoIFR5cGU=</PHRASE>
<PHRASE Label="lu_search_within" Module="In-Portal" Type="0">U2VhcmNoIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_see_also" Module="In-Portal" Type="0">U2VlIEFsc28=</PHRASE>
<PHRASE Label="lu_select_language" Module="In-Portal" Type="0">U2VsZWN0IExhbmd1YWdl</PHRASE>
<PHRASE Label="lu_select_theme" Module="In-Portal" Type="0">U2VsZWN0IFRoZW1l</PHRASE>
<PHRASE Label="lu_select_username" Module="In-Portal" Type="0">U2VsZWN0IFVzZXJuYW1l</PHRASE>
<PHRASE Label="lu_send" Module="In-Portal" Type="0">U2VuZA==</PHRASE>
<PHRASE Label="lu_send_pm" Module="In-Portal" Type="0">U2VuZCBQcml2YXRlIE1lc3NhZ2U=</PHRASE>
<PHRASE Label="lu_sent" Module="In-Portal" Type="0">U2VudA==</PHRASE>
<PHRASE Label="lu_Sep" Module="In-Portal" Type="0">U2Vw</PHRASE>
<PHRASE Label="lu_ShoppingCart" Module="In-Portal" Type="0">U2hvcHBpbmcgQ2FydA==</PHRASE>
<PHRASE Label="lu_show" Module="In-Portal" Type="0">U2hvdw==</PHRASE>
<PHRASE Label="lu_show_signature" Module="In-Portal" Type="0">U2hvdyBTaWduYXR1cmU=</PHRASE>
<PHRASE Label="lu_show_user_signatures" Module="In-Portal" Type="0">U2hvdyBNeSBTaWduYXR1cmU=</PHRASE>
<PHRASE Label="lu_SiteLead_Story" Module="In-Portal" Type="0">U2l0ZSBMZWFkIFN0b3J5</PHRASE>
<PHRASE Label="lu_site_map" Module="In-Portal" Type="0">U2l0ZSBNYXA=</PHRASE>
<PHRASE Label="lu_smileys" Module="In-Portal" Type="0">U21pbGV5cw==</PHRASE>
<PHRASE Label="lu_sorted_list" Module="In-Portal" Type="0">U29ydGVkIGxpc3Q=</PHRASE>
<PHRASE Label="lu_sort_by" Module="In-Portal" Type="0">U29ydA==</PHRASE>
<PHRASE Label="lu_state" Module="In-Portal" Type="0">U3RhdGU=</PHRASE>
<PHRASE Label="lu_street" Module="In-Portal" Type="0">U3RyZWV0</PHRASE>
<PHRASE Label="lu_street2" Module="In-Portal" Type="0">U3RyZWV0IDI=</PHRASE>
<PHRASE Label="lu_subaction_prompt" Module="In-Portal" Type="0">QWxzbyBZb3UgQ2FuOg==</PHRASE>
<PHRASE Label="lu_subcats" Module="In-Portal" Type="0">U3ViY2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="lu_subject" Module="In-Portal" Type="0">U3ViamVjdA==</PHRASE>
<PHRASE Label="lu_submitting_to" Module="In-Portal" Type="0">U3VibWl0dGluZyB0bw==</PHRASE>
<PHRASE Label="lu_subscribe_banned" Module="In-Portal" Type="0">U3Vic2NyaXB0aW9uIGRlbmllZA==</PHRASE>
<PHRASE Label="lu_subscribe_confirm" Module="In-Portal" Type="0">U3Vic2NyaXB0aW9uIENvbmZpcm1hdGlvbg==</PHRASE>
<PHRASE Label="lu_subscribe_confirm_prompt" Module="In-Portal" Type="0">QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIHN1YnNjcmliZSB0byBvdXIgbWFpbGluZyBsaXN0PyAoWW91IGNhbiB1bnN1YnNjcmliZSBhbnkgdGltZSBieSBlbnRlcmluZyB5b3VyIGVtYWlsIG9uIHRoZSBmcm9udCBwYWdlKS4=</PHRASE>
<PHRASE Label="lu_subscribe_confirm_text" Module="In-Portal" Type="0">VGhhbmsgeW91IGZvciBzdWJzY3JpYmluZyB0byBvdXIgbWFpbGluZyBsaXN0IQ==</PHRASE>
<PHRASE Label="lu_subscribe_error" Module="In-Portal" Type="0">Rm9ybSBFcnJvcg==</PHRASE>
<PHRASE Label="lu_subscribe_missing_address" Module="In-Portal" Type="0">TWlzc2luZyBlbWFpbCBhZGRyZXNz</PHRASE>
<PHRASE Label="lu_subscribe_no_address" Module="In-Portal" Type="0">RS1tYWlsIGFkZHJlc3MgbWlzc2luZyBvciBpbnZhbGlk</PHRASE>
<PHRASE Label="lu_subscribe_success" Module="In-Portal" Type="0">U3Vic2NyaXB0aW9uIHN1Y2Nlc3NmdWw=</PHRASE>
<PHRASE Label="lu_subscribe_title" Module="In-Portal" Type="0">U3Vic2NyaWJlZA==</PHRASE>
<PHRASE Label="lu_subscribe_unknown_error" Module="In-Portal" Type="0">VW5kZWZpbmVkIGVycm9yIG9jY3VycmVkLCBzdWJzY3JpcHRpb24gbm90IGNvbXBsZXRlZA==</PHRASE>
<PHRASE Label="lu_suggest_category" Module="In-Portal" Type="0">U3VnZ2VzdCBDYXRlZ29yeQ==</PHRASE>
<PHRASE Label="lu_suggest_category_pending" Module="In-Portal" Type="0">Q2F0ZWdvcnkgU3VnZ2VzdGVkIChQZW5kaW5nIEFwcHJvdmFsKQ==</PHRASE>
<PHRASE Label="lu_suggest_error" Module="In-Portal" Type="0">Rm9ybSBFcnJvcg==</PHRASE>
<PHRASE Label="lu_suggest_link" Module="In-Portal" Type="0">U3VnZ2VzdCBMaW5r</PHRASE>
<PHRASE Label="lu_suggest_no_address" Module="In-Portal" Type="0">RS1tYWlsIGFkZHJlc3MgbWlzc2luZyBvciBpbnZhbGlk</PHRASE>
<PHRASE Label="lu_suggest_success" Module="In-Portal" Type="0">VGhhbmsgeW91IGZvciBzdWdnZXN0aW5nIG91ciBzaXRlIHRv</PHRASE>
<PHRASE Label="lu_template_error" Module="In-Portal" Type="0">VGVtcGxhdGUgRXJyb3I=</PHRASE>
<PHRASE Label="lu_TextUnsubscribe" Module="In-Portal" Type="0">IFdlIGFyZSBzb3JyeSB5b3UgaGF2ZSB1bnN1YnNjcmliZWQgZnJvbSBvdXIgbWFpbGluZyBsaXN0</PHRASE>
<PHRASE Label="lu_text_keyword" Module="In-Portal" Type="0">S2V5d29yZA==</PHRASE>
<PHRASE Label="lu_text_PasswordRequestConfirm" Module="In-Portal" Type="0">UGxlYXNlIGNvbmZpcm0gdGhhdCB5b3Ugd2FudCB0byByZXNldCB5b3VyIHBhc3N3b3JkLg==</PHRASE>
<PHRASE Label="lu_ThankForSubscribing" Module="In-Portal" Type="0">VGhhbmsgeW91IGZvciBzdWJzY3JpYmluZyB0byBvdXIgbWFpbGluZyBsaXN0</PHRASE>
<PHRASE Label="lu_title_confirm" Module="In-Portal" Type="0">Q29uZmlybWF0aW9u</PHRASE>
<PHRASE Label="lu_title_mailinglist" Module="In-Portal" Type="0">TWFpbGluZyBMaXN0</PHRASE>
<PHRASE Label="lu_title_PasswordRequestConfirm" Module="In-Portal" Type="0">UGFzc3dvcmQgUmVxdWVzdCBDb25maXJtYXRpb24=</PHRASE>
<PHRASE Label="lu_to" Module="In-Portal" Type="0">VG8=</PHRASE>
<PHRASE Label="lu_top" Module="In-Portal" Type="0">VG9wIFJhdGVk</PHRASE>
<PHRASE Label="lu_topics" Module="In-Portal" Type="0">VG9waWNz</PHRASE>
<PHRASE Label="lu_topics_updated" Module="In-Portal" Type="0">VG9waWNzIFVwZGF0ZWQ=</PHRASE>
<PHRASE Label="lu_topic_rate_confirm" Module="In-Portal" Type="0">VG9waWMgUmF0aW5nIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_topic_rate_confirm_duplicate_text" Module="In-Portal" Type="0">WW91IGhhdmUgYWxyZWFkeSByYXRlZCB0aGlzIHRvcGlj</PHRASE>
<PHRASE Label="lu_topic_rate_confirm_text" Module="In-Portal" Type="0">VGhhbmsgeW91IGZvciB2b3RpbmchICBZb3VyIGlucHV0IGhhcyBiZWVuIHJlY29yZGVkLg==</PHRASE>
<PHRASE Label="lu_topic_reply" Module="In-Portal" Type="0">UG9zdCBSZXBseQ==</PHRASE>
<PHRASE Label="lu_topic_search_results" Module="In-Portal" Type="0">VG9waWMgU2VhcmNoIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_topic_updated" Module="In-Portal" Type="0">VG9waWMgVXBkYXRlZA==</PHRASE>
<PHRASE Label="lu_top_rated" Module="In-Portal" Type="0">VG9wIFJhdGVkIExpbmtz</PHRASE>
<PHRASE Label="lu_total_categories" Module="In-Portal" Type="0">VG90YWwgQ2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="lu_total_links" Module="In-Portal" Type="0">VG90YWwgbGlua3MgaW4gdGhlIGRhdGFiYXNl</PHRASE>
<PHRASE Label="lu_total_news" Module="In-Portal" Type="0">VG90YWwgQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="lu_total_topics" Module="In-Portal" Type="0">VG90YWwgVG9waWNz</PHRASE>
<PHRASE Label="lu_true" Module="In-Portal" Type="0">VHJ1ZQ==</PHRASE>
<PHRASE Label="lu_unknown_error" Module="In-Portal" Type="0">U3lzdGVtIGVycm9yIGhhcyBvY2N1cmVk</PHRASE>
<PHRASE Label="lu_unsorted_list" Module="In-Portal" Type="0">VW5zb3J0ZWQgbGlzdA==</PHRASE>
<PHRASE Label="lu_unsubscribe_confirm" Module="In-Portal" Type="0">VW5zdWJzY3JpcHRpb24gQ29uZmlybWF0aW9u</PHRASE>
<PHRASE Label="lu_unsubscribe_confirm_prompt" Module="In-Portal" Type="0">QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIHVuc3Vic2NyaWJlIGZyb20gb3VyIG1haWxpbmcgbGlzdD8gKFlvdSBjYW4gYWx3YXlzIHN1YnNjcmliZSBhZ2FpbiBieSBlbnRlcmluZyB5b3VyIGVtYWlsIGF0IHRoZSBob21lIHBhZ2Up</PHRASE>
<PHRASE Label="lu_unsubscribe_confirm_text" Module="In-Portal" Type="0">V2UgYXJlIHNvcnJ5IHlvdSBoYXZlIHVuc3Vic2NyaWJlZCBmcm9tIG91ciBtYWlsaW5nIGxpc3Q=</PHRASE>
<PHRASE Label="lu_unsubscribe_title" Module="In-Portal" Type="0">VW5zdWJzY3JpYmU=</PHRASE>
<PHRASE Label="lu_update" Module="In-Portal" Type="0">VXBkYXRl</PHRASE>
<PHRASE Label="lu_username" Module="In-Portal" Type="0">VXNlcm5hbWU=</PHRASE>
<PHRASE Label="lu_users_online" Module="In-Portal" Type="0">VXNlcnMgT25saW5l</PHRASE>
<PHRASE Label="lu_user_already_exist" Module="In-Portal" Type="0">QSB1c2VyIHdpdGggc3VjaCB1c2VybmFtZSBhbHJlYWR5IGV4aXN0cy4=</PHRASE>
<PHRASE Label="lu_user_and_email_already_exist" Module="In-Portal" Type="0">QSB1c2VyIHdpdGggc3VjaCB1c2VybmFtZS9lLW1haWwgYWxyZWFkeSBleGlzdHMu</PHRASE>
<PHRASE Label="lu_user_exists" Module="In-Portal" Type="0">VXNlciBhbHJlYWR5IGV4aXN0cw==</PHRASE>
<PHRASE Label="lu_user_pending_aproval" Module="In-Portal" Type="0">UGVuZGluZyBSZWdpc3RyYXRpb24gQ29tcGxldGU=</PHRASE>
<PHRASE Label="lu_user_pending_aproval_text" Module="In-Portal" Type="0">VGhhbmsgeW91IGZvciByZWdpc3RlcmluZy4gWW91ciByZWdpc3RyYXRpb24gaXMgcGVuZGluZyBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbC4=</PHRASE>
<PHRASE Label="lu_VerifyPassword" Module="In-Portal" Type="0">VmVyaWZ5IHBhc3N3b3Jk</PHRASE>
<PHRASE Label="lu_views" Module="In-Portal" Type="0">Vmlld3M=</PHRASE>
<PHRASE Label="lu_view_flat" Module="In-Portal" Type="0">VmlldyBGbGF0</PHRASE>
<PHRASE Label="lu_view_pm" Module="In-Portal" Type="0">VmlldyBQTQ==</PHRASE>
<PHRASE Label="lu_view_profile" Module="In-Portal" Type="0">VmlldyBVc2VyIFByb2ZpbGU=</PHRASE>
<PHRASE Label="lu_view_threaded" Module="In-Portal" Type="0">VmlldyBUaHJlYWRlZA==</PHRASE>
<PHRASE Label="lu_view_your_profile" Module="In-Portal" Type="0">VmlldyBZb3VyIFByb2ZpbGU=</PHRASE>
<PHRASE Label="lu_visit_DirectReferer" Module="In-Portal" Type="0">RGlyZWN0IGFjY2VzcyBvciBib29rbWFyaw==</PHRASE>
<PHRASE Label="lu_votes" Module="In-Portal" Type="0">Vm90ZXM=</PHRASE>
<PHRASE Label="lu_Warning" Module="In-Portal" Type="0">V2FybmluZw==</PHRASE>
<PHRASE Label="lu_WeAcceptCards" Module="In-Portal" Type="0">V2UgYWNjZXB0IGNyZWRpdCBjYXJkcw==</PHRASE>
<PHRASE Label="lu_wrote" Module="In-Portal" Type="0">d3JvdGU=</PHRASE>
<PHRASE Label="lu_yes" Module="In-Portal" Type="0">WWVz</PHRASE>
<PHRASE Label="lu_YourAccount" Module="In-Portal" Type="0">WW91ciBBY2NvdW50</PHRASE>
<PHRASE Label="lu_YourCart" Module="In-Portal" Type="0">U2hvcHBpbmcgQ2FydA==</PHRASE>
<PHRASE Label="lu_YourCurrency" Module="In-Portal" Type="0">WW91ciBjdXJyZW5jeQ==</PHRASE>
<PHRASE Label="lu_YourLanguage" Module="In-Portal" Type="0">WW91ciBMYW5ndWFnZQ==</PHRASE>
<PHRASE Label="lu_YourWishList" Module="In-Portal" Type="0">WW91ciBXaXNoIExpc3Q=</PHRASE>
<PHRASE Label="lu_zip" Module="In-Portal" Type="0">Wmlw</PHRASE>
<PHRASE Label="lu_ZipCode" Module="In-Portal" Type="0">WklQIENvZGU=</PHRASE>
<PHRASE Label="lu_zip_code" Module="In-Portal" Type="0">WklQIENvZGU=</PHRASE>
<PHRASE Label="lu_zoom" Module="In-Portal" Type="0">Wm9vbQ==</PHRASE>
<PHRASE Label="my_account_title" Module="In-Portal" Type="0">TXkgU2V0dGluZ3M=</PHRASE>
<PHRASE Label="Next Theme" Module="In-Portal" Type="0">TmV4dCBUaGVtZQ==</PHRASE>
<PHRASE Label="Previous Theme" Module="In-Portal" Type="0">UHJldmlvdXMgVGhlbWU=</PHRASE>
<PHRASE Label="test 1" Module="In-Portal" Type="0">dGVzdCAy</PHRASE>
</PHRASES>
<EVENTS>
<EVENT MessageType="text" Event="CATEGORY.ADD" Type="0">U3ViamVjdDogQ2F0ZWdvcnkgYWRkZWQKCllvdXIgc3VnZ2VzdGVkIGNhdGVnb3J5ICI8aW5wOm1fY2F0ZWdvcnlfZmllbGQgX0ZpZWxkPSJOYW1lIiBfU3RyaXBIVE1MPSIxIi8+IiBoYXMgYmVlbiBhZGRlZC4=</EVENT>
<EVENT MessageType="text" Event="CATEGORY.ADD" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBhZGRlZAoKQSBjYXRlZ29yeSAiPGlucDptX2NhdGVnb3J5X2ZpZWxkIF9GaWVsZD0iTmFtZSIgX1N0cmlwSFRNTD0iMSIvPiIgaGFzIGJlZW4gYWRkZWQu</EVENT>
<EVENT MessageType="text" Event="CATEGORY.ADD.PENDING" Type="0"></EVENT>
<EVENT MessageType="text" Event="CATEGORY.ADD.PENDING" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQ2F0ZWdvcnkgYWRkZWQgKHBlbmRpbmcpCgpBIGNhdGVnb3J5ICI8aW5wOm1fY2F0ZWdvcnlfZmllbGQgX0ZpZWxkPSJOYW1lIiBfU3RyaXBIVE1MPSIxIi8+IiBoYXMgYmVlbiBhZGRlZCwgcGVuZGluZyB5b3VyIGNvbmZpcm1hdGlvbi4gIFBsZWFzZSByZXZpZXcgdGhlIGNhdGVnb3J5IGFuZCBhcHByb3ZlIG9yIGRlbnkgaXQu</EVENT>
<EVENT MessageType="text" Event="CATEGORY.APPROVE" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBhcHByb3ZlZAoKWW91ciBzdWdnZXN0ZWQgY2F0ZWdvcnkgIjxpbnA6bV9jYXRlZ29yeV9maWVsZCBfRmllbGQ9Ik5hbWUiIF9TdHJpcEhUTUw9IjEiLz4iIGhhcyBiZWVuIGFwcHJvdmVkLg==</EVENT>
<EVENT MessageType="text" Event="CATEGORY.APPROVE" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBhcHByb3ZlZAoKQSBjYXRlZ29yeSAiPGlucDptX2NhdGVnb3J5X2ZpZWxkIF9GaWVsZD0iTmFtZSIgX1N0cmlwSFRNTD0iMSIvPiIgaGFzIGJlZW4gYXBwcm92ZWQu</EVENT>
<EVENT MessageType="text" Event="CATEGORY.DELETE" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBkZWxldGVkCgpBIGNhdGVnb3J5ICI8aW5wOm1fY2F0ZWdvcnlfZmllbGQgX0ZpZWxkPSJOYW1lIiBfU3RyaXBIVE1MPSIxIi8+IiBoYXMgYmVlbiBkZWxldGVkLg==</EVENT>
<EVENT MessageType="text" Event="CATEGORY.DELETE" Type="1">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IEEgY2F0ZWdvcnkgaGFzIGJlZW4gZGVsZXRlZAoKQSBjYXRlZ29yeSAiPGlucDptX2NhdGVnb3J5X2ZpZWxkIF9GaWVsZD0iTmFtZSIgX1N0cmlwSFRNTD0iMSIvPiIgaGFzIGJlZW4gZGVsZXRlZC4=</EVENT>
<EVENT MessageType="text" Event="CATEGORY.DENY" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBkZW5pZWQKCllvdXIgY2F0ZWdvcnkgc3VnZ2VzdGlvbiAiPGlucDptX2NhdGVnb3J5X2ZpZWxkIF9GaWVsZD0iTmFtZSIgX1N0cmlwSFRNTD0iMSIvPiIgaGFzIGJlZW4gZGVuaWVkLg==</EVENT>
<EVENT MessageType="text" Event="CATEGORY.DENY" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBkZW5pZWQKCkEgY2F0ZWdvcnkgIjxpbnA6bV9jYXRlZ29yeV9maWVsZCBfRmllbGQ9Ik5hbWUiIF9TdHJpcEhUTUw9IjEiLz4iIGhhcyBiZWVuIGRlbmllZC4=</EVENT>
<EVENT MessageType="text" Event="CATEGORY.MODIFY" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBtb2RpZmllZAoKWW91ciBzdWdnZXN0ZWQgY2F0ZWdvcnkgIjxpbnA6bV9jYXRlZ29yeV9maWVsZCBfRmllbGQ9Ik5hbWUiIF9TdHJpcEhUTUw9IjEiLz4iIGhhcyBiZWVuIG1vZGlmaWVkLg==</EVENT>
<EVENT MessageType="text" Event="CATEGORY.MODIFY" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBtb2RpZmllZAoKQSBjYXRlZ29yeSAiPGlucDptX2NhdGVnb3J5X2ZpZWxkIF9GaWVsZD0iTmFtZSIgX1N0cmlwSFRNTD0iMSIvPiIgaGFzIGJlZW4gbW9kaWZpZWQu</EVENT>
<EVENT MessageType="html" Event="COMMON.FOOTER" Type="1">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IENvbW1vbiBGb290ZXIgVGVtcGxhdGUKCg==</EVENT>
<EVENT MessageType="text" Event="USER.ADD" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogSW4tcG9ydGFsIHJlZ2lzdHJhdGlvbgoKRGVhciA8aW5wOnRvdXNlciBfRmllbGQ9IkZpcnN0TmFtZSIgLz4gPGlucDp0b3VzZXIgX0ZpZWxkPSJMYXN0TmFtZSIgLz4sDQoNClRoYW5rIHlvdSBmb3IgcmVnaXN0ZXJpbmcgb24gPGlucDptX3BhZ2VfdGl0bGUgLz4uIFlvdXIgcmVnaXN0cmF0aW9uIGlzIG5vdyBhY3RpdmUu</EVENT>
<EVENT MessageType="text" Event="USER.ADD" Type="1">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IE5ldyB1c2VyIGhhcyBiZWVuIGFkZGVkCgpBIG5ldyB1c2VyICI8aW5wOnRvdXNlciBfRmllbGQ9IkxvZ2luIiAvPiIgaGFzIGJlZW4gYWRkZWQu</EVENT>
<EVENT MessageType="text" Event="USER.ADD.PENDING" Type="0">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IEluLVBvcnRhbCBSZWdpc3RyYXRpb24KCkRlYXIgPGlucDp0b3VzZXIgX0ZpZWxkPSJGaXJzdE5hbWUiIC8+IDxpbnA6dG91c2VyIF9GaWVsZD0iTGFzdE5hbWUiIC8+LA0KDQpUaGFuayB5b3UgZm9yIHJlZ2lzdGVyaW5nIG9uIDxpbnA6bV9wYWdlX3RpdGxlIC8+LiBZb3VyIHJlZ2lzdHJhdGlvbiB3aWxsIGJlIGFjdGl2ZSBhZnRlciBhcHByb3ZhbC4=</EVENT>
<EVENT MessageType="text" Event="USER.ADD.PENDING" Type="1">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IFVzZXIgcmVnaXN0ZXJlZAoKQSBuZXcgdXNlciAiPGlucDp0b3VzZXIgX0ZpZWxkPSJMb2dpbiIgLz4iIGhhcyByZWdpc3RlcmVkIGFuZCBpcyBwZW5kaW5nIGFkbWluaXN0cmF0aXZlIGFwcHJvdmFsLg==</EVENT>
<EVENT MessageType="text" Event="USER.APPROVE" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogWW91IGhhdmUgYmVlbiBhcHByb3ZlZAoKV2VsY29tZSB0byBJbi1wb3J0YWwhDQpZb3VyIHVzZXIgcmVnaXN0cmF0aW9uIGhhcyBiZWVuIGFwcHJvdmVkLiBZb3VyIHVzZXIgbmFtZSBpcyAiPGlucDp0b3VzZXIgX0ZpZWxkPSJVc2VyTmFtZSIgLz4iLg==</EVENT>
<EVENT MessageType="text" Event="USER.APPROVE" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVXNlciBhcHByb3ZlZAoKVXNlciAiPGlucDp0b3VzZXIgX0ZpZWxkPSJVc2VyTmFtZSIgLz4iIGhhcyBiZWVuIGFwcHJvdmVkLg==</EVENT>
<EVENT MessageType="text" Event="USER.DENY" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQWNjZXNzIGRlbmllZAoKWW91ciByZWdpc3RyYXRpb24gdG8gPGlucDptX3BhZ2VfdGl0bGUgLz4gaGFzIGJlZW4gZGVuaWVkLg==</EVENT>
<EVENT MessageType="text" Event="USER.DENY" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVXNlciBkZW5pZWQKClVzZXIgIjxpbnA6dG91c2VyIF9GaWVsZD0iVXNlck5hbWUiIC8+IiBoYXMgYmVlbiBkZW5pZWQu</EVENT>
<EVENT MessageType="text" Event="USER.MEMBERSHIP.EXPIRATION.NOTICE" Type="0">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IE1lbWJlcnNoaXAgZXhwaXJhdGlvbiBub3RpY2UKCk1lbWJlcnNoaXAgZXhwaXJhdGlvbiBub3RpY2U=</EVENT>
<EVENT MessageType="text" Event="USER.MEMBERSHIP.EXPIRATION.NOTICE" Type="1">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IE1lbWJlcnNoaXAgZXhwaXJhdGlvbiBub3RpY2UKCk1lbWJlcnNoaXAgZXhwaXJhdGlvbiBub3RpY2U=</EVENT>
<EVENT MessageType="text" Event="USER.MEMBERSHIP.EXPIRED" Type="0">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IE1lbWJlcnNoaXAgZXhwaXJlZAoKTWVtYmVyc2hpcCBleHBpcmVk</EVENT>
<EVENT MessageType="text" Event="USER.MEMBERSHIP.EXPIRED" Type="1">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IE1lbWJlcnNoaXAgZXhwaXJlZAoKTWVtYmVyc2hpcCBleHBpcmVk</EVENT>
<EVENT MessageType="text" Event="USER.PSWD" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTG9zdCBwYXNzd29yZAoKWW91ciBsb3N0IHBhc3N3b3JkIGhhcyBiZWVuIHJlc2V0LiBZb3VyIG5ldyBwYXNzd29yZCBpczogIjxpbnA6dG91c2VyIF9GaWVsZD0iUGFzc3dvcmQiIC8+Ii4=</EVENT>
<EVENT MessageType="text" Event="USER.PSWD" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTG9zdCBwYXNzd29yZAoKWW91ciBsb3N0IHBhc3N3b3JkIGhhcyBiZWVuIHJlc2V0LiBZb3VyIG5ldyBwYXNzd29yZCBpczogIjxpbnA6dG91c2VyIF9GaWVsZD0iUGFzc3dvcmQiIC8+Ii4=</EVENT>
<EVENT MessageType="text" Event="USER.PSWDC" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogUGFzc3dvcmQgcmVzZXQgY29uZmlybWF0aW9uCgpIZWxsbywNCg0KSXQgc2VlbXMgdGhhdCB5b3UgaGF2ZSByZXF1ZXN0ZWQgYSBwYXNzd29yZCByZXNldCBmb3IgeW91ciBJbi1wb3J0YWwgYWNjb3VudC4gSWYgeW91IHdvdWxkIGxpa2UgdG8gcHJvY2VlZCBhbmQgY2hhbmdlIHRoZSBwYXNzd29yZCwgcGxlYXNlIGNsaWNrIG9uIHRoZSBsaW5rIGJlbG93Og0KPGlucDptX2NvbmZpcm1fcGFzc3dvcmRfbGluayAvPg0KDQpZb3Ugd2lsbCByZWNlaXZlIGEgc2Vjb25kIGVtYWlsIHdpdGggeW91ciBuZXcgcGFzc3dvcmQgc2hvcnRseS4NCg0KSWYgeW91IGJlbGlldmUgeW91IGhhdmUgcmVjZWl2ZWQgdGhpcyBlbWFpbCBpbiBlcnJvciwgcGxlYXNlIGlnbm9yZSB0aGlzIGVtYWlsLiBZb3VyIHBhc3N3b3JkIHdpbGwgbm90IGJlIGNoYW5nZWQgdW5sZXNzIHlvdSBoYXZlIGNsaWNrZWQgb24gdGhlIGFib3ZlIGxpbmsuDQo=</EVENT>
<EVENT MessageType="text" Event="USER.SUBSCRIBE" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogU3Vic2NyaXB0aW9uIGNvbmZpcm1hdGlvbgoKWW91IGhhdmUgc3Vic2NyaWJlZCB0byA8aW5wOm1fcGFnZV90aXRsZSAvPiBtYWlsaW5nIGxpc3Qu</EVENT>
<EVENT MessageType="text" Event="USER.SUBSCRIBE" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSB1c2VyIGhhcyBzdWJzY3JpYmVkCgpBIHVzZXIgaGFzIHN1YnNjcmliZWQgdG8gPGlucDptX3BhZ2VfdGl0bGUgLz4gbWFpbGluZyBsaXN0Lg==</EVENT>
<EVENT MessageType="html" Event="USER.SUGGEST" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQ2hlY2sgb3V0IHRoaXMgc2l0ZQoKSGksDQoNClRoaXMgbWVzc2FnZSBoYXMgYmVlbiBzZW50IHRvIHlvdSBmcm9tIG9uZSBvZiB5b3VyIGZyaWVuZHMuDQpDaGVjayBvdXQgdGhpcyBzaXRlOiA8YSBocmVmPSI8aW5wOm1fdGhlbWVfdXJsIF9wYWdlPSJjdXJyZW50Ii8+Ij48aW5wOm1fcGFnZV90aXRsZSAvPjwvYT4h</EVENT>
<EVENT MessageType="text" Event="USER.SUGGEST" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVGhlIHNpdGUgaGFzIGJlZW4gc3VnZ2VzdGVkCgpBIHZpc2l0b3Igc3VnZ2VzdGVkIHlvdXIgc2l0ZSB0byBhIGZyaWVuZC4=</EVENT>
<EVENT MessageType="text" Event="USER.UNSUBSCRIBE" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogWW91IGhhdmUgYmVlbiB1bnN1YnNjcmliZWQKCllvdSBoYXZlIHN1Y2Nlc3NmdWxseSB1bnN1YnNyaWJlZCBmcm9tIDxpbnA6bV9wYWdlX3RpdGxlIC8+IG1haWxpbmcgbGlzdC4=</EVENT>
<EVENT MessageType="text" Event="USER.UNSUBSCRIBE" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVXNlciB1bnN1YnNyaWJlZAoKQSB1c2VyIGhhcyB1bnN1YnNjcmliZWQu</EVENT>
- <EVENT MessageType="text" Event="USER.VALIDATE" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogSW4tcG9ydGFsIHJlZ2lzdHJhdGlvbgoKV2VsY29tZSB0byBJbi1wb3J0YWwhDQpZb3VyIHVzZXIgcmVnaXN0cmF0aW9uIGhhcyBiZWVuIGFwcHJvdmVkLiBZb3VyIHVzZXIgbmFtZSBpcyAiPGlucDp0b3VzZXIgX0ZpZWxkPSJVc2VyTmFtZSIgLz4iIGFuZCB5b3VyIHBhc3N3b3JkIGlzICI8aW5wOnRvdXNlciBfRmllbGQ9InBhc3N3b3JkIiAvPiIuDQo=</EVENT>
+ <EVENT MessageType="text" Event="USER.VALIDATE" Type="0">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IEluLXBvcnRhbCByZWdpc3RyYXRpb24KCldlbGNvbWUgdG8gSW4tcG9ydGFsIQ0KWW91ciB1c2VyIHJlZ2lzdHJhdGlvbiBoYXMgYmVlbiBhcHByb3ZlZC4gWW91ciB1c2VyIG5hbWUgaXMgIjxpbnA6dG91c2VyIF9GaWVsZD0iVXNlck5hbWUiIC8+IiBhbmQgeW91ciBwYXNzd29yZCBpcyAiPGlucDp0b3VzZXIgX0ZpZWxkPSJwYXNzd29yZCIgLz4iLg0K</EVENT>
<EVENT MessageType="text" Event="USER.VALIDATE" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVXNlciB2YWxpZGF0ZWQKClVzZXIgIjxpbnA6dG91c2VyIF9GaWVsZD0iVXNlck5hbWUiIC8+IiBoYXMgYmVlbiB2YWxpZGF0ZWQu</EVENT>
</EVENTS>
</LANGUAGE>
</LANGUAGES>
\ No newline at end of file
Property changes on: trunk/admin/install/langpacks/english.lang
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.100
\ No newline at end of property
+1.101
\ No newline at end of property
Index: trunk/core/kernel/event_manager.php
===================================================================
--- trunk/core/kernel/event_manager.php (revision 7634)
+++ trunk/core/kernel/event_manager.php (revision 7635)
@@ -1,549 +1,549 @@
<?php
define('hBEFORE', 1);
define('hAFTER', 2);
define('reBEFORE', 1);
define('reAFTER', 2);
class kEventManager extends kBase {
/**
* Connection to database
*
* @var kDBConnection
* @access public
*/
var $Conn;
/**
* Cache of QueryString parameters
* from config, that are represented
* in enviroment variable
*
* @var Array
*/
var $queryMaps = Array();
/**
* Build events registred for
* pseudo classes. key - pseudo class
* value - event name
*
* @var Array
* @access private
*/
var $buildEvents=Array();
/**
* Events, that should be run before parser initialization
*
* @var Array
*/
var $beforeRegularEvents = Array();
/**
* Events, that should be run after parser initialization
*
* @var Array
*/
var $afterRegularEvents = Array();
/**
* Holds before hooks
* key - prefix.event (to link to)
* value - hooked event info
*
* @var Array
* @access private
*/
var $beforeHooks=Array();
/**
* Holds after hooks
* key - prefix.event (to link to)
* value - hooked event info
*
* @var Array
* @access private
*/
var $afterHooks = Array();
var $recursionStack = Array();
function kEventManager()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
/**
* Set's new enviroment parameter mappings
* between their names as application vars
*
* @param Array $new_query_maps
* @access public
*/
/*function setQueryMaps($new_query_maps)
{
$this->queryMaps = $new_query_maps;
}*/
/**
* Adds new query map to already parsed query maps
*
* @param string $prefix
*/
function setQueryMap($prefix_special)
{
list($prefix) = explode('.', $prefix_special);
$query_map = $this->Application->getUnitOption($prefix, 'QueryString');
if ($query_map) {
$this->queryMaps[$prefix_special] = $query_map;
}
else {
unset($this->queryMaps[$prefix]);
}
// 'passed' is set later in ProcessRequest - do we really need it here? (it breakes HTTPQuery initialization...)
// $this->Application->SetVar('passed', implode(',', array_keys($this->queryMaps)) );
return $query_map;
}
/**
* Registers new regular event
*
* @param string $short_name name to be used to store last maintenace run info
* @param string $event_name
* @param int $run_interval run interval in seconds
* @param int $type before or after regular event
*/
function registerRegularEvent($short_name, $event_name, $run_interval, $type = reBEFORE)
{
if($type == reBEFORE)
{
$this->beforeRegularEvents[$short_name] = Array('EventName' => $event_name, 'RunInterval' => $run_interval);
}
else
{
$this->afterRegularEvents[$short_name] = Array('EventName' => $event_name, 'RunInterval' => $run_interval);
}
}
function registerBuildEvent($pseudo_class,$build_event_name)
{
$this->buildEvents[$pseudo_class]=$build_event_name;
}
/**
* Returns build event by pseudo class
* name if any defined in config
*
* @param string $pseudo_class
* @return kEvent
* @access public
*/
function &getBuildEvent($pseudo_class)
{
$false = false;
if( !isset($this->buildEvents[$pseudo_class]) ) return $false;
$event = new kEvent();
$event->Name=$this->buildEvents[$pseudo_class];
$event->MasterEvent=null;
return $event;
}
/**
* Check if event is called twice, that causes recursion
*
* @param kEvent $event
*/
function isRecursion(&$event)
{
$event_key = $event->getPrefixSpecial().':'.$event->Name;
return in_array($event_key, $this->recursionStack) ? true : false;
}
function pushEvent(&$event)
{
$event_key = $event->getPrefixSpecial().':'.$event->Name;
array_push($this->recursionStack, $event_key);
}
function popEvent()
{
array_pop($this->recursionStack);
}
/**
* Allows to process any type of event
*
* @param kEvent $event
* @access public
*/
function HandleEvent(&$event)
{
if ($this->isRecursion($event)) {
return true;
}
$this->pushEvent($event);
if( !$this->Application->prefixRegistred($event->Prefix) )
{
$unit_config_reader =& $this->Application->recallObject('kUnitConfigReader');
$unit_config_reader->loadConfig($event->Prefix);
- }
-
- if( !$this->Application->prefixRegistred($event->Prefix) )
- {
- trigger_error('Prefix <b>'.$event->Prefix.'</b> not registred (requested event <b>'.$event->Name.'</b>)', E_USER_NOTICE);
- return false;
+ if( !$this->Application->prefixRegistred($event->Prefix) )
+ {
+ trigger_error('Prefix <b>'.$event->Prefix.'</b> not registred (requested event <b>'.$event->Name.'</b>)', E_USER_NOTICE);
+ return false;
+ }
}
if (!$event->SkipBeforeHooks) {
$this->processHooks($event, hBEFORE);
if ($event->status == erFATAL) return true;
}
$event_handler =& $this->Application->recallObject($event->Prefix.'_EventHandler');
+ /* @var $event_handler kEventHandler */
$event_handler->processEvent($event);
if ($event->status == erFATAL) return true;
if (!$event->SkipAfterHooks) {
$this->processHooks($event, hAFTER);
}
$this->popEvent();
-
return true;
}
function ProcessRequest()
{
$this->processOpener();
// 1. get events from $_POST
$events = $this->Application->GetVar('events');
if ($events === false) $events = Array();
// 2. if nothing there, then try to find them in $_GET
if ($this->queryMaps && !$events) {
// if we got $_GET type submit (links, not javascript)
foreach ($this->queryMaps as $prefix_special => $query_map) {
$query_map = array_flip($query_map);
if (isset($query_map['event'])) {
$event_name = $this->Application->GetVar($prefix_special.'_event');
if ($event_name) {
$events[$prefix_special] = $event_name;
}
}
}
$actions = $this->Application->GetVar('do');
if ($actions) {
list($prefix, $event_name) = explode('_', $actions);
$events[$prefix] = $event_name;
}
}
// 3. store all prefixes passed before event processing, because they are used by GetTopmostPrefix
- $passed = explode(',', $this->Application->GetVar('passed'));
+ $all_passed = explode(',', $this->Application->GetVar('passed'));
foreach ($events as $prefix_special => $event_name) {
if (!$event_name) continue;
$prefix_special = explode('.',$prefix_special);
- array_push($passed, $prefix_special[0]);
+ array_push($all_passed, $prefix_special[0]);
}
- $this->Application->SetVar('passed', implode(',', $passed));
+ $this->Application->SetVar('all_passed', implode(',', $all_passed));
foreach ($events as $prefix_special => $event_name) {
if (!$event_name) continue;
if (is_array($event_name)) {
$event_name = key($event_name);
$events[$prefix_special] = $event_name;
$this->Application->SetVar($prefix_special.'_event', $event_name);
}
$event = new kEvent();
$event->Name = $event_name;
$event->Prefix_Special = $prefix_special;
$prefix_special = explode('.',$prefix_special);
$event->Prefix = $prefix_special[0];
// array_push($passed, $prefix_special[0]);
$event->Special = isset($prefix_special[1]) ? $prefix_special[1] : '';
$event->redirect_params = Array('opener' => 's', 'pass' => 'all');
$event->redirect = true;
$event_handler =& $this->Application->recallObject($event->Prefix.'_EventHandler');
+ /* @var $event_handler kEventHandler */
$event->setEventParam('top_prefix', $this->Application->GetTopmostPrefix($event->Prefix, true));
if (($this->Application->RecallVar('user_id') == -1) || $event_handler->CheckPermission($event)) {
$this->HandleEvent($event);
}
if ($event->status == erPERM_FAIL) {
$event->redirect = $this->Application->IsAdmin() ? 'no_permission' : $this->Application->ConfigValue('NoPermissionTemplate');
$event->redirect_params['pass'] = 'm';
$event->redirect_params['m_cat_id'] = 0;
// restore stuff, that processOpener() changed
$wid = $this->Application->GetVar('m_wid');
$this->Application->RestoreVar(rtrim('opener_stack_'.$wid, '_'));
// don't save last_template, because no_permission template does js history.back and could cause invalid opener_stack content
$this->Application->SetVar('skip_last_template', 1);
}
// should do redirect but to no_permissions template
if ( ($event->status == erSUCCESS || $event->status == erPERM_FAIL) && ($event->redirect === true || strlen($event->redirect) > 0)) {
// we need to pass category if the action was submitted to self-template, with the category passed
// and it has not explicly set redirect template or pass_cateogry param
if ($event->redirect === true && !isset($event->redirect_params['pass_category']) && $this->Application->GetVar('m_cat_id')) {
$event->redirect_params['pass_category'] = 1;
}
$wid = $this->Application->GetVar('m_wid');
if ($wid && $event->redirect_params['opener'] == 'u') {
$event->redirect_params['opener'] = 's'; // because Application->HREF will react differently when 'opener' = 'u'
- $event->redirect = 'incs/close_popup';
+ $event->redirect = defined('CLOSE_POPUP_TPL') ? CLOSE_POPUP_TPL : 'incs/close_popup';
}
$this->Application->Redirect($event->redirect, $event->redirect_params, null, $event->redirect_script);
}
}
$this->Application->SetVar('events', $events);
-// $this->Application->SetVar('passed', implode(',', $passed));
+ $this->Application->SetVar('passed', implode(',', $all_passed));
}
function processOpener()
{
$wid = $this->Application->GetVar('m_wid');
$opener_stack = $this->Application->RecallVar(rtrim('opener_stack_'.$wid, '_'));
$opener_stack = $opener_stack ? unserialize($opener_stack) : Array();
$opener_action = $this->Application->GetVar('m_opener');
switch ($opener_action) {
case 'r': // "reset" opener stack
$opener_stack = Array();
break;
case 'd': // "down/push" new template to opener stack, deeplevel++
if ($this->Application->GetVar('front')) {
$front_session =& $this->Application->recallObject('Session.front');
array_push($opener_stack, '../'.$front_session->RecallVar('last_template') );
}
else {
array_push($opener_stack, $this->Application->RecallVar('last_template') );
}
break;
case 'u': // "up/pop" last template from opener stack, deeplevel--
array_pop($opener_stack);
break;
case 'p': // pop-up - generate new wid
$parent_wid = $this->Application->GetVar('m_wid'); // window_id of popup's parent window
$popup_wid = (int)$this->Application->RecallVar('last_wid') + 1;
$this->Application->StoreVar('last_wid', $popup_wid);
$this->Application->SetVar('m_wid', $popup_wid);
if ($this->Application->GetVar('front')) {
$front_session =& $this->Application->recallObject('Session.front');
$last_template = $front_session->RecallVar(rtrim('last_template_popup_'.$parent_wid, '_'));
$last_template = '../'.$last_template;
}
else {
$last_template = $this->Application->RecallVar(rtrim('last_template_popup_'.$parent_wid, '_'));
}
$opener_stack = Array ( $last_template );
$this->Application->SetVar('m_opener', 's');
$wid = $popup_wid;
break;
default: // "s/0," stay on same deep level
break;
}
$this->Application->SetVar('m_opener', 's');
$this->Application->StoreVar(rtrim('opener_stack_'.$wid, '_'), serialize($opener_stack));
}
/**
* Used from relationship event handler
*
* @param string $t
* @param Array $params
* @param string $pass
*/
- function openerStackPush($t, $params, $pass = 'all')
+ function openerStackPush($t, $params, $pass = 'all', $wid=null)
{
- $wid = $this->Application->GetVar('m_wid');
+ if (!isset($wid)) $wid = $this->Application->GetVar('m_wid');
$stack_name = rtrim('opener_stack_'.$wid, '_');
$opener_stack = $this->Application->RecallVar($stack_name);
$opener_stack = $opener_stack ? unserialize($opener_stack) : Array();
$redirect_params = array_merge_recursive2(Array('m_opener' => 'u', '__URLENCODE__' => 1), $params);
$new_level = $this->Application->BuildEnv($t, $redirect_params, $pass, true);
array_push($opener_stack, 'index.php|'.ltrim($new_level, ENV_VAR_NAME.'=') );
$this->Application->StoreVar($stack_name, serialize($opener_stack));
}
function registerHook($hookto_prefix, $hookto_special, $hookto_event, $mode, $do_prefix, $do_special, $do_event, $conditional)
{
if( !$this->Application->prefixRegistred($hookto_prefix) )
{
if ($this->Application->isDebugMode()) {
trigger_error('Prefix <b>'.$hookto_prefix.'</b> doesn\'t exist when trying to hook from <b>'.$do_prefix.':'.$do_event.'</b>', E_USER_WARNING);
}
return;
}
$hookto_prefix_special = rtrim($hookto_prefix.'.'.$hookto_special, '.');
if ($mode == hBEFORE) {
$this->beforeHooks[strtolower($hookto_prefix_special.'.'.$hookto_event)][] = Array(
'DoPrefix' => $do_prefix,
'DoSpecial' => $do_special,
'DoEvent' => $do_event,
'Conditional' => $conditional,
);
}
elseif ($mode == hAFTER) {
$this->afterHooks[strtolower($hookto_prefix_special.'.'.$hookto_event)][] = Array(
'DoPrefix' => $do_prefix,
'DoSpecial' => $do_special,
'DoEvent' => $do_event,
'Conditional' => $conditional,
);
}
}
/**
* Enter description here...
*
* @param kEvent $event
* @param int $mode hBEFORE or hAFTER
* @return Array
*/
function &getHooks(&$event, $mode, $special = null)
{
$event_key = !isset($special) ? $event->Prefix_Special : $event->Prefix.'.'.$special;
if ($mode == hBEFORE) {
$mode_hooks =& $this->beforeHooks;
}
else {
$mode_hooks =& $this->afterHooks;
}
if (!isset($mode_hooks[strtolower($event_key.'.'.$event->Name)])) {
$hooks = array();
return $hooks;
}
return $mode_hooks[strtolower($event_key.'.'.$event->Name)];
}
/**
* Enter description here...
*
* @param kEvent $event
* @param int $mode hBEFORE or hAFTER
*/
function processHooks(&$event, $mode)
{
// * - get hooks that are valid with any special of given prefix
$hooks = array_merge($this->getHooks($event, $mode, '*'), $this->getHooks($event, $mode));
if ($hooks) {
foreach ($hooks as $hook) {
if ($hook['DoSpecial'] == '*') {
// use same special as master event
$hook['DoSpecial'] = $event->Special;
}
$prefix_special = rtrim($hook['DoPrefix'].'_'.$hook['DoSpecial'], '_');
if ( $hook['Conditional'] && !$this->Application->GetVar($prefix_special) ) {
continue;
}
$hook_event = new kEvent( Array('name'=>$hook['DoEvent'],'prefix'=>$hook['DoPrefix'],'special'=>$hook['DoSpecial']) );
$hook_event->MasterEvent =& $event;
$this->HandleEvent($hook_event);
}
}
}
/**
* Set's new event for $prefix_special
* passed
*
* @param string $prefix_special
* @param string $event_name
* @access public
*/
function setEvent($prefix_special,$event_name)
{
$actions =& $this->Application->recallObject('kActions');
$actions->Set('events['.$prefix_special.']',$event_name);
}
/**
* Run registred regular events with specified event type
*
* @param int $event_type
*/
function RunRegularEvents($event_type = reBEFORE, $from_cron=false)
{
if (defined('IS_INSTALL')) return ;
// if RegularEvents are set to run from cron
if (!$from_cron && $this->Application->ConfigValue('UseCronForRegularEvent')) return ;
$events_source = ($event_type == reBEFORE) ? $this->beforeRegularEvents : $this->afterRegularEvents;
/*if(rand(0, 100) < 90)
{
return;
}*/
$sql = 'SELECT Data FROM '.TABLE_PREFIX.'Cache WHERE VarName = %s';
$event_last_runs = $this->Conn->GetOne( sprintf($sql, $this->Conn->qstr('RegularEventRuns') ) );
$event_last_runs = $event_last_runs ? unserialize($event_last_runs) : Array();
foreach($events_source as $short_name => $event_data)
{
$event_last_run = getArrayValue($event_last_runs, $short_name);
if($event_last_run && $event_last_run > adodb_mktime() - $event_data['RunInterval'])
{
continue;
}
else
{
$event = new kEvent($event_data['EventName']);
$event->redirect = false;
$this->Application->HandleEvent($event);
$event_last_runs[$short_name] = adodb_mktime();
}
}
$sql = 'REPLACE INTO '.TABLE_PREFIX.'Cache (VarName,Data,Cached) VALUES (%s,%s,%s)';
$this->Conn->Query( sprintf($sql, $this->Conn->qstr('RegularEventRuns'), $this->Conn->qstr(serialize($event_last_runs)), adodb_mktime() ) );
}
/**
* Allows to determine, that required event is beeing processed right now
*
* @param string $event_key Event name in format prefix[.special]:event_name
* @return bool
*/
function eventRunning($event_key)
{
return array_search($event_key, $this->recursionStack) !== false;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/event_manager.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.40
\ No newline at end of property
+1.41
\ No newline at end of property
Index: trunk/core/kernel/processors/tag_processor.php
===================================================================
--- trunk/core/kernel/processors/tag_processor.php (revision 7634)
+++ trunk/core/kernel/processors/tag_processor.php (revision 7635)
@@ -1,187 +1,193 @@
<?php
class TagProcessor extends kBase {
/**
* Processes tag
*
* @param Tag $tag
* @return string
* @access public
*/
function ProcessTag(&$tag)
{
return $this->ProcessParsedTag($tag->Tag, $tag->NP, $tag->getPrefixSpecial());
/*$Method=$tag->Tag;
if(method_exists($this, $Method))
{
//echo htmlspecialchars($tag->GetFullTag()).'<br>';
return $this->$Method($tag->NP);
}
else
{
if ($this->Application->hasObject('TagsAggregator')) {
$aggregator =& $this->Application->recallObject('TagsAggregator');
$tag_mapping = $aggregator->GetArrayValue($tag->Prefix, $Method);
if ($tag_mapping) {
$mapped_tag =& new Tag('', $this->Application->Parser);
$mapped_tag->CopyFrom($tag);
$mapped_tag->Processor = $tag_mapping[0];
$mapped_tag->Tag = $tag_mapping[1];
$mapped_tag->NP['PrefixSpecial'] = $tag->getPrefixSpecial();
$mapped_tag->RebuildTagData();
return $mapped_tag->DoProcessTag();
}
}
trigger_error('Tag '.$Method.' Undefined in '.get_class($this).'[Agregated Tag]:<br><b>'.$tag->RebuildTagData().'</b>',E_USER_WARNING);
return false;
}*/
}
function ProcessParsedTag($tag, $params, $prefix)
{
$Method = $tag;
if(method_exists($this, $Method))
{
if ($this->Application->isDebugMode() && constOn('DBG_SHOW_TAGS')) {
$this->Application->Debugger->appendHTML('Processing PreParsed Tag '.$Method.' in '.$this->Prefix);
}
$backup_prefix = $this->Prefix;
$backup_special = $this->Special;
// process all possible flags: begin
- $flags = Array('js_escape', 'result_to_var', 'pass_params');
+ $flags = Array('js_escape', 'result_to_var', 'pass_params', 'html_escape');
$flag_values = Array();
foreach ($flags as $flag_name) {
$flag_values[$flag_name] = false;
if (isset($params[$flag_name])) {
$flag_values[$flag_name] = $params[$flag_name];
unset($params[$flag_name]);
}
}
// process all possible flags: end
// pass_params for non ParseBlock tags :)
if ($flag_values['pass_params']) {
$params = array_merge_recursive2($this->Application->Parser->Params, $params);
}
$ret = $this->$Method($params);
$this->Prefix = $backup_prefix;
$this->Special = $backup_special;
if ($flag_values['js_escape']) {
$ret = str_replace('\'', '&#39;', $ret);
$ret = addslashes($ret);
$ret = str_replace(Array("\r", "\n"), Array('\r', '\n'), $ret);
$ret = str_replace('</script>', "</'+'script>", $ret);
}
+ if ($flag_values['html_escape']) {
+ $ret = htmlspecialchars($ret);
+ }
if ($flag_values['result_to_var']) {
$this->Application->Parser->SetParam($flag_values['result_to_var'], $ret);
$ret = '';
}
return $ret;
}
else
{
if ($this->Application->hasObject('TagsAggregator')) {
$aggregator =& $this->Application->recallObject('TagsAggregator');
$tmp = $this->Application->processPrefix($prefix);
$tag_mapping = $aggregator->GetArrayValue($tmp['prefix'], $Method);
if ($tag_mapping) {
$tmp = $this->Application->processPrefix($tag_mapping[0]);
$__tag_processor = $tmp['prefix'].'_TagProcessor';
$processor =& $this->Application->recallObject($__tag_processor);
$processor->Prefix = $tmp['prefix'];
$processor->Special = getArrayValue($tag_mapping, 2) ? $tag_mapping[2] : $tmp['special'];
$params['PrefixSpecial'] = $prefix;
$ret = $processor->ProcessParsedTag($tag_mapping[1], $params, $prefix);
if (isset($params['result_to_var'])) {
$this->Application->Parser->SetParam($params['result_to_var'], $ret);
$ret = '';
}
return $ret;
}
+ if ($this->Application->isDebugMode()) {
+ $this->Application->Debugger->appendTrace();
+ }
trigger_error('Tag <b>'.$Method.'</b> Undefined in '.get_class($this).'[Agregated Tag]:<br><b>'.$tag.'</b>', E_USER_WARNING);
}
trigger_error('Tag Undefined:<br><b>'.$prefix.':'.$tag.'</b>',E_USER_WARNING);
return false;
}
}
/**
* Not tag, method for parameter
* selection from list in this TagProcessor
*
* @param Array $params
* @param string $possible_names
* @return string
* @access public
*/
function SelectParam($params, $possible_names)
{
if (!is_array($params)) return;
if (!is_array($possible_names))
$possible_names = explode(',', $possible_names);
foreach ($possible_names as $name)
{
if( isset($params[$name]) ) return $params[$name];
}
return false;
}
}
/*class ProcessorsPool {
var $Processors = Array();
var $Application;
var $Prefixes = Array();
var $S;
function ProcessorsPool()
{
$this->Application =& KernelApplication::Instance();
$this->S =& $this->Application->Session;
}
function RegisterPrefix($prefix, $path, $class)
{
// echo " RegisterPrefix $prefix, $path, $class <br>";
$prefix_item = Array(
'path' => $path,
'class' => $class
);
$this->Prefixes[$prefix] = $prefix_item;
}
function CreateProcessor($prefix, &$tag)
{
// echo " prefix : $prefix <br>";
if (!isset($this->Prefixes[$prefix]))
$this->Application->ApplicationDie ("<b>Filepath and ClassName for prefix $prefix not defined while processing ".htmlspecialchars($tag->GetFullTag())."!</b>");
include_once($this->Prefixes[$prefix]['path']);
$ClassName = $this->Prefixes[$prefix]['class'];
$a_processor =& new $ClassName($prefix);
$this->SetProcessor($prefix, $a_processor);
}
function SetProcessor($prefix, &$a_processor)
{
$this->Processors[$prefix] =& $a_processor;
}
function &GetProcessor($prefix, &$tag)
{
if (!isset($this->Processors[$prefix]))
$this->CreateProcessor($prefix, $tag);
return $this->Processors[$prefix];
}
}*/
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/processors/tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.14
\ No newline at end of property
+1.15
\ No newline at end of property
Index: trunk/core/kernel/session/session.php
===================================================================
--- trunk/core/kernel/session/session.php (revision 7634)
+++ trunk/core/kernel/session/session.php (revision 7635)
@@ -1,867 +1,865 @@
<?php
/*
The session works the following way:
1. When a visitor loads a page from the site the script checks if cookies_on varibale has been passed to it as a cookie.
2. If it has been passed, the script tries to get Session ID (SID) from the request:
3. Depending on session mode the script is getting SID differently.
The following modes are available:
smAUTO - Automatic mode: if cookies are on at the client side, the script relays only on cookies and
ignore all other methods of passing SID.
If cookies are off at the client side, the script relays on SID passed through query string
and referal passed by the client. THIS METHOD IS NOT 100% SECURE, as long as attacker may
get SID and substitude referal to gain access to user' session. One of the faults of this method
is that the session is only created when the visitor clicks the first link on the site, so
there is NO session at the first load of the page. (Actually there is a session, but it gets lost
after the first click because we do not use SID in query string while we are not sure if we need it)
smCOOKIES_ONLY - Cookies only: in this mode the script relays solely on cookies passed from the browser
and ignores all other methods. In this mode there is no way to use sessions for clients
without cookies support or cookies support disabled. The cookies are stored with the
full domain name and path to base-directory of script installation.
smGET_ONLY - GET only: the script will not set any cookies and will use only SID passed in
query string using GET, it will also check referal. The script will set SID at the
first load of the page
smCOOKIES_AND_GET - Combined mode: the script will use both cookies and GET right from the start. If client has
cookies enabled, the script will check SID stored in cookie and passed in query string, and will
use this SID only if both cookie and query string matches. However if cookies are disabled on the
client side, the script will work the same way as in GET_ONLY mode.
4. After the script has the SID it tries to load it from the Storage (default is database)
5. If such SID is found in the database, the script checks its expiration time. If session is not expired, it updates
its expiration, and resend the cookie (if applicable to session mode)
6. Then the script loads all the data (session variables) pertaining to the SID.
Usage:
$session =& new Session(smAUTO); //smAUTO is default, you could just leave the brackets empty, or provide another mode
$session->SetCookieDomain('my.domain.com');
$session->SetCookiePath('/myscript');
$session->SetCookieName('my_sid_cookie');
$session->SetGETName('sid');
$session->InitSession();
...
//link output:
echo "<a href='index.php?'". ( $session->NeedQueryString() ? 'sid='.$session->SID : '' ) .">My Link</a>";
*/
//Implements session storage in the database
class SessionStorage extends kDBBase {
var $Expiration;
var $SessionTimeout=0;
var $DirectVars = Array();
var $ChangedDirectVars = Array();
var $PersistentVars = Array ();
var $OriginalData=Array();
var $TimestampField;
var $SessionDataTable;
var $DataValueField;
var $DataVarField;
function Init($prefix,$special)
{
parent::Init($prefix,$special);
$this->setTableName('sessions');
$this->setIDField('sid');
$this->TimestampField = 'expire';
$this->SessionDataTable = 'SessionData';
$this->DataValueField = 'value';
$this->DataVarField = 'var';
}
function setSessionTimeout($new_timeout)
{
$this->SessionTimeout = $new_timeout;
}
function StoreSession(&$session, $additional_fields = Array())
{
$fields_hash = Array (
$this->IDField => $session->SID,
$this->TimestampField => $session->Expiration
);
$this->Conn->doInsert($fields_hash, $this->TableName);
foreach ($additional_fields as $field_name => $field_value) {
$this->SetField($session, $field_name, $field_value);
}
}
function DeleteSession(&$session)
{
$query = ' DELETE FROM '.$this->TableName.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID);
$this->Conn->Query($query);
$query = ' DELETE FROM '.$this->SessionDataTable.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID);
$this->Conn->Query($query);
$this->OriginalData = Array();
}
function UpdateSession(&$session, $timeout=0)
{
$this->SetField($session, $this->TimestampField, $session->Expiration);
$query = ' UPDATE '.$this->TableName.' SET '.$this->TimestampField.' = '.$session->Expiration.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID);
$this->Conn->Query($query);
}
function LocateSession($sid)
{
$query = ' SELECT * FROM '.$this->TableName.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($sid);
$result = $this->Conn->GetRow($query);
if($result===false) return false;
$this->DirectVars = $result;
$this->Expiration = $result[$this->TimestampField];
return true;
}
function GetExpiration()
{
return $this->Expiration;
}
function LoadData(&$session)
{
$query = 'SELECT '.$this->DataValueField.','.$this->DataVarField.' FROM '.$this->SessionDataTable.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID);
$this->OriginalData = $this->Conn->GetCol($query, $this->DataVarField);
return $this->OriginalData;
}
/**
* Enter description here...
*
* @param Session $session
* @param string $var_name
* @param mixed $default
*/
function GetField(&$session, $var_name, $default = false)
{
return isset($this->DirectVars[$var_name]) ? $this->DirectVars[$var_name] : $default;
//return $this->Conn->GetOne('SELECT '.$var_name.' FROM '.$this->TableName.' WHERE `'.$this->IDField.'` = '.$this->Conn->qstr($session->GetID()) );
}
function SetField(&$session, $var_name, $value)
{
$value_changed = !isset($this->DirectVars[$var_name]) || ($this->DirectVars[$var_name] != $value);
if ($value_changed) {
$this->DirectVars[$var_name] = $value;
$this->ChangedDirectVars[] = $var_name;
$this->ChangedDirectVars = array_unique($this->ChangedDirectVars);
}
//return $this->Conn->Query('UPDATE '.$this->TableName.' SET '.$var_name.' = '.$this->Conn->qstr($value).' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->GetID()) );
}
function SaveData(&$session)
{
if(!$session->SID) return false; // can't save without sid
$ses_data = $session->Data->GetParams();
$replace = '';
foreach ($ses_data as $key => $value)
{
if ( isset($this->OriginalData[$key]) && $this->OriginalData[$key] == $value)
{
continue; //skip unchanged session data
}
else
{
$replace .= sprintf("(%s, %s, %s),",
$this->Conn->qstr($session->SID),
$this->Conn->qstr($key),
$this->Conn->qstr($value));
}
}
$replace = rtrim($replace, ',');
if ($replace != '') {
$query = ' REPLACE INTO '.$this->SessionDataTable. ' ('.$this->IDField.', '.$this->DataVarField.', '.$this->DataValueField.') VALUES '.$replace;
$this->Conn->Query($query);
}
if ($this->ChangedDirectVars) {
$changes = array();
foreach ($this->ChangedDirectVars as $var) {
$changes[] = $var.' = '.$this->Conn->qstr($this->DirectVars[$var]);
}
$query = 'UPDATE '.$this->TableName.' SET '.implode(',', $changes).' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->GetID());
$this->Conn->Query($query);
}
}
function RemoveFromData(&$session, $var)
{
$query = 'DELETE FROM '.$this->SessionDataTable.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID).
' AND '.$this->DataVarField.' = '.$this->Conn->qstr($var);
$this->Conn->Query($query);
unset($this->OriginalData[$var]);
}
function GetFromData(&$session, $var)
{
return getArrayValue($this->OriginalData, $var);
}
function GetExpiredSIDs()
{
$query = ' SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE '.$this->TimestampField.' > '.adodb_mktime();
return $this->Conn->GetCol($query);
}
function DeleteExpired()
{
$expired_sids = $this->GetExpiredSIDs();
if ($expired_sids) {
$where_clause=' WHERE '.$this->IDField.' IN ("'.implode('","',$expired_sids).'")';
$sql = 'DELETE FROM '.$this->SessionDataTable.$where_clause;
$this->Conn->Query($sql);
$sql = 'DELETE FROM '.$this->TableName.$where_clause;
$this->Conn->Query($sql);
// delete debugger ouputs left of expired sessions
foreach ($expired_sids as $expired_sid) {
$debug_file = KERNEL_PATH.'/../cache/debug_@'.$expired_sid.'@.txt';
if (file_exists($debug_file)) {
@unlink($debug_file);
}
}
}
return $expired_sids;
}
function LoadPersistentVars(&$session)
{
$user_id = $this->Application->RecallVar('user_id');
if ($user_id != -2) {
// root & normal users
$sql = 'SELECT VariableValue, VariableName
FROM '.TABLE_PREFIX.'PersistantSessionData
WHERE PortalUserId = '.$user_id;
$this->PersistentVars = $this->Conn->GetCol($sql, 'VariableName');
}
else {
$this->PersistentVars = Array ();
}
}
function StorePersistentVar(&$session, $var_name, $var_value)
{
$this->PersistentVars[$var_name] = $var_value;
$replace_hash = Array (
'PortalUserId' => $this->Application->RecallVar('user_id'),
'VariableName' => $var_name,
'VariableValue' => $var_value
);
$this->Conn->doInsert($replace_hash, TABLE_PREFIX.'PersistantSessionData', 'REPLACE');
}
function RecallPersistentVar(&$session, $var_name, $default = false)
{
return isset($this->PersistentVars[$var_name]) ? $this->PersistentVars[$var_name] : $default;
}
function RemovePersistentVar(&$session, $var_name)
{
unset($this->PersistentVars[$var_name]);
$user_id = $this->Application->RecallVar('user_id');
if ($user_id != -2) {
$sql = 'DELETE FROM '.TABLE_PREFIX.'PersistantSessionData
WHERE PortalUserId = '.$user_id.' AND VariableName = '.$this->Conn->qstr($var_name);
$this->Conn->Query($sql);
}
}
}
define('smAUTO', 1);
define('smCOOKIES_ONLY', 2);
define('smGET_ONLY', 3);
define('smCOOKIES_AND_GET', 4);
class Session extends kBase {
var $Checkers;
var $Mode;
var $OriginalMode = null;
var $GETName = 'sid';
var $CookiesEnabled = true;
var $CookieName = 'sid';
var $CookieDomain;
var $CookiePath;
var $CookieSecure = 0;
var $SessionTimeout = 3600;
var $Expiration;
var $SID;
/**
* Enter description here...
*
* @var SessionStorage
*/
var $Storage;
var $CachedNeedQueryString = null;
var $Data;
function Session($mode=smAUTO)
{
parent::kBase();
$this->SetMode($mode);
}
function SetMode($mode)
{
$this->Mode = $mode;
$this->CachedNeedQueryString = null;
$this->CachedSID = null;
}
function SetCookiePath($path)
{
$this->CookiePath = $path;
}
function SetCookieDomain($domain)
{
$this->CookieDomain = '.'.ltrim($domain, '.');
}
function SetGETName($get_name)
{
$this->GETName = $get_name;
}
function SetCookieName($cookie_name)
{
$this->CookieName = $cookie_name;
}
function InitStorage()
{
$this->Storage =& $this->Application->recallObject('SessionStorage');
$this->Storage->setSessionTimeout($this->SessionTimeout);
}
function Init($prefix,$special)
{
parent::Init($prefix,$special);
$this->CheckIfCookiesAreOn();
if ($this->CookiesEnabled) $_COOKIE['cookies_on'] = 1;
$this->Checkers = Array();
$this->InitStorage();
$this->Data =& new Params();
$tmp_sid = $this->GetPassedSIDValue();
$check = $this->Check();
if( !(defined('IS_INSTALL') && IS_INSTALL) )
{
$expired_sids = $this->DeleteExpired();
if( ( $expired_sids && in_array($tmp_sid,$expired_sids) ) || ( $tmp_sid && !$check ) )
{
$this->SetSession();
$this->Application->HandleEvent($event, 'u:OnSessionExpire');
}
}
if ($check) {
$this->SID = $this->GetPassedSIDValue();
$this->Refresh();
$this->LoadData();
}
else {
$this->SetSession();
}
if (!is_null($this->OriginalMode)) $this->SetMode($this->OriginalMode);
}
function IsHTTPSRedirect()
{
$http_referer = getArrayValue($_SERVER, 'HTTP_REFERER');
return (
( PROTOCOL == 'https://' && preg_match('#http:\/\/#', $http_referer) )
||
( PROTOCOL == 'http://' && preg_match('#https:\/\/#', $http_referer) )
);
}
function CheckReferer($for_cookies=0)
{
if (!$for_cookies) {
if ( !$this->Application->ConfigValue('SessionReferrerCheck') || $_SERVER['REQUEST_METHOD'] != 'POST') {
return true;
}
}
$path = preg_replace('/admin[\/]{0,1}$/', '', $this->CookiePath); // removing /admin for compatability with in-portal (in-link/admin/add_link.php)
$reg = '#^'.preg_quote(PROTOCOL.ltrim($this->CookieDomain, '.').$path).'#';
return preg_match($reg, getArrayValue($_SERVER, 'HTTP_REFERER') ) || (defined('IS_POPUP') && IS_POPUP);
}
/*function CheckDuplicateCookies()
{
if (isset($_SERVER['HTTP_COOKIE'])) {
$cookie_str = $_SERVER['HTTP_COOKIE'];
$cookies = explode('; ', $cookie_str);
$all_cookies = array();
foreach ($cookies as $cookie) {
list($name, $value) = explode('=', $cookie);
if (isset($all_cookies[$name])) {
//double cookie name!!!
$this->RemoveCookie($name);
}
else $all_cookies[$name] = $value;
}
}
}
function RemoveCookie($name)
{
$path = $_SERVER['PHP_SELF'];
$path_parts = explode('/', $path);
$cur_path = '';
setcookie($name, false, null, $cur_path);
foreach ($path_parts as $part) {
$cur_path .= $part;
setcookie($name, false, null, $cur_path);
$cur_path .= '/';
setcookie($name, false, null, $cur_path);
}
}*/
function CheckIfCookiesAreOn()
{
// $this->CheckDuplicateCookies();
if ($this->Mode == smGET_ONLY)
{
//we don't need to bother checking if we would not use it
$this->CookiesEnabled = false;
return;
}
$http_query =& $this->Application->recallObject('HTTPQuery');
$cookies_on = isset($http_query->Cookie['cookies_on']); // not good here
$get_sid = getArrayValue($http_query->Get, $this->GETName);
if ($this->IsHTTPSRedirect() && $get_sid) { //Redirect from http to https on different domain
$this->OriginalMode = $this->Mode;
$this->SetMode(smGET_ONLY);
}
if (!$cookies_on || $this->IsHTTPSRedirect()) {
//If referer is our server, but we don't have our cookies_on, it's definetly off
$is_install = defined('IS_INSTALL') && IS_INSTALL;
if (!$is_install && $this->CheckReferer(1) && !$this->Application->GetVar('admin') && !$this->IsHTTPSRedirect()) {
$this->CookiesEnabled = false;
}
else {
//Otherwise we still suppose cookies are on, because may be it's the first time user visits the site
//So we send cookies on to get it next time (when referal will tell us if they are realy off
$this->SetCookie('cookies_on', 1, adodb_mktime() + 31104000); //one year should be enough
}
}
else
$this->CookiesEnabled = true;
return $this->CookiesEnabled;
}
/**
* Sets cookie for current site using path and domain
*
* @param string $name
* @param mixed $value
* @param int $expires
*/
function SetCookie($name, $value, $expires = null)
{
setcookie($name, $value, $expires, $this->CookiePath, $this->CookieDomain, $this->CookieSecure);
}
-
+
function Check()
{
// we should check referer if cookies are disabled, and in combined mode
// auto mode would detect cookies, get only mode would turn it off - so we would get here
// and we don't care about referal in cookies only mode
if ( $this->Mode != smCOOKIES_ONLY && (!$this->CookiesEnabled || $this->Mode == smCOOKIES_AND_GET) ) {
if (!$this->CheckReferer())
return false;
}
$sid = $this->GetPassedSIDValue();
if (empty($sid)) return false;
//try to load session by sid, if everything is fine
$result = $this->LoadSession($sid);
return $result;
}
function LoadSession($sid)
{
if( $this->Storage->LocateSession($sid) ) {
//if we have session with such SID - get its expiration
$this->Expiration = $this->Storage->GetExpiration();
//If session has expired
if ($this->Expiration < adodb_mktime()) return false;
//Otherwise it's ok
return true;
}
else //fake or deleted due to expiration SID
return false;
}
function GetPassedSIDValue($use_cache = 1)
{
if (!empty($this->CachedSID) && $use_cache) return $this->CachedSID;
$http_query =& $this->Application->recallObject('HTTPQuery');
$get_sid = getArrayValue($http_query->Get, $this->GETName);
if ($this->Application->GetVar('admin') == 1 && $get_sid) {
$sid = $get_sid;
}
else {
switch ($this->Mode) {
case smAUTO:
//Cookies has the priority - we ignore everything else
$sid = $this->CookiesEnabled ? $this->GetSessionCookie() : $get_sid;
break;
case smCOOKIES_ONLY:
$sid = $this->GetSessionCookie();
break;
case smGET_ONLY:
$sid = $get_sid;
break;
case smCOOKIES_AND_GET:
$cookie_sid = $this->GetSessionCookie();
//both sids should match if cookies are enabled
if (!$this->CookiesEnabled || ($cookie_sid == $get_sid))
{
$sid = $get_sid; //we use get here just in case cookies are disabled
}
else
{
$sid = '';
}
break;
}
}
$this->CachedSID = $sid;
return $this->CachedSID;
}
/**
* Returns session id
*
* @return int
* @access public
*/
function GetID()
{
return $this->SID;
}
/**
* Generates new session id
*
* @return int
* @access private
*/
function GenerateSID()
{
list($usec, $sec) = explode(" ",microtime());
$sid_part_1 = substr($usec, 4, 4);
$sid_part_2 = mt_rand(1,9);
$sid_part_3 = substr($sec, 6, 4);
$digit_one = substr($sid_part_1, 0, 1);
if ($digit_one == 0) {
$digit_one = mt_rand(1,9);
$sid_part_1 = ereg_replace("^0","",$sid_part_1);
$sid_part_1=$digit_one.$sid_part_1;
}
$this->setSID($sid_part_1.$sid_part_2.$sid_part_3);
return $this->SID;
}
/**
* Set's new session id
*
* @param int $new_sid
* @access private
*/
function setSID($new_sid)
{
$this->SID=$new_sid;
$this->Application->SetVar($this->GETName,$new_sid);
}
function SetSession()
{
$this->GenerateSID();
$this->Expiration = adodb_mktime() + $this->SessionTimeout;
switch ($this->Mode) {
case smAUTO:
if ($this->CookiesEnabled) {
$this->SetSessionCookie();
}
break;
case smGET_ONLY:
break;
case smCOOKIES_ONLY:
case smCOOKIES_AND_GET:
$this->SetSessionCookie();
break;
}
$this->Storage->StoreSession($this);
}
/**
* Returns SID from cookie
*
* @return int
*/
function GetSessionCookie()
{
return isset($this->Application->HttpQuery->Cookie[$this->CookieName]) ? $this->Application->HttpQuery->Cookie[$this->CookieName] : false;
}
/**
* Updates SID in cookie with new value
*
*/
function SetSessionCookie()
{
$this->SetCookie($this->CookieName, $this->SID, $this->Expiration);
$_COOKIE[$this->CookieName] = $this->SID; // for compatibility with in-portal
}
/**
* Refreshes session expiration time
*
* @access private
*/
function Refresh()
{
if ($this->CookiesEnabled) $this->SetSessionCookie(); //we need to refresh the cookie
$this->Storage->UpdateSession($this);
}
function Destroy()
{
$this->Storage->DeleteSession($this);
$this->Data =& new Params();
$this->SID = '';
if ($this->CookiesEnabled) $this->SetSessionCookie(); //will remove the cookie due to value (sid) is empty
$this->SetSession(); //will create a new session
}
function NeedQueryString($use_cache = 1)
{
if ($this->CachedNeedQueryString != null && $use_cache) return $this->CachedNeedQueryString;
$result = false;
switch ($this->Mode)
{
case smAUTO:
if (!$this->CookiesEnabled) $result = true;
break;
/*case smCOOKIES_ONLY:
break;*/
case smGET_ONLY:
case smCOOKIES_AND_GET:
$result = true;
break;
}
$this->CachedNeedQueryString = $result;
return $result;
}
function LoadData()
{
$this->Data->AddParams($this->Storage->LoadData($this));
}
function PrintSession($comment='')
{
if($this->Application->isDebugMode() && constOn('DBG_SHOW_SESSIONDATA')) {
// dump session data
$this->Application->Debugger->appendHTML('SessionStorage ('.$comment.'):');
$session_data = $this->Data->GetParams();
ksort($session_data);
foreach ($session_data as $session_key => $session_value) {
if (IsSerialized($session_value)) {
$session_data[$session_key] = unserialize($session_value);
}
}
$this->Application->Debugger->dumpVars($session_data);
-
+ }
+ if ($this->Application->isDebugMode() && constOn('DBG_SHOW_PERSISTENTDATA')) {
// dump persistent session data
if ($this->Storage->PersistentVars) {
$this->Application->Debugger->appendHTML('Persistant Session:');
$session_data = $this->Storage->PersistentVars;
ksort($session_data);
foreach ($session_data as $session_key => $session_value) {
if (IsSerialized($session_value)) {
$session_data[$session_key] = unserialize($session_value);
}
}
$this->Application->Debugger->dumpVars($session_data);
}
-
-// to insert after HTTPQuery if it's visible
-// $new_row = constOn('DBG_SHOW_HTTPQUERY') ? 4 : 2;
-// $debugger->moveAfterRow($new_row,2);
}
}
function SaveData()
{
if (!$this->Application->GetVar('skip_last_template') && $this->Application->GetVar('ajax') != 'yes') {
$this->SaveLastTemplate( $this->Application->GetVar('t') );
}
$this->PrintSession('after save');
$this->Storage->SaveData($this);
}
function SaveLastTemplate($t)
{
// save last_template
$wid = $this->Application->GetVar('m_wid');
-
+
$last_env = $this->getLastTemplateENV($t, Array('m_opener' => 'u'));
$last_template = basename($_SERVER['PHP_SELF']).'|'.substr($last_env, strlen(ENV_VAR_NAME) + 1);
$this->StoreVar(rtrim('last_template_'.$wid, '_'), $last_template);
-
+
$last_env = $this->getLastTemplateENV($t, Array());
$last_template = basename($_SERVER['PHP_SELF']).'|'.substr($last_env, strlen(ENV_VAR_NAME) + 1);
$this->StoreVar(rtrim('last_template_popup_'.$wid, '_'), $last_template);
-
+
// save other last... variables for mistical purposes (customizations may be)
$this->StoreVar('last_url', $_SERVER['REQUEST_URI']); // needed by ord:StoreContinueShoppingLink
$this->StoreVar('last_env', substr($last_env, strlen(ENV_VAR_NAME)+1));
}
function getLastTemplateENV($t, $params)
{
$params['__URLENCODE__'] = 1;
return $this->Application->BuildEnv($t, $params, 'all');
}
function StoreVar($name, $value)
{
$this->Data->Set($name, $value);
}
function StorePersistentVar($name, $value)
{
$this->Storage->StorePersistentVar($this, $name, $value);
}
function LoadPersistentVars()
{
$this->Storage->LoadPersistentVars($this);
}
function StoreVarDefault($name, $value)
{
$tmp = $this->RecallVar($name);
if($tmp === false || $tmp == '')
{
$this->StoreVar($name, $value);
}
}
function RecallVar($name, $default = false)
{
$ret = $this->Data->Get($name);
return ($ret === false) ? $default : $ret;
}
function RecallPersistentVar($name, $default = false)
{
return $this->Storage->RecallPersistentVar($this, $name, $default);
}
+
function RemoveVar($name)
{
$this->Storage->RemoveFromData($this, $name);
$this->Data->Remove($name);
}
function RemovePersistentVar($name)
{
return $this->Storage->RemovePersistentVar($this, $name);
}
/**
* Ignores session varible value set before
*
* @param string $name
*/
function RestoreVar($name)
{
return $this->StoreVar($name, $this->Storage->GetFromData($this, $name));
}
function GetField($var_name, $default = false)
{
return $this->Storage->GetField($this, $var_name, $default);
}
function SetField($var_name, $value)
{
$this->Storage->SetField($this, $var_name, $value);
}
/**
* Deletes expired sessions
*
* @return Array expired sids if any
* @access private
*/
function DeleteExpired()
{
return $this->Storage->DeleteExpired();
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/session/session.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.54
\ No newline at end of property
+1.55
\ No newline at end of property
Index: trunk/core/kernel/utility/debugger/debugger.js
===================================================================
--- trunk/core/kernel/utility/debugger/debugger.js (revision 7634)
+++ trunk/core/kernel/utility/debugger/debugger.js (revision 7635)
@@ -1,308 +1,337 @@
function DebugReq() {}
DebugReq.timeout = 5000; //5 seconds
DebugReq.makeRequest = function(p_url, p_busyReq, p_progId, p_successCallBack, p_errorCallBack, p_pass, p_object) {
//p_url: the web service url
//p_busyReq: is a request for this object currently in progress?
//p_progId: element id where progress HTML should be shown
//p_successCallBack: callback function for successful response
//p_errorCallBack: callback function for erroneous response
//p_pass: string of params to pass to callback functions
//p_object: object of params to pass to callback functions
if (p_busyReq) {
return;
}
var req = DebugReq.getRequest();
if (req != null) {
p_busyReq = true;
DebugReq.showProgress(p_progId);
req.onreadystatechange = function() {
if (req.readyState == 4) {
p_busyReq = false;
window.clearTimeout(toId);
if (req.status == 200) {
p_successCallBack(req,p_pass,p_object);
} else {
p_errorCallBack(req,p_pass,p_object);
}
}
}
req.open('GET', p_url, true);
req.setRequestHeader('If-Modified-Since', 'Sat, 1 Jan 2000 00:00:00 GMT');
req.send(null);
var toId = window.setTimeout( function() {if (p_busyReq) req.abort();}, DebugReq.timeout );
}
}
DebugReq.getRequest = function() {
var xmlHttp;
try { xmlHttp = new ActiveXObject('MSXML2.XMLHTTP'); return xmlHttp; } catch (e) {}
try { xmlHttp = new ActiveXObject('Microsoft.XMLHTTP'); return xmlHttp; } catch (e) {}
try { xmlHttp = new XMLHttpRequest(); return xmlHttp; } catch(e) {}
return null;
}
DebugReq.showProgress = function(p_id) {
$Debugger.AppendRow(DebugReq.getProgressHtml());
}
DebugReq.getProgressHtml = function() {
return 'Loading ...';
}
DebugReq.getErrorHtml = function(p_req) {
//TODO: implement accepted way to handle request error
return "<p>" + "(" + p_req.status + ") " + p_req.statusText + "</p>"
}
// Debugger
-function Debugger() {
+function Debugger($row_separator, $errors_count, $fatal_error, $sql_count) {
+ this.RowSeparator = $row_separator;
+ this.IsFatalError = $fatal_error;
+ this.ErrorsCount = parseInt($errors_count);
+ this.SQLCount = parseInt($sql_count);
this.IsQueried = false;
this.IsVisible = false;
this.DebuggerDIV = document.getElementById('debug_layer');
this.DebuggerTable = document.getElementById('debug_table');
this.RowCount = 0;
this.busyRequest = false;
// window.$Debugger = this; // this should be uncommented in case if debugger variable is not $Debugger
this.AddEvent(window, 'scroll', function (ev) { window.$Debugger.Resize(ev); });
this.AddEvent(window, 'resize', function (ev) { window.$Debugger.Resize(ev); });
// this.AddEvent(window, 'keydown', function (ev) { window.$Debugger.KeyDown(ev); }); // don't work in IE
document.onkeydown = function(ev) { window.$Debugger.KeyDown(ev); }
}
Debugger.prototype.SetOpacity = function(opacity)
{
this.DebuggerToolbar.style.opacity = (opacity / 100);
- this.DebuggerToolbar.style.MozOpacity = (opacity / 100);
- this.DebuggerToolbar.style.KhtmlOpacity = (opacity / 100);
- this.DebuggerToolbar.style.filter = "alpha(opacity=" + opacity + ")";
+ this.DebuggerToolbar.style.MozOpacity = (opacity / 100);
+ this.DebuggerToolbar.style.KhtmlOpacity = (opacity / 100);
+ this.DebuggerToolbar.style.filter = "alpha(opacity=" + opacity + ")";
+}
+
+Debugger.prototype.ToolbarClick = function ($button) {
+ switch ($button.id) {
+ case 'dbg_ReloadFrame':
+ self.location.reload();
+ break;
+
+ case 'dbg_ShowDebugger':
+ this.Toggle();
+ break;
+ }
}
Debugger.prototype.AddToolbar = function($var_name) {
var $span = document.createElement('SPAN');
$span.style.position = 'absolute';
- $span.innerHTML = '<table cellspacing="3" cellpadding="0" class="dbg-toolbar"><tr><td><input type="button" class="dbg-button" value="Reload Frame" onclick="self.location.reload();" /><input type="button" class="dbg-button" value="Show Debugger" onclick="' + $var_name + '.Toggle();" /><br /></td></tr></table>';
-
+ var $toolbar_content = '<td class="dbg-button" id="dbg_ReloadFrame" onclick="' + $var_name + '.ToolbarClick(this);">Reload Frame</td>';
+
+ if (this.ErrorsCount > 0) {
+ $toolbar_content += '<td class="dbg-separator"></td><td class="dbg-button debug_error" style="font-weight: bold;" id="dbg_ShowDebugger" onclick="' + $var_name + '.ToolbarClick(this);">Show Debugger (' + this.ErrorsCount + ' errors)</td>';
+ }
+ else {
+ $toolbar_content += '<td class="dbg-button" id="dbg_ShowDebugger" onclick="' + $var_name + '.ToolbarClick(this);">Show Debugger</td>';
+ }
+
+ if (this.SQLCount > 0) {
+ $toolbar_content += '<td class="dbg-separator"></td><td>' + this.SQLCount + ' sqls</td>';
+ }
+
+ $span.innerHTML = '<table cellpadding="0" cellspacing="3" class="dbg-toolbar"><tr>' + $toolbar_content + '</tr></table>';
+
this.DebuggerToolbar = $span;
this.SetOpacity(20);
$span.onmouseover = function() {
$Debugger.SetOpacity(100);
}
$span.onmouseout = function() {
$Debugger.SetOpacity(20);
}
var $body = document.getElementsByTagName('BODY')[0];
$body.insertBefore($span, $body.firstChild);
}
Debugger.prototype.AppendRow = function($html) {
this.RowCount++;
var $tr = document.createElement('TR');
this.DebuggerTable.appendChild($tr);
$tr.className = 'debug_row_' + (this.RowCount % 2 ? 'odd' : 'even');
$tr.id = 'debug_row_' + this.RowCount;
var $td = document.createElement('TD');
$td.className = 'debug_cell';
$td.innerHTML = $html;
$tr.appendChild($td);
}
Debugger.prototype.RemoveRow = function($row_index) {
this.DebuggerTable.deleteRow($row_index);
this.RowCount--;
}
Debugger.prototype.Clear = function() {
if (!this.IsQueried) return false;
this.IsQueried = false;
while (this.DebuggerTable.rows.length) {
this.RemoveRow(0);
}
}
Debugger.prototype.KeyDown = function($e) {
var $KeyCode = this.GetKeyCode($e);
if ($KeyCode == 123 || $KeyCode == 27) {// F12 or ESC
this.Toggle($KeyCode);
this.StopEvent($e);
}
}
Debugger.prototype.OpenDOMViewer = function() {
var $value = document.getElementById('dbg_domviewer').value;
DOMViewerObj = ($value.indexOf('"') != -1) ? document.getElementById( $value.substring(1,$value.length-1) ) : eval($value);
window.open(this.DOMViewerURL);
return false;
}
Debugger.prototype.GetKeyCode = function($e) {
$e = ($e) ? $e : event;
var target = ($e.target) ? $e.target : $e.scrElement;
var charCode = ($e.charCode) ? $e.charCode : (($e.which) ? $e.which : $e.keyCode);
return charCode;
}
Debugger.prototype.StopEvent = function($e) {
$e = ($e) ? $e : event;
$e.cancelBubble = true;
if ($e.stopPropagation) $e.stopPropagation();
}
Debugger.prototype.Toggle = function($KeyCode) {
if(!this.DebuggerDIV) return false;
this.IsVisible = this.DebuggerDIV.style.display == 'none' ? false : true;
if (!this.IsVisible && $KeyCode == 27) {
return false;
}
this.Resize(null);
if (!this.IsQueried) {
this.Query();
}
this.DebuggerDIV.style.display = this.IsVisible ? 'none' : 'block';
}
Debugger.prototype.Query = function() {
DebugReq.makeRequest(this.DebugURL, this.busyRequest, '', this.successCallback, this.errorCallback, '', this);
}
Debugger.prototype.successCallback = function(p_req, p_pass, p_object) {
var contents = p_req.responseText;
contents = contents.split(p_object.RowSeparator);
if (contents.length == 1) {
alert('error: '+p_req.responseText);
p_object.IsQueried = true;
return ;
}
for (var $i = 0; $i < contents.length - 1; $i++) {
p_object.AppendRow(contents[$i]);
}
p_object.Refresh();
}
Debugger.prototype.errorCallback = function(p_req, p_pass, p_object) {
alert('AJAX ERROR: '+DebugReq.getErrorHtml(p_req));
p_object.Refresh();
}
Debugger.prototype.Refresh = function() {
// progress mether row
this.RemoveRow(0);
this.IsQueried = true;
this.DebuggerDIV.scrollTop = this.IsFatalError ? 10000000 : 0;
this.DebuggerDIV.scrollLeft = 0;
}
Debugger.prototype.Resize = function($e) {
if (!this.DebuggerDIV) return false;
var $pageTop = document.all ? document.body.offsetTop + document.body.scrollTop : window.scrollY;
this.DebuggerDIV.style.top = $pageTop + 'px';
this.DebuggerDIV.style.height = GetWindowHeight() + 'px';
return true;
}
function GetWindowHeight() {
var currWinHeight;
if (window.innerHeight) {//FireFox with correction for status bar at bottom of window
currWinHeight = window.innerHeight - 10;
} else if (document.documentElement.clientHeight) {//IE 7 with correction for address bar
currWinHeight = document.documentElement.clientHeight - 10;
} else if (document.body.offsetHeight) {//IE 4+
currWinHeight = document.body.offsetHeight - 5 + 15 - 10; // + 10
}
return currWinHeight;
}
/*function GetWinHeight() {
if (window.innerHeight) return window.innerHeight;
else if (document.documentElement.clientHeight) return document.documentElement.clientHeight;
else if (document.body.offsetHeight) return document.body.offsetHeight;
else return _winHeight;
}*/
Debugger.prototype.SetClipboard = function(copyText) {
if (window.clipboardData) {
// IE send-to-clipboard method.
window.clipboardData.setData('Text', copyText);
}
else if (window.netscape) {
// You have to sign the code to enable this or allow the action in about:config by changing user_pref("signed.applets.codebase_principal_support", true);
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
// Store support string in an object.
var str = Components.classes['@mozilla.org/supports-string;1'].createInstance(Components.interfaces.nsISupportsString);
if (!str) {
return false;
}
str.data = copyText;
// Make transferable.
var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
if (!trans) {
return false;
}
// Specify what datatypes we want to obtain, which is text in this case.
trans.addDataFlavor('text/unicode');
trans.setTransferData('text/unicode', str, copyText.length * 2);
var clipid = Components.interfaces.nsIClipboard;
var clip = Components.classes['@mozilla.org/widget/clipboard;1'].getService(clipid);
if (!clip) {
return false;
}
clip.setData(trans, null, clipid.kGlobalClipboard);
}
}
Debugger.prototype.ShowProps = function($Obj, $Name) {
var $ret = '';
for ($Prop in $Obj) {
$ret += $Name + '.' + $Prop + ' = ' + $Obj[$Prop] + "\n";
}
return alert($ret);
}
Debugger.prototype.editFile = function($fileName, $lineNo) {
if (!document.all) {
alert('Only works in IE');
return;
}
if (!this.EditorPath) {
alert('Editor path not defined!');
return;
}
var $launch_object = new ActiveXObject('LaunchinIE.Launch');
var $editor_path = this.EditorPath;
$editor_path = $editor_path.replace('%F', $fileName);
$editor_path = $editor_path.replace('%L',$lineNo);
$launch_object.LaunchApplication($editor_path);
}
Debugger.prototype.ToggleTraceArgs = function($arguments_layer_id) {
var $arguments_layer = document.getElementById($arguments_layer_id);
$arguments_layer.style.display = ($arguments_layer.style.display == 'none') ? 'block' : 'none';
}
Debugger.prototype.AddEvent = function (el, evname, func) {
var $status = false;
if (document.all) {
$status = el.attachEvent('on' + evname, func);
} else {
$status = el.addEventListener(evname, func, true);
}
}
\ No newline at end of file
Property changes on: trunk/core/kernel/utility/debugger/debugger.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.10
\ No newline at end of property
+1.11
\ No newline at end of property
Index: trunk/core/kernel/utility/debugger/debugger_responce.php
===================================================================
--- trunk/core/kernel/utility/debugger/debugger_responce.php (revision 7634)
+++ trunk/core/kernel/utility/debugger/debugger_responce.php (revision 7635)
@@ -1,55 +1,58 @@
<?php
+ ini_set('memory_limit', -1);
+ set_time_limit(0);
+
define('FULL_PATH', realpath(dirname(__FILE__).'/../../../..') );
$sid = $_GET['sid'];
$path = isset($_GET['path']) ? $_GET['path'] : '/kernel/cache';
if (!preg_match('/^@([\d]+)@$/', $sid)) exit;
$debug_file = FULL_PATH.$path.'/debug_'.$sid.'.txt';
if (file_exists($debug_file)) {
$ret = file_get_contents($debug_file);
$ret = str_replace('#DBG_FILESIZE#', formatSize( filesize($debug_file) ), $ret);
unlink($debug_file);
}
else {
$ret = 'file not found';
}
if (function_exists('gzencode') && strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
header('Content-Encoding: gzip');
echo gzencode($ret);
}
else {
echo $ret;
}
/**
* Formats file/memory size in nice way
*
* @param int $bytes
* @return string
* @access public
*/
function formatSize($bytes)
{
if ($bytes >= 1099511627776) {
$return = round($bytes / 1024 / 1024 / 1024 / 1024, 2);
$suffix = "TB";
} elseif ($bytes >= 1073741824) {
$return = round($bytes / 1024 / 1024 / 1024, 2);
$suffix = "GB";
} elseif ($bytes >= 1048576) {
$return = round($bytes / 1024 / 1024, 2);
$suffix = "MB";
} elseif ($bytes >= 1024) {
$return = round($bytes / 1024, 2);
$suffix = "KB";
} else {
$return = $bytes;
$suffix = "Byte";
}
$return .= ' '.$suffix;
return $return;
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/utility/debugger/debugger_responce.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property
Index: trunk/core/kernel/utility/debugger/debugger.css
===================================================================
--- trunk/core/kernel/utility/debugger/debugger.css (revision 7634)
+++ trunk/core/kernel/utility/debugger/debugger.css (revision 7635)
@@ -1,94 +1,103 @@
.dbg_profiler {
margin-top: 5px;
padding: 0px;
height: 10px;
border: 1px solid #000000;
float: left;
display: inline;
}
.dbg_flat_table, .dbg_stats_table {
border-collapse: collapse;
width: auto;
margin: 0px;
}
.dbg_flat_table TD, .dbg_stats_table TD {
border: 1px solid #CCCCCC;
padding: 4px;
}
.dbg_stats_table TD {
background-color: #FFFFFF;
font-family: Arial, Verdana;
font-size: 9pt;
text-align: left;
}
.debug_layer_table {
border-collapse: collapse;
}
.debug_text, .debug_row_even TD, .debug_row_odd TD {
color: #000000;
font-family: Verdana;
font-size: 11px;
}
.debug_cell {
border: 1px solid #FF0000;
padding: 4px;
text-align: left;
}
.debug_row_even {
background-color: #CCCCFF;
}
.debug_row_odd {
background-color: #FFFFCC;
}
.debug_layer_container {
left: 2px;
top: 1px;
z-index: +1000;
position: absolute;
overflow: auto;
border: 2px solid;
padding: 3px;
border-top-color: threedlightshadow;
border-left-color: threedlightshadow;
border-right-color: threeddarkshadow;
border-bottom-color: threeddarkshadow;
background-color: buttonface;
}
.debug_layer {
padding: 0px;
}
.debug_error {
color: #FF0000;
}
.dbg-toolbar {
- background-color: #D4D0C8;
border: 1px solid #000000;
+ background-color: #D4D0C8;
width: auto;
}
-.dbg-button, .dbg-button:hover {
+.dbg-toolbar td {
font-size: 13px;
- font-family: Arial, Helvetica;
+ font-family: Tahoma;
+ padding: 1px 5px 1px 5px;
}
-.dbg-button {
- background-color: #D4D0C8;
+.dbg-toolbar td.dbg-button {
border: 1px solid #D4D0C8;
+ background-color: #D4D0C8;
}
-.dbg-button:hover {
- background-color: #B5BDD2;
+.dbg-toolbar td.dbg-button:hover {
border: 1px solid #0A246A;
-}
\ No newline at end of file
+ background-color: #B5BDD2;
+}
+
+.dbg-toolbar td.dbg-separator {
+ background-color: #000000;
+ width: 1px;
+ padding: 0px;
+}
+
+
Property changes on: trunk/core/kernel/utility/debugger/debugger.css
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5
\ No newline at end of property
+1.6
\ No newline at end of property
Index: trunk/core/kernel/utility/formatters/multilang_formatter.php
===================================================================
--- trunk/core/kernel/utility/formatters/multilang_formatter.php (revision 7634)
+++ trunk/core/kernel/utility/formatters/multilang_formatter.php (revision 7635)
@@ -1,126 +1,129 @@
<?php
class kMultiLanguage extends kFormatter
{
/**
* Returns ML field equivalent to field name specifed
*
* @param string $field_name
* @param bool $from_primary use primary/current language for name custruction
* @return string
*/
function LangFieldName($field_name, $from_primary = false)
{
$lang = $from_primary ? $this->Application->GetDefaultLanguageId() : $this->Application->GetVar('m_lang');
if (!$lang) $lang = $this->Application->GetDefaultLanguageId();
return 'l'.$lang.'_'.$field_name;
}
function PrepareOptions($field_name, &$field_options, &$object)
{
if (getArrayValue($object->Fields, $field_name, 'master_field')) return;
$lang_field_name = $this->LangFieldName($field_name);
//substitude title field
$title_field = $this->Application->getUnitOption($object->Prefix, 'TitleField');
if ($title_field == $field_name) {
$this->Application->setUnitOption($object->Prefix, 'TitleField', $lang_field_name);
}
//substitude fields
$fields = $this->Application->getUnitOption($object->Prefix, 'Fields');
if ( isset($fields[$field_name]) ) {
$fields[$lang_field_name] = $fields[$field_name];
$fields[$lang_field_name]['master_field'] = $field_name;
$object->Fields[$lang_field_name] = $fields[$lang_field_name];
$fields[$field_name]['required'] = false;
$object->Fields[$field_name]['required'] = false;
$object->VirtualFields[$field_name] = $object->Fields[$field_name];
}
$this->Application->setUnitOption($object->Prefix, 'Fields', $fields);
//substitude virtual fields
$virtual_fields = $this->Application->getUnitOption($object->Prefix, 'VirtualFields');
if ( isset($virtual_fields[$field_name]) ) {
$virtual_fields[$lang_field_name] = $virtual_fields[$field_name];
$virtual_fields[$lang_field_name]['master_field'] = $field_name;
$object->VirtualFields[$lang_field_name] = $virtual_fields[$lang_field_name];
$virtual_fields[$field_name]['required'] = false;
$object->VirtualFields[$field_name]['required'] = false;
}
$this->Application->setUnitOption($object->Prefix, 'VirtualFields', $virtual_fields);
//substitude grid fields
$grids = $this->Application->getUnitOption($object->Prefix, 'Grids', Array());
foreach ($grids as $name => $grid) {
if ( getArrayValue($grid, 'Fields', $field_name) ) {
array_rename_key($grids[$name]['Fields'], $field_name, $lang_field_name);
}
}
$this->Application->setUnitOption($object->Prefix, 'Grids', $grids);
//substitude default sortings
$sortings = $this->Application->getUnitOption($object->Prefix, 'ListSortings', Array());
foreach ($sortings as $special => $the_sortings) {
if (isset($the_sortings['ForcedSorting'])) {
array_rename_key($sortings[$special]['ForcedSorting'], $field_name, $lang_field_name);
}
if (isset($the_sortings['Sorting'])) {
array_rename_key($sortings[$special]['Sorting'], $field_name, $lang_field_name);
}
}
$this->Application->setUnitOption($object->Prefix, 'ListSortings', $sortings);
//TODO: substitude possible language-fields sortings after changing language
}
/*function UpdateSubFields($field, $value, &$options, &$object)
{
}
function UpdateMasterFields($field, $value, &$options, &$object)
{
}*/
function Format($value, $field_name, &$object, $format=null)
{
$master_field = getArrayValue($object->Fields, $field_name, 'master_field');
if (!$master_field) { // if THIS field is master it does NOT have reference to it's master_field
$lang = $this->Application->GetVar('m_lang');
$value = $object->GetDBField('l'.$lang.'_'.$field_name); //getting value of current language
$master_field = $field_name; // THIS is master_field
}
+ $options = $object->GetFieldOptions($field_name);
+ $format = isset($format) ? $format : ( isset($options['format']) ? $options['format'] : null);
+
if ( $value == '' && $format != 'no_default') { // try to get default language value
$def_lang_value = $object->GetDBField('l'.$this->Application->GetDefaultLanguageId().'_'.$master_field);
if ($def_lang_value == '') return NULL;
return $def_lang_value; //return value from default language
}
return $value;
}
function Parse($value, $field_name, &$object)
{
$lang = $this->Application->GetVar('m_lang');
$def_lang = $this->Application->GetDefaultLanguageId();
$master_field = getArrayValue($object->Fields, $field_name, 'master_field');
if ( getArrayValue($object->Fields, $field_name, 'required') && ( (string) $value == '' ) ) {
$object->FieldErrors[$master_field]['pseudo'] = 'required';
};
if (!$this->Application->GetVar('allow_translation') && $lang != $def_lang && getArrayValue($object->Fields, $field_name, 'required')) {
$def_lang_field = 'l'.$def_lang.'_'.$master_field;
if ( !$object->ValidateRequired($def_lang_field, $object->Fields[$field_name]) ) {
$object->FieldErrors[$master_field]['pseudo'] = 'primary_lang_required';
}
}
if ($value == '') return NULL;
return $value;
}
}
\ No newline at end of file
Property changes on: trunk/core/kernel/utility/formatters/multilang_formatter.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/kernel/utility/formatters/unit_formatter.php
===================================================================
--- trunk/core/kernel/utility/formatters/unit_formatter.php (revision 7634)
+++ trunk/core/kernel/utility/formatters/unit_formatter.php (revision 7635)
@@ -1,84 +1,84 @@
<?php
class kUnitFormatter extends kFormatter {
function PrepareOptions($field_name, &$field_options, &$object)
{
if( !isset($field_options['master_field']) )
{
$regional =& $this->Application->recallObject('lang.current');
$add_fields = Array();
$options_a = Array('type' => 'int','error_field' => $field_name,'master_field' => $field_name,'format' => '%d' );
$options_b = Array('type' => 'double','error_field' => $field_name,'master_field' => $field_name,'format' => '%0.2f' );
switch( $regional->GetDBField('UnitSystem') )
{
case 2: // US/UK
$field_options_copy = $field_options;
unset($field_options_copy['min_value_exc']);
$add_fields[$field_name.'_a'] = array_merge_recursive2($field_options_copy, $options_a);
$add_fields[$field_name.'_b'] = array_merge_recursive2($field_options_copy, $options_b);
break;
default:
}
$add_fields = array_merge_recursive2($add_fields, $object->VirtualFields);
$object->setVirtualFields($add_fields);
}
}
function UpdateMasterFields($field, $value, &$options, &$object)
{
if( !isset($options['master_field']) )
{
$regional =& $this->Application->recallObject('lang.current');
switch( $regional->GetDBField('UnitSystem') )
{
case 2: // US/UK
- $major = $object->GetDirtyField($field.'_a');
- $minor = $object->GetDirtyField($field.'_b');
+ $major = $this->TypeCast($object->GetDBField($field.'_a'), $options);
+ $minor = $this->TypeCast($object->GetDBField($field.'_b'), $options);
if($major === '' && $minor === '')
{
$value = null;
}
elseif($major === null && $minor === null)
{
unset($object->Fields[$field]);
return;
}
else
{
$value = Pounds2Kg($major, $minor);
}
break;
default:
}
$object->SetDBField($field, $value);
}
}
function UpdateSubFields($field, $value, &$options, &$object)
{
if( !isset($options['master_field']) )
{
$regional =& $this->Application->recallObject('lang.current');
switch( $regional->GetDBField('UnitSystem') )
{
case 2: // US/UK
if($value === null)
{
$major = null;
$minor = null;
}
else
{
list($major,$minor) = Kg2Pounds($value);
/*$major = floor( $value / 0.5 );
$minor = ($value - $major * 0.5) * 32;*/
}
$object->SetDBField($field.'_a', $major);
$object->SetDBField($field.'_b', $minor);
break;
default:
}
}
}
}
\ No newline at end of file
Property changes on: trunk/core/kernel/utility/formatters/unit_formatter.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/core/kernel/utility/formatters/formatter.php
===================================================================
--- trunk/core/kernel/utility/formatters/formatter.php (revision 7634)
+++ trunk/core/kernel/utility/formatters/formatter.php (revision 7635)
@@ -1,159 +1,178 @@
<?php
class kFormatter extends kBase {
/**
* Convert's value to match type from config
*
* @param mixed $value
* @param Array $options
* @return mixed
* @access protected
*/
function TypeCast($value, $options)
{
$ret = true;
if( isset($options['type']) )
{
$field_type = $options['type'];
$type_ok = preg_match('#int|integer|double|float|real|numeric|string#', $field_type);
- if($field_type == 'string') return $value;
+ if ($field_type == 'string') {
+ if (!$this->Application->IsAdmin() && isset($options['allow_html']) && $options['allow_html']) {
+ // this allows to revert htmlspecialchars call for each field submitted on front-end
+ $value = unhtmlentities($value);
+ }
+ return $value;
+ }
static $comma = null;
static $thousands = null;
if (is_null($comma) || is_null($thousands)) {
$lang =& $this->Application->recallObject('lang.current');
$comma = $lang->GetDBField('DecimalPoint');
$thousands = $lang->GetDBField('ThousandSep');
}
$value = str_replace($thousands, '', $value);
$value = str_replace($comma, '.', $value);
if ($value != '' && $type_ok)
{
$ret = is_numeric($value);
if($ret)
{
$f = 'is_'.$field_type;
settype($value, $field_type);
$ret = $f($value);
}
}
}
return $ret ? $value : false;
}
+ function TypeCastArray($src, &$object)
+ {
+ $dst = array();
+ foreach ($src as $id => $row) {
+ $tmp_row = array();
+ foreach ($row as $fld => $value) {
+ $tmp_row[$fld] = $this->TypeCast($value, $object->Fields[$fld]);
+ }
+ $dst[$id] = $tmp_row;
+ }
+ return $dst;
+ }
+
//function Format($value, $options, &$errors)
function Format($value, $field_name, &$object, $format=null)
{
if ( is_null($value) ) return '';
$options = $object->GetFieldOptions($field_name);
if ( isset($format) ) $options['format'] = $format;
$tc_value = $value; // $this->TypeCast($value,$options);
if( ($tc_value === false) || ("$tc_value" != "$value") ) return $value; // for leaving badly formatted date on the form
if (isset($options['format'])) {
$tc_value = sprintf($options['format'], $tc_value);
}
if (preg_match('#int|integer|double|float|real|numeric#', $options['type'])) {
$lang =& $this->Application->recallObject('lang.current');
return $lang->formatNumber($tc_value);
}
return $tc_value;
}
//function Parse($value, $options, &$errors)
function Parse($value, $field_name, &$object)
{
if ($value == '') return NULL;
$options = $object->GetFieldOptions($field_name);
$tc_value = $this->TypeCast($value,$options);
if($tc_value === false) return $value; // for leaving badly formatted date on the form
if( isset($options['type']) )
{
if( preg_match('#double|float|real|numeric#', $options['type']) ) $tc_value = str_replace(',', '.', $tc_value);
}
if( isset($options['regexp']) )
{
if( !preg_match($options['regexp'], $value) )
{
$object->FieldErrors[$field_name]['pseudo'] = 'invalid_format';
}
}
return $tc_value;
}
function HumanFormat($format)
{
return $format;
}
/**
* The method is supposed to alter config options or cofigure object in some way based on its usage of formatters
* The methods is called for every field with formatter defined when configuring item.
* Could be used for adding additional VirtualFields to an object required by some special Formatter
*
* @param string $field_name
* @param array $field_options
* @param kDBBase $object
*/
function PrepareOptions($field_name, &$field_options, &$object)
{
}
/**
* Used for split fields like timestamp -> date, time
* Called from DBItem to update sub fields values after loading item
*
* @param unknown_type $field
* @param unknown_type $value
* @param unknown_type $options
* @param unknown_type $object
*/
function UpdateSubFields($field, $value, &$options, &$object)
{
}
/**
* Used for split fields like timestamp -> date, time
* Called from DBItem Validate (before validation) to get back master field value from its sub_fields
*
* @param unknown_type $field
* @param unknown_type $value
* @param unknown_type $options
* @param unknown_type $object
*/
function UpdateMasterFields($field, $value, &$options, &$object)
{
}
/* function GetErrorMsg($pseudo_error, $options)
{
if ( isset($options['error_msgs'][$pseudo_error]) ) {
return $options['error_msgs'][$pseudo_error];
}
else {
return $this->ErrorMsgs[$pseudo_error];
}
}*/
function GetSample($field, &$options, &$object)
{
if (isset($options['sample_value'])) return $options['sample_value'];
}
}
\ No newline at end of file
Property changes on: trunk/core/kernel/utility/formatters/formatter.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/core/kernel/utility/formatters/password_formatter.php
===================================================================
--- trunk/core/kernel/utility/formatters/password_formatter.php (revision 7634)
+++ trunk/core/kernel/utility/formatters/password_formatter.php (revision 7635)
@@ -1,111 +1,114 @@
<?php
class kPasswordFormatter extends kFormatter
{
function PrepareOptions($field_name, &$field_options, &$object)
{
if( isset( $field_options['verify_field'] ) )
{
$add_fields = Array();
$options = Array('master_field' => $field_name, 'formatter' => 'kPasswordFormatter');
if (isset($field_options['encryption_method'])) {
$options['encryption_method'] = $field_options['encryption_method'];
}
if (isset($field_options['salt'])) {
$options['salt'] = $field_options['salt'];
}
+ if (isset($field_options['required'])) {
+ $options['required'] = $field_options['required'];
+ }
$add_fields[ $field_options['verify_field'] ] = $options;
$add_fields[$field_name.'_plain'] = Array('type'=>'string', 'error_field'=>$field_name);
$add_fields[ $field_options['verify_field'].'_plain' ] = Array('type'=>'string', 'error_field'=>$field_options['verify_field'] );
$add_fields = array_merge_recursive2($add_fields, $object->VirtualFields);
$object->setVirtualFields($add_fields);
}
}
function Format($value, $field_name, &$object, $format=null)
{
return $value;
}
function Parse($value, $field_name, &$object)
{
$options = $object->GetFieldOptions($field_name);
$fields = Array('master_field','verify_field');
$fields_set = true;
$flip_count = 0;
while($flip_count < 2)
{
if( getArrayValue($options,$fields[0]) )
{
$object->SetDBField($field_name.'_plain', $value);
if( !getArrayValue($object->Fields[ $options[ $fields[0] ] ], $fields[1].'_set') )
{
$object->Fields[ $options[ $fields[0] ] ][$fields[1].'_set'] = true;
}
$password_field = $options[ $fields[0] ];
$verify_field = $field_name;
}
$fields = array_reverse($fields);
$flip_count++;
}
-
+
$salt = isset($object->Fields[$password_field]['salt']) ? $object->Fields[$password_field]['salt'] : '';
if( getArrayValue($object->Fields[$password_field], 'verify_field_set') && getArrayValue($object->Fields[$verify_field], 'master_field_set') )
{
$new_password = $object->GetDBField($password_field.'_plain');
$verify_password = $object->GetDBField($verify_field.'_plain');
if($new_password == '' && $verify_password == '')
{
if( $object->GetDBField($password_field) != $this->EncryptPassword('', $salt) )
{
if ($options['encryption_method'] == 'plain') return $value;
return $this->EncryptPassword($value);
}
else
{
$object->Fields[$password_field.'_plain']['required'] = true;
$object->Fields[$verify_field.'_plain']['required'] = true;
return null;
}
}
$min_length = $this->Application->ConfigValue('Min_Password');
if( strlen($new_password) >= $min_length )
{
if($new_password != $verify_password)
{
$object->ErrorMsgs['passwords_do_not_match'] = $this->Application->Phrase('lu_passwords_do_not_match');
$object->FieldErrors[$password_field]['pseudo'] = 'passwords_do_not_match';
$object->FieldErrors[$verify_field]['pseudo'] = 'passwords_do_not_match';
}
}
else
{
$object->ErrorMsgs['passwords_min_length'] = sprintf($this->Application->Phrase('lu_passwords_too_short'), $min_length);
$object->FieldErrors[$password_field]['pseudo'] = 'passwords_min_length';
$object->FieldErrors[$verify_field]['pseudo'] = 'passwords_min_length';
}
}
if($value == '') return $object->GetDBField($field_name);
if ($options['encryption_method'] == 'plain') return $value;
return $this->EncryptPassword($value, $salt);
}
function EncryptPassword($value, $salt=null)
{
if (!isset($salt) || !$salt) {
// if empty salt, assume, that it's not passed at all
return md5($value);
}
return md5(md5($value).$salt);
}
}
\ No newline at end of file
Property changes on: trunk/core/kernel/utility/formatters/password_formatter.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/core/kernel/utility/debugger.php
===================================================================
--- trunk/core/kernel/utility/debugger.php (revision 7634)
+++ trunk/core/kernel/utility/debugger.php (revision 7635)
@@ -1,1168 +1,1185 @@
<?php
if( !class_exists('Debugger') ) {
class Debugger {
/**
* Set to true if fatal error occured
*
* @var bool
*/
var $IsFatalError = false;
/**
* Debugger data for building report
*
* @var Array
*/
var $Data = Array();
var $ProfilerData = Array();
var $ProfilerTotals = Array();
var $ProfilerTotalCount = Array();
/**
* Prevent recursion when processing debug_backtrace() function results
*
* @var Array
*/
var $RecursionStack = Array();
var $scrollbarWidth = 0;
/**
* Long errors are saved here, because trigger_error doesn't support error messages over 1KB in size
*
* @var Array
*/
var $longErrors = Array();
var $IncludesData = Array();
var $IncludeLevel = 0;
var $reportDone = false;
/**
* Transparent spacer image used in case of none spacer image defined via SPACER_URL contant.
* Used while drawing progress bars (memory usage, time usage, etc.)
*
* @var string
*/
var $dummyImage = '';
/**
* Temporary files created by debugger will be stored here
*
* @var string
*/
var $tempFolder = '';
/**
* Debug rows will be separated using this string before writing to debug file
*
* @var string
*/
var $rowSeparator = '@@';
/**
* Base URL for debugger includes
*
* @var string
*/
var $baseURL = '';
function Debugger()
{
global $start, $dbg_options;
// check if user haven't defined DEBUG_MODE contant directly
if (defined('DEBUG_MODE') && DEBUG_MODE) {
die('error: contant DEBUG_MODE defined directly, please use <strong>$dbg_options</strong> array instead');
}
// check IP before enabling debug mode
$ip_match = false;
$ip_addresses = isset($dbg_options['DBG_IP']) ? explode(';', $dbg_options['DBG_IP']) : Array ();
foreach ($ip_addresses as $ip_address) {
if ($this->netMatch($ip_address, $_SERVER['REMOTE_ADDR'])) {
$ip_match = true;
break;
}
}
if (!$ip_match) {
define('DEBUG_MODE', 0);
return ;
}
// debug is allowed for user, continue initialization
$this->InitDebugger();
$this->profileStart('kernel4_startup', 'Startup and Initialization of kernel4', $start);
$this->profileStart('script_runtime', 'Script runtime', $start);
error_reporting(E_ALL);
ini_set('display_errors', $this->constOn('DBG_ZEND_PRESENT') ? 0 : 1); // show errors on screen in case if not in Zend Studio debugging
$this->scrollbarWidth = $this->isGecko() ? 22 : 25; // vertical scrollbar width differs in Firefox and other browsers
$this->appendRequest();
}
/**
* Set's default values to constants debugger uses
*
*/
function InitDebugger()
{
global $dbg_options;
unset($_REQUEST['debug_host'], $_REQUEST['debug_fastfile'], $dbg_options['DBG_IP']); // this var messed up whole detection stuff :(
// Detect fact, that this session beeing debugged by Zend Studio
foreach ($_REQUEST as $rq_name => $rq_value) {
if (substr($rq_name, 0, 6) == 'debug_') {
$this->safeDefine('DBG_ZEND_PRESENT', 1);
break;
}
}
$this->safeDefine('DBG_ZEND_PRESENT', 0); // set this constant value to 0 (zero) to debug debugger using Zend Studio
// set default values for debugger constants
$dbg_constMap = Array(
'DBG_USE_HIGHLIGHT' => 1, // highlight output same as php code using "highlight_string" function
'DBG_WINDOW_WIDTH' => 700, // set width of debugger window (in pixels) for better viewing large amount of debug data
'DBG_USE_SHUTDOWN_FUNC' => DBG_ZEND_PRESENT ? 0 : 1, // use shutdown function to include debugger code into output
'DBG_HANDLE_ERRORS' => DBG_ZEND_PRESENT ? 0 : 1, // handle all allowed by php (see php manual) errors instead of default handler
'DBG_IGNORE_STRICT_ERRORS' => 1, // ignore PHP5 errors about private/public view modified missing in class declarations
'DBG_DOMVIEWER' => '/temp/domviewer.html', // path to DOMViewer on website
'DOC_ROOT' => str_replace('\\', '/', realpath($_SERVER['DOCUMENT_ROOT']) ), // windows hack
'DBG_LOCAL_BASE_PATH' => 'w:', // replace DOC_ROOT in filenames (in errors) using this path
);
// only for IE, in case if no windows php script editor defined
if (!defined('DBG_EDITOR')) {
// $dbg_constMap['DBG_EDITOR'] = 'c:\Program Files\UltraEdit\uedit32.exe %F/%L';
$dbg_constMap['DBG_EDITOR'] = 'c:\Program Files\Zend\ZendStudio-5.2.0\bin\ZDE.exe %F';
}
+ if (isset($_REQUEST['ajax']) && $_REQUEST['ajax'] && constOn('DBG_SKIP_AJAX')) {
+ $this->safeDefine('DBG_SKIP_REPORTING', 1);
+ }
+
// user defined options override debugger defaults
$dbg_constMap = $this->array_merge_recursive2($dbg_constMap, $dbg_options);
foreach ($dbg_constMap as $dbg_constName => $dbg_constValue) {
$this->safeDefine($dbg_constName, $dbg_constValue);
}
}
function constOn($const_name)
{
return defined($const_name) && constant($const_name);
}
function safeDefine($const_name, $const_value) {
if (!defined($const_name)) {
define($const_name, $const_value);
}
}
function array_merge_recursive2($paArray1, $paArray2)
{
if (!is_array($paArray1) or !is_array($paArray2)) {
return $paArray2;
}
foreach ($paArray2 AS $sKey2 => $sValue2) {
$paArray1[$sKey2] = isset($paArray1[$sKey2]) ? array_merge_recursive2($paArray1[$sKey2], $sValue2) : $sValue2;
}
return $paArray1;
}
function netMatch($network, $ip) {
$network = trim($network);
$ip = trim($ip);
if ($network == $ip) {
// comparing 2 ip addresses directly
return true;
}
$d = strpos($network, '-');
if ($d === false) {
// sigle subnet specified
$ip_arr = explode('/', $network);
if (!preg_match("@\d*\.\d*\.\d*\.\d*@", $ip_arr[0], $matches)) {
$ip_arr[0] .= '.0'; // Alternate form 194.1.4/24
}
$network_long = ip2long($ip_arr[0]);
$x = ip2long($ip_arr[1]);
$mask = long2ip($x) == $ip_arr[1] ? $x : (0xffffffff << (32 - $ip_arr[1]));
$ip_long = ip2long($ip);
return ($ip_long & $mask) == ($network_long & $mask);
}
else {
// ip address range specified
$from = ip2long(trim(substr($network, 0, $d)));
$to = ip2long(trim(substr($network, $d + 1)));
$ip = ip2long($ip);
return ($ip >= $from && $ip <= $to);
}
}
function InitReport()
{
if (!class_exists('kApplication')) return false;
$application =& kApplication::Instance();
// string used to separate debugger records while in file (used in debugger dump filename too)
$this->rowSeparator = '@'.(is_object($application->Factory) ? $application->GetSID() : 0).'@';
// include debugger files from this url
$reg_exp = '/^'.preg_quote(FULL_PATH, '/').'/';
$kernel_path = preg_replace($reg_exp, '', KERNEL_PATH, 1);
$this->baseURL = PROTOCOL.SERVER_NAME.rtrim(BASE_PATH, '/').$kernel_path.'/utility/debugger';
// save debug output in this folder
$this->tempFolder = defined('WRITEABLE') ? WRITEABLE.'/cache' : FULL_PATH.'/kernel/cache';
}
function mapLongError($msg)
{
$key = $this->generateID();
$this->longErrors[$key] = $msg;
return $key;
}
/**
* Appends all passed variable values (wihout variable names) to debug output
*
*/
function dumpVars()
{
$dumpVars = func_get_args();
foreach ($dumpVars as $varValue) {
$this->Data[] = Array('value' => $varValue, 'debug_type' => 'var_dump');
}
}
function prepareHTML($dataIndex)
{
$Data =& $this->Data[$dataIndex];
if ($Data['debug_type'] == 'html') {
return $Data['html'];
}
switch ($Data['debug_type']) {
case 'error':
$fileLink = $this->getFileLink($Data['file'], $Data['line']);
$ret = '<b class="debug_error">'.$this->getErrorNameByCode($Data['no']).'</b>: '.$Data['str'];
$ret .= ' in <b>'.$fileLink.'</b> on line <b>'.$Data['line'].'</b>';
return $ret;
break;
case 'var_dump':
return $this->highlightString( $this->print_r($Data['value'], true) );
break;
case 'trace':
ini_set('memory_limit', '500M');
$trace =& $Data['trace'];
$i = 0; $traceCount = count($trace);
$ret = '';
while ($i < $traceCount) {
$traceRec =& $trace[$i];
$argsID = 'trace_args_'.$dataIndex.'_'.$i;
$has_args = isset($traceRec['args']);
if (isset($traceRec['file'])) {
$func_name = isset($traceRec['class']) ? $traceRec['class'].$traceRec['type'].$traceRec['function'] : $traceRec['function'];
$args_link = $has_args ? '<a href="javascript:$Debugger.ToggleTraceArgs(\''.$argsID.'\');" title="Show/Hide Function Arguments"><b>Function</b></a>' : '<b>Function</b>';
$ret .= $args_link.': '.$this->getFileLink($traceRec['file'], $traceRec['line'], $func_name);
$ret .= ' in <b>'.basename($traceRec['file']).'</b> on line <b>'.$traceRec['line'].'</b><br>';
}
else {
$ret .= 'no file information available';
}
if ($has_args) {
// if parameter value is longer then 200 symbols, then leave only first 50
$args = $this->highlightString($this->print_r($traceRec['args'], true, 50, 200));
$ret .= '<div id="'.$argsID.'" style="display: none;">'.$args.'</div>';
}
$i++;
}
return $ret;
break;
case 'profiler':
$profileKey = $Data['profile_key'];
$Data =& $this->ProfilerData[$profileKey];
$runtime = ($Data['ends'] - $Data['begins']); // in seconds
$totals_key = getArrayValue($Data, 'totalsKey');
if ($totals_key) {
$total_before = $Data['totalsBefore'];
$total = $this->ProfilerTotals[$totals_key];
$div_width = Array();
$total_width = ($this->getWindowWidth()-10);
$div_width['before'] = round(($total_before / $total) * $total_width);
$div_width['current'] = round(($runtime / $total) * $total_width);
$div_width['left'] = round((($total - $total_before - $runtime) / $total) * $total_width);
$ret = '<b>Name</b>: '.$Data['description'].'<br />';
if (isset($Data['file'])) {
$ret .= '[<b>Runtime</b>: '.$runtime.'s] [<b>File</b>: '.$Data['file'].']<br />';
}
else {
$ret .= '<b>Runtime</b>: '.$runtime.'s<br />';
}
$ret .= '<div class="dbg_profiler" style="width: '.$div_width['before'].'px; border-right: 0px; background-color: #298DDF;"><img src="'.$this->dummyImage.'" width="1" height="1"/></div>';
$ret .= '<div class="dbg_profiler" style="width: '.$div_width['current'].'px; border-left: 0px; border-right: 0px; background-color: #EF4A4A;"><img src="'.$this->dummyImage.'" width="1" height="1"/></div>';
$ret .= '<div class="dbg_profiler" style="width: '.$div_width['left'].'px; border-left: 0px; background-color: #DFDFDF;"><img src="'.$this->dummyImage.'" width="1" height="1"/></div>';
return $ret;
}
else {
return '<b>Name</b>: '.$Data['description'].'<br><b>Runtime</b>: '.$runtime.'s';
}
break;
default:
return 'incorrect debug data';
break;
}
}
function getWindowWidth()
{
return DBG_WINDOW_WIDTH - $this->scrollbarWidth - 8;
}
/**
* Tells debugger to skip objects that are heavy in plan of memory usage while printing debug_backtrace results
*
* @param Object $object
* @return bool
*/
function IsBigObject(&$object)
{
$skip_classes = Array(
defined('APPLICATION_CLASS') ? APPLICATION_CLASS : 'kApplication',
'kFactory',
'kUnitConfigReader',
'TemplateParser',
);
foreach ($skip_classes as $class_name) {
if (strtolower(get_class($object)) == strtolower($class_name)) {
return true;
}
}
return false;
}
/**
* Advanced version of print_r (for debugger only). Don't print objects recursively
*
* @param Array $array
* @param bool $return_output return output or print it out
* @param int $cut_first cut first N symbols, don't cut anything if -1 specified
* @package int $cut_min_length cut only of this length of string or greather
* @return string
*/
function print_r(&$array, $return_output = false, $cut_first = -1, $cut_min_length = -1)
{
static $first_line = true, $tab_count = -1;
if (is_null($array)) {
return 'NULL';
}
elseif (!is_array($array)) {
if ($cut_min_length != -1 && strlen($array) > $cut_min_length) {
$array = substr($array, 0, $cut_first).' ...';
}
return $array;
}
$output = '';
$tab_count++;
$output .= "Array\n".str_repeat(' ', $tab_count)."(\n";
$tab_count++;
$tabsign = $tab_count ? str_repeat(' ', $tab_count) : '';
$array_keys = array_keys($array);
foreach ($array_keys as $key) {
switch (gettype($array[$key])) {
case 'array':
$output .= $tabsign.'['.$key.'] = '.$this->print_r($array[$key], true, 50, 200);
break;
case 'boolean':
$output .= $tabsign.'['.$key.'] = '.($array[$key] ? 'true' : 'false')."\n";
break;
case 'integer':
case 'double':
case 'string':
if ($cut_min_length != -1 && strlen($array[$key]) > $cut_min_length) {
$array[$key] = substr($array[$key], 0, $cut_first).' ...';
}
$output .= $tabsign.'['.$key.'] = '.$array[$key]."\n";
break;
case 'NULL':
$output .= $tabsign.'['.$key."] = NULL\n";
break;
case 'object':
$attribute_names = get_class_vars( get_class($array[$key]) );
if (!$attribute_names) {
$output .= $tabsign.'['.$key."] = NO_ATTRIBUTES\n";
}
else {
if ($this->IsBigObject($array[$key])) {
$output .= $tabsign.'['.$key.'] = SKIPPED (class: '.get_class($array[$key]).")\n";
break;
}
// $attribute_value - default value for this attribute, not used here
foreach ($attribute_names as $attribute_name => $attribute_value) {
if (is_object($array[$key]->$attribute_name)) {
// it is object
$object_class = get_class($array[$key]->$attribute_name);
if (!in_array($object_class, $this->RecursionStack)) {
// object [not in recursion stack]
if ($this->IsBigObject($array[$key]->$attribute_name)) {
$output .= $tabsign.'['.$attribute_name.'] = SKIPPED (class: '.$object_class.")\n";
continue;
}
array_push($this->RecursionStack, $object_class);
$output .= $this->print_r($array[$key]->$attribute_name, true, 50, 200);
array_pop($this->RecursionStack);
}
else {
// object [in recursion stack]
$output .= $tabsign.'['.$attribute_name.'] = *** RECURSION *** (class: '.$object_class.")\n";
}
}
else {
$output .= $tabsign.'['.$attribute_name.'] = '.$this->print_r($array[$key]->$attribute_name, true, 50, 200)."\n";
}
}
}
break;
default:
$output .= $tabsign.'['.$key.'] unknown = '.gettype($array[$key])."\n";
break;
}
}
$tab_count--;
$output .= str_repeat(' ', $tab_count).")\n";
if ($first_line) {
$first_line = false;
$output .= "\n";
}
$tab_count--;
if ($return_output) {
return $output;
}
else {
echo $output;
}
return true;
}
/**
* Returns only first 200 chars of string, this allow to save amount of data sent to browser
*
* @param string $string
* @return string
*/
function cutStringForHTML($string)
{
if (strlen($string) > 200) {
$string = substr($string,0,50).' ...';
}
return $string;
}
/**
* Format SQL Query using predefined formatting
* and highlighting techniques
*
* @param string $sql
* @return string
*/
function formatSQL($sql)
{
$sql = preg_replace('/(\n|\t| )+/is', ' ', $sql);
$sql = preg_replace('/(CREATE TABLE|DROP TABLE|SELECT|UPDATE|SET|REPLACE|INSERT|DELETE|VALUES|FROM|LEFT JOIN|INNER JOIN|LIMIT|WHERE|HAVING|GROUP BY|ORDER BY) /is', "\n\t$1 ", $sql);
return $this->highlightString($sql);
}
function highlightString($string)
{
if (!$this->constOn('DBG_USE_HIGHLIGHT')) {
return $string;
}
$string = str_replace( Array('\\', '/') , Array('_no_match_string_', '_n_m_s_'), $string);
$string = highlight_string('<?php '.$string.'?>', true);
$string = str_replace( Array('_no_match_string_', '_n_m_s_'), Array('\\', '/'), $string);
return preg_replace('/&lt;\?(.*)php(.*)\?&gt;/Us', '\\2', $string);
}
/**
* Determine by php type of browser used to show debugger
*
* @return bool
*/
function isGecko()
{
return strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'firefox') !== false;
}
/**
* Returns link for editing php file (from error) in external editor
*
* @param string $file filename with path from root folder
* @param int $lineno line number in file where error is found
* @param string $title text to show on file edit link
* @return string
*/
function getFileLink($file, $lineno = 1, $title = '')
{
if (!$title) {
$title = str_replace('/', '\\', $this->getLocalFile($file));
}
if ($this->isGecko()) {
return '<a href="file://'.$this->getLocalFile($file).'">'.$title.'</a>';
}
else {
return '<a href="javascript:$Debugger.editFile(\''.$this->getLocalFile($file).'\', '.$lineno.');" title="'.$file.'">'.$title.'</a>';
}
}
/**
* Converts filepath on server to filepath in mapped DocumentRoot on developer pc
*
* @param string $remoteFile
* @return string
*/
function getLocalFile($remoteFile)
{
return preg_replace('/^'.preg_quote(DOC_ROOT, '/').'/', DBG_LOCAL_BASE_PATH, $remoteFile, 1);
}
/**
* Appends call trace till this method call
*
*/
function appendTrace()
{
$trace = debug_backtrace();
array_shift($trace);
$this->Data[] = Array('trace' => $trace, 'debug_type' => 'trace');
}
function appendMemoryUsage($msg, $used = null)
{
if (!isset($used)) {
$used = round(memory_get_usage() / 1024);
}
$this->appendHTML('<b>Memory usage</b> '.$msg.' '.$used.'Kb');
}
/**
* Appends HTML code whithout transformations
*
* @param string $html
*/
function appendHTML($html)
{
$this->Data[] = Array('html' => $html, 'debug_type' => 'html');
}
/**
* Change debugger info that was already generated before.
* Returns true if html was set.
*
* @param int $index
* @param string $html
* @param string $type = {'append','prepend','replace'}
* @return bool
*/
function setHTMLByIndex($index, $html, $type = 'append')
{
if (!isset($this->Data[$index]) || $this->Data[$index]['debug_type'] != 'html') {
return false;
}
switch ($type) {
case 'append':
$this->Data[$index]['html'] .= '<br>'.$html;
break;
case 'prepend':
$this->Data[$index]['html'] = $this->Data[$index]['html'].'<br>'.$html;
break;
case 'replace':
$this->Data[$index]['html'] = $html;
break;
}
return true;
}
/**
* Move $debugLineCount lines of input from debug output
* end to beginning.
*
* @param int $debugLineCount
*/
function moveToBegin($debugLineCount)
{
$lines = array_splice($this->Data,count($this->Data)-$debugLineCount,$debugLineCount);
$this->Data = array_merge($lines,$this->Data);
}
function moveAfterRow($new_row, $debugLineCount)
{
$lines = array_splice($this->Data,count($this->Data)-$debugLineCount,$debugLineCount);
$rows_before = array_splice($this->Data,0,$new_row,$lines);
$this->Data = array_merge($rows_before,$this->Data);
}
function appendRequest()
{
if (isset($_SERVER['SCRIPT_FILENAME'])) {
$script = $_SERVER['SCRIPT_FILENAME'];
}
else {
$script = $_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF'];
}
$this->appendHTML('ScriptName: <b>'.$this->getFileLink($script, 1, basename($script)).'</b> (<b>'.dirname($script).'</b>)');
if (isset($_REQUEST['ajax']) && $_REQUEST['ajax'] == 'yes') {
$this->appendHTML('RequestURI: '.$_SERVER['REQUEST_URI'].' (QS Length:'.strlen($_SERVER['QUERY_STRING']).')');
}
$this->appendHTML('<a href="http://www.brainjar.com/dhtml/domviewer/" target="_blank">DomViewer</a>: <input id="dbg_domviewer" type="text" value="window" style="border: 1px solid #000000;"/>&nbsp;<button class="button" onclick="return $Debugger.OpenDOMViewer();">Show</button>');
ob_start();
?>
<table border="0" cellspacing="0" cellpadding="0" class="dbg_flat_table" style="width: <?php echo $this->getWindowWidth(); ?>px;">
<thead style="font-weight: bold;">
<td width="20">Src</td><td>Name</td><td>Value</td>
</thead>
<?php
foreach ($_REQUEST as $key => $value) {
if(!is_array($value) && trim($value) == '') {
$value = '<b class="debug_error">no value</b>';
}
else {
$value = htmlspecialchars($this->print_r($value, true));
}
$in_cookie = isset($_COOKIE[$key]);
$src = isset($_GET[$key]) && !$in_cookie ? 'GE' : (isset($_POST[$key]) && !$in_cookie ? 'PO' : ($in_cookie ? 'CO' : '?') );
echo '<tr><td>'.$src.'</td><td>'.$key.'</td><td>'.$value.'</td></tr>';
}
?>
</table>
<?php
$this->appendHTML(ob_get_contents());
ob_end_clean();
}
/**
* Appends php session content to debugger output
*
*/
function appendSession()
{
if (isset($_SESSION) && $_SESSION) {
$this->appendHTML('PHP Session: [<b>'.ini_get('session.name').'</b>]');
$this->dumpVars($_SESSION);
$this->moveToBegin(2);
}
}
function profileStart($key, $description = null, $timeStamp = null)
{
if (!isset($timeStamp)) {
$timeStamp = $this->getMoment();
}
$this->ProfilerData[$key] = Array('begins' => $timeStamp, 'ends' => 5000, 'debuggerRowID' => count($this->Data));
if (isset($description)) {
$this->ProfilerData[$key]['description'] = $description;
}
if (substr($key, 0, 4) == 'sql_') {
// append place from what was called
$trace_results = debug_backtrace();
$trace_count = count($trace_results);
$i = 0;
while ($i < $trace_count) {
$trace_file = basename($trace_results[$i]['file']);
if ($trace_file != 'db_connection.php' && $trace_file != 'adodb.inc.php') {
break;
}
$i++;
}
$this->ProfilerData[$key]['file'] = $trace_file.':'.$trace_results[$i]['line'];
unset($trace_results);
}
$this->Data[] = Array('profile_key' => $key, 'debug_type' => 'profiler');
}
function profileFinish($key, $description = null, $timeStamp = null)
{
if (!isset($timeStamp)) {
$timeStamp = $this->getMoment();
}
$this->ProfilerData[$key]['ends'] = $timeStamp;
if (isset($description)) {
$this->ProfilerData[$key]['description'] = $description;
}
}
function profilerAddTotal($total_key, $key = null, $value = null)
{
if (!isset($this->ProfilerTotals[$total_key])) {
$this->ProfilerTotals[$total_key] = 0;
$this->ProfilerTotalCount[$total_key] = 0;
}
if (!isset($value)) {
$value = $this->ProfilerData[$key]['ends'] - $this->ProfilerData[$key]['begins'];
}
if (isset($key)) {
$this->ProfilerData[$key]['totalsKey'] = $total_key;
$this->ProfilerData[$key]['totalsBefore'] = $this->ProfilerTotals[$total_key];
}
$this->ProfilerTotals[$total_key] += $value;
$this->ProfilerTotalCount[$total_key]++;
}
function getMoment()
{
list($usec, $sec) = explode(' ', microtime());
return ((float)$usec + (float)$sec);
}
function generateID()
{
list($usec, $sec) = explode(' ', microtime());
$id_part_1 = substr($usec, 4, 4);
$id_part_2 = mt_rand(1,9);
$id_part_3 = substr($sec, 6, 4);
$digit_one = substr($id_part_1, 0, 1);
if ($digit_one == 0) {
$digit_one = mt_rand(1,9);
$id_part_1 = ereg_replace("^0",'',$id_part_1);
$id_part_1=$digit_one.$id_part_1;
}
return $id_part_1.$id_part_2.$id_part_3;
}
function getErrorNameByCode($error_code)
{
$error_map = Array(
'Fatal Error' => Array(E_USER_ERROR),
'Warning' => Array(E_WARNING, E_USER_WARNING),
'Notice' => Array(E_NOTICE, E_USER_NOTICE),
);
if (defined('E_STRICT')) {
$error_map['PHP5 Strict'] = Array(E_STRICT);
}
foreach ($error_map as $error_name => $error_codes) {
if (in_array($error_code, $error_codes)) {
return $error_name;
}
}
return '';
}
/**
+ * Returns profile total key (check against unexisting key too)
+ *
+ * @param string $key
+ * @return int
+ */
+ function getProfilerTotal($key)
+ {
+ if (isset($this->ProfilerTotalCount[$key])) {
+ return (int)$this->ProfilerTotalCount[$key];
+ }
+ return 0;
+ }
+
+ /**
* Generates report
*
*/
function printReport($returnResult = false, $clean_output_buffer = true)
{
if ($this->reportDone) {
// don't print same report twice (in case if shutdown function used + compression + fatal error)
return '';
}
$this->profileFinish('script_runtime');
$this->breakOutofBuffering();
$debugger_start = memory_get_usage();
if (defined('SPACER_URL')) {
$this->dummyImage = SPACER_URL;
}
$this->InitReport(); // set parameters required by AJAX
// defined here, because user can define this contant while script is running, not event before debugger is started
$this->safeDefine('DBG_RAISE_ON_WARNINGS', 0);
$this->safeDefine('DBG_TOOLBAR_BUTTONS', 1);
$this->appendSession(); // show php session if any
// ensure, that 1st line of debug output always is this one:
$top_line = '<table cellspacing="0" cellpadding="0" style="width: '.$this->getWindowWidth().'px; margin: 0px;"><tr><td align="left" width="50%">[<a href="javascript:window.location.reload();">Reload Frame</a>] [<a href="javascript:$Debugger.Toggle(27);">Hide Debugger</a>]</td><td align="right" width="50%">[Current Time: <b>'.date('H:i:s').'</b>] [File Size: <b>#DBG_FILESIZE#</b>]</td></tr></table>';
$this->appendHTML($top_line);
$this->moveToBegin(1);
if ($this->constOn('DBG_SQL_PROFILE') && isset($this->ProfilerTotals['sql'])) {
// sql query profiling was enabled -> show totals
$this->appendHTML('<b>SQL Total time:</b> '.$this->ProfilerTotals['sql'].' <b>Number of queries</b>: '.$this->ProfilerTotalCount['sql']);
}
if ($this->constOn('DBG_PROFILE_INCLUDES') && isset($this->ProfilerTotals['includes'])) {
// included file profiling was enabled -> show totals
$this->appendHTML('<b>Included Files Total time:</b> '.$this->ProfilerTotals['includes'].' Number of includes: '.$this->ProfilerTotalCount['includes']);
}
if ($this->constOn('DBG_PROFILE_MEMORY')) {
// detailed memory usage reporting by objects was enabled -> show totals
$this->appendHTML('<b>Memory used by Objects:</b> '.round($this->ProfilerTotals['objects'] / 1024, 2).'Kb');
}
/*if ($this->constOn('DBG_INCLUDED_FILES')) {
$files = get_included_files();
$this->appendHTML('<b>Included files:</b>');
foreach ($files as $file) {
$this->appendHTML($this->getFileLink($this->getLocalFile($file)).' ('.round(filesize($file) / 1024, 2).'Kb)');
}
}*/
/*if ($this->constOn('DBG_PROFILE_INCLUDES')) {
$this->appendHTML('<b>Included files statistics:</b>'.( $this->constOn('DBG_SORT_INCLUDES_MEM') ? ' (sorted by memory usage)':''));
$totals = Array( 'mem' => 0, 'time' => 0);
$totals_configs = Array( 'mem' => 0, 'time' => 0);
if (is_array($this->IncludesData['mem'])) {
if ( $this->constOn('DBG_SORT_INCLUDES_MEM') ) {
array_multisort($this->IncludesData['mem'], SORT_DESC, $this->IncludesData['file'], $this->IncludesData['time'], $this->IncludesData['level']);
}
foreach ($this->IncludesData['file'] as $key => $file_name) {
$this->appendHTML( str_repeat('&nbsp;->&nbsp;', ($this->IncludesData['level'][$key] >= 0 ? $this->IncludesData['level'][$key] : 0)).$file_name.' Mem: '.sprintf("%.4f Kb", $this->IncludesData['mem'][$key]/1024).' Time: '.sprintf("%.4f", $this->IncludesData['time'][$key]));
if ($this->IncludesData['level'][$key] == 0) {
$totals['mem'] += $this->IncludesData['mem'][$key];
$totals['time'] += $this->IncludesData['time'][$key];
}
else if ($this->IncludesData['level'][$key] == -1) {
$totals_configs['mem'] += $this->IncludesData['mem'][$key];
$totals_configs['time'] += $this->IncludesData['time'][$key];
}
}
$this->appendHTML('<b>Sub-Total classes:</b> '.' Mem: '.sprintf("%.4f Kb", $totals['mem']/1024).' Time: '.sprintf("%.4f", $totals['time']));
$this->appendHTML('<b>Sub-Total configs:</b> '.' Mem: '.sprintf("%.4f Kb", $totals_configs['mem']/1024).' Time: '.sprintf("%.4f", $totals_configs['time']));
$this->appendHTML('<span class="error"><b>Grand Total:</b></span> '.' Mem: '.sprintf("%.4f Kb", ($totals['mem']+$totals_configs['mem'])/1024).' Time: '.sprintf("%.4f", $totals['time']+$totals_configs['time']));
}
}*/
$is_ajax = isset($_GET['ajax']) && $_GET['ajax'] == 'yes';
$skip_reporting = $this->constOn('DBG_SKIP_REPORTING') || $this->constOn('DBG_ZEND_PRESENT');
- if ($is_ajax || !$skip_reporting) {
+ if (($is_ajax && !constOn('DBG_SKIP_AJAX')) || !$skip_reporting) {
$debug_file = $this->tempFolder.'/debug_'.$this->rowSeparator.'.txt';
if (file_exists($debug_file)) unlink($debug_file);
$i = 0;
$fp = fopen($debug_file, 'a');
$lineCount = count($this->Data);
while ($i < $lineCount) {
fwrite($fp, $this->prepareHTML($i).$this->rowSeparator);
$i++;
}
fclose($fp);
}
if ($skip_reporting) {
// let debugger write report and then don't output anything
$this->reportDone = true;
return '';
}
$dbg_path = str_replace(FULL_PATH, '', $this->tempFolder);
ob_start();
?>
<html><body></body></html>
<script type="text/javascript" src="<?php echo $this->baseURL; ?>/debugger.js"></script>
<link rel="stylesheet" rev="stylesheet" href="<?php echo $this->baseURL; ?>/debugger.css" type="text/css" media="screen" />
<div id="debug_layer" class="debug_layer_container" style="display: none; width: <?php echo DBG_WINDOW_WIDTH; ?>px;">
<div class="debug_layer" style="width: <?php echo $this->getWindowWidth(); ?>px;">
<table width="100%" cellpadding="0" cellspacing="1" border="0" class="debug_layer_table" style="width: <?php echo $this->getWindowWidth(); ?>px;" align="left">
<tbody id="debug_table"></tbody>
</table>
</div>
</div>
<script type="text/javascript">
- var $Debugger = new Debugger();
- $Debugger.IsFatalError = <?php echo $this->IsFatalError ? 'true' : 'false'; ?>;
+ var $Debugger = new Debugger(<?php echo "'".$this->rowSeparator."', ".$this->getProfilerTotal('error_handling').', '.($this->IsFatalError ? 'true' : 'false').', '.$this->getProfilerTotal('sql'); ?>);
$Debugger.DOMViewerURL = '<?php echo constant('DBG_DOMVIEWER'); ?>';
$Debugger.EditorPath = '<?php echo defined('DBG_EDITOR') ? addslashes(DBG_EDITOR) : '' ?>';
- $Debugger.RowSeparator = '<?php echo $this->rowSeparator; ?>';
$Debugger.DebugURL = '<?php echo $this->baseURL.'/debugger_responce.php?sid='.$this->rowSeparator.'&path='.urlencode($dbg_path); ?>';
+
<?php
if ($this->IsFatalError || DBG_RAISE_ON_WARNINGS) {
echo '$Debugger.Toggle();';
}
if (DBG_TOOLBAR_BUTTONS) {
echo '$Debugger.AddToolbar("$Debugger");';
}
?>
window.focus();
</script>
<?php
if (!isset($this->ProfilerTotals['error_handling'])) {
$memory_used = $debugger_start;
$this->ProfilerTotalCount['error_handling'] = 0;
}
else {
$memory_used = $debugger_start - $this->ProfilerTotals['error_handling'];
}
if ($returnResult) {
$ret = ob_get_contents();
if ($clean_output_buffer) {
ob_end_clean();
}
$ret .= $this->getShortReport($memory_used);
$this->reportDone = true;
return $ret;
}
else {
if (!$this->constOn('DBG_HIDE_FULL_REPORT')) {
$this->breakOutofBuffering();
}
elseif ($clean_output_buffer) {
ob_clean();
}
echo $this->getShortReport($memory_used);
$this->reportDone = true;
}
}
/**
* Format's memory usage report by debugger
*
* @return string
* @access private
*/
function getShortReport($memory_used)
{
$info = Array(
'Script Runtime' => 'PROFILE:script_runtime',
'-' => 'SEP:-',
'Notice / Warning' => 'PROFILE_TC:error_handling',
'SQLs Count' => 'PROFILE_TC:sql',
);
$ret = '<tr><td>Application:</td><td><b>'.$this->formatSize($memory_used).'</b> ('.$memory_used.')</td></tr>';
foreach ($info as $title => $value_key) {
list ($record_type, $record_data) = explode(':', $value_key, 2);
switch ($record_type) {
case 'PROFILE': // profiler totals value
$Data =& $this->ProfilerData[$record_data];
$profile_time = ($Data['ends'] - $Data['begins']); // in seconds
$ret .= '<tr><td>'.$title.':</td><td><b>'.sprintf('%.5f', $profile_time).' s</b></td></tr>';
break;
case 'PROFILE_TC': // profile totals record count
$record_cell = '<td>';
if ($record_data == 'error_handling' && $this->ProfilerTotalCount[$record_data] > 0) {
$record_cell = '<td class="debug_error">';
}
$ret .= '<tr>'.$record_cell.$title.':</td>'.$record_cell.'<b>'.$this->ProfilerTotalCount[$record_data].'</b></td></tr>';
break;
case 'SEP':
$ret .= '<tr><td colspan="2" style="height: 1px; background-color: #000000; padding: 0px;"><img src="'.$this->dummyImage.'" height="1" alt=""/></td></tr>';
break;
}
}
return '<br /><table class="dbg_stats_table"><tr><td style="border-color: #FFFFFF;"><table class="dbg_stats_table" align="left">'.$ret.'</table></td></tr></table>';
}
/**
* User-defined error handler
*
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
* @param array $errcontext
*/
function saveError($errno, $errstr, $errfile = '', $errline = '', $errcontext = '')
{
$this->ProfilerData['error_handling']['begins'] = memory_get_usage();
$errorType = $this->getErrorNameByCode($errno);
if (!$errorType) {
trigger_error('Unknown error type ['.$errno.']', E_USER_ERROR);
return false;
}
if ($this->constOn('DBG_IGNORE_STRICT_ERRORS') && defined('E_STRICT') && ($errno == E_STRICT)) return;
if (preg_match('/(.*)#([\d]+)$/', $errstr, $rets) ) {
// replace short message with long one (due triger_error limitations on message size)
$long_id = $rets[2];
$errstr = $this->longErrors[$long_id];
unset($this->longErrors[$long_id]);
}
if (strpos($errfile,'eval()\'d code') !== false) {
$errstr = '[<b>EVAL</b>, line <b>'.$errline.'</b>]: '.$errstr;
$tmpStr = $errfile;
$pos = strpos($tmpStr,'(');
$errfile = substr($tmpStr, 0, $pos);
$pos++;
$errline = substr($tmpStr,$pos,strpos($tmpStr,')',$pos)-$pos);
}
$this->Data[] = Array('no' => $errno, 'str' => $errstr, 'file' => $errfile, 'line' => $errline, 'context' => $errcontext, 'debug_type' => 'error');
$this->ProfilerData['error_handling']['ends'] = memory_get_usage();
$this->profilerAddTotal('error_handling', 'error_handling');
if (substr($errorType, 0, 5) == 'Fatal') {
$this->IsFatalError = true;
// append debugger report to data in buffer & clean buffer afterwards
die( $this->breakOutofBuffering(false) . $this->printReport(true) );
}
}
function breakOutofBuffering($flush = true)
{
$buffer_content = Array();
while (ob_get_level()) {
$buffer_content[] = ob_get_clean();
}
$ret = implode('', array_reverse($buffer_content));
if ($flush) {
echo $ret;
flush();
}
return $ret;
}
function saveToFile($msg)
{
$fp = fopen($_SERVER['DOCUMENT_ROOT'].'/vb_debug.txt', 'a');
fwrite($fp, $msg."\n");
fclose($fp);
}
/**
* Formats file/memory size in nice way
*
* @param int $bytes
* @return string
* @access public
*/
function formatSize($bytes)
{
if ($bytes >= 1099511627776) {
$return = round($bytes / 1024 / 1024 / 1024 / 1024, 2);
$suffix = "TB";
} elseif ($bytes >= 1073741824) {
$return = round($bytes / 1024 / 1024 / 1024, 2);
$suffix = "GB";
} elseif ($bytes >= 1048576) {
$return = round($bytes / 1024 / 1024, 2);
$suffix = "MB";
} elseif ($bytes >= 1024) {
$return = round($bytes / 1024, 2);
$suffix = "KB";
} else {
$return = $bytes;
$suffix = "Byte";
}
$return .= ' '.$suffix;
return $return;
}
function printConstants($constants)
{
if (!is_array($constants)) {
$constants = explode(',', $constants);
}
$contant_tpl = '<tr><td>%s</td><td><b>%s</b></td></tr>';
$ret = '<table class="dbg_flat_table" style="width: '.$this->getWindowWidth().'px;">';
foreach ($constants as $constant_name) {
$ret .= sprintf($contant_tpl, $constant_name, constant($constant_name));
}
$ret .= '</table>';
$this->appendHTML($ret);
}
function AttachToApplication() {
if (!$this->constOn('DBG_HANDLE_ERRORS')) return true;
if (class_exists('kApplication')) {
restore_error_handler();
$application =& kApplication::Instance();
$application->Debugger =& $this;
$application->errorHandlers[] = Array(&$this, 'saveError');
}
else {
set_error_handler(Array(&$this, 'saveError'));
}
}
}
if (!function_exists('memory_get_usage')) {
function memory_get_usage(){ return -1; }
}
if (!Debugger::constOn('DBG_ZEND_PRESENT')) {
$debugger = new Debugger();
}
if (Debugger::constOn('DBG_USE_SHUTDOWN_FUNC')) {
register_shutdown_function( Array(&$debugger, 'printReport') );
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/utility/debugger.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.64
\ No newline at end of property
+1.65
\ No newline at end of property
Index: trunk/core/kernel/utility/http_query.php
===================================================================
--- trunk/core/kernel/utility/http_query.php (revision 7634)
+++ trunk/core/kernel/utility/http_query.php (revision 7635)
@@ -1,540 +1,539 @@
<?php
class kHTTPQuery extends Params {
/**
* $_POST vars
*
* @var Array
* @access private
*/
var $Post;
/**
* $_GET vars
*
* @var Array
* @access private
*/
var $Get;
/**
* $_COOKIE vars
*
* @var Array
* @access private
*/
var $Cookie;
/**
* $_SERVER vars
*
* @var Array
* @access private
*/
var $Server;
/**
* $_ENV vars
*
* @var Array
* @access private
*/
var $Env;
/**
* Order in what write
* all vars together in
* the same array
*
* @var string
*/
var $Order;
/**
* Uploaded files info
*
* @var Array
* @access private
*/
var $Files;
var $specialsToRemove = Array();
var $Admin = false;
/**
* Description
*
* @var kDBConnection
* @access public
*/
var $Conn;
/**
* Loads info from $_POST, $_GET and
* related arrays into common place
*
* @param string $order
* @return HTTPQuery
* @access public
*/
function kHTTPQuery($order = 'CGPF')
{
parent::Params();
$this->Conn =& $this->Application->GetADODBConnection();
$this->Order = $order;
$this->Admin = $this->Application->IsAdmin(); // better cache this value, not to calculate it each time in foreach
}
function Init($prefix, $special)
{
$this->AddAllVars();
$this->specialsToRemove = $this->Get('remove_specials');
if($this->specialsToRemove)
{
$this->_Params = $this->removeSpecials($this->_Params);
}
ini_set('magic_quotes_gpc', 0);
}
function removeSpecials($array)
{
$ret = Array();
$removed = false;
foreach($this->specialsToRemove as $prefix_special => $flag)
{
if($flag)
{
$removed = true;
list($prefix,$special) = explode('.',$prefix_special, 2);
foreach ($array as $key => $val) {
$new_key = preg_match("/^".$prefix."[._]{1}".$special."(.*)/", $key, $regs) ? $prefix.$regs[1] : $key;
$ret[$new_key] = is_array($val) ? $this->removeSpecials($val) : $val;
}
}
}
return $removed ? $ret : $array;
}
/**
* All all requested vars to
* common storage place
*
* @access private
*/
function AddAllVars()
{
for ($i=0; $i < strlen($this->Order); $i++)
{
$current = $this->Order[$i];
switch ($current) {
case 'G':
$this->Get = $this->AddVars($_GET);
$this->processQueryString();
break;
case 'P':
$this->Post = $this->AddVars($_POST);
$this->convertPostEvents();
break;
case 'C':
$this->Cookie = $this->AddVars($_COOKIE);
break;
case 'E';
$this->Env = $this->AddVars($_ENV);
break;
case 'S';
$this->Server = $this->AddVars($_SERVER);
break;
case 'F';
$this->convertFiles();
$this->Files = $this->MergeVars($_FILES, false); //do not strip slashes!
break;
}
}
// $this->AfterInit();
}
function AfterInit()
{
// $this->processQueryString();
// $this->convertPostEvents();
// if ($this->Application->RewriteURLs()) {
if ($this->Application->RewriteURLs() || $this->Get('_mod_rw_url_')) {
if( $this->Application->isDebugMode() )
{
$this->Application->Debugger->profileStart('url_parsing');
$this->processRewriteURL();
$description = 'Parsing <b>MOD_REWRITE</b> url (template: <b>'.$this->Get('t').'</b>)';
$this->Application->Debugger->profileFinish('url_parsing', $description);
}
else
{
$this->processRewriteURL();
}
-
}
else {
$this->Application->VerifyLanguageId();
$this->Application->VerifyThemeId();
}
}
function convertFiles()
{
if (!$_FILES)
{
return false;
}
$file_keys = Array('error','name','size','tmp_name','type');
$tmp = Array();
foreach($_FILES as $file_name => $file_info)
{
if( is_array($file_info['error']) )
{
$tmp[$file_name] = $this->getArrayLevel( $file_info['error'], $file_name );
}
else
{
$normal_files[$file_name] = $file_info;
}
}
if(!$tmp) return false;
$files = $_FILES;
$_FILES = Array();
foreach($tmp as $prefix => $prefix_files)
{
$anchor =& $_FILES;
foreach($prefix_files['keys'] as $key)
{
$anchor =& $anchor[$key];
}
foreach($prefix_files['value'] as $field_name)
{
unset($inner_anchor);
unset($copy);
$work_copy = $prefix_files['keys'];
foreach($file_keys as $file_key)
{
$inner_anchor =& $files[$prefix][$file_key];
if (isset($copy))
{
$work_copy = $copy;
}
else
{
$copy = $work_copy;
}
array_shift($work_copy);
foreach($work_copy as $prefix_file_key)
{
$inner_anchor =& $inner_anchor[$prefix_file_key];
}
$anchor[$field_name][$file_key] = $inner_anchor[$field_name];
}
}
}
// keys: img_temp, 0, values: LocalPath, ThumbPath
}
function getArrayLevel(&$level, $prefix='')
{
$ret['keys'] = $prefix ? Array($prefix) : Array();
$ret['value'] = Array();
foreach($level as $level_key => $level_value)
{
if( is_array($level_value) )
{
$ret['keys'][] = $level_key;
$tmp = $this->getArrayLevel($level_value);
$ret['keys'] = array_merge($ret['keys'], $tmp['keys']);
$ret['value'] = array_merge($ret['value'], $tmp['value']);
}
else
{
$ret['value'][] = $level_key;
}
}
return $ret;
}
/**
* Owerwrites GET events with POST events in case if they are set and not empty
*
*/
function convertPostEvents()
{
$events = $this->Get('events');
if( is_array($events) )
{
foreach ($events as $prefix_special => $event_name)
{
if($event_name) $this->Set($prefix_special.'_event', $event_name);
}
}
}
function finalizeParsing($passed = Array(), $module_params = Array() )
{
if ($passed) {
$event_manger =& $this->Application->recallObject('EventManager');
foreach ($passed as $passed_prefix) {
$event_manger->setQueryMap($passed_prefix);
}
$this->Set('passed', implode(',', array_keys($event_manger->queryMaps)));
}
// get joined version (env var + mod rewrite parsed)
$passed = $this->Application->GetVar('passed');
$env = $this->Application->BuildEnv( $this->Get('t'), $module_params, $passed, false, false );
$this->Set(ENV_VAR_NAME, $env);
$_REQUEST['env'] = $_GET['env'] = $env; // for capability with old in-portal code
}
function processRewriteURL()
{
$mod_rw_helper = $this->Application->recallObject('ModRewriteHelper');
$mod_rw_helper->processRewriteURL();
}
function getDefaultTemplate($t)
{
$t = $this->getTemplateName( trim($t, '/') );
if (!$t) $t = 'index';
return trim($t, '/');
}
function extractSIDAndTemplate(&$parts)
{
if ( defined('INPORTAL_ENV') && INPORTAL_ENV ) // SID-TEMPLATE
{
$sub_parts = array_shift($parts);
list($sid, $t) = explode('-', $sub_parts, 2);
// Save Session ID
if($sid)
{
$this->Set('sid', $sid);
$this->Get['sid'] = $sid;
}
// Save Template Name
$this->Set('t', $this->getDefaultTemplate($t) );
}
else // SID:TEMPLATE
{
// Save Session ID
$sid = array_shift($parts);
if ($sid) $this->Set('sid', $sid);
// Save Template Name
$t = array_shift($parts);
$this->Set('t', $this->getDefaultTemplate($t) );
}
}
/**
* Process QueryString only, create
* events, ids, based on config
* set template name and sid in
* desired application variables.
*
* @access private
*/
function processQueryString()
{
// env=SID:TEMPLATE:m-1-1-1-1:l0-0-0:n-0-0-0:bb-0-0-1-1-1-0
$env_var = $this->Get(ENV_VAR_NAME);
if ($env_var) {
// replace escaped ":" symbol not to explode by it
$env_var = str_replace('\:','_&+$$+&_', $env_var); // replace escaped "=" with spec-chars :)
$parts = explode(':', $env_var);
if (!$this->Application->RewriteURLs() || ($this->Application->RewriteURLs() && $this->Get('rewrite') != 'on')) {
$this->extractSIDAndTemplate($parts);
}
if ($parts) {
foreach ($parts as $mixed_part) {
$this->parseEnvPart($mixed_part);
}
}
}
else
{
$t=$this->getTemplateName('index');
$this->Set('t', $t);
}
}
-
+
function parseEnvPart($mixed_part)
{
// In-portal old style env conversion - adds '-' between prefix and first var
$mixed_part = str_replace('_&+$$+&_', ':', $mixed_part);
$mixed_part = preg_replace("/^([a-zA-Z]+)([0-9]+)-(.*)/", "$1-$2-$3", $mixed_part);
// replace escaped "-" symbol not to explode by it
$escaped_part = str_replace('\-', '_&+$$+&_', $mixed_part);
$escaped_part = explode('-', $escaped_part);
$mixed_part = Array();
foreach ($escaped_part as $escaped_val) {
$mixed_part[] = str_replace('_&+$$+&_', '-', $escaped_val);
}
$prefix_special = array_shift($mixed_part); // l.pick, l
$query_map = $this->Application->EventManager->setQueryMap($prefix_special);
$this->Set('passed', implode(',', array_keys($this->Application->EventManager->queryMaps)));
// if config is not defined for prefix in QueryString, then don't process it
if ($query_map) {
foreach($query_map as $index => $var_name)
{
// l_id, l_page, l_bla-bla-bla
$val = $mixed_part[$index - 1];
if ($val == '') $val = false;
$this->Set($prefix_special.'_'.$var_name, $val);
}
}
}
-
+
/**
* Decides what template name to
* use from $_GET or from $_POST
*
* @param string $querystring_template
* @return string
* @access private
*/
function getTemplateName($querystring_template)
{
$t_from_post = $this->Get('t');
$t = $t_from_post ? $t_from_post : $querystring_template;
if ( is_numeric($t) )
{
$t = $this->Conn->GetOne(' SELECT CONCAT(FilePath, \'/\', FileName)
FROM '.TABLE_PREFIX.'ThemeFiles
WHERE FileId = '.$t);
}
$t = preg_replace('/\.tpl$/', '', $t);
return $t;
}
/**
* Saves variables from array specified
* into common variable storage place
*
* @param Array $array
* @return Array
* @access private
*/
function AddVars($array)
{
$array = $this->StripSlashes($array);
foreach($array as $key => $value)
{
$this->Set($key,$value);
}
return $array;
}
function MergeVars($array, $strip_slashes=true)
{
if ($strip_slashes) $array = $this->StripSlashes($array);
foreach($array as $key => $value)
{
$this->_Params = array_merge_recursive2($this->_Params, Array($key=>$value));
}
return $array;
}
function StripSlashes($array)
{
//if( !get_magic_quotes_gpc() ) return $array;
foreach($array as $key=>$value)
{
if( is_array($value) )
{
$array[$key] = $this->StripSlashes($value);
}
else
{
// $value = iconv('UTF-8', 'windows-1257', $value);
if( get_magic_quotes_gpc() ) $value = stripslashes($value);
if(!$this->Admin) $value = htmlspecialchars($value);
$array[$key] = $value;
}
//$array[$key]=is_array($value)?$this->StripSlashes($value):stripslashes($value);
}
return $array;
}
/**
* Returns all $_GET array excluding system parameters, that are not allowed to be passed through generated urls
*
* @return Array
*/
function getRedirectParams()
{
$unset_vars = Array(ENV_VAR_NAME, 'rewrite', '_mod_rw_url_', 'Action');
$ret = $this->Get;
foreach ($unset_vars as $var_name)
{
if( isset($ret[$var_name]) ) unset( $ret[$var_name] );
}
return $ret;
}
function writeRequestLog($filename)
{
$folder_path = dirname(FULL_PATH.'/'.$filename);
if (is_writable($folder_path)) {
$fp = fopen(FULL_PATH.'/'.$filename, 'a');
if ($fp) {
$session =& $this->Application->recallObject('Session');
$user_id = $session->GetField('PortalUserId');
$admin_mark = $this->Application->IsAdmin() ? 'ADMIN' : 'FRONT';
$data = '['.date('D M d H:i:s Y').'] '.$admin_mark.'; ip: '.$_SERVER['REMOTE_ADDR'].'; user_id: '.$user_id.'; sid: '.$this->Application->GetSID().'; request: '."\n";
if ($this->Get) {
$data .= "_GET:\n".print_r($this->Get, true);
}
if ($this->Post) {
$data .= "_POST:\n".print_r($this->Post, true);
}
$data .= str_repeat('=', 100)."\n";
fwrite($fp, $data);
fclose($fp);
}
else {
trigger_error('Requrest Log directory not writable', E_USER_WARNING);
}
}
else {
trigger_error('Requrest Log directory not writable', E_USER_WARNING);
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/utility/http_query.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.52
\ No newline at end of property
+1.53
\ No newline at end of property
Index: trunk/core/kernel/utility/unit_config_reader.php
===================================================================
--- trunk/core/kernel/utility/unit_config_reader.php (revision 7634)
+++ trunk/core/kernel/utility/unit_config_reader.php (revision 7635)
@@ -1,665 +1,669 @@
<?php
class kUnitConfigReader extends kBase {
/**
* Configs readed
*
* @var Array
* @access private
*/
var $configData=Array();
var $configFiles=Array();
var $CacheExpired = false;
var $prefixFiles = array();
var $ProcessAllConfigs = false;
var $FinalStage = false;
var $StoreCache = false;
var $AfterConfigProcessed = array();
/**
* Scan kernel and user classes
* for available configs
*
* @access protected
*/
function Init($prefix,$special)
{
parent::Init($prefix,$special);
}
function CacheParsedData()
{
$event_manager =& $this->Application->recallObject('EventManager');
$aggregator =& $this->Application->recallObject('TagsAggregator', 'kArray');
$config_vars = Array(
'SessionTimeout',
'SessionCookieName',
'SessionReferrerCheck',
'CookieSessions',
'UseCronForRegularEvent',
'User_GuestGroup',
'User_LoggedInGroup',
'SessionTimeout',
'UseModRewrite',
'UseOutputCompression',
'OutputCompressionLevel',
);
foreach ($config_vars as $var) {
$this->Application->ConfigValue($var);
}
$cache = Array(
'Factory.Files' => $this->Application->Factory->Files,
'Factory.realClasses' => $this->Application->Factory->realClasses,
'Factory.Dependencies' => $this->Application->Factory->Dependencies,
'ConfigReader.prefixFiles' => $this->prefixFiles,
'EventManager.buildEvents' => $event_manager->buildEvents,
'EventManager.beforeRegularEvents' => $event_manager->beforeRegularEvents,
'EventManager.afterRegularEvents' => $event_manager->afterRegularEvents,
'EventManager.beforeHooks' => $event_manager->beforeHooks,
'EventManager.afterHooks' => $event_manager->afterHooks,
'TagsAggregator.data' => $aggregator->_Array,
// the following caches should be reset based on admin interaction (adjusting config, enabling modules etc)
'Application.Caches.ConfigVariables' => $this->Application->Caches['ConfigVariables'],
'Application.ConfigCacheIds' => $this->Application->ConfigCacheIds,
'Application.ConfigHash' => $this->Application->ConfigHash,
'Application.ReplacementTemplates' => $this->Application->ReplacementTemplates,
'Application.ModuleInfo' => $this->Application->ModuleInfo,
);
$conn =& $this->Application->GetADODBConnection();
$conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("configs_parsed", '.$conn->qstr(serialize($cache)).', '.adodb_mktime().')');
$conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("config_files", '.$conn->qstr(serialize($this->configFiles)).', '.adodb_mktime().')');
unset($this->configFiles);
}
function RestoreParsedData()
{
$conn =& $this->Application->GetADODBConnection();
$data = $conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "configs_parsed"');
if ($data && $data['Cached'] > 0 ) {
$cache = unserialize($data['Data']);
$this->Application->Factory->Files = $cache['Factory.Files'];
$this->Application->Factory->realClasses = $cache['Factory.realClasses'];
$this->Application->Factory->Dependencies = $cache['Factory.Dependencies'];
$this->prefixFiles = $cache['ConfigReader.prefixFiles'];
$event_manager =& $this->Application->recallObject('EventManager');
$event_manager->buildEvents = $cache['EventManager.buildEvents'];
$event_manager->beforeRegularEvents = $cache['EventManager.beforeRegularEvents'];
$event_manager->afterRegularEvents = $cache['EventManager.afterRegularEvents'];
$event_manager->beforeHooks = $cache['EventManager.beforeHooks'];
$event_manager->afterHooks = $cache['EventManager.afterHooks'];
$aggregator =& $this->Application->recallObject('TagsAggregator', 'kArray');
$aggregator->_Array = $cache['TagsAggregator.data'];
$this->Application->ConfigHash = $cache['Application.ConfigHash'];
$this->Application->Caches['ConfigVariables'] = $cache['Application.ConfigCacheIds'];
$this->Application->ConfigCacheIds = $cache['Application.ConfigCacheIds'];
$this->Application->ReplacementTemplates = $cache['Application.ReplacementTemplates'];
$this->Application->ModuleInfo = $cache['Application.ModuleInfo'];
return true;
}
else return false;
}
function ResetParsedData($include_sections = false)
{
$conn =& $this->Application->GetADODBConnection();
$conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "configs_parsed"');
if ($include_sections) {
$conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "sections_parsed"');
}
}
function scanModules($folderPath, $cache = true)
{
if (defined('IS_INSTALL') && IS_INSTALL && !defined('FORCE_CONFIG_CACHE')) {
// disable config caching during installation
$cache = false;
}
if ($cache) {
$restored = $this->RestoreParsedData();
if ($restored) return;
}
$this->ProcessAllConfigs = true;
$this->includeConfigFiles($folderPath, $cache);
$this->ParseConfigs();
// tell AfterConfigRead to store cache if neede
// can't store it here beacuse AfterConfigRead needs ability to change config data
$this->StoreCache = $cache;
}
function findConfigFiles($folderPath)
{
// if FULL_PATH = "/" ensure, that all "/" in $folderPath are not deleted
$reg_exp = '/^'.preg_quote(FULL_PATH, '/').'/';
$folderPath = preg_replace($reg_exp, '', $folderPath, 1); // this make sense, since $folderPath may NOT contain FULL_PATH
$fh = opendir(FULL_PATH.$folderPath);
while (($sub_folder = readdir($fh))) {
$full_path = FULL_PATH.$folderPath.'/'.$sub_folder;
if ($this->isDir($full_path)) {
+ //the following is to exclude OLD, not removed files when upgrading to 'core'
+ if (preg_match('/^\/kernel\/kernel4\//', $folderPath) || ($folderPath == '/kernel/units' && file_exists(FULL_PATH.$this->getConfigName('/core/units/'.$sub_folder)))) {
+ continue;
+ }
if (file_exists(FULL_PATH.$this->getConfigName($folderPath.'/'.$sub_folder))) {
$this->configFiles[] = $this->getConfigName($folderPath.'/'.$sub_folder);
}
$this->findConfigFiles($full_path);
// if (filemtime($full_path) > $cached) { }
}
}
}
function includeConfigFiles($folderPath, $cache = true)
{
$this->Application->refreshModuleInfo();
$conn =& $this->Application->GetADODBConnection();
$data = $conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "config_files"');
if ($cache && $data) {
$this->configFiles = unserialize($data['Data']);
shuffle($this->configFiles);
$files_cached = $data['Cached'];
}
else {
$this->findConfigFiles($folderPath); // search from base directory
}
foreach ($this->configFiles as $filename)
{
$prefix = $this->PreloadConfigFile($filename);
if (!$prefix) {
trigger_error('Prefix not defined in config file '.$filename, E_USER_ERROR);
}
}
}
/**
* Process all read config files - called ONLY when there is no cache!
*
*/
function ParseConfigs()
{
$prioritized_configs = array();
foreach ($this->configData as $prefix => $config) {
if (isset($config['ConfigPriority'])) {
$prioritized_configs[$prefix] = $config['ConfigPriority'];
continue;
}
$this->parseConfig($prefix);
}
foreach ($this->configData as $prefix => $config) {
$this->ProcessDependencies($prefix);
$this->postProcessConfig($prefix, 'AggregateConfigs', 'sub_prefix');
$clones = $this->postProcessConfig($prefix, 'Clones', 'prefix');
}
asort($prioritized_configs);
foreach ($prioritized_configs as $prefix => $priority) {
$this->parseConfig($prefix);
}
}
function AfterConfigRead()
{
// if (!$this->ProcessAllConfigs) return ;
$this->FinalStage = true;
foreach ($this->configData as $prefix => $config) {
if (in_array($prefix, $this->AfterConfigProcessed)) continue;
$this->Application->HandleEvent( new kEvent($prefix.':OnAfterConfigRead') );
$this->AfterConfigProcessed[] = $prefix;
}
if ($this->StoreCache) $this->CacheParsedData();
}
/**
* Register nessasary classes
* This method should only process the data which is cached!
*
* @param string $prefix
* @access private
*/
function parseConfig($prefix)
{
$config =& $this->configData[$prefix];
$event_manager =& $this->Application->recallObject('EventManager');
$register_classes = getArrayValue($config,'RegisterClasses');
if (!$register_classes) $register_classes = Array();
$class_params=Array('ItemClass','ListClass','EventHandlerClass','TagProcessorClass');
foreach($class_params as $param_name)
{
if ( !(isset($config[$param_name]) ) ) continue;
$config[$param_name]['pseudo'] = $this->getPrefixByParamName($param_name,$prefix);
$register_classes[] = $config[$param_name];
}
foreach($register_classes as $class_info)
{
$require_classes = getArrayValue($class_info, 'require_classes');
if ($require_classes) {
if (!is_array($require_classes)) {
$require_classes = array($require_classes);
}
if (!isset($config['_Dependencies'][$class_info['class']])) {
$config['_Dependencies'][$class_info['class']] = array();
}
$config['_Dependencies'][$class_info['class']] = array_merge($config['_Dependencies'][$class_info['class']], $require_classes);
}
$this->Application->registerClass(
$class_info['class'],
$config['BasePath'].'/'.$class_info['file'],
$class_info['pseudo']/*,
getArrayValue($class_info, 'require_classes')*/
);
if (getArrayValue($class_info, 'build_event')) {
$event_manager->registerBuildEvent($class_info['pseudo'],$class_info['build_event']);
}
}
$regular_events = getArrayValue($config, 'RegularEvents');
if($regular_events)
{
foreach($regular_events as $short_name => $regular_event_info)
{
$event_manager->registerRegularEvent( $short_name, $config['Prefix'].':'.$regular_event_info['EventName'], $regular_event_info['RunInterval'], $regular_event_info['Type'] );
}
}
$hooks = getArrayValue($config, 'Hooks');
if (is_array($hooks) && count($hooks) > 0) {
foreach ($hooks as $hook) {
if (isset($config['ParentPrefix']) && $hook['HookToPrefix'] == $config['ParentPrefix']) {
trigger_error('Depricated Hook Usage [prefix: <b>'.$config['Prefix'].'</b>; do_prefix: <b>'.$hook['DoPrefix'].'</b>] use <b>#PARENT#</b> as <b>HookToPrefix</b> value, where HookToPrefix is same as ParentPrefix', E_USER_NOTICE);
}
if ($hook['HookToPrefix'] == '') {
$hook['HookToPrefix'] = $config['Prefix']; // new: set hooktoprefix to current prefix if not set
}
if (isset($config['ParentPrefix'])) {
// new: allow to set hook to parent prefix what ever it is
if ($hook['HookToPrefix'] == '#PARENT#') {
$hook['HookToPrefix'] = $config['ParentPrefix'];
}
if ($hook['DoPrefix'] == '#PARENT#') {
$hook['DoPrefix'] = $config['ParentPrefix'];
}
}
elseif ($hook['HookToPrefix'] == '#PARENT#' || $hook['DoPrefix'] == '#PARENT#') {
continue; // we need parent prefix but it's not set !
}
$do_prefix = $hook['DoPrefix'] == '' ? $config['Prefix'] : $hook['DoPrefix'];
if ( !is_array($hook['HookToEvent']) ) {
$hook_events = Array( $hook['HookToEvent'] );
}
else {
$hook_events = $hook['HookToEvent'];
}
foreach ($hook_events as $hook_event) {
$this->Application->registerHook($hook['HookToPrefix'], $hook['HookToSpecial'], $hook_event, $hook['Mode'], $do_prefix, $hook['DoSpecial'], $hook['DoEvent'], $hook['Conditional']);
}
}
}
if ( is_array(getArrayValue($config, 'AggregateTags')) ) {
foreach ($config['AggregateTags'] as $aggregate_tag) {
if (isset($config['ParentPrefix'])) {
if ($aggregate_tag['AggregateTo'] == $config['ParentPrefix']) {
trigger_error('Depricated Aggregate Tag Usage [prefix: <b>'.$config['Prefix'].'</b>; AggregateTo: <b>'.$aggregate_tag['AggregateTo'].'</b>] use <b>#PARENT#</b> as <b>AggregateTo</b> value, where AggregateTo is same as ParentPrefix', E_USER_NOTICE);
}
if ($aggregate_tag['AggregateTo'] == '#PARENT#') {
$aggregate_tag['AggregateTo'] = $config['ParentPrefix'];
}
}
$aggregate_tag['LocalPrefix'] = $config['Prefix'];
$this->Application->registerAggregateTag($aggregate_tag);
}
}
if (isset($config['ReplacementTemplates']) && $config['ReplacementTemplates']) {
// replacement templates defined in this config
$this->Application->ReplacementTemplates = array_merge_recursive2($this->Application->ReplacementTemplates, $config['ReplacementTemplates']);
}
if ( $this->Application->isDebugMode() && constOn('DBG_VALIDATE_CONFIGS') && isset($config['TableName']) )
{
global $debugger;
$tablename = $config['TableName'];
$conn =& $this->Application->GetADODBConnection();
$res = $conn->Query("DESCRIBE $tablename");
foreach ($res as $field) {
$f_name = $field['Field'];
if (getArrayValue($config, 'Fields')) {
if ( !array_key_exists ($f_name, $config['Fields']) ) {
$debugger->appendHTML("<b class='debug_error'>Config Warning: </b>Field $f_name exists in the database, but is not defined in config file for prefix <b>".$config['Prefix']."</b>!");
safeDefine('DBG_RAISE_ON_WARNINGS', 1);
}
else {
$options = $config['Fields'][$f_name];
if ($field['Null'] == '') {
if ( $f_name != $config['IDField'] && !isset($options['not_null']) && !isset($options['required']) ) {
$debugger->appendHTML("<b class='debug_error'>Config Error: </b>Field $f_name in config for prefix <b>".$config['Prefix']."</b> is NOT NULL in the database, but is not configured as not_null or required!");
safeDefine('DBG_RAISE_ON_WARNINGS', 1);
}
if ( isset($options['not_null']) && !isset($options['default']) ) {
$debugger->appendHTML("<b class='debug_error'>Config Error: </b>Field $f_name in config for prefix <b>".$config['Prefix']."</b> is described as NOT NULL, but does not have DEFAULT value!");
safeDefine('DBG_RAISE_ON_WARNINGS', 1);
}
}
}
}
}
}
}
function ProcessDependencies($prefix)
{
$config =& $this->configData[$prefix];
$deps = getArrayValue($config, '_Dependencies');
if (!$deps) return ;
foreach ($deps as $real_class => $requires) {
foreach ($requires as $class) {
$this->Application->registerDependency($real_class, $class);
}
}
unset($config['_Dependencies']);
}
function postProcessConfig($prefix, $config_key, $dst_prefix_var)
{
$main_config =& $this->configData[$prefix];
$sub_configs = getArrayValue($main_config, $config_key);
if (!$sub_configs) {
return array();
}
unset($main_config[$config_key]);
$processed = array();
foreach ($sub_configs as $sub_prefix => $sub_config) {
if ($config_key == 'AggregateConfigs' && !isset($this->configData[$sub_prefix])) {
$this->loadConfig($sub_prefix);
}
$sub_config['Prefix'] = $sub_prefix;
$this->configData[$sub_prefix] = array_merge_recursive2($this->configData[$$dst_prefix_var], $sub_config);
// when merging empty array to non-empty results non-empty array, but empty is required
foreach ($sub_config as $sub_key => $sub_value) {
if (!$sub_value) {
unset($this->configData[$sub_prefix][$sub_key]);
}
}
if ($config_key == 'Clones') {
$this->prefixFiles[$sub_prefix] = $this->prefixFiles[$prefix];
}
$this->postProcessConfig($sub_prefix, $config_key, $dst_prefix_var);
if ($config_key == 'AggregateConfigs') {
$processed = array_merge($this->postProcessConfig($sub_prefix, 'Clones', 'prefix'), $processed);
}
elseif ($this->ProcessAllConfigs) {
$this->parseConfig($sub_prefix);
}
array_push($processed, $sub_prefix);
}
if (!$prefix) {
// configs, that used only for cloning & not used ifself
unset($this->configData[$prefix]);
}
return array_unique($processed);
}
function PreloadConfigFile($filename)
{
$config_found = file_exists(FULL_PATH.$filename) && $this->configAllowed($filename);
if( defined('DEBUG_MODE') && DEBUG_MODE && constOn('DBG_PROFILE_INCLUDES') )
{
if ( in_array($filename, get_required_files()) ) return;
global $debugger;
if($config_found) {
$file = FULL_PATH.$filename;
$debugger->ProfileStart('inc_'.crc32($file), $file);
include_once($file);
$debugger->ProfileFinish('inc_'.crc32($file));
$debugger->profilerAddTotal('includes', 'inc_'.crc32($file));
}
}
else
{
if ($config_found) include_once(FULL_PATH.$filename);
}
if ($config_found) {
if (isset($config) && $config) {
// config file is included for 1st time -> save it's content for future processing
$prefix = isset($config['Prefix']) ? $config['Prefix'] : '';
preg_match('/\/(.*)\//U', $filename, $rets);
$config['ModuleFolder'] = $rets[1];
$config['BasePath'] = dirname(FULL_PATH.$filename);
if (isset($config['AdminTemplatePath'])) {
// append template base folder for admin templates path of this prefix
- $module_templates = $rets[1] == 'kernel' ? '' : $rets[1].'/';
+ $module_templates = $rets[1] == 'core' ? 'in-portal/' : $rets[1].'/';
$config['AdminTemplatePath'] = $module_templates.$config['AdminTemplatePath'];
}
$this->configData[$prefix] = $config;
$this->prefixFiles[$prefix] = $filename;
return $prefix;
}
elseif ($prefix = array_search($filename, $this->prefixFiles)) {
// attempt is made to include config file twice or more, but include_once prevents that,
// but file exists on hdd, then it is already saved to all required arrays, just return it's prefix
return $prefix;
}
}
return 'dummy';
}
function loadConfig($prefix)
{
if (!isset($this->prefixFiles[$prefix])) {
if ($this->Application->isDebugMode()) $this->Application->Debugger->appendTrace();
trigger_error('Configuration file for prefix <b>'.$prefix.'</b> is unknown', E_USER_ERROR);
return ;
}
$file = $this->prefixFiles[$prefix];
$prefix = $this->PreloadConfigFile($file);
$clones = $this->postProcessConfig($prefix, 'AggregateConfigs', 'sub_prefix');
$clones = array_merge($this->postProcessConfig($prefix, 'Clones', 'prefix'), $clones);
if ($this->FinalStage) {
array_unshift($clones, $prefix);
$clones = array_unique($clones);
foreach ($clones as $a_prefix) {
$this->Application->HandleEvent( new kEvent($a_prefix.':OnAfterConfigRead') );
}
}
}
/**
* Reads unit (specified by $prefix)
* option specified by $option
*
* @param string $prefix
* @param string $name
* @param mixed $default
* @return string
* @access public
*/
function getUnitOption($prefix, $name, $default = false)
{
if (preg_match('/(.*)\.(.*)/', $prefix, $rets)) {
if (!isset($this->configData[$rets[1]])) {
$this->loadConfig($rets[1]);
}
$ret = isset($this->configData[$rets[1]][$name][$rets[2]]) ? $this->configData[$rets[1]][$name][$rets[2]] : false;
// $ret = getArrayValue($this->configData, $rets[1], $name, $rets[2]);
}
else {
if (!isset($this->configData[$prefix])) {
$this->loadConfig($prefix);
}
$ret = isset($this->configData[$prefix][$name]) ? $this->configData[$prefix][$name] : false;
// $ret = getArrayValue($this->configData, $prefix, $name);
}
return $ret === false ? $default : $ret;
}
/**
* Read all unit with $prefix options
*
* @param string $prefix
* @return Array
* @access public
*/
function getUnitOptions($prefix)
{
if (!isset($this->configData[$prefix])) {
$this->loadConfig($prefix);
}
return $this->configData[$prefix];
}
/**
* Set's new unit option value
*
* @param string $prefix
* @param string $name
* @param string $value
* @access public
*/
function setUnitOption($prefix, $name, $value)
{
if (preg_match('/(.*)\.(.*)/', $prefix, $rets)) {
if (!isset($this->configData[$rets[1]])) {
$this->loadConfig($rets[1]);
}
$this->configData[$rets[1]][$name][$rets[2]] = $value;
}
else {
if (!isset($this->configData[$prefix])) {
$this->loadConfig($prefix);
}
$this->configData[$prefix][$name] = $value;
}
}
function getPrefixByParamName($paramName,$prefix)
{
$pseudo_class_map=Array(
'ItemClass'=>'%s',
'ListClass'=>'%s_List',
'EventHandlerClass'=>'%s_EventHandler',
'TagProcessorClass'=>'%s_TagProcessor'
);
return sprintf($pseudo_class_map[$paramName],$prefix);
}
/**
* Get's config file name based
* on folder name supplied
*
* @param string $folderPath
* @return string
* @access private
*/
function getConfigName($folderPath)
{
return $folderPath.'/'.basename($folderPath).'_config.php';
}
/**
* is_dir ajustment to work with
* directory listings too
*
* @param string $folderPath
* @return bool
* @access private
*/
function isDir($folderPath)
{
$base_name = basename($folderPath);
$ret = !( $base_name == '.' || $base_name == '..' );
return $ret && is_dir($folderPath);
}
/**
* Checks if config file is allowed for includion (if module of config is installed)
*
* @param string $config_path relative path from in-portal directory
*/
function configAllowed($config_path)
{
if (defined('IS_INSTALL') && IS_INSTALL) {
// at installation start no modules in db and kernel configs could not be read
return true;
}
if (preg_match('#/plugins/|/core|/proj-|/custom/#', $config_path)) {
return true;
}
$module_found = false;
if (!$this->Application->ModuleInfo) return false;
foreach($this->Application->ModuleInfo as $module_name => $module_info)
{
$module_path = '/'.$module_info['Path'];
if (preg_match('/^'.preg_quote($module_path, '/').'/', $config_path)) {
// if (substr($config_path, 0, strlen($module_path)) == $module_path) {
// config file path starts with module folder path
$module_found = true;
break;
}
}
return $module_found;
}
/**
* Returns true if config exists and is allowed for reading
*
* @param string $prefix
* @return bool
*/
function prefixRegistred($prefix)
{
return isset($this->prefixFiles[$prefix]) ? true : false;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/utility/unit_config_reader.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.64
\ No newline at end of property
+1.65
\ No newline at end of property
Index: trunk/core/kernel/db/db_tag_processor.php
===================================================================
--- trunk/core/kernel/db/db_tag_processor.php (revision 7634)
+++ trunk/core/kernel/db/db_tag_processor.php (revision 7635)
@@ -1,1760 +1,1856 @@
<?php
class kDBTagProcessor extends TagProcessor {
/**
* Description
*
* @var kDBConnection
* @access public
*/
var $Conn;
function kDBTagProcessor()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
/**
* Returns true if "new" button was pressed in toolbar
*
* @param Array $params
* @return bool
*/
function IsNewMode($params)
{
$object =& $this->getObject($params);
return $object->GetID() <= 0;
}
/**
* Returns view menu name for current prefix
*
* @param Array $params
* @return string
*/
function GetItemName($params)
{
$item_name = $this->Application->getUnitOption($this->Prefix, 'ViewMenuPhrase');
return $this->Application->Phrase($item_name);
}
function ViewMenu($params)
{
$block_params = $params;
unset($block_params['block']);
$block_params['name'] = $params['block'];
$list =& $this->GetList($params);
$block_params['PrefixSpecial'] = $list->getPrefixSpecial();
return $this->Application->ParseBlock($block_params);
}
function SearchKeyword($params)
{
$list =& $this->GetList($params);
return $this->Application->RecallVar($list->getPrefixSpecial().'_search_keyword');
}
/**
* Draw filter menu content (for ViewMenu) based on filters defined in config
*
* @param Array $params
* @return string
*/
function DrawFilterMenu($params)
{
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['spearator_block'];
$separator = $this->Application->ParseBlock($block_params);
$filter_menu = $this->Application->getUnitOption($this->Prefix,'FilterMenu');
if(!$filter_menu)
{
trigger_error('<span class="debug_error">no filters defined</span> for prefix <b>'.$this->Prefix.'</b>, but <b>DrawFilterMenu</b> tag used', E_USER_WARNING);
return '';
}
// Params: label, filter_action, filter_status
$block_params['name'] = $params['item_block'];
$view_filter = $this->Application->RecallVar($this->getPrefixSpecial().'_view_filter');
if($view_filter === false)
{
$event_params = Array('prefix'=>$this->Prefix,'special'=>$this->Special,'name'=>'OnRemoveFilters');
$this->Application->HandleEvent( new kEvent($event_params) );
$view_filter = $this->Application->RecallVar($this->getPrefixSpecial().'_view_filter');
}
$view_filter = unserialize($view_filter);
$filters = Array();
$prefix_special = $this->getPrefixSpecial();
foreach ($filter_menu['Filters'] as $filter_key => $filter_params) {
$group_params = isset($filter_params['group_id']) ? $filter_menu['Groups'][ $filter_params['group_id'] ] : Array();
if (!isset($group_params['element_type'])) {
$group_params['element_type'] = 'checkbox';
}
if (!$filter_params) {
$filters[] = $separator;
continue;
}
$block_params['label'] = addslashes( $this->Application->Phrase($filter_params['label']) );
if (getArrayValue($view_filter,$filter_key)) {
$submit = 0;
- $status = $group_params['element_type'] == 'checkbox' ? '[\'img/check_on.gif\']' : '[\'img/menu_dot.gif\']';
+ if ($params['old_style']) {
+ $status = $group_params['element_type'] == 'checkbox' ? 1 : 2;
+ }
+ else {
+ $status = $group_params['element_type'] == 'checkbox' ? '[\'img/check_on.gif\']' : '[\'img/menu_dot.gif\']';
+ }
}
else {
$submit = 1;
$status = 'null';
}
$block_params['filter_action'] = 'set_filter("'.$prefix_special.'","'.$filter_key.'","'.$submit.'",'.$params['ajax'].');';
$block_params['filter_status'] = $status; // 1 - checkbox, 2 - radio, 0 - no image
$filters[] = $this->Application->ParseBlock($block_params);
}
return implode('', $filters);
}
function IterateGridFields($params)
{
$mode = $params['mode'];
$def_block = isset($params['block']) ? $params['block'] : '';
$force_block = isset($params['force_block']) ? $params['force_block'] : false;
$grids = $this->Application->getUnitOption($this->Prefix,'Grids');
$grid_config = $grids[$params['grid']]['Fields'];
$picker_helper =& $this->Application->RecallObject('ColumnPickerHelper');
/* @var $picker_helper kColumnPickerHelper */
$picker_helper->ApplyPicker($this->getPrefixSpecial(), $grid_config, $params['grid']);
$std_params['pass_params']='true';
$std_params['PrefixSpecial']=$this->getPrefixSpecial();
$o = '';
$i = 0;
foreach ($grid_config as $field => $options) {
$i++;
$block_params = Array();
$block_params['name'] = $force_block ? $force_block : (isset($options[$mode.'_block']) ? $options[$mode.'_block'] : $def_block);
$block_params['field'] = $field;
$block_params['sort_field'] = isset($options['sort_field']) ? $options['sort_field'] : $field;
$block_params['filter_field'] = isset($options['filter_field']) ? $options['filter_field'] : $field;
$field_options = $this->Application->getUnitOption($this->Prefix.'.'.$field, 'Fields');
if (isset($field_options['use_phrases'])) {
$block_params['use_phrases'] = $field_options['use_phrases'];
}
$block_params['is_last'] = ($i == count($grid_config));
$block_params = array_merge($std_params, $block_params, $options);
$o.= $this->Application->ParseBlock($block_params, 1);
}
return $o;
}
function PickerCRC($params)
{
/* @var $picker_helper kColumnPickerHelper */
$picker_helper =& $this->Application->RecallObject('ColumnPickerHelper');
$picker_helper->SetGridName($params['grid']);
$data = $picker_helper->LoadColumns($this->getPrefixSpecial());
return $data['crc'];
}
function GridFieldsCount($params)
{
$grids = $this->Application->getUnitOption($this->Prefix, 'Grids');
$grid_config = $grids[$params['grid']]['Fields'];
return count($grid_config);
}
/**
* Prints list content using block specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintList($params)
{
$list =& $this->GetList($params);
$id_field = $this->Application->getUnitOption($this->Prefix,'IDField');
$list->Query();
$o = '';
$list->GoFirst();
$block_params=$this->prepareTagParams($params);
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
$block_params['pass_params'] = 'true';
$i = 0;
while (!$list->EOL())
{
$this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET
$block_params['is_last'] = ($i == $list->SelectedCount-1);
$o.= $this->Application->ParseBlock($block_params, 1);
$list->GoNext();
$i++;
}
$this->Application->SetVar( $this->getPrefixSpecial().'_id', '');
return $o;
}
function InitList($params)
{
$list_name = isset($params['list_name']) ? $params['list_name'] : '';
$names_mapping = $this->Application->GetVar('NamesToSpecialMapping');
if( !getArrayValue($names_mapping, $this->Prefix, $list_name) )
{
$list =& $this->GetList($params);
}
}
function BuildListSpecial($params)
{
return $this->Special;
}
/**
* Enter description here...
*
* @param Array $params
* @return kDBList
*/
function &GetList($params)
{
$list_name = $this->SelectParam($params, 'list_name,name');
if (!$list_name) {
$list_name = $this->Application->Parser->GetParam('list_name');
}
$requery = getArrayValue($params, 'requery');
if ($list_name && !$requery){
$names_mapping = $this->Application->GetVar('NamesToSpecialMapping');
$special = getArrayValue($names_mapping, $this->Prefix, $list_name);
if(!$special)
{
$special = $this->BuildListSpecial($params);
}
}
else
{
$special = $this->BuildListSpecial($params);
}
$prefix_special = rtrim($this->Prefix.'.'.$special, '.');
$params['skip_counting'] = true;
$list =& $this->Application->recallObject( $prefix_special, $this->Prefix.'_List', $params);
if ($requery) {
$this->Application->HandleEvent($an_event, $prefix_special.':OnListBuild', $params);
}
$list->Query($requery);
$this->Special = $special;
if ($list_name) {
$names_mapping[$this->Prefix][$list_name] = $special;
$this->Application->SetVar('NamesToSpecialMapping', $names_mapping);
}
return $list;
}
function ListMarker($params)
{
$list =& $this->GetList($params);
$ret = $list->getPrefixSpecial();
if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/');
return $ret;
}
function SubmitName($params)
{
$list =& $this->GetList($params);
$prefix_special = $list->getPrefixSpecial();
return 'events['.$prefix_special.']['.$params['event'].']';
}
function CombinedSortingDropDownName($params)
{
$list =& $this->GetList($params);
$prefix_special = $list->getPrefixSpecial();
return $prefix_special.'_CombinedSorting';
}
function SortingSelected($params)
{
$list =& $this->GetList($params);
$user_sorting_start = $this->getUserSortIndex();
$sorting = strtolower($list->GetOrderField($user_sorting_start).'|'.$list->GetOrderDirection($user_sorting_start));
if ($sorting == strtolower($params['sorting'])) return $params['selected'];
}
/**
* Prints list content using block specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintList2($params)
{
$per_page = $this->SelectParam($params, 'per_page,max_items');
if ($per_page !== false) $params['per_page'] = $per_page;
$list =& $this->GetList($params);
$o = '';
$direction = (isset($params['direction']) && $params['direction']=="H")?"H":"V";
$columns = (isset($params['columns'])) ? $params['columns'] : 1;
$id_field = (isset($params['id_field'])) ? $params['id_field'] : $this->Application->getUnitOption($this->Prefix, 'IDField');
if ($columns>1 && $direction=="V") {
$list->Records = $this->LinearToVertical($list->Records, $columns, $list->GetPerPage());
$list->SelectedCount=count($list->Records);
ksort($list->Records); // this is issued twice, maybe need to be removed
}
$list->GoFirst();
$block_params=$this->prepareTagParams($params);
$block_params['name']=$this->SelectParam($params, 'render_as,block');
$block_params['pass_params']='true';
$block_params['column_width'] = 100 / $columns;
$block_start_row_params = $this->prepareTagParams($params);
$block_start_row_params['name'] = $this->SelectParam($params, 'row_start_render_as,block_row_start,row_start_block');
$block_end_row_params=$this->prepareTagParams($params);
$block_end_row_params['name'] = $this->SelectParam($params, 'row_end_render_as,block_row_end,row_end_block');
$block_empty_cell_params = $this->prepareTagParams($params);
$block_empty_cell_params['name'] = $this->SelectParam($params, 'empty_cell_render_as,block_empty_cell,empty_cell_block');
$i=0;
$backup_id=$this->Application->GetVar($this->Prefix."_id");
$displayed = array();
$column_number = 1;
$cache_mod_rw = $this->Application->getUnitOption($this->Prefix, 'CacheModRewrite') && $this->Application->RewriteURLs();
while (!$list->EOL())
{
$this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET
$this->Application->SetVar( $this->Prefix.'_id', $list->GetDBField($id_field) );
$block_params['is_last'] = ($i == $list->SelectedCount-1);
if ($cache_mod_rw) {
$this->Application->setCache('filenames', $this->Prefix.'_'.$list->GetDBField($id_field), $list->GetDBField('Filename'));
$this->Application->setCache('filenames', 'c_'.$list->GetDBField('CategoryId'), $list->GetDBField('CategoryFilename'));
}
if ($i % $columns == 0) {
// record in this iteration is first in row, then open row
$column_number = 1;
$o.= $block_start_row_params['name'] ?
$this->Application->ParseBlock($block_start_row_params, 1) :
(!isset($params['no_table']) ? '<tr>' : '');
}
else {
$column_number++;
}
+ $block_params['first_col'] = $column_number == 1 ? 1 : 0;
+ $block_params['last_col'] = $column_number == $columns ? 1 : 0;
+
$block_params['column_number'] = $column_number;
$o.= $this->Application->ParseBlock($block_params, 1);
array_push($displayed, $list->GetDBField($id_field));
if (($i+1) % $columns == 0) {
// record in next iteration is first in row too, then close this row
$o.= $block_end_row_params['name'] ?
$this->Application->ParseBlock($block_end_row_params, 1) :
(!isset($params['no_table']) ? '<tr>' : '');
}
$list->GoNext();
$i++;
}
// append empty cells in place of missing cells in last row
while ($i % $columns != 0) {
// until next cell will be in new row append empty cells
$o .= $block_empty_cell_params['name'] ? $this->Application->ParseBlock($block_empty_cell_params, 1) : '<td>&nbsp;</td>';
if (($i+1) % $columns == 0) {
// record in next iteration is first in row too, then close this row
$o .= $block_end_row_params['name'] ? $this->Application->ParseBlock($block_end_row_params, 1) : '</tr>';
}
$i++;
}
$cur_displayed = $this->Application->GetVar($this->Prefix.'_displayed_ids');
if (!$cur_displayed) {
$cur_displayed = Array();
}
else {
$cur_displayed = explode(',', $cur_displayed);
}
$displayed = array_unique(array_merge($displayed, $cur_displayed));
$this->Application->SetVar($this->Prefix.'_displayed_ids', implode(',',$displayed));
$this->Application->SetVar( $this->Prefix.'_id', $backup_id);
$this->Application->SetVar( $this->getPrefixSpecial().'_id', '');
if (isset($params['more_link_render_as'])) {
$block_params = $params;
$params['render_as'] = $params['more_link_render_as'];
$o .= $this->MoreLink($params);
}
return $o;
}
function MoreLink($params)
{
$per_page = $this->SelectParam($params, 'per_page,max_items');
if ($per_page !== false) $params['per_page'] = $per_page;
$list =& $this->GetList($params);
if ($list->PerPage < $list->RecordsCount) {
$block_params = array();
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
return $this->Application->ParseBlock($block_params, 1);
}
}
function NotLastItem($params)
{
$object =& $this->getList($params); // maybe we should use $this->GetList($params) instead
return ($object->CurrentIndex < min($object->PerPage == -1 ? $object->RecordsCount : $object->PerPage, $object->RecordsCount) - 1);
}
function PageLink($params)
{
$t = isset($params['template']) ? $param['template'] : '';
+ unset($params['template']);
+
if (!$t) $t = $this->Application->GetVar('t');
if (isset($params['page'])) {
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $params['page']);
+ unset($params['page']);
}
-// $http_query =& $this->Application->recallObject('HTTPQuery');
-// $get = $http_query->getRedirectParams();
- $pass = Array('pass' => 'm,'.$this->getPrefixSpecial());
-// $pass = array_merge($get, $pass);
+ $params['pass'] = 'm,'.$this->getPrefixSpecial();
- return $this->Application->HREF($t, '', $pass);
+ return $this->Application->HREF($t, '', $params);
}
function ColumnWidth($params)
{
$columns = $this->Application->Parser->GetParam('columns');
return round(100/$columns).'%';
}
/**
* Append prefix and special to tag
* params (get them from tagname) like
* they were really passed as params
*
* @param Array $tag_params
* @return Array
* @access protected
*/
function prepareTagParams($tag_params = Array())
{
/*if (isset($tag_params['list_name'])) {
$list =& $this->GetList($tag_params);
$this->Init($list->Prefix, $list->Special);
}*/
$ret = $tag_params;
$ret['Prefix'] = $this->Prefix;
$ret['Special'] = $this->Special;
$ret['PrefixSpecial'] = $this->getPrefixSpecial();
return $ret;
}
function GetISO($currency)
{
if ($currency == 'selected') {
$iso = $this->Application->RecallVar('curr_iso');
}
elseif ($currency == 'primary' || $currency == '') {
$iso = $this->Application->GetPrimaryCurrency();
}
else { //explicit currency
$iso = $currency;
}
return $iso;
}
function ConvertCurrency($value, $iso)
{
$converter =& $this->Application->recallObject('kCurrencyRates');
// convery primary currency to selected (if they are the same, converter will just return)
$value = $converter->Convert($value, 'PRIMARY', $iso);
return $value;
}
function AddCurrencySymbol($value, $iso)
{
$currency =& $this->Application->recallObject('curr.-'.$iso, null, Array('skip_autoload' => true));
if( !$currency->isLoaded() ) $currency->Load($iso, 'ISO');
$symbol = $currency->GetDBField('Symbol');
if (!$symbol) $symbol = $currency->GetDBField('ISO').'&nbsp;';
if ($currency->GetDBField('SymbolPosition') == 0) {
$value = $symbol.$value;
}
if ($currency->GetDBField('SymbolPosition') == 1) {
$value = $value.$symbol;
}
return $value;
}
/**
* Get's requested field value
*
* @param Array $params
* @return string
* @access public
*/
function Field($params)
{
$field = $this->SelectParam($params, 'name,field');
if( !$this->Application->IsAdmin() ) $params['no_special'] = 'no_special';
$object =& $this->getObject($params);
if ( $this->HasParam($params, 'db') )
{
$value = $object->GetDBField($field);
}
else
{
if( $this->HasParam($params, 'currency') )
{
$iso = $this->GetISO($params['currency']);
$original = $object->GetDBField($field);
$value = $this->ConvertCurrency($original, $iso);
$object->SetDBField($field, $value);
$object->Fields[$field]['converted'] = true;
}
$format = getArrayValue($params, 'format');
if( !$format || $format == '$format' )
{
$format = null;
}
else
{
if(preg_match("/_regional_(.*)/", $format, $regs))
{
$lang =& $this->Application->recallObject('lang.current');
$format = $lang->GetDBField($regs[1]);
}
}
$value = $object->GetField($field, $format);
if( $this->SelectParam($params, 'negative') )
{
if(strpos($value, '-') === 0)
{
$value = substr($value, 1);
}
else
{
$value = '-'.$value;
}
}
if( $this->HasParam($params, 'currency') )
{
$value = $this->AddCurrencySymbol($value, $iso);
$params['no_special'] = 1;
}
}
if( !$this->HasParam($params, 'no_special') ) $value = htmlspecialchars($value);
if( getArrayValue($params,'checked' ) ) $value = ($value == ( isset($params['value']) ? $params['value'] : 1)) ? 'checked' : '';
if( isset($params['plus_or_as_label']) ) {
$value = substr($value, 0,1) == '+' ? substr($value, 1) : $this->Application->Phrase($value);
}
elseif( getArrayValue($params,'as_label') ) $value = $this->Application->Phrase($value);
$first_chars = $this->SelectParam($params,'first_chars,cut_first');
if($first_chars)
{
$needs_cut = strlen($value) > $first_chars;
$value = substr($value,0,$first_chars);
if($needs_cut) $value .= ' ...';
}
if( getArrayValue($params,'nl2br' ) ) $value = nl2br($value);
if ($value != '') $this->Application->Parser->DataExists = true;
if( $this->HasParam($params, 'currency') )
{
//restoring value in original currency, for other Field tags to work properly
$object->SetDBField($field, $original);
}
return $value;
}
function SetField($params)
{
// <inp2:SetField field="Value" src=p:cust_{$custom_name}"/>
$object =& $this->getObject($params);
$dst_field = $this->SelectParam($params, 'name,field');
list($prefix_special, $src_field) = explode(':', $params['src']);
$src_object =& $this->Application->recallObject($prefix_special);
$object->SetDBField($dst_field, $src_object->GetDBField($src_field));
}
/**
* Checks if parameter is passed
* Note: works like Tag and line simple method too
*
* @param Array $params
* @param string $param_name
* @return bool
*/
function HasParam($params, $param_name = null)
{
if( !isset($param_name) )
{
$param_name = $this->SelectParam($params, 'name');
$params = $this->Application->Parser->Params;
}
$value = getArrayValue($params, $param_name);
return $value && ($value != '$'.$param_name);
}
function PhraseField($params)
{
$field_label = $this->Field($params);
$translation = $this->Application->Phrase( $field_label );
return $translation;
}
function Error($params)
{
$field = $this->SelectParam($params, 'name,field');
$object =& $this->getObject($params);
$msg = $object->GetErrorMsg($field, false);
return $msg;
}
function HasError($params)
{
if ($params['field'] == 'any')
{
$object =& $this->getObject($params);
$skip_fields = getArrayValue($params, 'except');
$skip_fields = $skip_fields ? explode(',', $skip_fields) : Array();
return $object->HasErrors($skip_fields);
}
else
{
$fields = $this->SelectParam($params, 'field,fields');
$fields = explode(',', $fields);
$res = false;
foreach($fields as $field)
{
$params['field'] = $field;
$res = $res || ($this->Error($params) != '');
}
return $res;
}
}
function ErrorWarning($params)
{
if (!isset($params['field'])) {
$params['field'] = 'any';
}
if ($this->HasError($params)) {
return $this->Application->ParseBlock($params);
}
}
function IsRequired($params)
{
$field = $params['field'];
$object =& $this->getObject($params);;
$formatter_class = getArrayValue($object->Fields, $field, 'formatter');
if ($formatter_class == 'kMultiLanguage')
{
$formatter =& $this->Application->recallObject($formatter_class);
$field = $formatter->LangFieldName($field);
}
$options = $object->GetFieldOptions($field);
return getArrayValue($options,'required');
}
function PredefinedOptions($params)
{
$field = $params['field'];
$object =& $this->getObject($params);
$value = $object->GetDBField($field);
$options = $object->GetFieldOptions($field);
if( $this->HasParam($params,'has_empty') )
{
$empty_value = getArrayValue($params, 'empty_value');
if($empty_value === false) $empty_value = '';
$options['options'] = array_merge_recursive2( Array($empty_value => ''), $options['options'] );
}
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
$block_params['field'] = $params['field'];
$block_params['pass_params'] = 'true';
$block_params['field_name'] = $this->InputName($params);
$block_params['PrefixSpecial'] = $this->getPrefixSpecial();
$selected_param_name = getArrayValue($params,'selected_param');
if(!$selected_param_name) $selected_param_name = $params['selected'];
$selected = $params['selected'];
$o = '';
if( $this->HasParam($params,'no_empty') && !getArrayValue($options['options'],'') ) array_shift($options['options']);
if( strpos($value, '|') !== false )
{
// multiple selection checkboxes
$value = explode('|', substr($value, 1, -1) );
foreach ($options['options'] as $key => $val)
{
$block_params['key'] = $key;
$block_params['option'] = $val;
$block_params[$selected_param_name] = ( in_array($key, $value) ? ' '.$selected : '');
$o .= $this->Application->ParseBlock($block_params, 1);
}
}
else
{
// single selection radio or checkboxes
foreach ($options['options'] as $key => $val)
{
$block_params['key'] = $key;
$block_params['option'] = $val;
$block_params[$selected_param_name] = (strlen($key) == strlen($value) && ($key == $value) ? ' '.$selected : '');
$o .= $this->Application->ParseBlock($block_params, 1);
}
}
return $o;
}
function PredefinedSearchOptions($params)
{
$object =& $this->getObject($params);
/* @var $object kDBList */
$field = $params['field'];
$saved_value = $object->Queried ? $object->GetDBField($field) : null;
$object->SetDBField($field, $this->SearchField($params));
$view_name = $this->Application->RecallVar($this->getPrefixSpecial().'_current_view');
$custom_filter = $this->Application->RecallPersistentVar($this->getPrefixSpecial().'_custom_filter.'.$view_name);
$ret = $this->PredefinedOptions($params);
$object->SetDBField($field, $saved_value);
return $ret;
}
function Format($params)
{
$field = $this->SelectParam($params, 'name,field');
$object =& $this->getObject($params);
$options = $object->GetFieldOptions($field);
$format = $options[ $this->SelectParam($params, 'input_format') ? 'input_format' : 'format' ];
$formatter_class = getArrayValue($options,'formatter');
if($formatter_class)
{
$formatter =& $this->Application->recallObject($formatter_class);
$human_format = getArrayValue($params,'human');
$edit_size = getArrayValue($params,'edit_size');
$sample = getArrayValue($params,'sample');
if($sample)
{
return $formatter->GetSample($field, $options, $object);
}
elseif($human_format || $edit_size)
{
$format = $formatter->HumanFormat($format);
return $edit_size ? strlen($format) : $format;
}
}
return $format;
}
/**
+ * Returns grid padination information
+ * Can return links to pages
+ *
+ * @param Array $params
+ * @return mixed
+ */
+ function PageInfo($params)
+ {
+ $object =& $this->GetList($params);
+ /* @var $object kDBList */
+
+ $type = $params['type'];
+ unset($params['type']); // remove parameters used only by current tag
+
+ switch ($type) {
+ case 'current':
+ $ret = $object->Page;
+ break;
+
+ case 'total':
+ $ret = $object->GetTotalPages();
+ break;
+
+ case 'prev':
+ $ret = $object->Page > 1 ? $object->Page - 1 : false;
+ break;
+
+ case 'next':
+ $ret = $object->Page < $object->GetTotalPages() ? $object->Page + 1 : false;
+ break;
+ }
+
+ if ($ret && isset($params['as_link']) && $params['as_link']) {
+ unset($params['as_link']); // remove parameters used only by current tag
+ $params['page'] = $ret;
+ $current_page = $object->Page; // backup current page
+ $ret = $this->PageLink($params);
+ $this->Application->SetVar($object->getPrefixSpecial().'_Page', $current_page); // restore page
+ }
+
+ return $ret;
+ }
+
+ /**
* Print grid pagination using
* block names specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintPages($params)
{
$list =& $this->GetList($params);
$prefix_special = $list->getPrefixSpecial();
$total_pages = $list->GetTotalPages();
if ($total_pages > 1) $this->Application->Parser->DataExists = true;
if($total_pages == 0) $total_pages = 1; // display 1st page as selected in case if we have no pages at all
$o = '';
// what are these 2 lines for?
$this->Application->SetVar($prefix_special.'_event','');
$this->Application->SetVar($prefix_special.'_id','');
$current_page = $list->Page; // $this->Application->RecallVar($prefix_special.'_Page');
$block_params = $this->prepareTagParams($params);
$split = ( isset($params['split'] ) ? $params['split'] : 10 );
$split_start = $current_page - ceil($split/2);
if ($split_start < 1){
$split_start = 1;
}
$split_end = $split_start + $split-1;
if ($split_end > $total_pages) {
$split_end = $total_pages;
$split_start = max($split_end - $split + 1, 1);
}
if ($current_page > 1){
$prev_block_params = $this->prepareTagParams();
if ($total_pages > $split){
$prev_block_params['page'] = max($current_page-$split, 1);
$prev_block_params['name'] = $this->SelectParam($params, 'prev_page_split_render_as,prev_page_split_block');
if ($prev_block_params['name']){
$o .= $this->Application->ParseBlock($prev_block_params, 1);
}
}
$prev_block_params['name'] = 'page';
$prev_block_params['page'] = $current_page-1;
$prev_block_params['name'] = $this->SelectParam($params, 'prev_page_render_as,block_prev_page,prev_page_block');
if ($prev_block_params['name']) {
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $current_page-1);
$o .= $this->Application->ParseBlock($prev_block_params, 1);
}
}
else {
if ( $no_prev_page_block = $this->SelectParam($params, 'no_prev_page_render_as,block_no_prev_page') ) {
$block_params['name'] = $no_prev_page_block;
$o .= $this->Application->ParseBlock($block_params, 1);
}
}
$separator_params['name'] = $this->SelectParam($params, 'separator_render_as,block_separator');
for ($i = $split_start; $i <= $split_end; $i++)
{
if ($i == $current_page) {
$block = $this->SelectParam($params, 'current_render_as,active_render_as,block_current,active_block');
}
else {
$block = $this->SelectParam($params, 'link_render_as,inactive_render_as,block_link,inactive_block');
}
$block_params['name'] = $block;
$block_params['page'] = $i;
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $i);
$o .= $this->Application->ParseBlock($block_params, 1);
if ($this->SelectParam($params, 'separator_render_as,block_separator')
&& $i < $split_end)
{
$o .= $this->Application->ParseBlock($separator_params, 1);
}
}
if ($current_page < $total_pages){
$next_block_params = $this->prepareTagParams();
$next_block_params['page']=$current_page+1;
$next_block_params['name'] = $this->SelectParam($params, 'next_page_render_as,block_next_page,next_page_block');
if ($next_block_params['name']){
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $current_page+1);
$o .= $this->Application->ParseBlock($next_block_params, 1);
}
if ($total_pages > $split){
$next_block_params['page']=min($current_page+$split, $total_pages);
$next_block_params['name'] = $this->SelectParam($params, 'next_page_split_render_as,next_page_split_block');
if ($next_block_params['name']){
$o .= $this->Application->ParseBlock($next_block_params, 1);
}
}
}
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $current_page);
return $o;
}
/**
* Print grid pagination using
* block names specified
*
* @param Array $params
* @return string
* @access public
*/
function PaginationBar($params)
{
return $this->PrintPages($params);
}
/**
* Returns field name (processed by kMultiLanguage formatter
* if required) and item's id from it's IDField or field required
*
* @param Array $params
* @return Array (id,field)
* @access private
*/
function prepareInputName($params)
{
$field = $this->SelectParam($params, 'name,field');
$object =& $this->getObject($params);
$formatter_class = getArrayValue($object->Fields, $field, 'formatter');
if ($formatter_class == 'kMultiLanguage')
{
$formatter =& $this->Application->recallObject($formatter_class);
$field = $formatter->LangFieldName($field);
}
$id_field = getArrayValue($params, 'IdField');
$id = $id_field ? $object->GetDBField($id_field) : $object->GetID();
return Array($id, $field);
}
/**
* Returns input field name to
* be placed on form (for correct
* event processing)
*
* @param Array $params
* @return string
* @access public
*/
function InputName($params)
{
list($id, $field) = $this->prepareInputName($params);
$ret = $this->getPrefixSpecial().'['.$id.']['.$field.']';
if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/');
return $ret;
}
/**
* Allows to override various field options through hidden fields with specific names in submit.
* This tag generates this special names
*
* @param Array $params
* @return string
* @author Alex
*/
function FieldModifier($params)
{
list($id, $field) = $this->prepareInputName($params);
$ret = 'field_modifiers['.$this->getPrefixSpecial().']['.$field.']['.$params['type'].']';
if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/');
return $ret;
}
/**
* Returns index where 1st changable sorting field begins
*
* @return int
* @access private
*/
function getUserSortIndex()
{
$list_sortings = $this->Application->getUnitOption($this->Prefix, 'ListSortings');
$sorting_prefix = getArrayValue($list_sortings, $this->Special) ? $this->Special : '';
$user_sorting_start = 0;
if ( $forced_sorting = getArrayValue($list_sortings, $sorting_prefix, 'ForcedSorting') ) {
$user_sorting_start = count($forced_sorting);
}
return $user_sorting_start;
}
/**
* Returns order direction for given field
*
*
*
* @param Array $params
* @return string
* @access public
*/
function Order($params)
{
$field = $params['field'];
$user_sorting_start = $this->getUserSortIndex();
$list =& $this->GetList($params);
if ($list->GetOrderField($user_sorting_start) == $field)
{
return strtolower($list->GetOrderDirection($user_sorting_start));
}
elseif($list->GetOrderField($user_sorting_start+1) == $field)
{
return '2_'.strtolower($list->GetOrderDirection($user_sorting_start+1));
}
else
{
return 'no';
}
}
/**
* Get's information of sorting field at "pos" position,
* like sorting field name (type="field") or sorting direction (type="direction")
*
* @param Array $params
* @return mixed
*/
function OrderInfo($params)
{
$user_sorting_start = $this->getUserSortIndex() + --$params['pos'];
$list =& $this->GetList($params);
// $object =& $this->Application->recallObject( $this->getPrefixSpecial() );
if($params['type'] == 'field') return $list->GetOrderField($user_sorting_start);
if($params['type'] == 'direction') return $list->GetOrderDirection($user_sorting_start);
}
/**
* Checks if sorting field/direction matches passed field/direction parameter
*
* @param Array $params
* @return bool
*/
function IsOrder($params)
{
$params['type'] = isset($params['field']) ? 'field' : 'direction';
$value = $this->OrderInfo($params);
if( isset($params['field']) ) return $params['field'] == $value;
if( isset($params['direction']) ) return $params['direction'] == $value;
}
/**
* Returns list perpage
*
* @param Array $params
* @return int
*/
function PerPage($params)
{
$object =& $this->getObject($params);
return $object->PerPage;
}
/**
* Checks if list perpage matches value specified
*
* @param Array $params
* @return bool
*/
function PerPageEquals($params)
{
$object =& $this->getObject($params);
return $object->PerPage == $params['value'];
}
function SaveEvent($params)
{
// SaveEvent is set during OnItemBuild, but we may need it before any other tag calls OnItemBuild
$object =& $this->getObject($params);
return $this->Application->GetVar($this->getPrefixSpecial().'_SaveEvent');
}
function NextId($params)
{
$object =& $this->getObject($params);
$wid = $this->Application->GetTopmostWid($this->Prefix);
$session_name = rtrim($this->getPrefixSpecial().'_selected_ids_'.$wid, '_');
$ids = explode(',', $this->Application->RecallVar($session_name));
$cur_id = $object->GetID();
$i = array_search($cur_id, $ids);
if ($i !== false) {
return $i < count($ids) - 1 ? $ids[$i + 1] : '';
}
return '';
}
function PrevId($params)
{
$object =& $this->getObject($params);
$wid = $this->Application->GetTopmostWid($this->Prefix);
$session_name = rtrim($this->getPrefixSpecial().'_selected_ids_'.$wid, '_');
$ids = explode(',', $this->Application->RecallVar($session_name));
$cur_id = $object->GetID();
$i = array_search($cur_id, $ids);
if ($i !== false) {
return $i > 0 ? $ids[$i - 1] : '';
}
return '';
}
function IsSingle($params)
{
return ($this->NextId($params) === '' && $this->PrevId($params) === '');
}
function IsLast($params)
{
return ($this->NextId($params) === '');
}
function IsFirst($params)
{
return ($this->PrevId($params) === '');
}
/**
* Checks if field value is equal to proposed one
*
* @param Array $params
* @return bool
*/
function FieldEquals($params)
{
$object =& $this->getObject($params);
$ret = $object->GetDBField($this->SelectParam($params, 'name,field')) == $params['value'];
// if( getArrayValue($params,'inverse') ) $ret = !$ret;
return $ret;
}
function ItemIcon($params)
{
$object =& $this->getObject($params);
$grids = $this->Application->getUnitOption($this->Prefix,'Grids');
$icons =& $grids[ $params['grid'] ]['Icons'];
$key = '';
$status_fields = $this->Application->getUnitOption($this->Prefix,'StatusField');
if(!$status_fields) return $icons['default'];
foreach($status_fields as $status_field)
{
$key .= $object->GetDBField($status_field).'_';
}
$key = rtrim($key,'_');
$value = ($key !== false) ? $key : 'default';
return isset($icons[$value]) ? $icons[$value] : $icons['default'];
}
/**
* Generates bluebar title + initializes prefixes used on page
*
* @param Array $params
* @return string
*/
function SectionTitle($params)
{
$preset_name = replaceModuleSection($params['title_preset']);
$title_presets = $this->Application->getUnitOption($this->Prefix,'TitlePresets');
$title_info = getArrayValue($title_presets, $preset_name);
if($title_info === false) return str_replace('#preset_name#', $preset_name, $params['title']);
if( getArrayValue($title_presets,'default') )
{
// use default labels + custom labels specified in preset used
$title_info = array_merge_recursive2($title_presets['default'], $title_info);
}
$title = $title_info['format'];
// 1. get objects in use for title construction
$objects = Array();
$object_status = Array();
$status_labels = Array();
$prefixes = getArrayValue($title_info,'prefixes');
$all_tag_params = getArrayValue($title_info,'tag_params');
if($prefixes)
{
// extract tag_perams passed directly to SectionTitle tag for specific prefix
foreach ($params as $tp_name => $tp_value) {
if (preg_match('/(.*)\[(.*)\]/', $tp_name, $regs)) {
$all_tag_params[ $regs[1] ][ $regs[2] ] = $tp_value;
unset($params[$tp_name]);
}
}
$tag_params = Array();
foreach($prefixes as $prefix_special)
{
$prefix_data = $this->Application->processPrefix($prefix_special);
$prefix_data['prefix_special'] = rtrim($prefix_data['prefix_special'],'.');
if($all_tag_params)
{
$tag_params = getArrayValue($all_tag_params, $prefix_data['prefix_special']);
if(!$tag_params) $tag_params = Array();
}
$tag_params = array_merge_recursive2($params, $tag_params);
$objects[ $prefix_data['prefix_special'] ] =& $this->Application->recallObject($prefix_data['prefix_special'], $prefix_data['prefix'], $tag_params);
$object_status[ $prefix_data['prefix_special'] ] = $objects[ $prefix_data['prefix_special'] ]->IsNewItem() ? 'new' : 'edit';
// a. set object's status field (adding item/editing item) for each object in title
if( getArrayValue($title_info[ $object_status[ $prefix_data['prefix_special'] ].'_status_labels' ],$prefix_data['prefix_special']) )
{
$status_labels[ $prefix_data['prefix_special'] ] = $title_info[ $object_status[ $prefix_data['prefix_special'] ].'_status_labels' ][ $prefix_data['prefix_special'] ];
$title = str_replace('#'.$prefix_data['prefix_special'].'_status#', $status_labels[ $prefix_data['prefix_special'] ], $title);
}
// b. setting object's titlefield value (in titlebar ONLY) to default in case if object beeing created with no titlefield filled in
if( $object_status[ $prefix_data['prefix_special'] ] == 'new' )
{
$new_value = $this->getInfo( $objects[ $prefix_data['prefix_special'] ], 'titlefield' );
if(!$new_value && getArrayValue($title_info['new_titlefield'],$prefix_data['prefix_special']) ) $new_value = $this->Application->Phrase($title_info['new_titlefield'][ $prefix_data['prefix_special'] ]);
- $title = str_replace('#'.$prefix_data['prefix_special'].'_titlefield#', $new_value, $title);
+ // old format had single quotes in the format
+ $title = str_replace('\'#'.$prefix_data['prefix_special'].'_titlefield#\'', "'$new_value'", $title);
+ // new format has no quotes and $new_value should be empty when creating items
+ if ($new_value) {
+ $title = str_replace('#'.$prefix_data['prefix_special'].'_titlefield#', "'$new_value'", $title);
+ }
}
}
}
// 2. replace phrases if any found in format string
$title = $this->Application->ReplaceLanguageTags($title,false);
// 3. find and replace any replacement vars
preg_match_all('/#(.*_.*)#/Uis',$title,$rets);
if($rets[1])
{
$replacement_vars = array_keys( array_flip($rets[1]) );
foreach($replacement_vars as $replacement_var)
{
$var_info = explode('_',$replacement_var,2);
$object =& $objects[ $var_info[0] ];
$new_value = $this->getInfo($object,$var_info[1]);
- $title = str_replace('#'.$replacement_var.'#', $new_value, $title);
+ $title = str_replace('\'#'.$replacement_var.'#\'', "'$new_value'", $title);
+ if ($new_value) {
+ $title = str_replace('#'.$replacement_var.'#', "'$new_value'", $title);
+ }
+ else {
+ $title = str_replace('#'.$replacement_var.'#', $new_value, $title);
+ }
}
}
$cut_first = getArrayValue($params,'cut_first');
if( $cut_first && strlen($title) > $cut_first && !preg_match('/<a href="(.*)">(.*)<\/a>/',$title) ) $title = substr($title, 0, $cut_first).' ...';
return $title;
}
function getInfo(&$object, $info_type)
{
switch ($info_type)
{
case 'titlefield':
$field = $this->Application->getUnitOption($object->Prefix,'TitleField');
return $field !== false ? $object->GetField($field) : 'TitleField Missing';
break;
case 'recordcount':
$of_phrase = $this->Application->Phrase('la_of');
return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' '.$of_phrase.' '.$object->NoFilterCount : $object->RecordsCount;
break;
default:
return $object->GetField($info_type);
break;
}
}
function GridInfo($params) {
- $object =& $this->getObject($params);
+ $object =& $this->GetList($params);
/* @var $object kDBList */
switch ($params['type'])
{
case 'filtered':
return $object->RecordsCount;
case 'total':
return $object->NoFilterCount;
case 'from':
return $object->RecordsCount ? $object->Offset+1 : 0; //0-based
case 'to':
return min($object->Offset + $object->PerPage, $object->RecordsCount);
+ case 'total_pages':
+ return ceil($object->RecordsCount / $object->PerPage);
+ case 'needs_pagination':
+ return $object->RecordsCount > $object->PerPage;
}
}
/**
* Parses block depending on its element type.
* For radio and select elements values are taken from 'value_list_field' in key1=value1,key2=value2
* format. key=value can be substituted by <SQL>SELECT f1 AS OptionName, f2 AS OptionValue... FROM <PREFIX>TableName </SQL>
* where prefix is TABLE_PREFIX
*
* @param Array $params
* @return string
*/
function ConfigFormElement($params)
{
$object =& $this->getObject($params);
$field = $params['field'];
$helper =& $this->Application->recallObject('InpCustomFieldsHelper');
$element_type = $object->GetDBField($params['element_type_field']);
if($element_type == 'label') $element_type = 'text';
$params['name'] = $params['blocks_prefix'].$element_type;
switch ($element_type) {
case 'select':
case 'radio':
$field_options = $object->GetFieldOptions($field, 'options');
$field_options['options'] = $helper->GetValuesHash( $object->GetDBField($params['value_list_field']) );
$object->SetFieldOptions($field, $field_options);
break;
case 'text':
case 'textarea':
$params['field_params'] = $helper->ParseConfigSQL($object->GetDBField($params['value_list_field']));
break;
case 'password':
case 'checkbox':
default:
break;
}
return $this->Application->ParseBlock($params, 1);
}
/**
* Get's requested custom field value
*
* @param Array $params
* @return string
* @access public
*/
function CustomField($params)
{
$params['name'] = 'cust_'.$this->SelectParam($params, 'name,field');
return $this->Field($params);
}
function CustomFieldLabel($params)
{
$object =& $this->getObject($params);
$field = $this->SelectParam($params, 'name,field');
$sql = 'SELECT FieldLabel
FROM '.$this->Application->getUnitOption('cf', 'TableName').'
WHERE FieldName = '.$this->Conn->qstr($field);
return $this->Application->Phrase($this->Conn->GetOne($sql));
}
/**
* transposes 1-dimensional array elements for vertical alignment according to given columns and per_page parameters
*
* @param array $arr
* @param int $columns
* @param int $per_page
* @return array
*/
function LinearToVertical(&$arr, $columns, $per_page)
{
$rows = $columns;
// in case if after applying per_page limit record count less then
// can fill requrested column count, then fill as much as we can
$cols = min(ceil($per_page / $columns), ceil(count($arr) / $columns));
$imatrix = array();
for ($row = 0; $row < $rows; $row++) {
for ($col = 0; $col < $cols; $col++) {
$source_index = $row * $cols + $col;
if (!isset($arr[$source_index])) {
// in case if source array element count is less then element count in one row
continue;
}
$imatrix[$col * $rows + $row] = $arr[$source_index];
}
}
ksort($imatrix);
reset($imatrix);
return $imatrix;
}
/**
* If data was modfied & is in TempTables mode, then parse block with name passed;
* remove modification mark if not in TempTables mode
*
* @param Array $params
* @return string
* @access public
* @author Alexey
*/
function SaveWarning($params)
{
$main_prefix = getArrayValue($params, 'main_prefix');
if ($main_prefix && $main_prefix != '$main_prefix') {
$top_prefix = $main_prefix;
}
else {
$top_prefix = $this->Application->GetTopmostPrefix($this->Prefix);
}
$temp_tables = substr($this->Application->GetVar($top_prefix.'_mode'), 0, 1) == 't';
$modified = $this->Application->RecallVar($top_prefix.'_modified');
if ($temp_tables && $modified) {
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $this->SelectParam($params, 'render_as,name');
$block_params['edit_mode'] = $temp_tables ? 1 : 0;
return $this->Application->ParseBlock($block_params);
}
$this->Application->RemoveVar($top_prefix.'_modified');
return '';
}
/**
* Returns list record count queries (on all pages)
*
* @param Array $params
* @return int
*/
function TotalRecords($params)
{
$list =& $this->GetList($params);
if (!$list->Counted) $list->CountRecs();
return $list->RecordsCount;
}
/**
* Range filter field name
*
* @param Array $params
* @return string
*/
function SearchInputName($params)
{
$field = $this->SelectParam($params, 'field,name');
$ret = 'custom_filters['.$this->getPrefixSpecial().']['.$params['grid'].']['.$field.']['.$params['filter_type'].']';
if (isset($params['type'])) {
$ret .= '['.$params['type'].']';
}
return $ret;
}
/**
* Return range filter field value
*
* @param Array $params
* @return string
*/
function SearchField($params) // RangeValue
{
$field = $this->SelectParam($params, 'field,name');
$view_name = $this->Application->RecallVar($this->getPrefixSpecial().'_current_view');
$custom_filter = $this->Application->RecallPersistentVar($this->getPrefixSpecial().'_custom_filter.'.$view_name);
$custom_filter = $custom_filter ? unserialize($custom_filter) : Array();
if (isset($custom_filter[ $params['grid'] ][$field])) {
$ret = $custom_filter[ $params['grid'] ][$field][ $params['filter_type'] ]['submit_value'];
if (isset($params['type'])) {
$ret = $ret[ $params['type'] ];
}
if( !$this->HasParam($params, 'no_special') ) $ret = htmlspecialchars($ret);
return $ret;
}
return '';
}
function SearchFormat($params)
{
$field = $params['field'];
$object =& $this->GetList($params);
$options = $object->GetFieldOptions($field);
$format = $options[ $this->SelectParam($params, 'input_format') ? 'input_format' : 'format' ];
$formatter_class = getArrayValue($options,'formatter');
if($formatter_class)
{
$formatter =& $this->Application->recallObject($formatter_class);
$human_format = getArrayValue($params,'human');
$edit_size = getArrayValue($params,'edit_size');
$sample = getArrayValue($params,'sample');
if($sample)
{
return $formatter->GetSample($field, $options, $object);
}
elseif($human_format || $edit_size)
{
$format = $formatter->HumanFormat($format);
return $edit_size ? strlen($format) : $format;
}
}
return $format;
}
/**
* Returns error of range field
*
* @param unknown_type $params
* @return unknown
*/
function SearchError($params)
{
$field = $this->SelectParam($params, 'field,name');
$error_var_name = $this->getPrefixSpecial().'_'.$field.'_'.$params['type'].'_error';
$error_msg = $this->Application->RecallVar($error_var_name);
if($error_msg)
{
$this->Application->StoreVar($error_var_name, '');
}
$object =& $this->Application->recallObject($this->Prefix.'.'.$this->Special.'-item', null, Array('skip_autoload' => true));
return $object->ErrorMsgs[$error_msg];
}
/**
* Returns templates path for module, which is gathered from prefix module
*
* @param Array $params
* @return string
* @author Alex
*/
function ModulePath($params)
{
$force_module = getArrayValue($params, 'module');
if ($force_module) {
if ($force_module == '#session#') {
$force_module = $this->Application->RecallVar('module');
if (!$force_module) $force_module = 'core';
}
else {
$force_module = strtolower($force_module);
}
if ($force_module == 'core') {
$module_folder = 'core';
}
else {
$module_folder = trim( $this->Application->findModule('Name', $force_module, 'Path'), '/');
}
}
else {
$module_folder = $this->Application->getUnitOption($this->Prefix, 'ModuleFolder');
}
return '../../'.$module_folder.'/admin_templates/';
}
/**
* Returns object used in tag processor
*
* @access public
* @return kDBBase
*/
function &getObject($params = Array())
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
return $object;
}
/**
* Checks if object propery value matches value passed
*
* @param Array $params
* @return bool
*/
function PropertyEquals($params)
{
$object =& $this->getObject($params);
$property_name = $this->SelectParam($params, 'name,var,property');
return $object->$property_name == $params['value'];
}
/**
* Group list records by header, saves internal order in group
*
* @param Array $records
* @param string $heading_field
*/
function groupRecords(&$records, $heading_field)
{
$sorted = Array();
$i = 0; $record_count = count($records);
while ($i < $record_count) {
$sorted[ $records[$i][$heading_field] ][] = $records[$i];
$i++;
}
$records = Array();
foreach ($sorted as $heading => $heading_records) {
$records = array_merge_recursive($records, $heading_records);
}
}
function DisplayOriginal($params)
{
return false;
}
function MultipleEditing($params)
{
$wid = $this->Application->GetTopmostWid($this->Prefix);
$session_name = rtrim($this->getPrefixSpecial().'_selected_ids_'.$wid, '_');
$selected_ids = explode(',', $this->Application->RecallVar($session_name));
$ret = '';
if ($selected_ids) {
$selected_ids = explode(',', $selected_ids);
$object =& $this->getObject( array_merge_recursive2($params, Array('skip_autoload' => true)) );
$params['name'] = $params['render_as'];
foreach ($selected_ids as $id) {
$object->Load($id);
$ret .= $this->Application->ParseBlock($params);
}
}
return $ret;
}
function ExportStatus($params)
{
$export_object =& $this->Application->recallObject('CatItemExportHelper');
$event = new kEvent($this->getPrefixSpecial().':OnDummy');
$action_method = 'perform'.ucfirst($this->Special);
$field_values = $export_object->$action_method($event);
// finish code is done from JS now
if ($field_values['start_from'] >= $field_values['total_records'])
{
if ($this->Special == 'import') {
$this->Application->StoreVar('PermCache_UpdateRequired', 1);
- $this->Application->Redirect('categories/cache_updater', Array('m_opener' => 'r', 'pass' => 'm', 'continue' => 1, 'no_amp' => 1));
+ $this->Application->Redirect('in-portal/categories/cache_updater', Array('m_opener' => 'r', 'pass' => 'm', 'continue' => 1, 'no_amp' => 1));
}
elseif ($this->Special == 'export') {
$finish_t = $this->Application->RecallVar('export_finish_t');
$this->Application->Redirect($finish_t, Array('pass' => 'all'));
$this->Application->RemoveVar('export_finish_t');
}
}
$export_options = $export_object->loadOptions($event);
return $export_options['start_from'] * 100 / $export_options['total_records'];
}
/**
* Returns path where exported category items should be saved
*
* @param Array $params
*/
function ExportPath($params)
{
$ret = EXPORT_PATH.'/';
if( getArrayValue($params, 'as_url') )
{
$ret = str_replace( FULL_PATH.'/', $this->Application->BaseURL(), $ret);
}
$export_options = unserialize($this->Application->RecallVar($this->getPrefixSpecial().'_options'));
$ret .= $export_options['ExportFilename'].'.'.($export_options['ExportFormat'] == 1 ? 'csv' : 'xml');
return $ret;
}
function FieldTotal($params)
{
$list =& $this->GetList($params);
return $list->GetFormattedTotal($this->SelectParam($params, 'field,name'), $params['function']);
}
function FCKEditor($params) {
$params['no_special'] = 1;
$value = $this->Field($params);
$name = $this->InputName($params);
+ $theme_path = $this->Application->BaseURL().substr($this->Application->GetFrontThemePath(), 1);
+
+ $bgcolor = $this->Application->GetVar('bgcolor');
+ if (!$bgcolor) $bgcolor = '#ffffff';
+
include_once(FULL_PATH.'/core/cmseditor/fckeditor.php');
$oFCKeditor = new FCKeditor($name);
$oFCKeditor->BasePath = BASE_PATH.'/core/cmseditor/';
$oFCKeditor->Width = $params['width'] ;
$oFCKeditor->Height = $params['height'] ;
$oFCKeditor->ToolbarSet = 'Advanced' ;
$oFCKeditor->Value = $value ;
$oFCKeditor->Config = Array(
//'UserFilesPath' => $pathtoroot.'kernel/user_files',
'ProjectPath' => BASE_PATH.'/',
'CustomConfigurationsPath' => $this->Application->BaseURL().'core/admin_templates/js/inp_fckconfig.js',
// 'EditorAreaCSS' => $this->Application->BaseURL().'/themes/inportal_site/inc/inportal.css', //GetThemeCSS(),
- 'StylesXmlPath' => $this->Application->BaseURL().'core/admin_templates/js/inp_styles.xml',
+ 'StylesXmlPath' => $theme_path.'/inc/styles.xml',
+ 'EditorAreaCSS' => $theme_path.'/inc/style.css',
+ 'DefaultClass' => 'Default Text',
// 'Debug' => 1,
'Admin' => 1,
'K4' => 1,
+ 'newBgColor' => $bgcolor,
);
return $oFCKeditor->CreateHtml();
}
+ function IsNewItem($params)
+ {
+ $object =& $this->getObject($params);
+ return $object->IsNewItem();
+ }
+
+ /**
+ * Creates link to an item including only it's id
+ *
+ * @param Array $params
+ * @return string
+ */
+ function ItemLink($params)
+ {
+ $object =& $this->getObject($params);
+
+ $params['pass'] = 'm';
+ $params[$object->getPrefixSpecial().'_id'] = $object->GetID();
+
+ return $this->Application->ProcessParsedTag('m', 't', $params);
+ }
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/db/db_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.70
\ No newline at end of property
+1.71
\ No newline at end of property
Index: trunk/core/kernel/db/dblist.php
===================================================================
--- trunk/core/kernel/db/dblist.php (revision 7634)
+++ trunk/core/kernel/db/dblist.php (revision 7635)
@@ -1,829 +1,831 @@
<?php
/**
* DBList
*
* Desciption
* @package kernel4
*/
class kDBList extends kDBBase {
/**
* Holds totals for fields specified in config
*
* @var Array
*/
var $Totals = Array();
/**
* Description
*
* @var array
* @access public
*/
var $OrderFields;
/**
* Holds counted total number of records in the query - without pagination (system+user filters)
*
* @var int
* @access public
*/
var $RecordsCount;
/**
* Records count with system filters only applied
*
* @var int
* @access private
*/
var $NoFilterCount = 0;
/**
* Record count selected to be
* showed on current page
*
* @var int
*/
var $SelectedCount=0;
/**
* Array of records selected
*
* @var Array
* @access private
*/
var $Records;
var $CurrentIndex = 0;
/**
* List items per-page
*
* @var int
* @access public
*/
var $PerPage;
/**
* Pages count in list based on PerPage & RecordsCount attributes
*
* @var int
* @access public
*/
var $TotalPages;
/**
* Description
*
* @var int
* @access public
*/
var $Direction;
/**
* Holds current page number - used when forming LIMIT clause of SELECT statement
*
* @var int
* @access public
*/
var $Page;
/**
* Holds offset for LIMIT clause, calculated in {@link kDBList::PerPage()}
*
* @var int
* @access private
*/
var $Offset;
/**
* Count SQL was already issued on query
*
* @var bool
* @access private
*/
var $hasCounted = false;
/**
* Holds list WHERE filter object
*
* @var kMultipleFilter
* @access private
*/
var $WhereFilter = Array(FLT_SYSTEM => null, FLT_NORMAL => null, FLT_SEARCH => null, FLT_VIEW => null);
/**
* Holds list HAVING filter object
*
* @var kMultipleFilter
* @access private
*/
var $HavingFilter = Array(FLT_SYSTEM => null, FLT_NORMAL => null, FLT_SEARCH => null, FLT_VIEW => null);
var $AggregateFilter = Array(FLT_SYSTEM => null, FLT_NORMAL => null);
var $GroupByFields = Array();
var $Queried = false;
var $Counted = false;
var $TotalsCalculated = false;
/**
* Creates kDBList
*
* @return kDBList
*/
function kDBList()
{
parent::kDBBase();
$this->OrderFields = Array();
$filters = $this->getFilterStructure();
foreach ($filters as $filter_params) {
$filter =& $this->$filter_params['type'];
$filter[ $filter_params['class'] ] =& $this->Application->makeClass('kMultipleFilter', $filter_params['join_using']);
}
$this->PerPage = -1;
}
/**
* Returns information about all possible filter types
*
* @return Array
*/
function getFilterStructure()
{
$filters = Array (
Array ('type' => 'WhereFilter', 'class' => FLT_SYSTEM, 'join_using' => FLT_TYPE_AND),
Array ('type' => 'WhereFilter', 'class' => FLT_NORMAL, 'join_using' => FLT_TYPE_OR),
Array ('type' => 'WhereFilter', 'class' => FLT_SEARCH, 'join_using' => FLT_TYPE_OR),
Array ('type' => 'WhereFilter', 'class' => FLT_VIEW, 'join_using' => FLT_TYPE_AND),
Array ('type' => 'WhereFilter', 'class' => FLT_CUSTOM, 'join_using' => FLT_TYPE_AND),
Array ('type' => 'HavingFilter', 'class' => FLT_SYSTEM, 'join_using' => FLT_TYPE_AND),
Array ('type' => 'HavingFilter', 'class' => FLT_NORMAL, 'join_using' => FLT_TYPE_OR),
Array ('type' => 'HavingFilter', 'class' => FLT_SEARCH, 'join_using' => FLT_TYPE_OR),
Array ('type' => 'HavingFilter', 'class' => FLT_VIEW, 'join_using' => FLT_TYPE_AND),
Array ('type' => 'HavingFilter', 'class' => FLT_CUSTOM, 'join_using' => FLT_TYPE_AND),
Array ('type' => 'AggregateFilter', 'class' => FLT_SYSTEM, 'join_using' => FLT_TYPE_AND),
Array ('type' => 'AggregateFilter', 'class' => FLT_NORMAL, 'join_using' => FLT_TYPE_OR),
Array ('type' => 'AggregateFilter', 'class' => FLT_VIEW, 'join_using' => FLT_TYPE_AND),
);
return $filters;
}
/**
* Adds new or replaces old filter with same name
*
* @param string $name filter name (for internal use)
* @param string $clause where/having clause part (no OR/AND allowed)
* @param int $filter_type is filter having filter or where filter
* @param int $filter_scope filter subtype: FLT_NORMAL,FLT_SYSTEM,FLT_SEARCH,FLT_VIEW,FLT_CUSTOM
* @access public
*/
function addFilter($name, $clause, $filter_type = WHERE_FILTER, $filter_scope = FLT_SYSTEM)
{
$filter_source = Array( WHERE_FILTER => 'WhereFilter',
HAVING_FILTER => 'HavingFilter',
AGGREGATE_FILTER => 'AggregateFilter');
$filter_name = $filter_source[$filter_type];
$filter =& $this->$filter_name;
$filter =& $filter[$filter_scope];
$filter->addFilter($name,$clause);
}
/**
* Removes specified filter from filters list
*
* @param string $name filter name (for internal use)
* @param int $filter_type is filter having filter or where filter
* @param int $filter_scope filter subtype: FLT_NORMAL,FLT_SYSTEM,FLT_SEARCH,FLT_VIEW,FLT_CUSTOM
* @access public
*/
function removeFilter($name, $filter_type = WHERE_FILTER, $filter_scope = FLT_SYSTEM)
{
$filter_source = Array( WHERE_FILTER => 'WhereFilter',
HAVING_FILTER => 'HavingFilter',
AGGREGATE_FILTER => 'AggregateFilter');
$filter_name = $filter_source[$filter_type];
$filter =& $this->$filter_name;
$filter =& $filter[$filter_scope];
$filter->removeFilter($name);
}
/**
* Clear list filters
*
*/
function clearFilters()
{
$filters = $this->getFilterStructure();
foreach ($filters as $filter_params) {
$filter =& $this->$filter_params['type'];
$filter[ $filter_params['class'] ]->clearFilters();
}
}
/**
* Counts the total number of records base on the query resulted from {@link kDBList::GetSelectSQL()}
*
* The method modifies the query to substitude SELECT part (fields listing) with COUNT(*).
* Special care should be applied when working with lists based on grouped queries, all aggregate function fields
* like SUM(), AVERAGE() etc. should be added to CountedSQL by using {@link kDBList::SetCountedSQL()}
*
* @access public
* @param string
* @return void
*/
function CountRecs()
{
$all_sql = $this->GetSelectSQL(true,false);
$sql = $this->getCountSQL($all_sql);
$this->Counted = true;
if( $this->GetGroupClause() )
{
$this->RecordsCount = count( $this->Conn->GetCol($sql) );
}
else
{
$this->RecordsCount = (int)$this->Conn->GetOne($sql);
}
$system_sql = $this->GetSelectSQL(true,true);
if($system_sql == $all_sql) //no need to query the same again
{
$this->NoFilterCount = $this->RecordsCount;
return;
}
$sql = $this->getCountSQL($system_sql);
if( $this->GetGroupClause() )
{
$this->NoFilterCount = count( $this->Conn->GetCol($sql) );
}
else
{
$this->NoFilterCount = (int)$this->Conn->GetOne($sql);
}
}
function getCountSQL($sql)
{
if ( preg_match("/DISTINCT(.*?)FROM(?!_)/is",$sql,$regs ) )
{
return preg_replace("/^.*SELECT DISTINCT(.*?)FROM(?!_)/is", "SELECT COUNT(DISTINCT ".$regs[1].") AS count FROM", $sql);
}
else
{
return preg_replace("/^.*SELECT(.*?)FROM(?!_)/is", "SELECT COUNT(*) AS count FROM ", $sql);
}
}
/**
* Queries the database with SQL resulted from {@link kDBList::GetSelectSQL()} and stores result in {@link kDBList::SelectRS}
*
* All the sorting, pagination, filtration of the list should be set prior to calling Query().
*
* @access public
* @param string
* @return void
*/
function Query($force=false)
{
if (!$force && $this->Queried) return true;
$q = $this->GetSelectSQL();
//$rs = $this->Conn->SelectLimit($q, $this->PerPage, $this->Offset);
//in case we have not counted records try to select one more item to find out if we have something more than perpage
$limit = $this->Counted ? $this->PerPage : $this->PerPage+1;
$sql = $q.' '.$this->Conn->getLimitClause($this->Offset,$limit);
$this->Records = $this->Conn->Query($sql);
$this->SelectedCount = count($this->Records);
if (!$this->Counted) $this->RecordsCount = $this->SelectedCount;
if (!$this->Counted && $this->SelectedCount > $this->PerPage && $this->PerPage != -1) $this->SelectedCount--;
if ($this->Records === false) {
//handle errors here
return false;
}
$this->Queried = true;
return true;
}
function CalculateTotals()
{
$this->Totals = Array();
$fields = Array();
foreach($this->Fields as $field_name => $field_options)
{
$totals = getArrayValue($field_options, 'totals');
if(!$totals) continue;
$calculated_field = isset($this->CalculatedFields[$field_name]) && isset($this->VirtualFields[$field_name]);
$db_field = !isset($this->VirtualFields[$field_name]);
if($calculated_field || $db_field)
{
$field_expression = $calculated_field ? $this->CalculatedFields[$field_name] : '`'.$this->TableName.'`.`'.$field_name.'`';
$fields[$field_name] = $totals.'('.$field_expression.') AS '.$field_name.'_'.$totals;
}
}
if(!$fields) return false;
$sql = $this->GetSelectSQL(true, false);
$fields = implode(', ', $fields);
if ( preg_match("/DISTINCT(.*?)FROM(?!_)/is",$sql,$regs ) )
{
$sql = preg_replace("/^.*SELECT DISTINCT(.*?)FROM(?!_)/is", 'SELECT '.$fields.' FROM', $sql);
}
else
{
$sql = preg_replace("/^.*SELECT(.*?)FROM(?!_)/is", 'SELECT '.$fields.' FROM ', $sql);
}
$totals = $this->Conn->Query($sql);
foreach($totals as $totals_row)
{
foreach($totals_row as $total_field => $field_value)
{
if(!isset($this->Totals[$total_field])) $this->Totals[$total_field] = 0;
$this->Totals[$total_field] += $field_value;
}
}
$this->TotalsCalculated = true;
}
function getTotal($field, $total_function)
{
if (!$this->TotalsCalculated) $this->CalculateTotals();
return $this->Totals[$field.'_'.$total_function];
}
function GetFormattedTotal($field, $total_function)
{
$val = $this->getTotal($field, $total_function);
$options = $this->GetFieldOptions($field);
$res = $val;
if (isset($options['formatter'])) {
$formatter =& $this->Application->recallObject($options['formatter']);
$res = $formatter->Format($val, $field, $this );
}
return $res;
}
/**
* Builds full select query except for LIMIT clause
*
* @access public
* @return string
*/
function GetSelectSQL($for_counting=false,$system_filters_only=false)
{
$q = parent::GetSelectSQL($this->SelectClause);
$q = !$for_counting ? $this->addCalculatedFields($q, 0) : str_replace('%2$s', '', $q);
$where = $this->GetWhereClause($for_counting,$system_filters_only);
$having = $this->GetHavingClause($for_counting,$system_filters_only);
$order = $this->GetOrderClause();
$group = $this->GetGroupClause();
if (!empty($where)) $q .= ' WHERE ' . $where;
if (!empty($group)) $q .= ' GROUP BY ' . $group;
if (!empty($having)) $q .= ' HAVING ' . $having;
if ( !$for_counting && !empty($order) ) $q .= ' ORDER BY ' . $order;
return $this->replaceModePrefix( str_replace('%1$s', $this->TableName, $q) );
}
/**
* Enter description here...
*
* @param string $clause where clause to extract calculated fields from
* @param int $aggregated 0 - having + aggregated, 1 - having only, 2 - aggregated only
* @return string
*/
function extractCalculatedFields($clause, $aggregated = 1)
{
$fields = $this->getCalculatedFields($aggregated);
if (is_array($fields) && count($fields) > 0) {
foreach ($fields as $field_name => $field_expression) {
$clause = preg_replace('/(\\(+)[(,` ]*'.$field_name.'[` ]{1}/', '\1 '.$field_expression.' ', $clause);
$clause = preg_replace('/[,` ]{1}'.$field_name.'[` ]{1}/', ' '.$field_expression.' ', $clause);
}
}
return $clause;
}
/**
* Returns WHERE clause of the query
*
* @access public
* @param bool $for_counting merge where filters with having filters + replace field names for having fields with their values
* @return string
*/
function GetWhereClause($for_counting=false,$system_filters_only=false)
{
$where =& $this->Application->makeClass('kMultipleFilter');
$where->addFilter('system_where', $this->WhereFilter[FLT_SYSTEM] );
if (!$system_filters_only) {
$where->addFilter('view_where', $this->WhereFilter[FLT_VIEW] );
$search_w = $this->WhereFilter[FLT_SEARCH]->getSQL();
if ($search_w || $for_counting) { // move search_having to search_where in case search_where isset or we are counting
$search_h = $this->extractCalculatedFields( $this->HavingFilter[FLT_SEARCH]->getSQL() );
$search_w = ($search_w && $search_h) ? $search_w.' OR '.$search_h : $search_w.$search_h;
$where->addFilter('search_where', $search_w );
}
// CUSTOM
$search_w = $this->WhereFilter[FLT_CUSTOM]->getSQL();
if ($search_w || $for_counting) { // move search_having to search_where in case search_where isset or we are counting
$search_h = $this->extractCalculatedFields( $this->HavingFilter[FLT_CUSTOM]->getSQL() );
$search_w = ($search_w && $search_h) ? $search_w.' AND '.$search_h : $search_w.$search_h;
$where->addFilter('custom_where', $search_w );
}
// CUSTOM
}
if( $for_counting ) // add system_having and view_having to where
{
$where->addFilter('system_having', $this->extractCalculatedFields($this->HavingFilter[FLT_SYSTEM]->getSQL()) );
if (!$system_filters_only) $where->addFilter('view_having', $this->extractCalculatedFields( $this->HavingFilter[FLT_VIEW]->getSQL() ) );
}
return $where->getSQL();
}
/**
* Depricated method
*
* @param string $clause
* @todo REMOVE
*/
function SetWhereClause($clause)
{
if( $this->Application->isDebugMode() )
{
global $debugger;
$debugger->appendTrace();
}
trigger_error('Depricated method <b>kDBList->SetWhereClause</b>. Use <b>kDBList->addFilter</b> instead.', E_USER_ERROR);
}
/**
* Returns HAVING clause of the query
*
* @param bool $for_counting don't return having filter in case if this is counting sql
* @param bool $system_filters_only return only system having filters
* @param int $aggregated 0 - aggregated and having, 1 - having only, 2 - aggregated only
* @return string
* @access public
*/
function GetHavingClause($for_counting=false, $system_filters_only=false, $aggregated = 0)
{
if ($for_counting) {
$aggregate_filter =& $this->Application->makeClass('kMultipleFilter');
$aggregate_filter->addFilter('aggregate_system', $this->AggregateFilter[FLT_SYSTEM]);
if (!$system_filters_only) {
$aggregate_filter->addFilter('aggregate_view', $this->AggregateFilter[FLT_VIEW]);
}
return $this->extractCalculatedFields($aggregate_filter->getSQL(), 2);
}
$having =& $this->Application->makeClass('kMultipleFilter');
$having->addFilter('system_having', $this->HavingFilter[FLT_SYSTEM] );
if ($aggregated == 0) {
if (!$system_filters_only) {
$having->addFilter('view_aggregated', $this->AggregateFilter[FLT_VIEW] );
}
$having->addFilter('system_aggregated', $this->AggregateFilter[FLT_SYSTEM]);
}
if (!$system_filters_only) {
$having->addFilter('view_having', $this->HavingFilter[FLT_VIEW] );
$having->addFilter('custom_having', $this->HavingFilter[FLT_CUSTOM] );
$search_w = $this->WhereFilter[FLT_SEARCH]->getSQL();
if (!$search_w) {
$having->addFilter('search_having', $this->HavingFilter[FLT_SEARCH] );
}
}
return $having->getSQL();
}
/**
* Returns GROUP BY clause of the query
*
* @access public
* @return string
*/
function GetGroupClause()
{
return $this->GroupByFields ? implode(',', $this->GroupByFields) : '';
}
function AddGroupByField($field)
{
$this->GroupByFields[$field] = $field;
}
function RemoveGroupByField($field)
{
unset($this->GroupByFields[$field]);
}
/**
* Adds order field to ORDER BY clause
*
* @access public
* @param string $field Field name
* @param string $direction Direction of ordering (asc|desc)
+ * @param bool $is_expression this is expression, that should not be escapted by "`" symbols
* @return void
*/
- function AddOrderField($field, $direction)
+ function AddOrderField($field, $direction = 'asc', $is_expression = false)
{
// original multilanguage field - convert to current lang field
if (getArrayValue($this->Fields, $field, 'formatter') == 'kMultiLanguage' && !getArrayValue($this->Fields, $field, 'master_field')) {
$lang = $this->Application->GetVar('m_lang');
$field = 'l'.$lang.'_'.$field;
}
- if (!isset($this->Fields[$field]) && ($field != 'RAND()')) {
+ if (!isset($this->Fields[$field]) && $field != 'RAND()' && !$is_expression) {
trigger_error('<span class="debug_error">Incorrect sorting</span> defined (field = <b>'.$field.'</b>; direction = <b>'.$direction.'</b>) in config for prefix <b>'.$this->Prefix.'</b>', E_USER_WARNING);
}
- $this->OrderFields[] = Array($field, $direction);
+ $this->OrderFields[] = Array($field, $direction, $is_expression);
}
/**
* Removes all order fields
*
* @access public
* @return void
*/
function ClearOrderFields()
{
$this->OrderFields = Array();
}
/**
* Returns ORDER BY Clause of the query
*
* The method builds order by clause by iterating {@link kDBList::OrderFields} array and concatenating it.
*
* @access public
* @return string
*/
function GetOrderClause()
{
$ret = '';
foreach ($this->OrderFields as $field) {
$name = $field[0];
$ret .= isset($this->Fields[$name]) && !isset($this->VirtualFields[$name]) ? '`'.$this->TableName.'`.' : '';
- if ($field[0] == 'RAND()') {
+
+ if ($field[0] == 'RAND()' || $field[2]) {
$ret .= $field[0].' '.$field[1].',';
}
else {
$ret .= '`'.$field[0] . '` ' . $field[1] . ',';
}
}
$ret = rtrim($ret, ',');
return $ret;
}
function GetOrderField($pos=NULL)
{
if(!(isset($this->OrderFields[$pos]) && $this->OrderFields[$pos]) )
{
$pos = 0;
}
return isset($this->OrderFields[$pos][0]) ? $this->OrderFields[$pos][0] : '';
}
function GetOrderDirection($pos=NULL)
{
if( !getArrayValue($this->OrderFields, $pos) ) $pos = 0;
return getArrayValue($this->OrderFields, $pos, 1);
}
/**
* Return unformatted field value
*
* @param string
* @return mixed
* @access public
*/
function GetDBField($name)
{
$row =& $this->getCurrentRecord();
return $row[$name];
}
/**
* Returns ID of currently processed record
*
* @return int
* @access public
*/
function GetID()
{
return $this->Queried ? $this->GetDBField($this->IDField) : null;
}
/**
* Allows kDBTagProcessor.SectionTitle to detect if it's editing or new item creation
*
* @return bool
*/
function IsNewItem()
{
// no such thing as NewItem for lists :)
return false;
}
function HasField($name)
{
$row =& $this->getCurrentRecord();
return isset($row[$name]);
}
function GetFieldValues()
{
return $this->getCurrentRecord();
}
function &getCurrentRecord()
{
return $this->Records[$this->CurrentIndex];
}
/**
* Description
*
* @access public
* @param string
* @return void
*/
function GoFirst()
{
$this->CurrentIndex = 0;
}
/**
* Description
*
* @access public
* @return void
*/
function GoNext()
{
$this->CurrentIndex++;
}
/**
* Description
*
* @access public
* @return void
*/
function GoPrev()
{
if ($this->CurrentIndex>0)
$this->CurrentIndex--;
}
/**
* Description
*
* @access public
* @return bool
*/
function EOL()
{
return ($this->CurrentIndex >= $this->SelectedCount);
}
/**
* Description
*
* @access public
* @param string
* @return void
*/
function GetTotalPages()
{
if (!$this->Counted) $this->CountRecs();
if ($this->PerPage == -1) return 1;
$this->TotalPages = (($this->RecordsCount - ($this->RecordsCount % $this->PerPage)) / $this->PerPage) // integer part of division
+ (($this->RecordsCount % $this->PerPage) != 0); // adds 1 if there is a reminder
return $this->TotalPages;
}
/**
* Sets number of records to query per page
*
* @access public
* @param int $per_page Number of records to display per page
* @return void
*/
function SetPerPage($per_page)
{
$this->PerPage = $per_page;
}
function GetPerPage()
{
return $this->PerPage == -1 ? $this->RecordsCount : $this->PerPage;
}
/**
* Description
*
* @access public
* @param int $page
* @return void
*/
function SetPage($page)
{
if ($this->PerPage == -1) {
$this->Page = 1;
return;
}
if ($page < 1) $page = 1;
$this->Offset = ($page-1)*$this->PerPage;
if ($this->Counted && $this->Offset > $this->RecordsCount) {
$this->SetPage(1);
}
else {
$this->Page = $page;
}
//$this->GoFirst();
}
/**
* Sets current item field value
* (doesn't apply formatting)
*
* @access public
* @param string $name Name of the field
* @param mixed $value Value to set the field to
* @return void
*/
function SetDBField($name,$value)
{
$this->Records[$this->CurrentIndex][$name] = $value;
}
/**
* Apply where clause, that links this object to it's parent item
*
* @param string $special
* @access public
*/
function linkToParent($special)
{
$parent_prefix = $this->Application->getUnitOption($this->Prefix, 'ParentPrefix');
if($parent_prefix)
{
$parent_table_key = $this->Application->getUnitOption($this->Prefix, 'ParentTableKey');
if (is_array($parent_table_key)) $parent_table_key = getArrayValue($parent_table_key, $parent_prefix);
$foreign_key_field = $this->Application->getUnitOption($this->Prefix, 'ForeignKey');
if (is_array($foreign_key_field)) $foreign_key_field = getArrayValue($foreign_key_field, $parent_prefix);
if (!$parent_table_key || !$foreign_key_field) return ;
$parent_object =& $this->Application->recallObject($parent_prefix.'.'.$special);
$parent_id = $parent_object->GetDBField($parent_table_key);
if (!$parent_id) return ;
$this->addFilter('parent_filter', '`'.$this->TableName.'`.`'.$foreign_key_field.'` = '.$parent_id); // only for list in this case
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/db/dblist.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.22
\ No newline at end of property
+1.23
\ No newline at end of property
Index: trunk/core/kernel/db/db_event_handler.php
===================================================================
--- trunk/core/kernel/db/db_event_handler.php (revision 7634)
+++ trunk/core/kernel/db/db_event_handler.php (revision 7635)
@@ -1,2031 +1,2046 @@
<?php
define('EH_CUSTOM_PROCESSING_BEFORE',1);
define('EH_CUSTOM_PROCESSING_AFTER',2);
/**
* Note:
* 1. When adressing variables from submit containing
* Prefix_Special as part of their name use
* $event->getPrefixSpecial(true) instead of
* $event->Prefix_Special as usual. This is due PHP
* is converting "." symbols in variable names during
* submit info "_". $event->getPrefixSpecial optional
* 1st parameter returns correct corrent Prefix_Special
* for variables beeing submitted such way (e.g. variable
* name that will be converted by PHP: "users.read_only_id"
* will be submitted as "users_read_only_id".
*
* 2. When using $this->Application-LinkVar on variables submitted
* from form which contain $Prefix_Special then note 1st item. Example:
* LinkVar($event->getPrefixSpecial(true).'_varname',$event->Prefix_Special.'_varname')
*
*/
/**
* EventHandler that is used to process
* any database related events
*
*/
class kDBEventHandler extends kEventHandler {
/**
* Description
*
* @var kDBConnection
* @access public
*/
var $Conn;
/**
* Adds ability to address db connection
*
* @return kDBEventHandler
* @access public
*/
function kDBEventHandler()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if (!$this->Application->IsAdmin()) {
$allow_events = Array('OnSearch', 'OnSearchReset', 'OnNew');
if (in_array($event->Name, $allow_events)) {
// allow search on front
return true;
}
}
$section = $event->getSection();
if (!preg_match('/^CATEGORY:(.*)/', $section)) {
// only if not category item events
if ((substr($event->Name, 0, 9) == 'OnPreSave') || ($event->Name == 'OnSave')) {
if ($this->isNewItemCreate($event)) {
return $this->Application->CheckPermission($section.'.add', 1);
}
else {
return $this->Application->CheckPermission($section.'.add', 1) || $this->Application->CheckPermission($section.'.edit', 1);
}
}
}
if ($event->Name == 'OnPreCreate') {
// save category_id before item create (for item category selector not to destroy permission checking category)
$this->Application->LinkVar('m_cat_id');
}
return parent::CheckPermission($event);
}
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnLoad' => Array('self' => 'view', 'subitem' => 'view'),
'OnNew' => Array('self' => 'add', 'subitem' => 'add|edit'),
'OnCreate' => Array('self' => 'add', 'subitem' => 'add|edit'),
'OnUpdate' => Array('self' => 'edit', 'subitem' => 'add|edit'),
'OnSetPrimary' => Array('self' => 'add|edit', 'subitem' => 'add|edit'),
'OnDelete' => Array('self' => 'delete', 'subitem' => 'add|edit'),
'OnMassDelete' => Array('self' => 'delete', 'subitem' => 'add|edit'),
'OnMassClone' => Array('self' => 'add', 'subitem' => 'add|edit'),
+ 'OnCut' => array('self'=>'edit', 'subitem' => 'edit'),
+ 'OnCopy' => array('self'=>'edit', 'subitem' => 'edit'),
+ 'OnPaste' => array('self'=>'edit', 'subitem' => 'edit'),
+
'OnSelectItems' => Array('self' => 'add|edit', 'subitem' => 'add|edit'),
'OnProcessSelected' => Array('self' => 'add|edit', 'subitem' => 'add|edit'),
'OnSelectUser' => Array('self' => 'add|edit', 'subitem' => 'add|edit'),
'OnMassApprove' => Array('self' => 'advanced:approve|edit', 'subitem' => 'advanced:approve|add|edit'),
'OnMassDecline' => Array('self' => 'advanced:decline|edit', 'subitem' => 'advanced:decline|add|edit'),
'OnMassMoveUp' => Array('self' => 'advanced:move_up|edit', 'subitem' => 'advanced:move_up|add|edit'),
'OnMassMoveDown' => Array('self' => 'advanced:move_down|edit', 'subitem' => 'advanced:move_down|add|edit'),
'OnPreCreate' => Array('self' => 'add|add.pending', 'subitem' => 'edit|edit.pending'),
'OnEdit' => Array('self' => 'edit|edit.pending', 'subitem' => 'edit|edit.pending'),
'OnExport' => Array('self' => 'view|advanced:export'),
'OnExportBegin' => Array('self' => 'view|advanced:export'),
// theese event do not harm, but just in case check them too :)
'OnCancelEdit' => Array('self' => true, 'subitem' => true),
'OnCancel' => Array('self' => true, 'subitem' => true),
'OnReset' => Array('self' => true, 'subitem' => true),
'OnSetSorting' => Array('self' => true, 'subitem' => true),
'OnSetSortingDirect' => Array('self' => true, 'subitem' => true),
'OnSetFilter' => Array('self' => true, 'subitem' => true),
'OnApplyFilters' => Array('self' => true, 'subitem' => true),
'OnRemoveFilters' => Array('self' => true, 'subitem' => true),
+ 'OnSetFilterPattern' => Array('self' => true, 'subitem' => true),
'OnSetPerPage' => Array('self' => true, 'subitem' => true),
'OnSearch' => Array('self' => true, 'subitem' => true),
'OnSearchReset' => Array('self' => true, 'subitem' => true),
'OnGoBack' => Array('self' => true, 'subitem' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
function mapEvents()
{
$events_map = Array(
'OnRemoveFilters' => 'FilterAction',
'OnApplyFilters' => 'FilterAction',
'OnMassApprove'=>'iterateItems',
'OnMassDecline'=>'iterateItems',
'OnMassMoveUp'=>'iterateItems',
'OnMassMoveDown'=>'iterateItems',
);
$this->eventMethods = array_merge($this->eventMethods, $events_map);
}
/**
* Returns ID of current item to be edited
* by checking ID passed in get/post as prefix_id
* or by looking at first from selected ids, stored.
* Returned id is also stored in Session in case
* it was explicitly passed as get/post
*
* @param kEvent $event
* @return int
*/
function getPassedID(&$event)
{
if ($event->getEventParam('raise_warnings') === false) {
$event->setEventParam('raise_warnings', 1);
}
// 1. get id from post (used in admin)
$ret = $this->Application->GetVar($event->getPrefixSpecial(true).'_id');
if($ret) return $ret;
// 2. get id from env (used in front)
$ret = $this->Application->GetVar($event->getPrefixSpecial().'_id');
if($ret) return $ret;
// recall selected ids array and use the first one
$ids = $this->Application->GetVar($event->getPrefixSpecial().'_selected_ids');
if ($ids != '') {
$ids=explode(',',$ids);
if($ids) $ret=array_shift($ids);
}
else { // if selected ids are not yet stored
$this->StoreSelectedIDs($event);
return $this->Application->GetVar($event->getPrefixSpecial(true).'_id'); // StoreSelectedIDs sets this variable
}
return $ret;
}
/**
* Prepares and stores selected_ids string
* in Session and Application Variables
* by getting all checked ids from grid plus
* id passed in get/post as prefix_id
*
* @param kEvent $event
* @param Array $ids
*
* @return Array ids stored
*/
function StoreSelectedIDs(&$event, $ids = null)
{
$wid = $this->Application->GetTopmostWid($event->Prefix);
$session_name = rtrim($event->getPrefixSpecial().'_selected_ids_'.$wid, '_');
if (isset($ids)) {
// save ids directly if they given
$this->Application->StoreVar($session_name, implode(',', $ids));
return $ids;
}
$ret = Array();
// May be we don't need this part: ?
$passed = $this->Application->GetVar($event->getPrefixSpecial(true).'_id');
if($passed !== false && $passed != '')
{
array_push($ret, $passed);
}
$ids = Array();
// get selected ids from post & save them to session
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
$id_field = $this->Application->getUnitOption($event->Prefix,'IDField');
foreach($items_info as $id => $field_values)
{
if( getArrayValue($field_values,$id_field) ) array_push($ids,$id);
}
//$ids=array_keys($items_info);
}
$ret = array_unique(array_merge($ret, $ids));
$this->Application->SetVar($event->getPrefixSpecial().'_selected_ids', implode(',',$ret));
$this->Application->LinkVar($event->getPrefixSpecial().'_selected_ids', $session_name);
// This is critical - otherwise getPassedID will return last ID stored in session! (not exactly true)
// this smells... needs to be refactored
$first_id = getArrayValue($ret,0);
if (($first_id === false) && ($event->getEventParam('raise_warnings') == 1)) {
if ($this->Application->isDebugMode()) {
$this->Application->Debugger->appendTrace();
}
trigger_error('Requested ID for prefix <b>'.$event->getPrefixSpecial().'</b> <span class="debug_error">not passed</span>',E_USER_NOTICE);
}
$this->Application->SetVar($event->getPrefixSpecial(true).'_id', $first_id);
return $ret;
}
/**
* Returns stored selected ids as an array
*
* @param kEvent $event
* @param bool $from_session return ids from session (written, when editing was started)
* @return array
*/
function getSelectedIDs(&$event, $from_session = false)
{
if ($from_session) {
$wid = $this->Application->GetTopmostWid($event->Prefix);
$var_name = rtrim($event->getPrefixSpecial().'_selected_ids_'.$wid, '_');
$ret = $this->Application->RecallVar($var_name);
}
else {
$ret = $this->Application->GetVar($event->getPrefixSpecial().'_selected_ids');
}
return explode(',', $ret);
}
/**
* Returs associative array of submitted fields for current item
* Could be used while creating/editing single item -
* meaning on any edit form, except grid edit
*
* @param kEvent $event
*/
function getSubmittedFields(&$event)
{
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
$field_values = $items_info ? array_shift($items_info) : Array();
return $field_values;
}
/**
* Removes any information about current/selected ids
* from Application variables and Session
*
* @param kEvent $event
*/
function clearSelectedIDs(&$event)
{
$prefix_special = $event->getPrefixSpecial();
$ids = implode(',', $this->getSelectedIDs($event, true));
$event->setEventParam('ids', $ids);
$wid = $this->Application->GetTopmostWid($event->Prefix);
$session_name = rtrim($prefix_special.'_selected_ids_'.$wid, '_');
$this->Application->RemoveVar($session_name);
$this->Application->SetVar($prefix_special.'_selected_ids', '');
$this->Application->SetVar($prefix_special.'_id', ''); // $event->getPrefixSpecial(true).'_id' too may be
}
/*function SetSaveEvent(&$event)
{
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent','OnUpdate');
$this->Application->LinkVar($event->Prefix_Special.'_SaveEvent');
}*/
/**
* Common builder part for Item & List
*
* @param kDBBase $object
* @param kEvent $event
* @access private
*/
function dbBuild(&$object, &$event)
{
$object->Configure();
$this->PrepareObject($object, $event);
// force live table if specified or is original item
$live_table = $event->getEventParam('live_table') || $event->Special == 'original';
if( $this->UseTempTables($event) && !$live_table )
{
$object->SwitchToTemp();
}
// This strange constuction creates hidden field for storing event name in form submit
// It pass SaveEvent to next screen, otherwise after unsuccsefull create it will try to update rather than create
$current_event = $this->Application->GetVar($event->Prefix_Special.'_event');
// $this->Application->setEvent($event->Prefix_Special, $current_event);
$this->Application->setEvent($event->Prefix_Special, '');
$save_event = $this->UseTempTables($event) && $this->Application->GetTopmostPrefix($event->Prefix) == $event->Prefix ? 'OnSave' : 'OnUpdate';
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent',$save_event);
}
/**
* Builds item (loads if needed)
*
* @param kEvent $event
* @access protected
*/
function OnItemBuild(&$event)
{
$object =& $event->getObject();
$this->dbBuild($object,$event);
$sql = $this->ItemPrepareQuery($event);
$sql = $this->Application->ReplaceLanguageTags($sql);
$object->setSelectSQL($sql);
// 2. loads if allowed
$auto_load = $this->Application->getUnitOption($event->Prefix,'AutoLoad');
$skip_autload = $event->getEventParam('skip_autoload');
if($auto_load && !$skip_autload) $this->LoadItem($event);
$actions =& $this->Application->recallObject('kActions');
$actions->Set($event->Prefix_Special.'_GoTab', '');
$actions->Set($event->Prefix_Special.'_GoId', '');
}
/**
* Build subtables array from configs
*
* @param kEvent $event
*/
function OnTempHandlerBuild(&$event)
{
$object =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
/* @var $object kTempTablesHandler */
$object->BuildTables( $event->Prefix, $this->getSelectedIDs($event) );
}
/**
* Enter description here...
*
* @param kEvent $event
* @return unknown
*/
function UseTempTables(&$event)
{
$object = &$event->getObject();
$top_prefix = $this->Application->GetTopmostPrefix($event->Prefix);
$var_names = Array (
$top_prefix,
rtrim($top_prefix.'_'.$event->Special, '_'),
rtrim($top_prefix.'.'.$event->Special, '.'),
);
$var_names = array_unique($var_names);
$temp_mode = false;
foreach ($var_names as $var_name) {
$value = $this->Application->GetVar($var_name.'_mode');
if (substr($value, 0, 1) == 't') {
$temp_mode = true;
break;
}
}
return $temp_mode;
}
/**
* Returns table prefix from event (temp or live)
*
* @param kEvent $event
* @return string
* @todo Needed? Should be refactored (by Alex)
*/
function TablePrefix(&$event)
{
return $this->UseTempTables($event) ? $this->Application->GetTempTablePrefix('prefix:'.$event->Prefix).TABLE_PREFIX : TABLE_PREFIX;
}
/**
* Load item if id is available
*
* @param kEvent $event
*/
function LoadItem(&$event)
{
$object =& $event->getObject();
$id = $this->getPassedID($event);
if ($object->Load($id) )
{
$actions =& $this->Application->recallObject('kActions');
$actions->Set($event->Prefix_Special.'_id', $object->GetID() );
$use_pending_editing = $this->Application->getUnitOption($event->Prefix, 'UsePendingEditing');
if ($use_pending_editing && $event->Special != 'original') {
$this->Application->SetVar($event->Prefix.'.original_id', $object->GetDBField('OrgId'));
}
}
else
{
$object->setID($id);
}
}
/**
* Builds list
*
* @param kEvent $event
* @access protected
*/
function OnListBuild(&$event)
{
$object =& $event->getObject();
+ /* @var $object kDBList */
$this->dbBuild($object,$event);
$sql = $this->ListPrepareQuery($event);
$sql = $this->Application->ReplaceLanguageTags($sql);
$object->setSelectSQL($sql);
$object->linkToParent( $this->getMainSpecial($event) );
$this->AddFilters($event);
$this->SetCustomQuery($event); // new!, use this for dynamic queries based on specials for ex.
$this->SetPagination($event);
$this->SetSorting($event);
// $object->CalculateTotals(); // Now called in getTotals to avoid extra query
$actions =& $this->Application->recallObject('kActions');
$actions->Set('remove_specials['.$event->Prefix_Special.']', '0');
$actions->Set($event->Prefix_Special.'_GoTab', '');
}
/**
* Get's special of main item for linking with subitem
*
* @param kEvent $event
* @return string
*/
function getMainSpecial(&$event)
{
$special = $event->getEventParam('main_special');
if($special === false || $special == '$main_special')
{
$special = $event->Special;
}
return $special;
}
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @access protected
* @see OnListBuild
*/
function SetCustomQuery(&$event)
{
}
/**
* Set's new perpage for grid
*
* @param kEvent $event
*/
function OnSetPerPage(&$event)
{
$per_page = $this->Application->GetVar($event->getPrefixSpecial(true).'_PerPage');
$this->Application->StoreVar($event->getPrefixSpecial().'_PerPage', $per_page);
$view_name = $this->Application->RecallVar($event->getPrefixSpecial().'_current_view');
$this->Application->StorePersistentVar($event->getPrefixSpecial().'_PerPage.'.$view_name, $per_page);
}
/**
* Set's correct page for list
* based on data provided with event
*
* @param kEvent $event
* @access private
* @see OnListBuild
*/
function SetPagination(&$event)
{
// get PerPage (forced -> session -> config -> 10)
$per_page = $this->getPerPage($event);
$object =& $event->getObject();
$object->SetPerPage($per_page);
$this->Application->StoreVarDefault($event->getPrefixSpecial().'_Page', 1);
$page = $this->Application->GetVar($event->getPrefixSpecial().'_Page');
if (!$page) {
$page = $this->Application->GetVar($event->getPrefixSpecial(true).'_Page');
}
if (!$page) {
$page = $this->Application->RecallVar($event->getPrefixSpecial().'_Page');
}
else {
$this->Application->StoreVar($event->getPrefixSpecial().'_Page', $page);
}
if( !$event->getEventParam('skip_counting') )
{
$pages = $object->GetTotalPages();
if($page > $pages)
{
$this->Application->StoreVar($event->getPrefixSpecial().'_Page', 1);
$page = 1;
}
}
/*$per_page = $event->getEventParam('per_page');
if ($per_page == 'list_next') {
$cur_page = $page;
$cur_per_page = $per_page;
$object->SetPerPage(1);
$object =& $this->Application->recallObject($event->Prefix);
$cur_item_index = $object->CurrentIndex;
$page = ($cur_page-1) * $cur_per_page + $cur_item_index + 1;
$object->SetPerPage(1);
}*/
$object->SetPage($page);
}
/**
* Returns current per-page setting for list
*
* @param kEvent $event
* @return int
*/
function getPerPage(&$event)
{
// 1. per-page is passed as tag parameter to PrintList, InitList, etc.
$per_page = $event->getEventParam('per_page');
/*if ($per_page == 'list_next') {
$per_page = '';
}*/
// 2. per-page variable name is store into config variable
$config_mapping = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping');
if ($config_mapping) {
switch ( $per_page ){
case 'short_list' :
$per_page = $this->Application->ConfigValue($config_mapping['ShortListPerPage']);
break;
case 'default' :
$per_page = $this->Application->ConfigValue($config_mapping['PerPage']);
break;
}
}
if (!$per_page) {
// per-page is stored to persistent session
$view_name = $this->Application->RecallVar($event->getPrefixSpecial().'_current_view');
$per_page = $this->Application->RecallPersistentVar($event->getPrefixSpecial().'_PerPage.'.$view_name);
if (!$per_page) {
// per-page is stored to current session
$per_page = $this->Application->RecallVar($event->getPrefixSpecial().'_PerPage');
}
if (!$per_page) {
if ($config_mapping) {
if (!isset($config_mapping['PerPage'])) {
trigger_error('Incorrect mapping of <span class="debug_error">PerPage</span> key in config for prefix <b>'.$event->Prefix.'</b>', E_USER_WARNING);
}
$per_page = $this->Application->ConfigValue($config_mapping['PerPage']);
}
if (!$per_page) {
// none of checked above per-page locations are useful, then try default value
$per_page = 10;
}
}
}
return $per_page;
}
/**
* Set's correct sorting for list
* based on data provided with event
*
* @param kEvent $event
* @access private
* @see OnListBuild
*/
function SetSorting(&$event)
{
$event->setPseudoClass('_List');
$object =& $event->getObject();
$cur_sort1 = $this->Application->RecallVar($event->Prefix_Special.'_Sort1');
$cur_sort1_dir = $this->Application->RecallVar($event->Prefix_Special.'_Sort1_Dir');
$cur_sort2 = $this->Application->RecallVar($event->Prefix_Special.'_Sort2');
$cur_sort2_dir = $this->Application->RecallVar($event->Prefix_Special.'_Sort2_Dir');
$sorting_configs = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping');
$list_sortings = $this->Application->getUnitOption($event->Prefix, 'ListSortings');
$sorting_prefix = getArrayValue($list_sortings, $event->Special) ? $event->Special : '';
$tag_sort_by = $event->getEventParam('sort_by');
if ($tag_sort_by) {
if ($tag_sort_by == 'random') {
$by = 'RAND()';
$dir = '';
}
else {
list($by, $dir) = explode(',', $tag_sort_by);
}
$object->AddOrderField($by, $dir);
}
if ($sorting_configs && isset ($sorting_configs['DefaultSorting1Field'])){
$list_sortings[$sorting_prefix]['Sorting'] = Array(
$this->Application->ConfigValue($sorting_configs['DefaultSorting1Field']) => $this->Application->ConfigValue($sorting_configs['DefaultSorting1Dir']),
$this->Application->ConfigValue($sorting_configs['DefaultSorting2Field']) => $this->Application->ConfigValue($sorting_configs['DefaultSorting2Dir']),
);
}
// Use default if not specified
if ( !$cur_sort1 || !$cur_sort1_dir)
{
if ( $sorting = getArrayValue($list_sortings, $sorting_prefix, 'Sorting') ) {
reset($sorting);
$cur_sort1 = key($sorting);
$cur_sort1_dir = current($sorting);
if (next($sorting)) {
$cur_sort2 = key($sorting);
$cur_sort2_dir = current($sorting);
}
}
}
if ( $forced_sorting = getArrayValue($list_sortings, $sorting_prefix, 'ForcedSorting') ) {
foreach ($forced_sorting as $field => $dir) {
$object->AddOrderField($field, $dir);
}
}
if($cur_sort1 != '' && $cur_sort1_dir != '')
{
$object->AddOrderField($cur_sort1, $cur_sort1_dir);
}
if($cur_sort2 != '' && $cur_sort2_dir != '')
{
$object->AddOrderField($cur_sort2, $cur_sort2_dir);
}
}
/**
* Add filters found in session
*
* @param kEvent $event
*/
function AddFilters(&$event)
{
$object =& $event->getObject();
$edit_mark = rtrim($this->Application->GetSID().'_'.$this->Application->GetTopmostWid($event->Prefix), '_');
// add search filter
$filter_data = $this->Application->RecallVar($event->getPrefixSpecial().'_search_filter');
if ($filter_data) {
$filter_data = unserialize($filter_data);
foreach ($filter_data as $filter_field => $filter_params) {
$filter_type = ($filter_params['type'] == 'having') ? HAVING_FILTER : WHERE_FILTER;
$filter_value = str_replace(EDIT_MARK, $edit_mark, $filter_params['value']);
$object->addFilter($filter_field, $filter_value, $filter_type, FLT_SEARCH);
}
}
// add custom filter
$view_name = $this->Application->RecallVar($event->getPrefixSpecial().'_current_view');
$custom_filters = $this->Application->RecallPersistentVar($event->getPrefixSpecial().'_custom_filter.'.$view_name);
if ($custom_filters) {
$grid_name = $event->getEventParam('grid');
$custom_filters = unserialize($custom_filters);
if (isset($custom_filters[$grid_name])) {
foreach ($custom_filters[$grid_name] as $field_name => $field_options) {
list ($filter_type, $field_options) = each($field_options);
if (isset($field_options['value']) && $field_options['value']) {
$filter_type = ($field_options['sql_filter_type'] == 'having') ? HAVING_FILTER : WHERE_FILTER;
$filter_value = str_replace(EDIT_MARK, $edit_mark, $field_options['value']);
$object->addFilter($field_name, $filter_value, $filter_type, FLT_CUSTOM);
}
}
}
}
$view_filter = $this->Application->RecallVar($event->getPrefixSpecial().'_view_filter');
if($view_filter)
{
$view_filter = unserialize($view_filter);
$temp_filter =& $this->Application->makeClass('kMultipleFilter');
$filter_menu = $this->Application->getUnitOption($event->Prefix,'FilterMenu');
$group_key = 0; $group_count = count($filter_menu['Groups']);
while($group_key < $group_count)
{
$group_info = $filter_menu['Groups'][$group_key];
$temp_filter->setType( constant('FLT_TYPE_'.$group_info['mode']) );
$temp_filter->clearFilters();
foreach ($group_info['filters'] as $flt_id)
{
$sql_key = getArrayValue($view_filter,$flt_id) ? 'on_sql' : 'off_sql';
if ($filter_menu['Filters'][$flt_id][$sql_key] != '')
{
$temp_filter->addFilter('view_filter_'.$flt_id, $filter_menu['Filters'][$flt_id][$sql_key]);
}
}
$object->addFilter('view_group_'.$group_key, $temp_filter, $group_info['type'] , FLT_VIEW);
$group_key++;
}
}
}
/**
* Set's new sorting for list
*
* @param kEvent $event
* @access protected
*/
function OnSetSorting(&$event)
{
$cur_sort1 = $this->Application->RecallVar($event->Prefix_Special.'_Sort1');
$cur_sort1_dir = $this->Application->RecallVar($event->Prefix_Special.'_Sort1_Dir');
- $cur_sort2 = $this->Application->RecallVar($event->Prefix_Special.'_Sort2');
- $cur_sort2_dir = $this->Application->RecallVar($event->Prefix_Special.'_Sort2_Dir');
+
+ $use_double_sorting = $this->Application->ConfigValue('UseDoubleSorting') !== false ? $this->Application->ConfigValue('UseDoubleSorting') : true;
+
+ if ($use_double_sorting) {
+ $cur_sort2 = $this->Application->RecallVar($event->Prefix_Special.'_Sort2');
+ $cur_sort2_dir = $this->Application->RecallVar($event->Prefix_Special.'_Sort2_Dir');
+ }
$passed_sort1 = $this->Application->GetVar($event->getPrefixSpecial(true).'_Sort1');
if ($cur_sort1 == $passed_sort1) {
$cur_sort1_dir = $cur_sort1_dir == 'asc' ? 'desc' : 'asc';
}
else {
- $cur_sort2 = $cur_sort1;
- $cur_sort2_dir = $cur_sort1_dir;
+ if ($use_double_sorting) {
+ $cur_sort2 = $cur_sort1;
+ $cur_sort2_dir = $cur_sort1_dir;
+ }
$cur_sort1 = $passed_sort1;
$cur_sort1_dir = 'asc';
}
$this->Application->StoreVar($event->Prefix_Special.'_Sort1', $cur_sort1);
$this->Application->StoreVar($event->Prefix_Special.'_Sort1_Dir', $cur_sort1_dir);
- $this->Application->StoreVar($event->Prefix_Special.'_Sort2', $cur_sort2);
- $this->Application->StoreVar($event->Prefix_Special.'_Sort2_Dir', $cur_sort2_dir);
+ if ($use_double_sorting) {
+ $this->Application->StoreVar($event->Prefix_Special.'_Sort2', $cur_sort2);
+ $this->Application->StoreVar($event->Prefix_Special.'_Sort2_Dir', $cur_sort2_dir);
+ }
}
/**
* Set sorting directly to session
*
* @param kEvent $event
*/
function OnSetSortingDirect(&$event)
{
$combined = $this->Application->GetVar($event->getPrefixSpecial(true).'_CombinedSorting');
if ($combined) {
list($field,$dir) = explode('|',$combined);
$this->Application->StoreVar($event->Prefix_Special.'_Sort1', $field);
$this->Application->StoreVar($event->Prefix_Special.'_Sort1_Dir', $dir);
return;
}
$field_pos = $this->Application->GetVar($event->getPrefixSpecial(true).'_SortPos');
$this->Application->LinkVar( $event->getPrefixSpecial(true).'_Sort'.$field_pos, $event->Prefix_Special.'_Sort'.$field_pos);
$this->Application->LinkVar( $event->getPrefixSpecial(true).'_Sort'.$field_pos.'_Dir', $event->Prefix_Special.'_Sort'.$field_pos.'_Dir');
}
/**
* Reset grid sorting to default (from config)
*
* @param kEvent $event
*/
function OnResetSorting(&$event)
{
$this->Application->RemoveVar($event->Prefix_Special.'_Sort1');
$this->Application->RemoveVar($event->Prefix_Special.'_Sort1_Dir');
$this->Application->RemoveVar($event->Prefix_Special.'_Sort2');
$this->Application->RemoveVar($event->Prefix_Special.'_Sort2_Dir');
}
/**
* Creates needed sql query to load item,
* if no query is defined in config for
* special requested, then use default
* query
*
* @param kEvent $event
* @access protected
*/
function ItemPrepareQuery(&$event)
{
$sqls = $this->Application->getUnitOption($event->Prefix,'ItemSQLs');
return isset($sqls[$event->Special]) ? $sqls[$event->Special] : $sqls[''];
}
/**
* Creates needed sql query to load list,
* if no query is defined in config for
* special requested, then use default
* query
*
* @param kEvent $event
* @access protected
*/
function ListPrepareQuery(&$event)
{
$sqls = $this->Application->getUnitOption($event->Prefix,'ListSQLs');
return isset( $sqls[$event->Special] ) ? $sqls[$event->Special] : $sqls[''];
}
/**
* Apply custom processing to item
*
* @param kEvent $event
*/
function customProcessing(&$event, $type)
{
}
/* Edit Events mostly used in Admin */
/**
* Creates new kDBItem
*
* @param kEvent $event
* @access protected
*/
function OnCreate(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
list($id,$field_values) = each($items_info);
$object->SetFieldsFromHash($field_values);
}
$this->customProcessing($event,'before');
//look at kDBItem' Create for ForceCreateId description, it's rarely used and is NOT set by default
if( $object->Create($event->getEventParam('ForceCreateId')) )
{
if( $object->IsTempTable() ) $object->setTempID();
$this->customProcessing($event,'after');
$event->status=erSUCCESS;
$event->redirect_params = Array('opener'=>'u');
}
else
{
$event->status = erFAIL;
$event->redirect = false;
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent','OnCreate');
$object->setID($id);
}
}
/**
* Updates kDBItem
*
* @param kEvent $event
* @access protected
*/
function OnUpdate(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
foreach($items_info as $id => $field_values)
{
$object->Load($id);
$object->SetFieldsFromHash($field_values);
$this->customProcessing($event, 'before');
if( $object->Update($id) )
{
$this->customProcessing($event, 'after');
$event->status=erSUCCESS;
}
else
{
$event->status=erFAIL;
$event->redirect=false;
break;
}
}
}
$event->redirect_params = Array('opener'=>'u');
}
/**
* Delete's kDBItem object
*
* @param kEvent $event
* @access protected
*/
function OnDelete(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->ID = $this->getPassedID($event);
if( $object->Delete() )
{
$event->status = erSUCCESS;
}
else
{
$event->status = erFAIL;
$event->redirect = false;
}
}
/**
* Prepares new kDBItem object
*
* @param kEvent $event
* @access protected
*/
function OnNew(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->setID(0);
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent','OnCreate');
$table_info = $object->getLinkedInfo();
$object->SetDBField($table_info['ForeignKey'], $table_info['ParentId']);
$event->redirect = false;
}
/**
* Cancel's kDBItem Editing/Creation
*
* @param kEvent $event
* @access protected
*/
function OnCancel(&$event)
{
$object =& $event->getObject(Array('skip_autoload' => true));
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
if ($items_info) {
$delete_ids = Array();
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
foreach ($items_info as $id => $field_values) {
$object->Load($id);
// record created for using with selector (e.g. Reviews->Select User), and not validated => Delete it
if ($object->isLoaded() && !$object->Validate() && ($id <= 0) ) {
$delete_ids[] = $id;
}
}
if ($delete_ids) {
$temp->DeleteItems($event->Prefix, $event->Special, $delete_ids);
}
}
$event->redirect_params = Array('opener'=>'u');
}
/**
* Deletes all selected items.
* Automatically recurse into sub-items using temp handler, and deletes sub-items
* by calling its Delete method if sub-item has AutoDelete set to true in its config file
*
* @param kEvent $event
*/
function OnMassDelete(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$event->status=erSUCCESS;
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$ids = $this->StoreSelectedIDs($event);
$event->setEventParam('ids', $ids);
$this->customProcessing($event, 'before');
$ids = $event->getEventParam('ids');
if($ids)
{
$temp->DeleteItems($event->Prefix, $event->Special, $ids);
}
$this->clearSelectedIDs($event);
}
/**
* Sets window id (of first opened edit window) to temp mark in uls
*
* @param kEvent $event
*/
function setTempWindowID(&$event)
{
$mode = $this->Application->GetVar($event->Prefix.'_mode');
if ($mode == 't') {
$wid = $this->Application->GetVar('m_wid');
$this->Application->SetVar($event->Prefix.'_mode', 't'.$wid);
}
}
/**
* Prepare temp tables and populate it
* with items selected in the grid
*
* @param kEvent $event
*/
function OnEdit(&$event)
{
$this->setTempWindowID($event);
$this->StoreSelectedIDs($event);
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
/* @var $temp kTempTablesHandler */
$temp->PrepareEdit();
$event->redirect=false;
}
/**
* Saves content of temp table into live and
* redirects to event' default redirect (normally grid template)
*
* @param kEvent $event
*/
function OnSave(&$event)
{
$event->CallSubEvent('OnPreSave');
if ($event->status == erSUCCESS) {
$skip_master = false;
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
$live_ids = $temp->SaveEdit($event->getEventParam('master_ids') ? $event->getEventParam('master_ids') : Array());
if ($live_ids) {
// ensure, that newly created item ids are avalable as if they were selected from grid
// NOTE: only works if main item has subitems !!!
$this->StoreSelectedIDs($event, $live_ids);
}
}
$this->clearSelectedIDs($event);
$event->redirect_params = Array('opener' => 'u');
$this->Application->RemoveVar($event->getPrefixSpecial().'_modified');
// all temp tables are deleted here => all after hooks should think, that it's live mode now
$this->Application->SetVar($event->Prefix.'_mode', '');
}
}
/**
* Cancels edit
* Removes all temp tables and clears selected ids
*
* @param kEvent $event
*/
function OnCancelEdit(&$event)
{
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$temp->CancelEdit();
$this->clearSelectedIDs($event);
$event->redirect_params = Array('opener'=>'u');
$this->Application->RemoveVar($event->getPrefixSpecial().'_modified');
}
/**
* Allows to determine if we are creating new item or editing already created item
*
* @param kEvent $event
* @return bool
*/
function isNewItemCreate(&$event)
{
$event->setEventParam('raise_warnings', 0);
$object =& $event->getObject();
return !$object->IsLoaded();
// $item_id = $this->getPassedID($event);
// return ($item_id == '') ? true : false;
}
/**
* Saves edited item into temp table
* If there is no id, new item is created in temp table
*
* @param kEvent $event
*/
function OnPreSave(&$event)
{
//$event->redirect = false;
// if there is no id - it means we need to create an item
if (is_object($event->MasterEvent)) {
$event->MasterEvent->setEventParam('IsNew',false);
}
if ($this->isNewItemCreate($event)) {
$event->CallSubEvent('OnPreSaveCreated');
if (is_object($event->MasterEvent)) {
$event->MasterEvent->setEventParam('IsNew',true);
}
return;
}
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info) {
foreach ($items_info as $id => $field_values) {
$object->SetDefaultValues();
$object->Load($id);
$object->SetFieldsFromHash($field_values);
$this->customProcessing($event, 'before');
if( $object->Update($id) )
{
$this->customProcessing($event, 'after');
$event->status=erSUCCESS;
}
else {
$event->status = erFAIL;
$event->redirect = false;
break;
}
}
}
}
/**
* Saves edited item in temp table and loads
* item with passed id in current template
* Used in Prev/Next buttons
*
* @param kEvent $event
*/
function OnPreSaveAndGo(&$event)
{
$event->CallSubEvent('OnPreSave');
if ($event->status==erSUCCESS) {
$event->redirect_params[$event->getPrefixSpecial(true).'_id'] = $this->Application->GetVar($event->Prefix_Special.'_GoId');
}
}
/**
* Saves edited item in temp table and goes
* to passed tabs, by redirecting to it with OnPreSave event
*
* @param kEvent $event
*/
function OnPreSaveAndGoToTab(&$event)
{
$event->CallSubEvent('OnPreSave');
if ($event->status==erSUCCESS) {
$event->redirect=$this->Application->GetVar($event->getPrefixSpecial(true).'_GoTab');
}
}
/**
* Saves editable list and goes to passed tab,
* by redirecting to it with empty event
*
* @param kEvent $event
*/
function OnUpdateAndGoToTab(&$event)
{
$event->setPseudoClass('_List');
$event->CallSubEvent('OnUpdate');
if ($event->status==erSUCCESS) {
$event->redirect=$this->Application->GetVar($event->getPrefixSpecial(true).'_GoTab');
}
}
/**
* Prepare temp tables for creating new item
* but does not create it. Actual create is
* done in OnPreSaveCreated
*
* @param kEvent $event
*/
function OnPreCreate(&$event)
{
$this->setTempWindowID($event);
$this->clearSelectedIDs($event);
$object =& $event->getObject( Array('skip_autoload' => true) );
$temp =& $this->Application->recallObject($event->Prefix.'_TempHandler', 'kTempTablesHandler');
$temp->PrepareEdit();
$object->setID(0);
$this->Application->SetVar($event->getPrefixSpecial().'_id',0);
$this->Application->SetVar($event->getPrefixSpecial().'_PreCreate', 1);
$event->redirect=false;
}
/**
* Creates a new item in temp table and
* stores item id in App vars and Session on succsess
*
* @param kEvent $event
*/
function OnPreSaveCreated(&$event)
{
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info) $field_values = array_shift($items_info);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->SetFieldsFromHash($field_values);
$this->customProcessing($event, 'before');
if( $object->Create() )
{
$this->customProcessing($event, 'after');
$event->redirect_params[$event->getPrefixSpecial(true).'_id'] = $object->GetId();
$event->status=erSUCCESS;
}
else
{
$event->status=erFAIL;
$event->redirect=false;
$object->setID(0);
}
}
function OnReset(&$event)
{
//do nothing - should reset :)
if ($this->isNewItemCreate($event)) {
// just reset id to 0 in case it was create
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->setID(0);
$this->Application->SetVar($event->getPrefixSpecial().'_id',0);
}
}
/**
* 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;
}
$object =& $event->getObject( Array('skip_autoload' => true) );
$ids = $this->StoreSelectedIDs($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;
}
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');
$ids = $this->StoreSelectedIDs($event);
if ($ids) {
$temp->CloneItems($event->Prefix, $event->Special, $ids);
}
$this->clearSelectedIDs($event);
}
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);
}
/* End of Edit events */
// III. Events that allow to put some code before and after Update,Load,Create and Delete methods of item
/**
* Occurse before loading item, 'id' parameter
* allows to get id of item beeing loaded
*
* @param kEvent $event
* @access public
*/
function OnBeforeItemLoad(&$event)
{
}
/**
* Occurse after loading item, 'id' parameter
* allows to get id of item that was loaded
*
* @param kEvent $event
* @access public
*/
function OnAfterItemLoad(&$event)
{
}
/**
* Occurse before creating item
*
* @param kEvent $event
* @access public
*/
function OnBeforeItemCreate(&$event)
{
}
/**
* Occurse after creating item
*
* @param kEvent $event
* @access public
*/
function OnAfterItemCreate(&$event)
{
}
/**
* Occurse before updating item
*
* @param kEvent $event
* @access public
*/
function OnBeforeItemUpdate(&$event)
{
}
/**
* Occurse after updating item
*
* @param kEvent $event
* @access public
*/
function OnAfterItemUpdate(&$event)
{
}
/**
* Occurse before deleting item, id of item beeing
* deleted is stored as 'id' event param
*
* @param kEvent $event
* @access public
*/
function OnBeforeItemDelete(&$event)
{
}
/**
* Occurse after deleting item, id of deleted item
* is stored as 'id' param of event
*
* @param kEvent $event
* @access public
*/
function OnAfterItemDelete(&$event)
{
}
/**
* Occurs after successful item validation
*
* @param kEvent $event
*/
function OnAfterItemValidate(&$event)
{
}
/**
* Occures after an item has been copied to temp
* Id of copied item is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnAfterCopyToTemp(&$event)
{
}
/**
* Occures before an item is deleted from live table when copying from temp
* (temp handler deleted all items from live and then copy over all items from temp)
* Id of item being deleted is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnBeforeDeleteFromLive(&$event)
{
}
/**
* Occures before an item is copied to live table (after all foreign keys have been updated)
* Id of item being copied is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnBeforeCopyToLive(&$event)
{
}
/**
* !!! NOT FULLY IMPLEMENTED - SEE TEMP HANDLER COMMENTS (search by event name)!!!
* Occures after an item has been copied to live table
* Id of copied item is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnAfterCopyToLive(&$event)
{
}
/**
* Occures before an item is cloneded
* Id of ORIGINAL item is passed as event' 'id' param
* Do not call object' Update method in this event, just set needed fields!
*
* @param kEvent $event
*/
function OnBeforeClone(&$event)
{
}
/**
* Occures after an item has been cloned
* Id of newly created item is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnAfterClone(&$event)
{
}
/**
* Ensures that popup will be closed automatically
* and parent window will be refreshed with template
* passed
*
* @param kEvent $event
* @access public
*/
function finalizePopup(&$event)
{
$event->SetRedirectParam('opener', 'u');
/*return ;
// 2. substitute opener
$opener_stack = $this->Application->RecallVar('opener_stack');
$opener_stack = $opener_stack ? unserialize($opener_stack) : Array();
//array_pop($opener_stack);
$t = $this->Application->RecallVar('return_template');
$this->Application->RemoveVar('return_template');
// restore original "m" prefix all params, that have values before opening selector
$return_m = $this->Application->RecallVar('return_m');
$this->Application->RemoveVar('return_m');
$this->Application->HttpQuery->parseEnvPart($return_m);
$pass_events = $event->getEventParam('pass_events');
$redirect_params = array_merge_recursive2($event->redirect_params, Array('m_opener' => 'u', '__URLENCODE__' => 1));
$new_level = 'index.php|'.ltrim($this->Application->BuildEnv($t, $redirect_params, 'all', $pass_events), ENV_VAR_NAME.'=');
array_push($opener_stack, $new_level);
$this->Application->StoreVar('opener_stack', serialize($opener_stack));*/
}
/**
* Create search filters based on search query
*
* @param kEvent $event
* @access protected
*/
function OnSearch(&$event)
{
$event->setPseudoClass('_List');
$search_helper =& $this->Application->recallObject('SearchHelper');
$search_helper->performSearch($event);
}
/**
* Clear search keywords
*
* @param kEvent $event
* @access protected
*/
function OnSearchReset(&$event)
{
$search_helper =& $this->Application->recallObject('SearchHelper');
$search_helper->resetSearch($event);
}
/**
* Set's new filter value (filter_id meaning from config)
*
* @param kEvent $event
*/
function OnSetFilter(&$event)
{
$filter_id = $this->Application->GetVar('filter_id');
$filter_value = $this->Application->GetVar('filter_value');
$view_filter = $this->Application->RecallVar($event->getPrefixSpecial().'_view_filter');
$view_filter = $view_filter ? unserialize($view_filter) : Array();
$view_filter[$filter_id] = $filter_value;
$this->Application->StoreVar( $event->getPrefixSpecial().'_view_filter', serialize($view_filter) );
}
function OnSetFilterPattern(&$event)
{
$filters = $this->Application->GetVar($event->getPrefixSpecial(true).'_filters');
if (!$filters) return ;
$view_filter = $this->Application->RecallVar($event->getPrefixSpecial().'_view_filter');
$view_filter = $view_filter ? unserialize($view_filter) : Array();
$filters = explode(',', $filters);
foreach ($filters as $a_filter) {
list($id, $value) = explode('=', $a_filter);
$view_filter[$id] = $value;
}
$this->Application->StoreVar( $event->getPrefixSpecial().'_view_filter', serialize($view_filter) );
$event->redirect = false;
}
/**
* Add/Remove all filters applied to list from "View" menu
*
* @param kEvent $event
*/
function FilterAction(&$event)
{
$view_filter = Array();
$filter_menu = $this->Application->getUnitOption($event->Prefix,'FilterMenu');
switch ($event->Name)
{
case 'OnRemoveFilters':
$filter_value = 1;
break;
case 'OnApplyFilters':
$filter_value = 0;
break;
}
foreach($filter_menu['Filters'] as $filter_key => $filter_params)
{
if(!$filter_params) continue;
$view_filter[$filter_key] = $filter_value;
}
$this->Application->StoreVar( $event->getPrefixSpecial().'_view_filter', serialize($view_filter) );
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnPreSaveAndOpenTranslator(&$event)
{
$this->Application->SetVar('allow_translation', true);
$object =& $event->getObject();
$this->RemoveRequiredFields($object);
$event->CallSubEvent('OnPreSave');
if ($event->status == erSUCCESS) {
$resource_id = $this->Application->GetVar('translator_resource_id');
if ($resource_id) {
$t_prefixes = explode(',', $this->Application->GetVar('translator_prefixes'));
$cdata =& $this->Application->recallObject($t_prefixes[1], null, Array('skip_autoload' => true));
$cdata->Load($resource_id, 'ResourceId');
if (!$cdata->isLoaded()) {
$cdata->SetDBField('ResourceId', $resource_id);
$cdata->Create();
}
$this->Application->SetVar($cdata->getPrefixSpecial().'_id', $cdata->GetID());
}
$event->redirect = $this->Application->GetVar('translator_t');
$event->redirect_params = Array('pass'=>'all,trans,'.$this->Application->GetVar('translator_prefixes'),
$event->getPrefixSpecial(true).'_id' => $object->GetID(),
'trans_event' => 'OnLoad',
'trans_prefix' => $this->Application->GetVar('translator_prefixes'),
'trans_field' => $this->Application->GetVar('translator_field'),
'trans_multi_line' => $this->Application->GetVar('translator_multi_line'),
);
// 1. SAVE LAST TEMPLATE TO SESSION (really needed here, because of tweaky redirect)
$last_template = $this->Application->RecallVar('last_template');
preg_match('/index4\.php\|'.$this->Application->GetSID().'-(.*):/U', $last_template, $rets);
$this->Application->StoreVar('return_template', $this->Application->GetVar('t'));
}
}
function RemoveRequiredFields(&$object)
{
// making all field non-required to achieve successful presave
foreach($object->Fields as $field => $options)
{
if(isset($options['required']))
{
unset($object->Fields[$field]['required']);
}
}
}
/**
* Dynamically fills customdata config
*
* @param kEvent $event
*/
function OnCreateCustomFields(&$event)
{
$main_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
if (!$main_prefix) return false;
$item_type = $this->Application->getUnitOption($main_prefix, 'ItemType');
if (!$item_type) {
// no main config of such type
return false;
}
// 1. get custom field information
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'CustomField
WHERE Type = '.$item_type.'
ORDER BY CustomFieldId';
$custom_fields = $this->Conn->Query($sql, 'CustomFieldId');
if (!$custom_fields) {
// config doesn't have custom fields
return false;
}
// 2. create fields (for customdata item)
$fields = $this->Application->getUnitOption($event->Prefix, 'Fields', Array());
$field_options = Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'db_type' => 'text', 'default' => '');
foreach ($custom_fields as $custom_id => $custom_params) {
if (isset($fields['cust_'.$custom_id])) continue;
$fields['cust_'.$custom_id] = $field_options;
}
$this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
// 3. create virtual & calculated fields (for main item)
$calculated_fields = Array();
$virtual_fields = $this->Application->getUnitOption($main_prefix, 'VirtualFields', Array());
$cf_helper =& $this->Application->recallObject('InpCustomFieldsHelper');
$field_options = Array('type' => 'string', 'not_null' => 1, 'default' => '');
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
foreach ($custom_fields as $custom_id => $custom_params) {
switch ($custom_params['ElementType']) {
case 'date':
case 'datetime':
unset($field_options['options']);
$field_options['formatter'] = 'kDateFormatter';
break;
case 'select':
case 'radio':
if ($custom_params['ValueList']) {
$field_options['options'] = $cf_helper->GetValuesHash($custom_params['ValueList']);
$field_options['formatter'] = 'kOptionsFormatter';
}
break;
default:
unset($field_options['options'], $field_options['formatter']);
break;
}
$custom_name = $custom_params['FieldName'];
$calculated_fields['cust_'.$custom_name] = 'cust.'.$ml_formatter->LangFieldName('cust_'.$custom_id);
if (!isset($virtual_fields['cust_'.$custom_name])) {
$virtual_fields['cust_'.$custom_name] = Array();
}
$virtual_fields['cust_'.$custom_name] = array_merge_recursive2($field_options, $virtual_fields['cust_'.$custom_name]);
$custom_fields[$custom_id] = $custom_name;
}
$config_calculated_fields = $this->Application->getUnitOption($main_prefix, 'CalculatedFields', Array());
foreach ($config_calculated_fields as $special => $special_fields) {
$config_calculated_fields[$special] = array_merge_recursive2($config_calculated_fields[$special], $calculated_fields);
}
$this->Application->setUnitOption($main_prefix, 'CalculatedFields', $config_calculated_fields);
$this->Application->setUnitOption($main_prefix, 'CustomFields', $custom_fields);
$this->Application->setUnitOption($main_prefix, 'VirtualFields', $virtual_fields);
}
/**
* Saves selected user in needed field
*
* @param kEvent $event
*/
function OnSelectUser(&$event)
{
$items_info = $this->Application->GetVar('u');
if ($items_info) {
$user_id = array_shift( array_keys($items_info) );
$object =& $event->getObject();
$this->RemoveRequiredFields($object);
$is_new = !$object->isLoaded();
$is_main = substr($this->Application->GetVar($event->Prefix.'_mode'), 0, 1) == 't';
if ($is_new) {
$new_event = $is_main ? 'OnPreCreate' : 'OnNew';
$event->CallSubEvent($new_event);
}
$object->SetDBField($this->Application->RecallVar('dst_field'), $user_id);
if ($is_new) {
$object->Create();
if (!$is_main && $object->IsTempTable()) {
$object->setTempID();
}
}
else {
$object->Update();
}
}
$event->SetRedirectParam($event->getPrefixSpecial().'_id', $object->GetID());
$this->finalizePopup($event);
}
/** EXPORT RELATED **/
/**
* Shows export dialog
*
* @param kEvent $event
*/
function OnExport(&$event)
{
$this->StoreSelectedIDs($event);
$selected_ids = $this->getSelectedIDs($event);
if (implode(',', $selected_ids) == '') {
// K4 fix when no ids found bad selected ids array is formed
$selected_ids = false;
}
$this->Application->StoreVar($event->Prefix.'_export_ids', $selected_ids ? implode(',', $selected_ids) : '' );
$export_t = $this->Application->GetVar('export_template');
$this->Application->LinkVar('export_finish_t');
$this->Application->LinkVar('export_progress_t');
$this->Application->StoreVar('export_oroginal_special', $event->Special);
$export_helper =& $this->Application->recallObject('CatItemExportHelper');
$event->redirect = $export_t ? $export_t : $export_helper->getModuleFolder($event).'/export';
list($index_file, $env) = explode('|', $this->Application->RecallVar('last_template'));
$finish_url = $this->Application->BaseURL('/admin').$index_file.'?'.ENV_VAR_NAME.'='.$env;
$this->Application->StoreVar('export_finish_url', $finish_url);
$redirect_params = Array(
$this->Prefix.'.export_event' => 'OnNew',
'pass' => 'all,'.$this->Prefix.'.export');
$event->setRedirectParams($redirect_params);
}
/**
* Apply some special processing to
* object beeing recalled before using
* it in other events that call prepareObject
*
* @param Object $object
* @param kEvent $event
* @access protected
*/
function prepareObject(&$object, &$event)
{
if ($event->Special == 'export' || $event->Special == 'import')
{
$export_helper =& $this->Application->recallObject('CatItemExportHelper');
$export_helper->prepareExportColumns($event);
}
}
/**
* Returns specific to each item type columns only
*
* @param kEvent $event
* @return Array
*/
function getCustomExportColumns(&$event)
{
return Array();
}
/**
* Export form validation & processing
*
* @param kEvent $event
*/
function OnExportBegin(&$event)
{
$export_helper =& $this->Application->recallObject('CatItemExportHelper');
/* @var $export_helper kCatDBItemExportHelper */
$export_helper->OnExportBegin($event);
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnExportCancel(&$event)
{
$this->OnGoBack($event);
}
/**
* Allows configuring export options
*
* @param kEvent $event
*/
function OnBeforeExportBegin(&$event)
{
}
function OnDeleteExportPreset(&$event)
{
$object =& $event->GetObject();
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
list($id,$field_values) = each($items_info);
$preset_key = $field_values['ExportPresets'];
$user =& $this->Application->recallObject('u');
$export_settings = $user->getPersistantVar('export_settings');
if (!$export_settings) return ;
$export_settings = unserialize($export_settings);
if (!isset($export_settings[$event->Prefix])) return ;
$to_delete = '';
$export_presets = array(''=>'');
foreach ($export_settings[$event->Prefix] as $key => $val) {
if (implode('|', $val['ExportColumns']) == $preset_key) {
$to_delete = $key;
break;
}
}
if ($to_delete) {
unset($export_settings[$event->Prefix][$to_delete]);
$user->setPersistantVar('export_settings', serialize($export_settings));
}
}
}
/**
* Saves changes & changes language
*
* @param kEvent $event
*/
function OnPreSaveAndChangeLanguage(&$event)
{
$event->CallSubEvent('OnPreSave');
if ($event->status == erSUCCESS) {
$this->Application->SetVar('m_lang', $this->Application->GetVar('language'));
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/db/db_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.81
\ No newline at end of property
+1.82
\ No newline at end of property
Index: trunk/core/kernel/db/dbitem.php
===================================================================
--- trunk/core/kernel/db/dbitem.php (revision 7634)
+++ trunk/core/kernel/db/dbitem.php (revision 7635)
@@ -1,943 +1,949 @@
<?php
/**
* DBItem
*
* Desciption
* @package kernel4
*/
class kDBItem extends kDBBase {
/**
* Description
*
* @var array Associative array of current item' field values
* @access public
*/
var $FieldValues;
/**
* Unformatted field values, before parse
*
* @var Array
* @access private
*/
var $DirtyFieldValues = Array();
var $FieldErrors;
var $ErrorMsgs = Array();
/**
* If set to true, Update will skip Validation before running
*
* @var array Associative array of current item' field values
* @access public
*/
var $IgnoreValidation = false;
var $Loaded = false;
/**
* Holds item' primary key value
*
* @var int Value of primary key field for current item
* @access public
*/
var $ID;
function kDBItem()
{
parent::kDBBase();
$this->ErrorMsgs['required'] = '!la_err_required!'; //'Field is required';
$this->ErrorMsgs['unique'] = '!la_err_unique!'; //'Field value must be unique';
$this->ErrorMsgs['value_out_of_range'] = '!la_err_value_out_of_range!'; //'Field is out of range, possible values from %s to %s';
$this->ErrorMsgs['length_out_of_range'] = '!la_err_length_out_of_range!'; //'Field is out of range';
$this->ErrorMsgs['bad_type'] = '!la_err_bad_type!'; //'Incorrect data format, please use %s';
$this->ErrorMsgs['invalid_format'] = '!la_err_invalid_format!'; //'Incorrect data format, please use %s';
$this->ErrorMsgs['bad_date_format'] = '!la_err_bad_date_format!'; //'Incorrect date format, please use (%s) ex. (%s)';
$this->ErrorMsgs['primary_lang_required'] = '!la_err_primary_lang_required!';
}
function SetDirtyField($field_name, $field_value)
{
$this->DirtyFieldValues[$field_name] = $field_value;
}
function GetDirtyField($field_name)
{
return $this->DirtyFieldValues[$field_name];
}
/**
* Set's default values for all fields
*
* @access public
*/
function SetDefaultValues()
{
parent::SetDefaultValues();
foreach ($this->Fields as $field => $params) {
if ( isset($params['default']) ) {
$this->SetDBField($field, $params['default']);
}
else {
$this->SetDBField($field, NULL);
}
}
}
/**
* Sets current item field value
* (applies formatting)
*
* @access public
* @param string $name Name of the field
* @param mixed $value Value to set the field to
* @return void
*/
function SetField($name,$value)
{
$options = $this->GetFieldOptions($name);
$parsed = $value;
if ($value == '') {
$parsed = NULL;
}
if (isset($options['formatter'])) {
$formatter =& $this->Application->recallObject($options['formatter']);
// $parsed = $formatter->Parse($value, $options, $err);
$parsed = $formatter->Parse($value, $name, $this);
}
+ // this will make sure numeric value is converted to normal representation
+ // according to regional format, even when formatter is not set (try seting format to 1.234,56 to understand why)
+ elseif (preg_match('#int|integer|double|float|real|numeric#', $options['type'])) {
+ $formatter =& $this->Application->recallObject('kFormatter');
+ $parsed = $formatter->TypeCast($value, $options);
+ }
$this->SetDBField($name,$parsed);
}
/**
* Sets current item field value
* (doesn't apply formatting)
*
* @access public
* @param string $name Name of the field
* @param mixed $value Value to set the field to
* @return void
*/
function SetDBField($name,$value)
{
$this->FieldValues[$name] = $value;
/*if (isset($this->Fields[$name]['formatter'])) {
$formatter =& $this->Application->recallObject($this->Fields[$name]['formatter']);
$formatter->UpdateSubFields($name, $value, $this->Fields[$name], $this);
}*/
}
/**
* Set's field error, if pseudo passed not found then create it with message text supplied.
* Don't owerrite existing pseudo translation.
*
* @param string $field
* @param string $pseudo
* @param string $error_label
*/
function SetError($field, $pseudo, $error_label = '')
{
$error_field = isset($this->Fields[$field]['error_field']) ? $this->Fields[$field]['error_field'] : $field;
$this->FieldErrors[$error_field]['pseudo'] = $pseudo;
$error_msg = $error_label ? $this->Application->Phrase($error_label) : '';
if ($error_label && !getArrayValue($this->ErrorMsgs, $pseudo))
{
$this->ErrorMsgs[$pseudo] = $error_msg;
}
}
/**
* Return current item' field value by field name
* (doesn't apply formatter)
*
* @access public
* @param string $name field name to return
* @return mixed
*/
function GetDBField($name)
{
return $this->FieldValues[$name];
}
function HasField($name)
{
return isset($this->FieldValues[$name]);
}
function GetFieldValues()
{
return $this->FieldValues;
}
/**
* Sets item' fields corresponding to elements in passed $hash values.
*
* The function sets current item fields to values passed in $hash, by matching $hash keys with field names
* of current item. If current item' fields are unknown {@link kDBItem::PrepareFields()} is called before acutally setting the fields
*
* @access public
* @param Array $hash
* @param Array $set_fields Optional param, field names in target object to set, other fields will be skipped
* @return void
*/
function SetFieldsFromHash($hash, $set_fields=null)
{
// used in formatter which work with multiple fields together
foreach($hash as $field_name => $field_value)
{
if( eregi("^[0-9]+$", $field_name) || !array_key_exists($field_name,$this->Fields) ) continue;
if ( is_array($set_fields) && !in_array($field_name, $set_fields) ) continue;
$this->SetDirtyField($field_name, $field_value);
}
// formats all fields using associated formatters
foreach ($hash as $field_name => $field_value)
{
if( eregi("^[0-9]+$", $field_name) || !array_key_exists($field_name,$this->Fields) ) continue;
if ( is_array($set_fields) && !in_array($field_name, $set_fields) ) continue;
$this->SetField($field_name,$field_value);
}
}
function SetDBFieldsFromHash($hash, $set_fields=null)
{
foreach ($hash as $field_name => $field_value)
{
if( eregi("^[0-9]+$", $field_name) || !array_key_exists($field_name,$this->Fields) ) continue;
if ( is_array($set_fields) && !in_array($field_name, $set_fields) ) continue;
$this->SetDBField($field_name, $field_value);
}
}
/**
* Returns part of SQL WHERE clause identifing the record, ex. id = 25
*
* @access public
* @param string $method Child class may want to know who called GetKeyClause, Load(), Update(), Delete() send its names as method
* @param Array $keys_hash alternative, then item id, keys hash to load item by
* @return void
* @see kDBItem::Load()
* @see kDBItem::Update()
* @see kDBItem::Delete()
*/
function GetKeyClause($method=null, $keys_hash = null)
{
if( !isset($keys_hash) ) $keys_hash = Array($this->IDField => $this->ID);
$ret = '';
foreach($keys_hash as $field => $value)
{
if (!preg_match('/\./', $field)) {
$ret .= '(`'.$this->TableName.'`.'.$field.' = '.$this->Conn->qstr($value).') AND ';
}
else {
$ret .= '('.$field.' = '.$this->Conn->qstr($value).') AND ';
}
}
return preg_replace('/(.*) AND $/', '\\1', $ret);
}
/**
* Loads item from the database by given id
*
* @access public
* @param mixed $id item id of keys->values hash to load item by
* @param string $id_field_name Optional parameter to load item by given Id field
* @return bool True if item has been loaded, false otherwise
*/
function Load($id, $id_field_name = null)
{
if ( isset($id_field_name) ) $this->SetIDField( $id_field_name );
$keys_sql = '';
if( is_array($id) )
{
$keys_sql = $this->GetKeyClause('load', $id);
}
else
{
$this->setID($id);
$keys_sql = $this->GetKeyClause('load');
}
if ( isset($id_field_name) ) $this->setIDField( $this->Application->getUnitOption($this->Prefix, 'IDField') );
if( ($id === false) || !$keys_sql ) return $this->Clear();
if( !$this->raiseEvent('OnBeforeItemLoad', $id) ) return false;
$q = $this->GetSelectSQL().' WHERE '.$keys_sql;
$field_values = $this->Conn->GetRow($q);
if($field_values)
{
$this->FieldValues = array_merge_recursive2($this->FieldValues, $field_values);
}
else
{
return $this->Clear();
}
if( is_array($id) || isset($id_field_name) ) $this->setID( $this->FieldValues[$this->IDField] );
$this->UpdateFormattersSubFields(); // used for updating separate virtual date/time fields from DB timestamp (for example)
$this->raiseEvent('OnAfterItemLoad', $this->GetID() );
$this->Loaded = true;
return true;
}
/**
* Builds select sql, SELECT ... FROM parts only
*
* @access public
* @return string
*/
function GetSelectSQL()
{
$sql = $this->addCalculatedFields($this->SelectClause);
return parent::GetSelectSQL($sql);
}
function UpdateFormattersMasterFields()
{
foreach ($this->Fields as $field => $options) {
if (isset($options['formatter'])) {
$formatter =& $this->Application->recallObject($options['formatter']);
$formatter->UpdateMasterFields($field, $this->GetDBField($field), $options, $this);
}
}
}
function SkipField($field_name, $force_id=false)
{
$skip = false;
$skip = $skip || ( isset($this->VirtualFields[$field_name]) ); //skipping 'virtual' field
$skip = $skip || ( !getArrayValue($this->FieldValues, $field_name) && getArrayValue($this->Fields[$field_name], 'skip_empty') ); //skipping 'virtual' field
// $skip = $skip || ($field_name == $this->IDField && !$force_id); //skipping Primary Key
// $table_name = preg_replace("/^(.*)\./", "$1", $field_name);
// $skip = $skip || ($table_name && ($table_name != $this->TableName)); //skipping field from other tables
$skip = $skip || ( !isset($this->Fields[$field_name]) ); //skipping field not in Fields (nor virtual, nor real)
return $skip;
}
/**
* Updates previously loaded record with current item' values
*
* @access public
* @param int Primery Key Id to update
* @return bool
*/
function Update($id=null, $system_update=false)
{
if( isset($id) ) $this->setID($id);
if( !$this->raiseEvent('OnBeforeItemUpdate') ) return false;
if( !isset($this->ID) ) return false;
// Validate before updating
if( !$this->IgnoreValidation && !$this->Validate() ) return false;
if( !$this->raiseEvent('OnAfterItemValidate') ) return false;
//Nothing to update
if(!$this->FieldValues) return true;
$sql = sprintf('UPDATE %s SET ',$this->TableName);
foreach ($this->FieldValues as $field_name => $field_value)
{
if ($this->SkipField($field_name)) continue;
$real_field_name = eregi_replace("^.*\.", '',$field_name); //removing table names from field names
//Adding part of SET clause for current field, escaping data with ADODB' qstr
if (is_null( $this->FieldValues[$field_name] )) {
if (isset($this->Fields[$field_name]['not_null']) && $this->Fields[$field_name]['not_null']) {
$sql .= '`'.$real_field_name.'` = '.$this->Conn->qstr($this->Fields[$field_name]['default']).', ';
}
else {
$sql .= '`'.$real_field_name.'` = NULL, ';
}
}
else {
$sql.= sprintf('`%s`=%s, ', $real_field_name, $this->Conn->qstr($this->FieldValues[$field_name], 0));
}
}
$sql = ereg_replace(", $", '', $sql); //Removing last comma and space
$sql.= sprintf(' WHERE %s', $this->GetKeyClause('update')); //Adding WHERE clause with Primary Key
if( $this->Conn->ChangeQuery($sql) === false ) return false;
$affected = $this->Conn->getAffectedRows();
if (!$system_update && $affected == 1){
$this->setModifiedFlag();
}
$this->saveCustomFields();
$this->raiseEvent('OnAfterItemUpdate');
$this->Loaded = true;
return true;
}
/**
* Validate all item fields based on
* constraints set in each field options
* in config
*
* @return bool
* @access private
*/
function Validate()
{
$this->UpdateFormattersMasterFields(); //order is critical - should be called BEFORE checking errors
$global_res = true;
foreach ($this->Fields as $field => $params) {
$res = true;
$res = $res && $this->ValidateType($field, $params);
$res = $res && $this->ValidateRange($field, $params);
$res = $res && $this->ValidateUnique($field, $params);
$res = $res && $this->ValidateRequired($field, $params);
$res = $res && $this->CustomValidation($field, $params);
// If Formatter has set some error messages during values parsing
$error_field = isset($params['error_field']) ? $params['error_field'] : $field;
if (isset($this->FieldErrors[$error_field]['pseudo']) && $this->FieldErrors[$error_field] != '') {
$global_res = false;
}
$global_res = $global_res && $res;
}
if (!$global_res && $this->Application->isDebugMode() )
{
global $debugger;
$error_msg = "Validation failed in prefix <b>".$this->Prefix."</b>, FieldErrors follow (look at items with 'pseudo' key set)<br>
You may ignore this notice if submitted data really has a validation error ";
trigger_error( $error_msg, E_USER_NOTICE);
$debugger->dumpVars($this->FieldErrors);
}
return $global_res;
}
/**
* Check field value by user-defined alghoritm
*
* @param string $field field name
* @param Array $params field options from config
* @return bool
*/
function CustomValidation($field, $params)
{
return true;
}
/**
* Check if item has errors
*
* @param Array $skip_fields fields to skip during error checking
* @return bool
*/
function HasErrors($skip_fields)
{
$global_res = false;
foreach ($this->Fields as $field => $field_params) {
// If Formatter has set some error messages during values parsing
if ( !( in_array($field, $skip_fields) ) &&
isset($this->FieldErrors[$field]['pseudo']) && $this->FieldErrors[$field] != '') {
$global_res = true;
}
}
return $global_res;
}
/**
* Check if value in field matches field type specified in config
*
* @param string $field field name
* @param Array $params field options from config
* @return bool
*/
function ValidateType($field, $params)
{
$res = true;
$val = $this->FieldValues[$field];
$error_field = isset($params['error_field']) ? $params['error_field'] : $field;
if ( $val != '' &&
isset($params['type']) &&
preg_match("#int|integer|double|float|real|numeric|string#", $params['type'])
) {
$res = is_numeric($val);
if($params['type']=='string' || $res)
{
$f = 'is_'.$params['type'];
settype($val, $params['type']);
$res = $f($val) && ($val==$this->FieldValues[$field]);
}
if (!$res)
{
$this->FieldErrors[$error_field]['pseudo'] = 'bad_type';
$this->FieldErrors[$error_field]['params'] = $params['type'];
}
}
return $res;
}
/**
* Check if value is set for required field
*
* @param string $field field name
* @param Array $params field options from config
* @return bool
* @access private
*/
function ValidateRequired($field, $params)
{
$res = true;
$error_field = isset($params['error_field']) ? $params['error_field'] : $field;
if ( getArrayValue($params,'required') )
{
$res = ( (string) $this->FieldValues[$field] != '');
}
$options = $this->GetFieldOptions($field);
if (!$res && getArrayValue($options, 'formatter') != 'kUploadFormatter') $this->FieldErrors[$error_field]['pseudo'] = 'required';
return $res;
}
/**
* Validates that current record has unique field combination among other table records
*
* @param string $field field name
* @param Array $params field options from config
* @return bool
* @access private
*/
function ValidateUnique($field, $params)
{
$res = true;
$error_field = isset($params['error_field']) ? $params['error_field'] : $field;
$unique_fields = getArrayValue($params,'unique');
if($unique_fields !== false)
{
$where = Array();
array_push($unique_fields,$field);
foreach($unique_fields as $unique_field)
{
$where[] = '`'.$unique_field.'` = '.$this->Conn->qstr( $this->GetDBField($unique_field) );
}
$sql = 'SELECT COUNT(*) FROM %s WHERE ('.implode(') AND (',$where).') AND ('.$this->IDField.' <> '.(int)$this->ID.')';
$res_temp = $this->Conn->GetOne( str_replace('%s', $this->TableName, $sql) );
$current_table_only = getArrayValue($params, 'current_table_only'); // check unique record only in current table
$res_live = $current_table_only ? 0 : $this->Conn->GetOne( str_replace('%s', $this->Application->GetLiveName($this->TableName), $sql) );
$res = ($res_temp == 0) && ($res_live == 0);
if(!$res) $this->FieldErrors[$error_field]['pseudo'] = 'unique';
}
return $res;
}
/**
* Check if field value is in range specified in config
*
* @param string $field field name
* @param Array $params field options from config
* @return bool
* @access private
*/
function ValidateRange($field, $params)
{
$res = true;
$val = $this->FieldValues[$field];
$error_field = isset($params['error_field']) ? $params['error_field'] : $field;
if ( isset($params['type']) && preg_match("#int|integer|double|float|real#", $params['type']) && strlen($val) > 0 ) {
if ( isset($params['max_value_inc'])) {
$res = $res && $val <= $params['max_value_inc'];
$max_val = $params['max_value_inc'].' (inclusive)';
}
if ( isset($params['min_value_inc'])) {
$res = $res && $val >= $params['min_value_inc'];
$min_val = $params['min_value_inc'].' (inclusive)';
}
if ( isset($params['max_value_exc'])) {
$res = $res && $val < $params['max_value_exc'];
$max_val = $params['max_value_exc'].' (exclusive)';
}
if ( isset($params['min_value_exc'])) {
$res = $res && $val > $params['min_value_exc'];
$min_val = $params['min_value_exc'].' (exclusive)';
}
}
if (!$res) {
$this->FieldErrors[$error_field]['pseudo'] = 'value_out_of_range';
if ( !isset($min_val) ) $min_val = '-&infin;';
if ( !isset($max_val) ) $max_val = '&infin;';
$this->FieldErrors[$error_field]['params'] = Array( $min_val, $max_val );
return $res;
}
if ( isset($params['max_len'])) {
$res = $res && strlen($val) <= $params['max_len'];
}
if ( isset($params['min_len'])) {
$res = $res && strlen($val) >= $params['min_len'];
}
if (!$res) {
$this->FieldErrors[$error_field]['pseudo'] = 'length_out_of_range';
$this->FieldErrors[$error_field]['params'] = Array( getArrayValue($params,'min_len'), getArrayValue($params,'max_len') );
return $res;
}
return $res;
}
/**
* Return error message for field
*
* @param string $field
* @return string
* @access public
*/
function GetErrorMsg($field, $force_escape = null)
{
if( !isset($this->FieldErrors[$field]) ) return '';
$err = getArrayValue($this->FieldErrors[$field], 'pseudo');
if (!$err) return '';
// if special error msg defined in config
if( isset($this->Fields[$field]['error_msgs'][$err]) )
{
$msg = $this->Fields[$field]['error_msgs'][$err];
}
else //fall back to defaults
{
if( !isset($this->ErrorMsgs[$err]) ) {
trigger_error('No user message is defined for pseudo error <b>'.$err.'</b><br>', E_USER_WARNING);
return $err; //return the pseudo itself
}
$msg = $this->ErrorMsgs[$err];
}
$msg = $this->Application->ReplaceLanguageTags($msg, $force_escape);
if ( isset($this->FieldErrors[$field]['params']) )
{
return vsprintf($msg, $this->FieldErrors[$field]['params']);
}
return $msg;
}
/**
* Creates a record in the database table with current item' values
*
* @param mixed $force_id Set to TRUE to force creating of item's own ID or to value to force creating of passed id. Do not pass 1 for true, pass exactly TRUE!
* @access public
* @return bool
*/
function Create($force_id=false, $system_create=false)
{
if( !$this->raiseEvent('OnBeforeItemCreate') ) return false;
// Validating fields before attempting to create record
if( !$this->IgnoreValidation && !$this->Validate() ) return false;
if( !$this->raiseEvent('OnAfterItemValidate') ) return false;
if (is_int($force_id)) {
$this->FieldValues[$this->IDField] = $force_id;
}
elseif (!$force_id || !is_bool($force_id)) {
$this->FieldValues[$this->IDField] = $this->generateID();
}
$fields_sql = '';
$values_sql = '';
foreach ($this->FieldValues as $field_name => $field_value)
{
if ($this->SkipField($field_name, $force_id)) continue;
$fields_sql .= sprintf('`%s`, ',$field_name); //Adding field name to fields block of Insert statement
//Adding field' value to Values block of Insert statement, escaping it with ADODB' qstr
if (is_null( $this->FieldValues[$field_name] ))
{
if (isset($this->Fields[$field_name]['not_null']) && $this->Fields[$field_name]['not_null'])
{
$values_sql .= $this->Conn->qstr($this->Fields[$field_name]['default']).', ';
}
else
{
$values_sql .= 'NULL, ';
}
}
else
{
$values_sql .= sprintf('%s, ',$this->Conn->qstr($this->FieldValues[$field_name], 0));
}
}
//Cutting last commas and spaces
$fields_sql = ereg_replace(", $", '', $fields_sql);
$values_sql = ereg_replace(", $", '', $values_sql);
$sql = sprintf('INSERT INTO %s (%s) VALUES (%s)', $this->TableName, $fields_sql, $values_sql); //Formatting query
//Executing the query and checking the result
if($this->Conn->ChangeQuery($sql) === false) return false;
$insert_id = $this->Conn->getInsertID();
if($insert_id == 0) $insert_id = $this->FieldValues[$this->IDField];
$this->setID($insert_id);
if (!$system_create){
$this->setModifiedFlag();
}
$this->saveCustomFields();
$this->raiseEvent('OnAfterItemCreate');
$this->Loaded = true;
return true;
}
/**
* Deletes the record from databse
*
* @access public
* @return bool
*/
function Delete($id = null)
{
if( isset($id) ) $this->setID($id);
if( !$this->raiseEvent('OnBeforeItemDelete') ) return false;
$q = 'DELETE FROM '.$this->TableName.' WHERE '.$this->GetKeyClause('Delete');
$ret = $this->Conn->ChangeQuery($q);
$this->setModifiedFlag();
$this->raiseEvent('OnAfterItemDelete');
return $ret;
}
/**
* Sets new name for item in case if it is beeing copied
* in same table
*
* @param array $master Table data from TempHandler
* @param int $foreign_key ForeignKey value to filter name check query by
* @access private
*/
function NameCopy($master=null, $foreign_key=null)
{
$title_field = $this->Application->getUnitOption($this->Prefix, 'TitleField');
if (!$title_field || isset($this->CalculatedFields[$title_field]) ) return;
$new_name = $this->GetDBField($title_field);
$original_checked = false;
do {
if ( preg_match('/Copy ([0-9]*) *of (.*)/', $new_name, $regs) ) {
$new_name = 'Copy '.($regs[1]+1).' of '.$regs[2];
}
elseif ($original_checked) {
$new_name = 'Copy of '.$new_name;
}
// if we are cloning in temp table this will look for names in temp table,
// since object' TableName contains correct TableName (for temp also!)
// if we are cloning live - look in live
$query = 'SELECT '.$title_field.' FROM '.$this->TableName.'
WHERE '.$title_field.' = '.$this->Conn->qstr($new_name);
$foreign_key_field = getArrayValue($master, 'ForeignKey');
$foreign_key_field = is_array($foreign_key_field) ? $foreign_key_field[ $master['ParentPrefix'] ] : $foreign_key_field;
if ($foreign_key_field && isset($foreign_key)) {
$query .= ' AND '.$foreign_key_field.' = '.$foreign_key;
}
$res = $this->Conn->GetOne($query);
/*// if not found in live table, check in temp table if applicable
if ($res === false && $object->Special == 'temp') {
$query = 'SELECT '.$name_field.' FROM '.$this->GetTempName($master['TableName']).'
WHERE '.$name_field.' = '.$this->Conn->qstr($new_name);
$res = $this->Conn->GetOne($query);
}*/
$original_checked = true;
} while ($res !== false);
$this->SetDBField($title_field, $new_name);
}
function raiseEvent($name, $id = null, $additional_params = Array())
{
if( !isset($id) ) $id = $this->GetID();
$event = new kEvent( Array('name'=>$name,'prefix'=>$this->Prefix,'special'=>$this->Special) );
$event->setEventParam('id', $id);
if ($additional_params) {
foreach ($additional_params as $ap_name => $ap_value) {
$event->setEventParam($ap_name, $ap_value);
}
}
$this->Application->HandleEvent($event);
return $event->status == erSUCCESS ? true : false;
}
/**
* Set's new ID for item
*
* @param int $new_id
* @access public
*/
function setID($new_id)
{
$this->ID = $new_id;
$this->SetDBField($this->IDField, $new_id);
}
/**
* Generate and set new temporary id
*
* @access private
*/
function setTempID()
{
$new_id = (int)$this->Conn->GetOne('SELECT MIN('.$this->IDField.') FROM '.$this->TableName);
if($new_id > 0) $new_id = 0;
--$new_id;
$this->Conn->Query('UPDATE '.$this->TableName.' SET `'.$this->IDField.'` = '.$new_id.' WHERE `'.$this->IDField.'` = '.$this->GetID());
$this->SetID($new_id);
}
/**
* Set's modification flag for main prefix of current prefix to true
*
* @access private
* @author Alexey
*/
function setModifiedFlag()
{
$main_prefix = $this->Application->GetTopmostPrefix($this->Prefix);
$this->Application->StoreVar($main_prefix.'_modified', '1');
}
/**
* Returns ID of currently processed record
*
* @return int
* @access public
*/
function GetID()
{
return $this->ID;
}
/**
* Generates ID for new items before inserting into database
*
* @return int
* @access private
*/
function generateID()
{
return 0;
}
/**
* Returns true if item was loaded successfully by Load method
*
* @return bool
*/
function isLoaded()
{
return $this->Loaded;
}
/**
* Checks if field is required
*
* @param string $field
* @return bool
*/
function isRequired($field)
{
return getArrayValue( $this->Fields[$field], 'required' );
}
/**
* Sets new required flag to field
*
* @param string $field
* @param bool $is_required
*/
function setRequired($field, $is_required = true)
{
$this->Fields[$field]['required'] = $is_required;
}
function Clear()
{
$this->setID(null);
$this->Loaded = false;
$this->FieldValues = Array();
$this->SetDefaultValues();
$this->FieldErrors = Array();
return $this->Loaded;
}
function Query($force = false)
{
if( $this->Application->isDebugMode() )
{
$this->Application->Debugger->appendTrace();
}
trigger_error('<b>Query</b> method is called in class <b>'.get_class($this).'</b> for prefix <b>'.$this->getPrefixSpecial().'</b>', E_USER_ERROR);
}
function saveCustomFields()
{
if (!$this->customFields) {
return true;
}
$cdata_key = rtrim($this->Prefix.'-cdata.'.$this->Special, '.');
$cdata =& $this->Application->recallObject($cdata_key, null, Array('skip_autoload' => true));
$resource_id = $this->GetDBField('ResourceId');
$cdata->Load($resource_id, 'ResourceId');
$cdata->SetDBField('ResourceId', $resource_id);
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
foreach ($this->customFields as $custom_id => $custom_name) {
$cdata->SetDBField($ml_formatter->LangFieldName('cust_'.$custom_id), $this->GetDBField('cust_'.$custom_name));
}
if ($cdata->isLoaded()) {
$ret = $cdata->Update();
}
else {
$ret = $cdata->Create();
if ($cdata->mode == 't') $cdata->setTempID();
}
return $ret;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/db/dbitem.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.29
\ No newline at end of property
+1.30
\ No newline at end of property
Index: trunk/core/kernel/languages/phrases_cache.php
===================================================================
--- trunk/core/kernel/languages/phrases_cache.php (revision 7634)
+++ trunk/core/kernel/languages/phrases_cache.php (revision 7635)
@@ -1,220 +1,228 @@
<?php
class PhrasesCache extends kBase {
/**
* Connection to database
*
* @var kDBConnection
* @access public
*/
var $Conn;
var $Phrases = Array();
var $Ids = Array();
var $OriginalIds = Array(); //for comparing cache
var $LanguageId = null;
var $fromTag = false;
function PhrasesCache()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
function Init($prefix, $special = '')
{
$this->LanguageId = $this->Application->GetVar('m_lang');
if (isset($this->Application->Caches['PhraseList'])) {
$this->LoadPhrases( $this->Application->Caches['PhraseList'] );
}
}
function GetCachedIds()
{
$query = sprintf("SELECT PhraseList, ConfigVariables FROM %s WHERE Template = %s",
TABLE_PREFIX.'PhraseCache',
$this->Conn->Qstr(md5($this->Application->GetVar('t').$this->Application->GetVar('m_theme').$this->Application->GetVar('m_lang'))));
$res = $this->Conn->GetRow($query);
if ($res && $res['ConfigVariables']) {
$this->Application->OriginalConfigCacheIds = explode(',', $res['ConfigVariables']);
$this->Application->ConfigCacheIds = $this->Application->OriginalConfigCacheIds;
}
return ($res === false) ? Array() : explode(',', $res['PhraseList']);
}
function LoadPhrases($ids)
{
if ( !is_array($ids) || !implode('', $ids) ) return;
$query = sprintf("SELECT Translation,UPPER(Phrase) AS Phrase FROM %s WHERE LanguageId = %s AND PhraseId IN (%s)",
TABLE_PREFIX.'Phrase',
$this->LanguageId,
join(',', $ids));
$this->Phrases = $this->Conn->GetCol($query,'Phrase');
/*foreach($phrases as $phrase => $tanslation)
{
$this->AddCachedPhrase(strtoupper($phrase), $tanslation);
}*/
$this->Ids = $ids;
$this->OriginalIds = $ids;
}
function AddCachedPhrase($label, $value)
{
$label = strtoupper($label);
$this->Phrases[$label] = $value;
}
function NeedsCacheUpdate()
{
return is_array($this->Ids) && count($this->Ids) > 0 && $this->Ids != $this->OriginalIds;
}
function UpdateCache()
{
$update = false;
//something changed
$update = $update || (is_array($this->Ids) && count($this->Ids) > 0 && $this->Ids != $this->OriginalIds);
$update = $update || (count($this->Application->ConfigCacheIds) && $this->Application->ConfigCacheIds != $this->Application->OriginalConfigCacheIds);
if ($update) {
$query = sprintf("REPLACE %s (PhraseList, CacheDate, Template, ConfigVariables)
VALUES (%s, %s, %s, %s)",
TABLE_PREFIX.'PhraseCache',
$this->Conn->Qstr(join(',', $this->Ids)),
adodb_mktime(),
$this->Conn->Qstr(md5($this->Application->GetVar('t').$this->Application->GetVar('m_theme').$this->Application->GetVar('m_lang'))),
$this->Conn->qstr(implode(',', array_unique($this->Application->ConfigCacheIds))));
$this->Conn->Query($query);
}
}
function GetPhrase($label)
{
if (ereg("^!.+!$", $label) > 0)
{
$label = substr($label, 1, -1); //cut exclamation marks
}
if( strlen($label) == 0 ) return '';
$original_label = $label;
$label = strtoupper($label);
if(isset($this->Phrases[$label])) {
$translated_label = $this->Phrases[$label];
// debug mode is checked directly to improve performance
if (defined('DEBUG_MODE') && DEBUG_MODE && constOn('DBG_PHRASES_HIGHLIGHT')) {
if (!$this->Application->isDebugMode()) return $translated_label;
if ($this->Application->IsAdmin()) {
$sql = 'SELECT Module
FROM '.TABLE_PREFIX.'Phrase
WHERE (LanguageId = '.$this->LanguageId.') AND (Phrase = '.$this->Conn->qstr($label).')';
$this->Application->Debugger->appendHTML('Phrase: <b>'.$label.'</b>; Module: <b>'.$this->Conn->GetOne($sql).'</b>');
// $translated_label = $translated_label.' [m: '.$this->Conn->GetOne($sql).'; l: '.$label.']';
}
else {
// highlight text created via translated phrase (used to detect if text on screen is phrase or not)
$translated_label = '<span style="border: 1px solid #999999; background-color: #cccccc; color: #999999; ">'.$translated_label.'</span></a> <span style="color: red; background-color:#ffffcc">'.$original_label.'</span>';
}
}
return $translated_label;
}
$this->LoadPhraseByLabel($label, $original_label);
return $this->GetPhrase($label);
}
function LoadPhraseByLabel($label, $original_label)
{
$query = sprintf("SELECT PhraseId, Translation FROM %s WHERE LanguageId = %s AND UPPER(Phrase) = UPPER(%s)",
TABLE_PREFIX.'Phrase',
$this->LanguageId,
$this->Conn->qstr($label));
$res = $this->Conn->GetRow($query);
if ($res === false || count($res) == 0)
{
$translation = '!'.$label.'!';
if($this->Application->isDebugMode() && constOn('DBG_PHRASES')) {
list($edit_tpl, $index_file) = $this->Application->IsAdmin() ? Array('regional/phrases_edit', 'index.php') : Array('phrases_edit', 'index.php');
- $edit_url = $this->Application->HREF($edit_tpl,'',Array('m_opener'=>'d','phrases_label'=>$original_label,'phrases_event'=>'OnNew', 'pass'=>'all,phrases'), $index_file );
+ if ($this->Application->IsAdmin() && $this->Application->ConfigValue('UsePopups')) {
+ // link to popup when using popups (only in admin)
+ $edit_url = 'javascript:translate_phrase(\''.addslashes($original_label).'\', \''.$edit_tpl.'\');';
+ }
+ else {
+ // direct link, when not using popups OR on frontend
+ $edit_url = $this->Application->HREF($edit_tpl,'',Array('m_opener'=>'d','phrases_label'=>$original_label,'phrases_event'=>'OnNew', 'pass'=>'all,phrases'), $index_file );
+ }
+
$translation = '<a href="'.$edit_url.'">!'.$label.'!</a>';
if($this->fromTag) $translation = $this->escapeTagReserved($translation);
}
$this->AddCachedPhrase($label, $translation); //add it as already cached, as long as we dont need to cache not found phrase
return false;
}
$this->Phrases[$label] = $res['Translation'];
array_push($this->Ids, $res['PhraseId']);
$this->Ids = array_unique($this->Ids); //just to make sure
return true;
}
/**
* Sort params by name and then by length
*
* @param string $a
* @param string $b
* @return int
* @access private
*/
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;
}
/**
* Replace language tags in exclamation marks found in text
*
* @param string $text
* @param bool $force_escape force escaping, not escaping of resulting string
* @return string
* @access public
*/
function ReplaceLanguageTags($text,$forse_escaping=null)
{
$this->fromTag = true;
if( isset($forse_escaping) ) $this->fromTag = $forse_escaping;
preg_match_all("(!(la|lu)[^!]+!)", $text, $res, PREG_PATTERN_ORDER);
$language_tags = $res[0];
uasort($language_tags, Array(&$this, 'CmpParams') );
$values = Array();
$i = 0;
foreach ($language_tags as $label) {
array_push($values, $this->GetPhrase($label) );
//array_push($values, $this->Application->Phrase($label) );
$language_tags[$i] = '/' . $language_tags[$i] . '/';
$i++;
}
$this->fromTag = false;
return preg_replace($language_tags, $values, $text);
}
/**
* Escape chars in phrase translation, that could harm parser to process tag
*
* @param string $text
* @return string
* @access private
*/
function escapeTagReserved($text)
{
$reserved = Array('"',"'"); // =
$replacement = Array('\"',"\'"); // \=
return str_replace($reserved,$replacement,$text);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/languages/phrases_cache.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.16
\ No newline at end of property
+1.17
\ No newline at end of property
Index: trunk/core/kernel/application.php
===================================================================
--- trunk/core/kernel/application.php (revision 7634)
+++ trunk/core/kernel/application.php (revision 7635)
@@ -1,2381 +1,2421 @@
<?php
/**
* Basic class for Kernel3-based Application
*
* This class is a Facade for any other class which needs to deal with Kernel3 framework.<br>
* The class incapsulates the main run-cycle of the script, provide access to all other objects in the framework.<br>
* <br>
* The class is a singleton, which means that there could be only one instance of KernelApplication in the script.<br>
* This could be guranteed by NOT calling the class constuctor directly, but rather calling KernelApplication::Instance() method,
* which returns an instance of the application. The method gurantees that it will return exactly the same instance for any call.<br>
* See singleton pattern by GOF.
* @package kernel4
*/
class kApplication {
/**
* Is true, when Init method was called already, prevents double initialization
*
* @var bool
*/
var $InitDone = false;
/**
* Holds internal TemplateParser object
* @access private
* @var TemplateParser
*/
var $Parser;
/**
* Holds parser output buffer
* @access private
* @var string
*/
var $HTML;
/**
* Prevents request from beeing proceeded twice in case if application init is called mere then one time
*
* @var bool
* @todo This is not good anyway (by Alex)
*/
var $RequestProcessed = false;
/**
* The main Factory used to create
* almost any class of kernel and
* modules
*
* @access private
* @var kFactory
*/
var $Factory;
/**
* All ConfigurationValues table content (hash) here
*
* @var Array
* @access private
*/
var $ConfigHash = Array();
/**
* Ids of config variables used in current run (for caching)
*
* @var Array
* @access private
*/
var $ConfigCacheIds = array();
/**
* Template names, that will be used instead of regular templates
*
* @var Array
*/
var $ReplacementTemplates = Array ();
/**
* Reference to debugger
*
* @var Debugger
*/
var $Debugger = null;
/**
* Holds all phrases used
* in code and template
*
* @var PhrasesCache
*/
var $Phrases;
/**
* Modules table content, key - module name
*
* @var Array
*/
var $ModuleInfo = Array();
/**
* Holds DBConnection
*
* @var kDBConnection
*/
var $Conn = null;
/**
* Maintains list of user-defined error handlers
*
* @var Array
*/
var $errorHandlers = Array();
// performance needs:
/**
* Holds a refererence to httpquery
*
* @var kHttpQuery
*/
var $HttpQuery = null;
/**
* Holds a reference to UnitConfigReader
*
* @var kUnitConfigReader
*/
var $UnitConfigReader = null;
/**
* Holds a reference to Session
*
* @var Session
*/
var $Session = null;
/**
* Holds a ref to kEventManager
*
* @var kEventManager
*/
var $EventManager = null;
/**
* Ref to itself, needed because everybody used to write $this->Application, even inside kApplication
*
* @var kApplication
*/
var $Application = null;
/**
* Ref for TemplatesChache
*
* @var TemplatesCache
*/
var $TemplatesCache = null;
var $CompilationCache = array(); //used when compiling templates
var $CachedProcessors = array(); //used when running compiled templates
/**
* Returns kApplication instance anywhere in the script.
*
* This method should be used to get single kApplication object instance anywhere in the
* Kernel-based application. The method is guranteed to return the SAME instance of kApplication.
* Anywhere in the script you could write:
* <code>
* $application =& kApplication::Instance();
* </code>
* or in an object:
* <code>
* $this->Application =& kApplication::Instance();
* </code>
* to get the instance of kApplication. Note that we call the Instance method as STATIC - directly from the class.
* To use descendand of standard kApplication class in your project you would need to define APPLICATION_CLASS constant
* BEFORE calling kApplication::Instance() for the first time. If APPLICATION_CLASS is not defined the method would
* create and return default KernelApplication instance.
* @static
* @access public
* @return kApplication
*/
function &Instance()
{
static $instance = false;
if(!$instance)
{
safeDefine('APPLICATION_CLASS', 'kApplication');
$class = APPLICATION_CLASS;
$instance = new $class();
$instance->Application =& $instance;
}
return $instance;
}
/**
* Initializes the Application
*
* @access public
* @see kHTTPQuery
* @see Session
* @see TemplatesCache
* @return bool Was Init actually made now or before
*/
function Init()
{
if($this->InitDone) return false;
if (!constOn('SKIP_OUT_COMPRESSION')) {
ob_start(); // collect any output from method (other then tags) into buffer
}
if(defined('DEBUG_MODE') && $this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Init:');
}
if (!$this->isDebugMode() && !constOn('DBG_ZEND_PRESENT')) {
error_reporting(0);
ini_set('display_errors', 0);
}
if (!constOn('DBG_ZEND_PRESENT')) {
$error_handler = set_error_handler( Array(&$this,'handleError') );
if ($error_handler) $this->errorHandlers[] = $error_handler;
}
$this->Conn = new kDBConnection(SQL_TYPE, Array(&$this, 'handleSQLError') );
$this->Conn->Connect(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB);
$this->Conn->debugMode = $this->isDebugMode();
$this->Factory = new kFactory();
$this->registerDefaultClasses();
$this->Phrases = new PhrasesCache();
$this->EventManager =& $this->Factory->makeClass('EventManager');
$this->Factory->Storage['EventManager'] =& $this->EventManager;
$this->RegisterDefaultBuildEvents();
$this->SetDefaultConstants();
$this->UnitConfigReader =& $this->recallObject('kUnitConfigReader');
$this->UnitConfigReader->scanModules(MODULES_PATH);
$this->registerModuleConstants();
$rewrite_on = $this->ConfigValue('UseModRewrite');
// admin=1 - when front is browsed using admin session
$admin_on = getArrayValue($_REQUEST, 'admin') || $this->IsAdmin();
define('MOD_REWRITE', $rewrite_on && !$admin_on ? 1 : 0);
$this->HttpQuery =& $this->recallObject('HTTPQuery');
$this->Session =& $this->recallObject('Session');
$this->HttpQuery->AfterInit();
$this->LoadCache();
$this->InitConfig();
$this->Phrases->Init('phrases');
$this->UnitConfigReader->AfterConfigRead();
/*// Module items are recalled during url parsing & PhrasesCache is needed already there,
// because it's used in their build events. That's why phrases cache initialization is
// called from kHTTPQuery in case when mod_rewrite is used
if (!$this->RewriteURLs()) {
$this->Phrases = new PhrasesCache();
}*/
if(!$this->RecallVar('UserGroups')) {
$session =& $this->recallObject('Session');
$user_groups = trim($session->GetField('GroupList'), ',');
if (!$user_groups) $user_groups = $this->ConfigValue('User_GuestGroup');
$this->StoreVar('UserGroups', $user_groups);
}
if ($this->GetVar('m_cat_id') === false) $this->SetVar('m_cat_id', 0);
if( !$this->RecallVar('curr_iso') ) $this->StoreVar('curr_iso', $this->GetPrimaryCurrency() );
$this->SetVar('visits_id', $this->RecallVar('visit_id') );
$language =& $this->recallObject( 'lang.current', null, Array('live_table' => true) );
$this->ValidateLogin();
if($this->isDebugMode()) {
$this->Debugger->profileFinish('kernel4_startup');
}
$this->InitDone = true;
$this->HandleEvent( new kEvent('adm:OnStartup') );
return true;
}
/**
* Returns module information. Searches module by requested field
*
* @param string $field
* @param mixed $value
* @param string field value to returns, if not specified, then return all fields
* @param string field to return
* @return Array
*/
function findModule($field, $value, $return_field = null)
{
$found = false;
foreach ($this->ModuleInfo as $module_name => $module_info) {
if (strtolower($module_info[$field]) == strtolower($value)) {
$found = true;
break;
}
}
if ($found) {
return isset($return_field) ? $module_info[$return_field] : $module_info;
}
return false;
}
function refreshModuleInfo()
{
$modules_helper =& $this->recallObject('ModulesHelper');
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'Modules
WHERE '.$modules_helper->getWhereClause().'
ORDER BY LoadOrder';
$this->ModuleInfo = $this->Conn->Query($sql, 'Name');
$this->registerModuleConstants();
}
/**
* Checks if passed language id if valid and sets it to primary otherwise
*
*/
function VerifyLanguageId()
{
$language_id = $this->GetVar('m_lang');
if (!$language_id) {
$language_id = 'default';
}
$this->SetVar('lang.current_id', $language_id );
$this->SetVar('m_lang', $language_id );
$lang_mode = $this->GetVar('lang_mode');
$this->SetVar('lang_mode', '');
$lang =& $this->recallObject('lang.current');
if ( !$lang->IsLoaded() || (!$this->Application->IsAdmin() && !$lang->GetDBField('Enabled')) ) {
if (!defined('IS_INSTALL')) $this->ApplicationDie('Unknown or disabled language');
}
$this->SetVar('lang_mode',$lang_mode);
}
/**
* Checks if passed theme id if valid and sets it to primary otherwise
*
*/
function VerifyThemeId()
{
if ($this->Application->IsAdmin()) {
safeDefine('THEMES_PATH', '/core/admin_templates');
return;
}
+ $path = $this->GetFrontThemePath();
+ if ($path === false) {
+ $this->ApplicationDie('No Primary Theme Selected or Current Theme is Unknonw or Disabled');
+ }
+ safeDefine('THEMES_PATH', $path);
+ /*
+
$theme_id = $this->GetVar('m_theme');
if (!$theme_id) {
$theme_id = $this->GetDefaultThemeId();
if (!$theme_id) {
if (!defined('IS_INSTALL')) $this->ApplicationDie('No Primary Theme Selected');
}
}
$this->SetVar('m_theme', $theme_id);
$this->SetVar('theme.current_id', $theme_id ); // KOSTJA: this is to fool theme' getPassedId
$theme =& $this->recallObject('theme.current');
if (!$theme->IsLoaded() || !$theme->GetDBField('Enabled')) {
if (!defined('IS_INSTALL')) $this->ApplicationDie('Unknown or disabled theme');
}
safeDefine('THEMES_PATH', '/themes/'.$theme->GetDBField('Name'));
+*/
+
+ }
+
+ function GetFrontThemePath($force=0)
+ {
+ static $path=null;
+ if (!$force && isset($path)) return $path;
+
+ $theme_id = $this->GetVar('m_theme');
+ if (!$theme_id) {
+ $theme_id = $this->GetDefaultThemeId(1); //1 to force front-end mode!
+ if (!$theme_id) {
+ return false;
+ }
+ }
+ $this->SetVar('m_theme', $theme_id);
+ $this->SetVar('theme.current_id', $theme_id ); // KOSTJA: this is to fool theme' getPassedId
+ $theme =& $this->recallObject('theme.current');
+ if (!$theme->IsLoaded() || !$theme->GetDBField('Enabled')) {
+ return false;
+ }
+ $path = '/themes/'.$theme->GetDBField('Name');
+ return $path;
}
function GetDefaultLanguageId()
{
static $language_id = 0;
if ($language_id > 0) return $language_id;
$table = $this->getUnitOption('lang','TableName');
$id_field = $this->getUnitOption('lang','IDField');
$sql = 'SELECT '.$id_field.'
FROM '.$table.'
WHERE (PrimaryLang = 1) AND (Enabled = 1)';
$language_id = $this->Conn->GetOne($sql);
if (!$language_id && defined('IS_INSTALL') && IS_INSTALL) {
$language_id = 1;
}
return $language_id;
}
- function GetDefaultThemeId()
+ function GetDefaultThemeId($force_front=0)
{
static $theme_id = 0;
if($theme_id > 0) return $theme_id;
if (constOn('DBG_FORCE_THEME')) {
$theme_id = DBG_FORCE_THEME;
}
- elseif ($this->IsAdmin()) {
+ elseif (!$force_front && $this->IsAdmin()) {
$theme_id = 999;
}
else {
$table = $this->getUnitOption('theme','TableName');
$id_field = $this->getUnitOption('theme','IDField');
$sql = 'SELECT '.$id_field.'
FROM '.$table.'
WHERE (PrimaryTheme = 1) AND (Enabled = 1)';
$theme_id = $this->Conn->GetOne($sql);
}
return $theme_id;
}
function GetPrimaryCurrency()
{
if ($this->isModuleEnabled('In-Commerce')) {
$table = $this->getUnitOption('curr', 'TableName');
return $this->Conn->GetOne('SELECT ISO FROM '.$table.' WHERE IsPrimary = 1');
}
else {
return 'USD';
}
}
/**
* Registers default classes such as ItemController, GridController and LoginController
*
* Called automatically while initializing Application
* @access private
* @return void
*/
function RegisterDefaultClasses()
{
$this->registerClass('kTempTablesHandler', KERNEL_PATH.'/utility/temp_handler.php');
$this->registerClass('kEventManager', KERNEL_PATH.'/event_manager.php', 'EventManager');
$this->registerClass('kUnitConfigReader', KERNEL_PATH.'/utility/unit_config_reader.php');
$this->registerClass('kArray', KERNEL_PATH.'/utility/params.php');
$this->registerClass('Params', KERNEL_PATH.'/utility/params.php');
$this->registerClass('kHelper', KERNEL_PATH.'/kbase.php');
$this->registerClass('kCache', KERNEL_PATH.'/utility/cache.php', 'Cache', Array('Params'));
$this->registerClass('kHTTPQuery', KERNEL_PATH.'/utility/http_query.php', 'HTTPQuery', Array('Params') );
$this->registerClass('Session', KERNEL_PATH.'/session/session.php');
$this->registerClass('SessionStorage', KERNEL_PATH.'/session/session.php');
$this->registerClass('Params', KERNEL_PATH.'/utility/params.php', 'kActions');
$this->registerClass('kMultipleFilter', KERNEL_PATH.'/utility/filters.php');
$this->registerClass('kDBList', KERNEL_PATH.'/db/dblist.php');
$this->registerClass('kDBItem', KERNEL_PATH.'/db/dbitem.php');
$this->registerClass('kDBEventHandler', KERNEL_PATH.'/db/db_event_handler.php');
$this->registerClass('kTagProcessor', KERNEL_PATH.'/processors/tag_processor.php');
$this->registerClass('kMainTagProcessor', KERNEL_PATH.'/processors/main_processor.php','m_TagProcessor', 'kTagProcessor');
$this->registerClass('kDBTagProcessor', KERNEL_PATH.'/db/db_tag_processor.php', null, 'kTagProcessor');
$this->registerClass('TemplatesCache', KERNEL_PATH.'/parser/template.php');
$this->registerClass('Template', KERNEL_PATH.'/parser/template.php');
$this->registerClass('TemplateParser', KERNEL_PATH.'/parser/template_parser.php',null, 'kDBTagProcessor');
$this->registerClass('kEmailMessage', KERNEL_PATH.'/utility/email.php');
$this->registerClass('kSmtpClient', KERNEL_PATH.'/utility/smtp_client.php');
if (file_exists(MODULES_PATH.'/in-commerce/units/currencies/currency_rates.php')) {
$this->registerClass('kCurrencyRates', MODULES_PATH.'/in-commerce/units/currencies/currency_rates.php');
}
$this->registerClass('FCKeditor', FULL_PATH.'/admin/editor/cmseditor/fckeditor.php'); // need this?
/* Moved from MyApplication */
$this->registerClass('Inp1Parser',KERNEL_PATH.'/../units/general/inp1_parser.php','Inp1Parser');
$this->registerClass('InpSession',KERNEL_PATH.'/../units/general/inp_ses_storage.php','Session');
$this->registerClass('InpSessionStorage',KERNEL_PATH.'/../units/general/inp_ses_storage.php','SessionStorage');
$this->registerClass('kCatDBItem',KERNEL_PATH.'/../units/general/cat_dbitem.php');
$this->registerClass('kCatDBItemExportHelper',KERNEL_PATH.'/../units/general/cat_dbitem_export.php', 'CatItemExportHelper');
$this->registerClass('kCatDBList',KERNEL_PATH.'/../units/general/cat_dblist.php');
$this->registerClass('kCatDBEventHandler',KERNEL_PATH.'/../units/general/cat_event_handler.php');
$this->registerClass('kCatDBTagProcessor',KERNEL_PATH.'/../units/general/cat_tag_processor.php');
// Do not move to config - this helper is used before configs are read
$this->registerClass('kModulesHelper', KERNEL_PATH.'/../units/general/helpers/modules.php', 'ModulesHelper');
/* End moved */
}
function RegisterDefaultBuildEvents()
{
$event_manager =& $this->recallObject('EventManager');
$event_manager->registerBuildEvent('kTempTablesHandler', 'OnTempHandlerBuild');
}
/**
* Returns item's filename that corresponds id passed. If possible, then get it from cache
*
* @param string $prefix
* @param int $id
* @return string
*/
function getFilename($prefix, $id, $category_id=null)
{
$filename = $this->getCache('filenames', $prefix.'_'.$id);
if ($filename === false) {
$table = $this->getUnitOption($prefix, 'TableName');
$id_field = $this->getUnitOption($prefix, 'IDField');
if ($prefix == 'c') {
if(!$id) {
$this->setCache('filenames', $prefix.'_'.$id, '');
return '';
}
// this allows to save 2 sql queries for each category
$sql = 'SELECT NamedParentPath, CachedCategoryTemplate
FROM '.$table.'
WHERE '.$id_field.' = '.$this->Conn->qstr($id);
$category_data = $this->Conn->GetRow($sql);
$filename = $category_data['NamedParentPath'];
$this->setCache('category_templates', $id, $category_data['CachedCategoryTemplate']);
// $this->setCache('item_templates', $id, $category_data['CachedItemTemplate']);
}
else {
$resource_id = $this->Conn->GetOne('SELECT ResourceId FROM '.$table.' WHERE '.$id_field.' = '.$this->Conn->qstr($id));
if (is_null($category_id)) $category_id = $this->GetVar('m_cat_id');
$sql = 'SELECT Filename FROM '.TABLE_PREFIX.'CategoryItems WHERE ItemResourceId = '.$resource_id.' AND CategoryId = '.$category_id;
$filename = $this->Conn->GetOne($sql);
/*if (!$filename) {
$sql = 'SELECT Filename FROM '.TABLE_PREFIX.'CategoryItems WHERE ItemResourceId = '.$resource_id.' AND PrimaryCat = 1';
$filename = $this->Conn->GetOne($sql);
}*/
/*$sql = 'SELECT Filename
FROM '.$table.'
WHERE '.$id_field.' = '.$this->Conn->qstr($id);
$filename = $this->Conn->GetOne($sql);*/
}
$this->setCache('filenames', $prefix.'_'.$id, $filename);
}
return $filename;
}
/**
* Adds new value to cache $cache_name and identified by key $key
*
* @param string $cache_name cache name
* @param int $key key name to add to cache
* @param mixed $value value of chached record
*/
function setCache($cache_name, $key, $value)
{
$cache =& $this->recallObject('Cache');
$cache->setCache($cache_name, $key, $value);
}
/**
* Returns cached $key value from cache named $cache_name
*
* @param string $cache_name cache name
* @param int $key key name from cache
* @return mixed
*/
function getCache($cache_name, $key)
{
$cache =& $this->recallObject('Cache');
return $cache->getCache($cache_name, $key);
}
/**
* Defines default constants if it's not defined before - in config.php
*
* @access private
*/
- function SetDefaultConstants()
+ function SetDefaultConstants() // it's defined in startup.php - can be removed??
{
safeDefine('SERVER_NAME', $_SERVER['HTTP_HOST']);
}
/**
* Registers each module specific constants if any found
*
*/
function registerModuleConstants()
{
if (file_exists(KERNEL_PATH.'/constants.php')) {
k4_include_once(KERNEL_PATH.'/constants.php');
}
if (!$this->ModuleInfo) return false;
foreach($this->ModuleInfo as $module_name => $module_info)
{
$module_path = '/'.$module_info['Path'];
$contants_file = FULL_PATH.$module_path.'constants.php';
if( file_exists($contants_file) ) k4_include_once($contants_file);
}
return true;
}
function ProcessRequest()
{
$event_manager =& $this->recallObject('EventManager');
+ /* @var $event_manager kEventManager */
if($this->isDebugMode() && constOn('DBG_SHOW_HTTPQUERY')) {
$this->Debugger->appendHTML('HTTPQuery:');
$this->Debugger->dumpVars($this->HttpQuery->_Params);
}
$event_manager->ProcessRequest();
$event_manager->RunRegularEvents(reBEFORE);
$this->RequestProcessed = true;
}
/**
* Actually runs the parser against current template and stores parsing result
*
* This method gets t variable passed to the script, loads the template given in t variable and
* parses it. The result is store in {@link $this->HTML} property.
* @access public
* @return void
*/
function Run()
{
if($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Run:');
}
if ($this->IsAdmin()) {
// for permission checking in events & templates
$this->LinkVar('module'); // for common configuration templates
$this->LinkVar('section'); // for common configuration templates
if ($this->GetVar('m_opener') == 'p') {
$this->LinkVar('main_prefix'); // window prefix, that opened selector
$this->LinkVar('dst_field'); // field to set value choosed in selector
// $this->LinkVar('return_template'); // template to go, when something was coosen from popup (from finalizePopup)
// $this->LinkVar('return_m'); // main env part to restore after popup will be closed (from finalizePopup)
}
if ($this->GetVar('ajax') == 'yes') {
// hide debug output from ajax requests automatically
define('DBG_SKIP_REPORTING', 1);
}
}
if (!$this->RequestProcessed) $this->ProcessRequest();
$this->InitParser();
$t = $this->GetVar('t');
if ($this->isModuleEnabled('In-Edit')) {
$cms_handler =& $this->recallObject('cms_EventHandler');
if (!$this->TemplatesCache->TemplateExists($t) && !$this->IsAdmin()) {
$t = $cms_handler->GetDesignTemplate();
}
/*else {
$cms_handler->SetCatByTemplate();
}*/
}
if ($this->isModuleEnabled('Proj-CMS')) {
$cms_handler =& $this->recallObject('st_EventHandler');
if (!$this->TemplatesCache->TemplateExists($t) && !$this->IsAdmin()) {
$t = $cms_handler->GetDesignTemplate();
}
/*else {
$cms_handler->SetCatByTemplate();
}*/
}
if($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Parsing:');
}
$this->HTML = $this->Parser->ParseTemplate( $t );
if ($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application after Parsing:');
}
}
function InitParser()
{
if( !is_object($this->Parser) ) {
$this->Parser =& $this->recallObject('TemplateParser');
$this->TemplatesCache =& $this->recallObject('TemplatesCache');
}
}
/**
* Send the parser results to browser
*
* Actually send everything stored in {@link $this->HTML}, to the browser by echoing it.
* @access public
* @return void
*/
function Done()
{
if ($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Done:');
}
if ($this->GetVar('admin')) {
$reg = '/('.preg_quote(BASE_PATH, '/').'.*\.html)(#.*){0,1}(")/sU';
$this->HTML = preg_replace($reg, "$1?admin=1$2$3", $this->HTML);
}
//eval("?".">".$this->HTML);
if ($this->isDebugMode()) {
$this->EventManager->RunRegularEvents(reAFTER);
$this->Session->SaveData();
$this->HTML = ob_get_clean() . $this->HTML . $this->Debugger->printReport(true);
}
else {
$this->HTML = ob_get_clean().$this->HTML;
}
if ($this->UseOutputCompression()) {
header('Content-Encoding: gzip');
$compression_level = $this->ConfigValue('OutputCompressionLevel');
if ($compression_level < 0 || $compression_level > 9) $compression_level = 7;
echo gzencode($this->HTML, $compression_level);
}
else {
echo $this->HTML;
}
$this->UpdateCache();
flush();
if ($this->isDebugMode() && constOn('DBG_CACHE')) {
$cache =& $this->recallObject('Cache');
$cache->printStatistics();
}
$this->EventManager->RunRegularEvents(reAFTER);
$this->Session->SaveData();
}
/**
* Checks if output compression options is available
*
* @return string
*/
function UseOutputCompression()
{
if (constOn('IS_INSTALL') || constOn('DBG_ZEND_PRESENT') || constOn('SKIP_OUT_COMPRESSION')) return false;
return $this->ConfigValue('UseOutputCompression') && function_exists('gzencode') && strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
}
// Facade
/**
* Returns current session id (SID)
* @access public
* @return longint
*/
function GetSID()
{
$session =& $this->recallObject('Session');
return $session->GetID();
}
function DestroySession()
{
$session =& $this->recallObject('Session');
$session->Destroy();
}
/**
* Returns variable passed to the script as GET/POST/COOKIE
*
* @access public
* @param string $name Name of variable to retrieve
* @param int $default default value returned in case if varible not present
* @return mixed
*/
function GetVar($name, $default = false)
{
// $http_query =& $this->recallObject('HTTPQuery');
return isset($this->HttpQuery->_Params[$name]) ? $this->HttpQuery->_Params[$name] : $default;
}
/**
* Returns ALL variables passed to the script as GET/POST/COOKIE
*
* @access public
* @return array
*/
function GetVars()
{
return $this->HttpQuery->GetParams();
}
/**
* Set the variable 'as it was passed to the script through GET/POST/COOKIE'
*
* This could be useful to set the variable when you know that
* other objects would relay on variable passed from GET/POST/COOKIE
* or you could use SetVar() / GetVar() pairs to pass the values between different objects.<br>
*
* This method is formerly known as $this->Session->SetProperty.
* @param string $var Variable name to set
* @param mixed $val Variable value
* @access public
* @return void
*/
function SetVar($var,$val)
{
// $http_query =& $this->recallObject('HTTPQuery');
return $this->HttpQuery->Set($var,$val);
}
/**
* Deletes kHTTPQuery variable
*
* @param string $var
* @todo think about method name
*/
function DeleteVar($var)
{
return $this->HttpQuery->Remove($var);
}
/**
* Deletes Session variable
*
* @param string $var
*/
function RemoveVar($var)
{
return $this->Session->RemoveVar($var);
}
function RemovePersistentVar($var)
{
return $this->Session->RemovePersistentVar($var);
}
/**
* Restores Session variable to it's db version
*
* @param string $var
*/
function RestoreVar($var)
{
return $this->Session->RestoreVar($var);
}
/**
* Returns session variable value
*
* Return value of $var variable stored in Session. An optional default value could be passed as second parameter.
*
* @see SimpleSession
* @access public
* @param string $var Variable name
* @param mixed $default Default value to return if no $var variable found in session
* @return mixed
*/
function RecallVar($var,$default=false)
{
return $this->Session->RecallVar($var,$default);
}
function RecallPersistentVar($var, $default = false)
{
return $this->Session->RecallPersistentVar($var, $default);
}
/**
* Stores variable $val in session under name $var
*
* Use this method to store variable in session. Later this variable could be recalled.
* @see RecallVar
* @access public
* @param string $var Variable name
* @param mixed $val Variable value
*/
function StoreVar($var, $val)
{
$session =& $this->recallObject('Session');
$this->Session->StoreVar($var, $val);
}
function StorePersistentVar($var, $val)
{
$this->Session->StorePersistentVar($var, $val);
}
function StoreVarDefault($var, $val)
{
$session =& $this->recallObject('Session');
$this->Session->StoreVarDefault($var, $val);
}
/**
* Links HTTP Query variable with session variable
*
* If variable $var is passed in HTTP Query it is stored in session for later use. If it's not passed it's recalled from session.
* This method could be used for making sure that GetVar will return query or session value for given
* variable, when query variable should overwrite session (and be stored there for later use).<br>
* This could be used for passing item's ID into popup with multiple tab -
* in popup script you just need to call LinkVar('id', 'current_id') before first use of GetVar('id').
* After that you can be sure that GetVar('id') will return passed id or id passed earlier and stored in session
* @access public
* @param string $var HTTP Query (GPC) variable name
* @param mixed $ses_var Session variable name
* @param mixed $default Default variable value
*/
function LinkVar($var, $ses_var = null, $default = '')
{
if (!isset($ses_var)) $ses_var = $var;
if ($this->GetVar($var) !== false) {
$this->StoreVar($ses_var, $this->GetVar($var));
}
else {
$this->SetVar($var, $this->RecallVar($ses_var, $default));
}
}
/**
* Returns variable from HTTP Query, or from session if not passed in HTTP Query
*
* The same as LinkVar, but also returns the variable value taken from HTTP Query if passed, or from session if not passed.
* Returns the default value if variable does not exist in session and was not passed in HTTP Query
*
* @see LinkVar
* @access public
* @param string $var HTTP Query (GPC) variable name
* @param mixed $ses_var Session variable name
* @param mixed $default Default variable value
* @return mixed
*/
function GetLinkedVar($var, $ses_var = null, $default = '')
{
$this->LinkVar($var, $ses_var, $default);
return $this->GetVar($var);
}
function AddBlock($name, $tpl)
{
$this->cache[$name] = $tpl;
}
/* Seems to be not used anywhere... /Kostja
function SetTemplateBody($title,$body)
{
$templates_cache =& $this->recallObject('TemplatesCache');
$templates_cache->SetTemplateBody($title,$body);
}*/
function ProcessTag($tag_data)
{
$a_tag = new Tag($tag_data,$this->Parser);
return $a_tag->DoProcessTag();
}
function ProcessParsedTag($prefix, $tag, $params)
{
$a_tag = new Tag('',$this->Parser);
$a_tag->Tag = $tag;
$tmp=$this->Application->processPrefix($prefix);
$a_tag->Processor = $tmp['prefix'];
$a_tag->Special = $tmp['special'];
$a_tag->NamedParams = $params;
return $a_tag->DoProcessTag();
}
/**
* Return ADODB Connection object
*
* Returns ADODB Connection object already connected to the project database, configurable in config.php
* @access public
* @return kDBConnection
*/
function &GetADODBConnection()
{
return $this->Conn;
}
function ParseBlock($params,$pass_params=0,$as_template=false)
{
if (substr($params['name'], 0, 5) == 'html:') return substr($params['name'], 6);
return $this->Parser->ParseBlock($params, $pass_params, $as_template);
}
/**
* Returns index file, that could be passed as parameter to method, as parameter to tag and as constant or not passed at all
*
* @param string $prefix
* @param string $index_file
* @param Array $params
* @return string
*/
function getIndexFile($prefix, $index_file, &$params)
{
if (isset($params['index_file'])) {
$index_file = $params['index_file'];
unset($params['index_file']);
return $index_file;
}
if (isset($index_file)) {
return $index_file;
}
if (defined('INDEX_FILE')) {
return INDEX_FILE;
}
$cut_prefix = trim(BASE_PATH, '/').'/'.trim($prefix, '/');
return trim(preg_replace('/'.preg_quote($cut_prefix, '/').'(.*)/', '\\1', $_SERVER['PHP_SELF']), '/');
}
/**
* Return href for template
*
* @access public
* @param string $t Template path
* @var string $prefix index.php prefix - could be blank, 'admin'
*/
function HREF($t, $prefix='', $params=null, $index_file=null)
{
if(!$t) $t = $this->GetVar('t'); // moved from kMainTagProcessor->T()
if ($this->isModuleEnabled('Proj-CMS')) {
$t = preg_replace('/^Content\//', '', $t);
}
/*if ($this->GetVar('skip_last_template')) {
$params['opener'] = 'p';
$this->SetVar('m_opener', 'p');
}
if ($t == 'incs/close_popup') {
// because this template closes the popup and we don't need popup mark here anymore
$params['m_opener'] = 's';
}*/
if( substr($t, -4) == '.tpl' ) $t = substr($t, 0, strlen($t) - 4 );
if ( $this->IsAdmin() && $prefix == '') $prefix = '/admin';
if ( $this->IsAdmin() && $prefix == '_FRONT_END_') $prefix = '';
$index_file = $this->getIndexFile($prefix, $index_file, $params);
if (isset($params['_auto_prefix_'])) {
unset($params['_auto_prefix_']); // this is parser-related param, do not need to pass it here
}
$ssl = isset($params['__SSL__']) ? $params['__SSL__'] : null;
if ($ssl !== null) {
$session =& $this->recallObject('Session');
$cookie_url = trim($session->CookieDomain.$session->CookiePath, '/.');
if ($ssl) {
$target_url = $this->ConfigValue('SSL_URL');
}
else {
$target_url = 'http://'.DOMAIN.$this->ConfigValue('Site_Path');
}
if (!preg_match('#'.preg_quote($cookie_url).'#', $target_url)) {
$session->SetMode(smGET_ONLY);
}
}
if (getArrayValue($params, 'opener') == 'u') {
$wid = $this->Application->GetVar('m_wid');
$stack_name = rtrim('opener_stack_'.$wid, '_');
$opener_stack = $this->RecallVar($stack_name);
if ($opener_stack && $opener_stack != serialize(Array())) {
$opener_stack = unserialize($opener_stack);
list($index_file, $env) = explode('|', $opener_stack[count($opener_stack) - 1]);
$ret = $this->BaseURL($prefix, $ssl).$index_file.'?'.ENV_VAR_NAME.'='.$env;
if ( getArrayValue($params,'escape') ) $ret = addslashes($ret);
if (isset($params['m_opener']) && $params['m_opener'] == 'u') {
array_pop($opener_stack);
if (!$opener_stack) {
$this->RemoveVar($stack_name);
// remove popups last templates, because popup is closing now
$this->RemoveVar('last_template_'.$wid);
$this->RemoveVar('last_template_popup_'.$wid);
// don't save popups last templates again :)
$this->SetVar('skip_last_template', 1);
}
else {
$this->StoreVar($stack_name, serialize($opener_stack));
}
}
return $ret;
}
else {
//define('DBG_REDIRECT', 1);
$t = $this->GetVar('t');
}
}
$pass = isset($params['pass']) ? $params['pass'] : '';
$pass_events = isset($params['pass_events']) ? $params['pass_events'] : false; // pass events with url
$map_link = '';
if( isset($params['anchor']) )
{
$map_link = '#'.$params['anchor'];
unset($params['anchor']);
}
if ( isset($params['no_amp']) )
{
$params['__URLENCODE__'] = $params['no_amp'];
unset($params['no_amp']);
}
$no_rewrite = false;
if( isset($params['__NO_REWRITE__']) )
{
$no_rewrite = true;
unset($params['__NO_REWRITE__']);
}
$force_rewrite = false;
if( isset($params['__MOD_REWRITE__']) )
{
$force_rewrite = true;
unset($params['__MOD_REWRITE__']);
}
$force_no_sid = false;
if( isset($params['__NO_SID__']) )
{
$force_no_sid = true;
unset($params['__NO_SID__']);
}
// append pass through variables to each link to be build
$params = array_merge_recursive2($this->getPassThroughVariables($params), $params);
if ($force_rewrite || ($this->RewriteURLs($ssl) && !$no_rewrite))
{
$session =& $this->recallObject('Session');
if( $session->NeedQueryString() && !$force_no_sid ) $params['sid'] = $this->GetSID();
$url = $this->BuildEnv_NEW($t, $params, $pass, $pass_events);
$ret = $this->BaseURL($prefix, $ssl).$url.$map_link;
}
else
{
unset($params['pass_category']); // we don't need to pass it when mod_rewrite is off
$env = $this->BuildEnv($t, $params, $pass, $pass_events);
$ret = $this->BaseURL($prefix, $ssl).$index_file.'?'.$env.$map_link;
}
return $ret;
}
/**
* Returns variables with values that should be passed throught with this link + variable list
*
* @param Array $params
* @return Array
*/
function getPassThroughVariables(&$params)
{
static $cached_pass_through = null;
if (isset($params['no_pass_through']) && $params['no_pass_through']) {
unset($params['no_pass_through']);
return Array();
}
// because pass through is not changed during script run, then we can cache it
if (is_null($cached_pass_through)) {
$cached_pass_through = Array();
$pass_through = $this->Application->GetVar('pass_through');
if ($pass_through) {
// names of variables to pass to each link
$cached_pass_through['pass_through'] = $pass_through;
$pass_through = explode(',', $pass_through);
foreach ($pass_through as $pass_through_var) {
$cached_pass_through[$pass_through_var] = $this->Application->GetVar($pass_through_var);
}
}
}
return $cached_pass_through;
}
/**
* Returns sorted array of passed prefixes (to build url from)
*
* @param string $pass
* @return Array
*/
function getPassInfo($pass = 'all')
{
- $pass = trim(preg_replace('/(?<=,|\\A)all(?=,|\\z)/', trim($this->GetVar('passed'), ','), trim($pass, ',')), ',');
+ if (!$pass) $pass = 'all';
+ $pass = trim(
+ preg_replace(
+ '/(?<=,|\\A)all(?=,|\\z)/',
+ trim($this->GetVar('passed'), ','),
+ trim($pass, ',')
+ ),
+ ',');
if (!$pass) {
return Array();
}
$pass_info = array_unique( explode(',', $pass) ); // array( prefix[.special], prefix[.special] ...
sort($pass_info, SORT_STRING); // to be prefix1,prefix1.special1,prefix1.special2,prefix3.specialX
// ensure that "m" prefix is at the beginning
$main_index = array_search('m', $pass_info);
if ($main_index !== false) {
unset($pass_info[$main_index]);
array_unshift($pass_info, 'm');
}
return $pass_info;
}
function BuildEnv_NEW($t, $params, $pass='all', $pass_events = false)
{
// $session =& $this->recallObject('Session');
$force_admin = getArrayValue($params,'admin') || $this->GetVar('admin');
// if($force_admin) $sid = $this->GetSID();
$ret = '';
$env = '';
$encode = false;
if (isset($params['__URLENCODE__']))
{
$encode = $params['__URLENCODE__'];
unset($params['__URLENCODE__']);
}
if (isset($params['__SSL__'])) {
unset($params['__SSL__']);
}
$m_only = true;
$pass_info = $this->getPassInfo($pass);
if ($pass_info) {
if ($pass_info[0] == 'm') array_shift($pass_info);
$params['t'] = $t;
foreach($pass_info as $pass_index => $pass_element)
{
list($prefix) = explode('.', $pass_element);
$require_rewrite = $this->findModule('Var', $prefix) && $this->getUnitOption($prefix, 'CatalogItem');
if ($require_rewrite) {
// if next prefix is same as current, but with special => exclude current prefix from url
$next_prefix = getArrayValue($pass_info, $pass_index + 1);
if ($next_prefix) {
$next_prefix = substr($next_prefix, 0, strlen($prefix) + 1);
if ($prefix.'.' == $next_prefix) continue;
}
$a = $this->BuildModuleEnv_NEW($pass_element, $params, $pass_events);
if ($a) {
$ret .= '/'.$a;
$m_only = false;
}
}
else
{
$env .= ':'.$this->BuildModuleEnv($pass_element, $params, $pass_events);
}
}
if (!$m_only) $params['pass_category'] = 1;
$ret = $this->BuildModuleEnv_NEW('m', $params, $pass_events).$ret;
$cat_processed = isset($params['category_processed']) && $params['category_processed'];
if ($cat_processed) {
unset($params['category_processed']);
}
if (!$m_only || !$cat_processed || !defined('EXP_DIR_URLS')) {
$ret = trim($ret, '/').'.html';
}
else {
$ret .= '/';
}
// $ret = trim($ret, '/').'/';
if($env) $params[ENV_VAR_NAME] = ltrim($env, ':');
}
unset($params['pass'], $params['opener'], $params['m_event']);
if ($force_admin) $params['admin'] = 1;
if( getArrayValue($params,'escape') )
{
$ret = addslashes($ret);
unset($params['escape']);
}
$ret = str_replace('%2F', '/', urlencode($ret));
$params_str = '';
$join_string = $encode ? '&' : '&amp;';
foreach ($params as $param => $value)
{
$params_str .= $join_string.$param.'='.$value;
}
$ret .= preg_replace('/^'.$join_string.'(.*)/', '?\\1', $params_str);
if ($encode) {
$ret = str_replace('\\', '%5C', $ret);
}
return $ret;
}
function BuildModuleEnv_NEW($prefix_special, &$params, $pass_events = false)
{
$event_params = Array('pass_events' => $pass_events, 'url_params' => $params);
$event = new kEvent($prefix_special.':BuildEnv', $event_params);
$this->HandleEvent($event);
$params = $event->getEventParam('url_params'); // save back unprocessed parameters
$ret = '';
if ($event->getEventParam('env_string')) {
$ret = trim( $event->getEventParam('env_string'), '/');
}
return $ret;
}
/**
* Builds env part that corresponds prefix passed
*
* @param string $prefix_special item's prefix & [special]
* @param Array $params url params
* @param bool $pass_events
*/
function BuildModuleEnv($prefix_special, &$params, $pass_events = false)
{
list($prefix) = explode('.', $prefix_special);
$query_vars = $this->getUnitOption($prefix, 'QueryString');
//if pass events is off and event is not implicity passed
if( !$pass_events && !isset($params[$prefix_special.'_event']) ) {
$params[$prefix_special.'_event'] = ''; // remove event from url if requested
//otherwise it will use value from get_var
}
if(!$query_vars) return '';
$tmp_string = Array(0 => $prefix_special);
foreach($query_vars as $index => $var_name)
{
//if value passed in params use it, otherwise use current from application
$var_name = $prefix_special.'_'.$var_name;
$tmp_string[$index] = isset( $params[$var_name] ) ? $params[$var_name] : $this->GetVar($var_name);
if ( isset($params[$var_name]) ) unset( $params[$var_name] );
}
$escaped = array();
foreach ($tmp_string as $tmp_val) {
$escaped[] = str_replace(Array('-',':'), Array('\-','\:'), $tmp_val);
}
$ret = implode('-', $escaped);
if ($this->getUnitOption($prefix, 'PortalStyleEnv') == true)
{
$ret = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/','\\1\\2-\\3', $ret);
}
return $ret;
}
function BuildEnv($t, $params, $pass='all', $pass_events = false, $env_var = true)
{
$session =& $this->recallObject('Session');
$ssl = isset($params['__SSL__']) ? $params['__SSL__'] : 0;
$sid = $session->NeedQueryString() && !$this->RewriteURLs($ssl) ? $this->GetSID() : '';
// if (getArrayValue($params,'admin') == 1) $sid = $this->GetSID();
$ret = '';
if ($env_var) {
$ret = ENV_VAR_NAME.'=';
}
$ret .= $sid.(constOn('INPORTAL_ENV') ? '-' : ':');
$encode = false;
if (isset($params['__URLENCODE__'])) {
$encode = $params['__URLENCODE__'];
unset($params['__URLENCODE__']);
}
if (isset($params['__SSL__'])) {
unset($params['__SSL__']);
}
$env_string = '';
$category_id = isset($params['m_cat_id']) ? $params['m_cat_id'] : $this->GetVar('m_cat_id');
$item_id = 0;
$pass_info = $this->getPassInfo($pass);
if ($pass_info) {
if ($pass_info[0] == 'm') array_shift($pass_info);
foreach ($pass_info as $pass_element) {
list($prefix) = explode('.', $pass_element);
$require_rewrite = $this->findModule('Var', $prefix);
if ($require_rewrite) {
$item_id = isset($params[$pass_element.'_id']) ? $params[$pass_element.'_id'] : $this->GetVar($pass_element.'_id');
}
$env_string .= ':'.$this->BuildModuleEnv($pass_element, $params, $pass_events);
}
}
if (strtolower($t) == '__default__') {
// to put category & item templates into cache
$filename = $this->getFilename('c', $category_id);
if ($item_id) {
$mod_rw_helper =& $this->Application->recallObject('ModRewriteHelper');
$t = $mod_rw_helper->GetItemTemplate($category_id, $pass_element); // $pass_element should be the last processed element
// $t = $this->getCache('item_templates', $category_id);
}
elseif ($category_id) {
$t = $this->getCache('category_templates', $category_id);
}
else {
$t = 'index';
}
}
$ret .= $t.':'.$this->BuildModuleEnv('m', $params, $pass_events).$env_string;
unset($params['pass']);
unset($params['opener']);
unset($params['m_event']);
if ($this->GetVar('admin') && !isset($params['admin'])) {
$params['admin'] = 1;
}
if( getArrayValue($params,'escape') )
{
$ret = addslashes($ret);
unset($params['escape']);
}
$join_string = $encode ? '&' : '&amp;';
$params_str = '';
foreach ($params as $param => $value)
{
$params_str .= $join_string.$param.'='.$value;
}
$ret .= $params_str;
if ($encode) {
$ret = str_replace('\\', '%5C', $ret);
}
return $ret;
}
function BaseURL($prefix='', $ssl=null)
{
if ($ssl === null) {
return PROTOCOL.SERVER_NAME.(defined('PORT')?':'.PORT : '').rtrim(BASE_PATH, '/').$prefix.'/';
}
else {
if ($ssl) {
return rtrim( $this->ConfigValue('SSL_URL'), '/').$prefix.'/';
}
else {
return 'http://'.DOMAIN.(defined('PORT')?':'.PORT : '').rtrim( $this->ConfigValue('Site_Path'), '/').$prefix.'/';
}
}
}
function Redirect($t='', $params=null, $prefix='', $index_file=null)
{
$js_redirect = getArrayValue($params, 'js_redirect');
if (preg_match("/external:(.*)/", $t, $rets)) {
$location = $rets[1];
}
else {
if ($t == '' || $t === true) $t = $this->GetVar('t');
// pass prefixes and special from previous url
if( isset($params['js_redirect']) ) unset($params['js_redirect']);
if (!isset($params['pass'])) $params['pass'] = 'all';
if ($this->GetVar('ajax') == 'yes' && $t == $this->GetVar('t')) {
// redirects to the same template as current
$params['ajax'] = 'yes';
}
$params['__URLENCODE__'] = 1;
$location = $this->HREF($t, $prefix, $params, $index_file);
//echo " location : $location <br>";
}
$a_location = $location;
$location = "Location: $location";
if ($this->isDebugMode() && constOn('DBG_REDIRECT')) {
$this->Debugger->appendTrace();
echo "<b>Debug output above!!!</b> Proceed to redirect: <a href=\"$a_location\">$a_location</a><br>";
}
else {
if ($js_redirect) {
$this->SetVar('t', 'redirect');
$this->SetVar('redirect_to_js', addslashes($a_location) );
$this->SetVar('redirect_to', $a_location);
return true;
}
else {
if ($this->GetVar('ajax') == 'yes' && $t != $this->GetVar('t')) {
// redirection to other then current template during ajax request
echo '#redirect#'.$a_location;
}
elseif (headers_sent() != '') {
// some output occured -> redirect using javascript
echo '<script type="text/javascript">window.location.href = \''.$a_location.'\';</script>';
}
else {
// no output before -> redirect using HTTP header
// header('HTTP/1.1 302 Found');
header("$location");
}
}
}
ob_end_flush();
// session expiration is called from session initialization,
// that's why $this->Session may be not defined here
if (is_object($this->Session)) {
$this->Session->SaveData();
}
exit;
}
function Phrase($label)
{
return $this->Phrases->GetPhrase($label);
}
/**
* Replace language tags in exclamation marks found in text
*
* @param string $text
* @param bool $force_escape force escaping, not escaping of resulting string
* @return string
* @access public
*/
function ReplaceLanguageTags($text, $force_escape=null)
{
// !!!!!!!!
// if( !is_object($this->Phrases) ) $this->Debugger->appendTrace();
return $this->Phrases->ReplaceLanguageTags($text,$force_escape);
}
/**
* Checks if user is logged in, and creates
* user object if so. User object can be recalled
* later using "u.current" prefix_special. Also you may
* get user id by getting "u.current_id" variable.
*
* @access private
*/
function ValidateLogin()
{
$session =& $this->recallObject('Session');
$user_id = $session->GetField('PortalUserId');
if (!$user_id && $user_id != -1) $user_id = -2;
$this->SetVar('u.current_id', $user_id);
if (!$this->IsAdmin()) {
// needed for "profile edit", "registration" forms ON FRONT ONLY
- $this->SetVar('u_id', $user_id);
+ $this->SetVar('u_id', $user_id);
}
$this->StoreVar('user_id', $user_id);
if ($this->GetVar('expired') == 1) {
// this parameter is set only from admin
$user =& $this->recallObject('u.current');
$user->SetError('ValidateLogin', 'session_expired', 'la_text_sess_expired');
}
if (($user_id != -2) && constOn('DBG_REQUREST_LOG') ) {
$http_query =& $this->recallObject('HTTPQuery');
$http_query->writeRequestLog(DBG_REQUREST_LOG);
}
if ($user_id != -2) {
// normal users + root
$this->LoadPersistentVars();
}
}
/**
* Loads current user persistent session data
*
*/
function LoadPersistentVars()
{
$this->Session->LoadPersistentVars();
}
+
function LoadCache() {
$cache_key = $this->GetVar('t').$this->GetVar('m_theme').$this->GetVar('m_lang').$this->IsAdmin();
$query = sprintf("SELECT PhraseList, ConfigVariables FROM %s WHERE Template = %s",
TABLE_PREFIX.'PhraseCache',
$this->Conn->Qstr(md5($cache_key)));
$res = $this->Conn->GetRow($query);
if ($res) {
$this->Caches['PhraseList'] = $res['PhraseList'] ? explode(',', $res['PhraseList']) : array();
$config_ids = $res['ConfigVariables'] ? explode(',', $res['ConfigVariables']) : array();
$config_ids = array_diff($config_ids, $this->Caches['ConfigVariables']);
}
else {
$config_ids = array();
}
$this->Caches['ConfigVariables'] = $config_ids;
$this->ConfigCacheIds = $config_ids;
}
function UpdateCache()
{
$update = false;
//something changed
$update = $update || $this->Phrases->NeedsCacheUpdate();
$update = $update || (count($this->ConfigCacheIds) && $this->ConfigCacheIds != $this->Caches['ConfigVariables']);
if ($update) {
$cache_key = $this->GetVar('t').$this->GetVar('m_theme').$this->GetVar('m_lang').$this->IsAdmin();
$query = sprintf("REPLACE %s (PhraseList, CacheDate, Template, ConfigVariables)
VALUES (%s, %s, %s, %s)",
TABLE_PREFIX.'PhraseCache',
$this->Conn->Qstr(join(',', $this->Phrases->Ids)),
adodb_mktime(),
$this->Conn->Qstr(md5($cache_key)),
$this->Conn->qstr(implode(',', array_unique($this->ConfigCacheIds))));
$this->Conn->Query($query);
}
}
function InitConfig()
{
if (isset($this->Caches['ConfigVariables']) && count($this->Caches['ConfigVariables']) > 0) {
$this->ConfigHash = array_merge($this->ConfigHash, $this->Conn->GetCol(
'SELECT VariableValue, VariableName FROM '.TABLE_PREFIX.'ConfigurationValues
WHERE VariableId IN ('.implode(',', $this->Caches['ConfigVariables']).')', 'VariableName'));
}
}
/**
* Returns configuration option value by name
*
* @param string $name
* @return string
*/
function ConfigValue($name)
{
$res = isset($this->ConfigHash[$name]) ? $this->ConfigHash[$name] : false;
if ($res !== false) return $res;
$res = $this->Conn->GetRow('SELECT VariableId, VariableValue FROM '.TABLE_PREFIX.'ConfigurationValues WHERE VariableName = '.$this->Conn->qstr($name));
if ($res) {
$this->ConfigHash[$name] = $res['VariableValue'];
$this->ConfigCacheIds[] = $res['VariableId'];
return $res['VariableValue'];
}
return false;
}
function UpdateConfigCache()
{
if ($this->ConfigCacheIds) {
}
}
/**
* Allows to process any type of event
*
* @param kEvent $event
* @access public
* @author Alex
*/
function HandleEvent(&$event, $params=null, $specificParams=null)
{
if ( isset($params) ) {
$event = new kEvent( $params, $specificParams );
}
if (!isset($this->EventManager)) {
$this->EventManager =& $this->recallObject('EventManager');
}
$this->EventManager->HandleEvent($event);
}
/**
* Registers new class in the factory
*
* @param string $real_class Real name of class as in class declaration
* @param string $file Filename in what $real_class is declared
* @param string $pseudo_class Name under this class object will be accessed using getObject method
* @param Array $dependecies List of classes required for this class functioning
* @access public
* @author Alex
*/
function registerClass($real_class, $file, $pseudo_class = null, $dependecies = Array() )
{
$this->Factory->registerClass($real_class, $file, $pseudo_class, $dependecies);
}
/**
* Add $class_name to required classes list for $depended_class class.
* All required class files are included before $depended_class file is included
*
* @param string $depended_class
* @param string $class_name
* @author Alex
*/
function registerDependency($depended_class, $class_name)
{
$this->Factory->registerDependency($depended_class, $class_name);
}
/**
* Registers Hook from subprefix event to master prefix event
*
* @param string $hookto_prefix
* @param string $hookto_special
* @param string $hookto_event
* @param string $mode
* @param string $do_prefix
* @param string $do_special
* @param string $do_event
* @param string $conditional
* @access public
* @todo take care of a lot parameters passed
* @author Kostja
*/
function registerHook($hookto_prefix, $hookto_special, $hookto_event, $mode, $do_prefix, $do_special, $do_event, $conditional)
{
$event_manager =& $this->recallObject('EventManager');
$event_manager->registerHook($hookto_prefix, $hookto_special, $hookto_event, $mode, $do_prefix, $do_special, $do_event, $conditional);
}
/**
* Allows one TagProcessor tag act as other TagProcessor tag
*
* @param Array $tag_info
* @author Kostja
*/
function registerAggregateTag($tag_info)
{
$aggregator =& $this->recallObject('TagsAggregator', 'kArray');
$aggregator->SetArrayValue($tag_info['AggregateTo'], $tag_info['AggregatedTagName'], Array($tag_info['LocalPrefix'], $tag_info['LocalTagName'], getArrayValue($tag_info, 'LocalSpecial')));
}
/**
* Returns object using params specified,
* creates it if is required
*
* @param string $name
* @param string $pseudo_class
* @param Array $event_params
* @return Object
* @author Alex
*/
function &recallObject($name,$pseudo_class=null,$event_params=Array())
{
$result =& $this->Factory->getObject($name, $pseudo_class, $event_params);
return $result;
}
/**
* Returns object using Variable number of params,
* all params starting with 4th are passed to object consturctor
*
* @param string $name
* @param string $pseudo_class
* @param Array $event_params
* @return Object
* @author Alex
*/
function &recallObjectP($name,$pseudo_class=null,$event_params=Array())
{
$func_args = func_get_args();
$result =& ref_call_user_func_array( Array(&$this->Factory, 'getObjectP'), $func_args );
return $result;
}
/**
* Returns tag processor for prefix specified
*
* @param string $prefix
* @return kDBTagProcessor
*/
function &recallTagProcessor($prefix)
{
$result =& $this->recallObject($prefix.'_TagProcessor');
return $result;
}
/**
* Checks if object with prefix passes was already created in factory
*
* @param string $name object presudo_class, prefix
* @return bool
* @author Kostja
*/
function hasObject($name)
{
return isset($this->Factory->Storage[$name]);
}
/**
* Removes object from storage by given name
*
* @param string $name Object's name in the Storage
* @author Kostja
*/
function removeObject($name)
{
$this->Factory->DestroyObject($name);
}
/**
* Get's real class name for pseudo class,
* includes class file and creates class
* instance
*
* @param string $pseudo_class
* @return Object
* @access public
* @author Alex
*/
function &makeClass($pseudo_class)
{
$func_args = func_get_args();
$result =& ref_call_user_func_array( Array(&$this->Factory, 'makeClass'), $func_args);
return $result;
}
/**
* Checks if application is in debug mode
*
* @param bool $check_debugger check if kApplication debugger is initialized too, not only for defined DEBUG_MODE constant
* @return bool
* @author Alex
* @access public
*/
function isDebugMode($check_debugger = true)
{
$debug_mode = defined('DEBUG_MODE') && DEBUG_MODE;
if($check_debugger)
{
$debug_mode = $debug_mode && is_object($this->Debugger);
}
return $debug_mode;
}
/**
* Checks if it is admin
*
* @return bool
* @author Alex
*/
function IsAdmin()
{
return constOn('ADMIN');
}
/**
* Apply url rewriting used by mod_rewrite or not
*
* @param bool $ssl Force ssl link to be build
* @return bool
*/
function RewriteURLs($ssl = false)
{
// case #1,#4:
// we want to create https link from http mode
// we want to create https link from https mode
// conditions: ($ssl || PROTOCOL == 'https://') && $this->ConfigValue('UseModRewriteWithSSL')
// case #2,#3:
// we want to create http link from https mode
// we want to create http link from http mode
// conditions: !$ssl && (PROTOCOL == 'https://' || PROTOCOL == 'http://')
$allow_rewriting =
(!$ssl && (PROTOCOL == 'https://' || PROTOCOL == 'http://')) // always allow mod_rewrite for http
|| // or allow rewriting for redirect TO httpS or when already in httpS
(($ssl || PROTOCOL == 'https://') && $this->ConfigValue('UseModRewriteWithSSL')); // but only if it's allowed in config!
return constOn('MOD_REWRITE') && $allow_rewriting;
}
/**
* Reads unit (specified by $prefix)
* option specified by $option
*
* @param string $prefix
* @param string $option
* @param mixed $default
* @return string
* @access public
* @author Alex
*/
function getUnitOption($prefix, $option, $default = false)
{
/*if (!isset($this->UnitConfigReader)) {
$this->UnitConfigReader =& $this->recallObject('kUnitConfigReader');
}*/
return $this->UnitConfigReader->getUnitOption($prefix, $option, $default);
}
/**
* Set's new unit option value
*
* @param string $prefix
* @param string $name
* @param string $value
* @author Alex
* @access public
*/
function setUnitOption($prefix, $option, $value)
{
// $unit_config_reader =& $this->recallObject('kUnitConfigReader');
return $this->UnitConfigReader->setUnitOption($prefix,$option,$value);
}
/**
* Read all unit with $prefix options
*
* @param string $prefix
* @return Array
* @access public
* @author Alex
*/
function getUnitOptions($prefix)
{
// $unit_config_reader =& $this->recallObject('kUnitConfigReader');
return $this->UnitConfigReader->getUnitOptions($prefix);
}
/**
* Returns true if config exists and is allowed for reading
*
* @param string $prefix
* @return bool
*/
function prefixRegistred($prefix)
{
/*if (!isset($this->UnitConfigReader)) {
$this->UnitConfigReader =& $this->recallObject('kUnitConfigReader');
}*/
return $this->UnitConfigReader->prefixRegistred($prefix);
}
/**
* Splits any mixing of prefix and
* special into correct ones
*
* @param string $prefix_special
* @return Array
* @access public
* @author Alex
*/
function processPrefix($prefix_special)
{
return $this->Factory->processPrefix($prefix_special);
}
/**
* Set's new event for $prefix_special
* passed
*
* @param string $prefix_special
* @param string $event_name
* @access public
*/
function setEvent($prefix_special,$event_name)
{
$event_manager =& $this->recallObject('EventManager');
$event_manager->setEvent($prefix_special,$event_name);
}
/**
* SQL Error Handler
*
* @param int $code
* @param string $msg
* @param string $sql
* @return bool
* @access private
* @author Alex
*/
function handleSQLError($code, $msg, $sql)
{
if ( isset($this->Debugger) )
{
$errorLevel = constOn('DBG_SQL_FAILURE') && !defined('IS_INSTALL') ? E_USER_ERROR : E_USER_WARNING;
$this->Debugger->dumpVars($_REQUEST);
$this->Debugger->appendTrace();
$error_msg = '<span class="debug_error">'.$msg.' ('.$code.')</span><br><a href="javascript:$Debugger.SetClipboard(\''.htmlspecialchars($sql).'\');"><b>SQL</b></a>: '.$this->Debugger->formatSQL($sql);
$long_id = $this->Debugger->mapLongError($error_msg);
trigger_error( substr($msg.' ('.$code.') ['.$sql.']',0,1000).' #'.$long_id, $errorLevel);
return true;
}
else
{
//$errorLevel = constOn('IS_INSTALL') ? E_USER_WARNING : E_USER_ERROR;
$errorLevel = E_USER_WARNING;
trigger_error('<b>SQL Error</b> in sql: '.$sql.', code <b>'.$code.'</b> ('.$msg.')', $errorLevel);
/*echo '<b>xProcessing SQL</b>: '.$sql.'<br>';
echo '<b>Error ('.$code.'):</b> '.$msg.'<br>';*/
return $errorLevel == E_USER_ERROR ? false : true;
}
}
/**
* Default error handler
*
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
* @param Array $errcontext
*/
function handleError($errno, $errstr, $errfile = '', $errline = '', $errcontext = '')
{
if( constOn('SILENT_LOG') )
{
$fp = fopen(FULL_PATH.'/silent_log.txt','a');
$time = adodb_date('d/m/Y H:i:s');
fwrite($fp, '['.$time.'] #'.$errno.': '.strip_tags($errstr).' in ['.$errfile.'] on line '.$errline."\n");
fclose($fp);
}
if( !$this->errorHandlers ) return true;
$i = 0; // while (not foreach) because it is array of references in some cases
$eh_count = count($this->errorHandlers);
while($i < $eh_count)
{
if( is_array($this->errorHandlers[$i]) )
{
$object =& $this->errorHandlers[$i][0];
$method = $this->errorHandlers[$i][1];
$object->$method($errno, $errstr, $errfile, $errline, $errcontext);
}
else
{
$function = $this->errorHandlers[$i];
$function($errno, $errstr, $errfile, $errline, $errcontext);
}
$i++;
}
}
/**
* Returns & blocks next ResourceId available in system
*
* @return int
* @access public
* @author Alex
*/
function NextResourceId()
{
$table_name = TABLE_PREFIX.'IdGenerator';
$this->Conn->Query('LOCK TABLES '.$table_name.' WRITE');
$this->Conn->Query('UPDATE '.$table_name.' SET lastid = lastid + 1');
$id = $this->Conn->GetOne('SELECT lastid FROM '.$table_name);
if($id === false)
{
$this->Conn->Query('INSERT INTO '.$table_name.' (lastid) VALUES (2)');
$id = 2;
}
$this->Conn->Query('UNLOCK TABLES');
return $id - 1;
}
/**
* Returns genealogical main prefix for subtable prefix passes
* OR prefix, that has been found in REQUEST and some how is parent of passed subtable prefix
*
* @param string $current_prefix
* @param string $real_top if set to true will return real topmost prefix, regardless of its id is passed or not
* @return string
* @access public
* @author Kostja / Alex
*/
function GetTopmostPrefix($current_prefix, $real_top=false)
{
// 1. get genealogical tree of $current_prefix
$prefixes = Array ($current_prefix);
while ( $parent_prefix = $this->getUnitOption($current_prefix, 'ParentPrefix') ) {
$current_prefix = $parent_prefix;
array_unshift($prefixes, $current_prefix);
}
if ($real_top) return $current_prefix;
// 2. find what if parent is passed
- $passed = explode(',', $this->GetVar('passed'));
- foreach ($prefixes as $current_prefix) {
- if (in_array($current_prefix, $passed)) {
- break;
+ $passed = explode(',', $this->GetVar('all_passed'));
+ foreach ($prefixes as $a_prefix) {
+ if (in_array($a_prefix, $passed)) {
+ return $a_prefix;
}
}
return $current_prefix;
}
/**
* Triggers email event of type Admin
*
* @param string $email_event_name
* @param int $to_user_id
* @param array $send_params associative array of direct send params, possible keys: to_email, to_name, from_email, from_name, message, message_text
* @return unknown
*/
function &EmailEventAdmin($email_event_name, $to_user_id = -1, $send_params = false)
{
return $this->EmailEvent($email_event_name, 1, $to_user_id, $send_params);
}
/**
* Triggers email event of type User
*
* @param string $email_event_name
* @param int $to_user_id
* @param array $send_params associative array of direct send params, possible keys: to_email, to_name, from_email, from_name, message, message_text
* @return unknown
*/
function &EmailEventUser($email_event_name, $to_user_id = -1, $send_params = false)
{
return $this->EmailEvent($email_event_name, 0, $to_user_id, $send_params);
}
/**
* Triggers general email event
*
* @param string $email_event_name
* @param int $email_event_type ( 0 for User, 1 for Admin)
* @param int $to_user_id
* @param array $send_params associative array of direct send params,
* possible keys: to_email, to_name, from_email, from_name, message, message_text
* @return unknown
*/
function &EmailEvent($email_event_name, $email_event_type, $to_user_id = -1, $send_params = false)
{
$params = array(
'EmailEventName' => $email_event_name,
'EmailEventToUserId' => $to_user_id,
'EmailEventType' => $email_event_type,
);
if ($send_params) {
$params['DirectSendParams'] = $send_params;
}
$event_str = isset($send_params['use_special']) ? 'emailevents.'.$send_params['use_special'].':OnEmailEvent' : 'emailevents:OnEmailEvent';
$this->HandleEvent($event, $event_str, $params);
return $event;
}
function LoggedIn()
{
$user_id = $this->Application->RecallVar('user_id');
$ret = $user_id > 0;
if ($this->IsAdmin() && ($user_id == -1)) {
$ret = true;
}
return $ret;
}
/**
* Check current user permissions based on it's group permissions in specified category
*
* @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)
{
$perm_helper =& $this->recallObject('PermissionsHelper');
return $perm_helper->CheckPermission($name, $type, $cat_id);
}
/**
* Set's any field of current visit
*
* @param string $field
* @param mixed $value
*/
function setVisitField($field, $value)
{
$visit =& $this->recallObject('visits');
$visit->SetDBField($field, $value);
$visit->Update();
}
/**
* Allows to check if in-portal is installed
*
* @return bool
*/
function isInstalled()
{
return $this->InitDone && (count($this->ModuleInfo) > 0);
}
/**
* Allows to determine if module is installed & enabled
*
* @param string $module_name
* @return bool
*/
function isModuleEnabled($module_name)
{
return $this->findModule('Name', $module_name) !== false;
}
function reportError($class, $method)
{
$this->Debugger->appendTrace();
trigger_error('depricated method <b>'.$class.'->'.$method.'(...)</b>', E_USER_ERROR);
}
/**
* Returns Window ID of passed prefix main prefix (in edit mode)
*
* @param string $prefix
* @return mixed
*/
function GetTopmostWid($prefix)
{
$top_prefix = $this->GetTopmostPrefix($prefix);
$mode = $this->GetVar($top_prefix.'_mode');
return $mode != '' ? substr($mode, 1) : '';
}
/**
* Get temp table name
*
* @param string $table
* @param mixed $wid
* @return string
*/
function GetTempName($table, $wid = '')
{
if (preg_match('/prefix:(.*)/', $wid, $regs)) {
$wid = $this->GetTopmostWid($regs[1]);
}
return TABLE_PREFIX.'ses_'.$this->GetSID().($wid ? '_'.$wid : '').'_edit_'.$table;
}
function GetTempTablePrefix($wid = '')
{
if (preg_match('/prefix:(.*)/', $wid, $regs)) {
$wid = $this->GetTopmostWid($regs[1]);
}
return TABLE_PREFIX.'ses_'.$this->GetSID().($wid ? '_'.$wid : '').'_edit_';
}
function IsTempTable($table)
{
return preg_match('/'.TABLE_PREFIX.'ses_'.$this->GetSID().'(_[\d]+){0,1}_edit_(.*)/',$table);
}
/**
* Return live table name based on temp table name
*
* @param string $temp_table
* @return string
*/
function GetLiveName($temp_table)
{
if( preg_match('/'.TABLE_PREFIX.'ses_'.$this->GetSID().'(_[\d]+){0,1}_edit_(.*)/',$temp_table, $rets) )
{
// cut wid from table end if any
return $rets[2];
}
else
{
return $temp_table;
}
}
function CheckProcessors($processors)
{
foreach ($processors as $a_processor)
{
if (!isset($this->CachedProcessors[$a_processor])) {
$this->CachedProcessors[$a_processor] =& $this->recallObject($a_processor.'_TagProcessor');
}
}
}
function TimeZoneAdjustment($time_zone=null)
{
$target_zone = isset($time_zone) ? $time_zone : $this->ConfigValue('Config_Site_Time');
return 3600 * ($target_zone - $this->ConfigValue('Config_Server_Time'));
}
function ApplicationDie($message = '')
{
$message = ob_get_clean().$message;
if ($this->isDebugMode()) {
$message .= $this->Debugger->printReport(true);
}
echo $this->UseOutputCompression() ? gzencode($message, DBG_COMPRESSION_LEVEL) : $message;
exit;
}
/* moved from MyApplication */
function getUserGroups($user_id)
{
switch($user_id)
{
case -1:
$user_groups = $this->ConfigValue('User_LoggedInGroup');
break;
case -2:
$user_groups = $this->ConfigValue('User_LoggedInGroup');
$user_groups .= ','.$this->ConfigValue('User_GuestGroup');
break;
default:
$sql = 'SELECT GroupId FROM '.TABLE_PREFIX.'UserGroup WHERE PortalUserId = '.$user_id;
$res = $this->Conn->GetCol($sql);
$user_groups = Array( $this->ConfigValue('User_LoggedInGroup') );
if(is_array($res))
{
$user_groups = array_merge($user_groups, $res);
}
$user_groups = implode(',', $user_groups);
}
return $user_groups;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/application.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.169
\ No newline at end of property
+1.170
\ No newline at end of property
Index: trunk/core/kernel/globals.php
===================================================================
--- trunk/core/kernel/globals.php (revision 7634)
+++ trunk/core/kernel/globals.php (revision 7635)
@@ -1,489 +1,491 @@
<?php
if( !function_exists('array_merge_recursive2') )
{
/**
* array_merge_recursive2()
*
* Similar to array_merge_recursive but keyed-valued are always overwritten.
* Priority goes to the 2nd array.
*
* @static yes
* @param $paArray1 array
* @param $paArray2 array
* @return array
* @access public
*/
function array_merge_recursive2($paArray1, $paArray2)
{
if (!is_array($paArray1) or !is_array($paArray2)) { return $paArray2; }
foreach ($paArray2 AS $sKey2 => $sValue2)
{
$paArray1[$sKey2] = isset($paArray1[$sKey2]) ? array_merge_recursive2($paArray1[$sKey2], $sValue2) : $sValue2;
// $paArray1[$sKey2] = array_merge_recursive2( getArrayValue($paArray1,$sKey2), $sValue2);
}
return $paArray1;
}
}
/**
* @return int
* @param $array array
* @param $value mixed
* @desc Prepend a reference to an element to the beginning of an array. Renumbers numeric keys, so $value is always inserted to $array[0]
*/
function array_unshift_ref(&$array, &$value)
{
$return = array_unshift($array,'');
$array[0] =& $value;
return $return;
}
/**
* Same as print_r, budet designed for viewing in web page
*
* @param Array $data
* @param string $label
*/
function print_pre($data, $label='')
{
$is_debug = false;
if (class_exists('kApplication')) {
$application =& kApplication::Instance();
$is_debug = $application->isDebugMode();
}
if ($is_debug) {
if ($label) $application->Debugger->appendHTML('<b>'.$label.'</b>');
$application->Debugger->dumpVars($data);
}
else
{
if ($label) echo '<b>', $label, '</b><br>';
echo '<pre>', print_r($data, true), '</pre>';
}
}
/**
* Returns array value if key exists
*
* @param Array $array searchable array
* @param int $key array key
* @return string
* @access public
*/
//
function getArrayValue(&$array, $key)
{
$ret = isset($array[$key]) ? $array[$key] : false;
if ($ret && func_num_args() > 2) {
for ($i = 2; $i < func_num_args(); $i++) {
$cur_key = func_get_arg($i);
$ret = getArrayValue( $ret, $cur_key );
if ($ret === false) break;
}
}
return $ret;
}
/**
* Rename key in associative array, maintaining keys order
*
* @param Array $array Associative Array
* @param mixed $old Old key name
* @param mixed $new New key name
* @access public
*/
function array_rename_key(&$array, $old, $new)
{
foreach ($array as $key => $val)
{
$new_array[ $key == $old ? $new : $key] = $val;
}
$array = $new_array;
}
/**
* Define constant if it was not already defined before
*
* @param string $const_name
* @param string $const_value
* @access public
*/
function safeDefine($const_name, $const_value)
{
if(!defined($const_name)) define($const_name,$const_value);
}
if( !function_exists('parse_portal_ini') )
{
function parse_portal_ini($file, $parse_section = false)
{
if (!file_exists($file)) return false;
if( file_exists($file) && !is_readable($file) ) die('Could Not Open Ini File');
$contents = file($file);
$retval = Array();
$section = '';
$ln = 1;
$resave = false;
foreach($contents as $line) {
if ($ln == 1 && $line != '<'.'?'.'php die() ?'.">\n") {
$resave = true;
}
$ln++;
$line = trim($line);
$line = eregi_replace(';[.]*','',$line);
if(strlen($line) > 0) {
//echo $line . " - ";
if(eregi('^[[a-z]+]$',str_replace(' ', '', $line))) {
//echo 'section';
$section = substr($line,1,(strlen($line)-2));
if ($parse_section) {
$retval[$section] = array();
}
continue;
} elseif(eregi('=',$line)) {
//echo 'main element';
list($key,$val) = explode(' = ',$line);
if (!$parse_section) {
$retval[trim($key)] = str_replace('"', '', $val);
}
else {
$retval[$section][trim($key)] = str_replace('"', '', $val);
}
} //end if
//echo '<br />';
} //end if
} //end foreach
if($resave)
{
$fp = fopen($file, 'w');
reset($contents);
fwrite($fp,'<'.'?'.'php die() ?'.">\n\n");
foreach($contents as $line) fwrite($fp,"$line");
fclose($fp);
}
return $retval;
}
}
if( !function_exists('getmicrotime') )
{
function getmicrotime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
}
if( !function_exists('k4_include_once') )
{
function k4_include_once($file)
{
global $debugger;
if ( defined('DEBUG_MODE') && DEBUG_MODE && isset($debugger) && constOn('DBG_PROFILE_INCLUDES') )
{
if ( in_array($file, get_required_files()) ) return;
global $debugger;
/* $debugger->IncludeLevel++;
$before_mem = memory_get_usage();
*/
$debugger->ProfileStart('inc_'.crc32($file), $file);
include_once($file);
$debugger->ProfileFinish('inc_'.crc32($file));
$debugger->profilerAddTotal('includes', 'inc_'.crc32($file));
/* $used_mem = memory_get_usage() - $before_mem;
$debugger->IncludeLevel--;
$debugger->IncludesData['file'][] = str_replace(FULL_PATH, '', $file);
$debugger->IncludesData['mem'][] = $used_mem;
$debugger->IncludesData['time'][] = $used_time;
$debugger->IncludesData['level'][] = $debugger->IncludeLevel;
*/
}
else
{
include_once($file);
}
}
}
/**
* Checks if string passed is serialized array
*
* @param string $string
* @return bool
*/
function IsSerialized($string)
{
if( is_array($string) ) return false;
return preg_match('/a:([\d]+):{/', $string);
}
if (!function_exists('makepassword4')){
function makepassword4($length=10)
{
$pass_length=$length;
$p1=array('b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z');
$p2=array('a','e','i','o','u');
$p3=array('1','2','3','4','5','6','7','8','9');
$p4=array('(','&',')',';','%'); // if you need real strong stuff
// how much elements in the array
// can be done with a array count but counting once here is faster
$s1=21;// this is the count of $p1
$s2=5; // this is the count of $p2
$s3=9; // this is the count of $p3
$s4=5; // this is the count of $p4
// possible readable combinations
$c1='121'; // will be like 'bab'
$c2='212'; // will be like 'aba'
$c3='12'; // will be like 'ab'
$c4='3'; // will be just a number '1 to 9' if you dont like number delete the 3
// $c5='4'; // uncomment to active the strong stuff
$comb='4'; // the amount of combinations you made above (and did not comment out)
for ($p=0;$p<$pass_length;)
{
mt_srand((double)microtime()*1000000);
$strpart=mt_rand(1,$comb);
// checking if the stringpart is not the same as the previous one
if($strpart<>$previous)
{
$pass_structure.=${'c'.$strpart};
// shortcutting the loop a bit
$p=$p+strlen(${'c'.$strpart});
}
$previous=$strpart;
}
// generating the password from the structure defined in $pass_structure
for ($g=0;$g<strlen($pass_structure);$g++)
{
mt_srand((double)microtime()*1000000);
$sel=substr($pass_structure,$g,1);
$pass.=${'p'.$sel}[mt_rand(0,-1+${'s'.$sel})];
}
return $pass;
}
}
if( !function_exists('unhtmlentities') )
{
function unhtmlentities($string)
{
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
return strtr($string, $trans_tbl);
}
}
if( !function_exists('curl_post') )
{
/**
* submits $url with $post as POST
*
* @param string $url
* @param unknown_type $post
* @return unknown
*/
function curl_post($url, $post, $headers=null, $request_type = 'POST')
{
if( is_array($post) )
{
$params_str = '';
foreach($post as $key => $value) $params_str .= $key.'='.urlencode($value).'&';
$post = $params_str;
}
$ch = curl_init($url);
$dbg = false;
if (defined('DEBUG_MODE') && DEBUG_MODE && constOn('DBG_CURL')) {
$dbg = true;
safeDefine('DBG_CURL_LOGFILE', '/curl.log');
$log = fopen(FULL_PATH.DBG_CURL_LOGFILE, 'a');
curl_setopt($ch, CURLOPT_FILE, $log);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_STDERR, $log);
//curl_setopt($ch, CURLOPT_WRITEHEADER, $log);
}
if (!is_null($headers)) {
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
}
// if we have post data, then POST else use GET method instead
if ($request_type == 'POST') {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_REFERER, PROTOCOL.SERVER_NAME);
curl_setopt($ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
$ret = curl_exec($ch);
+ $GLOBALS['curl_errorno'] = curl_errno($ch);
+ $GLOBALS['curl_error'] = curl_error($ch);
curl_close($ch);
if ($dbg) {
fwrite($log, "\n".$ret);
fclose($log);
}
return $ret;
}
}
if( !function_exists('memory_get_usage') )
{
function memory_get_usage(){ return -1; }
}
function &ref_call_user_func_array($callable, $args)
{
if( is_scalar($callable) )
{
// $callable is the name of a function
$call = $callable;
}
else
{
if( is_object($callable[0]) )
{
// $callable is an object and a method name
$call = "\$callable[0]->{$callable[1]}";
}
else
{
// $callable is a class name and a static method
$call = "{$callable[0]}::{$callable[1]}";
}
}
// Note because the keys in $args might be strings
// we do this in a slightly round about way.
$argumentString = Array();
$argumentKeys = array_keys($args);
foreach($argumentKeys as $argK)
{
$argumentString[] = "\$args[$argumentKeys[$argK]]";
}
$argumentString = implode($argumentString, ', ');
// Note also that eval doesn't return references, so we
// work around it in this way...
eval("\$result =& {$call}({$argumentString});");
return $result;
}
/**
* Checks if constant is defined and has positive value
*
* @param string $const_name
* @return bool
*/
function constOn($const_name)
{
return defined($const_name) && constant($const_name);
}
function Kg2Pounds($kg)
{
$major = floor( round($kg / POUND_TO_KG, 3) );
$minor = abs(round(($kg - $major * POUND_TO_KG) / POUND_TO_KG * 16, 2));
return array($major, $minor);
}
function Pounds2Kg($pounds, $ounces=0)
{
return round(($pounds + ($ounces / 16)) * POUND_TO_KG, 5);
}
/**
* Formats file/memory size in nice way
*
* @param int $bytes
* @return string
* @access public
*/
function formatSize($bytes)
{
if ($bytes >= 1099511627776) {
$return = round($bytes / 1024 / 1024 / 1024 / 1024, 2);
$suffix = "TB";
} elseif ($bytes >= 1073741824) {
$return = round($bytes / 1024 / 1024 / 1024, 2);
$suffix = "GB";
} elseif ($bytes >= 1048576) {
$return = round($bytes / 1024 / 1024, 2);
$suffix = "MB";
} elseif ($bytes >= 1024) {
$return = round($bytes / 1024, 2);
$suffix = "KB";
} else {
$return = $bytes;
$suffix = "Byte";
}
$return .= ' '.$suffix;
return $return;
}
/**
* Enter description here...
*
* @param resource $filePointer the file resource to write to
* @param Array $data the data to write out
* @param string $delimiter the field separator
* @param string $enclosure symbol to enclose field data to
* @param string $recordSeparator symbols to separate records with
*/
function fputcsv2($filePointer, $data, $delimiter = ',', $enclosure = '"', $recordSeparator = "\r\n")
{
foreach($data as $field_index => $field_value) {
// replaces an enclosure with two enclosures
$data[$field_index] = str_replace($enclosure, $enclosure.$enclosure, $field_value);
}
$line = $enclosure.implode($enclosure.$delimiter.$enclosure, $data).$enclosure.$recordSeparator;
fwrite($filePointer, $line);
}
/**
* Allows to replace #section# within any string with current section
*
* @param string $string
* @return string
*/
function replaceModuleSection($string)
{
$application =& kApplication::Instance();
$module_section = $application->RecallVar('section');
if ($module_section) {
// substitute section instead of #section# parameter in title preset name
$module_section = explode(':', $module_section);
$section = preg_replace('/(configuration|configure)_(.*)/i', '\\2', $module_section[count($module_section) == 2 ? 1 : 0]);
$string = str_replace('#section#', strtolower($section), $string);
}
return $string;
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/globals.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.32
\ No newline at end of property
+1.33
\ No newline at end of property
Index: trunk/core/kernel/kbase.php
===================================================================
--- trunk/core/kernel/kbase.php (revision 7634)
+++ trunk/core/kernel/kbase.php (revision 7635)
@@ -1,638 +1,641 @@
<?php
/**
* Base
*
* Desciption
* @package kernel4
*/
class kBase {
/**
* Holds reference to global KernelApplication instance
* @access public
* @var kApplication
*/
var $Application;
/**
* Prefix, that was used
* to create an object
*
* @var string
* @access public
*/
var $Prefix='';
/**
* Special, that was used
* to create an object
*
* @var string
* @access public
*/
var $Special='';
var $OriginalParams;
/**
* Set's application
*
* @return kBase
* @access public
*/
function kBase()
{
$this->Application =& kApplication::Instance();
}
/**
* Create new instance of object
*
* @return kBase
*/
function &makeClass()
{
- $object = new kBase();
+ $object = new kBase();
return $object;
}
/**
* Set's prefix and special
*
* @param string $prefix
* @param string $special
* @access public
*/
function Init($prefix,$special,$event_params=null)
{
$prefix=explode('_',$prefix,2);
$this->Prefix=$prefix[0];
$this->Special=$special;
$this->OriginalParams = $event_params;
}
/**
* Returns joined prefix
* and special if any
*
* @param bool $from_submit if true, then joins prefix & special by "_", uses "." otherwise
* @return string
* @access protected
*/
function getPrefixSpecial($from_submit = false)
{
$separator = !$from_submit ? '.' : '_';
$ret = $this->Prefix.$separator.$this->Special;
return rtrim($ret, $separator);
}
function &getProperty($property_name)
{
return $this->$property_name;
}
function setProperty($property_name, &$property_value)
{
$this->$property_name =& $property_value;
}
}
class kHelper extends kBase {
/**
* Connection to database
*
* @var kDBConnection
* @access public
*/
var $Conn;
function kHelper()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
function InitHelper()
{
}
}
class kDBBase extends kBase {
/**
* Connection to database
*
* @var kDBConnection
* @access public
*/
var $Conn;
/**
* Description
*
* @var string Name of primary key field for the item
* @access public
*/
var $IDField;
/**
* Holds SELECT, FROM, JOIN parts of SELECT query
*
* @var string
* @access public
*/
var $SelectClause;
/**
* Fields allowed to be set (from table + virtual)
*
* @var Array
* @access private
*/
var $Fields = Array();
/**
* Holds custom field names for item
*
* @var Array
*/
var $customFields = Array();
/**
* All virtual field names
*
* @var Array
* @access private
*/
var $VirtualFields = Array();
/**
* Fields that need to be queried using custom expression, e.g. IF(...) AS value
*
* @var Array
* @access private
*/
var $CalculatedFields = Array();
/**
* Calculated fields, that contain aggregated functions, e.g. COUNT, SUM, etc.
*
* @var Array
*/
var $AggregatedCalculatedFields = Array();
/**
* Description
*
* @var string Item' database table name, without prefix
* @access public
*/
var $TableName;
/**
* Allows to determine object's table status ('temp' - temp table, '' - live table)
*
* @var string
* @access public
*/
var $mode='';
function kDBBase()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
/**
* Set current item' database table name
*
* @access public
* @param string $table_name
* @return void
*/
function setTableName($table_name)
{
$this->TableName = $table_name;
}
/**
* Set object' TableName to Live table from config
*
* @access public
*/
function SwitchToLive()
{
$this->TableName = $this->Application->getUnitOption($this->Prefix, 'TableName');
}
/**
* Set object' TableName to Temp table from config
*
* @access public
*/
function SwitchToTemp()
{
$this->TableName = $this->Application->getUnitOption($this->Prefix, 'TableName');
$this->SetTableName( $this->Application->GetTempName($this->TableName, 'prefix:'.$this->Prefix) );
$this->mode = 't';
}
/**
* Checks if object uses temp table
*
* @return bool
*/
function IsTempTable()
{
return $this->Application->IsTempTable($this->TableName);
}
/**
* Sets SELECT part of list' query
*
* @access public
* @param string $sql SELECT and FROM [JOIN] part of the query up to WHERE
* @return void
*/
function SetSelectSQL($sql)
{
$this->SelectClause = $sql;
}
function GetSelectSQL($base_query = null)
{
if (!isset($base_query)) {
$base_query = $this->SelectClause;
}
$query = str_replace( Array('%1$s','%s'), $this->TableName, $base_query);
$query = $this->replaceModePrefix($query);
return $query;
}
/**
* Returns required mixing of aggregated & non-aggregated calculated fields
*
* @param int $aggregated 0 - having + aggregated, 1 - having only, 2 - aggregated only
* @return Array
*/
function getCalculatedFields($aggregated = 0)
{
switch ($aggregated) {
case 0:
$fields = array_merge($this->CalculatedFields, $this->AggregatedCalculatedFields);
break;
case 1:
$fields = $this->CalculatedFields;
break;
case 2:
$fields = $this->AggregatedCalculatedFields;
break;
default:
$fields = Array();
break;
}
return $fields;
}
/**
* Insert calculated fields sql into query in place of %2$s,
* return processed query.
*
* @param string $query
* @param int $aggregated 0 - having + aggregated, 1 - having only, 2 - aggregated only
* @return string
*/
function addCalculatedFields($query, $aggregated = 1)
{
$fields = $this->getCalculatedFields($aggregated);
if ($fields) {
$sql = Array();
foreach ($fields as $field_name => $field_expression) {
- $sql[] = '('.$field_expression.') AS '.$field_name;
+ $sql[] = '('.$field_expression.') AS `'.$field_name.'`';
}
$sql = implode(',',$sql);
return $this->Application->ReplaceLanguageTags( str_replace('%2$s', ','.$sql, $query) );
}
else {
return str_replace('%2$s', '', $query);
}
}
/**
* Allows substables to be in same mode as main item (e.g. LEFT JOINED ones)
*
* @param string $query
* @return string
*/
function replaceModePrefix($query)
{
$live_table = substr($this->Application->GetLiveName($this->TableName), strlen(TABLE_PREFIX));
preg_match('/'.preg_quote(TABLE_PREFIX, '/').'(.*)'.preg_quote($live_table, '/').'/', $this->TableName, $rets);
return str_replace('%3$s', $rets[1], $query);
}
/**
* Adds calculated field declaration to object.
*
* @param string $name
* @param string $sql_clause
*/
function addCalculatedField($name, $sql_clause)
{
$this->CalculatedFields[$name] = $sql_clause;
}
/**
* Sets ID Field name used as primary key for loading items
*
* @access public
* @param string $field_name
* @return void
* @see kDBBase::IDField
*/
function setIDField($field_name)
{
$this->IDField = $field_name;
}
function Configure()
{
$this->setTableName( $this->Application->getUnitOption($this->Prefix, 'TableName') );
$this->setIDField( $this->Application->getUnitOption($this->Prefix, 'IDField') );
$this->defineFields();
$this->ApplyFieldModifiers(); // should be called only after all fields definitions been set
$this->prepareConfigOptions(); // this should go last, but before setDefaultValues, order is significant!
$this->SetDefaultValues();
}
/**
* Add field definitions from all possible sources (DB Fields, Virtual Fields, Calcualted Fields, e.t.c.)
*
*/
function defineFields()
{
$this->setConfigFields( $this->Application->getUnitOption($this->Prefix, 'Fields') );
$this->setCustomFields( $this->Application->getUnitOption($this->Prefix, 'CustomFields', Array()) );
$this->setVirtualFields( $this->Application->getUnitOption($this->Prefix, 'VirtualFields') );
$this->setCalculatedFields( $this->Application->getUnitOption($this->Prefix, 'CalculatedFields', Array()) );
$this->setAggragatedCalculatedFields( $this->Application->getUnitOption($this->Prefix, 'AggregatedCalculatedFields', Array()) );
}
function setCalculatedFields($fields)
{
$this->CalculatedFields = isset($fields[$this->Special]) ? $fields[$this->Special] : (isset($fields['']) ? $fields[''] : Array());
}
function setAggragatedCalculatedFields($fields)
{
$this->AggregatedCalculatedFields = isset($fields[$this->Special]) ? $fields[$this->Special] : (isset($fields['']) ? $fields[''] : Array());
}
/**
* Set's field names from table
* from config
*
* @param Array $fields
* @access public
*/
function setCustomFields($fields)
{
$this->customFields = $fields;
}
/**
* Set's field names from table
* from config
*
* @param Array $fields
* @access public
*/
function setConfigFields($fields)
{
$this->Fields = $fields;
}
/**
* Override field options with ones defined in submit via "field_modfiers" array (common for all prefixes)
*
* @access private
* @author Alex
*/
function ApplyFieldModifiers()
{
// $this->Application->APCalled[] = $this->getPrefixSpecial();
$allowed_modifiers = Array('required');
$field_modifiers = $this->Application->GetVar('field_modifiers');
if(!$field_modifiers) return false;
$field_modifiers = getArrayValue($field_modifiers, $this->getPrefixSpecial());
if(!$field_modifiers) return false;
foreach ($field_modifiers as $field => $field_options)
{
foreach ($field_options as $option_name => $option_value)
{
if ( !in_array(strtolower($option_name), $allowed_modifiers) ) continue;
$this->Fields[$field][$option_name] = $option_value;
}
}
}
/**
* Set fields (+options) for fields that physically doesn't exist in database
*
* @param Array $fields
* @access public
*/
function setVirtualFields($fields)
{
if($fields)
{
$this->VirtualFields = $fields;
$this->Fields = array_merge_recursive2($this->VirtualFields, $this->Fields);
}
}
function SetDefaultValues()
{
foreach($this->Fields as $field => $options)
{
if( isset($options['default']) && $options['default'] === '#NOW#')
{
$this->Fields[$field]['default'] = adodb_mktime();
}
}
}
function SetFieldOptions($field, $options)
{
$this->Fields[$field] = $options;
}
function GetFieldOptions($field)
{
if (isset($this->Fields[$field])) {
$this->PrepareFieldOptions($field);
return $this->Fields[$field];
}
else {
return Array();
}
}
/**
* Returns formatted field value
*
* @param string $field
* @return string
* @access public
*/
function GetField($name, $format=null)
{
$options = $this->GetFieldOptions($name);
$val = $this->GetDBField($name);
$res = $val;
if (isset($options['formatter'])) {
$formatter =& $this->Application->recallObject($options['formatter']);
$res = $formatter->Format($val, $name, $this, $format );
}
return $res;
}
function HasField($name)
{
}
function GetFieldValues()
{
}
- function UpdateFormattersSubFields()
+ function UpdateFormattersSubFields($fields=null)
{
- foreach ($this->Fields as $field => $options) {
- if (isset($options['formatter'])) {
- $formatter =& $this->Application->recallObject($options['formatter']);
- $formatter->UpdateSubFields($field, $this->GetDBField($field), $options, $this);
+ if (!is_array($fields)) {
+ $fields = array_keys($this->Fields);
+ }
+ foreach ($fields as $field) {
+ if ( isset($this->Fields[$field]['formatter']) ) {
+ $formatter =& $this->Application->recallObject($this->Fields[$field]['formatter']);
+ $formatter->UpdateSubFields($field, $this->GetDBField($field), $this->Fields[$field], $this);
}
}
}
function prepareConfigOptions()
{
foreach (array_keys($this->Fields) as $field_name)
{
// $this->PrepareFieldOptions($field_name);
$this->PrepareOptions($field_name);
}
}
function PrepareFieldOptions($field_name)
{
$field_options =& $this->Fields[$field_name];
if( isset($field_options['options_sql']) )
{
// replace with query result
$select_clause = '`'.$field_options['option_title_field'].'`,`'.$field_options['option_key_field'].'`';
$sql = sprintf($field_options['options_sql'], $select_clause, $this->Application->GetVar('m_lang'));
$options_hash = getArrayValue($field_options,'options');
if($options_hash === false) $options_hash = Array();
$dynamic_options = $this->Conn->GetCol($sql, $field_options['option_key_field']);
$field_options['options'] = array_merge_recursive2($options_hash, $dynamic_options);
unset($field_options['options_sql']);
}
}
function PrepareOptions($field_name)
{
if ( isset($this->Fields[$field_name]['formatter']) )
{
$formatter =& $this->Application->recallObject( $this->Fields[$field_name]['formatter'] );
$formatter->PrepareOptions($field_name, $this->Fields[$field_name], $this);
}
}
/**
* Returns unformatted field value
*
* @param string $field
* @return string
* @access public
*/
function GetDBField($field)
{
}
/**
* Returns ID of currently processed record
*
* @return int
* @access public
*/
function GetID()
{
return $this->GetDBField($this->IDField);
}
/**
* Allows kDBTagProcessor.SectionTitle to detect if it's editing or new item creation
*
* @return bool
*/
function IsNewItem()
{
return $this->GetID() ? false : true;
}
/**
* Returns parent table information
*
* @param bool $from_temp load parent item from temp table
* @param string $special special of main item
* @return Array
*/
function getLinkedInfo($special = '')
{
$parent_prefix = $this->Application->getUnitOption($this->Prefix, 'ParentPrefix');
if($parent_prefix)
{
// if this is linked table, then set id from main table
$table_info = Array(
'TableName' => $this->Application->getUnitOption($this->Prefix,'TableName'),
'IdField' => $this->Application->getUnitOption($this->Prefix,'IDField'),
'ForeignKey' => $this->Application->getUnitOption($this->Prefix,'ForeignKey'),
'ParentTableKey' => $this->Application->getUnitOption($this->Prefix,'ParentTableKey'),
'ParentPrefix' => $parent_prefix
);
if (is_array($table_info['ForeignKey'])) {
$table_info['ForeignKey'] = getArrayValue($table_info, 'ForeignKey', $parent_prefix);
}
if (is_array($table_info['ParentTableKey'])) {
$table_info['ParentTableKey'] = getArrayValue($table_info, 'ParentTableKey', $parent_prefix);
}
$main_object =& $this->Application->recallObject($parent_prefix.'.'.$special);
return array_merge($table_info, Array('ParentId'=> $main_object->GetDBField( $table_info['ParentTableKey'] ) ) );
}
return false;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/kbase.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.25
\ No newline at end of property
+1.26
\ No newline at end of property
Index: trunk/core/kernel/parser/template.php
===================================================================
--- trunk/core/kernel/parser/template.php (revision 7634)
+++ trunk/core/kernel/parser/template.php (revision 7635)
@@ -1,259 +1,259 @@
<?php
class Template {
var $Body = '';
var $BasePath = '';
var $Filename = '';
function Template($base_path=null, $filename=null, $silent=0)
{
if ($this->SetBasePath($base_path)) {
if (isset($filename)) {
$this->Filename = $filename;
$this->LoadTemplate($silent);
}
}
}
function SetBasePath($base_path=null)
{
if (isset($base_path)) {
$base_path = eregi_replace("/$", '', $base_path); //Cutting possible last slash
$this->BasePath = $base_path;
return true;
}
return false;
}
function GetFullPath()
{
return $this->BasePath.'/'.ltrim($this->Filename, '/').'.tpl';
}
/**
* Enter description here...
*
* @param int $silent template not found {0 - fatal error, 1 - warning, 2 - nothing}
* @return bool
*/
function LoadTemplate($silent = 0)
{
$filename = $this->GetFullPath();
if(file_exists($filename)) {
if (filesize ($filename) == 0) {
trigger_error("Template file size is 0: <b>$filename</b>", ($silent ? E_USER_NOTICE : E_USER_ERROR) );
}
$this->SetBody(file_get_contents($filename));
/*$handle = fopen ($filename, "r");
$contents = fread ($handle, filesize ($filename));
$this->SetBody($contents);
fclose ($handle);*/
return true;
}
else {
if ($silent != 2) {
$application =& kApplication::Instance();
if ($application->isDebugMode()) {
$application->Debugger->appendTrace();
}
trigger_error("File or block not found: <b>$filename</b> at ".$application->Parser->TemplateName, ($silent ? E_USER_NOTICE : E_USER_ERROR) );
}
return false;
}
}
function SetBody($body)
{
$this->Body = $body;
}
function GetBody()
{
return $this->Body;
}
}
class TemplatesCache extends kBase {
var $Templates = Array();
var $BasePath;
var $FileNames = Array();
function TemplatesCache()
{
parent::kBase();
$this->BasePath = FULL_PATH.THEMES_PATH;
$conn =& $this->Application->GetADODBConnection();
}
/**
* Based on template name gets it's location on disk and owner module
*
* @param string $filename
* @return Array 0 - path on disk, 1 - template name
*/
function GetTemplatePaths($filename)
{
- if (isset($this->Application->ReplacementTemplates[$filename])) {
+ if ($this->Application->IsAdmin() && isset($this->Application->ReplacementTemplates[$filename])) {
$filename = $this->Application->ReplacementTemplates[$filename];
}
if (preg_match('#^[\/]{0,1}([^\/]*)\/(.*)#', $filename, $regs)) {
$module_filename = $regs[2];
$first_dir = $regs[1];
}
else {
$first_dir = '';
$module_filename = $filename;
}
// !preg_match for backward compatability with full-path plugins
if ($this->Application->IsAdmin() && $first_dir == 'plugins' && !preg_match('/admin_templates/', $module_filename)) {
if (preg_match('#^[\/]{0,1}([^\/]*)\/(.*)#', $module_filename, $regs)) {;
$path = MODULES_PATH.'/'.strtolower($first_dir).'/'.$regs[1].'/admin_templates';
$module_filename = $regs[2];
}
else {
$first_dir = '';
$module_filename = $filename;
}
}
elseif ( $this->Application->IsAdmin() && $this->Application->findModule('Name', $first_dir)) {
if ($first_dir == 'in-portal') {
$first_dir = 'kernel';
}
$path = MODULES_PATH.'/'.strtolower($first_dir).'/admin_templates';
}
else {
$path = $this->BasePath;
$module_filename = $first_dir.'/'.$module_filename;
}
return Array ($path, $module_filename);
}
function LoadTemplate($filename, $title=NULL, $silent=0)
{
list ($path, $module_filename) = $this->GetTemplatePaths($filename);
$template =& new Template($path, $module_filename, $silent);
if (!isset($title)) $title = $filename;
$this->SetTemplate($title, $template);
}
function GetRealFilename($filename)
{
list ($path, $module_filename) = $this->GetTemplatePaths($filename);
return $path.'/'.trim($module_filename, '/');
}
function SetTemplate($title, &$template, $filename=null)
{
if (!isset($filename)) $filename=$title;
$this->Templates[$title] = $template;
$this->FileNames[$title] = $filename;
}
function &GetTemplate($title, $silent=0)
{
if (!isset($this->Templates[$title])) {
$this->LoadTemplate($title, null, $silent);
}
return $this->Templates[$title];
}
function GetTemplateBody($title, $silent=0)
{
$template =& $this->GetTemplate($title, $silent);
if ( !is_object($template) ) {
return '';
}
return $template->GetBody();
}
function GetTemplateFileName($title)
{
return getArrayValue($this->FileNames, $title);
}
function SetTemplateBody($title, $body)
{
$template =& new Template();
$template->SetBody($body);
$this->SetTemplate($title, $template);
}
function ParseTemplate($template_name)
{
$Parser =& new TemplateParser($this->Application);
return $Parser->Parse( $this->GetTemplateBody($template_name) );
}
function TemplateExists($filename)
{
$real_file = $this->GetRealFilename($filename);
if (!preg_match('/\.tpl$/', $real_file)) {
$real_file .= '.tpl';
}
return file_exists($real_file);
}
function GetPreParsed($template)
{
$real_name = $this->GetRealFilename($template);
$fname = $real_name.'.php';
$fname = str_replace(FULL_PATH, defined('WRITEABLE') ? WRITEABLE.'/cache' : FULL_PATH.'/kernel/cache', $fname);
$tname = $real_name.'.tpl';
if (defined('SAFE_MODE') && SAFE_MODE) {
$conn =& $this->Application->GetADODBConnection();
$cached = $conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'Cache WHERE VarName = "'.$fname.'"');
if ($cached !== false && $cached['Cached'] > filemtime($tname)) {
return array('active' => 1, 'fname' => $fname, 'tname' => $tname, 'mode' => 'db', 'content' => $cached['Data']);
}
}
else {
if (file_exists($fname) && file_exists($tname) && filemtime($fname) > filemtime($tname)) {
return array('active' => 1, 'fname' => $fname, 'tname' => $tname, 'mode' => 'file');
}
if (!file_exists($fname)) {
// make sure to create directory if pre-parsed file does not exist
$this->CheckDir(dirname($fname), defined('WRITEABLE') ? WRITEABLE.'/cache' : FULL_PATH.'/kernel/cache');
}
}
return array('active' => 0, 'fname' => $fname, 'tname' => $tname);
}
/**
* Recursive mkdir
*
* @param string $dir
* @param string $base_path base path to directory where folders should be created in
*/
function CheckDir($dir, $base_path = '')
{
if (file_exists($dir)) {
return;
}
else {
// remove $base_path from beggining because it is already created during install
$dir = preg_replace('/^'.preg_quote($base_path.'/', '/').'/', '', $dir, 1);
$segments = explode('/', $dir);
$cur_path = $base_path;
foreach ($segments as $segment) {
// do not add leading / for windows paths (c:\...)
$cur_path .= preg_match('/^[a-zA-Z]{1}:/', $segment) ? $segment : '/'.$segment;
if (!file_exists($cur_path)) {
mkdir($cur_path);
}
}
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/parser/template.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.19
\ No newline at end of property
+1.20
\ No newline at end of property
Index: trunk/core/kernel/parser/tags.php
===================================================================
--- trunk/core/kernel/parser/tags.php (revision 7634)
+++ trunk/core/kernel/parser/tags.php (revision 7635)
@@ -1,438 +1,442 @@
<?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);
if (isset($this->NamedParams['_ignore_missing_'])) {
if (!$this->Application->prefixRegistred($tmp['prefix'])) return '';
}
$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.' in '.$this->Prefix,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[] = 'if (!isset($'.$key.')) $application->Parser->SetParam(\''.$key.'\', \''.$val.'\');';
$code[] = '$'.$key.' = isset($'.$key.') ? $'.$key.' : \''.$val.'\';';
}
return $code;
case 'param':
- $code[] = '$o .= $params["'.$this->NP['name'].'"];';
+ $param_code = '$o .= $params["'.$this->NP['name'].'"]';
+ if (isset($this->NP['plus'])) {
+ $param_code .= ' + '.$this->NP['plus'];
+ }
+ $code[] = $param_code.';';
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 = '$PrefixSpecial';
// $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;
} */
if (isset($this->NamedParams['_auto_prefix_'])) {
$prefix = '$PrefixSpecial';
}
else {
// use original prefix_special found in templates (parameter names in form $ParamName found in it will not be replaced with values)
list ($prefix, $tag) = explode(':', $splited[0], 2); //$prefix = $this->getPrefixSpecial();
if (isset($this->NamedParams['_ignore_missing_'])) {
if (!$this->Application->prefixRegistred($prefix)) return array();
}
}
$code[] = '$tmp = $application->processPrefix("'.$prefix.'");'."\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 (isset($pass_params['result_to_var'])) {
$code[] = '$'.$pass_params['result_to_var'].' = $application->Parser->GetParam(\''.$pass_params['result_to_var'].'\');';
$echo = false;
}
if ($echo) $code[] = ' echo $o;'."\n";
return $code;
//return '$o .= \'tag:'. $this->Tag .'\'';
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/parser/tags.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.15
\ No newline at end of property
+1.16
\ No newline at end of property
Index: trunk/core/kernel/parser/template_parser.php
===================================================================
--- trunk/core/kernel/parser/template_parser.php (revision 7634)
+++ trunk/core/kernel/parser/template_parser.php (revision 7635)
@@ -1,689 +1,704 @@
<?php
k4_include_once(KERNEL_PATH.'/parser/tags.php');
k4_include_once(KERNEL_PATH.'/parser/construct_tags.php');
class TemplateParser extends kBase {
var $Template;
var $Output = '';
var $Position = 0;
var $LastPosition = 0;
var $Ses;
var $Recursion = Array();
var $RecursionIndex = 0;
var $SkipMode = 0;
var $Params = Array();
var $Pattern = Array();
var $ForSort = Array();
var $Values = Array();
var $Buffers = Array();
var $Args;
var $ParamsRecursionIndex = 0;
var $ParamsStack = Array();
var $CompiledBuffer;
var $DataExists = false;
function TemplateParser()
{
parent::kBase();
$this->Ses =& $this->Application->recallObject('Session');
}
function AddParam($pattern, $value, $dont_sort=0)
{
$this->ForSort[] = Array($pattern, $value);
if (!$dont_sort) //used when mass-adding params, to escape sorting after every new param
$this->SortParams(); //but do sort by default!
}
//We need to sort params by its name length desc, so that params starting with same word get parsed correctly
function SortParams()
{
uasort($this->ForSort, array ("TemplateParser", "CmpParams"));
// commented out by Kostja, otherwise when rednerElement is done into var (result_to_var) the other params are reset
// $this->Pattern = Array();
// $this->Values = Array();
foreach($this->ForSort as $pair)
{
$this->Pattern[] = $pair[0];
$this->Values[] = $pair[1];
}
}
function CmpParams($a, $b)
{
$a_len = strlen($a[0]);
$b_len = strlen($b[0]);
if ($a_len == $b_len) return 0;
return $a_len > $b_len ? -1 : 1;
}
function SetParams($params, $for_parsing=true)
{
if (!is_array($params)) $params = Array();
$this->ForSort = array();
$this->Params = $params;
$this->ParamsStack[$this->ParamsRecursionIndex] = $params;
if (!$for_parsing) return ;
foreach ($params as $key => $val) {
$this->AddParam('/[{]{0,1}\$'.$key.'[}]{0,1}/i', $val, 1); //Do not sort every time
}
$this->SortParams(); //Sort once after adding is done
}
/**
* Returns parser parameter value at specified deep level
*
* @param string $name
* @param int $deep_level if greather then 0 then use from ParamsStack
* @return mixed
*/
function GetParam($name, $deep_level = 0)
{
if ($deep_level > 0) {
return isset($this->ParamsStack[$deep_level][$name]) ? $this->ParamsStack[$deep_level][$name] : false;
}
return isset($this->Params[$name]) ? $this->Params[$name] : false;
}
/**
* Set's template parser parameter, that could be retrieved from template
*
* @param string $name
* @param mixed $value
*/
function SetParam($name, $value)
{
$this->Params[strtolower($name)] = $value;
$this->AddParam('/[{]{0,1}\$'.$name.'[}]{0,1}/i', $value, $this->FromPreParseCache);
}
function SetBuffer($body)
{
$this->Buffers[$this->RecursionIndex] = $body;
}
function GetBuffer()
{
return $this->Buffers[$this->RecursionIndex];
}
function GetCode()
{
return $this->Code[$this->RecursionIndex];
}
function AppendBuffer($append)
{
$this->Buffers[$this->RecursionIndex] .= $append;
$this->AppendCode( $this->ConvertToCode($append) );
}
function AppendOutput($append, $append_code=false)
{
if ($this->SkipMode == parse) {
$this->Output .= $append; //append to Ouput only if we are parsing
if ($append_code) $this->AppendCompiledHTML($append);
}
elseif ($this->SkipMode == skip) {
if ($append_code) $this->AppendCompiledHTML($append);
}
elseif ($this->SkipMode == skip_tags) {
$this->AppendBuffer($append); //append to buffer if we are skipping tags
}
}
function ConvertToCode($data)
{
- $code = '$o .= \''. str_replace("'", "\'", $data) .'\';';
+ $data = str_replace("\\", "\\\\", $data); // escape any "\"
+ $data = str_replace("'", "\'", $data); // escape "'"
+
+ $code = '$o .= \''. $data .'\';';
$code = explode("\n", $code);
return $code;
}
function AppendCode($code)
{
if (defined('EXPERIMENTAL_PRE_PARSE')) {
if (!isset($this->Code[$this->RecursionIndex])) {
$this->Code[$this->RecursionIndex] = Array();
}
if (is_array($code)) {
foreach ($code as $line) {
$this->Code[$this->RecursionIndex][] = rtrim($line, "\n")."\n";
}
}
else {
$this->Code[$this->RecursionIndex][] .= rtrim($code, "\n")."\n";
}
}
}
function AppendCompiledFunction($f_name, $f_body)
{
$real_name = 'f_'.abs(crc32($this->TemplateName)).'_'.$f_name;
if (defined('EXPERIMENTAL_PRE_PARSE')) {
// if such function already compiled
if ( isset($this->Application->CompiledFunctions[$f_name]) ||
function_exists($real_name)
)
{
if (!isset($this->Application->CompiledFunctions[$f_name])) {
$real_name = $real_name.'_';
}
else {
$real_name = $this->Application->CompiledFunctions[$f_name].'_';
}
}
$this->CompiledBuffer .= "\t".'$application->PreParsedBlocks[\''.$f_name.'\'] = \''.$real_name.'\';'."\n";
$this->CompiledBuffer .= 'if (!function_exists(\''.$real_name.'\')) {'."\n";
$this->CompiledBuffer .= "\t".'function '.$real_name.'($params)'."\n\t{\n";
$this->CompiledBuffer .= $f_body;
$this->CompiledBuffer .= "\t}\n\n";
$this->CompiledBuffer .= '}'."\n";
$this->Application->CompiledFunctions[$f_name] = $real_name;
+ /*if (defined('DEBUG_MODE') && DEBUG_MODE && defined('DBG_PRE_PARSE') && DBG_PRE_PARSE) {
+ // this shows newly compiled functions (blocks)
+ global $debugger;
+ $f_body = "\t".'function '.$real_name.'($params)'."\n\t{\n".$f_body."\t}\n\n";
+ $debugger->appendHTML($debugger->highlightString($f_body));
+ }*/
}
}
function AppendCompiledCode($code)
{
if (defined('EXPERIMENTAL_PRE_PARSE')) {
if (is_array($code)) {
foreach ($code as $line) {
$this->CompiledBuffer .= "\t".rtrim($line, "\n")."\n";
}
}
else {
$this->CompiledBuffer .= $code;
}
$this->CompiledBuffer .= "\t".'echo $o;'."\n\t".'$o = \'\';'."\n";
}
}
function AppendCompiledHTML($append)
{
if (defined('EXPERIMENTAL_PRE_PARSE')) {
$this->CompiledBuffer .= '?'.'>'."\n";
$this->CompiledBuffer .= rtrim($append, "\t");
$this->CompiledBuffer .= '<'.'?php'."\n";
}
}
function ResetCode()
{
$this->Code[$this->RecursionIndex] = Array();
}
function FindTag2()
{
$openings = Array('<%' => '%>', '<inp2:' => Array('>', '/>'), '</inp2:' => '>', '</inp2>' => '', '<!--' => '-->');
$tag_open_pos = false;
foreach ($openings as $an_opening => $closings) {
$pos = strpos($this->Template, $an_opening, $this->Position);
if ($pos !== false && ($tag_open_pos === false || (int) $pos <= (int) $tag_open_pos)) {
$tag_open_pos = $pos;
$open_len = strlen($an_opening);
$opening_tag = $an_opening;
$tag_closings = $closings;
}
}
if ($tag_open_pos === false) { //If no tags left - adding all other data
$this->AppendOutput(substr($this->Template, $this->Position), true);
return false;
}
//Adding all data before tag open
$this->AppendOutput(substr($this->Template, $this->Position, $tag_open_pos - $this->Position), true);
if (is_array($tag_closings)) {
$tag_close_pos = false;
foreach ($tag_closings as $a_closing) {
$pos = strpos($this->Template, $a_closing, $tag_open_pos);
if ($pos !== false && ($tag_close_pos === false || (int) $pos <= (int) $tag_close_pos)) {
$tag_close_pos = $pos;
$closing_tag = $a_closing;
}
}
}
elseif ($opening_tag == '</inp2>') {
$closing_tag = '';
$tag_close_pos = $tag_open_pos + $open_len;
}
else {
$closing_tag = $tag_closings;
$tag_close_pos = strpos($this->Template, $closing_tag, $tag_open_pos);
}
$close_len = strlen($closing_tag);
// Cutting trailing line-breaks after tags (same way PHP does it)
if (substr($this->Template, $tag_close_pos+$close_len, 2) == "\r\n") {
$this->Template = substr_replace($this->Template, '', $tag_close_pos, 2);
}
elseif (substr($this->Template, $tag_close_pos+$close_len, 1) == "\n") {
$this->Template = substr_replace($this->Template, '', $tag_close_pos, 1);
}
//Cutting out the tag itself
$tag = substr($this->Template, $tag_open_pos + $open_len, $tag_close_pos - $tag_open_pos - $open_len);
if ($opening_tag == '<inp2:') {
//getting prefix_tag upto first space, tab or line break into regs[1]
preg_match("/^([^ \t\n]*)(.*)/", $tag, $regs);
$tag_part = $regs[1];
if (strpos($tag_part, '_') !== false) {
list($prefix, $the_tag) = explode('_', $tag, 2);
/*preg_match('/(.*)_(.*)/', $tag_part, $rets);
$prefix = $rets[1];
$the_tag = $rets[2].$regs[2];*/
$tag = $prefix.':'.$the_tag;
}
else {
$the_tag = $tag;
$tag = ':'.$tag;
}
}
if ($opening_tag == '</inp2>') { //empty closing means old style in-portal if <inp2:tag>....</inp2>
$tag = 'm:endif';
}
if ($opening_tag == '</inp2:') {
preg_match("/^([^ \t\n]*)(.*)/", $tag, $regs);
$tag_part = $regs[1];
if (strpos($tag_part, '_') !== false) {
list($prefix, $the_tag) = explode('_', $tag, 2);
$tag = $prefix.':'.$the_tag;
}
$tag .= ' _closing_tag_="1"';
}
// if there is no prefix for the tag
if (strpos($tag, ':') === 0) {
$prefix = getArrayValue($this->Params, 'PrefixSpecial');
$tag = $prefix.$tag.' _auto_prefix_="1"';
}
// temporary - for backward compatability with in-portal style if
if ($opening_tag == '<inp2:' && $closing_tag == '>' && $tag_part != 'm_if' && $tag_part != 'm_DefineElement') {
if (strpos($the_tag, ' ') !== false) {
list($function, $params) = explode(' ', $the_tag, 2);
}
else {
$function = $the_tag;
$params = '';
}
$tag = 'm:if prefix="'.$prefix.'" function="'.$function.'" '.$params;
}
if ($opening_tag == '<!--') {
- $this->AppendOutput('<!-- '.htmlspecialchars($tag). '-->');
+ if ($this->Application->IsAdmin()) {
+ $this->AppendOutput('<!-- '.htmlspecialchars($tag). '-->');
+ }
+ else {
+ $this->AppendOutput('<!-- '.$tag. '-->');
+ $this->AppendCompiledHTML('<!-- '.$tag. '-->');
+ }
$tag = '__COMMENT__';
}
$this->Position = $tag_close_pos + $close_len;
return $tag;
}
function CurrentLineNumber()
{
return substr_count(substr($this->Template, 0, $this->Position), "\n")+1;
}
function SkipModeName()
{
switch ($this->SkipMode) {
case skip: return 'skip';
case skip_tags: return 'skip_tags';
case parse: return 'parse';
}
}
/**
* Recursive mkdir
*
* @param string $dir
* @param string $base_path base path to directory where folders should be created in
*/
function CheckDir($dir, $base_path = '')
{
if (file_exists($dir)) {
return;
}
else {
// remove $base_path from beggining because it is already created during install
$dir = preg_replace('/^'.preg_quote($base_path.'/', '/').'/', '', $dir, 1);
$segments = explode('/', $dir);
$cur_path = $base_path;
foreach ($segments as $segment) {
// do not add leading / for windows paths (c:\...)
$cur_path .= preg_match('/^[a-zA-Z]{1}:/', $segment) ? $segment : '/'.$segment;
if (!file_exists($cur_path)) {
mkdir($cur_path);
}
}
}
}
function ParseTemplate($name, $pre_parse = 1, $params=array(), $silent=0)
{
$this->FromPreParseCache = false;
if ($this->GetParam('from_inportal')) $pre_parse = 0;
if ($pre_parse) {
$pre_parsed = $this->Application->TemplatesCache->GetPreParsed($name);
if ($pre_parsed && $pre_parsed['active']) { // active means good (not expired) pre-parsed cache
$this->FromPreParseCache = true;
$this->SetParams($params, 0); // 0 to disable params sorting and regexp generation - not needed when processing pre-parsed
ob_start();
if ($pre_parsed['mode'] == 'file') {
$this->TemplateName = str_replace(FULL_PATH, '', realpath($pre_parsed['fname']));
include($pre_parsed['fname']);
}
else {
eval('?'.'>'.$pre_parsed['content']);
}
$output = ob_get_contents();
ob_end_clean();
}
else {
$this->SetParams($params);
$this->CompiledBuffer .= '<'.'?php'."\n";
$this->CompiledBuffer .= 'global $application;'."\n";
$this->CompiledBuffer .= '$params =& $application->Parser->Params;'."\n";
$this->CompiledBuffer .= 'extract($params);'."\n";
$this->CompiledBuffer .= '$o = \'\';'."\n";
$body = $this->Application->TemplatesCache->GetTemplateBody($name, $silent);
$this->TemplateName = $name;
$output = $this->NewParse($body, $name);
$this->CompiledBuffer .= '?'.'>'."\n";
if (defined('SAFE_MODE') && SAFE_MODE) {
if (!isset($conn)) $conn =& $this->Application->GetADODBConnection();
$conn->Query('REPLACE INTO '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ('.$conn->qstr($pre_parsed['fname']).','.$conn->qstr($this->CompiledBuffer).','.adodb_mktime().')');
}
else {
$compiled = fopen($pre_parsed['fname'], 'w');
fwrite($compiled, $this->CompiledBuffer);
fclose($compiled);
}
}
if ( !$this->GetParam('from_inportal') && strpos($output, '<inp:') !== false) {
$inp1_parser =& $this->Application->recallObject('Inp1Parser');
// $name = $this->Application->TemplatesCache->GetTemplateFileName($name) . '-block:' . $name; // may be is needed (by Alex)
$output = $inp1_parser->Parse($name, $output);
}
return $output;
}
// pre-parse is OFF
$this->SetParams($params);
return $this->NewParse($this->Application->TemplatesCache->GetTemplateBody($name), $name, $pre_parse);
}
function NewParse($template, $name='unknown', $pre_parse = 1)
{
$this->Template = $template;
$this->TemplateName = $name;
$this->Position = 0;
$this->Output = '';
$this->TagHolder = new MyTagHolder();
$has_inp_tags = false;
if (!getArrayValue($this->Params, 'PrefixSpecial')) {
$this->Params['PrefixSpecial'] = '$PrefixSpecial';
}
//While we have more tags
while ($tag_data = $this->FindTag2())
{
if ($tag_data == '__COMMENT__') continue;
//Create tag object from passed tag data
if( $this->Application->isDebugMode() && constOn('DBG_SHOW_TAGS') )
{
global $debugger;
$debugger->appendHTML('mode: '.$this->SkipModeName().' tag '.$debugger->highlightString($tag_data).' in '.$debugger->getFileLink($debugger->getLocalFile(FULL_PATH.THEMES_PATH.'/'.$this->TemplateName).'.tpl', $this->CurrentLineNumber(), '', true));
}
$tag =& $this->TagHolder->GetTag($tag_data, $this);
if (!$this->CheckRecursion($tag)) //we do NOT process closing tags
{
$tag->Process();
}
}
return $this->Output;
}
function Parse($template, $name='unknown', $pre_parse = 1)
{
$this->Template = $template;
$this->TemplateName = $name;
$this->Position = 0;
$this->Output = '';
$this->TagHolder = new MyTagHolder();
$has_inp_tags = false;
if ($this->GetParam('from_inportal')) $pre_parse = 0;
if (defined('EXPERIMENTAL_PRE_PARSE') && $pre_parse) {
$fname = $this->Application->TemplatesCache->GetRealFilename($this->TemplateName).'.php';
$fname = str_replace(FULL_PATH, FULL_PATH.'/kernel/cache', $fname);
if (!defined('SAFE_MODE') || !SAFE_MODE) {
$this->CheckDir(dirname($fname), FULL_PATH.'/kernel/cache');
}
$tname = $this->Application->TemplatesCache->GetRealFilename($this->TemplateName).'.tpl';
$output = '';
$is_cached = false;
ob_start();
if (defined('SAFE_MODE') && SAFE_MODE) {
$conn =& $this->Application->GetADODBConnection();
$cached = $conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'Cache WHERE VarName = "'.$fname.'"');
if ($cached !== false && $cached['Cached'] > filemtime($tname)) {
eval('?'.'>'.$cached['Data']);
$is_cached = true;
}
}
else {
if (file_exists($fname) && file_exists($tname) && filemtime($fname) > filemtime($tname)) {
include($fname);
$is_cached = true;
}
}
$output = ob_get_contents();
ob_end_clean();
if ( $is_cached && !$this->GetParam('from_inportal') ) {
if ( strpos($output, '<inp:') !== false) {
$inp1_parser =& $this->Application->recallObject('Inp1Parser');
$output = $inp1_parser->Parse($name, $output);
}
return $output;
}
$this->CompiledBuffer .= '<'.'?php'."\n";
$this->CompiledBuffer .= 'global $application;'."\n";
$this->CompiledBuffer .= '$params =& $application->Parser->Params;'."\n";
$this->CompiledBuffer .= 'extract($params);'."\n";
$this->CompiledBuffer .= '$o = \'\';'."\n";
}
if (!getArrayValue($this->Params, 'PrefixSpecial')) {
$this->Params['PrefixSpecial'] = '$PrefixSpecial';
}
//While we have more tags
while ($tag_data = $this->FindTag2())
{
if ($tag_data == '__COMMENT__') continue;
//Create tag object from passed tag data
if( $this->Application->isDebugMode() && constOn('DBG_SHOW_TAGS') )
{
global $debugger;
$debugger->appendHTML('mode: '.$this->SkipModeName().' tag '.$debugger->highlightString($tag_data).' in '.$debugger->getFileLink($debugger->getLocalFile(FULL_PATH.THEMES_PATH.'/'.$this->TemplateName).'.tpl', $this->CurrentLineNumber(), '', true));
}
// $tag =& new MyTag($tag_data, $this);
$tag =& $this->TagHolder->GetTag($tag_data, $this);
if (!$this->CheckRecursion($tag)) //we do NOT process closing tags
{
$tag->Process();
}
}
if ( !$this->GetParam('from_inportal') ) {
if ( strpos($this->Output, '<inp:') !== false) {
$inp1_parser =& $this->Application->recallObject('Inp1Parser');
$this->Output = $inp1_parser->Parse($name, $this->Output);
$has_inp_tags = true;
}
}
if (defined('EXPERIMENTAL_PRE_PARSE') && $pre_parse && !$has_inp_tags) {
// $this->CompiledBuffer .= 'echo $o;'."\n";
$this->CompiledBuffer .= '?'.'>'."\n";
if (defined('SAFE_MODE') && SAFE_MODE) {
if (!isset($conn)) $conn =& $this->Application->GetADODBConnection();
$conn->Query('REPLACE INTO '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ('.$conn->qstr($fname).','.$conn->qstr($this->CompiledBuffer).','.adodb_mktime().')');
}
else {
$compiled = fopen($fname, 'w');
fwrite($compiled, $this->CompiledBuffer);
fclose($compiled);
}
}
return $this->Output;
}
function ParseBlock($params, $force_pass_params=0, $as_template=false)
{
if( $this->Application->isDebugMode() && constOn('DBG_SHOW_TAGS') )
{
global $debugger;
$debugger->appendHTML('ParseBlock '.$params['name'].' pass_params is '.$params['pass_params'].' force is '.$force_pass_params.' in '.$debugger->getFileLink($debugger->getLocalFile(FULL_PATH.THEMES_PATH.'/'.$this->TemplateName).'.tpl', $this->CurrentLineNumber(), '', true));
}
/*if ( $this->Application->isDebugMode() && constOn('DBG_PRE_PARSE') ) {
global $debugger;
$debugger->CurrentPreParsedBlock = $params['name'];
}*/
if (defined('EXPERIMENTAL_PRE_PARSE')) {
$this->MainParser = false;
if (isset($this->Application->PreParsedBlocks[$params['name']]) ) {
if ($this->ParamsRecursionIndex == 0) {
$this->ParamsStack[$this->ParamsRecursionIndex] = $this->Params;
}
if (isset($params['pass_params']) || $force_pass_params) {
$pass_params = array_merge($this->ParamsStack[$this->ParamsRecursionIndex], $params);
}
else {
$pass_params = $params;
}
$this->ParamsStack[++$this->ParamsRecursionIndex] = $pass_params;
$this->Params = $pass_params;
$f = $this->Application->PreParsedBlocks[$params['name']];
// $this->ParamsRecursionIndex--;
//$this->SetParams($params);
if( !isset($pass_params['PrefixSpecial']) && isset($pass_params['prefix']) ) $pass_params['PrefixSpecial'] = $pass_params['prefix'];
$ret = $f($pass_params);
unset($this->ParamsStack[$this->ParamsRecursionIndex--]);
$this->Params = $this->ParamsStack[$this->ParamsRecursionIndex];
$this->MainParser = true;
return $ret;
}
}
$BlockParser =& $this->Application->makeClass('TemplateParser');
if (isset($params['pass_params']) || $force_pass_params) {
$BlockParser->SetParams(array_merge($this->Params, $params));
}
else
$BlockParser->SetParams($params);
$this->Application->Parser =& $BlockParser;
if (!isset($params['name'])) {
trigger_error('<b>***Error: Block name not passed to ParseBlock</b>', E_USER_ERROR);
}
$templates_cache =& $this->Application->recallObject('TemplatesCache');
$template_name = $as_template ? $params['name'] : $templates_cache->GetTemplateFileName($params['name']) . '-block:'.$params['name'];
$silent = getArrayValue($params, 'from_inportal') && !defined('DBG_TEMPLATE_FAILURE');
$o = $BlockParser->Parse(
$templates_cache->GetTemplateBody($params['name'], $silent),
$template_name
);
if (getArrayValue($params, 'BlockNoData') && !$BlockParser->DataExists) {
$template_name = $as_template ? $params['BlockNoData'] : $templates_cache->GetTemplateFileName($params['BlockNoData']) . '-block:'.$params['BlockNoData'];
$o = $BlockParser->Parse(
$templates_cache->GetTemplateBody($params['BlockNoData'], $silent),
$template_name
);
}
$this->Application->Parser =& $this;
$this->Application->Parser->DataExists = $this->Application->Parser->DataExists || $BlockParser->DataExists;
return $o;
}
function Recurve(&$tag)
{
$this->Recursion[++$this->RecursionIndex] =& $tag;
}
function CheckRecursion(&$tag)
{
if ($this->RecursionIndex > 0) { //If we are inside the recursion
if ($this->Recursion[$this->RecursionIndex]->CheckRecursion($tag)) { //If we can close this recursion
unset($this->Recursion[$this->RecursionIndex--]); //unsetting current recursion level and decreasing it at the same time
return true; //we should inform not to process closing tag
}
}
return false;
}
function SetSkipMode($mode)
{
$this->SkipMode = $mode;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/parser/template_parser.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.27
\ No newline at end of property
+1.28
\ No newline at end of property
Index: trunk/core/units/groups/groups_event_handler.php
===================================================================
--- trunk/core/units/groups/groups_event_handler.php (revision 7634)
+++ trunk/core/units/groups/groups_event_handler.php (revision 7635)
@@ -1,19 +1,38 @@
<?php
class GroupsEventHandler extends kDBEventHandler {
/**
* Adds grouping by userid
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
- if ($event->Special == 'total') {
$object =& $event->getObject();
+ /* @var $object kDBList */
+
+ switch ($event->Special) {
+ case 'total':
$object->AddGroupByField('%1$s.GroupId');
+ break;
+
+ case 'user':
+ $user_id = $this->Application->GetVar('u_id');
+ if ($user_id !== false) {
+ // show only groups, that user doesn't belong to
+ $table_name = $this->Application->GetTempName(TABLE_PREFIX.'UserGroup', 'prefix:u');
+ $sql = 'SELECT GroupId
+ FROM '.$table_name.'
+ WHERE PortalUserId = '.$user_id;
+ $group_ids = $this->Conn->GetCol($sql);
+ array_push($group_ids, 14, 15); // Guest & Everyone groups are set dynamically
+
+ $object->addFilter('already_member_filter', '%1$s.GroupId NOT IN ('.implode(',', $group_ids).')');
+ }
+ break;
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/groups/groups_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/units/groups/groups_config.php
===================================================================
--- trunk/core/units/groups/groups_config.php (revision 7634)
+++ trunk/core/units/groups/groups_config.php (revision 7635)
@@ -1,123 +1,128 @@
<?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.total_List'), 'format' => "!la_title_Groups! (#g.total_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!"),
+ 'select_group' => Array('prefixes' => Array('g.user_List'), 'format' => "!la_title_Groups! (#g.user_recordcount#) - !la_title_SelectGroup!"),
),
'PermSection' => Array('main' => 'in-portal:user_groups'),
'TableName' => TABLE_PREFIX.'PortalGroup',
'ListSQLs' => Array(
- '' => '
- SELECT %1$s.* %2$s FROM %1$s',
- 'total' => '
- SELECT %1$s.* %2$s FROM %1$s
+ '' => 'SELECT %1$s.* %2$s FROM %1$s',
+ 'total' => '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
+ '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'),
- ),
- ),*/
- ),
+ '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'),
+ ),
+ ),
+
+ 'UserGroups' => 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'),
+ ),
+ ),
+
+ '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(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'),
+ 'Description' => Array('title' => 'la_col_Description'),
+ ),
+ ),
+ ),
+
);
?>
\ No newline at end of file
Property changes on: trunk/core/units/groups/groups_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.16
\ No newline at end of property
+1.17
\ No newline at end of property
Index: trunk/core/units/reviews/reviews_config.php
===================================================================
--- trunk/core/units/reviews/reviews_config.php (revision 7634)
+++ trunk/core/units/reviews/reviews_config.php (revision 7635)
@@ -1,136 +1,137 @@
<?php
$config = Array(
'Prefix' => 'rev',
'Clones' => Array(
'l-rev' => Array(
'ParentPrefix' => 'l',
),
'n-rev' => Array(
'ParentPrefix' => 'n',
),
'bb-rev'=> Array(
'ParentPrefix' => 'bb',
),
/*'p-rev' => Array('ParentPrefix' => 'p'),*/
),
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'ReviewsEventHandler','file'=>'reviews_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'ReviewsTagProcessor','file'=>'reviews_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
+ 4 => 'mode',
),
'ParentPrefix' => 'p', // replace all usage of rev to "p-rev" and then remove this param from here and Prefix too
'IDField' => 'ReviewId',
'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
'TableName' => TABLE_PREFIX.'ItemReview',
'ParentTableKey' => 'ResourceId', // linked field in master table
'ForeignKey' => 'ItemId', // linked field in subtable
'AutoDelete' => true,
'AutoClone' => true,
'TitlePresets' => Array(
'reviews_edit' => Array('format' => "!la_title_Editing_Review!"),
),
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER),
),
'Filters' => Array(
'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
)
),
'CalculatedFields' => Array(
'' => Array(
'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
),
'products' => Array(
'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
'ItemName' => 'pr.l1_Name',
'ProductId' => 'pr.ProductId',
),
'product' => Array(
'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
'ItemName' => 'pr.l1_Name',
'ProductId' => 'pr.ProductId',
),
),
// key - special, value - list select sql
'ListSQLs' => Array( ''=>'SELECT %1$s.* %2$s FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
'products' => ' SELECT %1$s.* %2$s
FROM %1$s, '.TABLE_PREFIX.'Products pr
LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
'product' => ' SELECT %1$s.* %2$s
FROM %1$s, '.TABLE_PREFIX.'Products pr
LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
),
'ItemSQLs' => Array( ''=> 'SELECT * FROM %s'),
'ListSortings' => Array(
'' => Array(
'ForcedSorting' => Array('Priority' => 'desc'),
'Sorting' => Array('CreatedOn' => 'desc'),
)
),
'Fields' => Array(
'ReviewId' => Array('type'=>'int'),
'CreatedOn' => Array('formatter'=>'kDateFormatter','not_null'=>1,'default'=>'#NOW#'),
'ReviewText' => Array('type'=>'string','required'=>1,'not_null'=>1,'default'=>''),
'IPAddress' => Array('type'=>'string','max_value_inc'=>15,'not_null'=>1,'default'=>''),
'ItemId' => Array('type'=>'int','not_null'=>1,'default'=>0),
'CreatedById' => Array('formatter'=>'kLEFTFormatter','options'=>Array(-1=>'root',-2=>'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'','left_key_field'=>'PortalUserId','left_title_field'=>'Login','required'=>1,'not_null'=>1,'default'=>-1),
'ItemType' => Array('type'=>'int','not_null'=>1,'default'=>0),
'Priority' => Array('type'=>'int','not_null'=>1,'default'=>0),
'Status' => Array('formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options'=>Array(1=>'la_Active',2=>'la_Pending',0=>'la_Disabled'),'not_null'=>1,'default'=>2 ),
'TextFormat' => Array('type'=>'int','not_null'=>1,'default'=>0),
'Module' => Array('type'=>'string','not_null'=>1,'default'=>''),
),
'VirtualFields' => Array(
'ReviewedBy' => Array(),
),
'Grids' => Array(
'Default' => Array( 'Icons' => Array('default'=>'icon16_custom.gif',1=>'icon16_review.gif',2=>'icon16_review_pending.gif',0=>'icon16_review_disabled.gif'),
'Fields' => Array(
'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'data_block' => 'reviewtext_checkbox_td'),
'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy' ),
'CreatedOn_formatted' => Array( 'title'=>'la_col_CreatedOn', 'sort_field' => 'CreatedOn' ),
'Status' => Array( 'title'=>'la_col_Status' ),
),
),
'ReviewsSection' => Array( 'Icons' => Array('default'=>'icon16_custom.gif',1=>'icon16_review.gif',2=>'icon16_review_pending.gif',0=>'icon16_review_disabled.gif'),
'Fields' => Array(
'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'data_block' => 'grid_checkbox_namelink_td'),
'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy' ),
'CreatedOn_formatted' => Array( 'title'=>'la_col_CreatedOn', 'sort_field' => 'CreatedOn' ),
'Status' => Array( 'title'=>'la_col_Status' ),
),
),
),
);
?>
\ No newline at end of file
Property changes on: trunk/core/units/reviews/reviews_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property
Index: trunk/core/units/reviews/reviews_event_handler.php
===================================================================
--- trunk/core/units/reviews/reviews_event_handler.php (revision 7634)
+++ trunk/core/units/reviews/reviews_event_handler.php (revision 7635)
@@ -1,204 +1,215 @@
<?php
class ReviewsEventHandler extends kDBEventHandler
{
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if ($event->Name == 'OnAddReview') {
$item_prefix = $this->getPermPrefix($event);
$res = $this->Application->CheckPermission($item_prefix.'.REVIEW.PENDING', 0) || $this->Application->CheckPermission($item_prefix.'.REVIEW', 0);
if (!$res) {
$event->status = erPERM_FAIL;
}
return $res;
}
return parent::CheckPermission($event);
}
/**
* Returns prefix for permissions
*
* @param kEvent $event
*/
function getPermPrefix(&$event)
{
$main_prefix = $this->Application->GetTopmostPrefix($event->Prefix);
// this will return LINK for l, ARTICLE for n, TOPIC for bb, PRODUCT for p
$item_prefix = $this->Application->getUnitOption($main_prefix, 'PermItemPrefix');
return $item_prefix;
}
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @access protected
* @see OnListBuild
*/
function SetCustomQuery(&$event)
{
$object =& $event->getObject();
switch ($event->Special)
{
case 'showall':
$object->clearFilters();
break;
case 'products':
$object->removeFilter('parent_filter'); // this is important
$object->addFilter('product_reviews', '%1$s.ItemId = pr.ResourceId');
// $object->addFilter('active', '%1$s.Status = 1');
/*$this->Application->setUnitOption('p', 'AutoLoad', true);
$product =& $this->Application->recallObject('p');
$object->addFilter('current_product', 'pr.ResourceId = '.$product->GetDBField('ResourceId'));*/
break;
case 'item':
$object->clearFilters();
$info = $object->getLinkedInfo();
$this->Application->setUnitOption($info['ParentPrefix'], 'AutoLoad', true);
$parent =& $this->Application->recallObject($info['ParentPrefix']);
$object->addFilter('item_reviews', '%1$s.ItemId = '.$parent->GetDBField('ResourceId'));
$object->addFilter('active', '%1$s.Status = 1');
break;
case 'product':
$object->clearFilters();
$object->addFilter('product_reviews', '%1$s.ItemId = pr.ResourceId');
$object->addFilter('active', '%1$s.Status = 1');
$this->Application->setUnitOption('p', 'AutoLoad', true);
$product =& $this->Application->recallObject('p');
$object->addFilter('current_product', 'pr.ResourceId = '.$product->GetDBField('ResourceId'));
break;
}
if($event->getEventParam('type') == 'current_user')
{
$user_id = $this->getUserID();
$ip = $_SERVER['REMOTE_ADDR'];
$object =& $event->getObject( Array('skip_autoload' => true) );
$product_info = $object->getLinkedInfo();
$object->addFilter('current_item', '%1$s.ItemId = '.$product_info['ParentId']);
$object->addFilter('current_user', '%1$s.CreatedById = '.$user_id);
$object->addFilter('current_ip', '%1$s.IPAddress = "'.$ip.'"');
}
}
/**
* Adds review from front in case if user is logged in
*
* @param kEvent $event
*/
function OnAddReview(&$event)
{
$user_id = $this->getUserID();
$event->redirect_params = Array('pass' => 'all,p');
$object =& $event->getObject( Array('skip_autoload' => true) );
$parent_info = $object->getLinkedInfo();
$review_fields = $this->Application->GetVar($event->getPrefixSpecial(true));
$sql = ' SELECT * FROM '.TABLE_PREFIX.'SpamControl
WHERE ItemResourceId='.$parent_info['ParentId'].'
AND IPaddress="'.$_SERVER['REMOTE_ADDR'].'"
AND PortalUserId='.$user_id.'
AND DataType="Review"';
$res = $this->Conn->GetRow($sql);
if( $res && $res['Expire'] < adodb_mktime() )
{
$sql = ' DELETE FROM '.TABLE_PREFIX.'SpamControl
WHERE ItemResourceId='.$parent_info['ParentId'].'
AND IPaddress="'.$_SERVER['REMOTE_ADDR'].'"
AND PortalUserId='.$user_id.'
AND DataType="Review"';
$this->Conn->Query($sql);
unset($res);
}
if(!$res)
{
$object->SetFieldsFromHash( array_shift($review_fields) );
$object->SetDBField('CreatedById', $user_id);
$object->SetDBField('IPAddress', $_SERVER['REMOTE_ADDR']);
$object->SetDBField('CreatedOn', adodb_mktime());
$module_info = $this->Application->findModule('Var',$parent_info['ParentPrefix']);
$object->SetDBField('Module', $module_info['Name']);
if( $this->Application->CheckPermission( $this->getPermPrefix($event).'.REVIEW.PENDING', 0) )
{
$object->SetDBField('Status', 2);
$template_var = 'success_pending_template';
}
if( $this->Application->CheckPermission($this->getPermPrefix($event).'.REVIEW', 0) )
{
$object->SetDBField('Status', 1);
$template_var = 'success_template';
}
$object->SetDBField('ItemId', $parent_info['ParentId']);
$event->CallSubEvent('OnCreate');
if($event->status == erSUCCESS)
{
$parent =& $this->Application->recallObject($parent_info['ParentPrefix']);
$sql = ' SELECT COUNT(ReviewId)
FROM '.$object->TableName.'
WHERE ItemId='.$parent_info['ParentId'];
$review_qty = $this->Conn->GetOne($sql);
$parent->SetDBField('CachedReviewsQty', $review_qty);
$parent->Update();
$expire = adodb_mktime() + $this->Application->ConfigValue('product_ReviewDelay_Value') * $this->Application->ConfigValue('product_ReviewDelay_Interval');
$sql = ' INSERT INTO '.TABLE_PREFIX.'SpamControl
(ItemResourceId, IPaddress, PortalUserId, DataType, Expire)
VALUES ('.$parent_info['ParentId'].',
"'.$_SERVER['REMOTE_ADDR'].'",
'.$user_id.',
"Review",
'.$expire.')';
$this->Conn->Query($sql);
$event->redirect_params = Array('pass' => 'all,'.$parent_info['ParentPrefix']);
$event->redirect = $this->Application->GetVar($template_var);
}
}
else
{
// $this->Application->removeObject($event->getPrefixSpecial());
$event->status == erFAIL;
$event->redirect=false;
$object->FieldErrors['ReviewText']['pseudo'] = 'too_frequent';
$object->ErrorMsgs['too_frequent'] = $this->Application->Phrase('lu_ferror_review_duplicate');
}
}
-
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ $object =& $event->getObject();
+ $object->SetDBField('Module', $this->Application->findModule('Var',$this->Application->getUnitOption($this->Prefix, 'ParentPrefix'), 'Name'));
+ }
+
/**
* Returns current user id for reviews, for logic ask Kostja T.
*
* @return int
*/
function getUserID()
{
$user_id = $this->Application->RecallVar('user_id');
-
+
if ($user_id == 0) {
$user_id = -2;
}
-
+
return $user_id;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/reviews/reviews_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.9
\ No newline at end of property
+1.10
\ No newline at end of property
Index: trunk/core/units/categories/categories_config.php
===================================================================
--- trunk/core/units/categories/categories_config.php (revision 7634)
+++ trunk/core/units/categories/categories_config.php (revision 7635)
@@ -1,278 +1,278 @@
<?php
$config = Array(
'Prefix' => 'c',
'ItemClass' => Array('class'=>'CategoriesItem','file'=>'categories_item.php','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'CategoriesEventHandler','file'=>'categories_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'CategoriesTagProcessor','file'=>'categories_tag_processor.php','build_event'=>'OnBuild'),
'RegisterClasses' => Array(
Array('pseudo' => 'kPermCacheUpdater','class' => 'kPermCacheUpdater', 'file' => 'cache_updater.php','build_event'=>''),
),
'AutoLoad' => true,
'CatalogItem' => true,
'AdminTemplatePath' => 'categories',
'AdminTemplatePrefix' => 'categories_',
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'AggregateTags' => Array(
Array(
'AggregateTo' => 'm',
'AggregatedTagName' => 'CategoryLink',
'LocalTagName' => 'CategoryLink',
),
),
'IDField' => 'CategoryId',
'StatusField' => Array('Status'),
'TitleField' => 'Name', // field, used in bluebar when editing existing item
'TitlePhrase' => 'la_Text_Category',
'ItemType' => 1, // used for custom fields only
'StatisticsInfo' => Array(
'pending' => Array(
'icon' => 'icon16_cat_pending.gif',
'label' => 'la_tab_Categories',
'js_url' => '#url#',
- 'url' => Array('t' => 'advanced_view', 'SetTab' => 'c', 'pass' => 'm,c.showall', 'c.showall_event' => 'OnSetFilterPattern', 'c.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_pick=1'),
+ 'url' => Array('t' => 'in-portal/advanced_view', 'SetTab' => 'c', 'pass' => 'm,c.showall', 'c.showall_event' => 'OnSetFilterPattern', 'c.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_pick=1'),
'status' => STATUS_PENDING,
),
),
'TableName' => TABLE_PREFIX.'Category',
'ViewMenuPhrase' => 'la_text_Categories',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('c' => '!la_title_Adding_Category!'),
'edit_status_labels' => Array('c' => '!la_title_Editing_Category!'),
'new_titlefield' => Array('c' => '!la_title_New_Category!'),
),
'category_list' => Array('prefixes' => Array('c_List'), 'format' => "!la_title_Categories! (#c_recordcount#)"),
'catalog' => Array('prefixes' => Array('c_List'), 'format' => "!la_title_Categories! (<span id='c_item_count'>#c_recordcount#</span>)"),
'advanced_view' => Array('prefixes' => Array('c_List'), 'format' => "!la_title_AdvancedView!"),
'categories_edit' => Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_General!"),
'categories_properties' => Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Properties!"),
'categories_relations' => Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Relations!"),
'categories_images' => Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Images!"),
'categories_permissions'=> Array('prefixes' => Array('c', 'g_List'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Permissions!"),
'categories_custom' => Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Custom!"),
'categories_update' => Array('prefixes' => Array(), 'format' => "!la_title_UpdatingCategories!"),
'images_edit' => Array( 'prefixes' => Array('c', 'c-img'),
'new_status_labels' => Array('c-img'=>'!la_title_Adding_Image!'),
'edit_status_labels' => Array('c-img'=>'!la_title_Editing_Image!'),
'new_titlefield' => Array('c-img'=>'!la_title_New_Image!'),
'format' => "#c_status# '#c_titlefield#' - #c-img_status# '#c-img_titlefield#'",
),
'relations_edit' => Array( 'prefixes' => Array('c', 'c-rel'),
'new_status_labels' => Array('c-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"),
'edit_status_labels' => Array('c-rel'=>'!la_title_Editing_Relationship!'),
'format' => "#c_status# '#c_titlefield#' - #c-rel_status#",
),
'tree_site' => Array('format' => '!la_selecting_categories!'),
),
'PermItemPrefix' => 'CATEGORY',
'PermSection' => Array('main' => 'CATEGORY:in-portal:categories', /*'search' => 'in-portal:configuration_search',*/ 'email' => 'in-portal:configuration_email', 'custom' => 'in-portal:configuration_custom'),
/* 'Sections' => Array(
// "Structure & Data" section
'in-portal:site' => Array(
'parent' => 'in-portal:root',
'icon' => 'struct',
'label' => 'la_tab_Site_Structure',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:browse' => Array(
'parent' => 'in-portal:site',
'icon' => 'catalog',
'label' => 'la_tab_Browse',
'url' => Array('t' => 'in-portal/catalog', 'pass' => 'm'),
'late_load' => Array('t' => 'in-portal/xml/tree_categories', 'pass' => 'm', 'm_cat_id' => 0),
'onclick' => 'checkCatalog(0)',
'permissions' => Array('view'),
'priority' => 0.1,
'type' => stTREE,
),
'in-portal:advanced_view' => Array(
'parent' => 'in-portal:site',
'icon' => 'advanced_view',
'label' => 'la_tab_AdvancedView',
'url' => Array('t' => 'in-portal/advanced_view', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 0.2,
'type' => stTREE,
),
'in-portal:reviews' => Array(
'parent' => 'in-portal:site',
'icon' => 'reviews',
'label' => 'la_tab_Reviews',
'url' => Array('index_file' => 'reviews.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:configure_categories' => Array(
'parent' => 'in-portal:site',
'icon' => 'cat_settings',
'label' => 'la_tab_Settings',
'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:configuration_search' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_search',
'label' => 'la_tab_ConfigSearch',
'url' => Array('t' => 'in-portal/config/config_search', 'module_key' => 'category', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:configuration_email' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_email',
'label' => 'la_tab_ConfigE-mail',
'url' => Array('t' => 'in-portal/config/config_email', 'module' => 'In-Portal:Category', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 6,
'type' => stTREE,
),
'in-portal:configuration_custom' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array('t' => 'in-portal/custom_fields/custom_fields_list', 'cf_type' => 1, 'pass_section' => true, 'pass' => 'm,cf'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 7,
'type' => stTREE,
),
),*/
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER),
Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER),
Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER),
),
'Filters' => Array(
'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Status != 1' ),
'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => 'Status != 2' ),
'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Status != 0' ),
's1' => Array(),
'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ),
'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '`EditorsPick` != 1' ),
)
),
'ListSQLs' => Array( ''=> ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PermCache ON '.TABLE_PREFIX.'PermCache.CategoryId = %1$s.CategoryId
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
'ItemSQLs' => Array( ''=> ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PermCache ON '.TABLE_PREFIX.'PermCache.CategoryId = %1$s.CategoryId
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
'SubItems' => Array('c-rel', 'c-img', 'c-cdata', 'c-perm'),
'ListSortings' => Array(
'' => Array(
'ForcedSorting' => Array("CurrentSort" => 'asc', 'Priority' => 'desc', 'Name' => 'asc'),
'Sorting' => Array('Name' => 'asc'),
)
),
'CalculatedFields' => Array(
'' => Array(
'CurrentSort' => "REPLACE(ParentPath, CONCAT('|', ".'%1$s'.".CategoryId, '|'), '')",
)
),
'Fields' => Array
(
'CategoryId' => Array('type' => 'int','not_null' => 1,'default' => ''),
'Type' => Array('type' => 'int','not_null' => 1,'default' => 0),
'ParentId' => Array('type' => 'int','not_null' => 1,'default' => 0),
'Name' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'required' => 1, 'default' => ''),
'Filename' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
'AutomaticFilename' => Array('type' => 'int', 'not_null' => 1, 'default' => 1),
'Description' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'required' => 1, 'default' => ''),
'CreatedOn' => Array('formatter' => 'kDateFormatter', 'default'=>'#NOW#', 'required' => 1, 'not_null' => 1),
'EditorsPick' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
'Pop' => Array('type' => 'int', 'default' => ''),
'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''),
'MetaKeywords' => Array('type' => 'string', 'default' => ''),
'CachedDescendantCatsQty' => Array('type' => 'int', 'default' => ''),
'CachedNavbar' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'default' => ''),
'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => '0'),
'ResourceId' => Array('type' => 'int', 'default' => ''),
'ParentPath' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
'NamedParentPath' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
'MetaDescription' => Array('type' => 'string', 'default' => ''),
'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1,'default' => '#NOW#'),
'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => '0'),
'CategoryTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
'CachedCategoryTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
),
'VirtualFields' => Array(
'CurrentSort' => Array('type' => 'string', 'default' => ''),
'IsNew' => Array('type' => 'int', 'default' => 0),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_cat.gif'),
'Fields' => Array(
'Name' => Array('title' => 'la_col_Name', 'data_block' => 'category_td'),
'Description' => Array('title' => 'la_col_Description'),
'CreatedOn_formatted' => Array('title' => 'la_col_CreatedOn', 'sort_field' => 'CreatedOn'),
),
),
),
'ConfigMapping' => Array(
'PerPage' => 'Perpage_Category',
'DefaultSorting1Field' => 'Category_Sortfield',
'DefaultSorting2Field' => 'Category_Sortfield2',
'DefaultSorting1Dir' => 'Category_Sortorder',
'DefaultSorting2Dir' => 'Category_Sortorder2',
),
);
?>
\ No newline at end of file
Property changes on: trunk/core/units/categories/categories_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.54
\ No newline at end of property
+1.55
\ No newline at end of property
Index: trunk/core/units/categories/categories_tag_processor.php
===================================================================
--- trunk/core/units/categories/categories_tag_processor.php (revision 7634)
+++ trunk/core/units/categories/categories_tag_processor.php (revision 7635)
@@ -1,510 +1,528 @@
<?php
class CategoriesTagProcessor extends kDBTagProcessor {
function SubCatCount($params)
{
$cat_object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
$sql = ' SELECT COUNT(*) - 1
FROM '.$cat_object->TableName.'
WHERE ParentPath LIKE "'.$cat_object->GetDBField('ParentPath').'%"';
if (isset($params['today'])) {
$sql .= ' AND CreatedOn > '.(adodb_mktime()-86400);
}
return $this->Conn->GetOne($sql);
}
function IsNew($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
$ret = $object->GetDBField('IsNew') ? 1 : 0;
return $ret;
}
function IsPick($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
$ret = $object->GetDBField('EditorsPick') ? 1 : 0;
return $ret;
}
function ItemIcon($params)
{
// only for categories, not structure
if ($this->Prefix != 'c') {
return parent::ItemIcon($params);
}
$object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
$status = $object->GetDBField('Status');
if($status == 1)
{
$ret = $object->GetDBField('IsNew') ? 'icon16_cat_new.gif' : 'icon16_cat.gif';
}
else
{
$ret = $status ? 'icon16_cat_pending.gif' : 'icon16_cat_disabled.gif';
}
return $ret;
}
function ItemCount($params)
{
$cat_object =& $this->getObject($params);
$ci_table = $this->Application->getUnitOption('l-ci', 'TableName');
$sql = ' SELECT COUNT(*)
FROM '.$cat_object->TableName.' c
LEFT JOIN '.$ci_table.' ci
ON c.CategoryId=ci.CategoryId
WHERE c.ParentPath LIKE "'.$cat_object->GetDBField('ParentPath').'%"
AND NOT (ci.CategoryId IS NULL)';
return $this->Conn->GetOne($sql);
}
function ListCategories($params)
{
return $this->PrintList2($params);
}
function RootCategoryName($params)
{
return $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params);
}
function CheckModuleRoot($params)
{
$module_name = getArrayValue($params, 'module') ? $params['module'] : 'In-Commerce';
$module =& $this->Application->recallObject('mod.'.$module_name);
$module_root_cat = $module->GetDBField('RootCat');
$additional_cats = $this->SelectParam($params, 'add_cats');
if ($additional_cats) {
$additional_cats = explode(',', $additional_cats);
}
else {
$additional_cats = array();
}
if ($this->Application->GetVar('m_cat_id') == $module_root_cat || in_array($this->Application->GetVar('m_cat_id'), $additional_cats)) {
$home_template = getArrayValue($params, 'home_template');
if (!$home_template) return;
$this->Application->Redirect($home_template, Array('pass'=>'all'));
};
}
function CategoryPath($params)
{
$module_name = getArrayValue($params, 'module') ? $params['module'] : 'In-Commerce';
$module_category_id = $this->Application->findModule('Name', $module_name, 'RootCat');
$module_item_id = $this->Application->GetVar($this->Application->findModule('Name', $module_name, 'Var').'_id');
$block_params['separator'] = $params['separator'];
if (!isset($params['cat_id'])) {
$params['cat_id'] = getArrayValue($params, 'cat_id') ? $params['cat_id'] : $this->Application->GetVar('m_cat_id');
}
if ($params['cat_id'] == 0) {
$block_params['current'] = 1;
$block_params['cat_id'] = 0;
$block_params['cat_name'] = $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params);
$block_params['name'] = $this->SelectParam($params, 'root_cat_render_as,block_root_cat,rootcatblock,render_as');
return $this->Application->ParseBlock($block_params);
}
else {
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$navbar_field = $ml_formatter->LangFieldName('CachedNavBar');
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($this->Prefix, 'TableName');
$sql = 'SELECT '.$navbar_field.', ParentPath
FROM '.$table_name.'
WHERE '.$id_field.' = '.$params['cat_id'];
$category_data = $this->Conn->GetRow($sql);
$ret = '';
if ($category_data) {
$category_names = explode('&|&', $category_data[$navbar_field]);
$category_ids = explode('|', substr($category_data['ParentPath'], 1, -1));
// add "Home" category at beginning of path
array_unshift($category_names, $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params));
array_unshift($category_ids, 0);
foreach ($category_ids as $category_pos => $category_id) {
$block_params['cat_id'] = $category_id;
$block_params['cat_name'] = $category_names[$category_pos];
$block_params['current'] = ($params['cat_id'] == $category_id) && !$module_item_id ? 1 : 0;
$block_params['is_module_root'] = $category_id == $module_category_id ? 1 : 0;
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
// which block to parse as current ?
if ($category_id == 0) {
$block_params['name'] = $this->SelectParam($params, 'root_cat_render_as,block_root_cat,rootcatblock,render_as,block');
}
if ($block_params['is_module_root'] == 1) { // module root
$block_params['name'] = $this->SelectParam($params, 'module_root_render_as,block_module_root,rootmoduleblock,render_as,block');
}
if ($block_params['current'] == 1) { // current cat (label)
$block_params['name'] = $this->SelectParam($params, 'current_render_as,block_current,currentblock,render_as,block');
}
$this->Application->SetVar($this->Prefix.'_id', $category_id);
$ret .= $this->Application->ParseBlock($block_params, 1);
}
}
return $ret;
}
}
function CurrentCategoryName($params)
{
$cat_object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix.'_List');
$sql = 'SELECT '.$this->getTitleField().'
FROM '.$cat_object->TableName.'
WHERE CategoryId = '.$this->Application->GetVar('m_cat_id');
return $this->Conn->GetOne($sql);
}
function getTitleField()
{
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
return $ml_formatter->LangFieldName('Name');
}
function CategoryLink($params)
{
// 'p_id'=>'0', ??
$params = array_merge(array('pass'=>'m'), $params);
$cat_id = getArrayValue($params,'cat_id');
if ($cat_id === false) {
// $cat_id = $this->Application->Parser->GetParam('cat_id');
$cat_id = $this->Application->GetVar($this->getPrefixSpecial().'_id');
}
if($cat_id == 'Root')
{
$object =& $this->Application->recallObject('mod.'.$params['module']);
$params['m_cat_id'] = $object->GetDBField('RootCat');
unset($params['module']);
}
else{
$params['m_cat_id'] = $cat_id;
}
unset($params['cat_id']);
$params['pass_category'] = 1;
$main_processor =& $this->Application->recallObject('m_TagProcessor');
return $main_processor->T($params);
}
function CategoryList($params)
{
//$object =& $this->Application->recallObject( $this->getPrefixSpecial() , $this->Prefix.'_List', $params );
$object =& $this->GetList($params);
if ($object->RecordsCount == 0)
{
if (isset($params['block_no_cats'])) {
$params['name'] = $params['block_no_cats'];
return $this->Application->ParseBlock($params);
}
else {
return '';
}
}
if (isset($params['block'])) {
return $this->PrintList($params);
}
else {
$params['block'] = $params['block_main'];
if (isset($params['block_row_start'])) {
$params['row_start_block'] = $params['block_row_start'];
}
if (isset($params['block_row_end'])) {
$params['row_end_block'] = $params['block_row_end'];
}
return $this->PrintList2($params);
}
}
function Meta($params)
{
$name = getArrayValue($params, 'name');
$object =& $this->Application->recallObject($this->Prefix.'.-item');
$field = $object->GetField('Meta'.$name);
if ($field) return $field;
switch ($name) {
case 'Description':
$conf = 'Category_MetaDesc';
break;
case 'Keywords':
$conf = 'Category_MetaKey';
break;
}
return $this->Application->ConfigValue($conf);
}
function BuildListSpecial($params)
{
if ( isset($params['parent_cat_id']) ) {
$parent_cat_id = $params['parent_cat_id'];
}
else {
$parent_cat_id = $this->Application->GetVar($this->Prefix.'_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
if (!$parent_cat_id) {
$parent_cat_id = 0;
}
}
$types = $this->SelectParam($params, 'types');
$except = $this->SelectParam($params, 'except');
$no_special = isset($params['no_special']) && $params['no_special'];
if ($no_special) return $this->Special;
if ($types.$except.$parent_cat_id == '') {
return parent::BuildListSpecial($params);
}
$special = crc32($types.$except.$parent_cat_id);
return $special;
}
function IsCurrent($params)
{
$object =& $this->getObject($params);
if ($object->GetID() == $this->Application->GetVar('m_cat_id')) {
return true;
}
else {
return false;
}
}
/**
* Substitutes category in last template base on current category
+ * This is required becasue when you navigate catalog using AJAX, last_template is not updated
+ * but when you open item edit from catalog last_template is used to build opener_stack
+ * So, if we don't substitute m_cat_id in last_template, after saving item we'll get redirected
+ * to the first category we've opened, not the one we navigated to using AJAX
*
* @param Array $params
*/
function UpdateLastTemplate($params)
{
$category_id = $this->Application->GetVar('m_cat_id');
- list($index_file, $env) = explode('|', $this->Application->RecallVar('last_template'), 2);
+ $wid = $this->Application->GetVar('m_wid');
+ list($index_file, $env) = explode('|', $this->Application->RecallVar(rtrim('last_template_'.$wid, '_')), 2);
$this->Application->SetVar(ENV_VAR_NAME, str_replace('%5C', '\\', $env));
$this->Application->HttpQuery->processQueryString();
// update required fields
$this->Application->SetVar('m_cat_id', $category_id);
$this->Application->Session->SaveLastTemplate($params['template']);
}
function GetParentCategory($params)
{
$parent_id = 0;
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$table = $this->Application->getUnitOption($this->Prefix,'TableName');
$cat_id = $this->Application->GetVar('m_cat_id');
if ($cat_id > 0) {
$sql = 'SELECT ParentId
FROM '.$table.'
WHERE '.$id_field.' = '.$cat_id;
$parent_id = $this->Conn->GetOne($sql);
}
return $parent_id;
}
function InitCacheUpdater($params)
{
safeDefine('CACHE_PERM_CHUNK_SIZE', 30);
$continue = $this->Application->GetVar('continue');
$total_cats = (int) $this->Conn->GetOne('SELECT COUNT(*) FROM '.TABLE_PREFIX.'Category');
if ($continue === false && $total_cats > CACHE_PERM_CHUNK_SIZE) {
// first step, if category count > CACHE_PERM_CHUNK_SIZE, then ask for cache update
return true;
}
if ($continue === false) {
// if we don't have to ask, then assume user selected "Yes" in permcache update dialog
$continue = 1;
}
$updater =& $this->Application->recallObject('kPermCacheUpdater', null, Array('continue' => $continue));
if ($continue === '0') { // No in dialog
$updater->clearData();
$this->Application->Redirect($params['destination_template']);
}
$ret = false; // don't ask for update
if ($continue == 1) { // Initial run
$updater->setData();
}
if ($continue == 2) { // Continuing
// called from AJAX request => returns percent
$needs_more = true;
while ($needs_more && $updater->iteration <= CACHE_PERM_CHUNK_SIZE) {
// until proceeeded in this step category count exceeds category per step limit
$needs_more = $updater->DoTheJob();
}
if ($needs_more) {
// still some categories are left for next step
$updater->setData();
}
else {
// all done -> redirect
$updater->clearData();
$this->Application->RemoveVar('PermCache_UpdateRequired');
$this->Application->Redirect($params['destination_template']);
}
$ret = $updater->getDonePercent();
}
return $ret;
}
/**
* Parses warning block, but with style="display: none;". Used during permissions saving from AJAX
*
* @param Array $params
* @return string
*/
function SaveWarning($params)
{
if ($this->Prefix != 'c') {
// don't use this method for other prefixes then Category, that use this tag processor
parent::SaveWarning($params);
return ;
}
$main_prefix = getArrayValue($params, 'main_prefix');
if ($main_prefix && $main_prefix != '$main_prefix') {
$top_prefix = $main_prefix;
}
else {
$top_prefix = $this->Application->GetTopmostPrefix($this->Prefix);
}
$temp_tables = substr($this->Application->GetVar($top_prefix.'_mode'), 0, 1) == 't';
$modified = $this->Application->RecallVar($top_prefix.'_modified');
if (!$temp_tables) {
$this->Application->RemoveVar($top_prefix.'_modified');
return '';
}
$block_name = $this->SelectParam($params, 'render_as,name');
if ($block_name) {
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $block_name;
$block_params['edit_mode'] = $temp_tables ? 1 : 0;
$block_params['display'] = $temp_tables && $modified ? 1 : 0;
return $this->Application->ParseBlock($block_params);
}
else {
return $temp_tables && $modified ? 1 : 0;
}
return ;
}
/**
* Allows to detect if this prefix has something in clipboard
*
* @param Array $params
* @return bool
*/
function HasClipboard($params)
{
$clipboard = $this->Application->RecallVar('clipboard');
if ($clipboard) {
$clipboard = unserialize($clipboard);
foreach ($clipboard as $prefix => $clipboard_data) {
foreach ($clipboard_data as $mode => $ids) {
if (count($ids)) return 1;
}
}
}
return 0;
}
/**
* Allows to detect if root category being edited
*
* @param Array $params
*/
function IsRootCategory($params)
{
$object =& $this->getObject($params);
return $object->IsRoot();
}
function CatalogItemCount($params)
{
$object =& $this->GetList($params);
if (!$object->Counted) {
$object->CountRecs();
}
return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' / '.$object->NoFilterCount : $object->RecordsCount;
}
/**
* Print grid pagination using
* block names specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintPages($params)
{
if ($this->Application->Parser->GetParam('no_special')) {
$params['no_special'] = $this->Application->Parser->GetParam('no_special');
}
return parent::PrintPages($params);
}
function InitCatalog($params)
{
$tab_prefixes = $this->Application->GetVar('tp'); // {all, <prefixes_list>, none}
if ($tab_prefixes === false) $tab_prefixes = 'all';
$skip_prefixes = isset($params['skip_prefixes']) && $params['skip_prefixes'] ? explode(',', $params['skip_prefixes']) : Array();
// get all prefixes available
$prefixes = Array();
foreach ($this->Application->ModuleInfo as $module_name => $module_data) {
if ($module_data['Var'] == 'm') continue;
$prefixes[] = $module_data['Var'];
}
if ($tab_prefixes == 'none') {
$skip_prefixes = array_unique(array_merge($skip_prefixes, $prefixes));
}
elseif ($tab_prefixes != 'all') {
// prefix list here
$tab_prefixes = explode(',', $tab_prefixes); // list of prefixes that should stay
$skip_prefixes = array_unique(array_merge($skip_prefixes, array_diff($prefixes, $tab_prefixes)));
}
$params['name'] = $params['render_as'];
$params['skip_prefixes'] = implode(',', $skip_prefixes);
return $this->Application->ParseBlock($params, 1);
}
+
+ function IsActive($params)
+ {
+ $cat_id = $this->Application->GetVar('c_id');
+ $current_cat = $this->getObject($params);
+ $current_path = $current_cat->GetDBField('ParentPath');
+
+ static $parent_path = null;
+ if (!isset($parent_path)) {
+ $parent_path = $this->Conn->GetOne('SELECT ParentPath FROM '.TABLE_PREFIX.'Category WHERE CategoryId = '.$this->Application->GetVar('m_cat_id'));
+ }
+ return strpos($parent_path, $current_path) !== false;
+ }
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/categories/categories_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.32
\ No newline at end of property
+1.33
\ No newline at end of property
Index: trunk/core/units/categories/categories_event_handler.php
===================================================================
--- trunk/core/units/categories/categories_event_handler.php (revision 7634)
+++ trunk/core/units/categories/categories_event_handler.php (revision 7635)
@@ -1,559 +1,563 @@
<?php
class CategoriesEventHandler extends kDBEventHandler {
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnRebuildCache' => Array('self' => 'add|edit'),
// 'OnSave' => Array('self' => 'add|edit')
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if (!$this->Application->IsAdmin()) {
if ($event->Name == 'OnSetSortingDirect') {
// allow sorting on front event without view permission
return true;
}
}
if ($event->Name == 'OnEdit' || $event->Name == 'OnSave') {
// check each id from selected individually and only if all are allowed proceed next
if ($event->Name == 'OnEdit') {
$selected_ids = implode(',', $this->StoreSelectedIDs($event));
}
else {
$selected_ids = implode(',', $this->getSelectedIDs($event, true));
}
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
if (strlen($selected_ids) > 0) {
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'SELECT '.$id_field.', CreatedById
FROM '.$table_name.' item_table
WHERE '.$id_field.' IN ('.$selected_ids.')';
$items = $this->Conn->Query($sql, $id_field);
}
else {
// when creating new category, then no IDs are stored in session
$parent_cat = $this->Application->RecallVar('m_cat_id');
$items[$parent_cat] = Array (
$id_field => $parent_cat,
'CreatedById' => $this->Application->RecallVar('user_id'),
);
}
$perm_value = true;
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
foreach ($items as $item_id => $item_data) {
if ($perm_helper->ModifyCheckPermission($item_data['CreatedById'], $item_data[$id_field], $event->Prefix) == 0) {
// one of items selected has no permission
$perm_value = false;
break;
}
}
if (!$perm_value) {
$event->status = erPERM_FAIL;
}
return $perm_value;
}
return parent::CheckPermission($event);
}
/**
* Apply system filter to categories list
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
parent::SetCustomQuery($event);
$types=$event->getEventParam('types');
$except_types=$event->getEventParam('except');
$object =& $event->getObject();
$type_clauses = Array();
$object =& $event->getObject();
/* @var $object kDBList */
// hide categories with status = 4 (system categories)
$object->addFilter('system_categories', '%1$s.Status <> 4');
if ( $event->getEventParam('parent_cat_id') ) {
$parent_cat_id = $event->getEventParam('parent_cat_id');
if ($parent_cat_id == 'Root') {
$module_name = $event->getEventParam('module') ? $event->getEventParam('module') : 'In-Commerce';
$module =& $this->Application->recallObject('mod.'.$module_name);
$parent_cat_id = $module->GetDBField('RootCat');
}
}
else {
$parent_cat_id = $this->Application->GetVar('c_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
if (!$parent_cat_id) {
$parent_cat_id = 0;
}
}
if ("$parent_cat_id" != 'any') {
if ($event->getEventParam('recursive')) {
$current_path = $this->Conn->GetOne('SELECT ParentPath FROM '.TABLE_PREFIX.'Category WHERE CategoryId='.$parent_cat_id);
$subcats = $this->Conn->GetCol('SELECT CategoryId FROM '.TABLE_PREFIX.'Category WHERE ParentPath LIKE "'.$current_path.'%" ');
$object->addFilter('parent_filter', 'ParentId IN ('.implode(', ', $subcats).')');
}
else {
$object->addFilter('parent_filter', 'ParentId = '.$parent_cat_id);
}
}
$object->addFilter('perm_filter', 'PermId = 1'); // check for CATEGORY.VIEW permission
if ($this->Application->RecallVar('user_id') != -1) {
// apply permission filters to all users except "root"
$groups = explode(',',$this->Application->RecallVar('UserGroups'));
foreach ($groups as $group) {
$view_filters[] = 'FIND_IN_SET('.$group.', acl)';
}
$view_filter = implode(' OR ', $view_filters);
$object->addFilter('perm_filter2', $view_filter);
}
if (!$this->Application->IsAdmin()) {
// apply status filter only on front
$object->addFilter('status_filter', $object->TableName.'.Status = 1');
}
if(strpos($types, 'category_related') !== false)
{
$object->removeFilter('parent_filter');
$resource_id = $this->Conn->GetOne('
SELECT ResourceId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
WHERE CategoryId = '.$parent_cat_id
);
$sql = 'SELECT DISTINCT(TargetId) FROM '.TABLE_PREFIX.'Relationship
WHERE SourceId = '.$resource_id.' AND SourceType = 1';
$related_cats = $this->Conn->GetCol($sql);
$related_cats = is_array($related_cats) ? $related_cats : Array();
$sql = 'SELECT DISTINCT(SourceId) FROM '.TABLE_PREFIX.'Relationship
WHERE TargetId = '.$resource_id.' AND TargetType = 1 AND Type = 1';
$related_cats2 = $this->Conn->GetCol($sql);
$related_cats2 = is_array($related_cats2) ? $related_cats2 : Array();
$related_cats = array_unique( array_merge( $related_cats2, $related_cats ) );
if($related_cats)
{
$type_clauses['category_related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_cats).')';
$type_clauses['category_related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_cats).')';
}
else
{
$type_clauses['category_related']['include'] = '0';
$type_clauses['category_related']['except'] = '1';
}
$type_clauses['category_related']['having_filter'] = false;
}
if(strpos($types, 'product_related') !== false)
{
$object->removeFilter('parent_filter');
$product_id = $event->getEventParam('product_id') ? $event->getEventParam('product_id') : $this->Application->GetVar('p_id');
$resource_id = $this->Conn->GetOne('
SELECT ResourceId FROM '.$this->Application->getUnitOption('p', 'TableName').'
WHERE ProductId = '.$product_id
);
$sql = 'SELECT DISTINCT(TargetId) FROM '.TABLE_PREFIX.'Relationship
WHERE SourceId = '.$resource_id.' AND TargetType = 1';
$related_cats = $this->Conn->GetCol($sql);
$related_cats = is_array($related_cats) ? $related_cats : Array();
$sql = 'SELECT DISTINCT(SourceId) FROM '.TABLE_PREFIX.'Relationship
WHERE TargetId = '.$resource_id.' AND SourceType = 1 AND Type = 1';
$related_cats2 = $this->Conn->GetCol($sql);
$related_cats2 = is_array($related_cats2) ? $related_cats2 : Array();
$related_cats = array_unique( array_merge( $related_cats2, $related_cats ) );
if($related_cats)
{
$type_clauses['product_related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_cats).')';
$type_clauses['product_related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_cats).')';
}
else
{
$type_clauses['product_related']['include'] = '0';
$type_clauses['product_related']['except'] = '1';
}
$type_clauses['product_related']['having_filter'] = false;
}
/********************************************/
$includes_or_filter =& $this->Application->makeClass('kMultipleFilter');
$includes_or_filter->setType(FLT_TYPE_OR);
$excepts_and_filter =& $this->Application->makeClass('kMultipleFilter');
$excepts_and_filter->setType(FLT_TYPE_AND);
$includes_or_filter_h =& $this->Application->makeClass('kMultipleFilter');
$includes_or_filter_h->setType(FLT_TYPE_OR);
$excepts_and_filter_h =& $this->Application->makeClass('kMultipleFilter');
$excepts_and_filter_h->setType(FLT_TYPE_AND);
$except_types_array=explode(',', $types);
if ($types){
$types_array=explode(',', $types);
for ($i=0; $i<sizeof($types_array); $i++){
$type=trim($types_array[$i]);
if (isset($type_clauses[$type])){
if ($type_clauses[$type]['having_filter']){
$includes_or_filter_h->removeFilter('filter_'.$type);
$includes_or_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['include']);
}else{
$includes_or_filter->removeFilter('filter_'.$type);
$includes_or_filter->addFilter('filter_'.$type, $type_clauses[$type]['include']);
}
}
}
}
if ($except_types){
$except_types_array=explode(',', $except_types);
for ($i=0; $i<sizeof($except_types_array); $i++){
$type=trim($except_types_array[$i]);
if (isset($type_clauses[$type])){
if ($type_clauses[$type]['having_filter']){
$excepts_and_filter_h->removeFilter('filter_'.$type);
$excepts_and_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['except']);
}else{
$excepts_and_filter->removeFilter('filter_'.$type);
$excepts_and_filter->addFilter('filter_'.$type, $type_clauses[$type]['except']);
}
}
}
}
$object->addFilter('includes_filter', $includes_or_filter);
$object->addFilter('excepts_filter', $excepts_and_filter);
$object->addFilter('includes_filter_h', $includes_or_filter_h, HAVING_FILTER);
$object->addFilter('excepts_filter_h', $excepts_and_filter_h, HAVING_FILTER);
}
/**
* Enter description here...
*
* @param kEvent $event
* @return int
*/
function GetPassedId(&$event)
{
if ( $this->Application->IsAdmin()) {
return parent::getPassedID($event);
}
return $this->Application->GetVar('m_cat_id');
}
function ParentGetPassedId(&$event)
{
return parent::GetPassedId($event);
}
/**
* Adds calculates fields for item statuses
*
* @param kCatDBItem $object
* @param kEvent $event
*/
function prepareObject(&$object, &$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
- $object->addCalculatedField('IsNew', ' IF(%1$s.NewItem = 2,
- IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - '.
- $this->Application->ConfigValue('Category_DaysNew').
- '*3600*24), 1, 0),
- %1$s.NewItem
- )');
+ $object->addCalculatedField(
+ 'IsNew',
+ ' IF(%1$s.NewItem = 2,
+ IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - '.
+ $this->Application->ConfigValue('Category_DaysNew').
+ '*3600*24), 1, 0),
+ %1$s.NewItem
+ )');
}
/**
* Set correct parent path for newly created categories
*
* @param kEvent $event
*/
function OnAfterCopyToLive(&$event)
{
$parent_path = false;
$object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true, 'live_table' => true));
$object->Load($event->getEventParam('id'));
if ($event->getEventParam('temp_id') == 0) {
if ($object->isLoaded()) {
// update path only for real categories (not including "Home" root category)
$fields_hash = Array('ParentPath' => $object->buildParentPath());
$this->Conn->doUpdate($fields_hash, $object->TableName, 'CategoryId = '.$object->GetID());
$parent_path = $fields_hash['ParentPath'];
}
}
else {
$parent_path = $object->GetDBField('ParentPath');
}
if ($parent_path) {
$cache_updater =& $this->Application->recallObject('kPermCacheUpdater', null, array('strict_path' => $parent_path));
$cache_updater->OneStepRun();
$cache_updater->StrictPath = false;
}
}
/**
* Set cache modification mark if needed
*
* @param kEvent $event
*/
function OnBeforeDeleteFromLive(&$event)
{
$id = $event->getEventParam('id');
// loding anyway, because this object is needed by "c-perm:OnBeforeDeleteFromLive" event
$temp_object =& $event->getObject( Array('skip_autoload' => true) );
$temp_object->Load($id);
if ($id == 0) {
if ($temp_object->isLoaded()) {
// new category -> update chache (not loaded when "Home" category)
$this->Application->StoreVar('PermCache_UpdateRequired', 1);
}
return ;
}
// existing category was edited, check if in-cache fields are modified
$live_object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('live_table' => true, 'skip_autoload' => true));
$live_object->Load($id);
$cached_fields = Array('Name', 'Filename', 'CategoryTemplate', 'ParentId');
foreach ($cached_fields as $cached_field) {
if ($live_object->GetDBField($cached_field) != $temp_object->GetDBField($cached_field)) {
// use session instead of REQUEST because of permission editing in category can contain
// multiple submits, that changes data before OnSave event occurs
$this->Application->StoreVar('PermCache_UpdateRequired', 1);
break;
}
}
}
/**
* Calls kDBEventHandler::OnSave original event
* Used in proj-cms:StructureEventHandler->OnSave
*
* @param kEvent $event
*/
function parentOnSave(&$event)
{
parent::OnSave($event);
}
/**
* Checks cache update mark and redirect to cache if needed
*
* @param kEvent $event
*/
function OnSave(&$event)
{
$object =& $event->getObject();
if ($object->IsRoot()) {
$event->setEventParam('master_ids', Array(0));
}
parent::OnSave($event);
if ($event->status == erSUCCESS && $this->Application->RecallVar('PermCache_UpdateRequired')) {
// "catalog" should be in opener stack by now
$wid = $this->Application->GetVar('m_wid');
$stack_name = rtrim('opener_stack_'.$wid, '_');
$opener_stack = unserialize($this->Application->RecallVar($stack_name));
$opener_stack[0] = str_replace('catalog', 'categories/cache_updater', $opener_stack[0]);
$this->Application->StoreVar($stack_name, serialize($opener_stack));
$this->Application->RemoveVar('PermCache_UpdateRequired');
}
}
/**
* Deletes all selected items.
* Automatically recurse into sub-items using temp handler, and deletes sub-items
* by calling its Delete method if sub-item has AutoDelete set to true in its config file
*
* @param kEvent $event
*/
function OnMassDelete(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
// $event->status = erSUCCESS;
$ids = $this->StoreSelectedIDs($event);
if ($ids) {
$recursive_helper =& $this->Application->recallObject('RecursiveHelper');
/* @var $recursive_helper kRecursiveHelper */
foreach ($ids as $id) {
$recursive_helper->DeleteCategory($id, $event->Prefix);
}
}
$this->clearSelectedIDs($event);
}
/**
* Add selected items to clipboard with mode = COPY (CLONE)
*
* @param kEvent $event
*/
function OnCopy(&$event)
{
$this->Application->RemoveVar('clipboard');
$clipboard_helper =& $this->Application->recallObject('ClipboardHelper');
$clipboard_helper->setClipboard($event, 'copy', $this->StoreSelectedIDs($event));
+ $this->clearSelectedIDs($event);
}
/**
* Add selected items to clipboard with mode = CUT
*
* @param kEvent $event
*/
function OnCut(&$event)
{
$this->Application->RemoveVar('clipboard');
$clipboard_helper =& $this->Application->recallObject('ClipboardHelper');
$clipboard_helper->setClipboard($event, 'cut', $this->StoreSelectedIDs($event));
+ $this->clearSelectedIDs($event);
}
/**
* Controls all item paste operations. Can occur only with filled clipbord.
*
* @param kEvent $event
*/
function OnPasteClipboard(&$event)
{
$clipboard = unserialize( $this->Application->RecallVar('clipboard') );
foreach ($clipboard as $prefix => $clipboard_data) {
$paste_event = new kEvent($prefix.':OnPaste', Array('clipboard_data' => $clipboard_data));
$this->Application->HandleEvent($paste_event);
$event->redirect = $paste_event->redirect;
$event->redirect_params = $paste_event->redirect_params;
$event->status = $paste_event->status;
}
}
/**
* Paste categories with subitems from clipboard
*
* @param kEvent $event
*/
function OnPaste(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$clipboard_data = $event->getEventParam('clipboard_data');
if (!$clipboard_data['cut'] && !$clipboard_data['copy']) {
return false;
}
$recursive_helper =& $this->Application->recallObject('RecursiveHelper');
/* @var $recursive_helper kRecursiveHelper */
if ($clipboard_data['cut']) {
$recursive_helper->MoveCategories($clipboard_data['cut'], $this->Application->GetVar('m_cat_id'));
}
if ($clipboard_data['copy']) {
foreach ($clipboard_data['copy'] as $id) {
$recursive_helper->PasteCategory($id, $event->Prefix);
}
}
if ($clipboard_data['cut'] || $clipboard_data['copy']) {
- $event->redirect = 'categories/cache_updater';
+ $event->redirect = 'in-portal/categories/cache_updater';
}
}
/**
* Occurs when pasting category
*
* @param kEvent $event
*/
/*function OnCatPaste(&$event)
{
$inp_clipboard = $this->Application->RecallVar('ClipBoard');
$inp_clipboard = explode('-', $inp_clipboard, 2);
if($inp_clipboard[0] == 'COPY')
{
$saved_cat_id = $this->Application->GetVar('m_cat_id');
$cat_ids = $event->getEventParam('cat_ids');
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table = $this->Application->getUnitOption($event->Prefix, 'TableName');
$ids_sql = 'SELECT '.$id_field.' FROM '.$table.' WHERE ResourceId IN (%s)';
$resource_ids_sql = 'SELECT ItemResourceId FROM '.TABLE_PREFIX.'CategoryItems WHERE CategoryId = %s AND PrimaryCat = 1';
$object =& $this->Application->recallObject($event->Prefix.'.item', $event->Prefix, Array('skip_autoload' => true));
foreach($cat_ids as $source_cat => $dest_cat)
{
$item_resource_ids = $this->Conn->GetCol( sprintf($resource_ids_sql, $source_cat) );
if(!$item_resource_ids) continue;
$this->Application->SetVar('m_cat_id', $dest_cat);
$item_ids = $this->Conn->GetCol( sprintf($ids_sql, implode(',', $item_resource_ids) ) );
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
if($item_ids) $temp->CloneItems($event->Prefix, $event->Special, $item_ids);
}
$this->Application->SetVar('m_cat_id', $saved_cat_id);
}
}*/
/**
* Cleares clipboard content
*
* @param kEvent $event
*/
function OnClearClipboard(&$event)
{
$this->Application->RemoveVar('clipboard');
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/categories/categories_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.26
\ No newline at end of property
+1.27
\ No newline at end of property
Index: trunk/core/units/categories/categories_item.php
===================================================================
--- trunk/core/units/categories/categories_item.php (revision 7634)
+++ trunk/core/units/categories/categories_item.php (revision 7635)
@@ -1,181 +1,233 @@
<?php
class CategoriesItem extends kDBItem
{
function Create($force_id=false, $system_create=false)
{
$this->checkFilename();
$this->generateFilename();
if (!$this->Validate()) return false;
$this->SetDBField('ResourceId', $this->Application->NextResourceId());
$this->SetDBField('CreatedById', $this->Application->RecallVar('user_id') );
$this->SetDBField('CreatedOn_date', adodb_mktime() );
$this->SetDBField('CreatedOn_time', adodb_mktime() );
$parent_category = $this->GetDBField('ParentId') > 0 ? $this->GetDBField('ParentId') : $this->Application->GetVar('m_cat_id');
$this->SetDBField('ParentId', $parent_category);
$ret = parent::Create($force_id, $system_create);
if ($ret) {
$sql = 'UPDATE %s SET ParentPath = %s WHERE CategoryId = %s';
$parent_path = $this->buildParentPath();
$this->Conn->Query( sprintf($sql, $this->TableName, $this->Conn->qstr($parent_path), $this->GetID() ) );
$this->SetDBField('ParentPath', $parent_path);
}
return $ret;
}
function Update($id=null, $system_update=false)
{
$this->checkFilename();
$this->generateFilename();
$ret = parent::Update($id, $system_update);
return $ret;
}
function buildParentPath()
{
$parent_id = $this->GetDBField('ParentId');
if ($parent_id == 0) {
$parent_path = '|';
}
else {
$cat_table = $this->Application->getUnitOption($this->Prefix, 'TableName');
$sql = 'SELECT ParentPath FROM '.$cat_table.' WHERE CategoryId = %s';
$parent_path = $this->Conn->GetOne( sprintf($sql, $parent_id) );
}
return $parent_path.$this->GetID().'|';
}
/**
* replace not allowed symbols with "_" chars + remove duplicate "_" chars in result
*
* @param string $string
* @return string
*/
function stripDisallowed($string)
{
$not_allowed = Array( ' ', '\\', '/', ':', '*', '?', '"', '<', '>', '|', '`',
'~', '!', '@', '#', '$', '%', '^', '&', '(', ')', '~',
'+', '=', '-', '{', '}', ']', '[', "'", ';', '.', ',');
$string = str_replace($not_allowed, '_', $string);
$string = preg_replace('/(_+)/', '_', $string);
$string = $this->checkAutoFilename($string);
return $string;
}
function checkFilename()
{
if( !$this->GetDBField('AutomaticFilename') )
{
$filename = $this->GetDBField('Filename');
$this->SetDBField('Filename', $this->stripDisallowed($filename) );
}
}
function checkAutoFilename($filename)
{
if(!$filename) return $filename;
$item_id = !$this->GetID() ? 0 : $this->GetID();
// check temp table
$sql_temp = 'SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE Filename = '.$this->Conn->qstr($filename);
$found_temp_ids = $this->Conn->GetCol($sql_temp);
// check live table
$sql_live = 'SELECT '.$this->IDField.' FROM '.$this->Application->GetLiveName($this->TableName).' WHERE Filename = '.$this->Conn->qstr($filename);
$found_live_ids = $this->Conn->GetCol($sql_live);
$found_item_ids = array_unique( array_merge($found_temp_ids, $found_live_ids) );
$has_page = preg_match('/(.*)_([\d]+)([a-z]*)$/', $filename, $rets);
$duplicates_found = (count($found_item_ids) > 1) || ($found_item_ids && $found_item_ids[0] != $item_id);
if ($duplicates_found || $has_page) // other category has same filename as ours OR we have filename, that ends with _number
{
$append = $duplicates_found ? '_a' : '';
if($has_page)
{
$filename = $rets[1].'_'.$rets[2];
$append = $rets[3] ? $rets[3] : '_a';
}
// check live & temp table
$sql_temp = 'SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE (Filename = %s) AND ('.$this->IDField.' != '.$item_id.')';
$sql_live = 'SELECT '.$this->IDField.' FROM '.$this->Application->GetLiveName($this->TableName).' WHERE (Filename = %s) AND ('.$this->IDField.' != '.$item_id.')';
while ( $this->Conn->GetOne( sprintf($sql_temp, $this->Conn->qstr($filename.$append)) ) > 0 ||
$this->Conn->GetOne( sprintf($sql_live, $this->Conn->qstr($filename.$append)) ) > 0 )
{
if (substr($append, -1) == 'z') $append .= 'a';
$append = substr($append, 0, strlen($append) - 1) . chr( ord( substr($append, -1) ) + 1 );
}
return $filename.$append;
}
return $filename;
}
/**
* Generate item's filename based on it's title field value
*
* @return string
*/
function generateFilename()
{
if ( !$this->GetDBField('AutomaticFilename') && $this->GetDBField('Filename') ) return false;
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$name = $this->stripDisallowed( $this->GetDBField( $ml_formatter->LangFieldName('Name', true) ) );
if ( $name != $this->GetDBField('Filename') ) $this->SetDBField('Filename', $name);
}
/**
* Allows to detect if root category being edited
*
* @param Array $params
*/
function IsRoot()
{
$category_id = $this->Application->GetVar($this->getPrefixSpecial().'_id');
if (is_numeric($category_id) && $category_id == 0 && !$this->Application->GetVar($this->getPrefixSpecial().'_PreCreate')) {
$sql = 'SELECT '.$this->IDField.'
FROM '.$this->TableName.'
WHERE '.$this->IDField.' = '.$category_id;
if ($this->Conn->GetOne($sql) === false) {
return true;
}
}
return false;
}
/**
* Sets correct name to Home category while editing it
*
* @return bool
*/
function IsNewItem()
{
if ($this->IsRoot() && $this->Prefix == 'c') {
$title_field = $this->Application->getUnitOption($this->Prefix, 'TitleField');
$category_name = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') );
$this->SetDBField($title_field, $category_name);
return false;
}
return parent::IsNewItem();
}
+
+ /**
+ * Sets new name for item in case if it is beeing copied
+ * in same table
+ *
+ * @param array $master Table data from TempHandler
+ * @param int $foreign_key ForeignKey value to filter name check query by
+ * @access private
+ */
+ function NameCopy($master=null, $foreign_key=null)
+ {
+ $title_field = $this->Application->getUnitOption($this->Prefix, 'TitleField');
+ if (!$title_field || isset($this->CalculatedFields[$title_field]) ) return;
+
+ $new_name = $this->GetDBField($title_field);
+ $cat_id = $this->Application->GetVar('m_cat_id');
+ $this->SetDBField('ParentId', $cat_id);
+ $original_checked = false;
+ do {
+ if ( preg_match('/Copy ([0-9]*) *of (.*)/', $new_name, $regs) ) {
+ $new_name = 'Copy '.($regs[1]+1).' of '.$regs[2];
+ }
+ elseif ($original_checked) {
+ $new_name = 'Copy of '.$new_name;
+ }
+
+ // if we are cloning in temp table this will look for names in temp table,
+ // since object' TableName contains correct TableName (for temp also!)
+ // if we are cloning live - look in live
+ $query = 'SELECT '.$title_field.' FROM '.$this->TableName.'
+ WHERE ParentId = '.$cat_id.' AND '.$title_field.' = '.$this->Conn->qstr($new_name);
+
+ $foreign_key_field = getArrayValue($master, 'ForeignKey');
+ $foreign_key_field = is_array($foreign_key_field) ? $foreign_key_field[ $master['ParentPrefix'] ] : $foreign_key_field;
+
+ if ($foreign_key_field && isset($foreign_key)) {
+ $query .= ' AND '.$foreign_key_field.' = '.$foreign_key;
+ }
+
+ $res = $this->Conn->GetOne($query);
+
+ /*// if not found in live table, check in temp table if applicable
+ if ($res === false && $object->Special == 'temp') {
+ $query = 'SELECT '.$name_field.' FROM '.$this->GetTempName($master['TableName']).'
+ WHERE '.$name_field.' = '.$this->Conn->qstr($new_name);
+ $res = $this->Conn->GetOne($query);
+ }*/
+
+ $original_checked = true;
+ } while ($res !== false);
+ $this->SetDBField($title_field, $new_name);
+ }
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/categories/categories_item.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.11
\ No newline at end of property
+1.12
\ No newline at end of property
Index: trunk/core/units/categories/cache_updater.php
===================================================================
--- trunk/core/units/categories/cache_updater.php (revision 7634)
+++ trunk/core/units/categories/cache_updater.php (revision 7635)
@@ -1,416 +1,416 @@
<?php
class clsRecursionStack
{
var $Stack;
function clsRecursionStack()
{
$this->Stack = Array();
}
function Push($values)
{
array_push($this->Stack, $values);
}
function Pop()
{
if ($this->Count() > 0) {
return array_pop($this->Stack);
}
else {
return false;
}
}
function Get()
{
if ($this->Count() > 0) {
// return end($this->Stack);
return $this->Stack[count($this->Stack)-1];
}
else {
return false;
}
}
function Update($values)
{
$this->Stack[count($this->Stack)-1] = $values;
}
function Count()
{
return count($this->Stack);
}
}
class clsCachedPermissions
{
var $Allow = Array();
var $Deny = Array();
var $CatId;
function clsCachedPermissions($CatId)
{
$this->CatId = $CatId;
}
function SetCatId($CatId)
{
$this->CatId = $CatId;
}
function CheckPermArray($Perm)
{
if (!isset($this->Allow[$Perm])) {
$this->Allow[$Perm] = array();
$this->Deny[$Perm] = array();
}
}
function AddAllow($Perm, $GroupId)
{
$this->CheckPermArray($Perm);
if (!in_array($GroupId, $this->Allow[$Perm])) {
array_push($this->Allow[$Perm], $GroupId);
$this->RemoveDeny($Perm, $GroupId);
}
}
function AddDeny($Perm, $GroupId)
{
$this->CheckPermArray($Perm);
if (!in_array($GroupId, $this->Deny[$Perm])) {
array_push($this->Deny[$Perm], $GroupId);
$this->RemoveAllow($Perm, $GroupId);
}
}
function RemoveDeny($Perm, $GroupId)
{
if (in_array($GroupId, $this->Deny[$Perm])) {
array_splice($this->Deny[$Perm], array_search($GroupId, $this->Deny[$Perm]), 1);
}
}
function RemoveAllow($Perm, $GroupId)
{
if (in_array($GroupId, $this->Allow[$Perm])) {
array_splice($this->Allow[$Perm], array_search($GroupId, $this->Allow[$Perm]), 1);
}
}
function GetInsertSQL()
{
$values = array();
$has_deny = array();
// don't write DACL at all
/*foreach ($this->Deny as $perm => $groups) {
if (count($groups) > 0) {
$values[] = '('.$this->CatId.', '.$perm.', "", "'.join(',', $groups).'")';
$has_deny[] = $perm;
}
}*/
foreach ($this->Allow as $perm => $groups) {
// if (in_array($perm, $has_deny)) continue;
if (count($groups) > 0) {
$values[] = '(' .$this->CatId. ', ' .$perm. ', "' .join(',', $groups). '", "")';
}
}
if (!$values) return '';
$sql = 'INSERT INTO '.TABLE_PREFIX.'PermCache (CategoryId, PermId, ACL, DACL) VALUES '.join(',', $values);
return $sql;
}
}
class kPermCacheUpdater extends kHelper
{
/**
* Holds Stack
*
* @var clsRecursionStack
*/
var $Stack;
var $iteration;
var $totalCats;
var $doneCats;
var $table;
var $primaryLanguageId = 0;
var $languageCount = 0;
var $root_prefixes = Array();
var $StrictPath = false;
function Init($prefix, $special, $event_params = null)
{
parent::Init($prefix, $special, $event_params);
$continuing = isset($event_params['continue']) ? $event_params['continue'] : 1;
$this->StrictPath = isset($event_params['strict_path']) ? $event_params['strict_path'] : false;
if ($this->StrictPath && !is_array($this->StrictPath)) {
$this->StrictPath = explode('|', trim($this->StrictPath, '|'));
}
// cache widely used values to speed up process: begin
$ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
$this->languageCount = $ml_helper->getLanguageCount();
$this->primaryLanguageId = $this->Application->GetDefaultLanguageId();
// cache widely used values to speed up process: end
foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
$this->root_prefixes[ $module_info['RootCat'] ] = $module_info['Var'];
}
$this->iteration = 0;
$this->table = $this->Application->GetTempName('permCacheUpdate');
if ($continuing == 1) {
$this->InitUpdater();
}
elseif ($continuing == 2) {
$this->getData();
}
}
function InitUpdater()
{
$this->Stack =& new clsRecursionStack();
$sql = 'DELETE FROM '.TABLE_PREFIX.'PermCache';
if ($this->StrictPath) {
$sql .= ' WHERE CategoryId IN ('.implode(',',$this->StrictPath).')';
}
$this->Conn->Query($sql);
$this->initData();
}
function getDonePercent()
{
if(!$this->totalCats)return 0;
- return min(100, intval( round( $this->doneCats / $this->totalCats * 100 ) ));
+ return min(100, intval( floor( $this->doneCats / $this->totalCats * 100 ) ));
}
function getData()
{
$tmp = $this->Conn->GetOne('SELECT data FROM '.$this->table);
if ($tmp) $tmp = unserialize($tmp);
$this->totalCats = isset($tmp['totalCats']) ? $tmp['totalCats'] : 0;
$this->doneCats = isset($tmp['doneCats']) ? $tmp['doneCats'] : 0;
if (isset($tmp['stack'])) {
$this->Stack = $tmp['stack'];
}
else {
$this->Stack = & new clsRecursionStack();
}
}
function setData()
{
$tmp = Array (
'totalCats' => $this->totalCats,
'doneCats' => $this->doneCats,
'stack' => $this->Stack,
);
$this->Conn->Query('DELETE FROM '.$this->table);
$fields_hash = Array('data' => serialize($tmp));
$this->Conn->doInsert($fields_hash, $this->table);
}
function initData()
{
$this->clearData(); // drop table before starting anyway
$this->Conn->Query('CREATE TABLE '.$this->table.'(data LONGTEXT)');
$this->totalCats = (int)$this->Conn->GetOne('SELECT COUNT(*) FROM '.TABLE_PREFIX.'Category');
$this->doneCats = 0;
}
function clearData()
{
$this->Conn->Query('DROP TABLE IF EXISTS '.$this->table);
$this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = \'ForcePermCacheUpdate\'');
}
function DoTheJob()
{
$data = $this->Stack->Get();
if ($data === false) { //If Stack is empty
$data['current_id'] = 0;
$data['titles'] = Array();
$data['parent_path'] = Array();
$data['named_path'] = Array();
$data['category_template'] = '';
$data['item_template'] = '';
$data['children_count'] = 0;
$this->Stack->Push($data);
}
if (!isset($data['queried'])) {
$this->QueryTitle($data);
$this->QueryChildren($data);
$data['children_count'] = count($data['children']);
$this->QueryPermissions($data);
$data['queried'] = 1;
if ($sql = $data['perms']->GetInsertSQL()) {
$this->Conn->Query($sql);
// $this->doneCats++; // moved to the place where it pops out of the stack by Kostja
}
$this->iteration++;
}
// start with first child if we haven't started yet
if (!isset($data['current_child'])) $data['current_child'] = 0;
// if we have more children
if (isset($data['children'][$data['current_child']])) {
if ($this->StrictPath) {
while ( isset($data['children'][ $data['current_child'] ]) && !in_array($data['children'][ $data['current_child'] ], $this->StrictPath) ) {
$data['current_child']++;
continue;
}
if (!isset($data['children'][ $data['current_child'] ])) return false; //error
}
$next_data = Array();
$next_data['titles'] = $data['titles'];
$next_data['parent_path'] = $data['parent_path'];
$next_data['named_path'] = $data['named_path'];
$next_data['category_template'] = $data['category_template'];
$next_data['item_template'] = $data['item_template'];
$next_data['current_id'] = $data['children'][ $data['current_child'] ]; //next iteration should process child
$next_data['perms'] = $data['perms']; //we should copy our permissions to child - inheritance
$next_data['perms']->SetCatId($next_data['current_id']);
$data['current_child']++;
$this->Stack->Update($data); //we need to update ourself for the iteration after the next (or further) return to next child
$this->Stack->Push($next_data); //next iteration should process this child
return true;
}
else {
$this->UpdateCachedPath($data);
$prev_data = $this->Stack->Pop(); //remove ourself from stack if we have finished all the childs (or there are none)
// we are getting here if we finished with current level, so check if it's first level - then bail out.
$this->doneCats++; // moved by Kostja from above, seems to fix the prob
$has_more = $this->Stack->Count() > 0;
if ($has_more) {
$next_data = $this->Stack->Get();
$next_data['children_count'] += $data['children_count'];
$this->Stack->Update($next_data);
}
return $has_more;
}
}
function UpdateCachedPath(&$data)
{
$fields_hash = Array (
'ParentPath' => '|'.implode('|', $data['parent_path']).'|',
'NamedParentPath' => implode('/', $data['named_path'] ),
'CachedCategoryTemplate' => $data['category_template'],
'CachedDescendantCatsQty' => $data['children_count'],
);
$i = 1;
while ($i <= $this->languageCount) {
$fields_hash['l'.$i.'_CachedNavbar'] = implode('&|&', $data['titles'][$i]);
$i++;
}
$this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Category', 'CategoryId = '.$data['current_id']);
}
function QueryTitle(&$data)
{
$category_id = $data['current_id'];
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'Category
WHERE CategoryId = '.$category_id;
$record = $this->Conn->GetRow($sql);
if ($record) {
$i = 1;
while ($i <= $this->languageCount) {
$data['titles'][$i][] = $record['l'.$i.'_Name'] ? $record['l'.$i.'_Name'] : $record['l'.$this->primaryLanguageId.'_Name'];
$i++;
}
$data['parent_path'][] = $category_id;
$data['named_path'][] = $record['Filename'];
// it is one of the modules root category
$root_prefix = isset($this->root_prefixes[$category_id]) ? $this->root_prefixes[$category_id] : false;
if ($root_prefix) {
$fields_hash = Array();
if (!$record['CategoryTemplate']) {
$record['CategoryTemplate'] = $this->Application->ConfigValue($root_prefix.'_CategoryTemplate');
$fields_hash['CategoryTemplate'] = $record['CategoryTemplate'];
}
$this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Category', 'CategoryId = '.$category_id);
}
// if explicitly set, then use it; use parent template otherwise
if ($record['CategoryTemplate']) {
$data['category_template'] = $record['CategoryTemplate'];
}
}
}
function QueryChildren(&$data)
{
$sql = 'SELECT CategoryId
FROM '.TABLE_PREFIX.'Category
WHERE ParentId = '.$data['current_id'];
$data['children'] = $this->Conn->GetCol($sql);
}
function QueryPermissions(&$data)
{
// don't search for section "view" permissions here :)
$sql = 'SELECT ipc.PermissionConfigId, ip.GroupId, ip.PermissionValue
FROM '.TABLE_PREFIX.'Permissions AS ip
LEFT JOIN '.TABLE_PREFIX.'PermissionConfig AS ipc ON ipc.PermissionName = ip.Permission
WHERE (CatId = '.$data['current_id'].') AND (Permission LIKE "%.VIEW") AND (ip.Type = 0)';
$records = $this->Conn->Query($sql);
//create permissions array only if we don't have it yet (set by parent)
if (!isset($data['perms'])) {
$data['perms'] = new clsCachedPermissions($data['current_id']);
}
foreach ($records as $record) {
if ($record['PermissionValue'] == 1) {
$data['perms']->AddAllow($record['PermissionConfigId'], $record['GroupId']);
}
else {
$data['perms']->AddDeny($record['PermissionConfigId'], $record['GroupId']);
}
}
}
/**
* Rebuild all cache in one step
*
*/
function OneStepRun($path='')
{
$this->InitUpdater();
$needs_more = true;
while ($needs_more) {
// until proceeeded in this step category count exceeds category per step limit
$needs_more = $this->DoTheJob();
}
$this->clearData();
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/categories/cache_updater.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.9
\ No newline at end of property
+1.10
\ No newline at end of property
Index: trunk/core/units/sections/sections_config.php
===================================================================
--- trunk/core/units/sections/sections_config.php (revision 7634)
+++ trunk/core/units/sections/sections_config.php (revision 7635)
@@ -1,343 +1,355 @@
<?php
$config = Array(
'Prefix' => 'inportal-sections',
'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
// 'SectionPrefix' => 'u',
'Sections' => Array(
'in-portal:root' => Array(
'parent' => null,
'icon' => 'in-portal:site',
'label' => $this->Application->ConfigValue('Site_Name'),
'url' => Array('t' => 'sections_list', 'pass' => 'm', 'pass_section' => true, 'no_amp' => 1),
'permissions' => Array('advanced:admin_login', 'advanced:front_login'),
'priority' => 0,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
'in-portal:site' => Array(
'parent' => 'in-portal:root',
'icon' => 'in-portal:struct',
'label' => 'la_tab_Site_Structure',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 1,
'type' => stTREE,
'SectionPrefix' => 'c',
),
'in-portal:browse' => Array(
'parent' => 'in-portal:site',
'icon' => 'in-portal:catalog',
'label' => 'la_tab_Browse',
'url' => Array('t' => 'in-portal/catalog', 'pass' => 'm'),
'late_load' => Array('t' => 'in-portal/xml/tree_categories', 'pass' => 'm', 'm_cat_id' => 0),
'onclick' => 'checkCatalog(0)',
'permissions' => Array('view'),
'priority' => 0.1,
'type' => stTREE,
),
'in-portal:advanced_view' => Array(
'parent' => 'in-portal:site',
'icon' => 'in-portal:advanced_view',
'label' => 'la_tab_AdvancedView',
'url' => Array('t' => 'in-portal/advanced_view', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 0.2,
'type' => stTREE,
),
'in-portal:reviews' => Array(
'parent' => 'in-portal:site',
'icon' => 'in-portal:reviews',
'label' => 'la_tab_Reviews',
'url' => Array('index_file' => 'reviews.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:configure_categories' => Array(
'parent' => 'in-portal:site',
'icon' => 'in-portal:cat_settings',
'label' => 'la_tab_Settings',
'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:configuration_search' => Array(
'parent' => 'in-portal:site',
'icon' => 'in-portal:settings_search',
'label' => 'la_tab_ConfigSearch',
'url' => Array('t' => 'in-portal/config/config_search', 'module_key' => 'category', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:configuration_email' => Array(
'parent' => 'in-portal:site',
'icon' => 'in-portal:settings_email',
'label' => 'la_tab_ConfigE-mail',
'url' => Array('t' => 'in-portal/config/config_email', 'module' => 'In-Portal:Category', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 6,
'type' => stTREE,
),
'in-portal:configuration_custom' => Array(
'parent' => 'in-portal:site',
'icon' => 'in-portal:settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array('t' => 'in-portal/custom_fields/custom_fields_list', 'cf_type' => 1, 'pass_section' => true, 'pass' => 'm,cf'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 7,
'type' => stTREE,
),
'in-portal:users' => Array(
'parent' => 'in-portal:root',
'icon' => 'in-portal:community',
'label' => 'la_tab_Community',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 2,
'type' => stTREE,
'SectionPrefix' => 'u',
),
+ 'in-portal:user_list' => Array(
+ 'parent' => 'in-portal:users',
+ 'icon' => 'in-portal:users',
+ 'label' => 'la_tab_User_List',
+ 'url' => Array('index_file' => 'users/user_list.php', 'pass' => 'm', 'resetpage' => 1),
+ 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:ban', 'advanced:send_email', /*'advanced:add_favorite', 'advanced:remove_favorite',*/),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:k4_user_list' => Array(
+ 'parent' => 'in-portal:users',
+ 'icon' => 'in-portal:users',
+ 'label' => 'la_title_K4Users',
+ 'url' => Array('t' => 'in-portal/users/users_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:ban', 'advanced:send_email', /*'advanced:add_favorite', 'advanced:remove_favorite',*/),
+ 'priority' => 1.5,
+ 'debug_only' => true,
+ 'type' => stTREE,
+ ),
+
'in-portal:user_groups' => Array(
'parent' => 'in-portal:users',
'icon' => 'in-portal:usergroups',
'label' => 'la_tab_User_Groups',
'url' => Array('t' => 'in-portal/groups/groups_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:send_email', 'advanced:manage_permissions'),
'priority' => 2,
'type' => stTREE,
),
- 'in-portal:user_list' => Array(
- 'parent' => 'in-portal:users',
- 'icon' => 'in-portal:users',
- 'label' => 'la_tab_User_List',
- 'url' => Array('index_file' => 'users/user_list.php', 'pass' => 'm', 'resetpage' => 1),
- 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:ban', 'advanced:send_email', /*'advanced:add_favorite', 'advanced:remove_favorite',*/),
- 'priority' => 1,
- 'type' => stTREE,
- ),
-
+
'in-portal:configure_users' => Array(
'parent' => 'in-portal:users',
'icon' => 'in-portal:users_settings',
'label' => 'la_tab_ConfigSettings',
'url' => Array('t' => 'config/config_universal', 'module' => 'In-Portal:Users', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:user_email' => Array(
'parent' => 'in-portal:users',
'icon' => 'in-portal:settings_email',
'label' => 'la_tab_ConfigE-mail',
'url' => Array('t' => 'config/config_email', 'module' => 'In-Portal:Users', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:user_custom' => Array(
'parent' => 'in-portal:users',
'icon' => 'in-portal:settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 6, 'pass_section' => true, 'pass' => 'm,cf'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:user_banlist' => Array(
'parent' => 'in-portal:users',
'icon' => 'in-portal:banlist',
'label' => 'la_tab_BanList',
'url' => Array('index_file' => 'config/edit_banlist.php', 'DataType' => 6, 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 6,
'type' => stTREE,
),
// "Help" section
'in-portal:help' => Array(
'parent' => 'in-portal:root',
'icon' => 'in-portal:help',
'label' => 'la_tab_Help',
'url' => Array('index_file' => 'help/manual.pdf', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 7,
'type' => stTREE,
),
// "Summary & Logs" section
'in-portal:reports' => Array(
'parent' => 'in-portal:root',
'icon' => 'in-portal:summary_logs',
'label' => 'la_tab_Reports',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 4,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
'in-portal:log_summary' => Array(
'parent' => 'in-portal:reports',
'icon' => 'in-portal:summary',
'label' => 'la_tab_Summary',
'url' => Array('index_file' => 'logs/summary.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:searchlog' => Array(
'parent' => 'in-portal:reports',
'icon' => 'in-portal:search_log',
'label' => 'la_tab_SearchLog',
'url' => Array('index_file' => 'logs/searchlog.php', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:sessionlog' => Array(
'parent' => 'in-portal:reports',
'icon' => 'in-portal:sessions_log',
'label' => 'la_tab_SessionLog',
'url' => Array('index_file' => 'logs/session_list.php', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:emaillog' => Array(
'parent' => 'in-portal:reports',
'icon' => 'in-portal:email_log',
'label' => 'la_tab_EmailLog',
'url' => Array('index_file' => 'logs/email_log.php', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:visits' => Array(
'parent' => 'in-portal:reports',
'icon' => 'in-portal:visits',
'label' => 'la_tab_Visits',
'url' => Array('t' => 'in-portal/visits/visits_list', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 5,
'type' => stTREE,
),
// "Configuration" section
'in-portal:system' => Array(
'parent' => 'in-portal:root',
'icon' => 'in-portal:conf',
'label' => 'la_tab_Sys_Config',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 5,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
'in-portal:configure_general' => Array(
'parent' => 'in-portal:system',
'icon' => 'in-portal:conf_general',
'label' => 'la_tab_General',
'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'module' => 'In-Portal', 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:configure_themes' => Array(
'parent' => 'in-portal:system',
'icon' => 'in-portal:conf_themes',
'label' => 'la_tab_Themes',
'url' => Array('index_file' => 'config/config_theme.php', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 3,
'type' => stTREE,
),
// "Tools" section
'in-portal:tools' => Array(
'parent' => 'in-portal:root',
'icon' => 'in-portal:tools',
'label' => 'la_tab_Tools',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 6,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
'in-portal:backup' => Array(
'parent' => 'in-portal:tools',
'icon' => 'in-portal:tool_backup',
'label' => 'la_tab_Backup',
'url' => Array('index_file' => 'backup/backup1.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:restore' => Array(
'parent' => 'in-portal:tools',
'icon' => 'in-portal:tool_restore',
'label' => 'la_tab_Restore',
'url' => Array('index_file' => 'backup/restore1.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:main_import' => Array(
'parent' => 'in-portal:tools',
'icon' => 'in-portal:tool_import',
'label' => 'la_tab_ImportData',
'url' => Array('index_file' => 'import/step1.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:sql_query' => Array(
'parent' => 'in-portal:tools',
'icon' => 'in-portal:tool_import',
'label' => 'la_tab_QueryDB',
'url' => Array('index_file' => 'tools/sql_query.php', 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:server_info' => Array(
'parent' => 'in-portal:tools',
'icon' => 'in-portal:server_info',
'label' => 'la_tab_ServerInfo',
'url' => Array('index_file' => 'tools/server_info.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 6,
'type' => stTREE,
),
),
);
\ No newline at end of file
Property changes on: trunk/core/units/sections/sections_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/units/admin/admin_tag_processor.php
===================================================================
--- trunk/core/units/admin/admin_tag_processor.php (revision 7634)
+++ trunk/core/units/admin/admin_tag_processor.php (revision 7635)
@@ -1,625 +1,678 @@
<?php
class AdminTagProcessor extends kDBTagProcessor {
function SetConst($params)
{
$name = $this->SelectParam($params, 'name,const');
safeDefine($name, $params['value']);
}
/**
* Allows to execute js script after the page is fully loaded
*
* @param Array $params
* @return string
*/
function AfterScript($params)
{
$after_script = $this->Application->GetVar('after_script');
if ($after_script) {
return '<script type="text/javascript">'.$after_script.'</script>';
}
return '';
}
/**
* Returns section title with #section# keyword replaced with current section
*
* @param Array $params
* @return string
*/
function GetSectionTitle($params)
{
$params['name'] = replaceModuleSection($params['phrase']);
return $this->Application->ProcessParsedTag('m', 'Phrase', $params);
}
/**
* Returns section icon with #section# keyword replaced with current section
*
* @param Array $params
* @return string
*/
function GetSectionIcon($params)
{
return replaceModuleSection($params['icon']);
}
/**
* Allows to detect if current template is one of listed ones
*
* @param Array $params
* @return int
*/
function TemplateMatches($params)
{
$templates = explode(',' ,$params['templates']);
$t = $this->Application->GetVar('t');
return in_array($t, $templates) ? 1 : 0;
}
/**
* Save return script in cases, when old sections are opened from new sections
*
* @param Array $params
*/
function SaveReturnScript($params)
{
// admin/save_redirect.php?do=
$url = str_replace($this->Application->BaseURL(), '', $this->Application->ProcessParsedTag('m', 'Link', $params) );
$url = explode('?', $url, 2);
$url = 'save_redirect.php?'.$url[1].'&do='.$url[0];
$this->Application->StoreVar('ReturnScript', $url);
}
/**
* Redirects to correct next import step template based on import script data
*
* @param Array $params
*/
function ImportRedirect($params)
{
$import_id = $this->Application->GetVar('import_id');
if ($import_id) {
// redirect forward to step3 (import parameters coosing)
$this->Application->StoreVar('ImportScriptID', $import_id);
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'ImportScripts
WHERE is_id = '.$import_id;
$db =& $this->Application->GetADODBConnection();
$is_params = $db->GetRow($sql);
if ($is_params['is_type'] == 'db') {
$this->Application->Redirect('', null, '', 'import/step3.php');
}
elseif ($is_params['is_type'] == 'csv') {
$module = strtolower($is_params['is_Module']);
$template = $module.'/import';
$module_info = $this->Application->findModule('Name', $module);
$item_prefix = $module_info['Var'];
$pass_params = Array('m_opener' => 'd', $item_prefix.'.import_id' => 0, $item_prefix.'.import_event' => 'OnNew', 'pass' => 'm,'.$item_prefix.'.import', 'm_cat_id' => $module_info['RootCat']);
$this->Application->Redirect($template, $pass_params);
}
}
else {
// redirect back to step2 (import type choosing)
$this->Application->Redirect('', null, '', 'import/step2.php');
}
}
/**
* Returns version of module by name
*
* @param Array $params
* @return string
*/
function ModuleVersion($params)
{
return $this->Application->findModule('Name', $params['module'], 'Version');
}
/**
* Used in table form section drawing
*
* @param Array $params
* @return string
*/
function DrawTree($params)
{
static $deep_level = 0;
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
$params['deep_level'] = $deep_level++;
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
if (!isset($section_data['children'])) {
return $ret;
}
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $section_name) {
$params['section_name'] = $section_name;
$ret .= $this->DrawTree($params);
$deep_level--;
}
return $ret;
}
+ function SectionInfo($params)
+ {
+ $section = $params['section'];
+ if ($section == '#session#') {
+ $section = $this->Application->RecallVar('section');
+ }
+
+ $sections_helper =& $this->Application->recallObject('SectionsHelper');
+ /* @var $sections_helper kSectionsHelper */
+ $section_data =& $sections_helper->getSectionData($section);
+
+ if (isset($params['parent']) && $params['parent']) {
+ do {
+ $section_data =& $sections_helper->getSectionData($section_data['parent']);
+ } while (isset($section_data['use_parent_header']) && $section_data['use_parent_header']);
+ }
+
+ $info = $params['info'];
+ switch ($info) {
+ case 'module_path':
+ $module = $section_data['icon_module'];
+ $res = $this->ModulePath(array('module' => $module));
+ break;
+ default:
+ $res = $section_data[$info];
+ }
+
+ if ($info == 'label' || isset($params['as_label'])) {
+ $res = $this->Application->Phrase($res);
+ }
+ return $res;
+ }
+
+
function PrintSection($params)
{
$section_name = $params['section_name'];
if ($section_name == '#session#') {
$section_name = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
$section_data =& $sections_helper->getSectionData($section_name);
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
$params['section_name'] = $section_name;
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$ret = $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
return $ret;
}
/**
* Used in XML drawing for tree
*
* @param Array $params
* @return string
*/
function PrintSections($params)
{
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
if ($section_name == '#session#') {
$section_name = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
if (!isset($section_data['children'])) {
return '';
}
$debug_mode = $this->Application->isDebugMode(); // cache this for performance
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $section_name) {
$params['section_name'] = $section_name;
$section_data =& $sections_helper->getSectionData($section_name);
if (!$debug_mode && isset($section_data['debug_only']) && $section_data['debug_only']) {
// don't show section for debug mode only without debug mode turned on
continue;
}
if (isset($section_data['tabs_only']) && $section_data['tabs_only']) {
$perm_status = false;
$folder_label = $section_data['label'];
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $priority => $section_name) {
// if only tabs in this section & none of them have permission, then skip section too
$section_data =& $sections_helper->getSectionData($section_name);
if ($section_data && isset($section_data['perm_prefix'])) {
// this section uses other section permissions
$section_name = $this->Application->getUnitOption($section_data['perm_prefix'].'.main', 'PermSection');
}
$perm_status = $this->Application->CheckPermission($section_name.'.view', 1);
if ($perm_status) {
break;
}
}
if (!$perm_status) {
// no permission for all tabs -> don't display tree node either
continue;
}
$params['section_name'] = $section_name;
$section_data =& $sections_helper->getSectionData($section_name);
$section_data['label'] = $folder_label; // use folder label in tree
$section_data['is_tab'] = 1;
}
else {
if ($section_data && isset($section_data['perm_prefix'])) {
// this section uses other section permissions
$section_name = $this->Application->getUnitOption($section_data['perm_prefix'].'.main', 'PermSection');
}
if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue;
}
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$late_load = getArrayValue($section_data, 'late_load');
if ($late_load) {
$t = $late_load['t'];
unset($late_load['t']);
$section_data['late_load'] = $this->Application->HREF($t, '', $late_load);
$params['children_count'] = 99;
}
else {
$section_data['late_load'] = '';
}
$ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
$params['section_name'] = $section_name;
}
return preg_replace("/\r\n|\n/", '', $ret);
}
function ListSectionPermissions($params)
{
$section_name = isset($params['section_name']) ? $params['section_name'] : $this->Application->GetVar('section_name');
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$block_params = array_merge_recursive2($section_data, Array('name' => $params['render_as'], 'section_name' => $section_name));
$ret = '';
foreach ($section_data['permissions'] as $perm_name) {
if (preg_match('/^advanced:(.*)/', $perm_name) != $params['type']) continue;
$block_params['perm_name'] = $perm_name;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
function ModuleInclude($params)
{
foreach ($params as $param_name => $param_value) {
$params[$param_name] = replaceModuleSection($param_value);
}
return $this->Application->ProcessParsedTag('m', 'ModuleInclude', $params);
}
function TodayDate($params)
{
return date($params['format']);
}
function TreeEditWarrning($params)
{
$ret = $this->Application->Phrase($params['label']);
$ret = str_replace(Array('&lt;', '&gt;', 'br/', 'br /', "\n", "\r"), Array('<', '>', 'br', 'br', '', ''), $ret);
if (getArrayValue($params, 'escape')) {
$ret = addslashes($ret);
}
$ret = str_replace('<br>', '\n', $ret);
return $ret;
}
/**
* Draws section tabs using block name passed
*
* @param Array $params
*/
function ListTabs($params)
{
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($params['section_name']);
$ret = '';
$block_params = Array('name' => $params['render_as']);
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $priority => $section_name) {
if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue;
$tab_data =& $sections_helper->getSectionData($section_name);
$block_params['t'] = $tab_data['url']['t'];
$block_params['title'] = $tab_data['label'];
$block_params['main_prefix'] = $section_data['SectionPrefix'];
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
/**
* Returns list of module item tabs that have view permission in current category
*
* @param Array $params
*/
function ListCatalogTabs($params)
{
$ret = '';
$special = isset($params['special']) ? $params['special'] : '';
$replace_main = isset($params['replace_m']) && $params['replace_m'];
$skip_prefixes = isset($params['skip_prefixes']) ? explode(',', $params['skip_prefixes']) : Array();
$block_params = Array('name' => $params['render_as']);
foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
$prefix = $module_info['Var'];
if (in_array($prefix, $skip_prefixes) || !$this->Application->prefixRegistred($prefix) || !$this->Application->getUnitOption($prefix, 'CatalogItem')) continue;
if ($prefix == 'm' && $replace_main) $prefix = 'c';
$label = $this->Application->getUnitOption($prefix, $params['title_property']);
$block_params['title'] = $label;
$block_params['prefix'] = $prefix;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
function FCKEditor($params)
{
- include_once(FULL_PATH.'/core/cmseditor/fckeditor.php');
+ if (file_exists(FULL_PATH.'/core/cmseditor/fckeditor.php')) {
+ $editor_path = 'core/cmseditor/';
+ }
+ else {
+ $editor_path = 'admin/editor/cmseditor/';
+ }
+ include_once(FULL_PATH.'/'.$editor_path.'/fckeditor.php');
$oFCKeditor = new FCKeditor($params['name']);
- $oFCKeditor->BasePath = BASE_PATH.'/core/cmseditor/';
+ $oFCKeditor->BasePath = BASE_PATH.'/'.$editor_path;
$oFCKeditor->Width = $params['width'] ;
$oFCKeditor->Height = $params['height'] ;
$oFCKeditor->ToolbarSet = 'Advanced' ;
$oFCKeditor->Value = '' ;
$oFCKeditor->Config = Array(
//'UserFilesPath' => $pathtoroot.'kernel/user_files',
'ProjectPath' => BASE_PATH.'/',
- 'CustomConfigurationsPath' => $this->Application->BaseURL().'core/cmseditor/inp_fckconfig.js',
+ 'CustomConfigurationsPath' => $this->Application->BaseURL().$editor_path.'fckconfig.js',
// 'EditorAreaCSS' => $this->Application->BaseURL().'/themes/inportal_site/inc/inportal.css', //GetThemeCSS(),
//'StylesXmlPath' => '../../inp_styles.xml',
// 'Debug' => 1,
'Admin' => 1,
'K4' => 1,
);
return $oFCKeditor->CreateHtml();
}
/**
* Allows to construct link for opening any type of catalog item selector
*
* @param Array $params
* @return string
*/
function SelectorLink($params)
{
$mode = 'catalog';
if (isset($params['mode'])) { // {catalog, advanced_view}
$mode = $params['mode'];
unset($params['mode']);
}
$params['t'] = 'in-portal/item_selector/item_selector_'.$mode;
$default_params = Array('no_amp' => 1, 'pass' => 'all,'.$params['prefix']);
unset($params['prefix']);
$pass_through = Array();
if (isset($params['tabs_dependant'])) { // {yes, no}
$pass_through['td'] = $params['tabs_dependant'];
unset($params['tabs_dependant']);
}
if (isset($params['selection_mode'])) { // {single, multi}
$pass_through['tm'] = $params['selection_mode'];
unset($params['selection_mode']);
}
if (isset($params['tab_prefixes'])) { // {all, none, <comma separated prefix list}
$pass_through['tp'] = $params['tab_prefixes'];
unset($params['tab_prefixes']);
}
if ($pass_through) {
// add pass_through to selector url if any
$params['pass_through'] = implode(',', array_keys($pass_through));
$params = array_merge_recursive2($params, $pass_through);
}
// user can override default parameters (except pass_through of course)
$params = array_merge_recursive2($default_params, $params);
return $this->Application->ProcessParsedTag('m', 't', $params);
}
function TimeFrame($params)
{
$w = adodb_date('w');
$m = adodb_date('m');
$y = adodb_date('Y');
//FirstDayOfWeek is 0 for Sunday and 1 for Monday
$fdow = $this->Application->ConfigValue('FirstDayOfWeek');
if ($fdow && $w == 0) $w = 7;
$today_start = adodb_mktime(0,0,0,adodb_date('m'),adodb_date('d'),$y);
$first_day_of_this_week = $today_start - ($w - $fdow)*86400;
$first_day_of_this_month = adodb_mktime(0,0,0,$m,1,$y);
$this_quater = ceil($m/3);
$this_quater_start = adodb_mktime(0,0,0,$this_quater*3-2,1,$y);
switch ($params['type']) {
case 'last_week_start':
$timestamp = $first_day_of_this_week - 86400*7;
break;
case 'last_week_end':
$timestamp = $first_day_of_this_week - 1;
break;
case 'last_month_start':
$timestamp = $m == 1 ? adodb_mktime(0,0,0,12,1,$y-1) : adodb_mktime(0,0,0,$m-1,1,$y);
break;
case 'last_month_end':
$timestamp = $first_day_of_this_month = adodb_mktime(0,0,0,$m,1,$y) - 1;
break;
case 'last_quater_start':
$timestamp = $this_quater == 1 ? adodb_mktime(0,0,0,10,1,$y-1) : adodb_mktime(0,0,0,($this_quater-1)*3-2,1,$y);
break;
case 'last_quater_end':
$timestamp = $this_quater_start - 1;
break;
case 'last_6_months_start':
$timestamp = $m <= 6 ? adodb_mktime(0,0,0,$m+6,1,$y-1) : adodb_mktime(0,0,0,$m-6,1,$y);
break;
case 'last_year_start':
$timestamp = adodb_mktime(0,0,0,1,1,$y-1);
break;
case 'last_year_end':
$timestamp = adodb_mktime(23,59,59,12,31,$y-1);
break;
}
if (isset($params['format'])) {
$format = $params['format'];
if(preg_match("/_regional_(.*)/", $format, $regs))
{
$lang =& $this->Application->recallObject('lang.current');
$format = $lang->GetDBField($regs[1]);
}
return adodb_date($format, $timestamp);
}
return $timestamp;
}
function CheckPermCache($params)
{
if ($this->Conn->GetOne('SELECT Data FROM '.TABLE_PREFIX.'Cache WHERE VarName = \'ForcePermCacheUpdate\'')) {
$this->Application->Redirect($params['cache_update_t'], array('continue' => 1));
}
}
/**
* Checks if current protocol is SSL
*
* @param Array $params
* @return int
*/
function IsSSL($params)
{
return (PROTOCOL == 'https://')? 1 : 0;
}
function PrintColumns($params)
{
$picker_helper =& $this->Application->RecallObject('ColumnPickerHelper');
$picker_helper->SetGridName($this->Application->GetLinkedVar('grid_name'));
/* @var $picker_helper kColumnPickerHelper */
$main_prefix = $this->Application->RecallVar('main_prefix');
$cols = $picker_helper->LoadColumns($main_prefix);
$o = '';
if (isset($params['hidden']) && $params['hidden']) {
foreach ($cols['hidden_fields'] as $col) {
$title = $this->Application->Phrase($cols['titles'][$col]);
$o .= "<option value='$col'>".$title;
}
}
else {
foreach ($cols['order'] as $col) {
if (in_array($col, $cols['hidden_fields'])) continue;
$title = $this->Application->Phrase($cols['titles'][$col]);
$o .= "<option value='$col'>".$title;
}
}
return $o;
}
/**
* Allows to set popup size (key - current template name)
*
* @param Array $params
*/
function SetPopupSize($params)
{
if (!$this->UsePopups($params)) return ;
$width = $params['width'];
$height = $params['height'];
if ($this->Application->GetVar('ajax') == 'yes') {
// during AJAX request just output size
die($width.'x'.$height);
}
$t = $this->Application->GetVar('t');
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'PopupSizes
WHERE TemplateName = '.$this->Conn->qstr($t);
$popup_info = $this->Conn->GetRow($sql);
if (!$popup_info) {
// create new popup size record
$fields_hash = Array (
'TemplateName' => $t,
'PopupWidth' => $width,
'PopupHeight' => $height,
);
$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'PopupSizes');
}
elseif ($popup_info['PopupWidth'] != $width || $popup_info['PopupHeight'] != $height) {
// popup found and size in tag differs from one in db -> update in db
$fields_hash = Array (
'PopupWidth' => $width,
'PopupHeight' => $height,
);
$this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'PopupSizes', 'PopupId = '.$popup_info['PopupId']);
}
}
/**
* Returns popup size (by template), if not cached, then parse template to get value
*
* @param Array $params
* @return string
*/
function GetPopupSize($params)
{
$t = $this->Application->GetVar('template_name');
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'PopupSizes
WHERE TemplateName = '.$this->Conn->qstr($t);
$popup_info = $this->Conn->GetRow($sql);
if (!$popup_info) {
$this->Application->InitParser();
- $this->Application->Parser->ParseTemplate($t); // dies when SetPopupSize tag found & in ajax requrest
+ $this->Application->ParseBlock(array('name' => $t)); // dies when SetPopupSize tag found & in ajax requrest
return '750x400'; // tag SetPopupSize not found in template -> use default size
}
return $popup_info['PopupWidth'].'x'.$popup_info['PopupHeight'];
}
function UsePopups($params)
{
return (int)$this->Application->ConfigValue('UsePopups');
}
function UseToolbarLabels($params)
{
return (int)$this->Application->ConfigValue('UseToolbarLabels');
}
+
+ /**
+ * Checks if debug mode enabled (optionally) and specified constant is on
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function ConstOn($params)
+ {
+ $constant_name = $this->SelectParam($params, 'name,const');
+ $debug_mode = isset($params['debug_mode']) && $params['debug_mode'] ? $this->Application->isDebugMode() : true;
+ return $debug_mode && constOn($constant_name);
+ }
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/admin/admin_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.28
\ No newline at end of property
+1.29
\ No newline at end of property
Index: trunk/core/units/users/users_event_handler.php
===================================================================
--- trunk/core/units/users/users_event_handler.php (revision 7634)
+++ trunk/core/units/users/users_event_handler.php (revision 7635)
@@ -1,1101 +1,1126 @@
<?php
class UsersEventHandler extends kDBEventHandler
{
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
// admin
'OnSetPersistantVariable' => Array('self' => 'view'), // because setting to logged in user only
'OnUpdateRootPassword' => Array('self' => true), // because setting to logged in user only
// front
'OnRefreshForm' => Array('self' => true),
'OnForgotPassword' => Array('self' => true),
'OnResetPassword' => Array('self' => true),
'OnResetPasswordConfirmed' => Array('self' => true),
'OnSubscribeQuery' => Array('self' => true),
'OnSubscribeUser' => Array('self' => true),
'OnRecommend' => Array('self' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
+ * Shows only admins when required
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ if ($event->Special == 'admins') {
+ $object->addFilter('primary_filter', 'ug.GroupId = 11');
+ }
+
+ if ($event->Special == 'regular') {
+ $object->addFilter('primary_filter', 'ug.GroupId <> 11');
+ }
+ }
+
+
+ /**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if ($event->Name == 'OnLogin' || $event->Name == 'OnLogout') {
// permission is checked in OnLogin event directly
return true;
}
if (!$this->Application->IsAdmin()) {
$user_id = $this->Application->RecallVar('user_id');
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
if ($event->Name == 'OnCreate' && $user_id == -2) {
// "Guest" can create new users
return true;
}
if ($event->Name == 'OnUpdate' && $user_id > 0) {
$user_dummy =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true));
foreach ($items_info as $id => $field_values) {
if ($id != $user_id) {
// registered users can update their record only
return false;
}
$user_dummy->Load($id);
$status_field = array_shift($this->Application->getUnitOption($event->Prefix, 'StatusField'));
if ($user_dummy->GetDBField($status_field) != STATUS_ACTIVE) {
// not active user is not allowed to update his record (he could not activate himself manually)
return false;
}
if (isset($field_values[$status_field]) && $user_dummy->GetDBField($status_field) != $field_values[$status_field]) {
// user can't change status by himself
return false;
}
}
return true;
}
if ($event->Name == 'OnUpdate' && $user_id <= 0) {
// guests are not allowed to update their record, because they don't have it :)
return false;
}
}
return parent::CheckPermission($event);
}
function OnSessionExpire()
{
if( $this->Application->IsAdmin() ) {
$this->Application->Redirect('index', Array('expired' => 1), '', 'index.php');
}
else {
$http_query =& $this->Application->recallObject('HTTPQuery');
$get = $http_query->getRedirectParams();
$t = $this->Application->GetVar('t');
$get['js_redirect'] = $this->Application->ConfigValue('UseJSRedirect');
$this->Application->Redirect($t ? $t : 'index', $get);
}
}
/**
* Checks user data and logs it in if allowed
*
* @param kEvent $event
*/
function OnLogin(&$event)
{
// persistent session data after login is not refreshed, because redirect will follow in any case
$prefix_special = $this->Application->IsAdmin() ? 'u.current' : 'u'; // "u" used on front not to change theme
$object =& $this->Application->recallObject($prefix_special, null, Array('skip_autoload' => true));
$password = $this->Application->GetVar('password');
+
+ $invalid_pseudo = $this->Application->IsAdmin() ? 'la_invalid_password' : 'lu_invalid_password';
+
if(!$password)
{
- $object->SetError('ValidateLogin', 'blank_password', 'lu_blank_password');
+ $object->SetError('ValidateLogin', 'invalid_password', $invalid_pseudo);
$event->status = erFAIL;
return false;
}
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
list($login_field, $submit_field) = $email_as_login && !$this->Application->IsAdmin() ? Array('Email', 'email') : Array('Login', 'login');
$login_value = $this->Application->GetVar($submit_field);
// process "Save Username" checkbox
- $save_username = $this->Application->GetVar('cb_save_username') ? $login_value : '';
- $this->Application->Session->SetCookie('save_username', $save_username, adodb_mktime() + 31104000); // 1 year expiration
- $this->Application->SetVar('save_username', $save_username); // cookie will be set on next refresh, but refresh won't occur if login error present, so duplicate cookie in HTTPQuery
-
+ if ($this->Application->IsAdmin()) {
+ $save_username = $this->Application->GetVar('cb_save_username') ? $login_value : '';
+ $this->Application->Session->SetCookie('save_username', $save_username, adodb_mktime() + 31104000); // 1 year expiration
+ $this->Application->SetVar('save_username', $save_username); // cookie will be set on next refresh, but refresh won't occur if login error present, so duplicate cookie in HTTPQuery
+ }
+
if ($this->Application->IsAdmin() && ($login_value == 'root')) {
// logging in "root" (admin only)
$root_password = $this->Application->ConfigValue('RootPass');
$password_formatter =& $this->Application->recallObject('kPasswordFormatter');
$test = $password_formatter->EncryptPassword($password, 'b38');
if ($root_password != $test) {
- $object->SetError('ValidateLogin', 'invalid_password', 'lu_invalid_password');
+ $object->SetError('ValidateLogin', 'invalid_password', $invalid_pseudo);
$event->status = erFAIL;
return false;
}
elseif ($this->checkLoginPermission($login_value)) {
$user_id = -1;
$object->Load($user_id);
$object->SetDBField('Login', $login_value);
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', $user_id);
// $session->SetField('GroupList', implode(',', $groups) );
$this->Application->SetVar('u.current_id', $user_id);
$this->Application->StoreVar('user_id', $user_id);
$this->processLoginRedirect($event, $password);
return true;
}
else {
$object->SetError('ValidateLogin', 'invalid_license', 'la_invalid_license');
$event->status = erFAIL;
return false;
}
}
/*$sql = 'SELECT PortalUserId FROM '.$object->TableName.' WHERE (%s = %s) AND (Password = MD5(%s))';
$user_id = $this->Conn->GetOne( sprintf($sql, $login_field, $this->Conn->qstr($login_value), $this->Conn->qstr($password) ) );*/
$sql = 'SELECT PortalUserId FROM '.$object->TableName.' WHERE (Email = %1$s OR Login = %1$s) AND (Password = MD5(%2$s))';
$user_id = $this->Conn->GetOne( sprintf($sql, $this->Conn->qstr($login_value), $this->Conn->qstr($password) ) );
if ($user_id) {
$object->Load($user_id);
if ($object->GetDBField('Status') == STATUS_ACTIVE) {
$groups = $object->getMembershipGroups(true);
if(!$groups) $groups = Array();
array_push($groups, $this->Application->ConfigValue('User_LoggedInGroup') );
$this->Application->StoreVar( 'UserGroups', implode(',', $groups) );
if ($this->checkLoginPermission($login_value)) {
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', $user_id);
$session->SetField('GroupList', implode(',', $groups) );
$this->Application->SetVar('u.current_id', $user_id);
$this->Application->StoreVar('user_id', $user_id);
$this_login = (int)$object->getPersistantVar('ThisLogin');
$object->setPersistantVar('LastLogin', $this_login);
$object->setPersistantVar('ThisLogin', adodb_mktime());
}
else {
$object->Load(-2);
$object->SetError('ValidateLogin', 'no_permission', 'lu_no_permissions');
$event->status = erFAIL;
}
$this->processLoginRedirect($event, $password);
}
else {
$event->redirect = $this->Application->GetVar('pending_disabled_template');
}
}
else
{
$object->SetID(-2);
- $object->SetError('ValidateLogin', 'invalid_password', 'lu_invalid_password');
+ $object->SetError('ValidateLogin', 'invalid_password', $invalid_pseudo);
$event->status = erFAIL;
}
-
+
$event->SetRedirectParam('pass', 'm');
}
/**
* Enter description here...
*
* @param string $user_name
* @return bool
*/
function checkLoginPermission($user_name)
{
$ret = true;
if ($this->Application->IsAdmin()) {
$modules_helper =& $this->Application->recallObject('ModulesHelper');
if ($user_name != 'root') {
// root is virtual user, so allow him to login to admin in any case
$ret = $this->Application->CheckPermission('ADMIN', 1);
}
$ret = $ret && $modules_helper->checkLogin();
}
else {
$ret = $this->Application->CheckPermission('LOGIN', 1);
}
return $ret;
}
/**
* Process all required data and redirect logged-in user
*
* @param kEvent $event
*/
function processLoginRedirect(&$event, $password)
{
$prefix_special = $this->Application->IsAdmin() ? 'u.current' : 'u'; // "u" used on front not to change theme
$object =& $this->Application->recallObject($prefix_special, null, Array('skip_autoload' => true));
$next_template = $this->Application->GetVar('next_template');
if ($next_template == '_ses_redirect') {
$location = $this->Application->BaseURL().$this->Application->RecallVar($next_template);
if( $this->Application->isDebugMode() && constOn('DBG_REDIRECT') )
{
$this->Application->Debugger->appendTrace();
echo "<b>Debug output above!!!</b> Proceed to redirect: <a href=\"$location\">$location</a><br>";
}
else {
header('Location: '.$location);
}
$session =& $this->Application->recallObject('Session');
$session->SaveData();
exit;
}
if ($next_template) {
$event->redirect = $next_template;
}
if ($this->Application->ConfigValue('UseJSRedirect')) {
$event->SetRedirectParam('js_redirect', 1);
}
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LoginUser', $object->GetDBField('Login'), $password);
}
/**
* Called when user logs in using old in-portal
*
* @param kEvent $event
*/
function OnInpLogin(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LoginUser', $event->getEventParam('user'), $event->getEventParam('pass') );
if ($event->redirect && is_string($event->redirect)) {
// some real template specified instead of true
$this->Application->Redirect($event->redirect, $event->redirect_params);
}
}
/**
* Called when user logs in using old in-portal
*
* @param kEvent $event
*/
function OnInpLogout(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LogoutUser');
}
function OnLogout(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LogoutUser');
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', -2);
$this->Application->SetVar('u.current_id', -2);
$this->Application->StoreVar('user_id', -2);
$object =& $this->Application->recallObject('u.current', null, Array('skip_autoload' => true));
$object->Load(-2);
$this->Application->DestroySession();
$group_list = $this->Application->ConfigValue('User_GuestGroup').','.$this->Application->ConfigValue('User_LoggedInGroup');
$session->SetField('GroupList', $group_list);
$this->Application->StoreVar('UserGroups', $group_list);
if ($this->Application->ConfigValue('UseJSRedirect')) {
$event->SetRedirectParam('js_redirect', 1);
}
-
+
$event->SetRedirectParam('pass', 'm');
}
/**
* Prefill states dropdown with correct values
*
* @param kEvent $event
* @access public
*/
function OnPrepareStates(&$event)
{
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$cs_helper->PopulateStates($event, 'State', 'Country');
$object =& $event->getObject();
if( $object->isRequired('Country') && $cs_helper->CountryHasStates( $object->GetDBField('Country') ) ) $object->setRequired('State', true);
$object->setLogin();
}
/**
* Redirects user after succesfull registration to confirmation template (on Front only)
*
* @param kEvent $event
*/
function OnAfterItemCreate(&$event)
{
$is_subscriber = $this->Application->GetVar('IsSubscriber');
if(!$is_subscriber)
{
$object =& $event->getObject();
$ug_table = TABLE_PREFIX.'UserGroup';
if ($object->mode == 't') {
$ug_table = $this->Application->GetTempName($ug_table, 'prefix:'.$event->Prefix);
}
-
+
$sql = 'UPDATE '.$ug_table.'
SET PrimaryGroup = 0
WHERE PortalUserId = '.$object->GetDBField('PortalUserId');
$this->Conn->Query($sql);
// set primary group to user
if ($this->Application->IsAdmin() && $this->Application->GetVar('user_group')) {
// while in admin you can set any group for new users
$group_id = $this->Application->GetVar('user_group');
}
else {
$group_id = $this->Application->ConfigValue('User_NewGroup');
}
$sql = 'REPLACE INTO '.$ug_table.'(PortalUserId,GroupId,PrimaryGroup) VALUES (%s,%s,1)';
$this->Conn->Query( sprintf($sql, $object->GetID(), $group_id) );
}
}
/**
* Login user if possible, if not then redirect to corresponding template
*
* @param kEvent $event
*/
function autoLoginUser(&$event)
{
$object =& $event->getObject();
$this->Application->SetVar('u.current_id', $object->GetID() );
if($object->GetDBField('Status') == STATUS_ACTIVE && !$this->Application->ConfigValue('User_Password_Auto'))
{
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
list($login_field, $submit_field) = $email_as_login ? Array('Email', 'email') : Array('Login', 'login');
$this->Application->SetVar($submit_field, $object->GetDBField($login_field) );
$this->Application->SetVar('password', $object->GetDBField('Password_plain') );
$event->CallSubEvent('OnLogin');
}
}
/**
* When creating user & user with such email exists then force to use OnUpdate insted of ?
*
* @param kEvent $event
*/
function OnSubstituteSubscriber(&$event)
{
$ret = false;
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
list($id, $field_values) = each($items_info);
- $user_email = $field_values['Email'];
+ $user_email = isset($field_values['Email']) ? $field_values['Email'] : false;
if($user_email)
{
// check if is subscriber
$verify_user =& $this->Application->recallObject('u.verify', null, Array('skup_autoload' => true) );
$verify_user->Load($user_email, 'Email');
if( $verify_user->isLoaded() && $verify_user->isSubscriberOnly() )
{
$items_info = Array( $verify_user->GetDBField('PortalUserId') => $field_values );
$this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
$ret = true;
}
}
}
if( isset($event->MasterEvent) )
{
$event->MasterEvent->setEventParam('is_subscriber_only', $ret);
}
else
{
$event->setEventParam('is_subscriber_only', $ret);
}
}
/**
* Enter description here...
*
* @param kEvent $event
* @return bool
*/
function isSubscriberOnly(&$event)
{
$event->CallSubEvent('OnSubstituteSubscriber');
$is_subscriber = false;
if( $event->getEventParam('is_subscriber_only') )
{
$is_subscriber = true;
$object =& $event->getObject( Array('skip_autoload' => true) );
$this->OnUpdate($event);
if($event->status == erSUCCESS)
{
$this->OnAfterItemCreate($event);
$object->SendEmailEvents();
if( !$this->Application->IsAdmin() && ($event->status == erSUCCESS) && $event->redirect) $this->autoLoginUser($event);
}
}
return $is_subscriber;
}
/**
* Creates new user
*
* @param kEvent $event
*/
function OnCreate(&$event)
{
if( !$this->Application->IsAdmin() ) $this->setUserStatus($event);
if( !$this->isSubscriberOnly($event) )
{
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$cs_helper->CheckStateField($event, 'State', 'Country');
$object =& $event->getObject( Array('skip_autoload' => true) );
if ($this->Application->ConfigValue('User_Password_Auto')) {
$pass = makepassword4(rand(5,8));
$object->SetField('Password', $pass);
$object->SetField('VerifyPassword', $pass);
$this->Application->SetVar('user_password',$pass);
}
parent::OnCreate($event);
$this->Application->SetVar('u.current_id', $object->getID() ); // for affil:OnRegisterAffiliate after hook
$this->setNextTemplate($event);
if( !$this->Application->IsAdmin() && ($event->status == erSUCCESS) && $event->redirect)
{
$object->SendEmailEvents();
$this->autoLoginUser($event);
}
}
}
/**
* Set's new user status based on config options
*
* @param kEvent $event
*/
function setUserStatus(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$new_users_allowed = $this->Application->ConfigValue('User_Allow_New');
// 1 - Instant, 2 - Not Allowed, 3 - Pending
switch ($new_users_allowed)
{
case 1: // Instant
$object->SetDBField('Status', 1);
$next_template = $this->Application->GetVar('registration_confirm_template');
if($next_template) $event->redirect = $next_template;
break;
case 3: // Pending
$next_template = $this->Application->GetVar('registration_confirm_pending_template');
if($next_template) $event->redirect = $next_template;
$object->SetDBField('Status', 2);
break;
case 2: // Not Allowed
$object->SetDBField('Status', 0);
break;
}
/*if ($object->GetDBField('PaidMember') == 1) {
$this->Application->HandleEvent($add_to_cart, 'ord:OnAddToCart');
$event->redirect = 'in-commerce/checkout/shop_cart';
} */
}
/**
* Set's new unique resource id to user
*
* @param kEvent $event
*/
function OnBeforeItemCreate(&$event)
{
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
$object =& $event->getObject();
if ($email_as_login) {
$object->Fields['Email']['error_msgs']['unique'] = $this->Application->Phrase('lu_user_and_email_already_exist');
}
}
/**
* Set's new unique resource id to user
*
* @param kEvent $event
*/
function OnAfterItemValidate(&$event)
{
$object =& $event->getObject();
$resource_id = $object->GetDBField('ResourceId');
if (!$resource_id)
{
$object->SetDBField('ResourceId', $this->Application->NextResourceId() );
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnRecommend(&$event){
$friend_email = $this->Application->GetVar('friend_email');
$friend_name = $this->Application->GetVar('friend_email');
// used for error reporting only -> rewrite code + theme (by Alex)
$object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too
-
+
if (preg_match("/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/", $friend_email))
{
$send_params = array();
$send_params['to_email']=$friend_email;
$send_params['to_name']=$friend_name;
$user_id = $this->Application->RecallVar('user_id');
$email_event = &$this->Application->EmailEventUser('SITE.SUGGEST', $user_id, $send_params);
if ($email_event->status == erSUCCESS){
$event->redirect_params = array('opener' => 's', 'pass' => 'all');
$event->redirect = $this->Application->GetVar('template_success');
}
else {
// $event->redirect_params = array('opener' => 's', 'pass' => 'all');
// $event->redirect = $this->Application->GetVar('template_fail');
-
+
$object->ErrorMsgs['send_error'] = $this->Application->Phrase('lu_email_send_error');
$object->FieldErrors['Email']['pseudo'] = 'send_error';
$event->status = erFAIL;
}
}
else {
$object->ErrorMsgs['invalid_email'] = $this->Application->Phrase('lu_InvalidEmail');
$object->FieldErrors['Email']['pseudo'] = 'invalid_email';
$event->status = erFAIL;
}
}
/**
* Saves address changes and mades no redirect
*
* @param kEvent $event
*/
function OnUpdateAddress(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
list($id,$field_values) = each($items_info);
if($id > 0) $object->Load($id);
$object->SetFieldsFromHash($field_values);
$object->setID($id);
$object->Validate();
}
$event->redirect = false;
}
function OnSubscribeQuery(&$event)
{
$user_email = $this->Application->GetVar('subscriber_email');
if ( preg_match("/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/", $user_email) ){
$object = &$this->Application->recallObject($this->Prefix.'.subscriber', null, Array('skip_autoload' => true));
$this->Application->StoreVar('SubscriberEmail', $user_email);
if( $object->Load(array('Email'=>$user_email)) ){
$group_info = $this->GetGroupInfo($object->GetID());
$event->redirect = $this->Application->GetVar($group_info ? 'unsubscribe_template' : 'subscribe_template');
}
else {
$event->redirect = $this->Application->GetVar('subscribe_template');
$this->Application->StoreVar('SubscriberEmail', $user_email);
}
}
else {
- // used for error reporting only -> rewrite code + theme (by Alex)
+ // used for error reporting only -> rewrite code + theme (by Alex)
$object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too
$object->ErrorMsgs['invalid_email'] = $this->Application->Phrase('lu_InvalidEmail');
$object->FieldErrors['SubscribeEmail']['pseudo'] = 'invalid_email';
$event->status = erFAIL;
}
//subscribe_query_ok_template
}
function OnSubscribeUser(&$event){
$object = &$this->Application->recallObject($this->Prefix.'.subscriber', null, Array('skip_autoload' => true));
$user_email = $this->Application->RecallVar('SubscriberEmail');
if (preg_match("/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/", $user_email)){
if($object->Load(array('Email'=>$user_email))){
$group_info = $this->GetGroupInfo($object->GetID());
if ($group_info){
if ($event->getEventParam('no_unsubscribe')) return;
if ($group_info['PrimaryGroup']){
// delete user
$object->Delete();
}
else {
$this->RemoveSubscriberGroup($object->GetID());
}
$event->redirect = $this->Application->GetVar('unsubscribe_ok_template');
}
else {
$this->AddSubscriberGroup($object->GetID(), 0);
$event->redirect = $this->Application->GetVar('subscribe_ok_template');
}
}
else {
$object->SetField('Email', $user_email);
$object->SetField('Login', $user_email);
$object->SetDBField('dob', 1);
$object->SetDBField('dob_date', 1);
$object->SetDBField('dob_time', 1);
$ip = getenv('HTTP_X_FORWARDED_FOR')?getenv('HTTP_X_FORWARDED_FOR'):getenv('REMOTE_ADDR');
$object->SetDBField('ip', $ip);
$this->Application->SetVar('IsSubscriber', 1);
if ($object->Create()) {
$this->AddSubscriberGroup($object->GetID(), 1);
$event->redirect = $this->Application->GetVar('subscribe_ok_template');
}
$this->Application->SetVar('IsSubscriber', 0);
}
}
else {
// error handling here
$event->redirect = $this->Application->GetVar('subscribe_fail_template');
}
}
function AddSubscriberGroup($user_id, $is_primary){
$group_id = $this->Application->ConfigValue('User_SubscriberGroup');
$sql = 'INSERT INTO '.TABLE_PREFIX.'UserGroup(PortalUserId,GroupId,PrimaryGroup) VALUES (%s,%s,'.$is_primary.')';
$this->Conn->Query( sprintf($sql, $user_id, $group_id) );
$this->Application->EmailEventAdmin('USER.SUBSCRIBE', $user_id);
$this->Application->EmailEventUser('USER.SUBSCRIBE', $user_id);
}
function RemoveSubscriberGroup($user_id){
$group_id = $this->Application->ConfigValue('User_SubscriberGroup');
$sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup WHERE PortalUserId='.$user_id.' AND GroupId='.$this->Application->ConfigValue('User_SubscriberGroup');
$this->Conn->Query($sql);
$this->Application->EmailEventAdmin('USER.UNSUBSCRIBE', $user_id);
$this->Application->EmailEventUser('USER.UNSUBSCRIBE', $user_id);
}
function GetGroupInfo($user_id){
$group_info = $this->Conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'UserGroup
WHERE PortalUserId='.$user_id.'
AND GroupId='.$this->Application->ConfigValue('User_SubscriberGroup'));
return $group_info;
}
function OnForgotPassword(&$event)
{
$user_object = &$this->Application->recallObject('u.forgot', null, Array('skip_autoload' => true));
-
+
// used for error reporting only -> rewrite code + theme (by Alex)
$user_current_object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too
$username = $this->Application->GetVar('username');
$email = $this->Application->GetVar('email');
$found = false;
$allow_reset = true;
if( strlen($username) )
{
if( $user_object->Load(array('Login'=>$username)) )
$found = ($user_object->GetDBField("Login")==$username && $user_object->GetDBField("Status")==1) && strlen($user_object->GetDBField("Password"));
}
else if( strlen($email) )
{
if( $user_object->Load(array('Email'=>$email)) )
$found = ($user_object->GetDBField("Email")==$email && $user_object->GetDBField("Status")==1) && strlen($user_object->GetDBField("Password"));
}
if( $user_object->isLoaded() )
{
$PwResetConfirm = $user_object->GetDBField('PwResetConfirm');
$PwRequestTime = $user_object->GetDBField('PwRequestTime');
$PassResetTime = $user_object->GetDBField('PassResetTime');
//$MinPwResetDelay = $user_object->GetDBField('MinPwResetDelay');
$MinPwResetDelay = $this->Application->ConfigValue('Users_AllowReset');
$allow_reset = (strlen($PwResetConfirm) ?
adodb_mktime() > $PwRequestTime + $MinPwResetDelay :
adodb_mktime() > $PassResetTime + $MinPwResetDelay);
}
if($found && $allow_reset)
{
$this->Application->StoreVar('tmp_user_id', $user_object->GetDBField("PortalUserId"));
$this->Application->StoreVar('tmp_email', $user_object->GetDBField("Email"));
$this->Application->EmailEventUser('INCOMMERCEUSER.PSWDC', $user_object->GetDBField("PortalUserId"));
$event->redirect = $this->Application->GetVar('template_success');
}
else
{
if(!strlen($username) && !strlen($email))
{
$user_current_object->ErrorMsgs['forgotpw_nodata'] = $this->Application->Phrase('lu_ferror_forgotpw_nodata');
$user_current_object->FieldErrors['Login']['pseudo'] = 'forgotpw_nodata';
$user_current_object->FieldErrors['Email']['pseudo'] = 'forgotpw_nodata';
}
else
{
if($allow_reset)
{
if( strlen($username) ){
$user_current_object->ErrorMsgs['unknown_username'] = $this->Application->Phrase('lu_ferror_unknown_username');
$user_current_object->FieldErrors['Login']['pseudo']='unknown_username';
}
if( strlen($email) ){
$user_current_object->ErrorMsgs['unknown_email'] = $this->Application->Phrase('lu_ferror_unknown_email');
$user_current_object->FieldErrors['Email']['pseudo']='unknown_email';
}
}
else
{
$user_current_object->ErrorMsgs['reset_denied'] = $this->Application->Phrase('lu_ferror_reset_denied');
if( strlen($username) ){
$user_current_object->FieldErrors['Login']['pseudo']='reset_denied';
}
if( strlen($email) ){
$user_current_object->FieldErrors['Email']['pseudo']='reset_denied';
}
}
}
if($user_current_object->FieldErrors){
$event->redirect = false;
}
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnResetPassword(&$event){
$user_object = &$this->Application->recallObject('u.forgot');
if($user_object->Load($this->Application->RecallVar('tmp_user_id'))){
$this->Application->EmailEventUser('INCOMMERCEUSER.PSWDC', $user_object->GetDBField("PortalUserId"));
$event->redirect = $this->Application->GetVar('template_success');
$mod_object =& $this->Application->recallObject('mod.'.'In-Commerce');
$m_cat_id = $mod_object->GetDBField('RootCat');
$event->SetRedirectParam('pass', 'm');
//$event->SetRedirectParam('m_cat_id', $m_cat_id);
$this->Application->SetVar('m_cat_id', $m_cat_id);
}
}
function OnResetPasswordConfirmed(&$event)
{
$passed_key = $this->Application->GetVar('user_key');
$user_object = &$this->Application->recallObject('u.forgot');
-
+
// used for error reporting only -> rewrite code + theme (by Alex)
$user_current_object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true));// TODO: change theme too
if (strlen(trim($passed_key)) == 0) {
$event->redirect_params = array('opener' => 's', 'pass' => 'all');
$event->redirect = false;
$user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
}
if($user_object->Load(array('PwResetConfirm'=>$passed_key)))
{
$exp_time = $user_object->GetDBField('PwRequestTime') + 3600;
$user_object->SetDBField("PwResetConfirm", '');
$user_object->SetDBField("PwRequestTime", 0);
if ( $exp_time > adodb_mktime() )
{
//$m_var_list_update['codevalidationresult'] = 'lu_resetpw_confirm_text';
$newpw = makepassword4();
$this->Application->StoreVar('password', $newpw);
$user_object->SetDBField("Password",$newpw);
$user_object->SetDBField("PassResetTime", adodb_mktime());
$user_object->SetDBField("PwResetConfirm", '');
$user_object->SetDBField("PwRequestTime", 0);
$user_object->Update();
$this->Application->SetVar('ForgottenPassword', $newpw);
$email_event_user = &$this->Application->EmailEventUser('INCOMMERCEUSER.PSWD', $user_object->GetDBField('PortalUserId'));
$email_event_admin = &$this->Application->EmailEventAdmin('INCOMMERCEUSER.PSWD');
$this->Application->DeleteVar('ForgottenPassword');
if ($email_event_user->status == erSUCCESS){
$event->redirect_params = array('opener' => 's', 'pass' => 'all');
$event->redirect = $this->Application->GetVar('template_success');
}
$user_object->SetDBField("Password",md5($newpw));
$user_object->Update();
} else {
$user_current_object->ErrorMsgs['code_expired'] = $this->Application->Phrase('lu_code_expired');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_expired';
$event->redirect = false;
}
} else {
$user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
$event->redirect = false;
}
}
function OnUpdate(&$event)
{
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$cs_helper->CheckStateField($event, 'State', 'Country');
parent::OnUpdate($event);
$this->setNextTemplate($event);
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function setNextTemplate(&$event)
{
if( !$this->Application->IsAdmin() )
{
$event->redirect_params['opener'] = 's';
$object =& $event->getObject();
if($object->GetDBField('Status') == STATUS_ACTIVE)
{
$next_template = $this->Application->GetVar('next_template');
if($next_template) $event->redirect = $next_template;
}
}
}
/**
* Delete users from groups if their membership is expired
*
* @param kEvent $event
*/
function OnCheckExpiredMembership(&$event)
{
// send pre-expiration reminders: begin
$pre_expiration = adodb_mktime() + $this->Application->ConfigValue('User_MembershipExpirationReminder') * 3600 * 24;
$sql = 'SELECT PortalUserId, GroupId
FROM '.TABLE_PREFIX.'UserGroup
WHERE (MembershipExpires IS NOT NULL) AND (ExpirationReminderSent = 0) AND (MembershipExpires < '.$pre_expiration.')';
$skip_clause = $event->getEventParam('skip_clause');
if ($skip_clause) {
$sql .= ' AND !('.implode(') AND !(', $skip_clause).')';
}
$records = $this->Conn->Query($sql);
if ($records) {
$conditions = Array();
foreach ($records as $record) {
$email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRATION.NOTICE', $record['PortalUserId']);
$email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRATION.NOTICE');
$conditions[] = '(PortalUserId = '.$record['PortalUserId'].' AND GroupId = '.$record['GroupId'].')';
}
$sql = 'UPDATE '.TABLE_PREFIX.'UserGroup
SET ExpirationReminderSent = 1
WHERE '.implode(' OR ', $conditions);
$this->Conn->Query($sql);
}
// send pre-expiration reminders: end
// remove users from groups with expired membership: begin
$sql = 'SELECT PortalUserId
FROM '.TABLE_PREFIX.'UserGroup
WHERE (MembershipExpires IS NOT NULL) AND (MembershipExpires < '.adodb_mktime().')';
$user_ids = $this->Conn->GetCol($sql);
if ($user_ids) {
foreach ($user_ids as $id) {
$email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRED', $id);
$email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRED');
}
}
$sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup
WHERE (MembershipExpires IS NOT NULL) AND (MembershipExpires < '.adodb_mktime().')';
$this->Conn->Query($sql);
// remove users from groups with expired membership: end
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnRefreshForm(&$event)
{
$event->redirect = false;
$item_info = $this->Application->GetVar($event->Prefix_Special);
list($id, $fields) = each($item_info);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->setID($id);
$object->IgnoreValidation = true;
$object->SetFieldsFromHash($fields);
}
/**
* Sets persistant variable
*
* @param kEvent $event
*/
function OnSetPersistantVariable(&$event)
{
$object =& $event->getObject();
$field = $this->Application->GetVar('field');
$value = $this->Application->GetVar('value');
$object->setPersistantVar($field, $value);
$force_tab = $this->Application->GetVar('SetTab');
if ($force_tab) {
$this->Application->StoreVar('force_tab', $force_tab);
}
}
/**
* Overwritten to return user from order by special .ord
*
* @param kEvent $event
*/
function getPassedId(&$event)
{
if ($event->Special == 'ord') {
$order =& $this->Application->recallObject('ord');
return $order->GetDBField('PortalUserId');
}
return parent::getPassedID($event);
}
-
+
/**
* Allows to change root password
*
* @param kEvent $event
*/
function OnUpdateRootPassword(&$event)
{
$user_id = $this->Application->RecallVar('user_id');
if ($user_id != -1) {
// not "root" can't change root's password via this event
return false;
}
-
+
// put salt to user's config
$field_options = $this->Application->getUnitOption($event->Prefix.'.RootPassword', 'Fields');
$field_options['salt'] = 'b38';
$this->Application->setUnitOption($event->Prefix.'.RootPassword', 'Fields', $field_options);
-
+
$object =& $event->getObject( Array('skip_autoload' => true) );
/* @var $object UsersItem */
-
+
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info) {
list ($id, $field_values) = each($items_info);
$this->RemoveRequiredFields($object);
$object->SetDBField('RootPassword', $this->Application->ConfigValue('RootPass'));
$object->SetFieldsFromHash($field_values);
$status = $object->Validate();
if ($status) {
// validation on, password match too
$fields_hash = Array (
'VariableValue' => $object->GetDBField('RootPassword')
);
$conf_table = $this->Application->getUnitOption('conf', 'TableName');
$this->Conn->doUpdate($fields_hash, $conf_table, 'VariableName = "RootPass"');
$event->SetRedirectParam('opener', 'u');
}
else {
$event->status = erFAIL;
$event->redirect = false;
}
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/users/users_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.70
\ No newline at end of property
+1.71
\ No newline at end of property
Index: trunk/core/units/users/users_config.php
===================================================================
--- trunk/core/units/users/users_config.php (revision 7634)
+++ trunk/core/units/users/users_config.php (revision 7635)
@@ -1,206 +1,210 @@
<?php
$config = Array(
'Prefix' => 'u',
'ItemClass' => Array('class'=>'UsersItem','file'=>'users_item.php','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'UsersEventHandler','file'=>'users_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'UsersTagProcessor','file'=>'users_tag_processor.php','build_event'=>'OnBuild'),
'RegisterClasses' => Array(
Array('pseudo' => 'UsersSyncronizeManager', 'class' => 'UsersSyncronizeManager', 'file' => 'users_syncronize.php', 'build_event' => ''),
),
'AutoLoad' => true,
'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'u',
'HookToSpecial' => '',
'HookToEvent' => Array('OnAfterItemLoad', 'OnBeforeItemCreate', 'OnBeforeItemUpdate', 'OnUpdateAddress'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnPrepareStates',
),
Array(
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => 'affil',
'HookToSpecial' => '',
'HookToEvent' => Array('OnCheckAffiliateAgreement'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnSubstituteSubscriber',
),
),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'RegularEvents' => Array(
'membership_expiration' => Array('EventName' => 'OnCheckExpiredMembership', 'RunInterval' => 1800, 'Type' => reAFTER),
),
'IDField' => 'PortalUserId',
'StatusField' => Array('Status'),
'TitleField' => 'Login',
'ItemType' => 6, // used for custom fields only (on user's case)
'StatisticsInfo' => Array(
'pending' => Array(
'icon' => 'icon16_user_pending.gif',
'label' => 'la_Text_Users',
'js_url' => "set_persistant_var('User_View', 4, 'users/users_list', '#url#')",
'url' => Array('t' => 'users/users_list', 'index_file' => 'users/user_list.php', 'pass' => 'm'),
'status' => STATUS_PENDING,
),
),
'TitlePresets' => Array(
- 'default' => Array( 'new_status_labels' => Array('u'=>'!la_title_Adding_User!'),
- 'edit_status_labels' => Array('u'=>'!la_title_Editing_User!'),
- 'new_titlefield' => Array('u'=>'!la_title_New_User!'),
- ),
+ 'default' => Array(
+ 'new_status_labels' => Array('u'=>'!la_title_Adding_User!'),
+ 'edit_status_labels' => Array('u'=>'!la_title_Editing_User!'),
+ 'new_titlefield' => Array('u'=>'!la_title_New_User!'),
+ ),
+
+ 'users_list' => Array('prefixes' => Array('u_List'), 'format' => "!la_title_Users! (#u_recordcount#)"),
+
+ 'users_edit' => Array('prefixes' => Array('u'), 'format' => "#u_status# '#u_titlefield#' - !la_title_General!"),
+ 'users_custom' => Array('prefixes' => Array('u'), 'format' => "#u_status# '#u_titlefield#' - !la_title_Custom!"),
+
+ 'users_select' => Array('prefixes' => Array('u_List'), 'format' => "!la_title_Users! (#u_recordcount#) - !la_title_SelectUser!"),
- 'users_list' => Array('prefixes' => Array('u_List'), 'format' => "!la_title_Users! (#u_recordcount#)"),
+ 'user_groups_list' => Array('prefixes' => Array('u', 'u-ug_List'), 'format' => "#u_status# '#u_titlefield#' - !la_title_Groups! (#u-ug_recordcount#)"),
- 'users_edit' => Array('prefixes' => Array('u'), 'format' => "#u_status# '#u_titlefield#' - !la_title_General!"),
-
- 'users_select' => Array('prefixes' => Array('u_List'), 'format' => "!la_title_Users! (#u_recordcount#) - !la_title_SelectUser!"),
-
- 'tree_users' => Array('format' => '!la_section_overview!'),
- ),
+ 'tree_users' => Array('format' => '!la_section_overview!'),
+ ),
'PermSection' => Array('main' => 'in-portal:user_list', 'email' => 'in-portal:user_email', 'custom' => 'in-portal:user_custom'),
'TableName' => TABLE_PREFIX.'PortalUser',
'ListSQLs' => Array( '' => ' SELECT %1$s.* %2$s FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON %1$s.PortalUserId = ug.PortalUserId AND ug.PrimaryGroup = 1
LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON ug.GroupId = g.GroupId
LEFT JOIN '.TABLE_PREFIX.'%3$sPortalUserCustomData cust ON %1$s.ResourceId = cust.ResourceId',
),
'ItemSQLs' => Array( '' => ' SELECT %1$s.* %2$s FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON %1$s.PortalUserId = ug.PortalUserId AND ug.PrimaryGroup = 1
LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON ug.GroupId = g.GroupId
LEFT JOIN '.TABLE_PREFIX.'%3$sPortalUserCustomData cust ON %1$s.ResourceId = cust.ResourceId',
),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('Login' => 'asc'),
)
),
'SubItems' => Array('addr', 'u-cdata', 'u-ug', 'fav'),
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER),
),
'Filters' => Array(
0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
1 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
2 => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
)
),
'CalculatedFields' => Array(
'' => Array(
'PrimaryGroup' => 'g.Name',
),
),
'Fields' => Array
(
'PortalUserId' => Array(),
'Login' => Array('type' => 'string', 'unique'=>Array('Login'), 'default' => '','required'=>1, 'error_msgs' => Array('unique'=>'!lu_user_already_exist!')),
'Password' => Array('type' => 'string', 'formatter' => 'kPasswordFormatter', 'encryption_method' => 'md5', 'verify_field' => 'VerifyPassword', 'skip_empty' => 1, 'default' => md5('') ),
'FirstName' => Array('type' => 'string','default' => ''),
'LastName' => Array('type' => 'string','default' => ''),
'Company' => Array('type' => 'string','not_null' => '1','default' => ''),
'Email' => Array('type' => 'string', 'formatter'=>'kFormatter', 'regexp'=>'/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/', 'sample_value' => 'email@domain.com', 'unique'=>Array('Email'), 'not_null' => '1', 'required'=>1, 'default' => '', 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!', 'unique'=>'!lu_email_already_exist!') ),
'CreatedOn' => Array('type'=>'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#', 'not_null' => '1' ),
'Phone' => Array('type' => 'string','default' => ''),
'Fax' => Array('type' => 'string','not_null' => '1','default' => ''),
'Street' => Array('type' => 'string','default' => ''),
'Street2' => Array('type' => 'string', 'not_null' => '1', 'default' => ''),
'City' => Array('type' => 'string','default' => ''),
'State' => Array('formatter'=>'kOptionsFormatter',
'options' => Array(),
'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
'not_null' => '1','default' => ''),
'Zip' => Array('type' => 'string','default' => ''),
'Country' => Array('formatter'=>'kOptionsFormatter',
'options_sql'=>'SELECT %1$s
FROM '.TABLE_PREFIX.'StdDestinations
LEFT JOIN '.TABLE_PREFIX.'Phrase
ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
WHERE
DestType=1
AND
LanguageId = %2$s
ORDER BY Translation',
'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
'not_null' => '1','default' => ''),
'ResourceId' => Array('type' => 'int','not_null' => '1','default' => '0'),
'Status' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array(1=>'la_Enabled', 0=>'la_Disabled', 2=>'la_Pending'), 'use_phrases'=>1, 'not_null' => '1','default' => 2),
'Modified' => Array('type' => 'int', 'formatter'=>'kDateFormatter', 'not_null' => '1', 'default' => '#NOW#' ),
'dob' => Array('type'=>'int', 'formatter' => 'kDateFormatter', 'not_null' => '1', 'default' => '', 'required'=>1),
'tz' => Array('type' => 'int','default' => ''),
'ip' => Array('type' => 'string','default' => ''),
'IsBanned' => Array('type' => 'int','not_null' => '1','default' => '0'),
'PassResetTime' => Array('type' => 'int','default' => ''),
'PwResetConfirm' => Array('type' => 'string','default' => ''),
'PwRequestTime' => Array('type' => 'int','default' => ''),
'MinPwResetDelay' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array('300' => '5', '600' => '10', '900' => '15', '1800' => '30', '3600' => '60'), 'use_phrases' => 0, 'not_null' => '1', 'default' => 30),
),
'VirtualFields' => Array(
'ValidateLogin' => Array('type'=>'string','default'=>''),
'SubscribeEmail' => Array('type'=>'string','default'=>''),
'PrimaryGroup' => Array('type' => 'string', 'default' => ''),
'RootPassword' => Array('type' => 'string', 'formatter' => 'kPasswordFormatter', 'encryption_method' => 'md5', 'verify_field' => 'VerifyRootPassword', 'skip_empty' => 1, 'default' => md5('') ),
),
'Grids' => Array(
'Default' => 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_checkbox_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'),
),
),
'UserSelector' => 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: trunk/core/units/users/users_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.33
\ No newline at end of property
+1.34
\ No newline at end of property
Index: trunk/core/units/relationship/relationship_event_handler.php
===================================================================
--- trunk/core/units/relationship/relationship_event_handler.php (revision 7634)
+++ trunk/core/units/relationship/relationship_event_handler.php (revision 7635)
@@ -1,266 +1,266 @@
<?php
class RelationshipEventHandler extends kDBEventHandler
{
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnProcessSelected' => Array('subitem' => 'add|edit'),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Initializes new relation
*
* @param kEvent $event
*/
function OnNew(&$event)
{
parent::OnNew($event);
$object =& $event->getObject();
$table_info = $object->getLinkedInfo();
$object->SetDBField('SourceId', $table_info['ParentId']);
$source_itemtype = $this->Application->getUnitOption($table_info['ParentPrefix'], 'ItemType');
$object->SetDBField('SourceType', $source_itemtype);
$object->SetDBField('TargetId', $this->Application->GetVar('target_id'));
$object->SetDBField('TargetType', $this->Application->GetVar('target_type'));
$this->OnAfterItemLoad($event);
}
/**
* Add new relation
*
* @param kEvent $event
*/
function OnProcessSelected(&$event)
{
$dst_field = $this->Application->RecallVar('dst_field');
if ($dst_field == 'TargetId') {
// prepare target_id & target_type
$object =& $event->getObject( Array('skip_autoload' => true) );
$selected_ids = $this->Application->GetVar('selected_ids');
$target_prefix = false;
foreach ($selected_ids as $selected_prefix => $target_id) {
if ($target_id > 0) {
$target_prefix = $selected_prefix;
break;
}
}
if (!$target_prefix) {
$this->finalizePopup($event);
return;
}
$sql = 'SELECT ResourceId
FROM '.$this->Application->getUnitOption($target_prefix, 'TableName').'
- WHERE '.$this->Application->getUnitOption($target_prefix, 'IDField').' = '.$target_id;
+ WHERE '.$this->Application->getUnitOption($target_prefix, 'IDField').' IN ('.$target_id.')';
$target_id = $this->Conn->GetOne($sql);
$target_type = $this->Application->getUnitOption($target_prefix, 'ItemType');
// don't add same relation twice
$table_info = $object->getLinkedInfo();
$sql = 'SELECT TargetId
FROM '.$object->TableName.'
WHERE (SourceId = '.$table_info['ParentId'].') AND (TargetId = '.$target_id.')';
$duplicate_relation = $this->Conn->GetOne($sql) == $target_id;
$this->finalizePopup($event);
if (!$duplicate_relation) {
// place correct template in opener stack
$source_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
$template = $this->Application->getUnitOption($source_prefix, 'AdminTemplatePath').'/relations_edit';
-
+
$redirect_params = Array($event->Prefix.'_event' => 'OnNew', 'target_id' => $target_id, 'm_opener' => 's', 'target_type' => $target_type);
$this->Application->EventManager->openerStackPush($template, $redirect_params, 'all,'.$event->Prefix);
-
+
// $event->SetRedirectParam('popup_stay', 1); // if popup mode, then set this
}
}
else {
$this->finalizePopup($event);
}
}
/**
* Set ItemName & ItemType virtual fields based on loaded item data
*
* @param kEvent $event
*/
function OnAfterItemLoad(&$event)
{
$object =& $event->getObject();
$sql = 'SELECT Prefix
FROM '.TABLE_PREFIX.'ItemTypes
WHERE ItemType = '.$object->GetDBField('TargetType');
$target_prefix = $this->Conn->GetOne($sql);
$title_field = $this->getTitleField($target_prefix);
$title_phrase = $this->Application->getUnitOption($target_prefix, 'TitlePhrase');
$sql = 'SELECT '.$title_field.'
FROM '.$this->Application->getUnitOption($target_prefix, 'TableName').'
WHERE ResourceId = '.$object->GetDBField('TargetId');
$object->SetDBField('ItemName', $this->Conn->GetOne($sql));
$object->SetDBField('ItemType', $this->Application->Phrase($title_phrase));
}
/**
* Creates needed sql query to load list,
* if no query is defined in config for
* special requested, then use default
* query
*
* @param kEvent $event
* @access protected
*/
function ListPrepareQuery(&$event)
{
return $this->BaseQuery($event, 'ListSQLs');
}
/**
* Creates needed sql query to load item,
* if no query is defined in config for
* special requested, then use default
* query
*
* @param kEvent $event
* @access protected
*/
function ItemPrepareQuery(&$event)
{
return $this->BaseQuery($event, 'ItemSQLs');
}
/**
* Get item name & type based on relation type & modules installed
*
* @param kEvent $event
* @param string $sql_field
*/
function BaseQuery(&$event, $sql_field)
{
$sqls = $this->Application->getUnitOption($event->Prefix,$sql_field);
$sql = isset($sqls[$event->Special]) ? $sqls[$event->Special] : $sqls[''];
$configs = $this->extractModulesInfo();
// 2. build sql based on information queried
$sql_templates['ItemName'] = 'IFNULL(%s.%s,\' \')';
$sql_templates['TableJoin'] = 'LEFT JOIN %1$s ON %1$s.ResourceId = rel.TargetId';
$sql_templates['TargetName'] = 'IF(rel.TargetType = %s, \'%s\', %s)';
$sql_parts = Array();
$sql_parts['TargetName'] = "''";
foreach ($configs as $prefix => $config_data) {
$title_field = $this->getTitleField($prefix);
$sql_parts['ItemName'][] = sprintf($sql_templates['ItemName'], $config_data['TableName'], $title_field);
$sql_parts['TableJoin'][] = sprintf($sql_templates['TableJoin'], $config_data['TableName']);
$sql_parts['TargetName'] = sprintf( $sql_templates['TargetName'],
$config_data['ItemType'],
'!'.$config_data['TitlePhrase'].'!',
$sql_parts['TargetName']);
$sql_parts['TargetName'] = str_replace('rel','%1$s',$sql_parts['TargetName']);
}
$object =& $event->getObject();
$vars = Array('#ITEM_NAMES#', '#ITEM_TYPES#');
$replacements = Array( implode(', ',$sql_parts['ItemName']), $sql_parts['TargetName'] );
$calculated_fields =& $object->getProperty('CalculatedFields');
foreach ($calculated_fields as $field_name => $field_expression) {
$calculated_fields[$field_name] = str_replace($vars, $replacements, $field_expression);
}
$object->setProperty('CalculatedFields', $calculated_fields);
$sql = str_replace('#ITEM_JOIN#', implode(' ',$sql_parts['TableJoin']), $sql);
$sql = str_replace('rel.','%1$s.',$sql);
return $sql;
}
/**
* Convert TitleField field of kMultiLanguage formatter used for it
*
* @param string $prefix
* @return string
*/
function getTitleField($prefix)
{
$lang_prefix = 'l'.$this->Application->GetVar('m_lang').'_';
$title_field = $this->Application->getUnitOption($prefix, 'TitleField');
$field_options = $this->Application->getUnitOption($prefix.'.'.$title_field, 'Fields');
$formatter_class = isset($field_options['formatter']) ? $field_options['formatter'] : '';
if ($formatter_class == 'kMultiLanguage' && !isset($field_options['master_field'])) {
$title_field = $lang_prefix.$title_field;
}
return $title_field;
}
/**
* Get configs from modules installed
*
* @return Array
* @access private
*/
function extractModulesInfo()
{
// get installed modules & their config info
// maybe we should leave only prefixes, that have "view" permission
$configs = Array();
foreach ($this->Application->ModuleInfo as $module_name => $module_data) {
$prefix = $module_data['Var'];
if ($prefix == 'm') {
$prefix = 'c';
}
if (!$this->Application->prefixRegistred($prefix)) continue;
-
+
$configs[$prefix] = $this->Application->getUnitOptions($prefix);
if($configs[$prefix] === false) unset($configs[$prefix]);
if(!isset($configs[$prefix]['CatalogItem']) || !$configs[$prefix]['CatalogItem']) unset($configs[$prefix]);
}
return $configs;
}
/**
* Deletes relations to hooked item from other items
*
* @param kEvent $event
*/
function OnDeleteForeignRelations(&$event)
{
$main_object =& $event->MasterEvent->getObject();
$resource_id = $main_object->GetDBField('ResourceId');
$table = $this->Application->getUnitOption($event->Prefix,'TableName');
$sql = 'DELETE FROM '.$table.' WHERE TargetId = '.$resource_id;
$this->Conn->Query($sql);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/relationship/relationship_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.10
\ No newline at end of property
+1.11
\ No newline at end of property
Index: trunk/core/units/languages/languages_config.php
===================================================================
--- trunk/core/units/languages/languages_config.php (revision 7634)
+++ trunk/core/units/languages/languages_config.php (revision 7635)
@@ -1,168 +1,180 @@
<?php
$config = Array(
'Prefix' => 'lang',
'ItemClass' => Array('class'=>'LanguagesItem','file'=>'languages_item.php','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'LanguagesEventHandler','file'=>'languages_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'LanguagesTagProcessor','file'=>'languages_tag_processor.php','build_event'=>'OnBuild'),
'RegisterClasses' => Array(
Array('pseudo'=>'LangXML','class'=>'LangXML_Parser','file'=>'import_xml.php'),
),
'AutoLoad' => true,
'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'lang',
'HookToSpecial' => '',
'HookToEvent' => Array('OnSave'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnReflectMultiLingualFields',
),
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'lang',
'HookToSpecial' => '',
'HookToEvent' => Array('OnPreSave'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnCopyLabels',
),
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'lang',
'HookToSpecial' => '*',
'HookToEvent' => Array('OnSave'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnUpdatePrimary',
),
+
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'lang',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnSave','OnMassDelete'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnScheduleTopFrameReload',
+ ),
+
),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'LanguageId',
'StatusField' => Array('Enabled','PrimaryLang'), // field, that is affected by Approve/Decline events
'TitleField' => 'PackName', // field, used in bluebar when editing existing item
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('lang'=>'!la_title_Adding_Language!'),
'edit_status_labels' => Array('lang'=>'!la_title_Editing_Language!'),
'new_titlefield' => Array('lang'=>'!la_title_New_Language!'),
),
'languages_list' => Array( 'prefixes' => Array('lang_List'), 'format' => "!la_title_Configuration! - !la_title_LanguagePacks! (#lang_recordcount#)"),
'languages_edit_general' => Array( 'prefixes' => Array('lang'), 'format' => "#lang_status# '#lang_titlefield#' - !la_title_General!"),
'phrases_list' => Array( 'prefixes' => Array('lang','phrases_List'), 'format' => "#lang_status# '#lang_titlefield#' - !la_title_Labels! (#phrases_recordcount#)"),
'import_language' => Array( 'prefixes' => Array('phrases.import'), 'format' => "!la_title_InstallLanguagePackStep1!"),
'import_language_step2' => Array( 'prefixes' => Array('phrases.import'), 'format' => "!la_title_InstallLanguagePackStep2!"),
'export_language' => Array( 'prefixes' => Array('phrases.export'), 'format' => "!la_title_ExportLanguagePackStep1!"),
'export_language_results' => Array( 'prefixes' => Array('phrases.export'), 'format' => "!la_title_ExportLanguagePackResults!"),
'events_list' => Array( 'prefixes' => Array('lang','emailevents_List'), 'format' => "#lang_status# '#lang_titlefield#' - !la_title_EmailEvents! (#emailevents_recordcount#)"),
'event_edit' => Array( 'prefixes' => Array('emailevents'),
'edit_status_labels' => Array('emailevents' => '!la_title_Editing_EmailEvent!'),
'format' => '#emailevents_status# - #emailevents_titlefield#'),
'email_messages_edit' => Array( 'prefixes' => Array('lang','emailmessages'),
'new_titlefield' => Array('emailmessages' => '!la_NoSubject!'),
'format' => "#lang_status# '#lang_titlefield#' - !la_title_EditingEmailEvent! '#emailmessages_titlefield#'"),
),
'PermSection' => Array('main' => 'in-portal:configure_lang'),
'Sections' => Array(
'in-portal:configure_lang' => Array(
'parent' => 'in-portal:system',
'icon' => 'conf_regional',
'label' => 'la_tab_Regional',
'url' => Array('t' => 'regional/languages_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:set_primary', 'advanced:import', 'advanced:export'),
'priority' => 2,
'type' => stTREE,
),
),
'TableName' => TABLE_PREFIX.'Language',
'SubItems' => Array('phrases','emailmessages'),
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array(0,1), 'type' => WHERE_FILTER),
),
'Filters' => Array(
0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 1' ),
1 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 0' ),
)
),
'AutoDelete' => true,
'AutoClone' => true,
'ListSQLs' => Array( ''=>'SELECT * FROM %s',
), // key - special, value - list select sql
'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('PackName' => 'asc'),
)
),
'Fields' => Array(
'LanguageId' => Array(),
'PackName' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
'LocalName' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
'Enabled' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_Disabled', 1 => 'la_Enabled'), 'use_phrases' => 1, 'not_null' => '1', 'default' => 1),
'PrimaryLang' => Array('type' => 'int','not_null' => '1','default' => '0'),
'IconURL' => Array('type' => 'string','default' => ''),
'DateFormat' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
'TimeFormat' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
'InputDateFormat' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('m/d/Y' => 'm/d/Y', 'd/m/Y' => 'd/m/Y'), 'not_null' => '1','default' => 'm/d/Y', 'required' => 1),
'InputTimeFormat' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('g:i:s A' => 'g:i:s A', 'g:i A' => 'g:i A', 'H:i:s' => 'H:i:s', 'H:i' => 'H:i' ), 'not_null' => '1','default' => 'g:i:s A', 'required' => 1),
'DecimalPoint' => Array('type' => 'string','not_null' => '1','default' => ''),
'ThousandSep' => Array('type' => 'string','not_null' => '1','default' => ''),
'Charset' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
'UnitSystem' => Array('type' => 'int','not_null' => '1','default' => '1','formatter' => 'kOptionsFormatter','options' => Array(1 => 'la_Metric', 2 => 'la_US_UK'),'use_phrases' => 1),
),
'VirtualFields' => Array(
'CopyLabels' => Array('type' => 'int', 'default' => 0),
'CopyFromLanguage' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Language ORDER BY PackName', 'option_title_field' => 'PackName', 'option_key_field' => 'LanguageId'),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_custom.gif','0_0'=>'icon16_language_disabled.gif','1_0'=>'icon16_language.gif','0_1'=>'icon16_language_disabled.gif','1_1'=>'icon16_language_primary.gif'),
'Fields' => Array(
'PackName' => Array( 'title'=>'la_col_PackName', 'data_block' => 'grid_checkbox_td'),
'LocalName' => Array( 'title'=>'la_col_LocalName' ),
'Enabled' => Array( 'title'=>'la_col_Status' ),
),
),
),
);
?>
\ No newline at end of file
Property changes on: trunk/core/units/languages/languages_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.20
\ No newline at end of property
+1.21
\ No newline at end of property
Index: trunk/core/units/languages/languages_tag_processor.php
===================================================================
--- trunk/core/units/languages/languages_tag_processor.php (revision 7634)
+++ trunk/core/units/languages/languages_tag_processor.php (revision 7635)
@@ -1,82 +1,110 @@
<?php
class LanguagesTagProcessor extends kDBTagProcessor
{
/**
* Guesses what charset should be used:
* 1. use lang.current_Field field="Charset" by default
* 2. if using temp tables then use lang_Field field="Charset"
*
* @param Array $params
* @return string
*/
function GetCharset($params)
{
$edit_direct = $this->Application->GetVar('phrases_label');
$top_prefix = $this->Application->GetTopmostPrefix($this->Prefix);
if( substr($this->Application->GetVar($top_prefix.'_mode'), 0, 1) == 't' && !$edit_direct )
{
$object =& $this->getObject();
return $object->GetDBField('Charset');
}
$lang_current =& $this->Application->recallObject('lang.current');
return $lang_current->GetDBField('Charset');
}
+ /**
+ * Returns formatted date + time on current language
+ *
+ * @param Array $params
+ * @return string
+ */
+ function CurrentDate($params)
+ {
+ $week_day = $this->Application->Phrase('lu_weekday_'.adodb_date('l'));
+ $format = str_replace('l', '#@#', $params['format']); // replace with reserved char (preserves translation link)
+
+ return str_replace('#@#', $week_day, adodb_date($format));
+ }
+
function ListLanguages($params)
{
$this->Special = 'enabled';
return $this->PrintList2($params);
}
+ function LanguageName($params)
+ {
+ $object =& $this->getObject($params);
+ return $this->Application->Phrase($params['phrase_prefix'].$object->GetDBField('PackName'));
+ }
+
+ function LanguageLink($params)
+ {
+ $t = $this->SelectParam($params, 'template,t');
+
+ $object =& $this->getObject($params);
+ return $this->Application->HREF($t, '', Array('m_lang' => $object->GetID()));
+ }
+
function SelectedLanguage($params)
{
- $object =& $this->Application->recallObject($this->getPrefixSpecial());
+ $object =& $this->getObject($params);
return $object->GetDBField('LanguageId') == $this->Application->GetVar('m_lang');
}
/**
* Returns path where exported languages should be saved
*
* @param unknown_type $params
*/
function ExportPath($params)
{
$ret = EXPORT_PATH.'/';
if( getArrayValue($params,'as_url') )
{
$ret = str_replace( FULL_PATH.'/', $this->Application->BaseURL(), $ret);
}
return $ret;
}
/**
* Returns true if system has more then 1 language installed
*
* @param Array $params
* @return bool
*/
function IsMultiLanguage($params)
{
return $this->TotalRecords($params) > 1;
}
function IsPrimaryLanguage($params)
{
return $this->Application->GetDefaultLanguageId() == $this->Application->GetVar('m_lang');
}
/* function Main_IsMetricUnits($params)
{
$object =& $this->Application->recallObject($this->Prefix.'.current');
$measure_system = $object->GetDBField('UnitSystem');
return $measure_system == 1 ? 1 : 0;
}*/
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/languages/languages_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.8
\ No newline at end of property
+1.9
\ No newline at end of property
Index: trunk/core/units/languages/languages_event_handler.php
===================================================================
--- trunk/core/units/languages/languages_event_handler.php (revision 7634)
+++ trunk/core/units/languages/languages_event_handler.php (revision 7635)
@@ -1,438 +1,460 @@
<?php
class LanguagesEventHandler extends kDBEventHandler
{
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnChangeLanguage' => Array('self' => true),
'OnSetPrimary' => Array('self' => 'advanced:set_primary|add|edit'),
'OnImportLanguage' => Array('self' => 'advanced:import'),
'OnImportProgress' => Array('self' => 'advanced:import'),
'OnExportLanguage' => Array('self' => 'advanced:export'),
'OnExportProgress' => Array('self' => 'advanced:export'),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Updates table structure on new language adding/removing language
*
* @param kEvent $event
*/
function OnReflectMultiLingualFields($event)
{
$ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
$this->Application->UnitConfigReader->includeConfigFiles(MODULES_PATH); //make sure to re-read all configs
+ $this->Application->UnitConfigReader->AfterConfigRead();
foreach ($this->Application->UnitConfigReader->configData as $prefix => $config_data) {
$ml_helper->createFields($prefix);
}
}
/**
* Allows to set selected language as primary
*
* @param kEvent $event
*/
function OnSetPrimary(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$this->StoreSelectedIDs($event);
$ids = $this->getSelectedIDs($event);
if ($ids) {
$id = array_shift($ids);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->Load($id);
$object->setPrimary();
}
}
/**
* [HOOK] Reset primary status of other languages if we are saving primary language
*
* @param kEvent $event
*/
function OnUpdatePrimary(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->SwitchToLive();
// set primary for each languages, that have this checkbox checked
$ids = explode(',', $event->MasterEvent->getEventParam('ids'));
foreach ($ids as $id) {
$object->Load($id);
if ($object->GetDBField('PrimaryLang')) {
$object->setPrimary();
}
}
// if no primary language left, then set primary last language (not to load again) from edited list
$sql = 'SELECT '.$object->IDField.'
FROM '.$object->TableName.'
WHERE PrimaryLang = 1';
$primary_language = $this->Conn->GetOne($sql);
if (!$primary_language) {
$object->setPrimary(false);
}
}
/**
* Occurse before updating item
*
* @param kEvent $event
* @access public
*/
function OnBeforeItemUpdate(&$event)
{
$object =& $event->getObject();
$status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') );
if ($object->GetDBField('PrimaryLang') == 1 && $object->GetDBField($status_field) == 0) {
$object->SetDBField($status_field, 1);
}
}
/**
* Shows only enabled languages on front
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
if($event->Special == 'enabled')
{
$object =& $event->getObject();
$object->addFilter('enabled_filter', '%1$s.Enabled = 1');
}
}
/**
* Copy labels from another language
*
* @param kEvent $event
*/
function OnCopyLabels(&$event)
{
$object =& $event->getObject();
$from_lang_id = $object->GetDBField('CopyFromLanguage');
if( ($event->MasterEvent->status == erSUCCESS) && $object->GetDBField('CopyLabels') == 1 && ($from_lang_id > 0) )
{
$lang_id = $object->GetID();
// 1. phrases import
$phrases_live = $this->Application->getUnitOption('phrases','TableName');
$phrases_temp = $this->Application->GetTempName($phrases_live, 'prefix:phrases');
$sql = 'INSERT INTO '.$phrases_temp.'
SELECT Phrase, Translation, PhraseType, 0-PhraseId, '.$lang_id.', '.adodb_mktime().', "", Module
FROM '.$phrases_live.'
WHERE LanguageId='.$from_lang_id;
$this->Conn->Query($sql);
// 2. events import
$em_table_live = $this->Application->getUnitOption('emailmessages','TableName');
$em_table_temp = $this->Application->GetTempName($em_table_live, 'prefix:emailmessages');
$sql = 'SELECT * FROM '.$em_table_live.' WHERE LanguageId = '.$from_lang_id;
$email_messages = $this->Conn->Query($sql);
if($email_messages)
{
$id = $this->Conn->GetOne('SELECT MIN(EmailMessageId) FROM '.$em_table_live);
if($id > 0) $id = 0;
$id--;
$sqls = Array();
foreach($email_messages as $email_message)
{
$sqls[] = $id.','.$this->Conn->qstr($email_message['Template']).','.$this->Conn->qstr($email_message['MessageType']).','.$lang_id.','.$email_message['EventId'];
$id--;
}
$sql = 'INSERT INTO '.$em_table_temp.'(EmailMessageId,Template,MessageType,LanguageId,EventId) VALUES ('.implode('),(',$sqls).')';
$this->Conn->Query($sql);
}
$object->SetDBField('CopyLabels', 0);
}
}
/**
* Prepare temp tables for creating new item
* but does not create it. Actual create is
* done in OnPreSaveCreated
*
* @param kEvent $event
*/
function OnPreCreate(&$event)
{
parent::OnPreCreate($event);
$object =& $event->getObject();
$object->SetDBField('CopyLabels', 1);
$live_table = $this->Application->getUnitOption($event->Prefix, 'TableName');
$primary_lang_id = $this->Conn->GetOne('SELECT '.$object->IDField.' FROM '.$live_table.' WHERE PrimaryLang = 1');
$object->SetDBField('CopyFromLanguage', $primary_lang_id);
}
function OnChangeLanguage(&$event)
{
$this->Application->SetVar('m_lang', $this->Application->GetVar('language'));
//$this->Application->LinkVar('language', 'm_lang');
}
/**
* Parse language XML file into temp tables and redirect to progress bar screen
*
* @param kEvent $event
*/
function OnImportLanguage(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$items_info = $this->Application->GetVar('phrases_import');
if($items_info)
{
list($id,$field_values) = each($items_info);
$object =& $this->Application->recallObject('phrases.import', 'phrases', Array('skip_autoload' => true) );
$object->SetFieldsFromHash($field_values);
$filename = getArrayValue($field_values, 'LangFile', 'tmp_name');
if( filesize($filename) )
{
$modules = getArrayValue($field_values,'Module');
$lang_xml =& $this->Application->recallObject('LangXML');
$lang_xml->Parse($filename, $field_values['PhraseType'], $modules, $field_values['ImportOverwrite']);
$event->redirect = true;
$event->SetRedirectParams( Array('lang_event' => 'OnImportProgress', 'pass' => 'all,lang', 'mode'=>$field_values['ImportOverwrite']) );
}
else
{
$object =& $this->Application->recallObject('phrases.import');
$object->SetError('LangFile', 'la_empty_file', 'la_EmptyFile');
$event->redirect = false;
}
}
}
/**
* Copies imported from xml file from temp table to live table
*
* @param kEvent $event
*/
function OnImportProgress(&$event)
{
define('IMPORT_BY', 300); // import this much records per step
$template_name = 'regional/languages_import_step2';
$import_mode = (int)$this->Application->GetVar('mode'); // 1 - overwrite existing phrases, 0 - don't overwrite existing phrases
$import_source = (int)$this->Application->GetVar('source');
$import_steps = Array(0 => 'lang', 1 => 'phrases', 2 => 'emailmessages', 3 => 'finish');
$key_fields = Array(0 => 'PackName', 1 => 'Phrase', 2 => 'EventId'); // by what field should we search record match
$import_titles = Array(0 => 'la_ImportingLanguages', 1 => 'la_ImportingPhrases', 2 => 'la_ImportingEmailEvents', 3 => 'la_Done');
// --- BEFORE ---
$import_prefix = $import_steps[$import_source];
$import_start = (int)$this->Application->GetVar('start');
$id_field = $this->Application->getUnitOption($import_prefix,'IDField');
$dst_table = $this->Application->getUnitOption($import_prefix,'TableName');
$src_table = $this->Application->GetTempName($dst_table);
$import_total = $this->Application->GetVar('total');
if(!$import_total) $import_total = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$src_table);
// --- AFTER ---
if($import_start == $import_total)
{
$import_source++;
$import_prefix = $import_steps[$import_source];
if($import_prefix == 'finish')
{
$event->SetRedirectParam('opener','u');
return true;
}
$import_start = 0;
$id_field = $this->Application->getUnitOption($import_prefix,'IDField');
$dst_table = $this->Application->getUnitOption($import_prefix,'TableName');
$src_table = $this->Application->GetTempName($dst_table);
$import_total = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$src_table);
}
if($import_total > 0)
{
$done_percent = ($import_start * 100) / $import_total;
}
else
{
$done_percent = 100;
}
$block_params = Array( 'name' => $template_name,
'title' => $import_titles[$import_source],
'percent_done' => $done_percent,
'percent_left' => 100 - $done_percent);
$this->Application->InitParser();
$this->Application->setUnitOption('phrases','AutoLoad',false);
echo $this->Application->ParseBlock($block_params);
//break out of buffering
$buffer_content = Array();
while (ob_get_level()) {
$buffer_content[] = ob_get_clean();
}
$ret = implode('', array_reverse($buffer_content));
echo $ret;
flush();
$sql = 'SELECT * FROM %s LIMIT %s,%s';
$rows = $this->Conn->Query( sprintf($sql,$src_table,$import_start,IMPORT_BY) );
$values_sql = '';
// if found and mode = 1 (overwrite)
$search_sql = 'SELECT '.$id_field.' FROM '.$dst_table.' WHERE '.$key_fields[$import_source].' = %s AND LanguageId = %s';
$update_sql = 'UPDATE '.$dst_table.' SET %s WHERE '.$id_field.' = %s';
foreach($rows as $row)
{
$tmp_sql = sprintf($search_sql, $this->Conn->qstr($row[ $key_fields[$import_source] ]), $row['LanguageId'] );
$tmp_id = $this->Conn->GetOne($tmp_sql);
if($tmp_id > 0 && $import_mode == 1)
{
// update
$update_fields = '';
foreach($row as $field_name => $field_value)
{
if($field_name == $id_field) continue;
$update_fields .= '`'.$field_name.'` = '.$this->Conn->qstr($field_value).',';
}
$update_fields = preg_replace('/(.*),$/', '\\1', $update_fields);
$this->Conn->Query( sprintf($update_sql, $update_fields, $tmp_id) );
}
elseif(!$tmp_id)
{
$values_sql .= '(';
foreach($row as $field_value)
{
$values_sql .= $this->Conn->qstr($field_value).',';
}
$values_sql = preg_replace('/(.*),$/', '\\1', $values_sql).'),';
}
}
if($values_sql)
{
$fields_sql = '';
$fields = array_keys( $this->Application->getUnitOption($import_prefix,'Fields') );
foreach($fields as $field_name)
{
$fields_sql .= '`'.$field_name.'`,';
}
$fields_sql = preg_replace('/(.*),$/', '\\1', $fields_sql);
$values_sql = preg_replace('/(.*),$/', '\\1', $values_sql);
$sql = sprintf('INSERT INTO %s (%s) VALUES %s', $dst_table, $fields_sql, $values_sql);
$this->Conn->Query($sql);
}
$event->setRedirectParams( Array('lang_event' => 'OnImportProgress', 'pass' => 'all,lang', 'start' => $import_start += count($rows), 'total' => $import_total, 'source' => $import_source, 'mode' => $import_mode) );
}
/**
* Stores ids of selected languages and redirects to export language step 1
*
* @param kEvent $event
*/
function OnExportLanguage(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$this->Application->setUnitOption('phrases','AutoLoad',false);
$this->StoreSelectedIDs($event);
$this->Application->StoreVar('export_language_ids', implode(',', $this->getSelectedIDs($event)) );
$event->setRedirectParams( Array('m_opener'=>'d','phrases.export_event'=>'OnNew','pass'=>'all,phrases.export') );
$event->redirect = 'regional/languages_export';
}
/**
* Saves selected languages to xml file passed
*
* @param kEvent $event
*/
function OnExportProgress(&$event)
{
$items_info = $this->Application->GetVar('phrases_export');
if($items_info)
{
list($id,$field_values) = each($items_info);
$object =& $this->Application->recallObject('phrases.export', 'phrases', Array('skip_autoload' => true) );
$object->SetFieldsFromHash($field_values);
$lang_ids = explode(',', $this->Application->RecallVar('export_language_ids') );
if( !getArrayValue($field_values,'LangFile') )
{
$object->SetError('LangFile', 'required');
$event->redirect = false;
return false;
}
if( !is_writable(EXPORT_PATH) )
{
$object->SetError('LangFile', 'write_error', 'la_ExportFolderNotWritable');
$event->redirect = false;
return false;
}
if( substr($field_values['LangFile'], -5) != '.lang' ) $field_values['LangFile'] .= '.lang';
$filename = EXPORT_PATH.'/'.$field_values['LangFile'];
$lang_xml =& $this->Application->recallObject('LangXML');
if ($object->GetDBField('DoNotEncode')) {
$lang_xml->SetEncoding('plain');
}
$lang_xml->Create($filename, $field_values['PhraseType'], $lang_ids, $field_values['Module']);
}
$event->redirect = 'regional/languages_export_step2';
$event->SetRedirectParam('export_file', $field_values['LangFile']);
}
/**
* Returns to previous template in opener stack
*
* @param kEvent $event
*/
function OnGoBack(&$event)
{
$event->redirect_params['opener'] = 'u';
}
+ function OnScheduleTopFrameReload(&$event)
+ {
+ $this->Application->StoreVar('RefreshTopFrame',1);
+ }
+
+ /**
+ * Do now allow deleting current language
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ $del_id = $event->getEventParam('id');
+ $object =& $event->getObject(array('skip_autload' => true));
+ $object->Load($del_id);
+
+ if ($object->GetDBField('PrimaryLang') || $del_id == $this->Application->GetVar('m_lang')) {
+ $event->status = erFAIL;
+ }
+ }
+
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/languages/languages_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.29
\ No newline at end of property
+1.30
\ No newline at end of property
Index: trunk/core/units/modules/modules_config.php
===================================================================
--- trunk/core/units/modules/modules_config.php (revision 7634)
+++ trunk/core/units/modules/modules_config.php (revision 7635)
@@ -1,121 +1,121 @@
<?php
$config = Array(
'Prefix' => 'mod',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'ModulesEventHandler','file'=>'modules_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'ModulesTagProcessor','file'=>'modules_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'Name',
'TitleField' => 'Name', // field, used in bluebar when editing existing item
'StatusField' => Array('Loaded'),
'TitlePresets' => Array(
'modules_list' => Array( 'prefixes' => Array('mod_List'), 'format' => "!la_title_Configuration! - !la_title_Module_Status! (#mod_recordcount#)"),
'tree_modules' => Array('format' => '!la_section_overview!'),
),
'PermSection' => Array('main' => 'in-portal:mod_status'),
'Sections' => Array(
// "Configuration" -> "Modules and Settings"
'in-portal:modules' => Array(
'parent' => 'in-portal:system',
'icon' => 'modules',
'label' => 'la_tab_ModulesManagement',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:mod_status' => Array(
'parent' => 'in-portal:modules',
'icon' => 'modules',
'label' => 'la_title_Module_Status',
- 'url' => Array('t' => 'in-portal/modules/modules_list', 'pass' => 'm'),
+ 'url' => Array('t' => 'modules/modules_list', 'pass' => 'm'),
'permissions' => Array('view', 'edit', 'advanced:approve', 'advanced:decline'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:addmodule' => Array(
'parent' => 'in-portal:modules',
'icon' => 'modules',
'label' => 'la_title_Add_Module',
'url' => Array('index_file' => 'modules/addmodule.php', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:tag_library' => Array(
'parent' => 'in-portal:modules',
'icon' => 'modules',
'label' => 'la_tab_TagLibrary',
'url' => Array('index_file' => 'tag_listing.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 3,
'type' => stTREE,
),
),
'TableName' => TABLE_PREFIX.'Modules',
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array('enabled', 'disabled'), 'type' => WHERE_FILTER),
),
'Filters' => Array(
'enabled' => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Loaded != 1'),
'disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Loaded != 0'),
)
),
'ListSQLs' => Array( ''=>'SELECT * FROM %s',
), // key - special, value - list select sql
'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('LoadOrder' => 'asc'),
)
),
'Fields' => Array(
'Name' => Array('type' => 'string','not_null' => '1','default' => ''),
'Path' => Array('type' => 'string','not_null' => '1','default' => ''),
'Var' => Array('type' => 'string','not_null' => '1','default' => ''),
'Version' => Array('type' => 'string','not_null' => '1','default' => ''),
'Loaded' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Enabled', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => '1','default' => '1'),
'LoadOrder' => Array('type' => 'int','not_null' => '1','default' => '0'),
'TemplatePath' => Array('type' => 'string','not_null' => '1','default' => ''),
'RootCat' => Array('type' => 'int','not_null' => '1','default' => '0'),
'BuildDate' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'not_null' => '1','default' => ''),
),
'VirtualFields' => Array(),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default' => 'icon16_custom.gif'),
'Fields' => Array(
'Name' => Array('title' => 'la_col_Name', 'data_block' => 'grid_checkbox_td_no_icon'),
'Loaded' => Array('title' => 'la_col_Status'),
'Version' => Array('title' => 'la_col_Version'),
),
),
),
);
?>
\ No newline at end of file
Property changes on: trunk/core/units/modules/modules_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.7
\ No newline at end of property
+1.8
\ No newline at end of property
Index: trunk/core/units/modules/modules_event_handler.php
===================================================================
--- trunk/core/units/modules/modules_event_handler.php (revision 7634)
+++ trunk/core/units/modules/modules_event_handler.php (revision 7635)
@@ -1,79 +1,82 @@
<?php
class ModulesEventHandler extends kDBEventHandler {
/**
* Builds item
*
* @param kEvent $event
* @access protected
*/
function OnItemBuild(&$event)
{
$this->Application->SetVar($event->getPrefixSpecial(true).'_id', $event->Special);
parent::OnItemBuild($event);
}
/**
* List with one record if special passed
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
+ $object =& $event->getObject();
if ($event->Special) {
- $object =& $event->getObject();
$object->addFilter('current_module', 'Name = '.$event->Special);
}
+ if (!$this->Application->isModuleEnabled('Proj-Base')) {
+ $object->addFilter('not_core', 'Name != '.$this->Conn->qstr('Core'));
+ }
}
function mapEvents()
{
parent::mapEvents();
$this->eventMethods['OnMassApprove'] = 'moduleAction';
$this->eventMethods['OnMassDecline'] = 'moduleAction';
}
/**
* Disabled modules, but not In-Portal
*
* @param kEvent $event
*/
function moduleAction(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$object =& $event->getObject( Array('skip_autoload' => true) );
$ids = $this->StoreSelectedIDs($event);
if (!$ids) return true;
$status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') );
foreach($ids as $id)
{
$object->Load($id);
if ($object->GetID() == 'In-Portal') continue;
$object->SetDBField($status_field, $event->Name == 'OnMassApprove' ? 1 : 0);
if ($object->Update()) {
$event->status = erSUCCESS;
- $event->redirect_params = Array('opener' => 's', 'pass_events' => true); //stay!
+ $event->redirect_params = Array('opener' => 's'); //stay!
}
else {
$event->status = erFAIL;
$event->redirect = false;
break;
}
}
$this->Application->UnitConfigReader->ResetParsedData(true); //true to reset sections cache also
$event->SetRedirectParam('RefreshTree', 1);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/modules/modules_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.9
\ No newline at end of property
+1.10
\ No newline at end of property
Index: trunk/core/units/permissions/permissions_config.php
===================================================================
--- trunk/core/units/permissions/permissions_config.php (revision 7634)
+++ trunk/core/units/permissions/permissions_config.php (revision 7635)
@@ -1,88 +1,88 @@
<?php
$config = Array(
'Prefix' => 'perm',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'PermissionsEventHandler','file'=>'permissions_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'PermissionsTagProcessor','file'=>'permissions_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'Clones' => Array(
'c-perm' => Array(
'Constrain' => 'Type = 0', // non-system
'ParentPrefix' => 'c',
'ForeignKey' => 'CatId',
'ParentTableKey' => 'CategoryId',
-
+
'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => true,
'HookToPrefix' => '#PARENT#',
'HookToSpecial' => '*',
'HookToEvent' => Array('OnPreSave'),
'DoPrefix' => '',
'DoSpecial' => '*',
'DoEvent' => 'OnCategorySavePermissions',
),
),
),
'g-perm' => Array(
'Constrain' => 'Type = 1', // system
'ParentPrefix' => 'g',
'ForeignKey' => 'GroupId',
'ParentTableKey' => 'GroupId',
-
+
'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => true,
'HookToPrefix' => '#PARENT#',
'HookToSpecial' => '*',
'HookToEvent' => Array('OnPreSave'),
'DoPrefix' => '',
'DoSpecial' => '*',
'DoEvent' => 'OnGroupSavePermissions',
),
),
),
),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
),
'IDField' => 'PermissionId',
'StatusField' => Array('PermissionValue'),
'TitleField' => 'Permission',
'TableName' => TABLE_PREFIX.'Permissions',
- 'AutoDelete' => true,
- 'AutoClone' => true,
+ 'AutoDelete' => false,
+ 'AutoClone' => false,
'ListSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s'),
'ItemSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s'),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('Permission' => 'asc'),
)
),
'Fields' => Array(
'PermissionId' => Array(),
'Permission' => Array('type' => 'string','not_null' => '1','default' => ''),
'GroupId' => Array('type' => 'int','default' => '0'),
'PermissionValue' => Array('type' => 'int','not_null' => '1','default' => '0'),
'Type' => Array('type' => 'int','not_null' => '1','default' => '0'),
'CatId' => Array('type' => 'int','not_null' => '1','default' => '0'),
),
);
?>
\ No newline at end of file
Property changes on: trunk/core/units/permissions/permissions_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/core/units/general/cat_dbitem.php
===================================================================
--- trunk/core/units/general/cat_dbitem.php (revision 7634)
+++ trunk/core/units/general/cat_dbitem.php (revision 7635)
@@ -1,461 +1,467 @@
<?php
class kCatDBItem extends kDBItem {
/**
* Category path, needed for import
*
* @var Array
*/
var $CategoryPath = Array();
/**
* Use automatic filename generation
*
* @var bool
*/
var $useFilenames = true;
/**
* Use pending editing abilities during item (delegated by permissions)
*
* @var bool
*/
var $usePendingEditing = false;
-
+
function Clear()
{
parent::Clear();
$this->CategoryPath = Array();
}
-
+
/**
* Set's prefix and special
*
* @param string $prefix
* @param string $special
* @access public
*/
function Init($prefix, $special, $event_params = null)
{
parent::Init($prefix, $special, $event_params);
$this->usePendingEditing = $this->Application->getUnitOption($this->Prefix, 'UsePendingEditing');
}
-
+
function Create($force_id=false, $system_create=false)
{
if (!$this->Validate()) return false;
$this->SetDBField('ResourceId', $this->Application->NextResourceId());
$this->SetDBField('Modified', adodb_mktime() );
+ $this->UpdateFormattersSubFields(array('Modified'));
if ($this->mode != 't' && !$this->Application->IsAdmin()) {
$this->SetDBField('CreatedById', $this->Application->RecallVar('user_id'));
}
if ($this->useFilenames) {
$this->checkFilename();
$this->generateFilename();
}
$ret = parent::Create();
if ($ret) {
$primary_category = $this->GetDBField('CategoryId') > 0 ? $this->GetDBField('CategoryId') : $this->Application->GetVar('m_cat_id');
$fields_hash = Array(
'CategoryId' => $primary_category,
'ItemResourceId' => $this->GetField('ResourceId'),
'PrimaryCat' => 1,
'ItemPrefix' => $this->Prefix,
'Filename' => $this->GetDBField('Filename'),
);
- $this->Conn->doInsert($fields_hash, $this->CategoryItemsTable());
+ $this->Conn->doInsert($fields_hash, $this->CategoryItemsTable());
}
return $ret;
}
function Update($id=null, $system_update=false)
{
$this->VirtualFields['ResourceId'] = Array();
$this->SetDBField('Modified', adodb_mktime() );
+ $this->UpdateFormattersSubFields(array('Modified'));
$this->SetDBField('ModifiedById', $this->Application->RecallVar('user_id'));
if ($this->useFilenames) {
$this->checkFilename();
$this->generateFilename();
}
$ret = parent::Update($id, $system_update);
if ($ret) {
$filename = $this->useFilenames ? $this->GetDBField('Filename') : '';
$sql = 'UPDATE '.$this->CategoryItemsTable().'
SET Filename = '.$this->Conn->qstr($filename).'
WHERE ItemResourceId = '.$this->GetDBField('ResourceId');
$this->Conn->Query($sql);
}
unset($this->VirtualFields['ResourceId']);
return $ret;
}
/**
* Returns CategoryItems table based on current item mode (temp/live)
*
* @return string
*/
function CategoryItemsTable()
{
$table = TABLE_PREFIX.'CategoryItems';
if ($this->Application->IsTempTable($this->TableName)) {
$table = $this->Application->GetTempName($table, 'prefix:'.$this->Prefix);
}
-
+
return $table;
}
-
-
+
+
function checkFilename()
{
if( !$this->GetDBField('AutomaticFilename') )
{
$filename = $this->GetDBField('Filename');
$this->SetDBField('Filename', $this->stripDisallowed($filename) );
}
}
function Copy($cat_id=null)
{
if (!isset($cat_id)) $cat_id = $this->Application->GetVar('m_cat_id');
$this->NameCopy($cat_id);
return $this->Create($cat_id);
}
function NameCopy($master=null, $foreign_key=null)
{
$title_field = $this->Application->getUnitOption($this->Prefix, 'TitleField');
if (!$title_field) return;
$new_name = $this->GetDBField($title_field);
$cat_id = $this->Application->GetVar('m_cat_id');
$original_checked = false;
do {
if ( preg_match('/Copy ([0-9]*) *of (.*)/', $new_name, $regs) ) {
$new_name = 'Copy '.( (int)$regs[1] + 1 ).' of '.$regs[2];
}
elseif ($original_checked) {
$new_name = 'Copy of '.$new_name;
}
$query = 'SELECT '.$title_field.' FROM '.$this->TableName.'
LEFT JOIN '.TABLE_PREFIX.'CategoryItems ON
('.TABLE_PREFIX.'CategoryItems.ItemResourceId = '.$this->TableName.'.ResourceId)
WHERE ('.TABLE_PREFIX.'CategoryItems.CategoryId = '.$cat_id.') AND '.
$title_field.' = '.$this->Conn->qstr($new_name);
$res = $this->Conn->GetOne($query);
$original_checked = true;
} while ($res !== false);
$this->SetDBField($title_field, $new_name);
+
+ // this is needed, because Create will create items in its own CategoryId (if it's set),
+ // but we need to create it in target Paste category @see{kCatDBItem::Create} and its primary_category detection
+ $this->SetDBField('CategoryId', $cat_id);
}
function MoveToCat($cat_id=null)
{
// $this->NameCopy();
$cat_id = $this->Application->GetVar('m_cat_id');
// check if the product already exists in destination cat
$query = 'SELECT PrimaryCat FROM '.TABLE_PREFIX.'CategoryItems
WHERE CategoryId = '.$cat_id.' AND ItemResourceId = '.$this->GetDBField('ResourceId');
// if it's not found is_primary will be FALSE, if it's found but not primary it will be int 0
$is_primary = $this->Conn->GetOne($query);
$exists = $is_primary !== false;
if ($exists) { // if the Product already exists in destination category
if ($is_primary) return; // do nothing when we paste to primary
// if it's not primary - delete it from destination category,
// as we will move it from current primary below
$query = 'DELETE FROM '.TABLE_PREFIX.'CategoryItems
WHERE ItemResourceId = '.$this->GetDBField('ResourceId').' AND CategoryId = '.$cat_id;
$this->Conn->Query($query);
}
$query = 'UPDATE '.TABLE_PREFIX.'CategoryItems SET CategoryId = '.$cat_id.
' WHERE ItemResourceId = '.$this->GetDBField('ResourceId').' AND PrimaryCat = 1';
$this->Conn->Query($query);
$this->Update();
}
// We need to delete CategoryItems record when deleting product
function Delete($id = null)
{
if( isset($id) ) {
$this->setID($id);
}
$this->Load($this->GetID());
$ret = parent::Delete();
if ($ret) {
$query = ' DELETE FROM '.$this->CategoryItemsTable().'
WHERE ItemResourceId = '.$this->GetDBField('ResourceId');
$this->Conn->Query($query);
}
return $ret;
}
/**
* Deletes item from categories
*
* @param Array $delete_category_ids
* @author Alex
*/
function DeleteFromCategories($delete_category_ids)
{
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); // because item was loaded before by ResourceId
$ci_table = $this->Application->getUnitOption($this->Prefix.'-ci', 'TableName');
$resource_id = $this->GetDBField('ResourceId');
$item_cats_sql = 'SELECT CategoryId FROM %s WHERE ItemResourceId = %s';
$delete_category_items_sql = 'DELETE FROM %s WHERE ItemResourceId = %s AND CategoryId IN (%s)';
$category_ids = $this->Conn->GetCol( sprintf($item_cats_sql, $ci_table, $resource_id) );
$cats_left = array_diff($category_ids, $delete_category_ids);
if(!$cats_left)
{
$sql = 'SELECT %s FROM %s WHERE ResourceId = %s';
$ids = $this->Conn->GetCol( sprintf($sql, $id_field, $this->TableName, $resource_id) );
$temp =& $this->Application->recallObject($this->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$temp->DeleteItems($this->Prefix, $this->Special, $ids);
}
else
{
$this->Conn->Query( sprintf($delete_category_items_sql, $ci_table, $resource_id, implode(',', $delete_category_ids) ) );
$sql = 'SELECT CategoryId FROM %s WHERE PrimaryCat = 1 AND ItemResourceId = %s';
$primary_cat_id = $this->Conn->GetCol( sprintf($sql, $ci_table, $resource_id) );
if( count($primary_cat_id) == 0 )
{
$sql = 'UPDATE %s SET PrimaryCat = 1 WHERE (CategoryId = %s) AND (ItemResourceId = %s)';
$this->Conn->Query( sprintf($sql, $ci_table, reset($cats_left), $resource_id ) );
}
}
}
/**
* replace not allowed symbols with "_" chars + remove duplicate "_" chars in result
*
* @param string $string
* @return string
*/
function stripDisallowed($filename)
{
$filenames_helper =& $this->Application->recallObject('FilenamesHelper');
$table = $this->mode == 't' ? $this->Application->GetTempName(TABLE_PREFIX.'CategoryItems', 'prefix:'.$this->Prefix) : TABLE_PREFIX.'CategoryItems';
return $filenames_helper->stripDisallowed($table, 'ItemResourceId', $this->GetDBField('ResourceId'), $filename);
}
/* commented out because it's called only from stripDisallowed body, which is moved to helper
function checkAutoFilename($filename)
{
$filenames_helper =& $this->Application->recallObject('FilenamesHelper');
return $filenames_helper->checkAutoFilename($this->TableName, $this->IDField, $this->GetID(), $filename);
}*/
/**
* Generate item's filename based on it's title field value
*
* @return string
*/
function generateFilename()
{
if ( !$this->GetDBField('AutomaticFilename') && $this->GetDBField('Filename') ) return false;
$title_field = $this->Application->getUnitOption($this->Prefix, 'TitleField');
if (preg_match('/l([\d]+)_(.*)/', $title_field, $regs)) {
// if title field is multilingual, then use it's name from primary language
$title_field = 'l'.$this->Application->GetDefaultLanguageId().'_'.$regs[2];
}
$name = $this->stripDisallowed( $this->GetDBField($title_field) );
if ( $name != $this->GetDBField('Filename') ) $this->SetDBField('Filename', $name);
}
/**
* Check if value is set for required field
*
* @param string $field field name
* @param Array $params field options from config
* @return bool
* @access private
*/
function ValidateRequired($field, $params)
{
$res = true;
$error_field = isset($params['error_field']) ? $params['error_field'] : $field;
if ( getArrayValue($params,'required') )
{
$res = ( (string) $this->FieldValues[$field] != '');
}
if (!$res) $this->FieldErrors[$error_field]['pseudo'] = 'required';
return $res;
}
/**
* Adds item to other category
*
* @param int $category_id
* @param bool $is_primary
*/
function assignToCategory($category_id, $is_primary = false)
{
$table = $this->mode == 't' ? $this->Application->GetTempName(TABLE_PREFIX.'CategoryItems', 'prefix:'.$this->Prefix) : TABLE_PREFIX.'CategoryItems';
$key_clause = '(ItemResourceId = '.$this->GetDBField('ResourceId').')';
// get all cateories, where item is in
$sql = 'SELECT PrimaryCat, CategoryId FROM '.$table.' WHERE '.$key_clause;
$item_categories = $this->Conn->GetCol($sql, 'CategoryId');
if (!$item_categories) {
$item_categories = Array();
$primary_found = false;
}
// find primary category
foreach ($item_categories as $item_category_id => $primary_found) {
if ($primary_found) {
break;
}
}
if ($primary_found && ($item_category_id == $category_id) && !$is_primary) {
// want to make primary category as non-primary :(
return true;
}
else if (!$primary_found) {
$is_primary = true;
}
if ($is_primary && $item_categories) {
// reset primary mark from all other categories
$sql = 'UPDATE '.$table.' SET PrimaryCat = 0 WHERE '.$key_clause;
$this->Conn->Query($sql);
}
// UPDATE & INSERT instead of REPLACE because CategoryItems table has no primary key defined in database
if (isset($item_categories[$category_id])) {
$sql = 'UPDATE '.$table.' SET PrimaryCat = '.($is_primary ? 1 : 0).' WHERE '.$key_clause.' AND (CategoryId = '.$category_id.')';
$this->Conn->Query($sql);
}
else {
$sql = 'INSERT INTO '.$table.' (CategoryId,ItemResourceId,PrimaryCat,ItemPrefix,Filename) VALUES (%s,%s,%s,%s,%s)';
$filename = $this->useFilenames ? $this->GetDBField('Filename') : ''; // because some prefixes does not use filenames
$this->Conn->Query( sprintf($sql, $category_id, $this->GetDBField('ResourceId'), $is_primary ? 1 : 0, $this->Conn->qstr($this->Prefix), $this->Conn->qstr($filename)) );
}
// to ensure filename update after adding to another category
// this is critical since there may be an item with same filename in newly added category!
$this->Update();
}
/**
* Removes item from category specified
*
* @param int $category_id
*/
function removeFromCategory($category_id)
{
$sql = 'DELETE FROM '.TABLE_PREFIX.'CategoryItems WHERE (CategoryId = %s) AND (ItemResourceId = %s)';
$this->Conn->Query( sprintf($sql, $category_id, $this->GetDBField('ResourceId')) );
}
/**
* Returns list of columns, that could exist in imported file
*
* @return Array
*/
function getPossibleExportColumns()
{
static $columns = null;
if (!is_array($columns)) {
$columns = array_merge($this->Fields['AvailableColumns']['options'], $this->Fields['ExportColumns']['options']);
}
return $columns;
}
/**
* Returns item's primary image data
*
* @return Array
*/
function getPrimaryImageData()
{
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'Images
WHERE (ResourceId = '.$this->GetDBField('ResourceId').') AND (DefaultImg = 1)';
$image_data = $this->Conn->GetRow($sql);
if (!$image_data) {
// 2. no primary image, then get image with name "main"
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'Images
WHERE (ResourceId = '.$this->GetDBField('ResourceId').') AND (Name = "main")';
$image_data = $this->Conn->GetRow($sql);
}
return $image_data;
}
-
+
function ChangeStatus($new_status)
{
$status_field = array_shift( $this->Application->getUnitOption($this->Prefix,'StatusField') );
$this->SetDBField($status_field, $new_status);
return $this->Update();
}
-
+
/**
* Approves changes made to category item
*
* @return bool
*/
function ApproveChanges()
{
$original_id = $this->GetDBField('OrgId');
if (!($this->usePendingEditing && $original_id)) {
// non-pending copy of original link
return $this->ChangeStatus(STATUS_ACTIVE);
}
-
+
if ($this->raiseEvent('OnBeforeDeleteOriginal', null, Array('original_id' => $original_id))) {
// delete original item, because changes made in pending copy (this item) got to be approved in this method
$temp_handler =& $this->Application->recallObject($this->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$temp_handler->DeleteItems($this->Prefix, $this->Special, Array($original_id));
-
+
$this->SetDBField('OrgId', 0);
return $this->ChangeStatus(STATUS_ACTIVE);
}
-
+
return false;
}
-
+
/**
* Decline changes made to category item
*
* @return bool
*/
function DeclineChanges()
{
$original_id = $this->GetDBField('OrgId');
-
+
if (!($this->usePendingEditing && $original_id)) {
// non-pending copy of original link
return $this->ChangeStatus(STATUS_DISABLED);
}
-
+
// delete this item, because changes made in pending copy (this item) will be declined in this method
$temp_handler =& $this->Application->recallObject($this->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$temp_handler->DeleteItems($this->Prefix, $this->Special, Array($this->GetID()));
// original item is not changed here, because it is already enabled (thrus pending copy is visible to item's owner or admin with permission)
return true;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/cat_dbitem.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.35
\ No newline at end of property
+1.36
\ No newline at end of property
Index: trunk/core/units/general/helpers/multilanguage.php
===================================================================
--- trunk/core/units/general/helpers/multilanguage.php (revision 7634)
+++ trunk/core/units/general/helpers/multilanguage.php (revision 7635)
@@ -1,242 +1,254 @@
<?php
/**
* Performs action on multilingual fields
*
*/
class kMultiLanguageHelper extends kHelper {
var $languageCount = 0;
/**
* Structure of table, that is currently processed
*
* @var Array
*/
var $curStructure = Array();
/**
* Field, to get structure information from
*
* @var string
*/
var $curSourceField = false;
/**
* Indexes used in table of 32
*
* @var int
*/
var $curIndexCount = 0;
/**
* Fields from config, that are currently used
*
* @var Array
*/
var $curFields = Array();
function kMultiLanguageHelper()
{
parent::kHelper();
$this->languageCount = $this->getLanguageCount();
}
/**
* Returns language count in system (always is divisible by 5)
*
*/
function getLanguageCount()
{
$table_name = $this->Application->getUnitOption('lang', 'TableName');
$languages_count = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$table_name);
if (!$languages_count) {
// during installation we have not languages, but we need to created custom field columns
$languages_count = 1;
}
return $languages_count + 5 - ( $languages_count % 5 ? ($languages_count % 5) : 5 );
}
function scanTable($mask)
{
$i = 0;
$fields_found = 0;
$fields = array_keys($this->curStructure);
foreach ($fields as $field_name) {
if (preg_match($mask, $field_name)) {
$fields_found++;
}
}
return $fields_found;
}
function readTableStructure($table_name, $refresh = false)
{
// if ($refresh || !getArrayValue($structure_status, $prefix.'.'.$table_name)) {
$this->curStructure = $this->Conn->Query('DESCRIBE '.$table_name, 'Field');
$this->curIndexCount = count($this->Conn->Query('SHOW INDEXES FROM '.$table_name));
// }
}
+
+ /**
+ * Checks if table exists in database
+ *
+ * @param string $table_name
+ * @return bool
+ */
+ function tableExists($table_name)
+ {
+ $sql = 'SHOW TABLES LIKE "'.$table_name.'"';
+ return $this->Conn->Query($sql) ? true : false;
+ }
/**
* Creates missing multilanguage fields in table by specified prefix
*
* @param string $prefix
* @param bool $refresh Forces config field structure to be re-read from database
*/
function createFields($prefix, $refresh = false)
{
if ($refresh) {
$this->Application->HandleEvent( new kEvent($prefix.':OnCreateCustomFields') );
}
$table_name = $this->Application->getUnitOption($prefix, 'TableName');
$this->curFields = $this->Application->getUnitOption($prefix, 'Fields');
- if (!($table_name && $this->curFields) ) {
+ if (!($table_name && $this->curFields) || ($table_name && !$this->tableExists($table_name))) {
// invalid config found or prefix not found
return true;
}
$sqls = Array();
$this->readTableStructure($table_name, $refresh);
foreach($this->curFields as $field_name => $field_options)
{
if (getArrayValue($field_options, 'formatter') == 'kMultiLanguage') {
if (isset($field_options['master_field'])) {
unset($this->curFields[$field_name]);
continue;
}
$created_count = $this->getCreatedCount($field_name);
$create_count = $this->languageCount - $created_count;
if ($create_count > 0) {
// `l77_Name` VARCHAR( 255 ) NULL DEFAULT '0';
$field_mask = Array();
$field_mask['name'] = 'l%s_'.$field_name;
$field_mask['null'] = getArrayValue($field_options, 'not_null') ? 'NOT NULL' : 'NULL';
if ($this->curSourceField) {
$default_value = $this->getFieldParam('Default') != 'NULL' ? $this->Conn->qstr($this->getFieldParam('Default')) : $this->getFieldParam('Default');
$field_mask['type'] = $this->getFieldParam('Type');
}
else {
$default_value = is_null($field_options['default']) ? 'NULL' : $this->Conn->qstr($field_options['default']);
$field_mask['type'] = $field_options['db_type'];
}
$field_mask['default'] = 'DEFAULT '.$default_value;
$field_mask = $field_mask['name'].' '.$field_mask['type'].' '.$field_mask['null'].' '.$field_mask['default'];
$sqls[] = 'ALTER TABLE '.$table_name.( $this->generateAlterSQL($field_mask, $created_count + 1, $create_count) );
}
}
}
foreach ($sqls as $sql_query) {
$this->Conn->Query($sql_query);
}
}
function deleteField($prefix, $custom_id)
{
$table_name = $this->Application->getUnitOption($prefix, 'TableName');
$sql = 'DESCRIBE '.$table_name.' "l%_cust_'.$custom_id.'"';
$fields = $this->Conn->GetCol($sql);
$sql = 'ALTER TABLE '.$table_name.' ';
$sql_template = 'DROP COLUMN %s, ';
foreach ($fields as $field_name) {
$sql .= sprintf($sql_template, $field_name);
}
$sql = preg_replace('/(.*), $/', '\\1', $sql);
$this->Conn->Query($sql);
}
/**
* Returns parameter requested of current source field
*
* @param string $param_name
* @return string
*/
function getFieldParam($param_name)
{
return $this->curStructure[$this->curSourceField][$param_name];
}
function getCreatedCount($field_name)
{
$ret = $this->scanTable('/^l[\d]+_'.preg_quote($field_name, '/').'/');
if (!$ret) {
// no multilingual fields at all (but we have such field without language prefix)
$original_found = $this->scanTable('/'.preg_quote($field_name, '/').'/');
$this->curSourceField = $original_found ? $field_name : false;
}
else {
$this->curSourceField = 'l1_'.$field_name;
}
return $ret;
}
/**
* Returns ALTER statement part for adding required fields to table
*
* @param string $field_mask sql mask for creating field with correct definition (type & size)
* @param int $start_index add new fields starting from this index
* @param int $create_count create this much new multilingual field translations
* @return string
*/
function generateAlterSQL($field_mask, $start_index, $create_count)
{
static $single_lang = null;
if (!isset($single_lang)) {
// if single language mode, then create indexes only on primary columns
$table_name = $this->Application->getUnitOption('lang', 'TableName');
$sql = 'SELECT COUNT(*)
FROM '.$table_name.'
WHERE Enabled = 1';
// if language count = 0, then assume it's multi language mode
$single_lang = $this->Conn->GetOne($sql) == 1;
}
$ret = ' ';
$ml_field = preg_replace('/l(.*)_(.*?) (.*)/', '\\2', $field_mask);
$i_count = $start_index + $create_count;
while ($start_index < $i_count) {
list($prev_field,$type) = explode(' ', sprintf($field_mask, $start_index - 1) );
if (substr($prev_field, 0, 3) == 'l0_') {
$prev_field = substr($prev_field, 3, strlen($prev_field));
if (!$this->curSourceField) {
// get field name before this one
$fields = array_keys($this->curFields);
// $prev_field = key(end($this->curStructure));
$prev_field = $fields[array_search($prev_field, $fields) - 1];
if (getArrayValue($this->curFields[$prev_field], 'formatter') == 'kMultiLanguage') {
$prev_field = 'l'.$this->languageCount.'_'.$prev_field;
}
}
}
$field_expression = sprintf($field_mask, $start_index);
$ret .= 'ADD COLUMN '.$field_expression.' AFTER `'.$prev_field.'`, ';
if ($this->curIndexCount < 32 && ($start_index == $this->Application->GetDefaultLanguageId() || !$single_lang)) {
// create index for primary language column + for all others (if multiple languages installed)
list($field_name, $field_params) = explode(' ', $field_expression, 2);
$index_type = isset($this->curFields[$ml_field]['index_type']) ? $this->curFields[$prev_field]['index_type'] : 'string';
$ret .= $index_type == 'string' ? 'ADD INDEX (`'.$field_name.'` (5) ), ' : 'ADD INDEX (`'.$field_name.'`), ';
$this->curIndexCount++;
}
$start_index++;
}
return preg_replace('/, $/',';',$ret);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/helpers/multilanguage.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.9
\ No newline at end of property
+1.10
\ No newline at end of property
Index: trunk/core/units/general/helpers/mod_rewrite_helper.php
===================================================================
--- trunk/core/units/general/helpers/mod_rewrite_helper.php (revision 7634)
+++ trunk/core/units/general/helpers/mod_rewrite_helper.php (revision 7635)
@@ -1,527 +1,527 @@
<?php
class kModRewriteHelper extends kHelper {
function kModRewriteHelper()
{
parent::kHelper();
$this->HTTPQuery =& $this->Application->recallObject('HTTPQuery');
}
function SetDefaultValues(&$vars)
{
$defaults = Array('m_cat_id' => 0, 'm_cat_page' => 1, 'm_opener' => 's');
foreach ($defaults as $default_key => $default_value)
{
if ($this->HTTPQuery->Get($default_key) == null) {
$vars[$default_key] = $default_value;
}
}
}
function ProcessLanguage(&$url_parts, &$vars)
{
if (!isset($url_parts[0])) return false;
$res = false;
$url_part = array_shift($url_parts);
$sql = 'SELECT LanguageId FROM '.TABLE_PREFIX.'Language WHERE LOWER(PackName) = '.$this->Conn->qstr($url_part).' AND Enabled = 1';
$language_id = $this->Conn->GetOne($sql);
$this->Application->Phrases = new PhrasesCache();
if($language_id)
{
$vars['m_lang'] = $language_id;
$res = true;
}
// $this->Application->VerifyLanguageId();
if (!$res) {
array_unshift($url_parts, $url_part);
}
return $res;
}
function ProcessTheme(&$url_parts, &$vars)
{
if (!isset($url_parts[0])) return false;
$res = false;
$url_part = array_shift($url_parts);
$sql = 'SELECT ThemeId FROM '.TABLE_PREFIX.'Theme WHERE LOWER(Name) = '.$this->Conn->qstr($url_part).' AND Enabled = 1';
$theme_id = $this->Conn->GetOne($sql);
if($theme_id)
{
$vars['m_theme'] = $theme_id;
$res = true;
}
// $this->Application->VerifyThemeId(); // verify anyway - will set default if not found!!!
if (!$res) {
array_unshift($url_parts, $url_part);
}
return $res;
}
function ProcessCategory(&$url_parts, &$vars)
{
if (!isset($url_parts[0])) return false;
$res = false;
$url_part = array_shift($url_parts);
$category_id = 0;
$last_category_id = 0;
$category_path = '';
do
{
$category_path = trim($category_path.'/'.$url_part, '/');
- if( preg_match('/(.*)_([\d]+)$/', $category_path, $rets) )
+ if( !preg_match('/^bb_[\d]+/', $url_part) && preg_match('/(.*)_([\d]+)$/', $category_path, $rets) )
{
$category_path = $rets[1];
$vars['m_cat_page'] = $rets[2];
}
$category_id = $this->Conn->GetOne(
'SELECT CategoryId
FROM '.TABLE_PREFIX.'Category
WHERE Status = 1 AND NamedParentPath = '.$this->Conn->qstr($category_path));
if ($category_id !== false) {
$last_category_id = $category_id;
$url_part = array_shift($url_parts);
$res = true;
}
} while ($category_id !== false && $url_part);
$vars['m_cat_id'] = $last_category_id;
if ($url_part) {
array_unshift($url_parts, $url_part);
}
return $res;
}
function ProcessPage(&$url_parts, &$vars)
{
if (!is_numeric($url_parts[0]) || count($url_parts) > 1) return false;
// set module pages for all modules, since we don't know which module will need it
foreach ($this->Application->ModuleInfo as $module_name => $module_data)
{
$vars[ $module_data['Var'].'_id'] = 0;
$vars[ $module_data['Var'].'_Page'] = $url_parts[0];
$vars[ $module_data['Var'].'_Reviews_Page'] = 0;
}
return true;
}
function ProcessModuleIndex(&$url_parts, &$vars)
{
if ( count($url_parts) > 1) return false; // if no more parts or only 1 part left
if ( $url_parts && $url_parts[0] == 'index') { // treat index same as no parts
array_shift($url_parts);
}
if( $url_parts ) { // if parts are left, it can only be module page
if (!is_numeric($url_parts[0])) return false;
$this->ProcessPage($url_parts, $vars);
}
// try to find CMS index page of the category
if ($this->Application->isModuleEnabled('In-CMS')) {
$sql = 'SELECT p.Path, ci.CategoryId FROM '.TABLE_PREFIX.'Pages AS p
LEFT JOIN '.TABLE_PREFIX.'CategoryItems AS ci
ON ci.ItemResourceId = p.ResourceId
WHERE
p.IsIndex = 1
AND
p.Status = 1
AND
CategoryId = '.$vars['m_cat_id'].'
AND
ci.PrimaryCat = 1';
$template_found = $this->Conn->GetRow($sql);
if ($template_found !== false) {
$vars['t'] = $template_found['Path'];
return true;
}
}
$sql = 'SELECT CachedCategoryTemplate
FROM '.TABLE_PREFIX.'Category
WHERE CategoryId = '.$vars['m_cat_id'];
$vars['t'] = $this->Conn->GetOne($sql);
if (!$vars['t']) $vars['t'] = 'index';
return true;
}
function ProcessModuleItem(&$url_parts, &$vars, $set_t=true)
{
if (preg_match('/^bb_.*/', $url_parts[0])) {
$cat_item = $this->Conn->GetRow('
SELECT c.ParentPath, c.CategoryId FROM '.TABLE_PREFIX.'Category AS c
WHERE
c.CategoryId = '.$vars['m_cat_id']);
if ($set_t) {
$item_template = $this->GetItemTemplate($cat_item, 'bb');
$vars['t'] = $item_template;
}
$this->Application->HandleEvent($bb_event, 'bb:ParseEnv', Array('url_parts' => $url_parts, 'vars' => $vars));
$vars = $bb_event->getEventParam('vars');
return 'bb';
}
if (!isset($url_parts[0])) return false;
if ( count($url_parts) != 1 ) return false;
$url_part = array_shift($url_parts);
// match module reviews page
$page = 1;
if( preg_match('/(.*)_([\d]+)$/', $url_part, $rets) )
{
$url_part = $rets[1];
$page = $rets[2];
}
// locating the item in CategoryItems by filename to detect its ItemPrefix and its category ParentPath
$cat_item = $this->Conn->GetRow('
SELECT ci.ItemResourceId, ci.ItemPrefix, c.ParentPath, ci.CategoryId FROM '.TABLE_PREFIX.'CategoryItems AS ci
LEFT JOIN '.TABLE_PREFIX.'Category AS c
ON c.CategoryId = ci.CategoryId
WHERE
ci.CategoryId = '.$vars['m_cat_id'].'
AND
ci.Filename = '.$this->Conn->qstr($url_part));
if ($cat_item !== false) { // item found
$module_prefix = $cat_item['ItemPrefix'];
$item_template = $this->GetItemTemplate($cat_item, $module_prefix);
// converting ResourceId to correpsonding Item id
$module_config = $this->Application->getUnitOptions($module_prefix);
$item_id = $this->Conn->GetOne(
'SELECT '.$module_config['IDField'].' FROM '.$module_config['TableName'].'
WHERE ResourceId = '.$cat_item['ItemResourceId']
);
if ((!$set_t || $item_template) && $item_id) {
if ($set_t) {
$vars['t'] = $item_template;
}
$vars[ $module_prefix.'_id' ] = $item_id;
$vars[ $module_prefix.'_Reviews_Page' ] = $page;
return $module_prefix;
}
}
array_unshift($url_parts, $url_part);
return false;
}
function GetItemTemplate($category, $module_prefix)
{
if (!is_array($category)) {
$category = $this->Conn->GetRow('
SELECT c.ParentPath, c.CategoryId FROM '.TABLE_PREFIX.'Category AS c
WHERE
c.CategoryId = '.$category);
}
$parent_path = implode(',',explode('|', substr($category['ParentPath'], 1, -1)));
// item template is stored in module' system custom field - need to get that field Id
$item_template_field_id = $this->Conn->GetOne(
'SELECT CustomFieldId
FROM '.TABLE_PREFIX.'CustomField
WHERE FieldName = '.$this->Conn->qstr($module_prefix.'_ItemTemplate'));
// looking for item template through cats hierarchy sorted by parent path
$query = 'SELECT ccd.l1_cust_'.$item_template_field_id.',
FIND_IN_SET(c.CategoryId, '.$this->Conn->qstr($parent_path).') AS Ord1,
c.CategoryId, c.Name, ccd.l1_cust_'.$item_template_field_id.'
FROM '.TABLE_PREFIX.'Category AS c
LEFT JOIN '.TABLE_PREFIX.'CategoryCustomData AS ccd
ON ccd.ResourceId = c.ResourceId
WHERE c.CategoryId IN ('.$parent_path.') AND ccd.l1_cust_'.$item_template_field_id.' != \'\'
ORDER BY FIND_IN_SET(c.CategoryId, '.$this->Conn->qstr($parent_path).') DESC';
$item_template = $this->Conn->GetOne($query);
return $item_template;
}
function ProcessPhisycalTemplate(&$url_parts, &$vars)
{
if (!isset($url_parts[0])) return false;
$remaining = array();
do
{
$template_path = implode('/', $url_parts);
$t_parts['path'] = dirname($template_path) == '.' ? '' : '/'.dirname($template_path);
$t_parts['file'] = basename($template_path);
$sql = 'SELECT FileId
FROM '.TABLE_PREFIX.'ThemeFiles
WHERE (FilePath = '.$this->Conn->qstr($t_parts['path']).') AND (FileName = '.$this->Conn->qstr($t_parts['file'].'.tpl').')';
// $sql = 'SELECT FileId FROM '.TABLE_PREFIX.'ThemeFiles WHERE CONCAT(FilePath, "/", FileName) = '.$this->Conn->qstr('/'.$template_path.'.tpl');
$template_found = $this->Conn->GetOne($sql);
if(!$template_found)
{
array_unshift($remaining, array_pop($url_parts));
}
} while (!$template_found && $url_parts);
$url_parts = $remaining;
if ($template_found) {
$vars['t'] = $template_path;
return true;
}
return false;
}
/**
* Checks if whole url_parts matches a whole In-CMS page
*
* @param array $url_parts
* @return boolean
*/
function ProcessVirtualTemplate(&$url_parts, &$vars)
{
if (!isset($url_parts[0])) return false;
if ($this->Application->isModuleEnabled('Proj-CMS')) {
$friendly = $this->Conn->GetRow(
' SELECT CategoryId, NamedParentPath FROM '.TABLE_PREFIX.'Category
WHERE FriendlyURL = '.$this->Conn->qstr(implode('/', $url_parts)));
if ($friendly) {
$vars['m_cat_id'] = $friendly['CategoryId'];
$vars['t'] = preg_replace('/^content\//i', '', $friendly['NamedParentPath']);
return true;
}
$template_path = 'content/'.implode('/', $url_parts);
$sql = 'SELECT CategoryId FROM '.TABLE_PREFIX.'Category
WHERE
- NamedParentPath = '.$this->Conn->qstr($template_path).'
+ LOWER(NamedParentPath) = '.$this->Conn->qstr($template_path).'
AND
- Status = 1';
+ Status IN (1,4) ';
$template_found = $this->Conn->GetRow($sql);
if ($template_found) {
$vars['m_cat_id'] = $template_found['CategoryId'];
$vars['t'] = implode('/', $url_parts);
return true;
}
}
if ($this->Application->isModuleEnabled('In-Edit')) {
$template_path = implode('/', $url_parts);
$sql = 'SELECT p.PageId, ci.CategoryId FROM '.TABLE_PREFIX.'Pages AS p
LEFT JOIN '.TABLE_PREFIX.'CategoryItems AS ci
ON ci.ItemResourceId = p.ResourceId
WHERE
Path = '.$this->Conn->qstr($template_path).'
AND
ci.PrimaryCat = 1
AND
p.Status = 1';
$template_found = $this->Conn->GetRow($sql);
if ($template_found) {
$vars['m_cat_id'] = $template_found['CategoryId'];
$vars['t'] = $template_path;
return true;
}
}
return false;
}
function processRewriteURL()
{
$passed = array();
$url = $this->HTTPQuery->Get('_mod_rw_url_');
if( substr($url, -5) == '.html' ) $url = substr($url, 0, strlen($url) - 5 );
$restored = false;
$cache = $this->Conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "mod_rw_'.md5($url).'"');
if (false && $cache && $cache['Cached'] > 0) {
$cache = unserialize($cache['Data']);
$vars = $cache['vars'];
$passed = $cache['passed'];
$restored = true;
}
else {
$passed = array();
$vars = $this->parseRewriteURL($url,$passed);
$cache = array('vars'=>$vars,'passed'=>$passed);
$this->Conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("mod_rw_'.md5($url).'", '.$this->Conn->qstr(serialize($cache)).', '.adodb_mktime().')');
}
foreach ($vars as $name => $value)
{
$this->HTTPQuery->Set($name,$value);
}
// if ($restored) {
$this->InitAll();
// }
$this->HTTPQuery->finalizeParsing($passed);
}
function InitAll()
{
// $this->Application->Phrases = new PhrasesCache();
$this->Application->VerifyLanguageId();
$this->Application->Phrases->Init('phrases');
$this->Application->VerifyThemeId();
}
function parseRewriteURL($url, &$passed)
{
$vars = $this->Conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "mod_rw_'.md5($url).'"');
if (false && $vars && $vars['Cached'] > 0) {
$vars = unserialize($menu['Data']);
return $vars;
}
$vars = array();
- $url_parts = $url ? explode('/', $url) : Array();
+ $url_parts = $url ? explode('/', trim($url, '/')) : Array();
$process_module = true;
if($this->HTTPQuery->Get('rewrite') == 'on' || !$url_parts)
{
$this->SetDefaultValues($vars);
}
if(!$url_parts)
{
$this->InitAll();
$vars['t'] = $this->HTTPQuery->getDefaultTemplate('');
$passed[] = 'm';
return $vars;
}
else
{
$vars['t'] = '';
}
$passed = Array('m');
$this->ProcessLanguage($url_parts, $vars);
$this->ProcessTheme($url_parts, $vars);
if ( $this->ProcessVirtualTemplate($url_parts, $vars) ) {
return $vars;
}
$this->ProcessCategory($url_parts, $vars);
if ( $this->ProcessModuleIndex($url_parts, $vars) ) {
foreach ($this->Application->ModuleInfo as $module_name => $info) {
$passed[] = $info['Var'];
}
return $vars;
}
if ( $module_prefix = $this->ProcessModuleItem($url_parts, $vars) ) {
$passed[] = $module_prefix;
return $vars;
}
/*// match module
$next_template = $this->HTTPQuery->Get('next_template');
if($url_part || $next_template)
{
if($next_template)
{
$next_template_parts = explode('/', $next_template);
$module_folder = array_shift($next_template_parts);
}
else
{
$module_folder = $url_part;
}
foreach ($this->Application->ModuleInfo as $module_name => $module_data)
{
if( trim($module_data['TemplatePath'], '/') == $module_folder )
{
$module_prefix = $module_data['Var'];
break;
}
}
}*/
if ( $this->ProcessPhisycalTemplate($url_parts, $vars) ) {
if (!$url_parts) {
return $vars;
}
}
if ( $this->ProcessPage($url_parts, $vars) ) {
if (count($passed) == 1) {// passed contains only 1 value which is 'm'
// this may be search results page, so we need to find out the module, especially for old in-portal
foreach ($this->Application->ModuleInfo as $module_name => $module_data)
{
if (!$module_data['TemplatePath']) continue;
if( preg_match('/^'.preg_quote($module_data['TemplatePath'], '/').'/i', $vars['t']) )
{
$module_prefix = $module_data['Var'];
break;
}
}
$passed[] = $module_prefix;
}
return $vars;
}
if ( $module_prefix = $this->ProcessModuleItem($url_parts, $vars, false) ) {
$passed[] = $module_prefix;
return $vars;
}
if ( $this->Application->isModuleEnabled('In-Edit') && $this->Application->GetVar('admin') == 1) {
$adm_ses =& $this->Application->recallObject('Session.admin');
$user = $adm_ses->RecallVar('user_id');
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
if ($perm_helper->CheckUserPermission($user, 'PAGE.ADD', 0)) {
$vars['t'] = implode('/', $url_parts);
return $vars;
}
}
$not_found = $this->Application->ConfigValue('ErrorTemplate');
$vars['t'] = $not_found ? $not_found : 'error_notfound';
header('HTTP/1.0 404 Not Found');
return $vars;
// $this->HTTPQuery->finalizeParsing($passed, $module_params);
// pass params left to module
/*$this->Application->Phrases->Init('phrases');
$passed = Array('m');
$module_params = Array();
if ( isset($module_prefix) ) {
$passed[] = $module_prefix;
$module_event = new kEvent($module_prefix.':ParseEnv', Array('url_parts' => $url_parts) );
if ($process_module) {
$this->Application->HandleEvent($module_event);
}
$item_id = $this->HTTPQuery->Get($module_prefix.'_id');
$module_params = Array($module_prefix.'_id' => $item_id ? $item_id : '0' );
if ($module_event->status == erFAIL) {
$not_found = $this->Application->ConfigValue('ErrorTemplate');
$this->HTTPQuery->Set('t', $not_found ? $not_found : 'error_notfound' );
}
}
$this->HTTPQuery->finalizeParsing($passed, $module_params);*/
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/helpers/mod_rewrite_helper.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.8
\ No newline at end of property
+1.9
\ No newline at end of property
Index: trunk/core/units/general/helpers/recursive_helper.php
===================================================================
--- trunk/core/units/general/helpers/recursive_helper.php (revision 7634)
+++ trunk/core/units/general/helpers/recursive_helper.php (revision 7635)
@@ -1,182 +1,183 @@
<?php
class kRecursiveHelper extends kHelper {
function DeleteCategory($category_id, $prefix='c')
{
$id_field = $this->Application->getUnitOption($prefix, 'IDField');
$table_name = $this->Application->getUnitOption($prefix, 'TableName');
$sql = 'SELECT '.$id_field.'
FROM '.$table_name.'
WHERE ParentId = '.$category_id;
$sub_categories = $this->Conn->GetCol($sql);
if ($sub_categories) {
foreach ($sub_categories as $sub_category_id) {
$this->DeleteCategory($sub_category_id);
}
}
$ci_table = $this->Application->getUnitOption('ci', 'TableName');
// 1. remove category items from this category if it is supplemental (non-primary) category to them
$sql = 'DELETE FROM '.$ci_table.'
WHERE ('.$id_field.' = '.$category_id.') AND (PrimaryCat = 0)';
$this->Conn->Query($sql);
$temp_handler =& $this->Application->recallObject($prefix.'_TempHandler', 'kTempTablesHandler');
// 2. delete items this have this category as primary
$delete_ids = $this->getCategoryItems($category_id, true);
foreach ($delete_ids as $item_prefix => $resource_ids) {
if (!$item_prefix) {
// not ItemPrefix filled -> old categoryitem linking
continue;
}
$item_ids = $this->GetItemIDs($item_prefix, $resource_ids);
$temp_handler->BuildTables($item_prefix, $item_ids);
$temp_handler->DeleteItems($item_prefix, '', $item_ids);
}
// 3. delete this category
$temp_handler->BuildTables($prefix, Array($category_id));
$temp_handler->DeleteItems($prefix, '', Array($category_id));
}
/**
* Converts resource ids list to id field list for given prefix
*
* @param string $prefix
* @param Array $resource_ids
* @return Array
*/
function GetItemIDs($prefix, $resource_ids)
{
if (!$resource_ids) {
return Array();
}
$id_field = $this->Application->getUnitOption($prefix, 'IDField');
$table_name = $this->Application->getUnitOption($prefix, 'TableName');
$sql = 'SELECT '.$id_field.'
FROM '.$table_name.'
WHERE ResourceId IN ('.implode(',', $resource_ids).')';
return $this->Conn->GetCol($sql);
}
// moves selected categories to destination category
function MoveCategories($category_ids, $dest_category_id)
{
if (!$category_ids) return ;
$id_field = $this->Application->getUnitOption('c', 'IDField');
$table_name = $this->Application->getUnitOption('c', 'TableName');
// do not move categories into their children
$sql = 'SELECT ParentPath
FROM '.$table_name.'
WHERE '.$id_field.' = '.$dest_category_id;
$dest_parent_path = explode('|', substr($this->Conn->GetOne($sql), 1, -1));
-
+
$child_categories = array_intersect($dest_parent_path, $category_ids); // get categories, then can't be moved
$category_ids = array_diff($category_ids, $child_categories); // remove them from movable categories list
-
+
if ($category_ids) {
$sql = 'UPDATE '.$table_name.'
SET ParentId = '.$dest_category_id.'
WHERE '.$id_field.' IN ('.implode(',', $category_ids).')';
$this->Conn->Query($sql);
}
}
/**
* Complete cloning or category with subcategories and subitems
*
* @param int $category_id
*/
function PasteCategory($category_id, $prefix = 'c')
{
$backup_category_id = $this->Application->GetVar('m_cat_id');
// 1. clone category
$temp_handler =& $this->Application->recallObject($prefix.'_TempHandler', 'kTempTablesHandler');
+ /* @var $temp_handler kTempTablesHandler*/
$temp_handler->BuildTables($prefix, Array($category_id));
$new_category_id = array_pop( $temp_handler->CloneItems($prefix, '', Array($category_id)) );
$this->Application->SetVar('m_cat_id', $new_category_id);
$id_field = $this->Application->getUnitOption($prefix, 'IDField');
$table_name = $this->Application->getUnitOption($prefix, 'TableName');
// 2. assign supplemental items to current category to new category
$paste_ids = $this->getCategoryItems($category_id, false);
foreach ($paste_ids as $item_prefix => $resource_ids) {
if (!$item_prefix) {
// not ItemPrefix filled -> old categoryitem linking
continue;
}
$item_object =& $this->Application->recallObject($item_prefix.'.-item', null, Array('skip_autoload' => true));
foreach ($resource_ids as $item_resource_id) {
$item_object->Load($item_resource_id, 'ResourceId');
$item_object->assignToCategory($new_category_id, false);
}
}
// 3. clone items that have current category as primary
$paste_ids = $this->getCategoryItems($category_id, true);
foreach ($paste_ids as $item_prefix => $resource_ids) {
if (!$item_prefix) {
// not ItemPrefix filled -> old categoryitem linking
continue;
}
// 2. clone items from current category (for each prefix separately)
$item_ids = $this->GetItemIDs($item_prefix, $resource_ids);
$temp_handler->BuildTables($item_prefix, $item_ids);
$temp_handler->CloneItems($item_prefix, '', $item_ids);
}
// 4. do same stuff for each subcategory
$sql = 'SELECT '.$id_field.'
FROM '.$table_name.'
WHERE ParentId = '.$category_id;
$sub_categories = $this->Conn->GetCol($sql);
if ($sub_categories) {
foreach ($sub_categories as $sub_category_id) {
$this->PasteCategory($sub_category_id, $prefix);
}
}
$this->Application->SetVar('m_cat_id', $backup_category_id);
}
/**
* Returns grouped category items
*
* @param int $category_id
* @param bool $item_primary_category
* @return Array
*/
function getCategoryItems($category_id, $item_primary_category = true)
{
$ci_table = $this->Application->getUnitOption('ci', 'TableName');
$sql = 'SELECT ItemPrefix, ItemResourceId
FROM '.$ci_table.'
WHERE (CategoryId = '.$category_id.') AND (PrimaryCat = '.($item_primary_category ? 1 : 0).')';
$category_items = $this->Conn->GetCol($sql, 'ItemResourceId');
$item_ids = Array();
foreach ($category_items as $resource_id => $item_prefix) {
$item_ids[$item_prefix][] = $resource_id;
}
return $item_ids;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/helpers/recursive_helper.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property
Index: trunk/core/units/general/helpers/modules.php
===================================================================
--- trunk/core/units/general/helpers/modules.php (revision 7634)
+++ trunk/core/units/general/helpers/modules.php (revision 7635)
@@ -1,370 +1,370 @@
<?php
class kModulesHelper extends kHelper {
function checkLogin()
{
return $this->_GetModules();
}
function getWhereClause()
{
$where_clause = Array('Loaded = 1');
if (!$this->Application->IsAdmin()) return implode(' AND ', $where_clause);
$modules = $this->_GetModules();
if ($modules) {
foreach ($modules as $module_index => $module) {
$modules[$module_index] = $this->Conn->qstr($module);
}
$where_clause[] = 'Name IN ('.implode(',', $modules).')';
}
return implode(' AND ', $where_clause);
}
function _EnableCookieSID()
{
$session =& $this->Application->recallObject('Session');
return $session->CookiesEnabled;
}
function _IsSpider($UserAgent)
{
global $robots;
$lines = file(FULL_PATH.'/robots_list.txt');
if (!is_array($robots)) {
$robots = Array();
for($i = 0; $i < count($lines); $i++) {
$l = $lines[$i];
$p = explode("\t", $l, 3);
$robots[] = $p[2];
}
}
return in_array($UserAgent, $robots);
}
function _MatchIp($ip1, $ip2)
{
$matched = TRUE;
$ip = explode('.', $ip1);
$MatchIp = explode('.', $ip2);
for ($i = 0; $i < count($ip); $i++) {
if($i == count($MatchIp)) break;
if (trim($ip[$i]) != trim($MatchIp[$i]) || trim($ip[$i]) == '*') {
$matched = FALSE;
break;
}
}
return $matched;
}
function _IpAccess($IpAddress, $AllowList, $DenyList)
{
$allowed = explode(',', $AllowList);
$denied = explode(',', $DenyList);
$MatchAllowed = FALSE;
for ($x = 0; $x < count($allowed); $x++) {
$ip = explode('.', $allowed[$x]);
$MatchAllowed = $this->_MatchIp($IpAddress, $allowed[$x]);
if ($MatchAllowed)
break;
}
$MatchDenied = FALSE;
for ($x = 0; $x < count($denied); $x++) {
$ip = explode('.', $denied[$x]);
$MatchDenied = $this->_MatchIp($IpAddress, $denied[$x]);
if ($MatchDenied)
break;
}
$Result = (($MatchAllowed && !$MatchDenied) || (!$MatchAllowed && !$MatchDenied) ||
($MatchAllowed && $MatchDenied));
return $Result;
}
/**
* Reads config.php file and parses it
*
*/
function _readConfig()
{
$vars = parse_portal_ini(FULL_PATH.'/config.php');
foreach ($vars as $config_key => $config_value) {
$GLOBALS['g_'.$config_key] = $config_value;
}
}
/**
* Leaves only domain part from hostname (e.g. extract "intechnic.lv" from "test.intechnic.lv")
* Used for admin login license check
*
* @param string $d
* @return string
*/
function _StripDomainHost($d)
{
$IsIp = false;
$dotcount = substr_count($d, '.');
if ($dotcount == 3) {
$IsIp = true;
for ($x = 0; $x < strlen($d); $x++) {
if (!is_numeric(substr($d, $x, 1)) && substr($d, $x, 1) != '.')
{
$IsIp = false;
break;
}
}
}
if ($dotcount > 1 && !$IsIp) {
$p = explode('.', $d);
$ret = $p[count($p) - 2].'.'.$p[count($p) - 1];
}
else {
$ret = $d;
}
return $ret;
}
/**
* When logging into admin then check only last 2 parts of host name VS domain in license
*
* @param string $user_domain
* @param string $license_domain
* @return int
*/
function _CheckDomain($user_domain, $license_domain)
{
if ($this->Application->IsAdmin()) {
$user_domain = $this->_StripDomainHost($user_domain);
return preg_match('/(.*)'.preg_quote($user_domain, '/').'$/', $license_domain);
}
else {
return preg_match('/(.*)'.preg_quote($license_domain, '/').'$/', $user_domain);
}
}
/**
* Returns modules list, that are in license
*
* @return Array
*/
function _GetModules()
{
global $i_Keys;
static $modules = null;
if (isset($modules)) return $modules;
$this->_readConfig();
$license = base64_decode($GLOBALS['g_License']);
$this->_ParseLicense($license);
$modules = Array();
$domain = $this->_GetDomain();
if (!$this->_IsLocalSite($domain)) {
for ($x = 0; $x < count($i_Keys); $x++) {
$key = $i_Keys[$x];
if ($this->_CheckDomain($domain, $key['domain'])) {
// used hostname is subdomain or matches domain from license
$modules = explode(',', $key['mod']);
}
}
}
else {
$modules = array_keys($this->Application->ModuleInfo);
}
- array_push($modules, 'Proj-base', 'Proj-CMS', 'Custom');
+ array_push($modules, 'Core', 'Proj-base', 'Proj-CMS', 'Custom');
return $modules;
}
/**
* Allows to determine if module is licensed
*
* @param string $name
* @return bool
*/
function _ModuleLicensed($name)
{
$modules = $this->_GetModules();
return in_array($name, $modules);
}
/**
* Returns domain from licences (and direct in case of install script)
*
* @return string
*/
function _GetDomain()
{
return $this->Application->ConfigValue('DomainDetect') ? $_SERVER['HTTP_HOST'] : $GLOBALS['g_Domain'];
}
function _keyED($txt, $encrypt_key)
{
$encrypt_key = md5($encrypt_key);
$ctr = 0;
$tmp = '';
for ($i = 0; $i < strlen($txt); $i++) {
if ($ctr == strlen($encrypt_key)) $ctr = 0;
$tmp .= substr($txt, $i, 1) ^ substr($encrypt_key, $ctr, 1);
$ctr++;
}
return $tmp;
}
function _decrypt($txt, $key)
{
$txt = $this->_keyED($txt,$key);
$tmp = '';
for ($i = 0; $i < strlen($txt); $i++) {
$md5 = substr($txt, $i, 1);
$i++;
$tmp .= (substr($txt, $i, 1) ^ $md5);
}
return $tmp;
}
function LoadFromRemote()
{
return '';
}
function DLid()
{
die($GLOBALS['lid']."\n");
}
function _LoadLicense($LoadRemote = false)
{
$f = FULL_PATH.'/intechnic.php';
if ($this->_falseIsLocalSite($f)) $ret = true;
if (file_exists($f)) {
$contents = file($f);
$data = base64_decode($contents[1]);
}
else {
if ($LoadRemote) return $LoadFromRemote;
}
return $data;
}
function _VerifyKey($domain, $k)
{
$key = md5($domain);
$lkey = substr($key, 0, strlen($key) / 2);
$rkey = substr($key, strlen($key) / 2);
$r = $rkey.$lkey;
if ($k == $r) return true;
return false;
}
function _ParseLicense($txt)
{
global $i_User, $i_Pswd, $i_Keys;
if (!$this->_falseIsLocalSite($txt)) $nah = false;
$data = $this->_decrypt($txt, 'beagle');
$i_Keys = Array();
$lines = explode("\n", $data);
for ($x = 0; $x < count($lines); $x++) {
$l = $lines[$x];
$p = explode('=', $l, 2);
switch($p[0]) {
case 'Username':
$i_User = $p[1];
break;
case 'UserPass':
$i_Pswd = $p[1];
break;
default:
if (substr($p[0], 0, 3) == 'key') {
$parts = explode('|', $p[1]);
if ($this->_VerifyKey($parts[0], $parts[1])) {
unset($K);
$k['domain'] = $parts[0];
$k['key'] = $parts[1];
$k['desc'] = $parts[2];
$k['mod'] = $parts[3];
$i_Keys[] = $k;
}
}
break;
}
}
}
function _GetObscureValue($i)
{
if ($i == 'x') return 0254; $z = '';
if ($i == 'z') return 0x7F.'.';
if ($i == 'c') return '--code--';
if ($i >= 5 && $i < 7) return $this->_GetObscureValue($z)*$this->_GetObscureValue('e');
if ($i > 30) return Array(0x6c,0x6f,0x63,0x61,0x6c,0x68,0x6f,0x73,0x74);
if ($i > 20) return 99;
if ($i > 10) return '.'.($this->_GetObscureValue(6.5)+1);
if ($i == 'a') return 0xa;
}
function _Chr($val)
{
$x = $this->_GetObscureValue(25);
$f = chr($x).chr($x+5).chr($x+15);
return $f($val);
}
function _IsLocalSite($domain)
{
$ee = $this->_GetObscureValue(35); $yy = '';
foreach ($ee as $e) $yy .= $this->_Chr($e);
$localb = FALSE;
if(substr($domain,0,3)==$this->_GetObscureValue('x'))
{
$b = substr($domain,0,6);
$p = explode(".",$domain);
$subnet = $p[1];
if($p[1]>15 && $p[1]<32)
$localb=TRUE;
}
$zz = $this->_GetObscureValue('z').$this->_GetObscureValue(5).'.'.(int)$this->_GetObscureValue(7).$this->_GetObscureValue(12);
$ff = $this->_GetObscureValue('z')+65;
$hh = $ff-0x18;
if($domain==$yy || $domain==$zz || substr($domain,0,7)==$ff.$this->_Chr(46).$hh ||
substr($domain,0,3)==$this->_GetObscureValue('a').$this->_Chr(46) || $localb || strpos($domain,".")==0)
{
return TRUE;
}
return FALSE;
}
function _falseIsLocalSite($domain)
{
$localb = FALSE;
if(substr($domain,0,3)=="172")
{
$b = substr($domain,0,6);
$p = explode(".",$domain);
$subnet = $p[1];
if($p[1]>15 && $p[1]<32)
$localb=TRUE;
}
if($domain=="localhost" || $domain=="127.0.0.1" || substr($domain,0,7)=="192.168" ||
substr($domain,0,3)=="10." || $localb || strpos($domain,".")==0)
{
return TRUE;
}
return FALSE;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/helpers/modules.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.7
\ No newline at end of property
+1.8
\ No newline at end of property
Index: trunk/core/units/general/cat_tag_processor.php
===================================================================
--- trunk/core/units/general/cat_tag_processor.php (revision 7634)
+++ trunk/core/units/general/cat_tag_processor.php (revision 7635)
@@ -1,218 +1,218 @@
<?php
class kCatDBTagProcessor extends kDBTagProcessor {
/**
* Permission Helper
*
* @var kPermissionsHelper
*/
var $PermHelper = null;
function kCatDBTagProcessor()
{
parent::kDBTagProcessor();
$this->PermHelper = $this->Application->recallObject('PermissionsHelper');
}
function ItemIcon($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
$grids = $this->Application->getUnitOption($this->Prefix,'Grids');
$icons =& $grids[ $params['grid'] ]['Icons'];
$status_fields = $this->Application->getUnitOption($this->Prefix,'StatusField');
if (!$status_fields) return $icons['default'];
$value = $object->GetDBField($status_fields[0]); // sets base status icon
/* @var $object kDBItem */
if ($value == STATUS_ACTIVE) {
if( $object->HasField('IsPop') && $object->GetDBField('IsPop') ) $value = 'POP';
if( $object->HasField('IsHot') && $object->GetDBField('IsHot') ) $value = 'HOT';
if( $object->HasField('IsNew') && $object->GetDBField('IsNew') ) $value = 'NEW';
if( $object->HasField('EditorsPick') && $object->GetDBField('EditorsPick') ) $value = 'PICK';
}
return isset($icons[$value]) ? $icons[$value] : $icons['default'];
}
/**
* Allows to create valid mod-rewrite compatible link to module item
*
* @param Array $params
* @param string $id_prefix
* @return string
*/
function ItemLink($params, $id_prefix)
{
$params = array_merge($params, Array('pass' => 'm,'.$this->Prefix) );
$item_id = isset($params[$id_prefix.'_id']) && $params[$id_prefix.'_id'];
if (!$item_id) {
$item_id = $this->Application->GetVar($this->getPrefixSpecial().'_id');
if (!$item_id) {
$item_id = $this->Application->GetVar($this->Prefix.'_id');
}
}
$params[$this->Prefix.'_id'] = $item_id;
$object =& $this->getObject($params);
$params['m_cat_id'] = $object->GetDBField('CategoryId');
$params['pass_category'] = 1;
return $this->Application->ProcessParsedTag('m', 't', $params);
}
function CategoryPath($params)
{
if (!isset($params['cat_id'])) {
$params['cat_id'] = $this->Application->RecallVar($params['session_var'], 0);
}
return $this->Application->ProcessParsedTag('c', 'CategoryPath', $params);
}
function BuildListSpecial($params)
{
if ($this->Special != '') return $this->Special;
if ( isset($params['parent_cat_id']) ) {
$parent_cat_id = $params['parent_cat_id'];
}
else {
$parent_cat_id = $this->Application->GetVar('c_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
}
$recursive = isset($params['recursive']);
$types = $this->SelectParam($params, 'types');
$except = $this->SelectParam($params, 'except');
if ($types.$except.$recursive == '') {
return parent::BuildListSpecial($params);
}
$special = crc32($parent_cat_id.$types.$except.$recursive);
return $special;
}
function ExportStatus($params)
{
$export_object =& $this->Application->recallObject('CatItemExportHelper');
/* @var $export_object kCatDBItemExportHelper */
$event = new kEvent($this->getPrefixSpecial().':OnDummy');
$action_method = 'perform'.ucfirst($this->Special);
$field_values = $export_object->$action_method($event);
// finish code is done from JS now
if ($field_values['start_from'] == $field_values['total_records'])
{
if ($this->Special == 'import') {
$this->Application->StoreVar('PermCache_UpdateRequired', 1);
- $this->Application->Redirect('categories/cache_updater', Array('m_opener' => 'r', 'pass' => 'm', 'continue' => 1, 'no_amp' => 1));
+ $this->Application->Redirect('in-portal/categories/cache_updater', Array('m_opener' => 'r', 'pass' => 'm', 'continue' => 1, 'no_amp' => 1));
}
elseif ($this->Special == 'export') {
$template = $this->Application->getUnitOption($this->Prefix, 'ModuleFolder').'/'.$this->Special.'_finish';
$this->Application->Redirect($template, Array('pass' => 'all'));
}
}
$export_options = $export_object->loadOptions($event);
return $export_options['start_from'] * 100 / $export_options['total_records'];
}
function CatalogItemCount($params)
{
$object =& $this->GetList($params);
if (!$object->Counted) {
$object->CountRecs();
}
return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' / '.$object->NoFilterCount : $object->RecordsCount;
}
function ListReviews($params)
{
$prefix = $this->Prefix.'-rev';
$review_tag_processor =& $this->Application->recallObject($prefix.'.item_TagProcessor');
return $review_tag_processor->PrintList($params);
}
function ReviewCount($params)
{
$review_tag_processor =& $this->Application->recallObject('rev.item_TagProcessor');
return $review_tag_processor->TotalRecords($params);
}
function InitCatalogTab($params)
{
$tab_params['mode'] = $this->Application->GetVar('tm'); // single/multi selection possible
$tab_params['special'] = $this->Application->GetVar('ts'); // use special for this tab
$tab_params['dependant'] = $this->Application->GetVar('td'); // is grid dependant on categories grid
// set default params (same as in catalog)
if ($tab_params['mode'] === false) $tab_params['mode'] = 'multi';
if ($tab_params['special'] === false) $tab_params['special'] = '';
if ($tab_params['dependant'] === false) $tab_params['dependant'] = 'yes';
// pass params to block with tab content
$params['name'] = $params['render_as'];
$params['prefix'] = trim($this->Prefix.'.'.($tab_params['special'] ? $tab_params['special'] : $this->Special), '.');
$params['cat_prefix'] = trim('c.'.($tab_params['special'] ? $tab_params['special'] : $this->Special), '.');
$params['tab_mode'] = $tab_params['mode'];
$params['tab_dependant'] = $tab_params['dependant'];
$params['show_category'] = $tab_params['special'] == 'showall' ? 1 : 0; // this is advanced view -> show category name
return $this->Application->ParseBlock($params, 1);
}
/**
* Show CachedNavbar of current item primary category
*
* @param Array $params
* @return string
*/
function CategoryName($params)
{
// show category cachednavbar of
$object =& $this->getObject($params);
$category_id = isset($params['cat_id']) ? $params['cat_id'] : $object->GetDBField('CategoryId');
$category_path = $this->Application->getCache('category_paths', $category_id);
if ($category_path === false) {
// not chached
if ($category_id > 0) {
$category_path = trim($this->CategoryName( Array('cat_id' => 0) ).' > '.str_replace('&|&', ' > ', $object->GetDBField('CachedNavbar')), ' > ');
}
else {
$category_path = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') );
}
$this->Application->setCache('category_paths', $category_id, $category_path);
}
return $category_path;
}
/**
* Allows to determine if original value should be shown
*
* @param Array $params
* @return bool
*/
function DisplayOriginal($params)
{
// original id found & greather then zero + show original
$display_original = isset($params['display_original']) && $params['display_original'];
$object =& $this->getObject($params);
$perm_value = $this->PermHelper->ModifyCheckPermission($object->GetDBField('CreatedById'), $object->GetDBField('CategoryId'), $this->Prefix);
return $display_original && ($perm_value == 1) && $this->Application->GetVar($this->Prefix.'.original_id');
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/cat_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.16
\ No newline at end of property
+1.17
\ No newline at end of property
Index: trunk/core/units/general/inp_ses_storage.php
===================================================================
--- trunk/core/units/general/inp_ses_storage.php (revision 7634)
+++ trunk/core/units/general/inp_ses_storage.php (revision 7635)
@@ -1,123 +1,123 @@
<?php
class InpSession extends Session
{
function Init($prefix,$special)
{
$this->SessionTimeout = $this->Application->ConfigValue('SessionTimeout');
$path = (BASE_PATH == '') ? '/' : BASE_PATH;
// if ( $this->Application->IsAdmin() ) $path = rtrim($path, '/').'/admin';
$this->SetCookiePath($path);
$cookie_name = $this->Application->ConfigValue('SessionCookieName');
if (!$cookie_name) $cookie_name = 'sid';
if (($this->Application->IsAdmin() && $special !== 'front') || $special == 'admin' ) { // || $this->Application->GetVar('admin') == 1
$cookie_name = 'adm_'.$cookie_name;
}
$this->SetCookieName($cookie_name);
$this->SetCookieDomain(SERVER_NAME);
if( $this->Application->IsAdmin()) { // && $this->Application->GetVar('admin') != 1
$mode = smAUTO;
}
elseif (constOn('IS_INSTALL')) {
$mode = smCOOKIES_ONLY;
}
else {
$ses_mode = $this->Application->ConfigValue('CookieSessions');
if ($ses_mode == 2) $mode = smAUTO;
if ($ses_mode == 1) $mode = smCOOKIES_ONLY;
if ($ses_mode == 0) $mode = smGET_ONLY;
}
$this->SetMode($mode);
parent::Init($prefix,$special);
if( !$this->Application->IsAdmin() && $this->GetField('PortalUserId') <= 0 )
{
$group_list = $this->Application->ConfigValue('User_GuestGroup').','.$this->Application->ConfigValue('User_LoggedInGroup');
$this->SetField('GroupId', $this->Application->ConfigValue('User_GuestGroup'));
$this->SetField('GroupList', $group_list);
}
}
}
class InpSessionStorage extends SessionStorage {
function Init($prefix,$special)
{
parent::Init($prefix,$special);
$this->setTableName(TABLE_PREFIX.'UserSession');
$this->SessionDataTable = TABLE_PREFIX.'SessionData';
$this->setIDField('SessionKey');
$this->TimestampField = 'LastAccessed';
$this->DataValueField = 'VariableValue';
$this->DataVarField = 'VariableName';
}
function LocateSession($sid)
{
$res = parent::LocateSession($sid);
if ($res) {
$this->Expiration += $this->SessionTimeout;
}
return $res;
}
function UpdateSession(&$session)
{
$time = adodb_mktime();
// Update LastAccessed only if it's newer than 1/10 of session timeout - perfomance optimization to eliminate needless updates on every click
if ($time - $this->DirectVars['LastAccessed'] > $this->SessionTimeout/10) {
$this->SetField($session, $this->TimestampField, $time);
}
}
function StoreSession(&$session, $additional_fields = Array())
{
$fields_hash = Array( 'PortalUserId' => $this->Application->IsAdmin() ? 0 : -2, // Guest
'Language' => $this->Application->GetDefaultLanguageId(),
'Theme' => $this->Application->GetDefaultThemeId(),
'IpAddress' => $_SERVER['REMOTE_ADDR'],
'GroupId' => $this->Application->ConfigValue('User_GuestGroup'),
'GroupList' => $this->Application->ConfigValue('User_GuestGroup'),
'CurrentTempKey'=> $session->SID,
);
parent::StoreSession($session, $fields_hash);
}
function GetExpiredSIDs()
{
$query = ' SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE '.$this->TimestampField.' < '.(adodb_mktime()-$this->SessionTimeout);
$ret = $this->Conn->GetCol($query);
if($ret) {
$this->DeleteEditTables();
}
return $ret;
}
function DeleteEditTables()
{
$tables = $this->Conn->GetCol('SHOW TABLES');
$mask_edit_table = '/'.TABLE_PREFIX.'ses_(.*)_edit_(.*)/';
$mask_search_table = '/'.TABLE_PREFIX.'ses_(.*?)_(.*)/';
$sql='SELECT COUNT(*) FROM '.$this->TableName.' WHERE '.$this->IDField.' = \'%s\'';
foreach($tables as $table)
{
if( preg_match($mask_edit_table,$table,$rets) || preg_match($mask_search_table,$table,$rets) )
{
- $sid=$rets[1];
+ $sid = preg_replace('/(.*)_(.*)/', '\\1', $rets[1]); // remove popup's wid from sid
$is_alive = $this->Conn->GetOne( sprintf($sql,$sid) );
if(!$is_alive) $this->Conn->Query('DROP TABLE IF EXISTS '.$table);
}
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/inp_ses_storage.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.22
\ No newline at end of property
+1.23
\ No newline at end of property
Index: trunk/core/units/user_groups/user_groups_eh.php
===================================================================
--- trunk/core/units/user_groups/user_groups_eh.php (nonexistent)
+++ trunk/core/units/user_groups/user_groups_eh.php (revision 7635)
@@ -0,0 +1,91 @@
+<?php
+
+ class UserGroupsEventHandler extends kDBEventHandler {
+
+ /**
+ * Adds user as member for selected groups
+ *
+ * @param kEvent $event
+ */
+ function OnProcessSelected(&$event)
+ {
+ $new_groups = $this->Application->GetVar('g');
+ if (!$new_groups) {
+ return ;
+ }
+
+ $new_groups = array_keys($new_groups);
+
+ // don't insert duplicate group membership record
+ $user_id = $this->Application->GetVar('u_id');
+ $table_name = $this->Application->GetTempName(TABLE_PREFIX.'UserGroup', 'prefix:u');
+ $sql = 'SELECT GroupId
+ FROM '.$table_name.'
+ WHERE PortalUserId = '.$user_id;
+ $old_groups = $this->Conn->GetCol($sql);
+
+ $new_groups = array_diff($new_groups, $old_groups);
+ if ($new_groups) {
+ foreach ($new_groups as $new_group) {
+ $fields_hash = Array (
+ 'GroupId' => $new_group,
+ 'PortalUserId' => $user_id,
+ 'PrimaryGroup' => 0,
+ );
+ $this->Conn->doInsert($fields_hash, $table_name);
+ }
+ }
+
+ $event->SetRedirectParam('opener', 'u');
+ }
+
+ /**
+ * Sets primary group for user (in editing only)
+ *
+ * @param kEvent $event
+ */
+ function OnSetPrimary(&$event)
+ {
+ $ids = $this->StoreSelectedIDs($event);
+ if ($ids) {
+ $id = array_shift($ids);
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ $user_id = $this->Application->GetVar('u_id');
+
+ $sql = 'UPDATE '.$object->TableName.'
+ SET PrimaryGroup = 0
+ WHERE PortalUserId = '.$user_id;
+ $this->Conn->Query($sql);
+
+ $sql = 'UPDATE '.$object->TableName.'
+ SET PrimaryGroup = 1
+ WHERE '.$object->IDField.' = '.$id.' AND PortalUserId = '.$user_id;
+ $this->Conn->Query($sql);
+ }
+
+ $this->clearSelectedIDs($event);
+ }
+
+ /**
+ * Don't allow primary group record deleting
+ *
+ * @param kEvent $event
+ */
+ function customProcessing(&$event, $type)
+ {
+ if ($event->Name == 'OnMassDelete' && $type == 'before') {
+ $ids = $event->getEventParam('ids');
+ if ($ids) {
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ $user_id = $this->Application->GetVar('u_id');
+ $sql = 'SELECT '.$object->IDField.'
+ FROM '.$object->TableName.'
+ WHERE '.$object->IDField.' IN ('.implode(',', $ids).') AND PortalUserId = '.$user_id.' AND PrimaryGroup = 0';
+ $ids = $this->Conn->GetCol($sql);
+ $event->setEventParam('ids', $ids);
+ }
+ }
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: trunk/core/units/user_groups/user_groups_eh.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/units/user_groups/user_groups_dbitem.php
===================================================================
--- trunk/core/units/user_groups/user_groups_dbitem.php (nonexistent)
+++ trunk/core/units/user_groups/user_groups_dbitem.php (revision 7635)
@@ -0,0 +1,29 @@
+<?php
+
+ class UserGroups_DBItem extends kDBItem
+ {
+ /**
+ * Returns part of SQL WHERE clause identifing the record, ex. id = 25
+ *
+ * @access public
+ * @param string $method Child class may want to know who called GetKeyClause, Load(), Update(), Delete() send its names as method
+ * @return void
+ * @see kDBItem::Load()
+ * @see kDBItem::Update()
+ * @see kDBItem::Delete()
+ */
+ function GetKeyClause($method=null, $keys_hash = null)
+ {
+ $table_info = $this->getLinkedInfo();
+ $keys_hash = Array(
+ $this->IDField => $this->ID,
+ $table_info['ForeignKey'] => $table_info['ParentId'],
+ );
+
+ return parent::GetKeyClause($method, $keys_hash);
+ }
+
+ }
+
+
+?>
\ No newline at end of file
Property changes on: trunk/core/units/user_groups/user_groups_dbitem.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/units/user_groups/user_groups_config.php
===================================================================
--- trunk/core/units/user_groups/user_groups_config.php (revision 7634)
+++ trunk/core/units/user_groups/user_groups_config.php (revision 7635)
@@ -1,95 +1,77 @@
<?php
$config = Array(
'Prefix' => 'ug',
'Clones' => Array(
'g-ug' => Array(
'ParentPrefix' => 'g',
'ForeignKey' => 'GroupId',
'ParentTableKey' => 'GroupId',
),
'u-ug' => Array(
'ParentPrefix' => 'u',
'ForeignKey' => 'PortalUserId',
'ParentTableKey' => 'PortalUserId',
),
-
),
- 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ItemClass' => Array('class'=>'UserGroups_DBItem','file'=>'user_groups_dbitem.php','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
- 'EventHandlerClass' => Array('class'=>'kDBEventHandler','file'=>'','build_event'=>'OnBuild'),
+ 'EventHandlerClass' => Array('class'=>'UserGroupsEventHandler','file'=>'user_groups_eh.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
'AutoLoad' => true,
- 'QueryString' => Array(
- 1 => 'id',
- 2 => 'page',
- 3 => 'event',
- ),
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ ),
'IDField' => 'GroupId',
- 'StatusField' => Array('UserStatus'),
'TableName' => TABLE_PREFIX.'UserGroup',
'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s FROM %1$s
- LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON %1$s.GroupId = g.GroupId AND %1$s.PrimaryGroup = 1
- LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON u.PortalUserId = %1$s.PortalUserId'),
+ LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON %1$s.GroupId = g.GroupId'),
'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s FROM %1$s
- LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON %1$s.GroupId = g.GroupId AND %1$s.PrimaryGroup = 1
- LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON u.PortalUserId = %1$s.PortalUserId'),
+ LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON %1$s.GroupId = g.GroupId'),
'AutoDelete' => true,
'AutoClone' => true,
- 'CalculatedFields' => Array(
- '' => Array(
- 'Login' => 'u.Login',
- 'FirstName' => 'u.FirstName',
- 'LastName' => 'u.LastName',
- 'Email' => 'u.Email',
- 'PrimaryGroup' => 'g.Name',
- 'CreatedOn' => 'u.CreatedOn',
- 'UserStatus' => 'u.Status'
- ),
- ),
+ 'CalculatedFields' => Array (
+ '' => Array(
+ 'GroupName' => 'g.Name',
+ ),
+ ),
'Fields' => Array(
- 'PortalUserId' => Array('type' => 'int','not_null' => '1','default' => '0'),
- 'GroupId' => Array(),
- 'MembershipExpires' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => ''),
- 'PrimaryGroup' => Array('type' => 'int','not_null' => '1','default' => '1'),
- 'ExpirationReminderSent' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'PortalUserId' => Array('type' => 'int'),
+ 'GroupId' => Array('type' => 'int', 'not_null' => 1, 'default' => 1),
+ 'MembershipExpires' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => ''),
+ 'PrimaryGroup' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
+ 'ExpirationReminderSent' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
),
- 'VirtualFields' => Array(
- 'Login' => Array('type' => 'string'),
- 'FirstName' => Array('type' => 'string'),
- 'LastName' => Array('type' => 'string'),
- 'Email' => Array('type' => 'string'),
- 'PrimaryGroup' => Array('type' => 'string'),
- 'CreatedOn' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1, 'default' => '#NOW#'),
- 'UserStatus' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Enabled', 0 => 'la_Disabled', 2 => 'la_Pending'), 'use_phrases' => 1, 'not_null' => '1','default' => 2),
- ),
+ 'VirtualFields' => Array (
+ 'GroupName' => Array('type' => 'string'),
+ ),
'Grids' => Array(
- 'Default' => 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_checkbox_td'),
- 'LastName' => Array( 'title'=>'la_col_LastName'),
- 'FirstName' => Array( 'title'=>'la_col_FirstName'),
- 'Email' => Array( 'title'=>'la_col_Email'),
+ 'Default' => Array(
+ 'Icons' => Array ('default' => 'icon16_group.gif'),
+ 'Fields' => Array(
+ 'GroupId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td'),
+ 'GroupName' => Array ('title'=>'la_col_GroupName'),
'PrimaryGroup' => Array( 'title'=>'la_col_PrimaryGroup'),
- 'CreatedOn_formatted' => Array('title' => 'la_col_CreatedOn', 'sort_field' => 'CreatedOn'),
- ),
- ),
- ),
+ 'MembershipExpires' => Array ('title' => 'la_col_MembershipExpires', 'data_block' => 'grid_membership_td'),
+ ),
+ ),
+ ),
);
?>
\ No newline at end of file
Property changes on: trunk/core/units/user_groups/user_groups_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/core/units/category_items/category_items_event_handler.php
===================================================================
--- trunk/core/units/category_items/category_items_event_handler.php (revision 7634)
+++ trunk/core/units/category_items/category_items_event_handler.php (revision 7635)
@@ -1,127 +1,127 @@
<?php
class CategoryItemsEventHander extends kDBEventHandler
{
/**
* Setting language dependant navbar as calculated field
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
$object =& $event->getObject();
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$object->addCalculatedField('CategoryName', 'c.'.$ml_formatter->LangFieldName('CachedNavbar'));
}
/**
* Set's new category as primary for product
*
* @param kEvent $event
*/
function OnSetPrimary(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$ids = $this->StoreSelectedIDs($event);
-
+
if($ids)
{
$id = array_shift($ids);
$table_info = $object->getLinkedInfo();
$this->Conn->Query('UPDATE '.$object->TableName.' SET PrimaryCat = 0 WHERE '.$table_info['ForeignKey'].' = '.$table_info['ParentId']);
$this->Conn->Query('UPDATE '.$object->TableName.' SET PrimaryCat = 1 WHERE ('.$table_info['ForeignKey'].' = '.$table_info['ParentId'].') AND (CategoryId = '.$id.')');
}
- $event->redirect_params = Array('opener' => 's', 'pass_events' => true); //stay!
+ $event->redirect_params = Array('opener' => 's'); //stay!
}
/**
* Apply custom processing to item
*
* @param kEvent $event
*/
function customProcessing(&$event, $type)
{
if($event->Name == 'OnMassDelete')
{
$object =& $event->getObject();
$table_info = $object->getLinkedInfo();
switch ($type)
{
case 'before':
$ids = $event->getEventParam('ids');
if($ids)
{
$ids = $this->Conn->GetCol('SELECT CategoryId FROM '.$object->TableName.' WHERE (PrimaryCat=0) AND ('.$table_info['ForeignKey'].'='.$table_info['ParentId'].') AND CategoryId IN ('.implode(',',$ids).')');
$event->setEventParam('ids',$ids);
}
break;
// not needed because 'before' does not allow to delete primary cat!
/*case 'after':
// set 1st not deleted category as primary
$has_primary = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$object->TableName.' WHERE (PrimaryCat=1) AND ('.$table_info['ForeignKey'].' = '.$table_info['ParentId'].')');
if(!$has_primary)
{
$cat_id = $this->Conn->GetOne('SELECT CategoryId FROM '.$object->TableName.' WHERE '.$table_info['ForeignKey'].' = '.$table_info['ParentId']);
$this->Conn->Query('UPDATE '.$object->TableName.' SET PrimaryCat = 1 WHERE ('.$table_info['ForeignKey'].' = '.$table_info['ParentId'].') AND (CategoryId = '.$cat_id.')');
}
break;*/
}
}
}
/**
* Removes primary mark from cloned category items record
*
* @param kEvent $event
*/
function OnAfterClone(&$event)
{
$id = $event->getEventParam('id');
$table = $this->Application->getUnitOption($event->Prefix, 'TableName');
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$sql = 'UPDATE %s SET PrimaryCat = 0 WHERE %s = %s';
$this->Conn->Query( sprintf($sql, $table, $id_field, $id) );
}
/**
* Deletes items of requested type from requested categories.
* In case if item is deleted from it's last category, then delete item too.
*
* @param kEvent $event
*/
function OnDeleteFromCategory(&$event)
{
$category_ids = $event->getEventParam('category_ids');
if(!$category_ids) return false;
$item_prefix = $event->getEventParam('item_prefix');
$item =& $this->Application->recallObject($item_prefix.'.-item', null, Array('skip_autoload' => true));
$ci_table = $this->Application->getUnitOption($event->Prefix, 'TableName');
$item_table = $this->Application->getUnitOption($item_prefix, 'TableName');
$sql = 'SELECT ItemResourceId, CategoryId FROM %1$s INNER JOIN %2$s ON (%1$s.ResourceId = %2$s.ItemResourceId) WHERE CategoryId IN (%3$s)';
$category_items = $this->Conn->Query( sprintf($sql, $item_table, $ci_table, implode(',', $category_ids) ) );
$item_hash = Array();
foreach($category_items as $ci_row)
{
$item_hash[ $ci_row['ItemResourceId'] ][] = $ci_row['CategoryId'];
}
foreach($item_hash as $item_resource_id => $delete_category_ids)
{
$item->Load($item_resource_id, 'ResourceId');
$item->DeleteFromCategories($delete_category_ids);
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/category_items/category_items_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.10
\ No newline at end of property
+1.11
\ No newline at end of property
Index: trunk/core/admin_templates/categories/permissions_tab.tpl
===================================================================
--- trunk/core/admin_templates/categories/permissions_tab.tpl (revision 7634)
+++ trunk/core/admin_templates/categories/permissions_tab.tpl (revision 7635)
@@ -1,72 +1,74 @@
<inp2:m_if check="m_ParamEquals" name="tab_init" value="1">
<div id="<inp2:m_param name="item_prefix"/>_div" prefix="<inp2:m_param name="item_prefix"/>" group_id="-1" class="catalog-tab"></div>
<script type="text/javascript">$PermManager.registerTab('<inp2:m_param name="item_prefix"/>');</script>
<inp2:m_else/>
+ <inp2:lang.current_Field name="Charset" result_to_var="charset"/>
+ <inp2:m_Header data="Content-type: text/plain; charset=$charset"/>
if ($request_visible) {
document.getElementById('<inp2:m_get name="item_prefix"/>_div').setAttribute('group_id', <inp2:m_get name="group_id"/>);
}
<inp2:m_if check="c_SaveWarning">
document.getElementById('save_warning').style.display = 'block';
$edit_mode = true;
</inp2:m_if>
#separator#
<inp2:m_DefineElement name="permission_element">
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<td>
<inp2:m_phrase name="$Description"/> [<inp2:m_param name="PermissionName"/>]
</td>
-
+
<td>
<!-- Inherited checkbox -->
<input
type="hidden"
id="<inp2:PermInputName sub_key="inherited"/>"
name="<inp2:PermInputName sub_key="inherited"/>"
value="<inp2:m_if check="m_ParamEquals" name="Inherited" value="1">1<inp2:m_else/>0</inp2:m_if>" />
-
- <input
+
+ <input
type="checkbox"
- id="_cb_<inp2:PermInputName sub_key="inherited"/>"
+ id="_cb_<inp2:PermInputName sub_key="inherited"/>"
<inp2:m_if check="m_ParamEquals" name="Inherited" value="1">checked</inp2:m_if>
onchange="update_checkbox(this, document.getElementById('<inp2:PermInputName sub_key="inherited"/>'));"
onclick="inherited_click('<inp2:m_param name="PermissionName"/>', <inp2:m_param name="InheritedValue"/>, this.checked, '_cb_<inp2:PermInputName sub_key="value"/>')" />
</td>
-
+
<td>
<inp2:CategoryPath cat_id="$InheritedFrom"/>
</td>
-
+
<td>
<!-- Access checkbox -->
<input
type="hidden"
id="<inp2:PermInputName sub_key="value"/>"
name="<inp2:PermInputName sub_key="value"/>"
value="<inp2:m_if check="m_ParamEquals" name="Value" value="1">1<inp2:m_else/>0</inp2:m_if>" />
-
- <input
+
+ <input
type="checkbox"
- id="_cb_<inp2:PermInputName sub_key="value"/>"
+ id="_cb_<inp2:PermInputName sub_key="value"/>"
<inp2:m_if check="m_ParamEquals" name="Inherited" value="1">disabled="disabled"</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="Value" value="1">checked</inp2:m_if>
onchange="update_checkbox(this, document.getElementById('<inp2:PermInputName sub_key="value"/>'));"
onclick="update_light('<inp2:m_param name="PermissionName"/>', this.checked)" />
</td>
-
+
<td>
<img id="light_<inp2:m_param name="PermissionName"/>" src="img/perm_<inp2:m_if check="m_ParamEquals" name="Value" value="1">green<inp2:m_else/>red</inp2:m_if>.gif"/>
</td>
</tr>
</inp2:m_DefineElement>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder_full">
<inp2:m_set odd_even="table_color1"/>
<thead class="subsectiontitle">
<td><inp2:m_phrase name="la_col_Description"/></td>
<td><inp2:m_phrase name="la_col_Inherited"/></td>
<td><inp2:m_phrase name="la_col_InheritedFrom"/></td>
<td><inp2:m_phrase name="la_col_Access"/></td>
<td><inp2:m_phrase name="la_col_Effective"/></td>
</thead>
<inp2:c-perm_PrintPermissions render_as="permission_element"/>
</table>
</inp2:m_if>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/categories/permissions_tab.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.7
\ No newline at end of property
+1.8
\ No newline at end of property
Index: trunk/core/admin_templates/popups/editor.tpl
===================================================================
--- trunk/core/admin_templates/popups/editor.tpl (revision 7634)
+++ trunk/core/admin_templates/popups/editor.tpl (revision 7635)
@@ -1,73 +1,73 @@
-<inp2:m_RequireLogin/>
+<inp2:m_RequireLogin/><inp2:m_Set skip_last_template="1"/>
<inp2:m_include t="incs/header" nobody="yes"/>
<body style="margin: 0px 8px 0px 8px; background-color: #fff;" onload="update_content()">
<inp2:m_ParseBlock name="blue_bar" prefix="trans" title_preset="trans_edit" module="in-portal"/>
<!-- 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() {
document.getElementById('frm').submit();
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
window.close();
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
</form>
<form name="frm" id="frm" action="javascript:update_opener();">
<inp2:adm_FCKEditor name="Content" width="100%" height="500"/>
</form>
<script type="text/javascript">
var $TargetField = '<inp2:m_Get var="TargetField"/>';
function update_content()
{
if (window.opener && !window.opener.closed)
{
current = window.opener.document.getElementById($TargetField).value;
document.getElementById('Content').value = current;
}
else {
window.close()
}
}
function update_opener()
{
d = document.getElementById('Content');
if (d.form) {
if (d.form.onsubmit) {
d.form.onsubmit()
}
}
if (!window.opener) return;
if (!window.opener.closed) {
current = window.opener.document.getElementById($TargetField);
current.value = document.getElementById('Content').value;
}
window.close();
}
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/popups/editor.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/admin_templates/popups/column_picker.tpl
===================================================================
--- trunk/core/admin_templates/popups/column_picker.tpl (revision 7634)
+++ trunk/core/admin_templates/popups/column_picker.tpl (revision 7635)
@@ -1,96 +1,96 @@
<inp2:adm_SetPopupSize width="600" height="500"/>
<inp2:m_RequireLogin/>
<inp2:m_include t="incs/header"/>
<inp2:m_ParseBlock name="blue_bar" prefix="adm" title_preset="column_picker" module="in-portal"/>
<!-- 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() {
set_hidden_field('picked_str',select_to_string('picked_columns'))
set_hidden_field('hidden_str',select_to_string('available_columns'))
submit_event('adm','OnSaveColumns');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('adm','OnClosePopup');
// window.close();
}
) );
- a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
+ /* a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
reset_form('adm', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
}
- ) );
+ ) );*/
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('move_up', '<inp2:m_phrase label="la_ToolTip_MoveUp" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_MoveUp" escape="1"/>', function() {
move_options_up('picked_columns', 1)
}
) );
a_toolbar.AddButton( new ToolBarButton('move_down', '<inp2:m_phrase label="la_ToolTip_MoveDown" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_MoveDown" escape="1"/>', function() {
move_options_down('picked_columns', 1)
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="4" >
<tr class="">
<td>
<table style="width: 500px; margin: 5px auto;" >
<tr>
<td>
<strong><inp2:m_phrase label="la_PickedColumns"/></strong>
</td>
<td>&nbsp;</td>
<td>
<strong><inp2:m_phrase label="la_AvailableColumns"/></strong>
</td>
</tr>
<tr>
<td style="text-align: left">
<inp2:m_DefineElement name="a_column">
<option value="<inp2:m_param name="_Id"/>"><inp2:m_param name="_Name"/></option>
</inp2:m_DefineElement>
<select id="picked_columns" multiple="multiple" size="20" style="width: 230px">
<inp2:adm_PrintColumns render_as="a_column"/>
</select>
<br/><br/>
</td>
<td style="text-align: center; width: 40px;">
<img style="cursor: pointer; border: 0px" src="img/icons/icon_left.gif" onclick="move_selected('available_columns', 'picked_columns');"/><br/>
<img style="cursor: pointer; border: 0px" src="img/icons/icon_right.gif" onclick="move_selected('picked_columns', 'available_columns'); select_sort('available_columns');"/><br/>
</td>
<td style="text-align: left">
<select id="available_columns" multiple="multiple" size="20" style="width: 230px">
<inp2:adm_PrintColumns hidden="1" render_as="a_column"/>
</select>
<br/><br/>
</td>
</tr>
</table>
</td>
<td>&nbsp;</td>
</tr>
</table>
<input type="hidden" name="main_prefix" value="<inp2:m_get var="main_prefix"/>"/>
</form>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/popups/column_picker.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/admin_templates/incs/grid_blocks.tpl
===================================================================
--- trunk/core/admin_templates/incs/grid_blocks.tpl (revision 7634)
+++ trunk/core/admin_templates/incs/grid_blocks.tpl (revision 7635)
@@ -1,478 +1,478 @@
<inp2:m_block name="current_page"/>
<span class="current_page"><inp2:m_param name="page"/></span>
<inp2:m_blockend/>
<inp2:m_block name="page"/>
<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url"><inp2:m_param name="page"/></a>
<inp2:m_blockend/>
<inp2:m_block name="next_page"/>
<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url">&gt;</a>
<inp2:m_blockend/>
<inp2:m_block name="prev_page"/>
<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url">&lt;</a>
<inp2:m_blockend/>
<inp2:m_block name="next_page_split"/>
<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url">&gt;&gt;</a>
<inp2:m_blockend/>
<inp2:m_block name="prev_page_split"/>
<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url">&lt;&lt;</a>
<inp2:m_blockend/>
<inp2:m_DefineElement name="search_main_toolbar">
</inp2:m_DefineElement>
<inp2:m_block name="grid_pagination" SearchPrefixSpecial="" ajax="0"/>
<table cellspacing="0" cellpadding="0" width="100%" bgcolor="#E0E0DA" border="0" class="<inp2:m_if prefix="m" function="ParamEquals" name="no_toolbar" value="no_toolbar"/>tableborder_full_kernel<inp2:m_else/>pagination_bar<inp2:m_endif/>">
<tbody>
<tr id="MY_ID">
<td>
<img height="15" src="img/arrow.gif" width="15" align="absmiddle" border="0">
<b class=text><inp2:m_phrase name="la_Page"/></b>
<inp2:$PrefixSpecial_PrintPages active_block="current_page" split="10" inactive_block="page" prev_page_block="prev_page" next_page_block="next_page" prev_page_split_block="prev_page_split" next_page_split_block="next_page_split" main_special="$main_special" ajax="$ajax" grid="$grid"/>
</td>
<inp2:m_if check="m_ParamEquals" param="search" value="on">
<inp2:m_if check="m_ParamEquals" name="SearchPrefixSpecial" value="">
<inp2:m_RenderElement name="grid_search" grid="$grid" PrefixSpecial="$PrefixSpecial" ajax="$ajax"/>
<inp2:m_else />
<inp2:m_RenderElement name="grid_search" grid="$grid" PrefixSpecial="$SearchPrefixSpecial" ajax="$ajax"/>
</inp2:m_if>
</inp2:m_if>
<td>
</tr>
</tbody>
</table>
<inp2:m_blockend/>
<inp2:m_DefineElement name="grid_search" ajax="0">
<td align="right" class="search-cell">
<table cellspacing="0" cellpadding="0">
<tr>
<td><inp2:m_phrase name="la_Search"/>:&nbsp;</td>
<td>
<input type="text" id="<inp2:m_param name="PrefixSpecial"/>_search_keyword" name="<inp2:m_param name="PrefixSpecial"/>_search_keyword" value="<inp2:m_recall var="{$PrefixSpecial}_search_keyword" no_null="no_null" special="1"/>" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);" style="border: 1px solid grey;" />
<input type="text" style="display: none"; />
</td>
<td style="white-space: nowrap" id="search_buttons[<inp2:m_param name="PrefixSpecial"/>]">
<div style="white-space: nowrap;"></div>
<script type="text/javascript">
<inp2:m_RenderElement name="grid_search_buttons" pass_params="true"/>
</script>
</td>
</tr>
</table>
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_search_buttons" PrefixSpecial="" grid="" ajax="1">
Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'] = new ToolBar('icon16_');
Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].UseLabels = false;
Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].AddButton(
new ToolBarButton(
'search',
'<inp2:m_phrase name="la_ToolTip_Search" escape="1"/>',
function() { search('<inp2:m_param name="PrefixSpecial"/>','<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>) },
null,
'<inp2:m_param name="PrefixSpecial"/>') );
Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].AddButton(
new ToolBarButton(
'search_reset',
'<inp2:m_phrase name="la_ToolTip_SearchReset" escape="1"/>',
function() { search_reset('<inp2:m_param name="PrefixSpecial"/>','<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>) },
null,
'<inp2:m_param name="PrefixSpecial"/>') );
Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].Render(document.getElementById('search_buttons[<inp2:m_param name="PrefixSpecial"/>]'));
</inp2:m_DefineElement>
<inp2:m_block name="grid_column_title" use_phrases="1"/>
<td nowrap="nowrap">
<a href="javascript:resort_grid('<inp2:m_param name="PrefixSpecial"/>','<inp2:m_param name="sort_field"/>', <inp2:m_param name="ajax"/>);" class="columntitle_small"><IMG alt="" src="img/list_arrow_<inp2:$PrefixSpecial_order field="$sort_field"/>.gif" border="0" align="absmiddle"><inp2:m_if check="m_ParamEquals" name="use_phrases" value="1"><inp2:m_phrase name="$title"/><inp2:m_else/><inp2:m_param name="title"/></inp2:m_if></a>
</td>
<inp2:m_blockend/>
<inp2:m_block name="grid_column_title_no_sorting" use_phrases="1"/>
<td nowrap="nowrap">
<inp2:m_if check="m_ParamEquals" name="use_phrases" value="1"><inp2:m_phrase name="$title"/><inp2:m_else/><inp2:m_param name="title"/></inp2:m_if>
</td>
<inp2:m_blockend/>
<inp2:m_block name="grid_checkbox_td" format="" module="" />
<td valign="top" class="text">
<table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
<tr>
<td><input type="checkbox" name="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>"></td>
<td><img src="<inp2:ModulePath module="$module"/>img/itemicons/<inp2:$PrefixSpecial_ItemIcon grid="$grid"/>"></td>
<td><inp2:Field field="$field" no_special="no_special" format="$format"/></td>
</tr>
</table>
</td>
<inp2:m_blockend />
<inp2:m_block name="grid_checkbox_td_no_icon" format="" />
<td valign="top" class="text">
<table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
<tr>
<td><input type="checkbox" name="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>"></td>
<td><inp2:$PrefixSpecial_field field="$field" no_special="no_special" format="$format"/></td>
</tr>
</table>
</td>
<inp2:m_blockend />
<inp2:m_block name="label_grid_checkbox_td" format="" module="" />
<td valign="top" class="text">
<table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
<tr>
<td><input type="checkbox" name="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>"></td>
<td><img src="<inp2:ModulePath module="$module"/>img/itemicons/<inp2:$PrefixSpecial_ItemIcon grid="$grid"/>"></td>
<td><inp2:$PrefixSpecial_field field="$field" no_special="no_special" as_label="as_label" format="$format"/></td>
</tr>
</table>
</td>
<inp2:m_blockend />
<inp2:m_block name="grid_icon_td" format="" module="" />
<td valign="top" class="text">
<table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
<tr>
<td><img src="<inp2:ModulePath module="$module"/>img/itemicons/<inp2:$PrefixSpecial_ItemIcon grid="$grid"/>"></td>
<td><inp2:$PrefixSpecial_field field="$field" no_special="no_special" format="$format"/></td>
</tr>
</table>
</td>
<inp2:m_blockend />
<inp2:m_block name="grid_radio_td" format="" module=""/>
<td valign="top" class="text">
<table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
<tr>
<td><input type="radio" name="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>"></td>
<td><img src="<inp2:ModulePath module="$module"/>img/itemicons/<inp2:$PrefixSpecial_ItemIcon grid="$grid"/>"></td>
<td><inp2:Field field="$field" no_special="no_special" format="$format"/></td>
</tr>
</table>
</td>
<inp2:m_blockend />
-<inp2:m_block name="grid_data_td" format="" no_special="" nl2br="" first_chars="" td_style=""/>
- <td valign="top" class="text" style="<inp2:m_param name="td_style"/>"><inp2:$PrefixSpecial_field field="$field" first_chars="$first_chars" nl2br="$nl2br" grid="$grid" no_special="$no_special" format="$format"/></td>
+<inp2:m_block name="grid_data_td" format="" no_special="" nl2br="" first_chars="" td_style="" currency=""/>
+ <td valign="top" class="text" style="<inp2:m_param name="td_style"/>"><inp2:$PrefixSpecial_field field="$field" first_chars="$first_chars" currency="$currency" nl2br="$nl2br" grid="$grid" no_special="$no_special" format="$format"/></td>
<inp2:m_blockend />
<inp2:m_block name="grid_edit_td" format="" />
<td valign="top" class="text"><input type="text" id="<inp2:$PrefixSpecial_InputName field="$field"/>" name="<inp2:$PrefixSpecial_InputName field="$field"/>" value="<inp2:$PrefixSpecial_field field="$field" grid="$grid" format="$format"/>"></td>
<inp2:m_blockend />
<inp2:m_block name="grid_data_label_td" />
<td valign="top" class="text"><inp2:$PrefixSpecial_field field="$field" grid="$grid" plus_or_as_label="1" no_special="no_special" format="$format"/></td>
<inp2:m_blockend />
<inp2:m_block name="grid_data_label_ml_td" format="" />
<td valign="top" class="text">
<span class="<inp2:m_if check="{$SourcePrefix}_HasError" field="$virtual_field">error</inp2:m_if>">
<inp2:$PrefixSpecial_Field field="$field" grid="$grid" as_label="1" no_special="no_special" format="$format"/>
</span><inp2:m_if check="{$SourcePrefix}_IsRequired" field="$virtual_field"/><span class="error"> *</span></inp2:m_if>:<br />
<inp2:m_if check="FieldEquals" field="$ElementTypeField" value="textarea">
<a href="javascript:PreSaveAndOpenTranslatorCV('<inp2:m_param name="SourcePrefix"/>,<inp2:m_param name="SourcePrefix"/>-cdata', '<inp2:m_param name="SourcePrefix"/>-cdata:cust_<inp2:Field name="CustomFieldId"/>', 'popups/translator', <inp2:$SourcePrefix_Field field="ResourceId"/>, 1);" title="<inp2:m_Phrase label="la_Translate" escape="1"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand;" border="0"></a>
<inp2:m_else/>
<a href="javascript:PreSaveAndOpenTranslatorCV('<inp2:m_param name="SourcePrefix"/>,<inp2:m_param name="SourcePrefix"/>-cdata', '<inp2:m_param name="SourcePrefix"/>-cdata:cust_<inp2:Field name="CustomFieldId"/>', 'popups/translator', <inp2:$SourcePrefix_Field field="ResourceId"/>);" title="<inp2:m_Phrase label="la_Translate" escape="1"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand;" border="0"></a>
</inp2:m_if>
</td>
<inp2:m_blockend />
<inp2:m_DefineElement name="grid_column_filter">
<td>&nbsp;</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_options_filter" use_phrases="0">
<td>
<select <inp2:m_if check="SearchField" field="$filter_field" filter_type="options" grid="$grid">class="filter"</inp2:m_if> name="<inp2:SearchInputName field="$filter_field" filter_type="options" grid="$grid"/>">
<inp2:m_if prefix="m" function="ParamEquals" name="use_phrases" value="1"/>
<inp2:PredefinedSearchOptions field="$filter_field" block="inp_option_phrase" selected="selected" has_empty="1" empty_value="" filter_type="options" grid="$grid"/>
<inp2:m_else/>
<inp2:PredefinedSearchOptions field="$filter_field" block="inp_option_item" selected="selected" has_empty="1" empty_value="" filter_type="options" grid="$grid"/>
<inp2:m_endif/>
</select>
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_like_filter">
<td>
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="like" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="like" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="like" grid="$grid"/>" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/>
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_equals_filter">
<td>
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="equals" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="equals" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="equals" grid="$grid"/>" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/>
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_range_filter">
<td>
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="range" type="from" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="range" type="from" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="range" type="from" grid="$grid"/>" size="5" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/><br />
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="range" type="to" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="range" type="to" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="range" type="to" grid="$grid"/>" size="5" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/><br />
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_float_range_filter">
<td>
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="float_range" type="from" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="float_range" type="from" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="float_range" type="from" grid="$grid"/>" size="5" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/><br />
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="float_range" type="to" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="float_range" type="to" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="float_range" type="to" grid="$grid"/>" size="5" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/><br />
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_date_range_filter">
<td>
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="date_range" type="from" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="from" grid="$grid"/>" id="<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="from" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="date_range" type="from" grid="$grid"/>" size="15" datepickerIcon="img/calendar_icon.gif" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/><br />
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="date_range" type="to" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="to" grid="$grid"/>" id="<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="to" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="date_range" type="to" grid="$grid"/>" size="15" datepickerIcon="img/calendar_icon.gif" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/><br />
</td>
<script type="text/javascript">
initCalendar("<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="from" grid="$grid"/>", "<inp2:Format field="{$sort_field}_date" input_format="1"/>");
initCalendar("<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="to" grid="$grid"/>", "<inp2:Format field="{$sort_field}_date" input_format="1"/>");
</script>
</inp2:m_DefineElement>
<inp2:m_block name="viewmenu_sort_block"/>
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuItem('<inp2:m_phrase name="$title" escape="1"/>','direct_sort_grid("<inp2:m_param name="PrefixSpecial"/>","<inp2:m_param name="sort_field"/>","<inp2:$PrefixSpecial_OrderInfo type="direction" pos="1"/>", null, <inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="IsOrder" field="$sort_field" pos="1"/>2<inp2:m_endif/>');
<inp2:m_blockend/>
<inp2:m_block name="viewmenu_filter_block"/>
- $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuItem('<inp2:m_param name="label"/>','<inp2:m_param name="filter_action"/>','<inp2:m_param name="filter_status"/>');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuItem('<inp2:m_param name="label" js_escape="1"/>','<inp2:m_param name="filter_action"/>','<inp2:m_param name="filter_status"/>');
<inp2:m_blockend/>
<inp2:m_block name="viewmenu_filter_separator"/>
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuSeparator();
<inp2:m_blockend/>
<inp2:m_block name="viewmenu_declaration" menu_filters="no" menu_sorting="yes" menu_perpage="yes" menu_select="yes" ajax="0"/>
// define ViewMenu
$fw_menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'] = function()
{
<inp2:m_if check="m_ParamEquals" name="menu_filters" value="yes">
// filtring menu
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'] = new Menu('<inp2:m_phrase name="la_Text_View" escape="1"/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuItem('All','filters_remove_all("<inp2:m_param name="PrefixSpecial"/>", <inp2:m_param name="ajax"/>);');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuItem('None','filters_apply_all("<inp2:m_param name="PrefixSpecial"/>", <inp2:m_param name="ajax"/>);');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuSeparator();
- <inp2:$PrefixSpecial_DrawFilterMenu item_block="viewmenu_filter_block" spearator_block="viewmenu_filter_separator" ajax="$ajax"/>
+ <inp2:$PrefixSpecial_DrawFilterMenu old_style="1" item_block="viewmenu_filter_block" spearator_block="viewmenu_filter_separator" ajax="$ajax"/>
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="menu_sorting" value="yes">
// sorting menu
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'] = new Menu('<inp2:m_phrase name="la_Text_Sort" escape="1"/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuItem('<inp2:m_phrase name="la_common_ascending" escape="1"/>','direct_sort_grid("<inp2:m_param name="PrefixSpecial"/>","<inp2:$PrefixSpecial_OrderInfo type="field" pos="1"/>","asc",null,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="IsOrder" direction="asc" pos="1"/>2<inp2:m_endif/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuItem('<inp2:m_phrase name="la_common_descending" escape="1"/>','direct_sort_grid("<inp2:m_param name="PrefixSpecial"/>","<inp2:$PrefixSpecial_OrderInfo type="field" pos="1"/>","desc",null,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="IsOrder" direction="desc" pos="1"/>2<inp2:m_endif/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuSeparator();
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuItem('<inp2:m_phrase name="la_Text_Default" escape="1"/>','reset_sorting("<inp2:m_param name="PrefixSpecial"/>");');
<inp2:$PrefixSpecial_IterateGridFields grid="$grid" mode="header" block="viewmenu_sort_block" ajax="$ajax"/>
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="menu_perpage" value="yes">
// per page menu
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'] = new Menu('<inp2:m_phrase name="la_prompt_PerPage" escape="1"/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('10','set_per_page("<inp2:m_param name="PrefixSpecial"/>",10,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="10"/>2<inp2:m_endif/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('20','set_per_page("<inp2:m_param name="PrefixSpecial"/>",20,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="20"/>2<inp2:m_endif/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('50','set_per_page("<inp2:m_param name="PrefixSpecial"/>",50,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="50"/>2<inp2:m_endif/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('100','set_per_page("<inp2:m_param name="PrefixSpecial"/>",100,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="100"/>2<inp2:m_endif/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('500','set_per_page("<inp2:m_param name="PrefixSpecial"/>",500,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="500"/>2<inp2:m_endif/>');
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="menu_select" value="yes">
// select menu
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'] = new Menu('<inp2:m_phrase name="la_Text_Select" escape="1"/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].addMenuItem('<inp2:m_phrase name="la_Text_All" escape="1"/>','Grids["<inp2:m_param name="PrefixSpecial"/>"].SelectAll();');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].addMenuItem('<inp2:m_phrase name="la_Text_Unselect" escape="1"/>','Grids["<inp2:m_param name="PrefixSpecial"/>"].ClearSelection();');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].addMenuItem('<inp2:m_phrase name="la_Text_Invert" escape="1"/>','Grids["<inp2:m_param name="PrefixSpecial"/>"].InvertSelection();');
</inp2:m_if>
processHooks('ViewMenu', hBEFORE, '<inp2:m_param name="PrefixSpecial"/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'] = new Menu('<inp2:$PrefixSpecial_GetItemName/>');
<inp2:m_if check="m_ParamEquals" name="menu_filters" value="yes">
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addMenuItem( $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'] );
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="menu_sorting" value="yes">
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addMenuItem( $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'] );
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="menu_perpage" value="yes">
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addMenuItem( $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'] );
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="menu_select" value="yes">
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addMenuItem( $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'] );
</inp2:m_if>
processHooks('ViewMenu', hAFTER, '<inp2:m_param name="PrefixSpecial"/>');
}
<inp2:m_blockend/>
<inp2:m_include template="incs/menu_blocks"/>
<inp2:m_block name="grid_save_warning" />
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_<inp2:m_if prefix="m" function="ParamEquals" name="no_toolbar" value="no_toolbar"/>nobottom<inp2:m_else/>notop<inp2:m_endif/>">
<tr>
<td valign="top" class="hint_red">
<inp2:m_phrase name="la_Warning_Save_Item"/>
</td>
</tr>
</table>
<script type="text/javascript">
$edit_mode = <inp2:m_if check="m_ParamEquals" name="edit_mode" value="1">true<inp2:m_else />false</inp2:m_if>;
// window.parent.document.title += ' - MODE: ' + ($edit_mode ? 'EDIT' : 'LIVE');
</script>
<inp2:m_blockend/>
<inp2:m_DefineElement name="grid" main_prefix="" per_page="" main_special="" no_toolbar="" grid_filters="" search="on" header_block="grid_column_title" filter_block="grid_column_filter" data_block="grid_data_td" totals_block="grid_total_td" row_block="_row" ajax="0" totals="0">
<!--
grid_filters - show individual filters for each column
has_filters - draw filter section in "View" menu in toolbar
-->
<inp2:InitList pass_params="1"/> <!-- this is to avoid recalling prefix as an item in first iterate grid, by col-picker for instance -->
<inp2:$PrefixSpecial_SaveWarning name="grid_save_warning" main_prefix="$main_prefix" no_toolbar="$no_toolbar"/>
<inp2:m_if check="m_RecallEquals" var="{$PrefixSpecial}_search_keyword" value="" inverse="inverse">
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_<inp2:m_if prefix="m" function="ParamEquals" name="no_toolbar" value="no_toolbar"/>nobottom<inp2:m_else/>notop<inp2:m_endif/>">
<tr>
<td valign="top" class="hint_red">
<inp2:m_phrase name="la_Warning_Filter"/>
</td>
</tr>
</table>
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="per_page" value="-1" inverse="1">
<inp2:m_ParseBlock name="grid_pagination" grid="$grid" PrefixSpecial="$PrefixSpecial" main_special="$main_special" search="$search" no_toolbar="$no_toolbar" ajax="$ajax"/>
</inp2:m_if>
<table width="100%" cellspacing="0" cellpadding="4" class="tableborder">
<inp2:m_if check="m_ParamEquals" name="grid_filters" value="1">
<tr class="pagination_bar">
<inp2:$PrefixSpecial_IterateGridFields grid="$grid" mode="filter" block="$filter_block" ajax="$ajax"/>
</tr>
</inp2:m_if>
<tr class="subsectiontitle">
<inp2:$PrefixSpecial_IterateGridFields grid="$grid" mode="header" block="$header_block" ajax="$ajax"/>
</tr>
<inp2:m_DefineElement name="_row" td_style="">
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>" id="<inp2:m_param name="PrefixSpecial"/>_<inp2:Field field="$IdField"/>" sequence="<inp2:m_get param="{$PrefixSpecial}_sequence"/>"><inp2:m_inc param="{$PrefixSpecial}_sequence" by="1"/>
<inp2:IterateGridFields grid="$grid" mode="data" block="$data_block"/>
</tr>
</inp2:m_DefineElement>
<inp2:m_set {$PrefixSpecial}_sequence="1" odd_even="table_color1"/>
<inp2:$PrefixSpecial_PrintList block="$row_block" per_page="$per_page" main_special="$main_special" />
<inp2:m_DefineElement name="grid_total_td">
<inp2:m_if check="m_Param" name="total">
<td style="<inp2:m_param name="td_style"/>">
<inp2:FieldTotal name="$field" function="$total"/>
</td>
<inp2:m_else/>
<td style="<inp2:m_param name="td_style"/>">&nbsp;</td>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_if check="m_ParamEquals" name="totals" value="1">
<tr class="totals-row"/>
<inp2:IterateGridFields grid="$grid" mode="data" block="$totals_block"/>
</tr>
</inp2:m_if>
</table>
<inp2:m_if check="m_ParamEquals" name="ajax" value="0">
<inp2:m_if check="m_GetEquals" name="fw_menu_included" value="">
<script type="text/javascript" src="incs/fw_menu.js"></script>
<link rel="stylesheet" rev="stylesheet" href="incs/nlsmenu.css" type="text/css" />
<script type="text/javascript" src="js/nlsmenu.js"></script>
<script type="text/javascript" src="js/nlsmenueffect_1_2_1.js"></script>
<script type="text/javascript">
var menuMgr = new NlsMenuManager("mgr");
menuMgr.timeout = 500;
menuMgr.flowOverFormElement = true;
</script>
<inp2:m_set fw_menu_included="1"/>
</inp2:m_if>
<script type="text/javascript">
<inp2:m_RenderElement name="grid_js" selected_class="selected_div" tag_name="tr" pass_params="true"/>
</script>
</inp2:m_if>
<input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1" name="<inp2:m_param name="PrefixSpecial"/>_Sort1" value="">
<input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" name="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" value="asc">
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_js" ajax="1">
<inp2:m_if check="m_ParamEquals" name="no_init" value="no_init" inverse="inverse">
Grids['<inp2:m_param name="PrefixSpecial"/>'] = new Grid('<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="selected_class"/>', ':original', edit, a_toolbar);
Grids['<inp2:m_param name="PrefixSpecial"/>'].AddItemsByIdMask('<inp2:m_param name="tag_name"/>', /^<inp2:m_param name="PrefixSpecial"/>_([\d\w-]+)/, '<inp2:m_param name="PrefixSpecial"/>[$$ID$$][<inp2:m_param name="IdField"/>]');
Grids['<inp2:m_param name="PrefixSpecial"/>'].InitItems();
</inp2:m_if>
<inp2:m_RenderElement name="nlsmenu_declaration" pass_params="true"/>
$ViewMenus = new Array('<inp2:m_param name="PrefixSpecial"/>');
</inp2:m_DefineElement>
<inp2:m_DefineElement name="white_grid" main_prefix="" per_page="" main_special="" no_toolbar="" search="on" render_as="" columns="2" direction="V" empty_cell_render_as="wg_empty_cell" ajax="0">
<inp2:$PrefixSpecial_SaveWarning name="grid_save_warning" main_prefix="$main_prefix" no_toolbar="$no_toolbar"/>
<inp2:m_if check="m_RecallEquals" var="{$PrefixSpecial}_search_keyword" value="" inverse="inverse">
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_<inp2:m_if prefix="m" function="ParamEquals" name="no_toolbar" value="no_toolbar"/>nobottom<inp2:m_else/>notop<inp2:m_endif/>">
<tr>
<td valign="top" class="hint_red">
<inp2:m_phrase name="la_Warning_Filter"/>
</td>
</tr>
</table>
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="per_page" value="-1" inverse="1">
<inp2:m_ParseBlock name="grid_pagination" grid="$grid" PrefixSpecial="$PrefixSpecial" main_special="$main_special" search="$search" no_toolbar="$no_toolbar" ajax="$ajax"/>
</inp2:m_if>
<br />
<inp2:m_DefineElement name="wg_empty_cell">
<td width="<inp2:m_param name="column_width"/>%">&nbsp;</td>
</inp2:m_DefineElement>
<table width="100%" border="0" cellspacing="2" cellpadding="4">
<inp2:m_set {$PrefixSpecial}_sequence="1" odd_even="table_color1"/>
<inp2:$PrefixSpecial_PrintList2 pass_params="true"/>
</table>
<inp2:m_if check="m_ParamEquals" name="ajax" value="0">
<inp2:m_if check="m_GetEquals" name="fw_menu_included" value="">
<script type="text/javascript" src="incs/fw_menu.js"></script>
<link rel="stylesheet" rev="stylesheet" href="incs/nlsmenu.css" type="text/css" />
<script type="text/javascript" src="js/nlsmenu.js"></script>
<script type="text/javascript" src="js/nlsmenueffect_1_2_1.js"></script>
<script type="text/javascript">
var menuMgr = new NlsMenuManager("mgr");
menuMgr.timeout = 500;
menuMgr.flowOverFormElement = true;
</script>
<inp2:m_set fw_menu_included="1"/>
</inp2:m_if>
<script type="text/javascript">
<inp2:m_RenderElement name="grid_js" selected_class="table_white_selected" tag_name="td" pass_params="true"/>
</script>
</inp2:m_if>
<input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1" name="<inp2:m_param name="PrefixSpecial"/>_Sort1" value="">
<input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" name="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" value="asc">
</inp2:m_DefineElement>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/incs/grid_blocks.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/admin_templates/incs/header.tpl
===================================================================
--- trunk/core/admin_templates/incs/header.tpl (revision 7634)
+++ trunk/core/admin_templates/incs/header.tpl (revision 7635)
@@ -1,55 +1,58 @@
<inp2:m_DefaultParam body_properties=""/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
-<title>In-Portal :: Administration Panel</title>
+<title><inp2:m_GetConfig var="Site_Name"/> - <inp2:m_Phrase label="la_AdministrativeConsole"/></title>
<meta http-equiv="content-type" content="text/html; charset=<inp2:lang_GetCharset/>">
<meta name="keywords" content="...">
<meta name="description" content="...">
<meta name="robots" content="all">
<meta name="copyright" content="Copyright &#174; 2006 Test, Inc">
<meta name="author" content="Intechnic Inc.">
<inp2:m_base_ref/>
<link rel="icon" href="img/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" rev="stylesheet" href="incs/style.css" type="text/css" />
<script type="text/javascript" src="js/is.js"></script>
<script type="text/javascript" src="js/ajax.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript" src="js/in-portal.js"></script>
<script type="text/javascript" src="js/toolbar.js"></script>
<script type="text/javascript" src="js/grid.js"></script>
<script type="text/javascript" src="js/calendar.js"></script>
<script language="javascript">
var t = '<inp2:m_get param="t"/>';
var popups = '1';
var multiple_windows = '1';
var main_title = '<inp2:m_GetConfig var="Site_Name" escape="1"/>';
var tpl_changed = 0;
var base_url = '<inp2:m_BaseURL/>';
var $base_path = '<inp2:m_GetConst name="BASE_PATH"/>';
var img_path = '<inp2:m_TemplatesBase module="#MODULE#"/>/img/';
+NumberFormatter.ThousandsSep = '<inp2:lang.current_Field name="ThousandSep" js_escape="1"/>';
+NumberFormatter.DecimalSep = '<inp2:lang.current_Field name="DecimalPoint" js_escape="1"/>';
+
<inp2:m_if check="m_GetEquals" name="m_wid" value="" inverse="inverse">
window.name += '_<inp2:m_get name="m_wid"/>';
</inp2:m_if>
var $use_popups = <inp2:m_if check="adm_UsePopups">true<inp2:m_else/>false</inp2:m_if>;
var $use_toolbarlabels = <inp2:m_if check="adm_UseToolbarLabels">true<inp2:m_else/>false</inp2:m_if>;
</script>
</head>
<inp2:m_include t="incs/blocks"/>
<inp2:m_include t="incs/in-portal"/>
<inp2:m_if check="m_ParamEquals" name="nobody" value="yes" inverse="inverse">
- <body style="margin: 0px 0px 0px 8px" <inp2:m_get param="body_properties"/>>
+ <body <inp2:m_param name="body_properties"/>>
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="noform" value="yes" inverse="inverse">
<inp2:m_ParseBlock name="kernel_form"/>
</inp2:m_if>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/incs/header.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/admin_templates/incs/style.css
===================================================================
--- trunk/core/admin_templates/incs/style.css (revision 7634)
+++ trunk/core/admin_templates/incs/style.css (revision 7635)
@@ -1,634 +1,635 @@
/* --- In-Portal --- */
html {
height: 100%;
}
.head_version {
font-family: verdana, arial;
font-size: 10px;
font-weight: normal;
color: white;
padding-right: 5px;
text-decoration: none;
}
body {
font-family: Verdana, Arial, Helvetica, Sans-serif;
font-size: 12px;
color: #000000;
scrollbar-3dlight-color: #333333;
scrollbar-arrow-color: #ffffff;
scrollbar-track-color: #88d2f8;
scrollbar-darkshadow-color: #333333;
scrollbar-highlight-color: #009ffd;
scrollbar-shadow-color: #009ffd;
scrollbar-face-color: #009ffd;
overflow-x: auto; overflow-y: auto;
height: 100%;
+ margin: 0px 0px 0px 8px
}
A {
color: #006699;
text-decoration: none;
}
A:hover {
color: #009ff0;
text-decoration: none;
}
TD {
font-family: verdana,helvetica;
font-size: 10pt;
text-decoration: none;
}
form {
display: inline;
}
.text {
font-family: verdana, arial;
font-size: 12px;
font-weight: normal;
text-decoration: none;
}
.tablenav {
font-family: verdana, arial;
font-size: 14px;
font-weight: bold;
color: #FFFFFF;
text-decoration: none;
background-color: #73C4F5;
background: url(../img/tabnav_back.gif) repeat-x;
}
.header_left_bg {
background: url(../img/tabnav_left.gif) no-repeat;
}
.tablenav_link {
font-family: verdana, arial;
font-size: 14px;
font-weight: bold;
color: #FFFFFF;
text-decoration: none;
}
/*.tablenav_link:hover {
font-family: verdana, arial;
font-size: 14px;
font-weight: bold;
color: #ffcc00;
text-decoration: none;
}*/
.tableborder {
font-family: arial, helvetica, sans-serif;
font-size: 10pt;
border: 1px solid #000000;
border-top-width: 0px;
border-collapse: collapse;
}
.tableborder_full, .tableborder_full_kernel {
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
border: 1px solid #000000;
border-collapse: collapse;
}
.tableborder_full {
border-bottom-width: 0px;
}
.search-cell {
padding-right: 0px;
white-space: nowrap;
}
.button {
font-family: arial, verdana;
font-size: 12px;
font-weight: normal;
color: #000000;
background: url(../img/button_back.gif) #f9eeae repeat-x;
text-decoration: none;
}
.button-disabled {
font-family: arial, verdana;
font-size: 12px;
font-weight: normal;
color: #676767;
background: url(../img/button_back_disabled.gif) #f9eeae repeat-x;
text-decoration: none;
}
.hint_red {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
font-style: normal;
color: #FF0000;
/* background-color: #F0F1EB; */
}
.tree_head {
font-family: verdana, arial;
font-size: 10px;
font-weight: bold;
color: #FFFFFF;
text-decoration: none;
}
.admintitle {
font-family: verdana, arial;
font-size: 20px;
font-weight: bold;
color: #009FF0;
text-decoration: none;
}
.table_border_notop, .table_border_nobottom {
background-color: #F0F1EB;
border: 1px solid #000000;
border-collapse: collapse;
}
.table_border_notop {
border-top-width: 0px;
}
.table_border_nobottom {
border-bottom-width: 0px;
}
.pagination_bar {
background-color: #D7D7D7;
border: 1px solid #000000;
border-top-width: 0px;
border-collapse: collapse;
}
.totals-row td {
background-color: #D7D7D7;
border-bottom: 1px solid #000000;
border-top: 1px solid #000000;
font-weight: bold;
}
/* Categories */
.priority {
color: #FF0000;
padding-left: 1px;
padding-right: 1px;
font-size: 11px;
}
.cat_no, .cat_desc, .cat_new, .cat_pick, .cats_stats {
font-family: arial, verdana, sans-serif;
}
.cat_no {
font-size: 10px;
color: #707070;
}
.cat_desc {
font-size: 9pt;
color: #000000;
}
.cat_new {
font-size: 12px;
vertical-align: super;
color: blue;
}
.cat_pick {
font-size: 12px;
vertical-align: super;
color: #009900;
}
.cats_stats {
font-size: 11px;
color: #707070;
}
/* Links */
.link, .link:hover, .link_desc, .link_detail {
font-family: arial, helvetica, sans-serif;
}
.link {
font-size: 9pt;
color: #1F569A;
}
.link:hover {
font-size: 9pt;
color: #009FF0;
}
.link_desc {
font-size: 9pt;
color: #000000;
}
.link_detail {
font-size: 11px;
color: #707070;
}
.link_rate, .link_review, .link_modify, .link_div, .link_new, .link_top, .link_pop, .link_pick {
font-family: arial, helvetica, sans-serif;
font-size: 12px;
}
.link_rate, .link_review, .link_modify, .link_div {
text-decoration: none;
}
.link_rate { color: #006600; }
.link_review { color: #A27900; }
.link_modify { color: #800000; }
.link_div { color: #000000; }
.link_new, .link_top, .link_pop, .link_pick {
vertical-align: super;
}
.link_new { color: #0000FF; }
.link_top { color: #FF0000; }
.link_pop { color: FFA500; }
.link_pick { color: #009900; }
/* ToolBar */
.divider {
BACKGROUND-COLOR: #999999
}
.toolbar {
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
border: 1px solid #000000;
border-width: 0 1 1 1;
background-color: #F0F1EB;
border-collapse: collapse;
}
.current_page {
font-family: verdana;
font-size: 12px;
font-weight: bold;
background-color: #C4C4C4;
padding-left: 1px;
padding-right: 1px;
}
.nav_url {
font-family: verdana;
font-size: 12px;
font-weight: bold;
color: #1F569A;
}
.nav_arrow {
font-family: verdana;
font-size: 12px;
font-weight: normal;
color: #1F569A;
padding-left: 3px;
padding-right: 3px;
}
.nav_current_item {
font-family: verdana;
font-size: 12px;
font-weight: bold;
color: #666666;
}
/* Edit forms */
.hint {
font-family: arial, helvetica, sans-serif;
font-size: 12px;
font-style: normal;
color: #666666;
}
.table_color1, .table_color2 {
font-family: verdana, arial;
font-size: 14px;
font-weight: normal;
color: #000000;
text-decoration: none;
}
.table_color1 { background-color: #F6F6F6; }
.table_color2 { background-color: #EBEBEB; }
.table_white, .table_white_selected {
font-family: verdana, arial;
font-weight: normal;
font-size: 14px;
color: #000000;
text-decoration: none;
padding-top: 0px;
padding-bottom: 0px;
}
.table_white {
background-color: #FFFFFF;
}
.table_white_selected {
background-color: #C6D6EF;
}
.subsectiontitle {
font-family: verdana, arial;
font-size: 14px;
font-weight: bold;
background-color: #999999;
text-decoration: none;
color: #FFFFFF;
}
/*.subsectiontitle:hover {
font-family: verdana, arial;
font-size: 14px;
font-weight: bold;
background-color: #999999;
text-decoration: none;
color: #FFCC00;
}*/
.error {
font-family: arial, helvetica, sans-serif;
font-weight: bold;
font-size: 9pt;
color: #FF0000;
}
/* Tabs */
.tab_border {
border: 1px solid #000000;
border-width: 1 0 0 0;
}
.tab, .tab:hover {
font-family: verdana, arial, helvetica;
font-size: 12px;
font-weight: bold;
color: #000000;
text-decoration: none;
}
.tab2, .tab2:hover {
font-family: verdana, arial, helvetica;
font-size: 12px;
font-weight: bold;
text-decoration: none;
}
.tab2 { color: #FFFFFF; }
.tab2:hover { color: #000000; }
/* Item DIVS */
.selected_div { background-color: #C6D6EF; }
.notselected_div { background-color: #FFFFFF; }
/* Item tabs */
.itemtab_active {
background: url("../img/itemtabs/tab_active.gif") #eee repeat-x;
}
.itemtab_inactive {
background: url("../img/itemtabs/tab_inactive.gif") #F9EEAE repeat-x;
}
/* Grids */
.columntitle, .columntitle:hover {
font-family: verdana, arial;
font-size: 14px;
font-weight: bold;
background-color: #999999;
text-decoration: none;
}
.columntitle { color: #FFFFFF; }
.columntitle:hover { color: #FFCC00; }
.columntitle_small, .columntitle_small:hover {
font-family: verdana, arial;
font-size: 12px;
font-weight: bold;
background-color: #999999;
text-decoration: none;
}
.columntitle_small { color: #FFFFFF; }
.columntitle_small:hover { color: #FFCC00; }
/* ----------------------------- */
.section_header_bg {
background: url(../img/logo_bg.gif) no-repeat top right;
}
.small {
font-size: 9px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
/* order preview & preview_print styles */
.order_print_defaults TD,
.order_preview_header,
.order_preview_header TD,
.order_print_preview_header TD,
.order_preview_field_name,
.order-totals-name,
.arial2r,
.orders_print_flat_table TD {
font-family: Arial;
font-size: 10pt;
}
.order_preview_header, .order_preview_header TD, .order_print_preview_header TD {
background-color: #C9E9FE;
font-weight: bold;
}
.order_print_preview_header TD {
background-color: #FFFFFF;
}
.order_preview_field_name {
font-weight: bold;
padding: 2px 4px 2px 4px;
}
.order-totals-name {
font-style: normal;
}
.border1 {
border: 1px solid #111111;
}
.arial2r {
color: #602830;
font-weight: bold;
}
.orders_flat_table, .orders_print_flat_table {
border-collapse: collapse;
margin: 5px;
}
.orders_flat_table TD {
padding: 2px 5px 2px 5px;
border: 1px solid #444444;
}
.orders_print_flat_table TD {
border: 1px solid #000000;
padding: 2px 5px 2px 5px;
}
.help_box {
padding: 5px 10px 5px 10px;
}
.progress_bar
{
background: url(../img/progress_bar_segment.gif);
}
.grid_id_cell TD {
padding-right: 2px;
}
/*.transparent {
filter: alpha(opacity=50);
-moz-opacity: .5;
opacity: .5;
}*/
.none_transparent {
}
.subitem_icon {
vertical-align: top;
padding-top: 0px;
text-align: center;
width: 28px;
}
.subitem_description {
vertical-align: middle;
}
.dLink, .dLink:hover {
display: block;
margin-bottom: 5px;
font-family: Verdana;
font-size: 13px;
font-weight: bold;
color: #2C73CB;
}
.dLink {
text-decoration: none;
}
.dLink:hover {
text-decoration: underline;
}
a.config-header, a.config-header:hover {
color: #FFFFFF;
font-size: 11px;
}
.catalog-tab-left {
background: url(../img/itemtabs/tab_left.gif) top left no-repeat;
}
.catalog-tab-middle {
background: url(../img/itemtabs/tab_middle.gif) top left repeat-x;
}
.catalog-tab-right {
background: url(../img/itemtabs/tab_right.gif) top right no-repeat;
}
catalog-tab-separator td {
background: #FFFFFF;
}
.catalog-tab-selected td {
background-color: #E0E0DA;
cursor: default;
}
.catalog-tab-unselected td, .catalog-tab-unselected td span {
background-color: #F0F1EB;
cursor: pointer;
}
.catalog-tab {
display: none;
width: 100%;
}
.progress-text {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
color: #414141;
}
.flat-input {
border: 1px solid grey;
}
/* Toolbar */
.toolbar-button, .toolbar-button-disabled, .toolbar-button-over {
float: left;
clear: none !important;
border: none;
text-align: center;
font-size: 10px;
padding: 2px 2px 2px 2px;
vertical-align: middle;
}
.toolbar-button-over {
}
\ No newline at end of file
Property changes on: trunk/core/admin_templates/incs/style.css
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/core/admin_templates/incs/footer.tpl
===================================================================
--- trunk/core/admin_templates/incs/footer.tpl (revision 7634)
+++ trunk/core/admin_templates/incs/footer.tpl (revision 7635)
@@ -1,42 +1,43 @@
<inp2:m_if check="adm_UsePopups">
<script type="text/javascript">
var o = '';
var el = document.getElementById('scroll_container');
if (el) {
document.body.style.overflow = 'hidden';
document.body.style.height = '100%';
document.body.scroll = 'no'
o += '<div style="position: relative; overflow: auto; width: 100%; height: 100%;">';
o += el.innerHTML + '</div>';
el.innerHTML = o;
+ execJS(el)
MakeHeight100();
addEvent(window, 'resize', function() {MakeHeight100()})
}
function MakeHeight100(id)
{
if (!id) id = 'scroll_container';
var el = document.getElementById(id);
var h = (document.all ? window.document.body.offsetHeight : window.innerHeight) - el.offsetTop + 'px';
var w = (document.all ? window.document.body.offsetWidth : window.innerWidth) - el.offsetLeft + 'px';
// alert('h: '+h)
el.style.height = h;
// el.style.width=w;
}
+
</script>
<inp2:m_else/>
<inp2:m_if check="adm_TemplateMatches" templates="head,tree" inverse="inverse">
<br /><br />
</inp2:m_if>
</inp2:m_if>
<inp2:adm_AfterScript/>
<inp2:m_if check="m_ParamEquals" name="noform" value="yes" inverse="inverse">
<inp2:m_ParseBlock name="kernel_form_end"/>
</inp2:m_if>
<div id="nlsMenuPlace"></div>
-
</body>
</html>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/incs/footer.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/admin_templates/incs/form_blocks.tpl
===================================================================
--- trunk/core/admin_templates/incs/form_blocks.tpl (revision 7634)
+++ trunk/core/admin_templates/incs/form_blocks.tpl (revision 7635)
@@ -1,447 +1,493 @@
+<inp2:m_DefineElement name="combined_header">
+ <inp2:m_RequireLogin permissions="$section.view" system="1"/>
+ <inp2:m_if check="m_Param" name="prefix" inverse="1"><inp2:adm_SectionInfo section="$section" info="SectionPrefix" result_to_var="prefix"/></inp2:m_if>
+ <inp2:m_if check="m_get" var="m_wid" inverse="1">
+ <table cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tr style="background: url(<inp2:adm_SectionInfo section="$section" parent="1" info="module_path"/>img/logo_bg.gif) no-repeat top right; height: 55px;">
+ <td valign="top" class="admintitle" align="left" style="padding-top: 10px; padding-bottom: 10px;">
+ <img width="46" height="46" src="<inp2:adm_SectionInfo section="$section" parent="1" info="module_path"/>img/icons/icon46_<inp2:adm_SectionInfo section="$section" parent="1" info="icon"/>.gif" align="absmiddle" title="<inp2:adm_SectionInfo section="$section" parent="1" info="label"/>">&nbsp;<inp2:adm_SectionInfo section="$section" parent="1" info="label"/>
+ </td>
+ </tr>
+ </table>
+ </inp2:m_if>
+
+
+ <inp2:m_if check="m_Param" name="tabs">
+ <inp2:m_include t="$tabs"/>
+ </inp2:m_if>
+
+ <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
+ <tr>
+ <td class="header_left_bg" nowrap valign="middle">
+ <inp2:adm_SectionInfo section="$section" info="label" result_to_var="default_title"/>
+ <span class="tablenav_link" id="blue_bar"><inp2:$prefix_SectionTitle title_preset="$title_preset" title="$default_title" cut_first="100" pass_params="true"/></span>
+ </td>
+ <td align="right" class="tablenav" valign="middle">
+ <script type="text/javascript">
+ set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') + ' - <inp2:m_Phrase label="la_AdministrativeConsole"/>');
+ </script>
+ <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
+ <script>
+ var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
+ $help_url = $help_url.replace(/#/g, '%23');
+ </script>
+ <a href="javascript: OpenHelp($help_url);">
+ <img src="img/blue_bar_help.gif" border="0">
+ </a>
+ </inp2:m_if>
+ <inp2:m_if check="m_Param" name="pagination">
+ <inp2:m_RenderElement name="grid_pagination_elem" PrefixSpecial="$prefix" pass_params="1"/>
+ </inp2:m_if>
+ </td>
+ </tr>
+ </table>
+</inp2:m_DefineElement>
+
<inp2:m_block name="section_header"/>
<inp2:m_if check="m_ParamEquals" name="prefix" value="" inverse="inverse">
<inp2:m_RenderElement name="section_header_new" pass_params="true"/>
<inp2:m_else />
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr class="section_header_bg">
<td valign="top" class="admintitle" align="left" style="padding-top: 2px; padding-bottom: 2px;">
<img width="46" height="46" src="img/icons/<inp2:adm_GetSectionIcon icon="$icon"/>.gif" align="absmiddle" title="<inp2:adm_GetSectionTitle phrase="$title"/>">&nbsp;<inp2:adm_GetSectionTitle phrase="$title"/>
</td>
</tr>
</table>
</inp2:m_if>
<inp2:m_blockend/>
<inp2:m_DefineElement name="section_header_new" module="#session#">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr style="background: url(<inp2:ModulePath module="$module"/>img/logo_bg.gif) no-repeat top right; height: 65px;">
<td valign="top" class="admintitle" align="left" style="padding-top: 15px; padding-bottom: 15px;">
<img width="46" height="46" src="<inp2:ModulePath module="$module"/>img/icons/<inp2:adm_GetSectionIcon icon="$icon"/>.gif" align="absmiddle" title="<inp2:adm_GetSectionTitle phrase="$title"/>">&nbsp;<inp2:adm_GetSectionTitle phrase="$title"/>
</td>
</tr>
</table>
</inp2:m_DefineElement>
<inp2:m_block name="blue_bar" module="" icon="" pagination="0"/>
<table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
<tr>
<td class="header_left_bg" nowrap width="80%" valign="middle">
<span class="tablenav_link" id="blue_bar"><inp2:$prefix_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/></span>
</td>
<td align="right" class="tablenav" width="20%" valign="middle">
<inp2:m_if check="m_ModuleEnabled" module="In-Portal">
<script>
var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
$help_url = $help_url.replace(/#/g, '%23');
set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
</script>
<a href="javascript: OpenHelp($help_url);">
<img src="img/blue_bar_help.gif" border="0">
</a>
</inp2:m_if>
<inp2:m_if check="m_Param" name="pagination">
<inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
</inp2:m_if>
</td>
</tr>
</table>
<inp2:m_blockend/>
<inp2:m_DefineElement name="inp_original_label">
<td><inp2:$prefix.original_Field field="$field"/></td>
</inp2:m_DefineElement>
<inp2:m_block name="subsection" prefix=""/>
<tr class="subsectiontitle">
<td colspan="3"><inp2:m_phrase label="$title"/></td>
<inp2:m_if check="m_ParamEquals" name="prefix" value="" inverse="inverse">
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<td><inp2:m_phrase name="$original_title"/></td>
</inp2:m_if>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_field_caption" subfield="" NamePrefix=""/>
<inp2:m_inc param="tab_index" by="1"/>
<td class="text">
<label for="<inp2:m_param name="NamePrefix"/><inp2:$prefix_InputName field="$field" subfield="$subfield"/>">
<span class="<inp2:m_if prefix="$prefix" function="HasError" field="$field"/>error<inp2:m_endif/>">
<inp2:m_phrase label="$title"/></span><inp2:m_if prefix="$prefix" function="IsRequired" field="$field"/><span class="error"> *</span><inp2:m_endif/>:
</label>
</td>
<inp2:m_blockend/>
<inp2:m_block name="inp_label" is_last="" as_label="" currency="" is_last=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td valign="top"><span class="text"><inp2:$prefix_Field field="$field" as_label="$as_label" currency="$currency"/></span></td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
-<inp2:m_block name="inp_id_label"/>
+<inp2:m_block name="inp_id_label" db=""/>
<inp2:m_if check="{$prefix}_FieldEquals" field="$field" value="" inverse="inverse">
<inp2:m_ParseBlock name="inp_label" pass_params="true"/>
</inp2:m_if>
+ <input type="hidden" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field" db="$db"/>">
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_box" subfield="" class="" is_last="" maxlength="" onblur="" size="" onkeyup=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" subfield="$subfield" title="$title" is_last="$is_last"/>
<td>
<input type="text" name="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" id="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" value="<inp2:$prefix_Field field="$field" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>" onkeyup="<inp2:m_Param name="onkeyup"/>">
<inp2:m_if check="{$prefix}_HasParam" name="hint_label"><span class="small"><inp2:m_phrase label="$hint_label"/></span></inp2:m_if>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_DefineElement name="inp_edit_password" class="" size="">
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title"/>
<td>
<input type="password" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" value="" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>" />
<inp2:m_if check="{$prefix}_HasParam" name="hint_label"><span class="small"><inp2:m_phrase label="$hint_label"/></span></inp2:m_if>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_block name="inp_edit_upload" class="" is_last=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<input type="file" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>">
<inp2:m_if check="$prefix_FieldEquals" name="$field" value="" inverse="inverse">
(<inp2:$prefix_Field field="$field"/>)
</inp2:m_if>
<input type="hidden" name="<inp2:$prefix_InputName field="$field"/>[upload]" id="<inp2:$prefix_InputName field="$field"/>[upload]" value="<inp2:$prefix_Field field="$field"/>">
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_box_ml" class="" size="" maxlength=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<td class="text" valign="top">
<span class="<inp2:m_if prefix="$prefix" function="HasError" field="$field"/>error<inp2:m_endif/>">
<inp2:m_phrase label="$title"/><inp2:m_if prefix="$prefix" function="IsRequired" field="$field"/><span class="error"> *</span></inp2:m_if>:</span><br>
<a href="javascript:PreSaveAndOpenTranslator('<inp2:m_param name="prefix"/>', '<inp2:m_param name="field"/>', 'popups/translator');" title="<inp2:m_Phrase label="la_Translate"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand" border="0"></a>
</td>
<td>
<input type="text" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field" format="no_default"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_hidden" db=""/>
<input type="hidden" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field" db="$db"/>">
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_date" class="" is_last=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<input type="text" name="<inp2:$prefix_InputName field="{$field}_date"/>" id="<inp2:$prefix_InputName field="{$field}_date"/>" value="<inp2:$prefix_Field field="{$field}_date" format="_regional_InputDateFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:$prefix_Format field="{$field}_date" input_format="1" edit_size="edit_size"/>" class="<inp2:m_param name="class"/>" datepickerIcon="<inp2:m_ProjectBase/>core/admin_templates/img/calendar_icon.gif">&nbsp;<span class="small">(<inp2:$prefix_Format field="{$field}_date" input_format="1" human="true"/>)</span>
<script type="text/javascript">
initCalendar("<inp2:$prefix_InputName field="{$field}_date"/>", "<inp2:$prefix_Format field="{$field}_date" input_format="1"/>");
</script>
<input type="hidden" name="<inp2:$prefix_InputName field="{$field}_time"/>" id="<inp2:$prefix_InputName field="{$field}_time" input_format="1"/>" value="">
</td>
<td class="error"><inp2:$prefix_Error field="{$field}_date"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_date_time" class="" is_last=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<!-- <input type="hidden" id="<inp2:$prefix_InputName field="$field"/>" name="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field" db="db"/>"> -->
<input type="text" name="<inp2:$prefix_InputName field="{$field}_date"/>" id="<inp2:$prefix_InputName field="{$field}_date"/>" value="<inp2:$prefix_Field field="{$field}_date" format="_regional_InputDateFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:$prefix_Format field="{$field}_date" input_format="1" edit_size="edit_size"/>" class="<inp2:m_param name="class"/>" datepickerIcon="<inp2:m_ProjectBase/>core/admin_templates/img/calendar_icon.gif">
<span class="small">(<inp2:$prefix_Format field="{$field}_date" input_format="1" human="true"/>)</span>
<script type="text/javascript">
initCalendar("<inp2:$prefix_InputName field="{$field}_date"/>", "<inp2:$prefix_Format field="{$field}_date" input_format="1"/>");
</script>
&nbsp;<input type="text" name="<inp2:$prefix_InputName field="{$field}_time"/>" id="<inp2:$prefix_InputName field="{$field}_time"/>" value="<inp2:$prefix_Field field="{$field}_time" format="_regional_InputTimeFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:$prefix_Format field="{$field}_time" input_format="1" edit_size="edit_size"/>" class="<inp2:m_param name="class"/>"><span class="small"> (<inp2:$prefix_Format field="{$field}_time" input_format="1" human="true"/>)</span>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_textarea" class="" allow_html="allow_html"/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<td class="text" valign="top">
<span class="<inp2:m_if prefix="$prefix" function="HasError" field="$field"/>error<inp2:m_endif/>">
<inp2:m_phrase label="$title"/><inp2:m_if prefix="$prefix" function="IsRequired" field="$field"/><span class="error"> *</span><inp2:m_endif/>:</span><br>
<inp2:m_if check="m_ParamEquals" name="allow_html" value="allow_html">
<a href="javascript:OpenEditor('&section=in-link:editlink_general','kernel_form','<inp2:$prefix_InputName field="$field"/>');"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
</inp2:m_if>
</td>
<td>
<textarea tabindex="<inp2:m_get param="tab_index"/>" id="<inp2:$prefix_InputName field="$field"/>" name="<inp2:$prefix_InputName field="$field"/>" cols="<inp2:m_param name="cols"/>" rows="<inp2:m_param name="rows"/>" class="<inp2:m_param name="class"/>"><inp2:$prefix_Field field="$field"/></textarea>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_textarea_ml" class=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<td class="text" valign="top">
<span class="<inp2:m_if prefix="$prefix" function="HasError" field="$field"/>error<inp2:m_endif/>">
<inp2:m_phrase label="$title"/><inp2:m_if prefix="$prefix" function="IsRequired" field="$field"/><span class="error"> *</span><inp2:m_endif/>:</span><br>
<a href="javascript:OpenEditor('&section=in-link:editlink_general','kernel_form','<inp2:$prefix_InputName field="$field"/>');"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
<a href="javascript:PreSaveAndOpenTranslator('<inp2:m_param name="prefix"/>', '<inp2:m_param name="field"/>', 'popups/translator', 1);" title="<inp2:m_Phrase label="la_Translate"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand" border="0"></a>
</td>
<td>
<textarea tabindex="<inp2:m_get param="tab_index"/>" id="<inp2:$prefix_InputName field="$field"/>" name="<inp2:$prefix_InputName field="$field"/>" cols="<inp2:m_param name="cols"/>" rows="<inp2:m_param name="rows"/>" class="<inp2:m_param name="class"/>"><inp2:$prefix_Field field="$field"/></textarea>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_user" class="" is_last="" old_style="0" onkeyup=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<input type="text" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>" onkeyup="<inp2:m_Param name="onkeyup"/>">
<inp2:m_if check="m_ParamEquals" name="old_style" value="1">
<a href="#" onclick="return OpenUserSelector('','kernel_form','<inp2:$prefix_InputName field="$field"/>');">
<inp2:m_else/>
<a href="javascript:openSelector('<inp2:m_param name="prefix"/>', '<inp2:m_t t="user_selector" pass="all,$prefix" escape="1"/>', '<inp2:m_param name="field"/>');">
</inp2:m_if>
<img src="img/icons/icon24_link_user.gif" style="cursor:hand;" border="0">
</a>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_option_item"/>
<option value="<inp2:m_param name="key"/>"<inp2:m_param name="selected"/>><inp2:m_param name="option"/></option>
<inp2:m_blockend/>
<inp2:m_block name="inp_option_phrase"/>
<option value="<inp2:m_param name="key"/>"<inp2:m_param name="selected"/>><inp2:m_phrase label="$option"/></option>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_options" is_last="" has_empty="0" empty_value=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<select tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" onchange="<inp2:m_Param name="onchange"/>">
<inp2:m_if prefix="m" function="ParamEquals" name="use_phrases" value="1"/>
<inp2:$prefix_PredefinedOptions field="$field" block="inp_option_phrase" selected="selected" has_empty="$has_empty" empty_value="$empty_value"/>
<inp2:m_else/>
<inp2:$prefix_PredefinedOptions field="$field" block="inp_option_item" selected="selected" has_empty="$has_empty" empty_value="$empty_value"/>
<inp2:m_endif/>
</select>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_radio_item" onclick="" onchange=""/>
<input type="radio" <inp2:m_param name="checked"/> name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>" onclick="<inp2:m_param name="onclick"/>" onchange="<inp2:m_param name="onchange"/>"><label for="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_param name="option"/></label>&nbsp;
<inp2:m_blockend/>
<inp2:m_block name="inp_radio_phrase" onclick="" onchange=""/>
<input type="radio" <inp2:m_param name="checked"/> name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>" onclick="<inp2:m_param name="onclick"/>" onchange="<inp2:m_param name="onchange"/>"><label for="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_phrase label="$option"/></label>&nbsp;
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_radio" is_last="" pass_tabindex="" onclick="" onchange="" use_phrases="1"/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<inp2:m_if check="m_ParamEquals" name="use_phrases" value="1">
<inp2:$prefix_PredefinedOptions field="$field" tabindex="$pass_tabindex" block="inp_radio_phrase" selected="checked" onclick="$onclick" onchange="$onchange" />
<inp2:m_else />
<inp2:$prefix_PredefinedOptions field="$field" tabindex="$pass_tabindex" block="inp_radio_item" selected="checked" onclick="$onclick" onchange="$onchange" />
</inp2:m_if>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_checkbox" is_last="" field_class="" onchange="" onclick=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last" NamePrefix="_cb_"/>
<td>
<input type="hidden" id="<inp2:$prefix_InputName field="$field"/>" name="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field" db="db"/>">
<!--<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:$prefix_InputName field="$field"/>" name="_cb_<inp2:$prefix_InputName field="$field"/>" <inp2:$prefix_Field field="$field" checked="checked" db="db"/> class="<inp2:m_param name="field_class"/>" onclick="update_checkbox(this, document.getElementById('<inp2:$prefix_InputName field="$field"/>'));" onchange="<inp2:m_param name="onchange"/>">-->
<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:$prefix_InputName field="$field"/>" name="_cb_<inp2:$prefix_InputName field="$field"/>" <inp2:$prefix_Field field="$field" checked="checked" db="db"/> class="<inp2:m_param name="field_class"/>" onchange="update_checkbox(this, document.getElementById('<inp2:$prefix_InputName field="$field"/>'));<inp2:m_param name="onchange"/>" onclick="<inp2:m_param name="onclick"/>">
<inp2:m_if check="{$prefix}_HasParam" name="hint_label"><inp2:m_phrase label="$hint_label"/></inp2:m_if>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_checkbox_item"/>
<input type="checkbox" <inp2:m_param name="checked"/> id="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>" onclick="update_checkbox_options(/^<inp2:$prefix_InputName field="$field" as_preg="1"/>_([0-9A-Za-z-]+)/, '<inp2:$prefix_InputName field="$field"/>');"><label for="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_param name="option"/></label>&nbsp;
<inp2:m_blockend/>
<inp2:m_block name="inp_checkbox_phrase"/>
<input type="checkbox" <inp2:m_param name="checked"/> id="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>" onclick="update_checkbox_options(/^<inp2:$prefix_InputName field="$field" as_preg="1"/>_([0-9A-Za-z-]+)/, '<inp2:$prefix_InputName field="$field"/>');"><label for="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_phrase label="$option"/></label>&nbsp;
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_checkboxes" is_last=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<inp2:m_if check="m_ParamEquals" name="use_phrases" value="1">
<inp2:$prefix_PredefinedOptions field="$field" no_empty="$no_empty" tabindex="$pass_tabindex" hint_label="$hint_label" block="inp_checkbox_phrase" selected="checked"/>
<inp2:m_else/>
<inp2:$prefix_PredefinedOptions field="$field" no_empty="$no_empty" tabindex="$pass_tabindex" hint_label="$hint_label" block="inp_checkbox_item" selected="checked"/>
</inp2:m_if>
<inp2:m_ParseBlock prefix="$prefix" name="inp_edit_hidden" field="$field"/>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_checkbox_allow_html"/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<td colspan="2">
<label for="_cb_<inp2:m_param name="field"/>"><inp2:m_phrase label="la_enable_html"/></label>
<input type="hidden" id="<inp2:$prefix_InputName field="$field"/>" name="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field"/>">
<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:m_param name="field"/>" name="_cb_<inp2:m_param name="field"/>" <inp2:$prefix_Field field="$field" checked="checked"/> class="<inp2:m_param name="field_class"/>" onclick="update_checkbox(this, document.getElementById('<inp2:$prefix_InputName field="$field"/>'))">
<br>
<span class="hint"><img src="img/smicon7.gif" width="14" height="14" align="absmiddle"><inp2:m_phrase label="la_Warning_Enable_HTML"/></span>
</td>
<td>&nbsp;</td>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_weight" subfield="" class="" is_last="" maxlength=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" subfield="$subfield" title="$title" is_last="$is_last"/>
<td>
<inp2:m_if check="lang.current_FieldEquals" field="UnitSystem" value="1">
<input type="text" name="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" id="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" value="<inp2:$prefix_Field field="$field" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
<inp2:m_phrase label="la_kg" />
</inp2:m_if>
<inp2:m_if check="lang.current_FieldEquals" field="UnitSystem" value="2">
<input type="text" name="<inp2:$prefix_InputName field="{$field}_a" subfield="$subfield"/>" id="<inp2:$prefix_InputName field="{$field}_a" subfield="$subfield"/>" value="<inp2:$prefix_Field field="{$field}_a" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
<inp2:m_phrase label="la_lbs" />
<input type="text" name="<inp2:$prefix_InputName field="{$field}_b" subfield="$subfield"/>" id="<inp2:$prefix_InputName field="{$field}_b" subfield="$subfield"/>" value="<inp2:$prefix_Field field="{$field}_b" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
<inp2:m_phrase label="la_oz" />
</inp2:m_if>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend />
<inp2:m_DefineElement name="ajax_progress_bar">
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<tr class="table_color1">
<td colspan="2">
<img src="img/spacer.gif" height="10" width="1" alt="" /><br />
<!-- progress bar paddings: begin -->
<table width="90%" cellpadding="2" cellspacing="0" border="0" align="center">
<tr>
<td class="progress-text">0%</td>
<td width="100%">
<!-- progress bar: begin -->
<table cellspacing="0" cellpadding="0" width="100%" border="0" align="center" style="background-color: #FFFFFF; border: 1px solid #E6E6E6;">
<tr>
<td colspan="3"><img src="img/spacer.gif" height="2" width="1" alt="" /></td>
</tr>
<tr>
<td width="2"><img src="img/spacer.gif" height="13" width="3" alt="" /></td>
<td align="center" width="100%">
<table cellspacing="0" cellpadding="0" width="100%" border="0" style="background: url(img/progress_left.gif) repeat-x;">
<tr>
<td id="progress_bar[done]" style="background: url(img/progress_done.gif);" align="left"></td>
<td id="progress_bar[left]" align="right"><img src="img/spacer.gif" height="9" width="1" alt="" /></td>
</tr>
</table>
</td>
<td width="1"><img src="img/spacer.gif" height="13" width="3" alt="" /></td>
</tr>
<tr>
<td colspan="3"><img src="img/spacer.gif" height="2" width="1" alt="" /></td>
</tr>
</table>
<!-- progress bar: end -->
</td>
<td class="progress-text">100%</td>
</tr>
</table>
<!-- progress bar paddings: end -->
<img src="img/spacer.gif" height="10" width="1" alt="" /><br />
</td>
</tr>
<tr class="table_color2">
<td width="50%" align="right"><inp2:m_phrase name="la_fld_PercentsCompleted"/>:</td>
<td id="progress_display[percents_completed]">0%</td>
</tr>
<tr class="table_color1">
<td align="right"><inp2:m_phrase name="la_fld_ElapsedTime"/>:</td>
<td id="progress_display[elapsed_time]">00:00</td>
</tr>
<tr class="table_color2">
<td align="right"><inp2:m_phrase name="la_fld_EstimatedTime"/>:</td>
<td id="progress_display[Estimated_time]">00:00</td>
</tr>
<tr class="table_color1">
<td align="center" colspan="2">
<input type="button" class="button" onclick="<inp2:m_param name="cancel_action"/>" value="<inp2:m_phrase name="la_Cancel"/>" />
</td>
</tr>
</table>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="ml_selector" prefix="">
</inp2:m_DefineElement>
Property changes on: trunk/core/admin_templates/incs/form_blocks.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.7
\ No newline at end of property
Index: trunk/core/admin_templates/incs/tab_blocks.tpl
===================================================================
--- trunk/core/admin_templates/incs/tab_blocks.tpl (revision 7634)
+++ trunk/core/admin_templates/incs/tab_blocks.tpl (revision 7635)
@@ -1,58 +1,58 @@
<inp2:m_block name="init_tab"/>
<inp2:m_if prefix="m" function="is_active" templ="$t$"/>
<inp2:m_set main_prefix="$main_prefix"/>
<inp2:m_endif/>
<inp2:m_blockend/>
<inp2:m_block name="prepare_tab"/>
<inp2:m_if prefix="m" function="is_active" templ="$t$"/>
<inp2:m_set active="active_" bgcolor="#FFA916" class="tab"/>
<inp2:m_else/>
<inp2:m_set active="" bgcolor="#009FF0" class="tab2"/>
<inp2:m_endif/>
<inp2:m_blockend/>
<inp2:m_block name="tab"/>
<inp2:m_ParseBlock name="prepare_tab" t="$t"/>
<td>
- <table style="background: <inp2:m_get param="bgcolor"/> <inp2:m_if check="m_Param name="active">url(img/tab_active_back3.jpg) no-repeat top left;</inp2:m_if>" cellpadding="0" cellspacing="0" border="0">
+ <table style="background: <inp2:m_get param="bgcolor"/> <inp2:m_if check="m_Param" name="active">url(img/tab_active_back3.jpg) no-repeat top left;</inp2:m_if>" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img alt="" src="img/tab_<inp2:m_get param="active"/>left.gif" width="15" height="23"></td>
<td nowrap align="center" style="border-top: 1px solid #000000;">
<a href="javascript:go_to_tab('<inp2:m_param name="main_prefix"/>', '<inp2:m_param name="t"/>')" class="<inp2:m_get param="class"/>" onClick=""><inp2:m_phrase name="$title"/></a><br>
</td>
<td><img alt="" src="img/tab_<inp2:m_get param="active"/>right.gif" width="15" height="23"></td>
</tr>
</table>
</td>
<inp2:m_blockend/>
<inp2:m_block name="tab_direct" pass="m"/>
<inp2:m_ParseBlock name="prepare_tab" t="$t"/>
<td>
- <table style="background: <inp2:m_get param="bgcolor"/> <inp2:m_if check="m_Param name="active">url(img/tab_active_back3.jpg) no-repeat top left;</inp2:m_if>" cellpadding="0" cellspacing="0" border="0">
+ <table style="background: <inp2:m_get param="bgcolor"/> <inp2:m_if check="m_Param" name="active">url(img/tab_active_back3.jpg) no-repeat top left;</inp2:m_if>" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img alt="" src="img/tab_<inp2:m_get param="active"/>left.gif" width="15" height="23"></td>
<td nowrap align="center" style="border-top: 1px solid #000000;">
<a href="<inp2:m_t t="$t" pass="$pass"/>" class="<inp2:m_get param="class"/>" onClick=""><inp2:m_phrase name="$title"/></a><br>
</td>
<td><img alt="" src="img/tab_<inp2:m_get param="active"/>right.gif" width="15" height="23"></td>
</tr>
</table>
</td>
<inp2:m_blockend/>
<inp2:m_block name="tab_list"/>
<inp2:m_ParseBlock name="prepare_tab" t="$t"/>
<td>
- <table style="background: <inp2:m_get param="bgcolor"/> <inp2:m_if check="m_Param name="active">url(img/tab_active_back3.jpg) no-repeat top left;</inp2:m_if>" cellpadding="0" cellspacing="0" border="0">
+ <table style="background: <inp2:m_get param="bgcolor"/> <inp2:m_if check="m_Param" name="active">url(img/tab_active_back3.jpg) no-repeat top left;</inp2:m_if>" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img alt="" src="img/tab_<inp2:m_get param="active"/>left.gif" width="15" height="23"></td>
<td nowrap align="center" <inp2:m_if check="m_getequals" name="active" value="active_">style="border-top: black 1px solid;"</inp2:m_if> background="img/tab_<inp2:m_get param="active"/>back.gif">
<a href="javascript:go_to_list('<inp2:m_get param="main_prefix"/>', '<inp2:m_param name="t"/>')" class="<inp2:m_get param="class"/>" onClick=""><inp2:m_phrase name="$title"/></a><br>
</td>
<td><img alt="" src="img/tab_<inp2:m_get param="active"/>right.gif" width="15" height="23"></td>
</tr>
</table>
</td>
<inp2:m_blockend/>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/incs/tab_blocks.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/core/admin_templates/tree.tpl
===================================================================
--- trunk/core/admin_templates/tree.tpl (revision 7634)
+++ trunk/core/admin_templates/tree.tpl (revision 7635)
@@ -1,125 +1,125 @@
<inp2:m_Set skip_last_template="1"/>
<inp2:m_include t="incs/header" nobody="yes" noform="yes"/>
<inp2:m_NoDebug/>
<body style="margin: 0px; height: 100%" bgcolor="#DCEBF6">
<inp2:m_RenderElement name="kernel_form"/>
<script type="text/javascript">
function credits(url)
{
var width = 200;
var height = 200;
var screen_x = (screen.availWidth-width)/2;
var screen_y = (screen.availHeight-height)/2;
window.open(url, 'credits', 'width=280,height=520,left='+screen_x+',top='+screen_y);
}
</script>
<script src="js/ajax.js"></script>
<script src="js/tree.js"></script>
<style type="text/css">
.tree_head.td, .tree_head, .tree_head:hover {
font-weight: bold;
font-size: 10px;
color: #FFFFFF;
font-family: Verdana, Arial;
text-decoration: none;
}
.tree {
padding: 0px;
border: none;
border-collapse: collapse;
}
.tree tr td {
padding: 0px;
margin: 0px;
font-family: helvetica, arial, verdana,;
font-size: 11px;
white-space: nowrap;
}
.tree tr td a {
font-size: 11px;
color: #000000;
font-family: Helvetica, Arial, Verdana;
text-decoration: none;
}
.tree tr td a:hover {
color: #009FF0;
}
</style>
<table style="height: 100%; width: 100%; border-collapse: collapse;" border="0">
<tr style="background: #5291DE url(img/menu_bar.gif) repeat-x left bottom;" class="tree_head">
<td align="left" width="80%" height="21">
&nbsp;<a class="tree_head" href="javascript:credits('<inp2:m_Link index_file="help/credits.php" destform="popup"/>');">In-Portal v <inp2:adm_ModuleVersion module="In-Portal"/></a>
</td>
<td align="right" width="20%">
<select name="language" style="width: 62px; border: 0px; background-color: #FFFFFF; font-size: 9px; color: black;" onchange="submit_event('lang', 'OnChangeLanguage', 'index');">
<inp2:m_DefineElement name="lang_elem">
<option value="<inp2:Field name="LanguageId"/>" <inp2:m_if check="SelectedLanguage">selected="selected"</inp2:m_if> ><inp2:Field name="PackName"/></option>
</inp2:m_DefineElement>
<inp2:lang_ListLanguages render_as="lang_elem" row_start_render_as="html:" row_end_render_as="html:"/>
</select>
</td>
</tr>
<tr>
<td colspan="2" style="vertical-align: top; padding: 5px;">
<inp2:m_DefineElement name="xml_node" icon_module="">
<inp2:m_if check="m_ParamEquals" param="children_count" value="0">
- <item href="<inp2:m_param name="section_url"/>" onclick="<inp2:m_param name="onclick"/>" icon="<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.gif"><inp2:m_phrase name="$label" escape="1"/></item>
+ <item href="<inp2:m_param name="section_url"/>" priority="<inp2:m_param name="priority"/>" onclick="<inp2:m_param name="onclick"/>" icon="<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.gif"><inp2:m_phrase name="$label" escape="1"/></item>
<inp2:m_else/>
- <folder href="<inp2:m_param name="section_url"/>" onclick="<inp2:m_param name="onclick"/>" name="<inp2:m_phrase name="$label" escape="1"/>" icon="<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.gif" load_url="<inp2:m_param name="late_load"/>"><inp2:adm_PrintSections render_as="xml_node" section_name="$section_name"/></folder>
+ <folder href="<inp2:m_param name="section_url"/>" priority="<inp2:m_param name="priority"/>" onclick="<inp2:m_param name="onclick"/>" name="<inp2:m_phrase name="$label" escape="1"/>" icon="<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.gif" load_url="<inp2:m_param name="late_load"/>"><inp2:adm_PrintSections render_as="xml_node" section_name="$section_name"/></folder>
</inp2:m_if>
</inp2:m_DefineElement>
<table class="tree">
<tbody id="tree">
</tbody>
</table>
<script type="text/javascript">
var TREE_ICONS_PATH = 'img/tree';
-
+ var TREE_SHOW_PRIORITY = <inp2:m_if check="adm_ConstOn" name="DBG_SHOW_TREE_PRIORITY" debug_mode="1">1<inp2:m_else/>0</inp2:m_if>;
<inp2:m_DefineElement name="root_node">
- var the_tree = new TreeFolder('tree', '<inp2:m_param name="label"/>', '<inp2:m_param name="section_url"/>', '<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.gif');
+ var the_tree = new TreeFolder('tree', '<inp2:m_param name="label"/>', '<inp2:m_param name="section_url"/>', '<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.gif', null, null, '<inp2:m_param name="priority"/>');
</inp2:m_DefineElement>
<inp2:adm_PrintSection render_as="root_node" section_name="in-portal:root"/>
the_tree.AddFromXML('<tree><inp2:adm_PrintSections render_as="xml_node" section_name="in-portal:root"/></tree>');
</script>
</td>
</tr>
</table>
<inp2:m_include t="incs/footer"/>
<script type="text/javascript">
// when changing language submit is made to frameset, not the current frame
var $kf = document.getElementById($form_name);
$kf.target = 'main_frame';
function checkCatalog($cat_id) {
var $ret = checkEditMode();
var $right_frame = getFrame('main');
if ($ret && $right_frame.$is_catalog) {
$right_frame.$Catalog.go_to_cat($cat_id);
return 1; // this opens folder, but disables click
}
return $ret;
}
function checkEditMode()
{
var $phrase = "<inp2:adm_TreeEditWarrning label="la_EditingInProgress" escape="1"/>";
if (getFrame('main').$edit_mode) {
return confirm($phrase) ? true : false;
}
return true;
}
</script>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/tree.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/core/admin_templates/regional/languages_list.tpl
===================================================================
--- trunk/core/admin_templates/regional/languages_list.tpl (revision 7634)
+++ trunk/core/admin_templates/regional/languages_list.tpl (revision 7635)
@@ -1,69 +1,69 @@
<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
<inp2:m_include t="incs/header"/>
<inp2:m_ParseBlock name="section_header" icon="icon46_conf_regional" title="!la_title_Regional!"/>
<inp2:m_ParseBlock name="blue_bar" prefix="lang" title_preset="languages_list" 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">
//do not rename - this function is used in default grid for double click!
function edit()
{
std_edit_item('lang', 'regional/languages_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_language', '<inp2:m_phrase label="la_ToolTip_NewLanguage" escape="1"/>::<inp2:m_phrase label="la_Add" escape="1"/>',
function() {
std_precreate_item('lang', 'regional/languages_edit')
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('lang')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
- a_toolbar.AddButton( new ToolBarButton('primary_language', '<inp2:m_phrase label="la_ToolTip_SetPrimaryLanguage" escape="1"/>', function() {
+ a_toolbar.AddButton( new ToolBarButton('primary_language', '<inp2:m_phrase label="la_ToolTip_SetPrimaryLanguage" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_SetPrimary" escape="1"/>', function() {
submit_event('lang','OnSetPrimary');
}
) );
- a_toolbar.AddButton( new ToolBarButton('import_language', '<inp2:m_phrase label="la_ToolTip_ImportLanguage" escape="1"/>', function() {
+ a_toolbar.AddButton( new ToolBarButton('import_language', '<inp2:m_phrase label="la_ToolTip_ImportLanguage" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Import" escape="1"/>', function() {
redirect('<inp2:m_t t="regional/languages_import" phrases.import_event="OnNew" m_opener="d" pass="all,m,phrases.import" />');
}
) );
- a_toolbar.AddButton( new ToolBarButton('export_language', '<inp2:m_phrase label="la_ToolTip_ExportLanguage" escape="1"/>', function() {
+ a_toolbar.AddButton( new ToolBarButton('export_language', '<inp2:m_phrase label="la_ToolTip_ExportLanguage" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Export" escape="1"/>', function() {
submit_event('lang','OnExportLanguage');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_ParseBlock name="grid" PrefixSpecial="lang" IdField="LanguageId" grid="Default" menu_filters="yes"/>
<script type="text/javascript">
Grids['lang'].SetDependantToolbarButtons( new Array('edit','delete','primary_language','export_language') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/regional/languages_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/admin_templates/regional/phrases_edit.tpl
===================================================================
--- trunk/core/admin_templates/regional/phrases_edit.tpl (revision 7634)
+++ trunk/core/admin_templates/regional/phrases_edit.tpl (revision 7635)
@@ -1,60 +1,60 @@
<inp2:adm_SetPopupSize width="888" height="415"/>
<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
<inp2:m_include t="incs/header"/>
<inp2:m_ParseBlock name="section_header" icon="icon46_conf_regional" title="!la_title_RegionalSettings!"/>
<inp2:m_ParseBlock name="blue_bar" prefix="phrases" title_preset="phrase_edit" 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('phrases','<inp2:phrases_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
- cancel_edit('phrases','OnCancelEdit','<inp2:st_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
+ cancel_edit('phrases','OnCancelEdit','<inp2:phrases_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
reset_form('phrases', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:phrases_SaveWarning name="grid_save_warning"/>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<input type="hidden" id="phrases_label" name="phrases_label" value="<inp2:m_get name="phrases_label"/>">
<inp2:m_DefineElement name="phrase_element">
<tr class="subsectiontitle">
<td colspan="3"><inp2:phrases_Field name="Phrase"/></td>
</tr>
<inp2:m_ParseBlock name="inp_edit_hidden" prefix="phrases" field="LanguageId"/>
<inp2:m_ParseBlock name="inp_label" prefix="phrases" field="PrimaryTranslation" title="!la_fld_PrimaryTranslation!"/>
<inp2:m_ParseBlock name="inp_edit_box" prefix="phrases" field="Phrase" title="!la_fld_Phrase!" size="60"/>
<inp2:m_ParseBlock name="inp_edit_textarea" prefix="phrases" field="Translation" title="!la_fld_Translation!" rows="7" cols="50" allow_html="0"/>
<inp2:m_ParseBlock name="inp_edit_radio" prefix="phrases" field="PhraseType" title="!la_fld_PhraseType!"/>
<inp2:m_ParseBlock name="inp_edit_options" prefix="phrases" field="Module" title="!la_fld_Module!"/>
</inp2:m_DefineElement>
<inp2:m_if check="m_GetEquals" name="phrases_label" value="ALEX, FIX IT!">
<inp2:phrases_MultipleEditing render_as="phrase_element"/>
<inp2:m_else/>
<inp2:m_RenderElement name="phrase_element"/>
</inp2:m_if>
</table>
<inp2:m_include t="incs/footer"/>
Property changes on: trunk/core/admin_templates/regional/phrases_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/admin_templates/users/group_selector.tpl
===================================================================
--- trunk/core/admin_templates/users/group_selector.tpl (nonexistent)
+++ trunk/core/admin_templates/users/group_selector.tpl (revision 7635)
@@ -0,0 +1,46 @@
+<inp2:adm_SetPopupSize width="582" height="504"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+
+<inp2:m_ParseBlock name="blue_bar" prefix="g" title_preset="select_group" module="custom" 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"/>', edit) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ window.close();
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+
+ a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
+ show_viewmenu(a_toolbar,'view');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ function edit()
+ {
+ set_hidden_field('remove_specials[g.user]', 1);
+ submit_event('<inp2:m_recall name="main_prefix"/>', 'OnProcessSelected');
+ }
+ </script>
+
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_ParseBlock name="grid" PrefixSpecial="g.user" IdField="GroupId" grid="GroupSelector"/>
+<script type="text/javascript">
+ Grids['g.user'].SetDependantToolbarButtons( new Array('select') );
+</script>
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/users/group_selector.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/config/config_universal.tpl
===================================================================
--- trunk/core/admin_templates/config/config_universal.tpl (revision 7634)
+++ trunk/core/admin_templates/config/config_universal.tpl (revision 7635)
@@ -1,91 +1,92 @@
<inp2:m_RequireLogin perm_event="conf:OnLoad" system="1"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_ParseBlock name="section_header" prefix="conf" icon="icon46_settings_#section#" title="!la_tab_Config#section#!"/>
-<inp2:m_ParseBlock name="blue_bar" prefix="conf" title_preset="config_list_#section#" icon="icon46_settings_#section#"/>
+<inp2:m_Get var="section" result_to_var="section"/>
+<inp2:conf_InitList name="default" per_page="-1" />
+<inp2:m_RenderElement name="combined_header" section="$section" prefix="conf" title_preset=""/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
function ValidatePassFld(fieldId){
var passFld=document.getElementById(fieldId);
var passVerifyFld=document.getElementById('verify_'+fieldId);
if (passFld && passVerifyFld && passFld.value == passVerifyFld.value) {
return true;
}
else {
var passErrorCell=document.getElementById('error_'+fieldId);
if (passErrorCell){
passErrorCell.innerHTML='<inp2:m_phrase name="la_error_PasswordMatch" />';
}
return false;
}
}
function ValidatePassFields(){
var el=false;
var validated=true;
for (var i=0; i<document.forms.kernel_form.elements.length; i++){
el=document.forms.kernel_form.elements[i];
if (el.getAttribute('primarytype')=='password'){
if (!ValidatePassFld(el.id)){
validated=false;
}
}
}
return validated;
}
function toggle_section($label) {
var $table = document.getElementById('config_table');
var $row = null;
var $is_visible = false;
for (var $i = 0; $i < $table.rows.length; $i++) {
$row = $table.rows[$i];
if ($row.getAttribute('header_label') != $label) {
continue;
}
if (!$row.style.display) {
$row.style.display = document.all ? 'block' : 'table-row';
}
$is_visible = !($row.style.display == 'none');
$row.style.display = $is_visible ? 'none' : (document.all ? 'block' : 'table-row');
document.getElementById('toggle_mark['+$label+']').innerHTML = '[' + ($is_visible ? '+' : '-') + ']';
}
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
if (ValidatePassFields()){
submit_event('conf','<inp2:conf_SaveEvent/>');
}
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('conf','OnCancel');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_include t="incs/config_blocks"/>
<inp2:conf_SaveWarning name="grid_save_warning"/>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder" id="config_table">
- <inp2:conf_PrintList block="config_block" per_page="-1" full_block="config_block" half_block1="config_block1" half_block2="config_block2"/>
+ <inp2:conf_PrintList list_name="default" block="config_block" full_block="config_block" half_block1="config_block1" half_block2="config_block2"/>
</table>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/config/config_universal.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/admin_templates/modules/modules_list.tpl
===================================================================
--- trunk/core/admin_templates/modules/modules_list.tpl (nonexistent)
+++ trunk/core/admin_templates/modules/modules_list.tpl (revision 7635)
@@ -0,0 +1,56 @@
+<inp2:m_RequireLogin permissions="in-portal:mod_status.view" system="1"/>
+<inp2:m_include t="incs/header" />
+
+<inp2:m_ParseBlock name="section_header" icon="icon46_modules" title="!la_title_Module_Status!"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="mod" title_preset="modules_list" module="in-portal" icon="icon46_modules"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ //do not rename - this function is used in default grid for double click!
+ function edit()
+ {
+
+ }
+
+ var a_toolbar = new ToolBar();
+
+ a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Enable" escape="1"/>', function() {
+ submit_event('mod','OnMassApprove');
+ }
+ ) );
+
+
+ a_toolbar.AddButton( new ToolBarButton('deny', '<inp2:m_phrase label="la_ToolTip_Disable" escape="1"/>', function() {
+ submit_event('mod','OnMassDecline');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
+ show_viewmenu(a_toolbar,'view');
+ }
+ ) );
+
+ a_toolbar.Render();
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_ParseBlock name="grid" PrefixSpecial="mod" IdField="Name" grid="Default" menu_filters="yes"/>
+<script type="text/javascript">
+ Grids['mod'].SetDependantToolbarButtons( new Array('approve','deny') );
+ <inp2:m_if check="m_GetEquals" name="RefreshTree" value="1">
+ var $tree_frame = getFrame('menu');
+ $tree_frame.location = $tree_frame.location;
+ </inp2:m_if>
+</script>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/modules/modules_list.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/catalog/item_selector/item_selector_catalog.tpl
===================================================================
--- trunk/core/admin_templates/catalog/item_selector/item_selector_catalog.tpl (revision 7634)
+++ trunk/core/admin_templates/catalog/item_selector/item_selector_catalog.tpl (revision 7635)
@@ -1,112 +1,112 @@
<inp2:m_include t="incs/header" nobody="yes" noform="yes"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF" onload="$Catalog.Init();">
<inp2:m_ParseBlock name="section_header" prefix="c" icon="icon46_catalog" module="in-portal" title="!la_title_Browse!"/>
<inp2:m_include t="in-portal/item_selector/item_selector_tabs"/>
<inp2:m_ParseBlock name="blue_bar" prefix="c" title_preset="catalog" module="in-portal"/>
<!-- main kernel_form: begin -->
<inp2:m_RenderElement name="kernel_form"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<input type="hidden" name="m_cat_id" value="<inp2:m_get name="m_cat_id"/>"/>
<inp2:m_include t="in-portal/item_selector/item_selector_toolbar" is_catalog="1"/>
<script type="text/javascript">
var $Catalog = new Catalog('<inp2:m_Link template="#TEMPLATE_NAME#" m_cat_id="#CATEGORY_ID#" no_amp="1"/>', 'is_catalog_');
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="kernel_form_end"/>
<!-- main kernel_form: end -->
<!-- category list: begin -->
<table id="c_search_warning" width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_notop" style="display: none">
<tr>
<td valign="top" class="hint_red">
<inp2:m_phrase name="la_Warning_Filter"/>
</td>
</tr>
</table>
<inp2:m_set t="in-portal/xml/categories_list"/>
<inp2:m_RenderElement name="kernel_form" form_name="categories_form"/>
<table class="toolbar" cellspacing="0" cellpadding="2" width="100%" border="0" class="tableborder_full_a">
<tr bgcolor="#e0e0da" height="20">
<td width="100%" valign="middle">
<img height="15" src="img/arrow.gif" width="15" align="absmiddle" border="0"><span id="category_path"></span>
</td>
- <td align="right">
- <table cellspacing="0" cellpadding="0" border="0">
+ <td align="right" class="search-cell" >
+ <table cellspacing="0" cellpadding="0" border="0" style="width: 270px">
<tr>
<td>Search:&nbsp;</td>
<td>
<input type="text" id="c_search_keyword" name="c_search_keyword" value="" PrefixSpecial="c" Grid="Default" ajax="1" style="border: 1px solid grey;">
<input type="text" style="display: none"; />
</td>
<td id="search_buttons[c]">
<script type="text/javascript">
<inp2:m_RenderElement name="grid_search_buttons" PrefixSpecial="c" grid="Default" ajax="1"/>
</script>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div id="categories_div" prefix="c" view_template="in-portal/xml/categories_list" edit_template="in-portal/categories/categories_edit" dep_buttons="" class="catalog-tab" style="display: block;"></div>
<inp2:m_RenderElement name="kernel_form_end"/>
<inp2:m_set t="in-portal/catalog"/>
<script type="text/javascript">$Catalog.registerTab('categories');</script>
<!-- categories list: end -->
<!-- item tabs: begin -->
<table cellpadding="0" cellspacing="0">
<tr>
<inp2:m_DefineElement name="item_tab" title="">
<td nowrap="nowrap" width="140">
<table id="<inp2:m_param name="prefix"/>_tab" cellpadding="0" cellspacing="0" width="100%" class="catalog-tab-unselected" onclick="$Catalog.switchTab('<inp2:m_param name="prefix"/>');">
<tr>
<td class="catalog-tab-left">
<img src="img/spacer.gif" height="22" width="9" />
</td>
<td class="catalog-tab-middle" width="100%" valign="middle" nowrap="nowrap">
<inp2:m_phrase name="$title"/> <span class="cats_stats">(<span id="<inp2:m_param name="prefix"/>_item_count">?</span>)</span>
</td>
<td class="catalog-tab-right">
<img src="img/spacer.gif" height="22" width="9" />
</td>
<td style="background-color: #FFFFFF;">
<img src="img/spacer.gif" height="1" width="5" />
</td>
</tr>
</table>
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="tab_headers">
<inp2:adm_ListCatalogTabs render_as="item_tab" title_property="ViewMenuPhrase" skip_prefixes="$skip_prefixes"/>
</inp2:m_DefineElement>
<inp2:c_InitCatalog render_as="tab_headers" skip_prefixes="m"/>
</tr>
</table>
<!-- item tabs: end -->
<inp2:m_DefineElement name="tab_bodies">
<inp2:m_ModuleInclude template="catalog_tab" tab_init="2" skip_prefixes="$skip_prefixes"/>
</inp2:m_DefineElement>
<inp2:c_InitCatalog render_as="tab_bodies" skip_prefixes="m"/>
<inp2:m_include t="incs/footer" noform="yes"/>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/catalog/item_selector/item_selector_catalog.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/core/admin_templates/catalog/item_selector/item_selector_toolbar.tpl
===================================================================
--- trunk/core/admin_templates/catalog/item_selector/item_selector_toolbar.tpl (revision 7634)
+++ trunk/core/admin_templates/catalog/item_selector/item_selector_toolbar.tpl (revision 7635)
@@ -1,68 +1,68 @@
<script type="text/javascript" src="js/ajax.js"></script>
<link rel="stylesheet" rev="stylesheet" href="incs/nlsmenu.css" type="text/css" />
<script type="text/javascript" src="js/nlsmenu.js"></script>
<script type="text/javascript" src="js/nlsmenueffect_1_2_1.js"></script>
<script type="text/javascript" src="<inp2:m_TemplatesBase module="in-portal"/>/incs/catalog.js"></script>
<script type="text/javascript">
var menuMgr = new NlsMenuManager("mgr");
menuMgr.timeout = 500;
menuMgr.flowOverFormElement = true;
Request.progressText = '<inp2:m_phrase name="la_title_Loading" escape="1"/>';
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
<inp2:m_if check="m_ParamEquals" name="is_catalog" value="1">
active_selected = '';
if (Grids[$Catalog.ActivePrefix]) {
active_selected = Grids[$Catalog.ActivePrefix].GetSelected();
set_hidden_field('selected_ids[' + $Catalog.ActivePrefix + ']', active_selected);
}
if (active_selected.length == 0) {
var $category_ids = Grids['c'].GetSelected();
if ($category_ids.length == 0) {
// no categories selected, then use current category
$category_ids = get_hidden_field('m_cat_id');
}
set_hidden_field('selected_ids[c]', $category_ids);
}
<inp2:m_else/>
var $prefix = $Catalog.ActivePrefix.replace('.<inp2:m_get name="ts"/>', '');
set_hidden_field('selected_ids[' + $prefix + ']', Grids[$Catalog.ActivePrefix].GetSelected());
</inp2:m_if>
- submit_event('<inp2:m_get name="main_prefix"/>', 'OnProcessSelected');
+ submit_event('<inp2:m_Recall name="main_prefix"/>', 'OnProcessSelected');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
window.close();
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
<inp2:m_if check="m_ParamEquals" name="is_catalog" value="1">
a_toolbar.AddButton( new ToolBarButton('upcat', '<inp2:m_phrase label="la_ToolTip_Up" escape="1"/>', function() {
$Catalog.go_to_cat($Catalog.ParentCategoryID);
}
) );
a_toolbar.AddButton( new ToolBarButton('homecat', '<inp2:m_phrase label="la_ToolTip_Home" escape="1"/>', function() {
$Catalog.go_to_cat(0);
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
</inp2:m_if>
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar, 'view');
}
) );
a_toolbar.Render();
function edit()
{
}
</script>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/catalog/item_selector/item_selector_toolbar.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property
Index: trunk/core/admin_templates/js/script.js
===================================================================
--- trunk/core/admin_templates/js/script.js (revision 7634)
+++ trunk/core/admin_templates/js/script.js (revision 7635)
@@ -1,1246 +1,1320 @@
if ( !( isset($init_made) && $init_made ) ) {
var Grids = new Array();
var Toolbars = new Array();
var $Menus = new Array();
var $ViewMenus = new Array();
var $nls_menus = new Array();
var $MenuNames = new Array();
var $form_name = 'kernel_form';
if(!$fw_menus) var $fw_menus = new Array();
var $env = '';
var submitted = false;
var $edit_mode = false;
var $init_made = true; // in case of double inclusion of script.js :)
// hook processing
var hBEFORE = 1; // this is const, but including this twice causes errors
var hAFTER = 2; // this is const, but including this twice causes errors
var $hooks = new Array();
}
function use_popups($prefix_special, $event) {
return $use_popups;
}
function getArrayValue()
{
var $value = arguments[0];
var $current_key = 0;
$i = 1;
while ($i < arguments.length) {
$current_key = arguments[$i];
if (isset($value[$current_key])) {
$value = $value[$current_key];
}
else {
return false;
}
$i++;
}
return $value;
}
function setArrayValue()
{
// first argument - array, other arguments - keys (arrays too), last argument - value
var $array = arguments[0];
var $current_key = 0;
$i = 1;
while ($i < arguments.length - 1) {
$current_key = arguments[$i];
if (!isset($array[$current_key])) {
$array[$current_key] = new Array();
}
$array = $array[$current_key];
$i++;
}
$array[$array.length] = arguments[arguments.length - 1];
}
function processHooks($function_name, $hook_type, $prefix_special)
{
var $i = 0;
var $local_hooks = getArrayValue($hooks, $function_name, $hook_type);
while($i < $local_hooks.length) {
$local_hooks[$i]($function_name, $prefix_special);
$i++;
}
}
function registerHook($function_name, $hook_type, $hook_body)
{
setArrayValue($hooks, $function_name, $hook_type, $hook_body);
}
function resort_grid($prefix_special, $field, $ajax)
{
set_form($prefix_special, $ajax);
set_hidden_field($prefix_special + '_Sort1', $field);
submit_event($prefix_special, 'OnSetSorting', null, null, $ajax);
}
function direct_sort_grid($prefix_special, $field, $direction, $field_pos, $ajax)
{
if(!isset($field_pos)) $field_pos = 1;
set_form($prefix_special, $ajax);
set_hidden_field($prefix_special+'_Sort'+$field_pos,$field);
set_hidden_field($prefix_special+'_Sort'+$field_pos+'_Dir',$direction);
set_hidden_field($prefix_special+'_SortPos',$field_pos);
submit_event($prefix_special,'OnSetSortingDirect', null, null, $ajax);
}
function reset_sorting($prefix_special)
{
submit_event($prefix_special,'OnResetSorting');
}
function set_per_page($prefix_special, $per_page, $ajax)
{
set_form($prefix_special, $ajax);
set_hidden_field($prefix_special + '_PerPage', $per_page);
submit_event($prefix_special, 'OnSetPerPage', null, null, $ajax);
}
function submit_event(prefix_special, event, t, form_action, $ajax)
{
if ($ajax) {
return $Catalog.submit_event(prefix_special, event, t);
}
if (event) {
set_hidden_field('events[' + prefix_special + ']', event);
}
if (t) set_hidden_field('t', t);
if (form_action) {
var old_env = '';
if (!form_action.match(/\?/)) {
document.getElementById($form_name).action.match(/.*(\?.*)/);
old_env = RegExp.$1;
}
document.getElementById($form_name).action = form_action + old_env;
}
submit_kernel_form();
}
function submit_action($url, $action)
{
$form = document.getElementById($form_name);
$form.action = $url;
set_hidden_field('Action', $action);
submit_kernel_form();
}
function show_form_data()
{
var $kf = document.getElementById($form_name);
$ret = '';
for(var i in $kf.elements)
{
$elem = $kf.elements[i];
$ret += $elem.id + ' = ' + $elem.value + "\n";
}
alert($ret);
}
function submit_kernel_form()
{
if (submitted) {
return;
}
submitted = true;
var $form = document.getElementById($form_name);
processHooks('SubmitKF', hBEFORE);
if (typeof $form.onsubmit == "function") {
$form.onsubmit();
}
$form.submit();
processHooks('SubmitKF', hAFTER);
$form.target = '';
set_hidden_field('t', t);
window.setTimeout(function() {submitted = false}, 500);
}
function set_event(prefix_special, event)
{
var event_field=document.getElementById('events[' + prefix_special + ']');
if(isset(event_field))
{
event_field.value = event;
}
}
function isset(variable)
{
if(variable==null) return false;
return (typeof(variable)=='undefined')?false:true;
}
function in_array(needle, haystack)
{
return array_search(needle, haystack) != -1;
}
function array_search(needle, haystack)
{
for (var i=0; i<haystack.length; i++)
{
if (haystack[i] == needle) return i;
}
return -1;
}
function print_pre(variable, msg)
{
if (!isset(msg)) msg = '';
var s = msg;
for (prop in variable) {
s += prop+" => "+variable[prop] + "\n";
}
alert(s);
}
function go_to_page($prefix_special, $page, $ajax)
{
set_form($prefix_special, $ajax);
set_hidden_field($prefix_special + '_Page', $page);
submit_event($prefix_special, null, null, null, $ajax);
}
function go_to_list(prefix_special, tab)
{
set_hidden_field(prefix_special+'_GoTab', tab);
submit_event(prefix_special,'OnUpdateAndGoToTab',null);
}
function go_to_tab(prefix_special, tab)
{
set_hidden_field(prefix_special+'_GoTab', tab);
submit_event(prefix_special,'OnPreSaveAndGoToTab',null);
}
function go_to_id(prefix_special, id)
{
set_hidden_field(prefix_special+'_GoId', id);
submit_event(prefix_special,'OnPreSaveAndGo')
}
// in-portal compatibility functions: begin
function getScriptURL($script_name, tpl)
{
tpl = tpl ? '-'+tpl : '';
var $asid = get_hidden_field('sid');
return base_url+$script_name+'?env='+( isset($env)&&$env?$env:$asid )+tpl+'&en=0';
}
function OpenEditor(extra_env,TargetForm,TargetField)
{
// var $url = getScriptURL('admin/editor/editor_new.php');
var $url = getScriptURL('admin/index.php', 'popups/editor');
// alert($url);
$url = $url+'&TargetForm='+TargetForm+'&TargetField='+TargetField+'&destform=popup';
if(extra_env.length>0) $url += extra_env;
openwin($url,'html_edit',800,575);
}
function OpenUserSelector(extra_env,TargetForm,TargetField)
{
var $url = getScriptURL('admin/users/user_select.php');
$url += '&destform='+TargetForm+'&Selector=radio&destfield='+TargetField+'&IdField=Login';
if(extra_env.length>0) $url += extra_env;
openwin($url,'user_select',800,575);
return false;
}
function OpenCatSelector(extra_env)
{
var $url = getScriptURL('admin/cat_select.php');
if(extra_env.length>0) $url += extra_env;
openwin($url,'catselect',750,400);
}
function OpenItemSelector(extra_env,$TargetForm)
{
var $url = getScriptURL('admin/relation_select.php') + '&destform='+$TargetForm;
if(extra_env.length>0) $url += extra_env;
openwin($url,'groupselect',750,400);
}
function OpenUserEdit($user_id, $extra_env)
{
var $url = getScriptURL('admin/users/adduser.php') + '&direct_id=' + $user_id;
if( isset($extra_env) ) $url += $extra_env;
window.location.href = $url;
}
function OpenLinkEdit($link_id, $extra_env)
{
var $url = getScriptURL('in-link/admin/addlink.php') + '&item=' + $link_id;
if( isset($extra_env) ) $url += $extra_env;
window.location.href = $url;
}
function OpenHelp($help_link)
{
// $help_link.match('http://(.*).lv/in-commerce/admin(.*)');
// alert(RegExp.$2);
openwin($help_link,'HelpPopup',750,400);
}
function openEmailSend($url, $type, $prefix_special)
{
var $kf = document.getElementById($form_name);
var $prev_action = $kf.action;
var $prev_opener = get_hidden_field('m_opener');
$kf.action = $url;
set_hidden_field('m_opener', 'p');
$kf.target = 'sendmail';
set_hidden_field('idtype', 'group');
set_hidden_field('idlist', Grids[$prefix_special].GetSelected().join(',') );
openwin('','sendmail',750,400);
submit_kernel_form();
$kf.action = $prev_action;
set_hidden_field('m_opener', $prev_opener);
}
// in-portal compatibility functions: end
function InitTranslator(prefix, field, t, multi_line)
{
var $kf = document.getElementById($form_name);
var $window_name = 'select_'+t.replace(/(\/|-)/g, '_');
var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)');
$regex = $regex.exec($kf.action);
// set_hidden_field('return_m', $regex[4]);
var $prev_opener = get_hidden_field('m_opener');
if (!isset(multi_line)) multi_line = 0;
openwin('', $window_name, 750, 400);
// set_hidden_field('return_template', $kf.elements['t'].value); // where should return after popup is done
set_hidden_field('m_opener', 'p');
set_hidden_field('translator_wnd_name', $window_name);
set_hidden_field('translator_field', field);
set_hidden_field('translator_t', t);
set_hidden_field('translator_prefixes', prefix);
set_hidden_field('translator_multi_line', multi_line);
$kf.target = $window_name;
return $prev_opener;
}
function PreSaveAndOpenTranslator(prefix, field, t, multi_line)
{
var $prev_opener = InitTranslator(prefix, field, t, multi_line);
var split_prefix = prefix.split(',');
submit_event(split_prefix[0], 'OnPreSaveAndOpenTranslator');
set_hidden_field('m_opener', $prev_opener);
}
function PreSaveAndOpenTranslatorCV(prefix, field, t, resource_id, multi_line)
{
var $prev_opener = InitTranslator(prefix, field, t, multi_line);
set_hidden_field('translator_resource_id', resource_id);
var split_prefix = prefix.split(',');
submit_event(split_prefix[0],'OnPreSaveAndOpenTranslator');
set_hidden_field('m_opener', $prev_opener);
}
function openTranslator(prefix,field,url,wnd)
{
var $kf = document.getElementById($form_name);
set_hidden_field('trans_prefix', prefix);
set_hidden_field('trans_field', field);
set_hidden_field('events[trans]', 'OnLoad');
var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(.*)');
var $t = $regex.exec(url)[3];
$kf.target = wnd;
submit_event(prefix,'',$t,url);
}
function openwin($url,$name,$width,$height)
{
// prevent window from opening larger, then screen resolution on user's computer (to Kostja)
// alert('openwin: name = ['+$name+']');
var left = Math.round((screen.width - $width)/2);
var top = Math.round((screen.height - $height)/2);
cur_x = is.ie ? window.screenLeft : window.screenX;
cur_y = is.ie ? window.screenTop : window.screenY;
// alert('current X,Y: '+cur_x+','+cur_y+' target x,y: '+left+','+top);
var $window_params = 'left='+left+',top='+top+',width='+$width+',height='+$height+',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no';
return window.open($url,$name,$window_params);
}
function OnResizePopup(e) {
if (!document.all) {
var $winW = window.innerWidth;
var $winH = window.innerHeight;
}
else {
var $winW = window.document.body.offsetWidth;
var $winH = window.document.body.offsetHeight;
}
window.status = '[width: ' + $winW + '; height: ' + $winH + ']';
}
function opener_action(new_action)
{
var $prev_opener = get_hidden_field('m_opener');
set_hidden_field('m_opener', new_action);
return $prev_opener;
}
function open_popup($prefix_special, $event, $t, $window_size) {
if (!$window_size) {
// if no size given, then query it from ajax
var $default_size = '750x400';
var $pm = getFrame('head').$popup_manager;
if ($pm) {
// popup manager was found in head frame
$pm.ResponceFunction = function ($responce) {
if (!$responce.match(/([\d]+)x([\d]+)/)) {
// invalid responce was received, may be php fatal error during AJAX request
$responce = $default_size;
}
open_popup($prefix_special, $event, $t, $responce);
}
$pm.GetSize($t);
return ;
}
$window_size = $default_size;
}
var $kf = document.getElementById($form_name);
var $window_name = $t.replace(/(\/|-)/g, '_'); // replace "/" and "-" with "_"
$window_size = $window_size.split('x');
openwin('', $window_name, $window_size[0], $window_size[1]);
$kf.target = $window_name;
var $prev_opener = opener_action('p');
event_bak = get_hidden_field('events[' + $prefix_special + ']')
+ if (!event_bak) event_bak = '';
submit_event($prefix_special, $event, $t);
opener_action($prev_opener); // restore opener in parent window
set_hidden_field('events[' + $prefix_special + ']', event_bak); // restore event
set_hidden_field($prefix_special+'_mode', mode_bak)
}
function openSelector($prefix, $url, $dst_field, $window_size, $event)
{
// if url has additional params - store it and make hidden fields from it (later, below)
var $additional = [];
- if ($url.match('(.*)&(.*)')) {
+ if ($url.match('(.*?)&(.*)')) {
$url = RegExp.$1;
var tmp = RegExp.$2;
var pairs = tmp.split('&');
for (var i in pairs) {
var data = pairs[i].split('=');
$additional[data[0]] = data[1];
}
}
// get template name from url
var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)');
$regex = $regex.exec($url);
var $t = $regex[3];
// substitute form action with selector's url
var $kf = document.getElementById($form_name);
var $prev_action = $kf.action;
$kf.action = $url;
// check parameter values
if (!isset($event)) $event = '';
// set variables need for selector to work
processHooks('openSelector', hBEFORE);
set_hidden_field('main_prefix', $prefix);
set_hidden_field('dst_field', $dst_field);
for (var i in $additional)
{
set_hidden_field(i, $additional[i]);
}
open_popup($prefix, $event, $t);
// restore form action back
processHooks('openSelector', hAFTER);
$kf.action = $prev_action;
}
+function translate_phrase($label, $template) {
+ set_hidden_field('phrases_label', $label);
+ open_popup('phrases', 'OnNew', $template);
+}
+
function std_precreate_item(prefix_special, edit_template)
{
set_hidden_field(prefix_special+'_mode', 't');
if (use_popups(prefix_special, 'OnPreCreate')) {
open_popup(prefix_special, 'OnPreCreate', edit_template);
}
else {
opener_action('d');
submit_event(prefix_special,'OnPreCreate', edit_template);
}
}
function std_new_item(prefix_special, edit_template)
{
if (use_popups(prefix_special, 'OnNew')) {
open_popup(prefix_special, 'OnNew', edit_template);
}
else {
opener_action('d');
submit_event(prefix_special,'OnNew', edit_template);
}
}
var mode_bak = null;
function std_edit_item(prefix_special, edit_template)
{
mode_bak = get_hidden_field(prefix_special+'_mode');
set_hidden_field(prefix_special+'_mode', 't');
if (use_popups(prefix_special, 'OnEdit')) {
open_popup(prefix_special, 'OnEdit', edit_template);
}
else {
opener_action('d');
submit_event(prefix_special,'OnEdit',edit_template);
}
}
function std_edit_temp_item(prefix_special, edit_template)
{
if (use_popups(prefix_special, '')) {
open_popup(prefix_special, '', edit_template);
}
else {
opener_action('d');
submit_event(prefix_special,'',edit_template);
}
}
function std_delete_items(prefix_special, t, $ajax)
{
if (inpConfirm('Are you sure you want to delete selected items?')) {
submit_event(prefix_special, 'OnMassDelete', t, null, $ajax);
}
}
// set current form base on ajax
function set_form($prefix_special, $ajax)
{
if ($ajax) {
$form_name = $Catalog.queryTabRegistry('prefix', $prefix_special, 'tab_id') + '_form';
}
}
// sets hidden field value
// if the field does not exist - creates it
function set_hidden_field($field_id, $value)
{
var $kf = document.getElementById($form_name);
var $field = $kf.elements[$field_id];
if ($field) {
$field.value = $value;
return true;
}
$field = document.createElement('INPUT');
$field.type = 'hidden';
$field.name = $field_id;
$field.id = $field_id;
$field.value = $value;
$kf.appendChild($field);
return false;
}
// sets hidden field value
// if the field does not exist - creates it
function setInnerHTML($field_id, $value)
{
var $element = document.getElementById($field_id);
if (!$element) return false;
$element.innerHTML = $value;
}
function get_hidden_field($field)
{
var $kf = document.getElementById($form_name);
return $kf.elements[$field] ? $kf.elements[$field].value : false;
}
function search($prefix_special, $grid_name, $ajax)
{
set_form($prefix_special, $ajax);
set_hidden_field('grid_name', $grid_name);
submit_event($prefix_special, 'OnSearch', null, null, $ajax);
}
function search_reset($prefix_special, $grid_name, $ajax)
{
set_form($prefix_special, $ajax);
set_hidden_field('grid_name', $grid_name);
submit_event($prefix_special, 'OnSearchReset', null, null, $ajax);
}
function search_keydown($event, $prefix_special, $grid, $ajax)
{
$event = $event ? $event : event;
if (window.event) {// IE
var $key_code = $event.keyCode;
}
else if($event.which) { // Netscape/Firefox/Opera
var $key_code = $event.which;
}
switch ($key_code) {
case 13:
search($prefix_special, $grid, parseInt($ajax));
break;
case 27:
search_reset($prefix_special, $grid, parseInt($ajax));
break;
}
}
function getRealLeft(el)
{
if (typeof(el) == 'string') {
el = document.getElementById(el);
}
xPos = el.offsetLeft;
tempEl = el.offsetParent;
while (tempEl != null)
{
xPos += tempEl.offsetLeft;
tempEl = tempEl.offsetParent;
}
// if (obj.x) return obj.x;
return xPos;
}
function getRealTop(el)
{
if (typeof(el) == 'string') {
el = document.getElementById(el);
}
yPos = el.offsetTop;
tempEl = el.offsetParent;
while (tempEl != null)
{
yPos += tempEl.offsetTop;
tempEl = tempEl.offsetParent;
}
// if (obj.y) return obj.y;
return yPos;
}
function show_viewmenu_old($toolbar, $button_id)
{
var $img = $toolbar.GetButtonImage($button_id);
var $pos_x = getRealLeft($img) - ((document.all) ? 6 : -2);
var $pos_y = getRealTop($img) + 32;
var $prefix_special = '';
window.triedToWriteMenus = false;
if($ViewMenus.length == 1)
{
$prefix_special = $ViewMenus[$ViewMenus.length-1];
$fw_menus[$prefix_special+'_view_menu']();
$Menus[$prefix_special+'_view_menu'].writeMenus('MenuContainers['+$prefix_special+']');
window.FW_showMenu($Menus[$prefix_special+'_view_menu'], $pos_x, $pos_y);
}
else
{
// prepare menus
for(var $i in $ViewMenus)
{
$prefix_special = $ViewMenus[$i];
$fw_menus[$prefix_special+'_view_menu']();
}
$Menus['mixed'] = new Menu('ViewMenu_mixed');
// merge menus into new one
for(var $i in $ViewMenus)
{
$prefix_special = $ViewMenus[$i];
$Menus['mixed'].addMenuItem( $Menus[$prefix_special+'_view_menu'] );
}
$Menus['mixed'].writeMenus('MenuContainers[mixed]');
window.FW_showMenu($Menus['mixed'], $pos_x, $pos_y);
}
}
var nlsMenuRendered = false;
function show_viewmenu($toolbar, $button_id)
{
if($ViewMenus.length == 1) {
$prefix_special = $ViewMenus[$ViewMenus.length-1];
menu_to_show = $prefix_special+'_view_menu';
}
else
{
mixed_menu = menuMgr.createMenu(rs('mixed_menu'));
mixed_menu.applyBorder(false, false, false, false);
mixed_menu.dropShadow("none");
mixed_menu.showIcon = true;
// merge menus into new one
for(var $i in $ViewMenus)
{
$prefix_special = $ViewMenus[$i];
mixed_menu.addItem( rs($prefix_special+'.view.menu.mixed'),
$MenuNames[$prefix_special+'_view_menu'],
'javascript:void()', null, true, null,
rs($prefix_special+'.view.menu'),$MenuNames[$prefix_special+'_view_menu'] );
}
menu_to_show = 'mixed_menu';
}
renderMenus();
nls_showMenu(rs(menu_to_show), $toolbar.GetButtonImage($button_id))
}
function renderMenus()
{
menuMgr.renderMenus('nlsMenuPlace');
nlsMenuRendered = true;
}
function set_window_title($title)
{
var $window = window;
if($window.parent) $window = $window.parent;
$window.document.title = (main_title.length ? main_title + ' - ' : '') + $title;
}
function set_filter($prefix_special, $filter_id, $filter_value, $ajax)
{
set_form($prefix_special, $ajax);
set_hidden_field('filter_id', $filter_id);
set_hidden_field('filter_value', $filter_value);
submit_event($prefix_special, 'OnSetFilter', null, null, $ajax);
}
function filters_remove_all($prefix_special, $ajax)
{
set_form($prefix_special, $ajax);
submit_event($prefix_special,'OnRemoveFilters', null, null, $ajax);
}
function filters_apply_all($prefix_special, $ajax)
{
set_form($prefix_special, $ajax);
submit_event($prefix_special,'OnApplyFilters', null, null, $ajax);
}
function RemoveTranslationLink($string, $escaped)
{
if (!isset($escaped)) $escaped = true;
if ($escaped) {
- return $string.match(/&lt;a href=&quot;(.*)&quot;&gt;(.*)&lt;\/a&gt;/) ? RegExp.$2 : $string;
- }
- else {
- return $string.match(/<a href="(.*)">(.*)<\/a>/) ? RegExp.$2 : $string;
+ return $string.replace(/&lt;a href=&quot;(.*?)&quot;&gt;(.*?)&lt;\/a&gt;/g, '$2');
}
+
+ return $string.replace(/<a href="(.*?)">(.*?)<\/a>/g, '$2');
}
function redirect($url)
{
window.location.href = $url;
}
function update_checkbox_options($cb_mask, $hidden_id)
{
var $kf = document.getElementById($form_name);
var $tmp = '';
for (var i = 0; i < $kf.elements.length; i++)
{
if ( $kf.elements[i].id.match($cb_mask) )
{
if ($kf.elements[i].checked) $tmp += '|'+$kf.elements[i].value;
}
}
if($tmp.length > 0) $tmp += '|';
document.getElementById($hidden_id).value = $tmp.replace(/,$/, '');
}
// related to lists operations (moving)
function move_selected($from_list, $to_list)
{
if (typeof($from_list) != 'object') $from_list = document.getElementById($from_list);
if (typeof($to_list) != 'object') $to_list = document.getElementById($to_list);
if (has_selected_options($from_list))
{
var $from_array = select_to_array($from_list);
var $to_array = select_to_array($to_list);
var $new_from = Array();
var $cur = null;
for (var $i = 0; $i < $from_array.length; $i++)
{
$cur = $from_array[$i];
if ($cur[2]) // If selected - add to To array
{
$to_array[$to_array.length] = $cur;
}
else //Else - keep in new From
{
$new_from[$new_from.length] = $cur;
}
}
$from_list = array_to_select($new_from, $from_list);
$to_list = array_to_select($to_array, $to_list);
}
else
{
alert('Please select items to perform moving!');
}
}
function select_to_array($aSelect)
{
var $an_array = new Array();
var $cur = null;
for (var $i = 0; $i < $aSelect.length; $i++)
{
$cur = $aSelect.options[$i];
$an_array[$an_array.length] = new Array($cur.text, $cur.value, $cur.selected);
}
return $an_array;
}
function array_to_select($anArray, $aSelect)
{
var $initial_length = $aSelect.length;
for (var $i = $initial_length - 1; $i >= 0; $i--)
{
$aSelect.options[$i] = null;
}
for (var $i = 0; $i < $anArray.length; $i++)
{
$cur = $anArray[$i];
$aSelect.options[$aSelect.length] = new Option($cur[0], $cur[1]);
}
}
function select_compare($a, $b)
{
if ($a[0] < $b[0])
return -1;
if ($a[0] > $b[0])
return 1;
return 0;
}
function select_to_string($aSelect)
{
var $result = '';
var $cur = null;
if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
for (var $i = 0; $i < $aSelect.length; $i++)
{
$result += $aSelect.options[$i].value + '|';
}
return $result.length ? '|' + $result : '';
}
function selected_to_string($aSelect)
{
var $result = '';
var $cur = null;
if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
for (var $i = 0; $i < $aSelect.length; $i++)
{
$cur = $aSelect.options[$i];
if ($cur.selected && $cur.value != '')
{
$result += $cur.value + '|';
}
}
return $result.length ? '|' + $result : '';
}
function string_to_selected($str, $aSelect)
{
var $cur = null;
for (var $i = 0; $i < $aSelect.length; $i++)
{
$cur = $aSelect.options[$i];
$aSelect.options[$i].selected = $str.match('\\|' + $cur.value + '\\|') ? true : false;
}
}
function set_selected($selected_options, $aSelect)
{
if (!$selected_options.length) return false;
for (var $i = 0; $i < $aSelect.length; $i++)
{
for (var $k = 0; $k < $selected_options.length; $k++)
{
if ($aSelect.options[$i].value == $selected_options[$k])
{
$aSelect.options[$i].selected = true;
}
}
}
}
function get_selected_count($theList)
{
var $count = 0;
var $cur = null;
for (var $i = 0; $i < $theList.length; $i++)
{
$cur = $theList.options[$i];
if ($cur.selected) $count++;
}
return $count;
}
function get_selected_index($aSelect, $typeIndex)
{
var $index = 0;
for (var $i = 0; $i < $aSelect.length; $i++)
{
if ($aSelect.options[$i].selected)
{
$index = $i;
if ($typeIndex == 'firstSelected') break;
}
}
return $index;
}
function has_selected_options($theList)
{
var $ret = false;
var $cur = null;
for (var $i = 0; $i < $theList.length; $i++)
{
$cur = $theList.options[$i];
if ($cur.selected) $ret = true;
}
return $ret;
}
function select_sort($aSelect)
{
if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
var $to_array = select_to_array($aSelect);
$to_array.sort(select_compare);
array_to_select($to_array, $aSelect);
}
function move_options_up($aSelect, $interval)
{
if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
if (has_selected_options($aSelect))
{
var $selected_options = Array();
var $first_selected = get_selected_index($aSelect, 'firstSelected');
for (var $i = 0; $i < $aSelect.length; $i++)
{
if ($aSelect.options[$i].selected && ($first_selected > 0) )
{
swap_options($aSelect, $i, $i - $interval);
$selected_options[$selected_options.length] = $aSelect.options[$i - $interval].value;
}
else if ($first_selected == 0)
{
//alert('Begin of list');
break;
}
}
set_selected($selected_options, $aSelect);
}
else
{
//alert('Check items from moving');
}
}
function move_options_down($aSelect, $interval)
{
if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
if (has_selected_options($aSelect))
{
var $last_selected = get_selected_index($aSelect, 'lastSelected');
var $selected_options = Array();
for (var $i = $aSelect.length - 1; $i >= 0; $i--)
{
if ($aSelect.options[$i].selected && ($aSelect.length - ($last_selected + 1) > 0))
{
swap_options($aSelect, $i, $i + $interval);
$selected_options[$selected_options.length] = $aSelect.options[$i + $interval].value;
}
else if ($last_selected + 1 == $aSelect.length)
{
//alert('End of list');
break;
}
}
set_selected($selected_options, $aSelect);
}
else
{
//alert('Check items from moving');
}
}
function swap_options($aSelect, $src_num, $dst_num)
{
var $src_html = $aSelect.options[$src_num].innerHTML;
var $dst_html = $aSelect.options[$dst_num].innerHTML;
var $src_value = $aSelect.options[$src_num].value;
var $dst_value = $aSelect.options[$dst_num].value;
var $src_option = document.createElement('OPTION');
var $dst_option = document.createElement('OPTION');
$aSelect.remove($src_num);
$aSelect.options.add($dst_option, $src_num);
$dst_option.innerText = $dst_html;
$dst_option.value = $dst_value;
$dst_option.innerHTML = $dst_html;
$aSelect.remove($dst_num);
$aSelect.options.add($src_option, $dst_num);
$src_option.innerText = $src_html;
$src_option.value = $src_value;
$src_option.innerHTML = $src_html;
}
function getXMLHTTPObject(content_type)
{
if (!isset(content_type)) content_type = 'text/plain';
var http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType(content_type);
// See note below about this line
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
return http_request;
}
function str_repeat($symbol, $count)
{
var $i = 0;
var $ret = '';
while($i < $count) {
$ret += $symbol;
$i++;
}
return $ret;
}
function getDocumentFromXML(xml)
{
if (window.ActiveXObject) {
var doc = new ActiveXObject("Microsoft.XMLDOM");
doc.async=false;
doc.loadXML(xml);
}
else {
var parser = new DOMParser();
var doc = parser.parseFromString(xml,"text/xml");
}
return doc;
}
function addEvent(el, evname, func) {
if (is.ie) {
el.attachEvent("on" + evname, func);
} else {
el.addEventListener(evname, func, true);
}
};
function set_persistant_var($var_name, $var_value, $t, $form_action)
{
set_hidden_field('field', $var_name);
set_hidden_field('value', $var_value);
submit_event('u', 'OnSetPersistantVariable', $t, $form_action);
}
/*functionremoveEvent(el, evname, func) {
if (Calendar.is_ie) {
el.detachEvent("on" + evname, func);
} else {
el.removeEventListener(evname, func, true);
}
};*/
function setCookie($Name, $Value)
{
// set cookie
if(getCookie($Name) != $Value)
{
document.cookie = $Name+'='+escape($Value)+'; path=' + $base_path + '/';
}
}
function getCookie($Name)
{
// get cookie
var $cookieString = document.cookie;
var $index = $cookieString.indexOf($Name+'=');
if($index == -1) return null;
$index = $cookieString.indexOf('=',$index)+1;
var $endstr = $cookieString.indexOf(';',$index);
if($endstr == -1) $endstr = $cookieString.length;
return unescape($cookieString.substring($index, $endstr));
}
function deleteCookie($Name)
{
// deletes cookie
if (getCookie($Name))
{
document.cookie = $Name+'=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/';
}
}
function addElement($dst_element, $tag_name) {
var $new_element = document.createElement($tag_name.toUpperCase());
$dst_element.appendChild($new_element);
return $new_element;
}
Math.sum = function($array) {
var $i = 0;
var $total = 0;
while ($i < $array.length) {
$total += $array[$i];
$i++;
}
return $total;
}
Math.average = function($array) {
return Math.sum($array) / $array.length;
}
// remove spaces and underscores from a string, used for nls_menu
function rs(str)
{
return str.replace(/[ _\']+/g, '.');
}
function getFrame($name)
{
var $main_window = window;
// 1. cycle through popups to get main window
try {
// will be error, when other site is opened in parent window
while ($main_window.opener) {
$main_window = $main_window.opener;
}
}
catch (err) {
// catch Access/Permission Denied error
// alert('getFrame.Error: [' + err.description + ']');
return window;
}
var $frameset = $main_window.parent.frames;
for ($i = 0; $i < $frameset.length; $i++) {
if ($frameset[$i].name == $name) {
return $frameset[$i];
}
}
return $main_window.parent;
}
function ClearBrowserSelection()
{
if (window.getSelection) {
// removeAllRanges will be supported by Opera from v 9+, do nothing by now
var selection = window.getSelection();
if (selection.removeAllRanges) { // Mozilla & Opera 9+
// alert('clearing FF')
window.getSelection().removeAllRanges();
}
} else if (document.selection && !is.opera) { // IE
// alert('clearing IE')
document.selection.empty();
}
}
function reset_form(prefix, event, msg)
{
- if (confirm(msg)) {
+ if (confirm(RemoveTranslationLink(msg, true))) {
submit_event(prefix, event)
}
}
function cancel_edit(prefix, cancel_ev, save_ev, msg)
{
- if (confirm(msg)) {
+ if (confirm(RemoveTranslationLink(msg, true))) {
submit_event(prefix, save_ev)
}
else {
submit_event(prefix, cancel_ev)
}
- }
\ No newline at end of file
+ }
+
+
+
+function execJS(node)
+{
+ var bSaf = (navigator.userAgent.indexOf('Safari') != -1);
+ var bOpera = (navigator.userAgent.indexOf('Opera') != -1);
+ var bMoz = (navigator.appName == 'Netscape');
+
+ if (!node) return;
+
+ /* IE wants it uppercase */
+ var st = node.getElementsByTagName('SCRIPT');
+ var strExec;
+
+ for(var i=0;i<st.length; i++)
+ {
+ if (bSaf) {
+ strExec = st[i].innerHTML;
+ st[i].innerHTML = "";
+ } else if (bOpera) {
+ strExec = st[i].text;
+ st[i].text = "";
+ } else if (bMoz) {
+ strExec = st[i].textContent;
+ st[i].textContent = "";
+ } else {
+ strExec = st[i].text;
+ st[i].text = "";
+ }
+
+ try {
+ var x = document.createElement("script");
+ x.type = "text/javascript";
+
+ /* In IE we must use .text! */
+ if ((bSaf) || (bOpera) || (bMoz))
+ x.innerHTML = strExec;
+ else x.text = strExec;
+
+ document.getElementsByTagName("head")[0].appendChild(x);
+ } catch(e) {
+ alert(e);
+ }
+ }
+};
+
+function NumberFormatter() {}
+
+NumberFormatter.ThousandsSep = '\'';
+NumberFormatter.DecimalSep = '.';
+
+NumberFormatter.Parse = function(num)
+{
+ return parseFloat( num.toString().replace(this.ThousandsSep, '').replace(this.DecimalSep, '.') );
+}
+
+NumberFormatter.Format = function(num)
+{
+ num += '';
+ x = num.split('.');
+ x1 = x[0];
+ x2 = x.length > 1 ? this.DecimalSep + x[1] : '';
+ var rgx = /(\d+)(\d{3})/;
+ while (rgx.test(x1)) {
+ x1 = x1.replace(rgx, '$1' + this.ThousandsSep + '$2');
+ }
+ return x1 + x2;
+}
Property changes on: trunk/core/admin_templates/js/script.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/core/admin_templates/js/nlsmenu.js
===================================================================
--- trunk/core/admin_templates/js/nlsmenu.js (revision 7634)
+++ trunk/core/admin_templates/js/nlsmenu.js (revision 7635)
@@ -1,754 +1,754 @@
/**
* nlsmenu.js v.1.2.1
* Copyright 2005-2006, addobject.com. All Rights Reserved
* Author Jack Hermanto, www.addobject.com
*/
var nlsMenu = new Object();
var nlsMenuMgr = new Object();
var nlsWinElmt = [];
var ag0=window.navigator.userAgent;
var nls_isIE = (ag0.indexOf("MSIE") >=0);
var nls_isIE5 = (ag0.indexOf("MSIE 5.0") >=0);
var nls_isSafari = (ag0.indexOf("Safari") >=0);
var nls_isOpera = (ag0.indexOf("Opera") >=0);
if (nls_isOpera) {nls_isIE=false; nls_isIE5=false;};
function NlsMenuManager(mgr) {
this.mgrId = mgr;
this.menus = new Object();
this.menubar = null;
this.timeout = 1500;
this.flowOverFormElement = false;
this.assocMenuMgr = [];
this.defaultEffect=null;
this.tmId = null;
this.setTimeout=function(a, t) { this.tmId = window.setTimeout(a, t); };
this.clearTimeout=function() { if (this.tmId!=null) { window.clearTimeout(this.tmId); this.tmId=null;}};
nlsMenuMgr[mgr] = this;
return this;
};
var NlsMnMgr = NlsMenuManager.prototype;
NlsMnMgr.createMenu = function(mId) {
var m = new NlsMenu(mId);
m.mgrId = this.mgrId;
if (this.defaultEffect!=null && this.defaultEffect!="") m.useEffect(this.defaultEffect);
this.menus[mId] = m;
return m;
};
NlsMnMgr.createMenubar = function (mbarId) {
if (this.menubar) alert("Menubar already exists!");
var m = new NlsMenubar(mbarId);
m.mgrId = this.mgrId;
this.menubar = m;
return m;
};
NlsMnMgr.renderMenus = function (plc) {
if (plc && plc!="") {
var d=NlsGetElementById(plc); var s="";
for (it in this.menus) { s+=this.menus[it].renderMenu(); }
d.innerHTML=s;
} else {
for (it in this.menus) { document.write(this.menus[it].renderMenu()); }
}
};
NlsMnMgr.renderMenubar = function (plc) {
if (this.menubar) {
if (plc && plc!="") {
NlsGetElementById(plc).innerHTML=this.menubar.renderMenubar();
} else {
document.write(this.menubar.renderMenubar());
}
}
};
NlsMnMgr.hideMenus = function () {
for (it in this.menus) {if (this.menus[it].active) this.menus[it].hideMenu();}
if (this.menubar) this.menubar.hideMenu();
};
NlsMnMgr.addAssocMenuMgr = function(frm, mgrId) {
this.assocMenuMgr[this.assocMenuMgr.length] = [frm, mgrId];
};
NlsMnMgr.getMenu= function(mId) { return this.menus[mId]; };
function listAllWinElmt() {
nlsWinElmt = [];
var arrWinEl = document.getElementsByTagName("SELECT");
var elm; var tmp; var x; var y;
for(var i=0; i<arrWinEl.length; i++) {
elm = arrWinEl[i]; tmp=elm; x=0; y=0;
while (tmp!=null) {
x += tmp.offsetLeft; y+=tmp.offsetTop;
tmp = tmp.offsetParent;
}
nlsWinElmt[nlsWinElmt.length] = {e:elm, eX1:x, eY1:y, eX2:x+elm.offsetWidth, eY2:y+elm.offsetHeight};
}
};
function NlsMenuItem(id, capt, url, ico, enb, xtra, subId, title, crossFrame, subFrame, subPos, subPosAdj, subDir) {
this.id = id;
this.intKey = "";
- this.capt = capt;
+ this.capt = RemoveTranslationLink(capt, true);
this.url = (url==null? "" : url);
this.ico = (ico==null && ico=="" && ico.length==0) ? null: ico;
this.enable=(enb==null?true:enb);
this.xtra = xtra;
this.stlprf="";
this.target=null;
this.title=title==null?"":title;
this.itemEffect=null;
this.subMenuId = (subId?subId:"");
this.crsFrame = (crossFrame?crossFrame:false);
this.subFrame = (subFrame?subFrame:null);
this.subPos = (subPos?subPos:[null,null]);
this.subPosAdj = (subPosAdj?subPosAdj:[0,0]);
this.subDir = (subDir?subDir:["right","down"]);
this.toString=function() {return "NlsMenuItem";};
this.useItemEffect=function(effName) {
this.itemEffect=new NlsMenuItemEffect(this.intKey, effName);
};
return this;
};
function NlsMenuSeparator(cstSeparator) {
this.stlprf = "";
this.intKey = "";
this.seprt = cstSeparator!=null?cstSeparator:"";
this.render = function () {
if (this.seprt!="") return this.seprt;
return ("<table border=0 cellpadding=0 cellspacing=0 width='100%' height='0%'><tr>" +
"<td class=\""+this.stlprf+"nlsseparator\"></td>" +
"</tr></table>");
};
this.toString=function() {return "NlsMenuSeparator";};
};
function NlsCustomMenuItem(cst) {
this.intKey = "";
this.cstMenu = (cst?cst:"&nbsp;");
this.toString=function() {return "NlsCustomMenuItem";};
};
function NlsMenu(mId) {
/*private*/
this.lsItm=null;
this.mgrId = "";
this.winElmt=null;
this.container=null;
this.customBorder=null;
this.shadow=new NlsMenuShadow("bottomright", "5px", mId);
this.count=0;
this.active = false;
this.isMenubar=false;
this.effect=null;
this.srItems=[];
this.imgPath="";
this.ready=true;
/*public*/
this.mId = mId;
this.items = new Object();
this.stlprf="";
this.subMenuIc=[];
this.target="_self";
this.showIcon=false;
this.showSubIcon=true;
this.absWidth="";
this.orient="V";
this.defItmEff=null;
this.defPos=[0,0];
this.maxItemCol=100;
this.zIndex = 100;
this.wnd = window;
nlsMenu[mId] = this;
return this;
};
var NLSMENU=NlsMenu.prototype;
NLSMENU.addItem = function(key, capt, url, ico, enb, xtra, subId, title) {
var intKey = this.mId+"_"+key;
var it = new NlsMenuItem(key, capt, url, ico, enb, xtra, subId, title);
it.intKey = intKey;
this.items[intKey]=it;
this.srItems[this.srItems.length]=it;
if (this.defItmEff!=null && typeof(NlsMenuItemEffect) != "undefined") { it.useItemEffect(this.defItmEff); }
this.count++;
return it;
};
NLSMENU.addSeparator = function(separator) {
var intKey = "sep_"+this.count;
var it = (separator ? separator : new NlsMenuSeparator());
it.stlprf = this.stlprf;
it.intKey = intKey;
this.items[intKey] = it;
this.srItems[this.srItems.length]=it;
this.count++;
return it;
};
NLSMENU.addSubmenu = function(key, subId, crsFrame, subFrame, subPos, subPosAdj, subDir) {
var intKey = this.mId+"_"+key;
alert('intKey: '+intKey);
var mnItem = this.items[intKey];
alert('subId '+subId)
mnItem.subMenuId=subId;
mnItem.subFrame=(subFrame?subFrame:null);
mnItem.crsFrame=(crsFrame?crsFrame:false);
mnItem.subPos = (subPos?subPos:[null,null]);
mnItem.subPosAdj = (subPosAdj?subPosAdj:[0,0]);
mnItem.subDir = (subDir?subDir:["right","down"]);
};
NLSMENU.addCustomMenu = function (custom) {
var intKey = "cst_"+this.count;
var it = new NlsCustomMenuItem(custom);
it.intKey = intKey;
this.items[intKey] = it;
this.srItems[this.srItems.length]=it;
this.count++;
return it;
};
NLSMENU.getItemById = function (key) {
return this.items[this.mId+"_"+key];
};
NLSMENU.setItemStyle = function (key, stlprf) {
var intKey = this.mId+"_"+key;
var mnItem = this.items[intKey];
mnItem.stlprf=stlprf;
};
NLSMENU.enableItem = function (key, b) {
var intKey = this.mId+"_"+key;
this.items[intKey].enable=b;
setMnStyle(NlsGetElementById(intKey), (b?"N":"D"), (this.items[intKey].stlprf==""?this.stlprf:this.items[intKey].stlprf));
};
NLSMENU.dropShadow = function (pos, offset) {
if (this.shadow) { this.shadow.pos=pos; this.shadow.offset=(offset?offset:"5px"); } else
{ this.shadow=new NlsMenuShadow(pos, offset, this.mId); }
};
NLSMENU.applyBorder = function (bTop, bBottom, bLeft, bRight) {
if (!bTop && !bBottom && !bLeft && !bRight) {
this.customBorder=null;
} else {
this.customBorder=new NlsMenuBorder(bTop, bBottom, bLeft, bRight);
}
};
NLSMENU.useEffect = function (effName) {
this.effect=new NlsMenuEffect(this.mId, effName);
};
NLSMENU.renderMenu = function() {
var allScs = (document.getElementsByTagName ? document.getElementsByTagName("SCRIPT"): document.scripts);
for (var i=0;i<allScs.length;i++) {
if (allScs[i].src.toLowerCase().indexOf("nlsmenu_1_2_1.js")>=0) { this.imgPath=allScs[i].src.replace(/nlsmenu_1_2_1.js/gi, ""); }
}
if (!this.subMenuIc||this.subMenuIc=="") { this.subMenuIc=[this.imgPath+"img/submenu.gif", this.imgPath+"img/submenuovr.gif"];}
var sAbs=(this.absWidth==""?"":"width='"+this.absWidth+"'");
var smenu="<table cellpadding=0 cellspacing=0 width='100%'>";
var tmpCnt=0;var prf=this.stlprf; var it=null;
for (var i=0; i<this.srItems.length; i++) {
it=this.srItems[i];
if (it.toString()=="NlsMenuSeparator") {
smenu+=(this.orient=="V"?"<tr>":"");
smenu+=("<td class='"+this.stlprf+"nlsseparatorcontainer'>"+it.render()+"</td>");
smenu+=(this.orient=="V"?"</tr>":"");
} else
if (it.toString()=="NlsCustomMenuItem") {
smenu+=(this.orient=="V"?"<tr>":"");
smenu+=("<td>"+it.cstMenu+"</td>");
smenu+=(this.orient=="V"?"</tr>":"");
} else {
if (it.stlprf) prf=it.stlprf; else prf=this.stlprf;
if (this.orient=="V") { smenu+="<tr>"; }
if (this.orient=="H") { if (tmpCnt==0) smenu+="<tr>"; tmpCnt++; }
smenu+="<td id=\""+it.intKey+"\" class=\""+prf+"nlsitemcontainer\" onmouseover=\"nlsMenuItemOver(event, '"+it.intKey+"')\" onclick=\"return nlsMenu['"+this.mId+"'].menuItemClick(event, '"+it.intKey+"');\">";
smenu+="<table cellpadding=0 cellspacing=0 width='100%' height='100%'><tr style=\"cursor:pointer;\" title=\""+it.title+"\">";
if (this.showIcon) { smenu+="<td id=\""+it.intKey+"x1\" class=\""+prf+"nlsiconcell\" align=\"center\" nowrap>"+(it.ico && it.ico.length>0?"<img id=\"ic_"+it.intKey+"\" src=\""+it.ico[0]+"\">" + (it.ico.length>1?"<img id=\"icovr_"+it.intKey+"\" style='display:none' src=\""+it.ico[1]+"\">":"") :"")+"</td>"; }
smenu+="<td id=\""+it.intKey+"x2\" class=\""+prf+(it.enable?"nlsitem\"":"nlsitemdisable\"")+" nowrap>"+it.capt+"</td>";
if (this.showSubIcon && it.subMenuId!="") { smenu+="<td id=\""+it.intKey+"x3\" class=\""+prf+"nlssubmenucell\" align=\"right\" nowrap>"+ (it.subMenuId!=""? "<img id='subic_"+it.intKey+"' src=\""+this.subMenuIc[0]+"\">" + (this.subMenuIc.length>1?"<img id='subicovr_"+it.intKey+"' style='display:none' src=\""+this.subMenuIc[1]+"\">":"") :"") +"</td>"; }
smenu+="</tr></table>";
smenu+="</td>";
if (this.orient=="V") { smenu+="</tr>"; }
if (this.orient=="H" && tmpCnt==this.maxItemCol) { smenu+="</tr>"; tmpCnt=0; }
}
}
smenu+=(this.orient=="H" && tmpCnt!=0 ?"</tr>":"");
smenu += "</table>";
smenu = "<table cellpadding=0 cellspacing=0 class='"+this.stlprf+"nlsmenu' "+ sAbs + "><tr><td>"+smenu+"</td></tr></table>";
if (this.customBorder!=null) smenu = this.customBorder.applyBorder(smenu, this.stlprf);
smenu = this.shadow.dropShadow(smenu);
smenu = "<div " + (nls_isIE && !this.isMenubar?"style='position:absolute;z-index:"+(this.zIndex-1)+";'":"") + ">" + smenu;
if (!this.isMenubar && nls_isIE && !nls_isIE5 && nlsMenuMgr[this.mgrId].flowOverFormElement) {
smenu += "<iframe id='"+this.mId+"ifrm' scrolling='no' frameborder=0 width='1' height='1' style='position:absolute;top:0px;left:0px;z-index:-1' src='"+this.imgPath+"img/blank.gif"+"'></iframe>";
}
smenu+="</div>";
smenu = "<div id='"+this.mId+"' style="+(this.isMenubar?"''":"'position:absolute;z-index:"+this.zIndex+";display:none;'")+" onmouseover=\"_nlsMenuItemOver('"+this.mgrId+"')\" onmouseout=\"nlsMenuItemOut('"+this.mgrId+"')\">" + smenu + "</div>";
return smenu;
};
function NlsMenuShadow(pos, offset, mId) {
this.pos=pos;
this.offset=offset;
this.mId=mId;
this.dropShadow = function (smenu) {
//return smenu;
var mn = nlsMenu[this.mId];
var shadow = "<div style='width: auto;'><table style='width: auto; margin: 0px;' id='effwin_"+this.mId+"' cellpadding=0 cellspacing=0 height='0px'>";
var hshadow = "<table cellpadding=0 cellspacing=0 width='100%' height='5px' class='"+mn.stlprf+"horzshadow'><tr><td></td></tr></table>";
var vshadow = "<table cellpadding=0 cellspacing=0 style='width: auto;' width='5px' height='100%' class='"+mn.stlprf+"vertshadow'><tr><td></td></tr></table>";
var menutd = "<td id='actmn_"+this.mId+"'>"+smenu+"</td>";
var cornertd = "<td class='"+mn.stlprf+"cornshadow' width='5px' height='5px'></td>";
switch (this.pos) {
case "none":
shadow += "<tr>"+menutd+"</tr>";
break;
case "bottomright" :
shadow += "<tr>"+menutd+"<td style='height:100%;padding-top:OFFSET;'>"+vshadow+"</td></tr>" +
"<tr><td style='padding-left:OFFSET;'>"+hshadow+"</td>"+cornertd+"</tr>";
break;
case "bottomleft" :
shadow += "<tr><td style='height:100%;padding-top:OFFSET;'>"+vshadow+"</td>"+menutd+"</tr>" +
"<tr>"+cornertd+"<td style='padding-right:OFFSET;'>"+hshadow+"</td></tr>";
break;
case "topleft" :
shadow += "<tr>"+cornertd+"<td style='padding-right:OFFSET;'>"+hshadow+"</td></tr>" +
"<tr><td style='height:100%;padding-bottom:OFFSET;'>"+vshadow+"</td>"+menutd+"</tr>";
break;
case "topright" :
shadow += "<tr><td style='padding-left:OFFSET;'>"+hshadow+"</td>"+cornertd+"</tr>" +
"<tr>"+menutd+"<td style='height:100%;padding-bottom:OFFSET;'>"+vshadow+"</td></tr>";
break;
}
return shadow.replace(/OFFSET/gi, this.offset) + "</table></div>";
};
};
NLSMENU.showMenu = function(x1, y1, x2, y2, mnOrient, subDir, subAdj) {
if (this.lsItm!=null) {setMnStyle(this.lsItm, "N", (this.lsItm.stlprf==""?this.stlprf:this.lsItm.stlprf)); this.lsItm=null;}
var flag= this.menuOnShow(this.mId);
if (flag==false) return;
var ctx = NlsGetElementById(this.mId);
if (!ctx) return;
var dmfrm = NlsGetElementById(this.mId+"ifrm");
ctx.style.visibility="hidden";
ctx.style.display="";
var scrOffX = window.scrollX?window.scrollX:document.body.scrollLeft;
var scrOffY = window.scrollY?window.scrollY:document.body.scrollTop;
var cW=(window.innerWidth?window.innerWidth:document.body.clientWidth);
var cH=(window.innerHeight?window.innerHeight:document.body.clientHeight);
var mW=(ctx.children?ctx.children[0]:ctx.childNodes[0]).offsetWidth;
var mH=(ctx.children?ctx.children[0]:ctx.childNodes[0]).offsetHeight;
var sDir=(subDir?[subDir[0], subDir[1]]:["right", "down"]);
var adjX=(subAdj?subAdj[0]:this.defPos[0]); var adjY=(subAdj?subAdj[1]:this.defPos[1]);
if (dmfrm) {
var actMn = NlsGetElementById("actmn_"+this.mId);
if (actMn) {
dmfrm.width = actMn.children[0].offsetWidth;
dmfrm.height = actMn.children[0].offsetHeight;
}
}
var mX=0; var mY=0;
if (mnOrient=="V") {
if (sDir[0]=="right") {
if(x2+mW>cW){if(x1>=mW){mX=x1-mW+adjX+scrOffX;sDir[0]="left"}else{mX=cW-mW-1+scrOffX;}}else{mX=x2+scrOffX-adjX;}
} else {
if(x1-mW<0){if(x2+mW<cW){mX=x2-adjX+scrOffX;sDir[0]="right"}else{mX=scrOffX;}}else{mX=x1-mW+adjX+scrOffX;}
}
if (sDir[1]=="down") {
if(y1+mH>cH){if(y2>=mH){mY=y2-mH+scrOffY-adjY;sDir[1]="up"}else{mY=cH-mH-1+scrOffY;}}else{mY=y1+scrOffY+adjY;}
} else {
if(y1-mH<0){if(y1+mH<cH){mY=y1+scrOffY-adjY;sDir[1]="down"}else{mY=scrOffY;}}else{mY=y2-mH+scrOffY-adjY;}
}
} else {
if (sDir[0] == "right") {
if(x1+mW>cW){if(x2>=mW){mX=x2-mW+scrOffX-adjX;sDir[0]="left"}else{mX=cW-mW-1+scrOffX;}}else{mX=x1+scrOffX+adjX;}
} else {
if(x2-mW<0){if(x1+mW<cW){mX=x1+scrOffX+adjX;sDir[0]="right"}else{mX=scrOffX;}}else{mX=x2-mW+scrOffX-adjX;}
}
if (sDir[1] == "down") {
if(y2+mH>cH){if(y1>=mH){mY=y1-mH+scrOffY+adjY;sDir[1]="up"}else{mY=cH-mH-1+scrOffY;}}else{mY=y2+scrOffY-adjY;}
} else {
if(y1-mH<0){if(y2+mH<cH){mY=y2+scrOffY-adjY;sDir[1]="down"}else{mY=scrOffY;}}else{mY=y1-mH+scrOffY+adjY;}
}
}
if (nls_isIE5 || !nlsMenuMgr[this.mgrId].flowOverFormElement) {
if (this.winElmt==null) hideWinElmt(this, mX, mY, mX+mW, mY+mH);
if (this.winElmt==null) this.winElmt=[];
for(var i=0;i<this.winElmt.length;i++) {
this.winElmt[i].style.visibility="hidden";
}
}
with (ctx.style) {
left=mX+"px"; top=mY+"px";
zIndex = this.zIndex;
if (this.effect) {
with (this.effect) {prop["dir"]=sDir[(mnOrient=="V"?0:1)]; start(false); visibility="visible"; run();}
} else { visibility="visible"; }
}
this.active=true;
};
function hideWinElmt(mn, mX1, mY1, mX2, mY2) {
var oe;
for (var i=0; i<nlsWinElmt.length; i++) {
oe = nlsWinElmt[i];
if ((oe.eX1>=mX1 && oe.eX1<=mX2 && oe.eY1>=mY1 && oe.eY1<=mY2) ||
(oe.eX1>=mX1 && oe.eX1<=mX2 && oe.eY2>=mY1 && oe.eY2<=mY2) ||
(oe.eX2>=mX1 && oe.eX2<=mX2 && oe.eY1>=mY1 && oe.eY1<=mY2) ||
(oe.eX2>=mX1 && oe.eX2<=mX2 && oe.eY2>=mY1 && oe.eY2<=mY2) ||
(mX1>=oe.eX1 && mX1<=oe.eX2 && mY1>=oe.eY1 && mY1<=oe.eY2) ||
(mX1>=oe.eX1 && mX1<=oe.eX2 && mY2>=oe.eY1 && mY2<=oe.eY2) ||
(mX2>=oe.eX1 && mX2<=oe.eX2 && mY1>=oe.eY1 && mY1<=oe.eY2) ||
(mX2>=oe.eX1 && mX2<=oe.eX2 && mY2>=oe.eY1 && mY2<=oe.eY2) ||
(oe.eX1<mX1 && oe.eX2>mX2 && oe.eY1>=mY1 && oe.eY1<=mY2) ||
(oe.eX1<mX1 && oe.eX2>mX2 && oe.eY2>=mY1 && oe.eY2<=mY2)
) {
if (oe.e.style.visibility!="hidden") {
oe.e.style.visibility="hidden";
if (mn.winElmt==null) mn.winElmt=[];
mn.winElmt[mn.winElmt.length]=oe.e;
}
}
}
};
NLSMENU.showMenuAbs = function(x, y) {
var ctx = NlsGetElementById(this.mId);
ctx.style.top=y+"px"; ctx.style.left=x+"px";
ctx.style.display="";
this.active=true;
};
NLSMENU.hideMenu = function() {
var ctx = NlsGetElementById(this.mId);
if (!ctx) return;
if (!this.isMenubar) {
if (this.effect) {
this.effect.start(true);
if ((nls_isIE && this.effect.effName!="aoslide") || nls_isOpera && this.effect.effName!="aoslide") {ctx.style.visibility="hidden";} else { this.effect.onHide=function() {ctx.style.visibility="hidden";}; };
this.effect.run();
} else { ctx.style.visibility="hidden"; }
this.active=false;
} else {
this.isMenuOpened = false;
}
if (this.lsItm!=null) {
setMnStyle(this.lsItm, "N", (this.items[this.lsItm.id].stlprf==""?this.stlprf:this.items[this.lsItm.id].stlprf));
setMnIcon(this, this.items[this.lsItm.id], "N");
this.lsItm=null;
}
if (this.winElmt!=null && this.winElmt.length>0) {
for (i=0;i<this.winElmt.length;i++) {
this.winElmt[i].style.visibility = "visible";
}
}
if (typeof(window.status)!="undefined") window.status="";
};
NLSMENU.menuItemClick = function(e, itemId) {
if (!this.items[itemId].enable) return;
var m=itemId.split("_");
var prMenu = nlsMenu[m[0]];
if (this.isMenubar && this.dropOnClick && !this.isMenuOpened) {
_showMenu(prMenu, itemId);
this.isMenuOpened = true;
return null;
} else {
nlsMenuMgr[this.mgrId].hideMenus();
var mnMgr = nlsMenuMgr[this.mgrId];
var assMgr = mnMgr.assocMenuMgr;
if ( assMgr && assMgr.length > 0) {
for (var i=0; i<assMgr.length; i++) { var frm = assMgr[i]; frm[0].hideAllNlsMenu(); }
}
if (this.isMenubar && this.dropOnClick) {
var oIt = NlsGetElementById(itemId);
setMnStyle(oIt, (prMenu.items[itemId].enable ? "O" : "D"), (prMenu.items[itemId].stlprf==""?this.stlprf:prMenu.items[itemId].stlprf));
setMnIcon(prMenu, prMenu.items[itemId], "O");
this.isMenuOpened = false;
return null;
} else {
var ids = itemId.split("_");
var trgt=this.items[itemId].target;
if (trgt==null) trgt=this.target!=null?this.target:"_self";
if (this.items[itemId].url!="") {
if (trgt=='_self') {
window.location.href=this.items[itemId].url
}
else {
window.open(this.items[itemId].url, trgt);
}
} else {
return this.menuOnClick(ids[0], ids[1]);
}
}
}
};
NLSMENU.menuOnClick = function (menuId, itemId) {return true;};
NLSMENU.menuOnShow = function (menuId) {return true;};
function setMnIcon(mn, mnItm, flg) {
if (mn.showIcon && mnItm.ico && mnItm.ico.length>1) {
NlsGetElementById("ic_"+mnItm.intKey).style.display=(flg=="N"?"":"none");
NlsGetElementById("icovr_"+mnItm.intKey).style.display=(flg=="O"?"":"none");
}
if (mn.showSubIcon && mnItm.subMenuId!="" && mn.subMenuIc && mn.subMenuIc.length>1) {
NlsGetElementById("subic_"+mnItm.intKey).style.display=(flg=="N"?"":"none");
NlsGetElementById("subicovr_"+mnItm.intKey).style.display=(flg=="O"?"":"none");
}
};
function setMnStyle(it, s, prefix) {
var suff=(s=="O"?"over":"");
it.className=prefix+"nlsitemcontainer"+suff;
var r = (it.children?it.children[0]:it.childNodes[0]).rows[0];
for (var i=0; i<r.cells.length; i++) {
switch (r.cells[i].id) {
case it.id+"x1":
r.cells[i].className=prefix+"nlsiconcell"+suff; break;
case it.id+"x2":
r.cells[i].className=prefix+"nlsitem"+(s=="D"?"disable":suff);
break;
case it.id+"x3":
r.cells[i].className=prefix+"nlssubmenucell"+suff; break;
}
}
};
function nlsMenuItemOver(e, it) {
var m=it.split("_");
var oIt = NlsGetElementById(it);
var li = nlsMenu[m[0]].lsItm;
var prMenu = nlsMenu[m[0]];
if (!prMenu.active) return;
if (!prMenu.ready) return;
if (li!=null) {
var lstItm = prMenu.items[li.id];
if (lstItm.intKey==it) return;
if (lstItm.itemEffect!=null) { lstItm.itemEffect.init(); }
setMnStyle(li, (lstItm.enable ? "N" : "D"), (lstItm.stlprf==""?prMenu.stlprf:lstItm.stlprf));
if (lstItm.enable) setMnIcon(prMenu, lstItm, "N");
if (lstItm.itemEffect!=null) { lstItm.itemEffect.start(); }
var tmp=null;
if (lstItm.crsFrame) {
tmp=(lstItm.subFrame.nlsGetMenu?lstItm.subFrame.nlsGetMenu(lstItm.subMenuId):null);
} else {
tmp=nlsGetMenu(lstItm.subMenuId);
}
while(tmp!=null) {
var nli = null;
if (tmp.lsItm) {
nli = (tmp.items[tmp.lsItm.id].crsFrame ? tmp.items[tmp.lsItm.id].subFrame.nlsGetMenu(tmp.items[tmp.lsItm.id].subMenuId) : tmp.wnd.nlsGetMenu(tmp.items[tmp.lsItm.id].subMenuId));
}
tmp.hideMenu(); tmp=nli;
}
}
if (typeof(window.status)!="undefined") window.status=prMenu.items[it].url;
if (prMenu.items[it].itemEffect!=null) { prMenu.items[it].itemEffect.init(); }
setMnStyle(oIt, (prMenu.items[it].enable ? "O" : "D"), (prMenu.items[it].stlprf==""?prMenu.stlprf:prMenu.items[it].stlprf));
if (prMenu.items[it].enable) setMnIcon(prMenu, prMenu.items[it], "O");
if (prMenu.items[it].itemEffect!=null) { prMenu.items[it].itemEffect.start(); }
if (!prMenu.isMenubar || (prMenu.isMenubar && !prMenu.dropOnClick) || (prMenu.isMenubar && prMenu.dropOnClick && prMenu.isMenuOpened)) { _showMenu(prMenu, it); }
nlsMenu[m[0]].lsItm=oIt;
};
function nls_getXY(oIt) {
var p=new Object(); p.x=0;p.y=0;p.x2=0;p.y2=0; var tmp = oIt;
while(tmp) { p.x+=tmp.offsetLeft; p.y+=tmp.offsetTop; tmp=tmp.offsetParent } ;
p.x -= (window.scrollX?window.scrollX:document.body.scrollLeft);
p.y -= (window.scrollY?window.scrollY:document.body.scrollTop);
p.x2=p.x+oIt.offsetWidth; p.y2=p.y+oIt.offsetHeight;
return p;
}
function _showMenu(prMenu, it) {
var oIt = NlsGetElementById(it);
var mnIt = prMenu.items[it];
if (mnIt.subMenuId!="" && mnIt.enable==true) {
var p=nls_getXY(oIt);
if (mnIt.crsFrame) {
if (mnIt.subPos[0]=="REL") { } else { p.x = mnIt.subPos[0]; p.x2=p.x; }
if (mnIt.subPos[1]=="REL") { } else { p.y = mnIt.subPos[1]; p.y2=p.y; }
if (!mnIt.subFrame.nlsGetMenu) return;
var subMn = mnIt.subFrame.nlsGetMenu(mnIt.subMenuId);
if (!subMn) return;
subMn.showMenu(p.x, p.y, p.x2, p.y2, prMenu.orient, mnIt.subDir, mnIt.subPosAdj);
} else {
var sMenu = nlsGetMenu(mnIt.subMenuId);
if (!sMenu) return;
if (sMenu.zIndex <= prMenu.zIndex) { sMenu.zIndex = prMenu.zIndex+1 }
sMenu.showMenu(p.x, p.y, p.x2, p.y2, prMenu.orient, mnIt.subDir, mnIt.subPosAdj);
}
}
};
function nls_showMenu(mId, oIt, orient, subDir, subPosAdj) {
var sMenu = nlsGetMenu(mId);
var mgr = nlsMenuMgr[sMenu.mgrId];
mgr.clearTimeout();
if (sMenu.active) return;
var p=nls_getXY(oIt);
mgr.hideMenus();
sMenu.showMenu(p.x, p.y, p.x2, p.y2, orient, subDir, subPosAdj);
}
function nls_hideMenu(mId) {
var sMenu = nlsGetMenu(mId);
nlsMenuItemOut(sMenu.mgrId);
}
function _nlsMenuItemOver(mgrId) {
var mnMgr = nlsMenuMgr[mgrId];
mnMgr.clearTimeout();
var assMgr = mnMgr.assocMenuMgr;
if ( assMgr && assMgr.length > 0) {
for (var i=0; i<assMgr.length; i++) {
if (!assMgr[i][0].nlsMenuMgr) continue;
assMgr[i][0].nlsMenuMgr[assMgr[i][1]].clearTimeout();
}
}
for (var it in nlsMenuMgr) {
if (it!=mgrId) {
nlsMenuMgr[it].hideMenus();
}
}
};
function nlsMenuItemOut(mgrId) {
var mnMgr = nlsMenuMgr[mgrId];
mnMgr.clearTimeout();
mnMgr.setTimeout(function() { _nlsMenuItemOut(mgrId) }, mnMgr.timeout);
var assMgr = mnMgr.assocMenuMgr;
if ( assMgr && assMgr.length > 0) {
for (var i=0; i<assMgr.length; i++) {
var frm = assMgr[i];
if (!frm[0].nlsMenuMgr) continue;
frm[0].nlsMenuMgr[frm[1]].clearTimeout();
frm[0].nlsMenuMgr[frm[1]].setTimeout(function() { frm[0]._nlsMenuItemOut(mgrId); }, mnMgr.timeout);
}
}
};
function _nlsMenuItemOut(mgrId) {
nlsMenuMgr[mgrId].hideMenus();
};
function nlsGetMenu(mId) {
return nlsMenu[mId];
};
/*===================================================*/
/*NlsMenuBorder class*/
/*===================================================*/
function NlsMenuBorder(bTop, bBottom, bLeft, bRight) {
var border = "<table cellpadding=0 cellspacing=0 style='width: auto; margin: 0px;'>";
var sTop="", sBottom="", sLeft="", sRight="";
if (bTop) sTop="<td><table width='100%' cellpadding=0 cellspacing=0><tr><td class='@stlprf_mtop'></td></tr></table></td>";
if (bBottom) sBottom="<td><table width='100%' cellpadding=0 cellspacing=0><tr><td class='@stlprf_mbottom'></td></tr></table></td>";
if (bLeft) {
sLeft="<td height='100%' class='@stlprf_mleft'></td>";
if (bTop) sTop="<td class='@stlprf_mtopleft'></td>"+sTop;
if (bBottom) sBottom="<td class='@stlprf_mbottomleft'></td>"+sBottom;
}
if (bRight) {
sRight="<td height='100%' class='@stlprf_mright'></td>";
if (bTop) sTop+="<td class='@stlprf_mtopright'></td>";
if (bBottom) sBottom+="<td class='@stlprf_mbottomright'></td>";
}
if (sTop!="") sTop="<tr>"+sTop+"</tr>";
if (sBottom!="") sBottom="<tr>"+sBottom+"</tr>";
border=border+sTop+"<tr height='100%'>"+sLeft+"<td>@menu</td>"+sRight+"</tr>"+sBottom;
border+="</table>";
this.applyBorder = function (smenu, stlprf) {
var b=border.replace(/@stlprf_/gi, stlprf);
return b.replace(/@menu/gi, smenu);
};
return this;
};
/*===================================================*/
/*NlsMenuBar class*/
/*===================================================*/
NLSMENU.isMenuOpened = false;
NLSMENU.dropOnClick = false;
NLSMENU.renderMenubar = function () {
return this.renderMenu();
};
function NlsMenubar(mId) {
var mnBar = new NlsMenu(mId);
mnBar.isMenubar=true;
mnBar.active=true;
return mnBar;
};
/*===================================================*/
/*Public general methods*/
/*===================================================*/
function hideAllNlsMenu() {
for (it in nlsMenu) {if (nlsMenu[it].active) nlsMenu[it].hideMenu();}
};
/**Cross browser related methods*/
function NlsGetElementById(id) {
if (document.all) {
return document.all(id);
} else
if (document.getElementById) {
return document.getElementById(id);
}
};
Property changes on: trunk/core/admin_templates/js/nlsmenu.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/admin_templates/js/ajax.js
===================================================================
--- trunk/core/admin_templates/js/ajax.js (revision 7634)
+++ trunk/core/admin_templates/js/ajax.js (revision 7635)
@@ -1,324 +1,324 @@
function preg_print_pre(obj, reg)
{
if (!reg) reg = /.*/;
var p = ''
for (var prop in obj) {
if (prop.match(reg) ) {
p += prop + ': '+obj[prop] + '\n'
}
}
alert(p)
}
// Main AJAX classs
function Request() {}
Request.timeout = 15000; //5 seconds
Request.method = 'GET';
Request.headers = new Array();
Request.params = null;
Request.makeRequest = function(p_url, p_busyReq, p_progId, p_successCallBack, p_errorCallBack, p_pass, p_object) {
//p_url: the web service url
//p_busyReq: is a request for this object currently in progress?
//p_progId: element id where progress HTML should be shown
//p_successCallBack: callback function for successful response
//p_errorCallBack: callback function for erroneous response
//p_pass: string of params to pass to callback functions
//p_object: object of params to pass to callback functions
if (p_busyReq) return;
var req = Request.getRequest();
if (req != null) {
p_busyReq = true;
Request.showProgress(p_progId);
req.onreadystatechange = function() {
if (req.readyState == 4) {
p_busyReq = false;
window.clearTimeout(toId);
try {
if (req.status == 200) {
// preg_print_pre(req)
p_successCallBack(req, p_pass, p_object);
} else {
p_errorCallBack(req, p_pass, p_object);
}
Request.hideProgress(p_progId);
}
catch (e) {
// alert('AJAX error')
}
}
}
var $ajax_mark = (p_url.indexOf('?') ? '&' : '?') + 'ajax=yes';
req.open(Request.method, p_url + $ajax_mark, true);
if (Request.method == 'POST') {
Request.headers['Content-type'] = 'application/x-www-form-urlencoded';
Request.headers['referer'] = p_url;
}
else {
Request.headers['If-Modified-Since'] = 'Sat, 1 Jan 2000 00:00:00 GMT';
}
Request.sendHeaders(req);
if (Request.method == 'POST') {
req.send(Request.params);
Request.method = 'GET'; // restore method back to GET
}
else {
req.send(null);
}
var toId = window.setTimeout( function() {if (p_busyReq) req.abort();}, Request.timeout );
}
}
Request.sendHeaders = function($request) {
for (var $header_name in Request.headers) {
$request.setRequestHeader($header_name, Request.headers[$header_name]);
}
Request.headers = new Array(); // reset header afterwards
}
Request.getRequest = function() {
var xmlHttp;
try { xmlHttp = new ActiveXObject('MSXML2.XMLHTTP'); return xmlHttp; } catch (e) {}
try { xmlHttp = new ActiveXObject('Microsoft.XMLHTTP'); return xmlHttp; } catch (e) {}
try { xmlHttp = new XMLHttpRequest(); return xmlHttp; } catch(e) {}
return null;
}
Request.showProgress = function(p_id) {
if (p_id != '') {
Request.setOpacity(20, p_id);
if (!document.getElementById(p_id + '_progress')) {
document.body.appendChild(Request.getProgressObject(p_id));
}
else {
var $progress_div = document.getElementById(p_id + '_progress');
$progress_div.style.top = getRealTop(p_id) + 'px';
$progress_div.style.height = document.getElementById(p_id).clientHeight;
$progress_div.style.display = 'block';
}
// document.getElementById(p_id).innerHTML = Request.getProgressHtml();
}
}
Request.hideProgress = function(p_id) {
if (p_id != '') {
document.getElementById(p_id + '_progress').style.display = 'none';
Request.setOpacity(100, p_id);
}
}
Request.setOpacity = function (opacity, id) {
var object = document.getElementById(id).style;
object.opacity = (opacity / 100);
object.MozOpacity = (opacity / 100);
object.KhtmlOpacity = (opacity / 100);
object.filter = "alpha(opacity=" + opacity + ")";
}
Request.getProgressHtml = function() {
return "<p class='progress'>" + Request.progressText + "<br /><img src='img/ajax_progress.gif' align='absmiddle' width='100' height='7' alt='" + Request.progressText + "'/></p>";
}
Request.getProgressObject = function($id) {
var $div = document.createElement('DIV');
var $parent_div = document.getElementById($id);
$div.id = $id + '_progress';
$div.style.width = $parent_div.clientWidth + 'px';
$div.style.height = '150px'; // default height if div is empty (first ajax request for div)
$div.style.left = getRealLeft($parent_div) + 'px';
$div.style.top = getRealTop($parent_div) + 'px';
$div.style.position = 'absolute';
/*$div.style.border = '1px solid green';
$div.style.backgroundColor = '#FF0000';*/
$div.innerHTML = '<table style="width: 100%; height: 100%;"><tr><td style="text-align: center;">'+Request.progressText+'<br /><img src="img/ajax_progress.gif" align="absmiddle" width="100" height="7" alt="'+escape(Request.progressText)+'" /></td></tr></table>';
return $div;
}
Request.getErrorHtml = function(p_req) {
//TODO: implement accepted way to handle request error
return '[status: ' + p_req.status + '; status_text: ' + p_req.statusText + '; responce_text: ' + p_req.responseText + ']';
}
Request.serializeForm = function(theform) {
if (typeof(theform) == 'string') {
theform = document.getElementById(theform);
}
var els = theform.elements;
var len = els.length;
var queryString = '';
Request.addField = function(name, value) {
if (queryString.length > 0) queryString += '&';
queryString += encodeURIComponent(name) + '=' + encodeURIComponent(value);
};
for (var i = 0; i<len; i++) {
var el = els[i];
if (el.disabled) continue;
switch(el.type) {
case 'text':
case 'password':
case 'hidden':
case 'textarea':
Request.addField(el.name, el.value);
break;
case 'select-one':
if (el.selectedIndex >= 0) {
Request.addField(el.name, el.options[el.selectedIndex].value);
}
break;
case 'select-multiple':
for (var j = 0; j < el.options.length; j++) {
if (!el.options[j].selected) continue;
Request.addField(el.name, el.options[j].value);
}
break;
case 'checkbox':
case 'radio':
if (!el.checked) continue;
Request.addField(el.name,el.value);
break;
}
}
return queryString;
};
// AJAX ProgressBar classs
function AjaxProgressBar($url) {
this.WindowTitle = this.GetWindow().document.title;
this.URL = $url;
this.BusyRequest = false;
this.LastResponceTime = this.GetMicroTime();
this.ProgressPercent = 0; // progress percent
this.ProgressTime = new Array();
this.Query();
}
AjaxProgressBar.prototype.GetWindow = function() {
return window.parent ? window.parent : window;
}
AjaxProgressBar.prototype.GetMicroTime = function() {
var $now = new Date();
return Math.round($now.getTime() / 1000); // because miliseconds are returned too
}
AjaxProgressBar.prototype.Query = function() {
// prompt('requestinng', this.URL);
Request.makeRequest(this.URL, this.BusyRequest, '', this.successCallback, this.errorCallback, '', this);
}
// return time needed for progress to finish
AjaxProgressBar.prototype.GetEstimatedTime = function() {
return Math.ceil((100 - this.ProgressPercent) * Math.sum(this.ProgressTime) / this.ProgressPercent);
}
AjaxProgressBar.prototype.successCallback = function($request, $params, $object) {
var $responce = $request.responseText;
var $match_redirect = new RegExp('^#redirect#(.*)').exec($responce);
if ($match_redirect != null) {
$object.showProgress(100);
// redirect to external template requested
window.location.href = $match_redirect[1];
return false;
}
if ($object.showProgress($responce)) {
$object.Query();
}
}
AjaxProgressBar.prototype.errorCallback = function($request, $params, $object) {
alert('AJAX Error; class: AjaxProgressBar; ' + Request.getErrorHtml($request));
}
AjaxProgressBar.prototype.FormatTime = function ($seconds) {
$seconds = parseInt($seconds);
var $minutes = Math.floor($seconds / 60);
if ($minutes < 10) $minutes = '0' + $minutes;
$seconds = $seconds % 60;
if ($seconds < 10) $seconds = '0' + $seconds;
return $minutes + ':' + $seconds;
}
AjaxProgressBar.prototype.showProgress = function ($percent) {
this.ProgressPercent = $percent;
var $now = this.GetMicroTime();
this.ProgressTime[this.ProgressTime.length] = $now - this.LastResponceTime;
this.LastResponceTime = $now;
var $display_progress = parseInt(this.ProgressPercent);
this.GetWindow().document.title = $display_progress + '% - ' + this.WindowTitle;
document.getElementById('progress_display[percents_completed]').innerHTML = $display_progress + '%';
document.getElementById('progress_display[elapsed_time]').innerHTML = this.FormatTime( Math.sum(this.ProgressTime) );
document.getElementById('progress_display[Estimated_time]').innerHTML = this.FormatTime( this.GetEstimatedTime() );
document.getElementById('progress_bar[done]').style.width = $display_progress + '%';
document.getElementById('progress_bar[left]').style.width = (100 - $display_progress) + '%';
return $percent < 100 ? true : false;
}
// AJAX PopupManager class
function AjaxPopupManager($url) {
this.URL = $url;
this.ResponceFunction = null;
this.PopupSizes = new Array();
}
AjaxPopupManager.prototype.GetSize = function ($template) {
- if (typeof this.ResponceFunction != 'function') {
- alert ('Please define responce function first');
+ if (this.ResponceFunction == null) {
+ alert ('Please define responce function first (type: '+typeof(this.ResponceFunction)+')');
}
if (!isset(this.PopupSizes[$template])) {
var $url = this.URL + '&type=GetPopupSize&template_name=' + $template;
// alert('from ajax: '+$url);
Request.makeRequest($url, this.BusyRequest, '', this.successCallback, this.errorCallback, ['GetSize', $template], this);
}
else {
// alert('from cache');
this.ResponceFunction(this.PopupSizes[$template]);
}
}
AjaxPopupManager.prototype.successCallback = function($request, $params, $object) {
var $responce = $request.responseText;
var $match_redirect = new RegExp('^#redirect#(.*)').exec($responce);
if ($match_redirect != null) {
// redirect to external template requested
window.location.href = $match_redirect[1];
return false;
}
switch ($params[0]) {
case 'GetSize':
// store responce to cache for future use
$object.PopupSizes[ $params[1] ] = $responce;
break;
}
$object.ResponceFunction($responce);
$object.ResponceFunction = null; // reset responce function
}
AjaxPopupManager.prototype.errorCallback = function($request, $params, $object) {
alert('AJAX Error; class: AjaxPopupManager; ' + Request.getErrorHtml($request));
}
\ No newline at end of file
Property changes on: trunk/core/admin_templates/js/ajax.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/admin_templates/js/grid.js
===================================================================
--- trunk/core/admin_templates/js/grid.js (revision 7634)
+++ trunk/core/admin_templates/js/grid.js (revision 7635)
@@ -1,452 +1,464 @@
var $GridManager = new GridManager();
function GridManager () {
this.Grids = Grids; // get all from global variable, in future replace all references to it with $GridManager.Grids
this.AlternativeGrids = new Array();
}
GridManager.prototype.AddAlternativeGrid = function ($source_grid, $destination_grid, $reciprocal)
{
if ($source_grid == $destination_grid) {
return false;
}
if (typeof(this.AlternativeGrids[$source_grid]) == 'undefined') {
// alternative grids not found, create empty list
this.AlternativeGrids[$source_grid] = new Array();
}
if (!in_array($destination_grid, this.AlternativeGrids[$source_grid])) {
// alternative grids found, check if not added already
this.AlternativeGrids[$source_grid].push($destination_grid);
}
if ($reciprocal) {
this.AddAlternativeGrid($destination_grid, $source_grid);
}
}
GridManager.prototype.ClearAlternativeGridsSelection = function ($source_prefix)
{
if (!this.AlternativeGrids[$source_prefix]) return false;
var $i = 0;
var $destination_prefix = '';
while ($i < this.AlternativeGrids[$source_prefix].length) {
$destination_prefix = this.AlternativeGrids[$source_prefix][$i];
if (this.Grids[$destination_prefix]) {
// alternative grid set, but not yet loaded by ajax
this.Grids[$destination_prefix].ClearSelection();
}
$i++;
}
}
GridManager.prototype.CheckDependencies = function ($prefix) {
if (typeof(this.Grids[$prefix]) != 'undefined') {
this.Grids[$prefix].CheckDependencies('GridManager.CheckDependencies');
}
}
function GridItem(grid, an_element, cb, item_id, class_on, class_off)
{
this.Grid = grid;
this.selected = false;
this.id = an_element.id;
this.ItemId = item_id;
this.sequence = parseInt(an_element.getAttribute('sequence'));
- this.class_on = class_on;
+// this.class_on = class_on;
+
if (class_off == ':original') {
this.class_off = an_element.className;
}
else
this.class_off = class_off;
+
+ if (class_on.match(/(.*):(.*)/)) {
+ var even = RegExp.$2;
+ var odd = RegExp.$1;
+ this.class_on = this.class_off.match(/even/) ? even : odd
+ }
+ else {
+ this.class_on = class_on
+ }
+
this.HTMLelement = an_element;
if (document.getElementById('left_'+an_element.id)) {
this.LeftElement = document.getElementById('left_'+an_element.id);
}
else {
this.LeftElement = false;
}
this.CheckBox = cb;
this.value = this.ItemId;
this.ItemType = 11;
}
GridItem.prototype.Init = function ()
{
this.HTMLelement.GridItem = this;
this.HTMLelement.onclick = function(ev) {
this.GridItem.Click(ev);
};
this.HTMLelement.ondblclick = function(ev) {
this.GridItem.DblClick(ev);
}
if ( this.LeftElement ) {
this.LeftElement.GridItem = this;
this.LeftElement.onclick = function(ev) {
this.GridItem.Click(ev);
};
this.LeftElement.ondblclick = function(ev) {
this.GridItem.DblClick(ev);
}
}
if ( isset(this.CheckBox) ) {
this.CheckBox.GridItem = this;
this.CheckBox.onclick = function(ev) {
this.GridItem.cbClick(ev);
};
this.CheckBox.ondblclick = function(ev) {
this.GridItem.DblClick(ev);
}
}
}
GridItem.prototype.DisableClicking = function ()
{
this.HTMLelement.onclick = function(ev) {
return false;
};
this.HTMLelement.ondblclick = function(ev) {
return false;
}
if ( this.LeftElement ) {
this.LeftElement.onclick = function(ev) {
return false;
};
this.LeftElement.ondblclick = function(ev) {
return false;
}
}
if ( isset(this.CheckBox) ) {
this.CheckBox.onclick = function(ev) {
return false;
};
}
}
GridItem.prototype.Select = function ()
{
if (this.selected) return;
this.selected = true;
this.HTMLelement.className = this.class_on;
if ( this.LeftElement ) {
this.LeftElement.className = this.class_on;
}
if ( isset(this.CheckBox) ) {
this.CheckBox.checked = true;
}
this.Grid.LastSelectedId = this.ItemId;
this.Grid.SelectedCount++;
// this is for in-portal only (used in relation select)
LastCheckedItem = this;
if (typeof (this.Grid.OnSelect) == 'function' ) {
this.Grid.OnSelect(this.ItemId);
}
}
GridItem.prototype.UnSelect = function ( force )
{
if ( !this.selected && !force) return;
this.selected = false;
this.HTMLelement.className = this.class_off;
if ( this.LeftElement ) {
this.LeftElement.className = this.class_off;
}
if ( isset(this.CheckBox) ) {
this.CheckBox.checked = false;
}
this.Grid.SelectedCount--;
if (typeof (this.Grid.OnUnSelect) == 'function' ) {
this.Grid.OnUnSelect(this.ItemId);
}
this.Grid.LastSelectedId = null;
}
GridItem.prototype.ClearBrowserSelection = function() {
ClearBrowserSelection();
}
GridItem.prototype.Click = function (ev)
{
- this.ClearBrowserSelection();
+ //this.ClearBrowserSelection();
this.Grid.ClearAlternativeGridsSelection('GridItem.Click');
var e = !is.ie ? ev : window.event;
if (e.shiftKey && !this.Grid.RadioMode) {
+ this.ClearBrowserSelection();
this.Grid.SelectRangeUpTo(this.sequence);
}
else {
if (e.ctrlKey && !this.Grid.RadioMode) {
this.Toggle()
}
else {
if (!(this.Grid.RadioMode && this.Grid.LastSelectedId == this.ItemId && this.selected)) {
// don't clear selection if item same as current is selected
if (!this.Grid.StickySelection) {
this.Grid.ClearSelection(null,'GridItem.Click');
}
else {
if (this.Grid.LastSelectedId == this.ItemId) {
return;
}
}
this.Toggle();
}
}
}
this.Grid.CheckDependencies('GridItem.Click');
e.cancelBubble = true;
}
GridItem.prototype.cbClick = function (ev)
{
var e = is.ie ? window.event : ev;
if (this.Grid.RadioMode) this.Grid.ClearSelection(null,'GridItem.cbClick');
this.Grid.ClearAlternativeGridsSelection('GridItem.cbClick');
this.Toggle();
this.Grid.CheckDependencies('GridItem.cbClick');
e.cancelBubble = true;
}
GridItem.prototype.DblClick = function (ev)
{
var e = is.ie ? window.event : ev;
this.Grid.Edit();
}
GridItem.prototype.Toggle = function ()
{
if (this.selected) this.UnSelect()
else {
this.Grid.LastSelectedSequence = this.sequence;
this.Select();
}
}
GridItem.prototype.FallsInRange = function (from, to)
{
return (from <= to) ?
(this.sequence >= from && this.sequence <= to) :
(this.sequence >= to && this.sequence <= from);
}
function Grid(prefix, class_on, class_off, dbl_click, toolbar)
{
this.prefix = prefix;
this.class_on = class_on;
this.class_off = class_off;
this.Items = new Array();
this.LastSelectedSequence = 1;
this.LastSelectedId = null;
this.DblClick = dbl_click;
this.ToolBar = toolbar;
this.SelectedCount = 0;
this.AlternativeGrids = new Array();
this.DependantButtons = new Array();
this.RadioMode = false;
// K3-style sticky selection, selection an item does not unselect currently selected
// even w/o Ctrl key pressed
this.StickySelection = false;
}
Grid.prototype.AddItem = function( an_item ) {
this.Items[an_item.id] = an_item;
}
Grid.prototype.AddItemsByIdMask = function ( tag, mask, cb_mask ) {
var $item_id=0;
elements = document.getElementsByTagName(tag.toUpperCase());
for (var i=0; i < elements.length; i++) {
if ( typeof(elements[i].id) == 'undefined') {
continue;
}
if ( !elements[i].id.match(mask)) continue;
$item_id=RegExp.$1;
cb_name = cb_mask.replace('$$ID$$',$item_id);
cb = document.getElementById(cb_name);
if (typeof(cb) == 'undefined') alert ('No Checkbox defined for item '+elements[i].id);
this.AddItem( new GridItem( this, elements[i], cb, $item_id, this.class_on, this.class_off ) );
}
}
Grid.prototype.InitItems = function() {
for (var i in this.Items) {
this.Items[i].Init();
}
this.ClearSelection( true,'Grid.InitItems' );
var a_Grid = this;
addEvent(document, 'keyup', function(ev) {
var e = !is.ie ? ev : window.event;
switch (e.keyCode) {
case 65:
if (!e.ctrlKey) break;
a_Grid.SelectAll();
ClearBrowserSelection()
// window.setTimeout(ClearBrowserSelection, 500);
break;
case 27:
a_Grid.ClearSelection();
break;
case 33:
case 37:
//alert('<-') // go to prev page here
break;
case 34:
case 39:
// alert('->') // go to next page here
break;
case 88:
ClearBrowserSelection();
break;
}
});
}
Grid.prototype.DisableClicking = function() {
for (var i in this.Items) {
this.Items[i].DisableClicking();
}
this.ClearSelection( true, 'Grid.DisableClicking' );
}
Grid.prototype.ClearSelection = function( force, called_from ) {
// alert('selection clear. force: '+force+'; called_from: '+called_from);
if (typeof(force) == 'undefined') force = false;
if (this.CountSelected() == 0 && !force) return;
for (var i in this.Items) {
this.Items[i].UnSelect(force);
}
this.SelectedCount = 0;
this.CheckDependencies('Grid.ClearSelection');
}
Grid.prototype.GetSelected = function() {
var $ret = new Array();
for (var i in this.Items) {
if (this.Items[i].selected) {
$ret[$ret.length] = this.Items[i].ItemId;
}
}
return $ret;
}
Grid.prototype.InvertSelection = function() {
for (var i in this.Items)
{
if( this.Items[i].selected )
{
this.Items[i].UnSelect();
}
else
{
this.Items[i].Select();
}
}
this.CheckDependencies('Grid.InvertSelection');
}
Grid.prototype.SelectAll = function() {
for (var i in this.Items) {
this.Items[i].Select();
}
this.CheckDependencies('Grid.SelectAll');
this.ClearAlternativeGridsSelection('Grid.SelectAll');
}
Grid.prototype.SelectRangeUpTo = function( last_sequence ) {
for (var i in this.Items) {
if (this.Items[i].FallsInRange(this.LastSelectedSequence, last_sequence)) {
this.Items[i].Select();
}
}
}
Grid.prototype.CountSelected = function ()
{
return this.SelectedCount;
}
Grid.prototype.Edit = function() {
if ( this.CountSelected() == 0 ) return;
this.DblClick();
}
Grid.prototype.SetDependantToolbarButtons = function($buttons, $direct, $mode) {
if (!isset($direct)) $direct = true; // direct (use false for invert mode)
if (!isset($mode)) $mode = 1; // enable/disable (use 2 for show/hide mode)
for (var i in $buttons) {
this.DependantButtons.push(new Array($buttons[i], $direct, $mode));
}
//this.DependantButtons = buttons;
this.CheckDependencies('Grid.SetDependantToolbarButtons');
}
Grid.prototype.CheckDependencies = function($called_from)
{
// alert('prefix: ' + this.prefix + '; ' + $called_from + ' -> Grid.CheckDependencies');
var enabling = (this.CountSelected() > 0);
for (var i in this.DependantButtons) {
if (this.DependantButtons[i][0].match("portal:(.*)")) {
button_name = RegExp.$1;
if (toolbar) {
if (enabling == this.DependantButtons[i][1]) {
toolbar.enableButton(button_name, true);
}
else
{
toolbar.disableButton(button_name, true);
}
}
}
else {
if (this.DependantButtons[i][2] == 1) {
this.ToolBar.SetEnabled(this.DependantButtons[i][0], enabling == this.DependantButtons[i][1]);
}
else {
this.ToolBar.SetVisible(this.DependantButtons[i][0], enabling == this.DependantButtons[i][1]);
}
}
}
//if (enabling) this.ClearAlternativeGridsSelection('Grid.CheckDependencies');
}
Grid.prototype.ClearAlternativeGridsSelection = function (called_from)
{
$GridManager.ClearAlternativeGridsSelection(this.prefix);
}
Grid.prototype.AddAlternativeGrid = function (alt_grid, reciprocal)
{
var $dst_prefix = typeof('alt_grid') == 'string' ? alt_grid : alt_grid.prefix;
$GridManager.AddAlternativeGrid(this.prefix, $dst_prefix, reciprocal);
}
Grid.prototype.FirstSelected = function ()
{
min_sequence = null;
var res = null
for (var i in this.Items) {
if (!this.Items[i].selected) continue;
if (min_sequence == null)
min_sequence = this.Items[i].sequence;
if (this.Items[i].sequence <= min_sequence) {
res = this.Items[i].ItemId;
min_sequence = this.Items[i].sequence;
}
}
return res;
}
\ No newline at end of file
Property changes on: trunk/core/admin_templates/js/grid.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/admin_templates/js/grid_scroller.js
===================================================================
--- trunk/core/admin_templates/js/grid_scroller.js (revision 7634)
+++ trunk/core/admin_templates/js/grid_scroller.js (revision 7635)
@@ -1,741 +1,732 @@
var sheetRules; // all rules in stylesheet Set by initStyleChange()
var currentRule; // which rule are we editing? Set by assignRule()
var defaultStyles = new Array();
function StyleManager() {}
StyleManager.InitStyles = function() {
if (!document.styleSheets) return;
var sheets = document.styleSheets;
this.Map = new Object();
// alert('total '+sheets.length+' sheets')
for (var i=0;i<sheets.length;i++) {
var currentSheet = sheets[i];
if (currentSheet.cssRules)
sheetRules = currentSheet.cssRules
else if (currentSheet.rules)
sheetRules = currentSheet.rules;
else {
// alert('bad sheet '+currentSheet.href);
continue;
}
// alert('sheet: '+currentSheet.href)
for (var ii=0;ii<sheetRules.length;ii++) {
var value = sheetRules[ii].selectorText;
if (value.match(',')) { // Mozilla does not break comma-separated selectors into separate rules...
var subselectors = value.split(',');
for (var sub in subselectors) {
var real_name = subselectors[sub].replace(/^[ \t]*(.*)[ \t]*/, '$1');
this.Map[real_name] = sheetRules[ii]
}
}
else {
this.Map[value.toLowerCase()] = sheetRules[ii];
}
}
}
this.Inited = true;
// preg_print_pre(this.Map, /last/);
}
StyleManager.ChangeStyle = function(selector, style, value)
{
if (!this.Inited) this.InitStyles()
rule = this.Map[selector.toLowerCase()];
if (!rule) {
alert('rule '+selector+' not found')
return;
}
rule.style[style] = value;
}
function preg_print_pre(obj, reg)
{
if (!reg) reg = /.*/;
var p = ''
for (var prop in obj) {
if (prop.match(reg) ) {
p += prop + ': '+obj[prop] + '\n'
}
}
alert(p)
}
function findPos(obj) {
var curleft = curtop = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
return [curleft,curtop];
}
-function execJS(node)
-{
- var bSaf = (navigator.userAgent.indexOf('Safari') != -1);
- var bOpera = (navigator.userAgent.indexOf('Opera') != -1);
- var bMoz = (navigator.appName == 'Netscape');
-
- if (!node) return;
-
- /* IE wants it uppercase */
- var st = node.getElementsByTagName('SCRIPT');
- var strExec;
-
- for(var i=0;i<st.length; i++)
- {
- if (bSaf) {
- strExec = st[i].innerHTML;
- st[i].innerHTML = "";
- } else if (bOpera) {
- strExec = st[i].text;
- st[i].text = "";
- } else if (bMoz) {
- strExec = st[i].textContent;
- st[i].textContent = "";
- } else {
- strExec = st[i].text;
- st[i].text = "";
- }
-
- try {
- var x = document.createElement("script");
- x.type = "text/javascript";
-
- /* In IE we must use .text! */
- if ((bSaf) || (bOpera) || (bMoz))
- x.innerHTML = strExec;
- else x.text = strExec;
-
- document.getElementsByTagName("head")[0].appendChild(x);
- } catch(e) {
- alert(e);
- }
- }
-};
-
var startTime,endTime;
function getDimensions(obj) {
var style
if (obj.currentStyle) {
style = obj.currentStyle;
}
else {
style = getComputedStyle(obj,'');
}
padding = [parseInt(style.paddingTop), parseInt(style.paddingRight), parseInt(style.paddingBottom), parseInt(style.paddingLeft)]
border = [parseInt(style.borderTopWidth), parseInt(style.borderRightWidth), parseInt(style.borderBottomWidth), parseInt(style.borderLeftWidth)]
for (var i in padding) if ( isNaN( padding[i] ) ) padding[i] = 0
for (var i in border) if ( isNaN( border[i] ) ) border[i] = 0
var result = new Object();
result.innerHeight = obj.clientHeight - padding[0] - padding[2];
result.innerWidth = obj.clientWidth - padding[1] - padding[3];
result.padding = padding;
result.borders = border;
return result;
}
var profile = 0;
var profile_total = 0;
var startTime = new Date().getTime();
function Profile(message,force)
{
if (profile || force) {
endTime = new Date().getTime();
var tmp = (endTime-startTime);
profile_total += tmp;
alert(message+' took '+tmp+' ms of '+profile_total)
startTime = new Date().getTime();
}
}
function ResetStart()
{
startTime = new Date().getTime();
profile_total = 0;
}
+function addLoadEvent(func) {
+ var oldonload = window.onload;
+ if (typeof window.onload != 'function') {
+ window.onload = func;
+ } else {
+ window.onload = function() {
+ if (oldonload) {
+ oldonload();
+ }
+ func();
+ }
+ }
+}
+
function GridScroller(grid_id, w, h)
{
this.GridId = grid_id
this.Footer = false;
this.LeftCells = 0;
this.LeftWidth = 0;
this.BottomOffset = 0;
this.Width = w;
this.Height = h;
this.AutoWidth = true;
this.ScrollerW = 0;
this.ScrollerH = 0;
this.MinWidths = [];
this.IDs = [];
this.Rendered = false;
this.PickerCRC = '';
}
GridScroller.prototype.Render = function(id)
{
ResetStart();
// var widths = this.PrepareWidths();
// this.MinWidths = [40,null,null,250]
this.MinWidths = this.PrepareWidths(); // [50,70,90,150,150,110,70,111];
html = this.AltHTML();
// Profile('Getting HTML',1);
if (id && id != '') {
document.getElementById(id).innerHTML = '<div id="main_div_'+this.GridId+'">'+html+'</div>';
execJS(document.getElementById(id))
}
else {
if (this.Rendered) {
this.Render('main_div_'+this.GridId);
return;
}
document.write('<div id="main_div_'+this.GridId+'">'+html+'</div>');
}
this.Rendered = true;
this.SetReferences()
document.body.style.height = '100%';
document.body.style.overflow = 'hidden';
document.body.scroll = 'no'
if (getFrame('head').ScrollerW) {
this.ScrollerW = getFrame('head').ScrollerW;
this.ScrollerH = getFrame('head').ScrollerH;
}
else {
this.ScrollerW = this.MainInner.offsetWidth - this.MainInner.clientWidth
this.ScrollerH = this.MainInner.offsetHeight - this.MainInner.clientHeight
getFrame('head').ScrollerW = this.ScrollerW
getFrame('head').ScrollerH = this.ScrollerH
}
// Profile('Up to col widths',1);
if (!this.UpdateColWidths()) return;
if (this.Width == 'auto') {
this.Resize( this.GetAutoSize() );
}
else {
this.Resize();
}
this.TheGrid.style.visibility = 'visible'
this.MainScroller.style.visibility = 'visible'
// Profile('Finalizng', 1);
var the_grid = this;
if (document.all) {
$status = window.attachEvent('onresize', function(ev) { the_grid.AutoResize() });
} else {
$status = window.addEventListener('resize', function(ev) { the_grid.AutoResize() }, true);
}
if (document.all) {
this.DataScroller.onmousewheel = function(ev) {
var e = document.all ? window.event : ev;
this.TheGrid.MainInner.scrollTop += -e.wheelDelta/2
this.TheGrid.SyncScroll();
}
}
else {
this.DataScroller.addEventListener("DOMMouseScroll", function(ev) {
var e = document.all ? window.event : ev;
this.TheGrid.MainInner.scrollTop += e.detail*10
this.TheGrid.SyncScroll();
}, false);
}
+
+ addLoadEvent( function() {the_grid.AutoResize()} );
}
GridScroller.prototype.SetReferences = function() {
this.MainOuter = document.getElementById('outer_main_'+this.GridId );
this.MainInner = document.getElementById('inner_main_'+this.GridId)
this.MainScroller = document.getElementById('main_scroller_'+this.GridId)
this.TheGrid = document.getElementById(this.GridId );
this.HeadTable = document.getElementById('header_'+this.GridId);
this.HeadScroller = document.getElementById('inner_header_'+this.GridId);
this.HeadOuter = document.getElementById('outer_header_'+this.GridId);
this.DataTable = document.getElementById('data_'+this.GridId);
this.DataScroller = document.getElementById('inner_data_'+this.GridId);
this.DataOuter = document.getElementById('outer_data_'+this.GridId);
if (this.HasFooter) {
this.FooterTable = document.getElementById('footer_'+this.GridId);
this.FooterScroller = document.getElementById('inner_footer_'+this.GridId);
this.FooterOuter = document.getElementById('outer_footer_'+this.GridId);
}
if (this.LeftCells != 0) {
this.LeftHeaderTable = document.getElementById('left_header_'+this.GridId);
this.LeftHeaderScroller = document.getElementById('inner_left_header_'+this.GridId);
this.LeftHeaderOuter = document.getElementById('outer_left_header_'+this.GridId);
this.LeftDataTable = document.getElementById('left_data_'+this.GridId);
this.LeftDataScroller = document.getElementById('inner_left_data_'+this.GridId);
this.LeftDataOuter = document.getElementById('outer_left_data_'+this.GridId);
if (this.HasFooter) {
this.LeftFooterTable = document.getElementById('left_footer_'+this.GridId);
this.LeftFooterScroller = document.getElementById('inner_left_footer_'+this.GridId);
this.LeftFooterOuter = document.getElementById('outer_left_footer_'+this.GridId);
}
}
this.DataScroller.TheGrid = this;
this.MainInner.TheGrid = this;
this.Dot = document.getElementById('dot_'+this.GridId)
this.MainOuter.className = 'grid-scrollable'
if (!is.ie) {
this.MainOuter.style.marginLeft = '-1px';
}
}
GridScroller.prototype.UpdateColWidths = function() {
pos = findPos(this.Dot)
this.TheGrid.style.left = (pos[0])+ 'px'
this.TheGrid.style.top = (pos[1]) + 'px'
// alert('MinWidths: '+this.MinWidths.length + ' vs Data ' + this.Header[0].length)
if (this.MinWidths.length < this.Header[0].length) {
var widths = new Array();
var total = 0;
StyleManager.ChangeStyle('td.grid-header-last-cell', 'width', '123px')
StyleManager.ChangeStyle('td.grid-data-last-cell', 'width', 'auto')
if (this.HasFooter()) {
StyleManager.ChangeStyle('td.grid-footer-last-cell', 'width', 'auto')
}
if (this.LeftCells) {
widths.push(this.LeftHeaderTable.clientWidth)
}
var header_widths = this.GetWidths('header_'+this.GridId);
// print_pre(header_widths)
var data_widths = this.GetWidths('data_'+this.GridId);
// print_pre(data_widths)
for (var i=0; i<header_widths.length; i++)
{
target = data_widths[i] ? data_widths[i] : header_widths[i];
if (target < header_widths[i]+20) target = header_widths[i]+20;
widths.push(target);
total += target;
}
this.MinWidths = widths;
// print_pre(this.MinWidths)
StyleManager.ChangeStyle('td.grid-header-last-cell', 'width', '100%')
StyleManager.ChangeStyle('td.grid-data-last-cell', 'width', '100%')
if (this.HasFooter()) {
StyleManager.ChangeStyle('td.grid-footer-last-cell', 'width', '100%')
}
// this.Render();
return false;
}
if (this.LeftCells != 0) {
this.SetHeights('left_header_'+this.GridId, this.GetHeights('header_'+this.GridId));
this.SetHeights('left_data_'+this.GridId, this.GetHeights('data_'+this.GridId));
if (this.HasFooter()) {
this.SetHeights('left_footer_'+this.GridId, this.GetHeights('footer_'+this.GridId));
}
}
if (this.HasFooter()) {
this.FooterHeight = this.FooterTable.offsetHeight;
this.FooterOuter.style.height = this.FooterHeight + 'px'
}
else {
this.FooterHeight = 0;
}
this.HeadHeight = this.HeadTable.offsetHeight;
this.DataHeight = this.DataTable.offsetHeight;
this.HeadOuter.style.height = (this.HeadHeight) + 'px'
if (this.LeftCells != 0) {
this.LeftWidth = Math.max(this.LeftHeaderTable.offsetWidth, this.LeftDataTable.offsetWidth)
this.LeftHeaderOuter.style.height = (this.HeadHeight) + 'px'
if (this.HasFooter()) {
this.LeftFooterOuter.style.height = (this.FooterHeight) + 'px'
this.LeftWidth = Math.max(this.LeftWidth, this.LeftFooterTable.offsetWidth);
}
}
this.MainInner.onscroll = function() {
this.TheGrid.SyncScroll()
}
this.MainOuter.style.width = 'auto'
this.HeaderWidth = this.HeadTable.offsetWidth + this.LeftWidth;
this.DataTotalHeight = this.DataHeight + this.HeadHeight + this.FooterHeight;
return true;
}
GridScroller.prototype.SetHeights = function(table_id, heights)
{
var table = document.getElementById(table_id);
for (var row=0; row<table.rows.length; row++)
{
var width = this.MinWidths[0] ? this.MinWidths[0] + 'px' : 'auto';
table.rows[row].cells[0].innerHTML = '<div style="background-color: inherit; display: table-cell; line-height: '+(heights[row])+'px; height: '+(heights[row]) +'px; width: '+width+'; overflow: hidden; background-color: inherit;">' + table.rows[row].cells[0].innerHTML + '</div>'
table.rows[row].cells[0].style.height = heights[row]+'px';
// heights.push( table.rows[0].cells[0].offsetHeight )
// alert('get ('+row+')'+table.rows[0].cells[0].innerHTML+' height '+table.rows[0].cells[0].offsetHeight)
}
// return heights;
}
GridScroller.prototype.GetHeights = function(table_id)
{
var table = document.getElementById(table_id);
var heights = new Array();
var height
for (var row=0; row<table.rows.length; row++)
{
height = getDimensions( table.rows[row].cells[0] ).innerHeight
heights.push( height )
// alert('get ('+row+')'+table.rows[row].cells[0].innerHTML+' height (offset/client/computed (coorection)): '+table.rows[row].cells[0].offsetHeight + '/' + table.rows[row].cells[0].clientHeight + '/ ' +height + ' ('+correction+')')
}
return heights;
}
GridScroller.prototype.GetWidths = function(table_id)
{
var table = document.getElementById(table_id);
table.style.width = 'auto'
var w = document.all ? window.document.body.offsetWidth : window.innerWidth
if (table.offsetWidth < screen.width * 0.8) {
table.style.width = Math.round( screen.width * 0.8 ) + 'px'
}
var widths = new Array();
var style;
if (!table.rows[0]) return [];
for (var col=0; col<table.rows[0].cells.length; col++)
{
widths.push( table.rows[0].cells[col].offsetWidth )
if (table_id.match(/^header_/)) {
// alert('get ('+col+')'+table.rows[0].cells[col].innerHTML+' width '+table.rows[0].cells[col].offsetWidth)
}
}
return widths;
}
GridScroller.prototype.GetAutoSize = function()
{
this.MainOuter.style.width = 'auto'
var w = this.MainInner.offsetWidth;
var h = document.body.clientHeight;
var pos = findPos(this.MainOuter);
var dim = getDimensions(this.MainOuter);
h -= pos[1] + dim.padding[0] + dim.padding[2] + dim.borders[0] + dim.borders[2] + this.BottomOffset;
return [w,h]
}
GridScroller.prototype.AutoResize = function()
{
var obj = this;
if (this.ResizeHappening && this.ResizeTimer) {
window.clearTimeout(this.ResizeTimer);
this.ResizeTimer = false;
}
this.ResizeHappening = true;
this.ResizeTimer = window.setTimeout(function() {
obj.Resize( obj.GetAutoSize() );
obj.ResizeHappening = false;
// alert('resized')
}, 300)
}
GridScroller.prototype.Resize = function(w,h)
{
if (typeof(w) == 'object') {
h = w[1];
w = w[0];
}
if (w) this.Width = w;
if (h) this.Height = h;
+
+ pos = findPos(this.Dot)
+
+ this.TheGrid.style.left = (pos[0])+ 'px'
+ this.TheGrid.style.top = (pos[1]) + 'px'
+
this.MainOuter.style.height = (this.Height)+'px'
this.MainOuter.style.width = (this.Width)+'px'
scroller_height = this.HeaderWidth > this.Width ? this.ScrollerH : 0;
scroller_width = this.DataTotalHeight > this.Height - scroller_height ? this.ScrollerW : 0;
scroller_height = this.HeaderWidth > this.Width - scroller_width ? this.ScrollerH : 0;
// alert('min: '+this.MinDataWidth+' pos: '+pos[0]+','+pos[1]+' scroller W x H: '+scroller_width+' x '+scroller_height+' will resize to '+this.Width+' x '+this.Height+' data: '+this.HeaderWidth+' x '+this.DataHeight)
this.HeadOuter.style.width = (this.Width -scroller_width -this.LeftWidth)+ 'px';
this.DataOuter.style.width = (this.Width -scroller_width -this.LeftWidth)+ 'px';
if (this.LeftCells != 0) {
this.LeftHeaderOuter.style.width = (this.LeftWidth) + 'px'
this.LeftDataOuter.style.width = (this.LeftWidth) + 'px'
if (this.HasFooter()) {
this.LeftFooterOuter.style.width = (this.LeftWidth) + 'px'
}
}
if (this.HasFooter()) {
this.FooterOuter.style.width = (this.Width -scroller_width -this.LeftWidth)+ 'px';
}
if (this.DataTotalHeight < this.Height - scroller_height) {
var adjusted_data_height = this.DataTotalHeight - this.HeadHeight - this.FooterHeight
}
else {
var adjusted_data_height = this.Height - this.HeadHeight - this.FooterHeight - scroller_height
}
this.DataOuter.style.height = adjusted_data_height + 'px'
if (this.LeftCells != 0) {
this.LeftDataOuter.style.height = adjusted_data_height + 'px'
}
this.MainScroller.style.width = (this.HeadTable.offsetWidth + this.LeftWidth)+'px'
this.MainScroller.style.height = ( this.DataHeight + this.HeadHeight + this.FooterHeight)+'px'
this.TheGrid.style.width = (this.Width - scroller_width) + 'px';
this.TheGrid.style.height = (this.Height - scroller_height) + 'px';
}
GridScroller.prototype.SyncScroll = function()
{
this.HeadScroller.scrollLeft = this.MainInner.scrollLeft;
this.DataScroller.scrollLeft = this.MainInner.scrollLeft;
if (this.HasFooter()) {
this.FooterScroller.scrollLeft = this.MainInner.scrollLeft;
}
this.DataScroller.scrollTop = this.MainInner.scrollTop;
if (this.LeftCells != 0) {
this.LeftDataScroller.scrollTop = this.MainInner.scrollTop;
}
}
GridScroller.prototype.AltHTML = function()
{
var o = '';
o += this.CreateScroller( '<div id="main_scroller_'+this.GridId+'" style="background-color: inherit; position: relative; width: auto; z-index: 20;"><img src="'+this.Spacer+'" id="dot_'+this.GridId+'" width="200" height="200"><br/><br/></div>', 100, 100, 'main_'+this.GridId, false, 1 );
o += '<div id="'+this.GridId+'" class="grid-container" style="background-color: inherit; top: 0px; visibility: hidden; z-index: 10; width: auto; height: '+300+'px; position: absolute; overflow: hidden;">';
var header_rows = this.Header.length;
var cols = this.Header[0].length;
var data_rows = this.Data.length;
var header = this.GetTableWithScroller(this.Header, [this.LeftCells, 0, cols, header_rows], 'header')
var data = this.GetTableWithScroller(this.Data, [this.LeftCells, 0, cols, data_rows], 'data', 'grid-data-row-even', '')
var footer = this.HasFooter() ? this.GetTableWithScroller(this.Footer, [this.LeftCells], 'footer') : '';
var left_header = this.GetTableWithScroller(this.Header, [0,0,this.LeftCells, header_rows], ['header','left_header'])
var left_data = this.GetTableWithScroller(this.Data, [0,0,this.LeftCells, data_rows], ['data','left_data'], 'grid-data-row-even', 'left_')
var left_footer = this.GetTableWithScroller(this.Footer, [0,0,this.LeftCells], ['footer','left_footer'])
/*var css = '';
for (var i=0;i<this.Header[0].length; i++) {
css += '.width-adj-grid-col-'+i+' {} ';
}
o += '<style type="text/css">'+css+'</style>';*/
if (this.LeftCells != 0) {
o += '<table style="background-color: inherit; width: 100%; border-collapse: collapse;">'
o += '<tr><td style="vertical-align: top; margin: 0px; padding: 0px;">' + left_header + '</td>'
o += '<td style="vertical-align: top; margin: 0px; padding: 0px;">' + header + '</td></tr>'
o += '<tr><td style="vertical-align: top; margin: 0px; padding: 0px">' + left_data + '</td>'
o += '<td style="vertical-align: top; margin: 0px; padding: 0px">' + data + '</td></tr>'
if (this.HasFooter()) {
o += '<tr><td style="vertical-align: top; margin: 0px; padding: 0px">' + left_footer + '</td>'
o += '<td style="vertical-align: top; margin: 0px; padding: 0px">' + footer + '</td></tr>'
}
o += '</table>'
}
else {
o += header + data + footer;
}
o += '</div>';
return o;
}
GridScroller.prototype.PrepareWidths = function()
{
cache = getFrame('head').grid_widths_cache;
+
+ if (this.MinWidths.length == this.Header[0].length) {
+ var has_all_widths = true;
+ for (var i in this.MinWidths) {
+ if (isNaN(parseInt(this.MinWidths[i]))) has_all_widths = false;
+ }
+ if (has_all_widths) {
+ widths = this.MinWidths
+ cache[this.GridId+'_'+this.PickerCRC] = widths;
+ return widths;
+ }
+ }
+
if (cache[this.GridId+'_'+this.PickerCRC]) {
return cache[this.GridId+'_'+this.PickerCRC]
}
var o = '';
data = this.Header.concat(this.Data).concat(this.Footer);
o += this.GetTableCells(this.Header, [0,0,this.Header[0].length,this.Header.length], 'header', null, null, false, true)[0];
if (this.Data.length) {
o += this.GetTableCells(this.Data, [0,0,this.Data[0].length,this.Data.length], 'data', null, null, false, true)[0];
}
o = '<table style="visibility: hidden; width: auto; border-collapse: collapse" id="tmp_'+this.GridId+'">'+o+'</table>'
document.write(o)
widths = this.GetWidths('tmp_'+this.GridId);
// print_pre(widths)
tmp_el = document.getElementById('tmp_'+this.GridId);
var p = tmp_el.parentNode;
p.removeChild(tmp_el);
cache[this.GridId+'_'+this.PickerCRC] = widths;
return widths;
}
GridScroller.prototype.GetTableWithScroller = function(source, dim, class_mode, even_class, id_prefix)
{
var tmp = this.GetIdAndClassName(class_mode);
var id = tmp[1];
var cells = this.GetTableCells(source, dim, class_mode, even_class, id_prefix);
return this.CreateScroller('<table style="width: 100%" id="'+id+'_'+this.GridId+'">'+cells[0]+'</table>', cells[1], 100, id+'_'+this.GridId, true, 5);
}
GridScroller.prototype.GetIdAndClassName = function(class_mode)
{
if (typeof(class_mode)=='object') {
var class_name = class_mode[0];
var id = class_mode[1]
}
else {
var class_name = class_mode;
var id = class_mode;
}
return [class_name, id]
}
GridScroller.prototype.GetTableCells = function(source, dim, class_mode, even_class, id_prefix, needs_last, no_inner_div)
{
if (!source.length) return ['', 0];
var o = '';
var start_col = dim[0];
var start_row = dim[1];
var end_col = dim[2];
var end_row = dim[3];
var even = false;
if (!even_class) even_class = '';
var tmp = this.GetIdAndClassName(class_mode);
var class_name = tmp[0];
var id = tmp[1];
if (id_prefix==null) id_prefix = id;
var needs_last = needs_last == null ? (end_col == source[0].length) : needs_last;
var total_width = 0;
for (var row=start_row; row<end_row; row++) {
var rh = '';
var row_id = this.IDs[row] ? 'id="'+id_prefix+this.IDs[row]+'"' : '';
rh +='<tr '+row_id+' class="grid-'+class_name+'-row '+(even ? even_class : '')+' grid-'+class_name+'-row-'+row+'" sequence="'+(row+1)+'">'
even = !even;
total_width = 0;
for (var col=start_col; col<end_col; col++) {
if (is.gecko && id.match(/^header/)) {
var cursor_workaround = ['<div style="width: '+this.MinWidths[col]+'px; overflow: auto;">', '</div>'];
}
else {
var cursor_workaround = ['','']
}
width = this.MinWidths[col] ? this.MinWidths[col] + 'px' : 'auto';
total_width += this.MinWidths[col];
if (no_inner_div) {
rh += '<td class="grid-'+class_name+'-col-'+col+'">'+cursor_workaround[0]+source[row][col]+cursor_workaround[1]+'</td>'
}
else {
rh += '<td class="grid-'+class_name+'-col-'+col+'">'+cursor_workaround[0]+'<div class="grid-cell-div" style="width: '+width+';">'+source[row][col]+cursor_workaround[1]+'</div></td>'
}
}
if (needs_last) {
rh += '<td class="grid-'+class_name+'-last-cell"><img src="'+this.Spacer+'" width="1" height="1" alt=""/></td>'
}
rh += '</tr>'
o += rh;
}
return [o, total_width];
}
GridScroller.prototype.HasFooter = function()
{
return (this.Footer != false)
}
GridScroller.prototype.CreateScroller = function(content, w, h, id, hidden, z)
{
if (hidden) {
overflow = 'hidden'
}
else {
overflow = 'auto'
}
if (!z) {
z = 0;
}
if (id && id != '') {
outer_id = 'id="outer_'+id+'"';
inner_id = 'id="inner_'+id+'"';
}
else {
outer_id = '';
inner_id = '';
}
var o = '';
o += '<div '+outer_id+' class="scroller-outer" style="z-index: '+z+'; width: '+w+'px; height: '+h+'px;">'
o += '<div '+inner_id+' class="scroller-inner" style="z-index: '+z+'; width: 100%; height: 100%; overflow: '+overflow+'; position: relative">'
o += content
o += '</div></div>'
return o
}
GridScroller.prototype.SetData = function(a_data)
{
this.Data = a_data;
}
GridScroller.prototype.SetHeader = function(a_header)
{
this.Header = a_header;
}
GridScroller.prototype.SetFooter = function(a_footer)
{
this.Footer = a_footer;
}
\ No newline at end of file
Property changes on: trunk/core/admin_templates/js/grid_scroller.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/admin_templates/js/inp_fckconfig.js
===================================================================
--- trunk/core/admin_templates/js/inp_fckconfig.js (revision 7634)
+++ trunk/core/admin_templates/js/inp_fckconfig.js (revision 7635)
@@ -1,114 +1,114 @@
/*
* Edited by Kostja
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: fckconfig.js
* Editor configuration settings.
* See the documentation for more info.
*
* Version: 2.0 RC3
* Modified: 2005-02-27 21:31:48
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
//FCKConfig.CustomConfigurationsPath = '' ;
//FCKConfig.EditorAreaCSS = FCKConfig.ProjectPath + 'themes/inportal_site/inc/inportal.css' ;
FCKConfig.BaseHref = '' ;
FCKConfig.FullPage = false ;
FCKConfig.Debug = false ;
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;
FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;
// FCKConfig.Plugins.Add( 'placeholder', 'en,it' ) ;
FCKConfig.AutoDetectLanguage = true ;
FCKConfig.DefaultLanguage = 'en' ;
FCKConfig.ContentLangDirection = 'ltr' ;
FCKConfig.EnableXHTML = true ;
FCKConfig.EnableSourceXHTML = true ;
FCKConfig.FillEmptyBlocks = true ;
FCKConfig.FormatSource = true ;
FCKConfig.FormatOutput = true ;
FCKConfig.FormatIndentator = ' ' ;
FCKConfig.GeckoUseSPAN = true ;
FCKConfig.StartupFocus = false ;
FCKConfig.ForcePasteAsPlainText = true ;
FCKConfig.ForceSimpleAmpersand = false ;
FCKConfig.TabSpaces = 0;
FCKConfig.ShowBorders = true;
FCKConfig.ShowTableBorders = true;
FCKConfig.UseBROnCarriageReturn = false ;
FCKConfig.ToolbarStartExpanded = true ;
FCKConfig.ToolbarCanCollapse = true ;
//FCKConfig.ProjectPath = FCKConfig.BasePath.replace(/\/cmseditor\/editor\/$/,'');
-FCKConfig.IconImagesUrl = FCKConfig.ProjectPath+'kernel/user_files/icons';
+FCKConfig.IconImagesUrl = FCKConfig.ProjectPath+'system/user_files/icons';
FCKConfig.ToolbarSets["Default"] = [
['Cut','Copy','Paste','PasteText','PasteWord','NewPage','SelectAll','-','Link','Unlink','Anchor','-','Image','SpecialChar','-','Find','Replace','-','Rule'],
['Source'],
'/',
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','-','OrderedList','UnorderedList','Outdent','Indent'],
'/',
['Style','RemoveFormat']
] ;
FCKConfig.ToolbarSets["Advanced"] = [
['Cut','Copy','Paste','PasteText','PasteWord','-','NewPage','SelectAll','-','Find','Replace','-','Print','-','Link','Unlink','Anchor','Rule','-','Image','Document','Table','SpecialChar'],
'/',
['Bold','Italic','Underline','StrikeThrough','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','-','OrderedList','UnorderedList','Outdent','Indent','-','Subscript','Superscript','-','TextColor','BGColor','-','Undo','Redo'],
'/',
['Style','FontName','FontSize','RemoveFormat','-','SpellCheck','100%','|','Source']
] ;
FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
] ;
FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Select','Document','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','TableCell','Table','Form'] ;
FCKConfig.FontColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF' ;
FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
FCKConfig.FontSizes = '1/xx-small;2/x-small;3/small;4/medium;5/large;6/x-large;7/xx-large' ;
FCKConfig.FontFormats = 'p;div;pre;address;h1;h2;h3;h4;h5;h6' ;
//FCKConfig.StylesXmlPath = '../../inp_styles.xml' ;
FCKConfig.SpellChecker = 'ieSpell' ; // 'ieSpell' | 'SpellerPages'
FCKConfig.IeSpellDownloadUrl = 'http://www.iespell.com/rel/ieSpellSetup211325.exe' ;
FCKConfig.LinkBrowser = true ;
-FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/php/connector.php&ServerPath='+FCKConfig.ProjectPath+'kernel/user_files' ;
+FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/php/connector.php&ServerPath='+FCKConfig.ProjectPath+'system/user_files' ;
FCKConfig.LinkBrowserWindowWidth = screen.width * 0.7 ; // 70%
FCKConfig.LinkBrowserWindowHeight = screen.height * 0.7 ; // 70%
FCKConfig.ImageBrowser = true ;
-FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Images&Connector=connectors/php/connector.php&ServerPath='+FCKConfig.ProjectPath+'kernel/user_files' ;
+FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Images&Connector=connectors/php/connector.php&ServerPath='+FCKConfig.ProjectPath+'system/user_files' ;
FCKConfig.ImageBrowserWindowWidth = screen.width * 0.7 ; // 70% ;
FCKConfig.ImageBrowserWindowHeight = screen.height * 0.7 ; // 70% ;
FCKConfig.DocumentBrowser = true ;
-FCKConfig.DocumentBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Documents&Connector=connectors/php/connector.php&ServerPath='+FCKConfig.ProjectPath+'kernel/user_files' ;
+FCKConfig.DocumentBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Documents&Connector=connectors/php/connector.php&ServerPath='+FCKConfig.ProjectPath+'system/user_files' ;
FCKConfig.ImageBrowserWindowWidth = screen.width * 0.7 ; // 70% ;
FCKConfig.ImageBrowserWindowHeight = screen.height * 0.7 ; // 70% ;
-FCKConfig.DocumentsServerPath = FCKConfig.ProjectPath+'kernel/user_files/Documents'
+FCKConfig.DocumentsServerPath = FCKConfig.ProjectPath+'system/user_files/Documents'
FCKConfig.StructureBrowser = true ;
FCKConfig.StructureBrowserURL = FCKConfig.ProjectPath+'/admin/index.php?t=structure/tree' ;
FCKConfig.StructureBrowserWindowWidth = screen.width * 0.5 ; // 50%
FCKConfig.StructureBrowserWindowHeight = screen.height * 0.7 ; // 70%
-FCKConfig.FilesBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Files&Connector=connectors/php/connector.php&ServerPath='+FCKConfig.ProjectPath+'kernel/user_files/' ;
+FCKConfig.FilesBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Files&Connector=connectors/php/connector.php&ServerPath='+FCKConfig.ProjectPath+'system/user_files/' ;
FCKConfig.SmileyPath = FCKConfig.BasePath + 'images/smiley/msn/' ;
FCKConfig.SmileyImages = ['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'] ;
FCKConfig.SmileyColumns = 8 ;
FCKConfig.SmileyWindowWidth = 320 ;
FCKConfig.SmileyWindowHeight = 240 ;
FCKConfig.K4Mode = 1;
\ No newline at end of file
Property changes on: trunk/core/admin_templates/js/inp_fckconfig.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/admin_templates/js/tree.js
===================================================================
--- trunk/core/admin_templates/js/tree.js (revision 7634)
+++ trunk/core/admin_templates/js/tree.js (revision 7635)
@@ -1,591 +1,596 @@
var last_hightlighted = null;
var last_highlighted_key = null;
-function TreeItem(title, url, icon, onclick)
+function TreeItem(title, url, icon, onclick, priority)
{
this.Title = title;
this.Url = url;
this.Rendered = false;
this.Displayed = false;
this.Level = 0;
this.Icon = icon;
this.Onclick = onclick;
+ this.Priority = isset(priority) ? priority : false;
this.Children = false;
}
TreeItem.prototype.Render = function(before, force)
{
if (!this.Rendered || force) {
if (!isset(before)) {before = null}
tr = document.createElement('tr');
this.ParentElement.insertBefore(tr, before);
if (!this.Displayed) { tr.style.display = 'none' }
td = document.createElement('td');
td.TreeElement = this;
tr.appendChild(td);
this.appendLevel(td);
if (this.ParentFolder != null) this.appendNodeImage(td);
this.appendIcon(td);
this.appendLink(td);
this.Tr = tr;
this.Rendered = true;
// alert(this.Tr.innerHTML)
}
}
TreeItem.prototype.remove = function()
{
var p = this.Tr.parentNode;
p.removeChild(this.Tr);
}
TreeItem.prototype.appendLevel = function(td)
{
for (var i=0; i < this.Level; i++)
{
img = document.createElement('img');
img.src = TREE_ICONS_PATH+'/ftv2blank.gif';
img.style.verticalAlign = 'middle';
td.appendChild(img);
}
}
TreeItem.prototype.getNodeImage = function(is_last)
{
return is_last ? TREE_ICONS_PATH+'/ftv2lastnode.gif' : TREE_ICONS_PATH+'/ftv2node.gif';
}
TreeItem.prototype.appendNodeImage = function(td)
{
img = document.createElement('img');
img.src = this.getNodeImage();
img.style.verticalAlign = 'middle';
td.appendChild(img);
}
TreeItem.prototype.appendIcon = function (td)
{
img = document.createElement('img');
if (this.Icon.indexOf('http://') != -1) {
img.src = this.Icon;
}
else {
img.src = this.Icon;
}
img.style.verticalAlign = 'middle';
td.appendChild(img);
}
TreeItem.prototype.appendLink = function (td)
{
var $node_text = document.createElement('span');
$node_text.innerHTML = this.Title;
+ if (TREE_SHOW_PRIORITY && this.Priority !== false) {
+ $node_text.innerHTML += '<span class="priority"><sup>' + this.Priority + '</sup></span>';
+ }
link = document.createElement('a');
link.nodeValue = this.Title;
link.href = this.Url;
link.target = 'main';
link.appendChild($node_text);
link.treeItem = this;
//addEvent(link, 'click',
link.onclick =
function(ev) {
var e = is.ie ? window.event : ev;
res = true;
if (isset(this.treeItem.Onclick)) {
res = eval(this.treeItem.Onclick);
}
if (!res) { // if we need to cancel onclick action
if (is.ie) {
window.event.cancelBubble = true;
window.event.returnValue = false;
} else {
ev.preventDefault();
ev.stopPropagation();
}
return res;
}
else {
// ensures, that click is made before AJAX request will be sent
if (res === true) {
// only in case of "true" is returned, used in catalog
getFrame(link.target).location.href = this.href;
}
if (!this.treeItem.Expanded && typeof(this.treeItem.folderClick) == 'function') {
if (this.treeItem.folderClick());
}
this.treeItem.highLight();
return false;
}
}
td.appendChild(link);
/*
if (this.LateLoadURL) {
var span = document.createElement('span');
span.innerHTML = '&nbsp;Reload';
span.treeItem = this;
span.onclick = function(ev) {
this.treeItem.reload();
}
td.appendChild(span);
}
*/
}
TreeItem.prototype.display = function()
{
this.Tr.style.display = is.ie ? 'block' : 'table-row';
this.Displayed = true;
var do_sub = TreeManager.isExpanded(this.Key);
if (this.Children && do_sub && !this.Expanding) {
this.expand();
}
}
TreeItem.prototype.hide = function()
{
this.Tr.style.display = 'none';
this.Displayed = false;
}
TreeItem.prototype.highLight = function()
{
if (last_hightlighted) last_hightlighted.Tr.className = '';
if (this.Children && this.Children.length > 0 && this.Children[0].Url.replace('&amp;', '&') == this.Url.replace('&amp;', '&')) {
if (!this.Expanded) {
this.expand();
}
this.Children[0].highLight();
return;
}
this.Tr.className = "highlighted";
last_hightlighted = this;
last_highlighted_key = this.Key;
if (!this.Expanded) {
this.expand();
}
}
TreeItem.prototype.expand = function() { this.display() }
TreeItem.prototype.collapse = function() { this.hide() }
TreeItem.prototype.updateLastNodes = function(is_last, lines_pattern)
{
if (!isset(is_last)) is_last = true;
if (!isset(this.Tr)) return;
if (!isset(lines_pattern)) { var lines_pattern = new Array() }
imgs = this.Tr.getElementsByTagName('img');
found = false;
for (var i=0; i<imgs.length; i++)
{
the_img = imgs.item(i);
if (in_array(i, lines_pattern) && the_img.src.indexOf('ftv2blank.gif') != -1) {
the_img.src = TREE_ICONS_PATH+'/ftv2vertline.gif';
}
if (this.isNodeImage(the_img))
{
found = true;
break;
}
}
if (found) {
the_img.src = this.getNodeImage(is_last);
}
this.isLast = is_last;
return lines_pattern;
}
TreeItem.prototype.isNodeImage = function(img)
{
return (
img.src.indexOf('ftv2node.gif') != -1 ||
img.src.indexOf('ftv2lastnode.gif') != -1
)
}
TreeItem.prototype.locateLastItem = function()
{
return this;
}
TreeItem.prototype.locateItemByURL = function(url)
{
if (this.Url == url) return this;
return false;
}
TreeItem.prototype.locateItemByKey = function(key)
{
if (this.Key == key) return this;
return false;
}
TreeItem.prototype.reload = function()
{
}
/* FOLDER */
-function TreeFolder(parent_id, title, url, icon, late_load_url, onclick)
+function TreeFolder(parent_id, title, url, icon, late_load_url, onclick, priority)
{
var render = false;
if (isset(parent_id)) {
this.ParentElement = document.getElementById(parent_id);
render = true;
}
else {
}
this.Title = title;
this.Url = url;
this.Rendered = false;
this.Displayed = false;
this.Expanded = false;
this.Level = 0;
this.Id = 0;
this.Tr = null;
this.Icon = icon;
this.LateLoadURL = isset(late_load_url) ? late_load_url : false;
this.Loaded = false;
this.Onclick = onclick;
+ this.Priority = isset(priority) ? priority : false;
this.Children = new Array();
this.ChildIndex = 0;
if (render) {
this.Expanded = true;
this.Displayed = true;
this.Render();
this.expand();
}
}
TreeFolder.prototype = new TreeItem;
TreeFolder.prototype.locateLastItem = function()
{
if (this.Children.length == 0) return this;
for (var i=0; i<this.Children.length; i++)
{
last_item = this.Children[i].locateLastItem()
}
return last_item;
}
TreeFolder.prototype.locateItemByURL = function(url)
{
last_item = false;
if (this.Url == url) {
return this;
}
for (var i=0; i<this.Children.length; i++)
{
last_item = this.Children[i].locateItemByURL(url)
if (last_item) return last_item;
}
return last_item;
}
TreeFolder.prototype.locateItemByKey = function(key)
{
last_item = false;
if (this.Key == key) {
return this;
}
for (var i=0; i<this.Children.length; i++)
{
last_item = this.Children[i].locateItemByKey(key)
if (last_item) return last_item;
}
return last_item;
}
TreeFolder.prototype.locateTopItem = function()
{
if (this.ParentFolder == null) return this;
return this.ParentFolder.locateTopItem();
}
TreeFolder.prototype.AddItem = function(an_item, render, display) {
an_item.ParentElement = this.ParentElement;
an_item.Level = this.ParentFolder != null ? this.Level + 1 : 0;
an_item.ParentFolder = this;
last_item = this.locateLastItem();
this.Children.push(an_item);
an_item.Id = this.Children.length;
an_item.Render(last_item.Tr.nextSibling);
var keys = new Array()
var tmp = an_item;
keys.push(tmp.Level + '_' + tmp.Id);
while (tmp.ParentFolder) {
tmp = tmp.ParentFolder
keys.push(tmp.Level + '_' + tmp.Id);
}
keys = keys.reverse();
key_str = keys.join('-');
an_item.Key = key_str;
if (this.Expanded)
{
an_item.display();
}
return an_item;
}
TreeFolder.prototype.AddFromXML = function(xml, render)
{
// start = new Date();
if (!isset(render)) render = true;
doc = getDocumentFromXML(xml);
this.LastFolder = this;
this.ProcessXMLNode(doc, render);
// end = new Date();
this.locateTopItem().updateLastNodes();
// alert('AddFromXML took: '+(end - start))
}
TreeFolder.prototype.ProcessXMLNode = function(node, render)
{
if (!isset(render)) render = true;
if (!isset(this.LastFolder)) this.LastFolder = this;
for (var i=0; i<node.childNodes.length; i++)
{
child = node.childNodes.item(i);
if (child.tagName == 'folder') {
var backupLastFolder = this.LastFolder;
- this.LastFolder = this.LastFolder.AddItem(new TreeFolder(null, child.getAttribute('name'), child.getAttribute('href'), child.getAttribute('icon'), child.getAttribute('load_url'), child.getAttribute('onclick')), render);
+ this.LastFolder = this.LastFolder.AddItem(new TreeFolder(null, child.getAttribute('name'), child.getAttribute('href'), child.getAttribute('icon'), child.getAttribute('load_url'), child.getAttribute('onclick'), child.getAttribute('priority')), render);
if (child.hasChildNodes) {
this.ProcessXMLNode(child);
}
this.LastFolder = backupLastFolder;
}
else if (child.tagName == 'item') {
- this.LastFolder.AddItem(new TreeItem(child.firstChild.nodeValue, child.getAttribute('href'), child.getAttribute('icon'), child.getAttribute('onclick')), render)
+ this.LastFolder.AddItem(new TreeItem(child.firstChild.nodeValue, child.getAttribute('href'), child.getAttribute('icon'), child.getAttribute('onclick'), child.getAttribute('priority')), render)
}
else if (child.tagName == 'tree') {
this.LastFolder = this;
this.ProcessXMLNode(child);
}
}
}
TreeFolder.prototype.getNodeImage = function(is_last)
{
if (is_last) {
return this.Expanded ? TREE_ICONS_PATH+'/ftv2mlastnode.gif' : TREE_ICONS_PATH+'/ftv2plastnode.gif';
}
else {
return this.Expanded ? TREE_ICONS_PATH+'/ftv2mnode.gif' : TREE_ICONS_PATH+'/ftv2pnode.gif';
}
}
TreeFolder.prototype.appendNodeImage = function(td, is_last)
{
img = document.createElement('img');
img.src = this.getNodeImage(is_last);
img.style.cursor = 'hand';
img.style.cursor = 'pointer';
img.style.verticalAlign = 'middle';
img.onclick = function() { this.parentNode.TreeElement.folderClick(this) }
this.Img = img;
td.appendChild(img);
}
TreeFolder.prototype.updateLastNodes = function(is_last, lines_pattern)
{
if (!isset(is_last)) is_last = true;
if (!isset(lines_pattern)) { var lines_pattern = new Array() }
if (!is_last && !in_array(this.Level, lines_pattern)) { lines_pattern.push(this.Level) }
lines_pattern = TreeItem.prototype.updateLastNodes.apply(this, new Array(is_last, lines_pattern))
for (var i=0; i<this.Children.length; i++)
{
lines_pattern = this.Children[i].updateLastNodes((i+1) == this.Children.length, lines_pattern)
}
lines_pattern[array_search(this.Level, lines_pattern)] = -1;
return lines_pattern;
}
TreeFolder.prototype.isNodeImage = function(img)
{
return (
img.src.indexOf('ftv2mlastnode.gif') != -1 ||
img.src.indexOf('ftv2plastnode.gif') != -1 ||
img.src.indexOf('ftv2mnode.gif') != -1 ||
img.src.indexOf('ftv2pnode.gif') != -1
)
}
TreeFolder.prototype.folderClick = function(img)
{
if (this.Expanded) {
this.collapse();
}
else {
this.expand();
}
}
TreeFolder.prototype.remove = function()
{
this.removeChildren();
var p = this.Tr.parentNode;
p.removeChild(this.Tr);
}
TreeFolder.prototype.removeChildren = function()
{
for (var i in this.Children) {
this.Children[i].remove();
}
this.Children = new Array();
}
TreeFolder.prototype.successCallback = function ($request, $params, $object) {
if ($params == 'reload') {
$object.removeChildren();
}
$object.Loaded = true;
$object.ProcessXMLNode($request.responseXML);
$object.Render();
$object.locateTopItem().updateLastNodes();
$object.expand();
if (last_highlighted_key) {
var fld = $object.locateItemByKey(last_highlighted_key)
if (fld) {
fld.highLight();
}
}
}
TreeFolder.prototype.reload = function()
{
Request.headers['Content-type'] = 'text/xml';
Request.makeRequest(this.LateLoadURL, false, '', this.successCallback, this.errorCallback, 'reload', this);
}
TreeFolder.prototype.errorCallback = function($request, $params, $object) {
alert('AJAX ERROR: ' + Request.getErrorHtml($request));
}
TreeFolder.prototype.expand = function(mode)
{
if (this.Expanding) {
return;
}
this.Expanding = true;
if (!isset(mode)) mode = 0;
this.display();
if (mode == 0 || this.Expanded ) {
for (var i=0; i<this.Children.length; i++)
{
this.Children[i].expand(mode+1);
}
}
if (mode == 0) {
if (this.LateLoadURL && !this.Loaded) {
Request.headers['Content-type'] = 'text/xml';
Request.makeRequest(this.LateLoadURL, false, '', this.successCallback, this.errorCallback, '', this);
}
this.Expanded = true;
TreeManager.markStatus(this.Key, 1)
if (isset(this.Img)) {
this.Img.src = this.getNodeImage(this.isLast);
}
}
this.Expanding = false;
}
TreeFolder.prototype.collapse = function(mode)
{
if (!isset(mode)) mode = 0;
for (var i=0; i<this.Children.length; i++)
{
this.Children[i].collapse(mode+1);
this.Children[i].hide();
}
if (mode == 0) {
this.Expanded = false;
TreeManager.markStatus(this.Key, 0)
if (isset(this.Img)) {
this.Img.src = this.getNodeImage(this.isLast);
}
}
}
function TreeManager() {}
TreeManager.ExpandStatus = [];
TreeManager.markStatus = function(id, status)
{
this.ExpandStatus[id] = status;
if (!status) {
for (var i in this.ExpandStatus) {
if (i.indexOf(id) == 0) { // if i starts with the same as id, meaning it is its child node
this.ExpandStatus[i] = 0;
}
}
}
TreeManager.saveStatus()
}
TreeManager.isExpanded = function(id)
{
return (this.ExpandStatus[id] == 1);
}
TreeManager.saveStatus = function ()
{
var cookieString = new Array();
for (var i in this.ExpandStatus) {
if (this.ExpandStatus[i] == 1) {
cookieString.push(i);
}
}
document.cookie = 'TreeExpandStatus=' + cookieString.join(':');
}
TreeManager.loadStatus = function ()
{
var doc_cookies = document.cookie.split('; ');
for (var i=0; i < doc_cookies.length; i++) {
var pair = doc_cookies[i].split('=');
if ('TreeExpandStatus' == pair[0] && pair[1]) {
var expandedBranches = pair[1].split(':');
for (var j=0; j<expandedBranches.length; j++) {
this.ExpandStatus[expandedBranches[j]] = true;
}
}
}
// print_pre(this.ExpandStatus)
}
TreeManager.loadStatus();
Property changes on: trunk/core/admin_templates/js/tree.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/admin_templates/js/toolbar.js
===================================================================
--- trunk/core/admin_templates/js/toolbar.js (revision 7634)
+++ trunk/core/admin_templates/js/toolbar.js (revision 7635)
@@ -1,291 +1,336 @@
function ToolBarButton(title, alt, onclick, $hidden, prefix)
{
this.Title = title || '';
+ this.TranslateLink = false;
this.CheckTitleModule();
this.Alt = RemoveTranslationLink(alt || '');
+ if (this.Alt != alt) {
+ this.TranslateLink = alt || '';
+ this.TranslateLink = this.TranslateLink.replace(/&lt;a href=&quot;(.*?)&quot;&gt;(.*?)&lt;\/a&gt;/g, '$1');
+ }
if (this.Alt.match(/(.*)::(.*)/)) {
this.Alt = RegExp.$1;
this.Label = RegExp.$2
}
else {
this.Label = this.Alt;
}
+
if (typeof(onclick) == 'function') {
this.onClick = onclick;
}
else {
this.onClick = function() {
if (eval('typeof('+this.Title+')') == 'function')
eval(this.Title + '()');
}
}
this.imgObject = null;
this.Enabled = true;
this.Hidden = $hidden ? true : false;
this.ToolBar = null;
this.Prefix = prefix ? prefix : '';
}
ToolBarButton.prototype.CheckTitleModule = function()
{
if (this.Title.match(/([^:]+):(.*)$/)) {
// has module set directly
this.Title = RegExp.$2;
this.Module = RegExp.$1;
if (this.Module == 'in-portal') {
this.Module = 'kernel';
}
}
else {
// use default module
this.Module = 'core';
}
}
ToolBarButton.prototype.IconsPath = function()
{
if (typeof(img_path) == 'undefined') {
//alert('error: toolbar image path not set');
}
return img_path.replace('#MODULE#', this.Module) + 'toolbar/';
}
ToolBarButton.prototype.GetHTML = function() {
var add_style = this.ToolBar.ButtonStyle ? 'style="'+this.ToolBar.ButtonStyle+'"' : '';
var o = '<div class="toolbar-button" id="'+this.GetToolID('div')+'" '+add_style+'>'
o += '<img id="' + this.GetToolID() + '" src="' + this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '.gif" title="' + this.Alt + '">';
if (this.ToolBar.UseLabels) o += '<br/>'+this.Label;
o += '</div>'
return o;
}
ToolBarButton.prototype.GetToolID = function(item) {
if (!item) item = 'tool'
return this.Prefix == '' ? item+'_' + this.Title : item+'_['+this.Prefix+'][' + this.Title+']'
}
ToolBarButton.prototype.Init = function() {
img = document.getElementById(this.GetToolID());
this.imgObject = img;
this.Container = document.getElementById(this.GetToolID('div')) ? document.getElementById(this.GetToolID('div')) : false;
this.Container.btn = this;
img.btn = this;
this.SetOnMouseOver();
this.SetOnMouseOut();
this.SetOnClick();
+ this.SetOnRightClick()
if (this.Hidden) this.Hide();
+
if (!img.complete) {
var real_path = img_path.replace('#MODULE#', this.Module) + 'toolbar/';
var old_path = img_path.replace('#MODULE#', 'kernel') + 'toolbar/'+this.ToolBar.IconPrefix + this.Title+'.gif';
real_path = real_path.replace('http://kostja.prod.intechnic.lv/in-portal.RC', '.');
old_path = old_path.replace('http://kostja.prod.intechnic.lv/in-portal.RC', '.');
var source = old_path.replace('/core/', '/kernel/').replace('.gif', '*.gif');
var path = 'cp '+source+' '+real_path;
// prompt('exec: ', path)
// img.src = 'img/bad_button.GIF';
}
// preg_print_pre(img, /natural|compl/i)
}
+ToolBarButton.prototype.EditTitle = function() {
+ if (this.TranslateLink !== false) {
+ var $links = this.TranslateLink;
+
+ $links = $links.split('::');
+ var $i = 0;
+ while ($i < $links.length) {
+ var $link = $links[$i];
+ if ($link.match(/(javascript:|http:\/\/)(.*)/)) {
+ var $link_type = RegExp.$1;
+ $link = RegExp.$2.replace(/&#39;/g, '"');
+ if ($link_type == 'javascript:') {
+ eval($link);
+ }
+ else {
+ window.location.href = 'http://' + $link;
+ }
+
+ // edit one phrase at a time
+ break;
+ }
+ $i++;
+ }
+
+ return false;
+ }
+
+ return true;
+}
+
ToolBarButton.prototype.SetOnMouseOver = function() {
this.Container.onmouseover = function() {
this.btn.imgObject.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '_f2.gif';
this.className = 'toolbar-button-over';
};
}
ToolBarButton.prototype.SetOnMouseOut = function() {
this.Container.onmouseout = function() {
this.btn.imgObject.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '.gif';
this.className = 'toolbar-button';
};
}
ToolBarButton.prototype.SetOnClick = function() {
// we have SetOnMouseOut for this ???
/*this.Container.onmouseout = function() {
this.btn.imgObject.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '.gif';
};*/
this.Container.inClick = false;
if (typeof(this.onClick) != 'function') {
this.Container.onclick = function() {
if (this.inClick) return;
this.inClick = true;
if (eval('typeof('+this.btn.Title+')') == 'function')
eval(this.btn.Title + '()');
this.inClick = false;
}
}
else {
this.Container.onclick = function() {
if (this.inClick) return;
this.inClick = true;
this.btn.onClick();
this.inClick = false;
}
}
// the following lines are correct, as long as mozilla understands 'pointer', but IE 'hand',
// do not change the order of these lines!
if (is.ie6up || is.gecko) {
this.Container.style.cursor = 'pointer';
}
else {
// somehow set cursor hand for IE 5/ 5.5
// this.imgObject.style = 'cursor: hand';
}
}
+ToolBarButton.prototype.SetOnRightClick = function() {
+ this.Container.oncontextmenu = function() {
+ return this.btn.EditTitle();
+ }
+}
+
+
ToolBarButton.prototype.Disable = function() {
if ( !this.Enabled ) return;
this.imgObject.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '_f3.gif';
this.Container.onmouseover = null;
this.Container.onmouseout = null;
this.Container.onclick = null;
this.Container.style.cursor = 'default';
this.Enabled = false;
this.Container.className = 'toolbar-button-disabled'
}
ToolBarButton.prototype.Enable = function() {
if (this.Enabled) return;
this.imgObject.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '.gif';
this.SetOnMouseOver();
this.SetOnMouseOut();
this.SetOnClick();
this.Enabled = true;
this.Container.className = 'toolbar-button'
}
ToolBarButton.prototype.Hide = function() {
this.Container.style.display = 'none';
this.Hidden = true;
}
ToolBarButton.prototype.Show = function() {
this.Container.style.display = '';
this.Hidden = false;
}
/* ----------- */
function ToolBarSeparator(title) //extends ToolBarButton
{
this.Title = title;
}
ToolBarSeparator.prototype = new ToolBarButton;
ToolBarSeparator.prototype.GetHTML = function() {
var add_style = this.ToolBar.ButtonStyle ? 'style="'+this.ToolBar.ButtonStyle+'"' : '';
var padding = this.ToolBar.UseLabels ? '12px' : '2px'
return '<div id="'+this.GetToolID('div')+'" class="toolbar-button" style="padding-top: '+padding+'; height: 32px;" '+add_style+'><img id="' + this.GetToolID() + '" src="' + this.IconsPath() + 'tool_divider.gif"></div>';
var add_style = this.ToolBar.ButtonStyle ? 'style="'+this.ToolBar.ButtonStyle+'"' : '';
return '<div id="'+this.GetToolID('div')+'" class="toolbar-button" style="border: 1px solid black; height: 100%;" '+add_style+'><img id="' + this.GetToolID() + '" src="' + this.IconsPath() + 'tool_divider.gif"></div>';
}
ToolBarSeparator.prototype.Init = function() {
img = document.getElementById(this.ToolBar.IconPrefix + this.Title);
this.Container = document.getElementById(this.GetToolID('div')) ? document.getElementById(this.GetToolID('div')) : false;
this.imgObject = img;
img.btn = this;
}
ToolBarSeparator.prototype.Enable = function() { }
ToolBarSeparator.prototype.Disable = function() { }
/* ----------- */
function ToolBarMarkup(title, html) //extends ToolBarButton
{
this.Title = title;
this.HTML = html;
}
ToolBarMarkup.prototype = new ToolBarButton;
ToolBarMarkup.prototype.GetHTML = function() {
return this.HTML;
}
ToolBarMarkup.prototype.Init = function() { }
ToolBarMarkup.prototype.Enable = function() { }
ToolBarMarkup.prototype.Disable = function() { }
/* ----------- */
function ToolBar(icon_prefix, $module)
{
this.Module = $module ? $module : 'core';
this.IconPrefix = icon_prefix ? icon_prefix : 'tool_';
this.Buttons = new Array();
- this.UseLabels = $use_toolbarlabels ? $use_toolbarlabels : false;
+ this.UseLabels = typeof($use_toolbarlabels) != 'undefined' ? $use_toolbarlabels : false;
}
ToolBar.prototype.AddButton = function(a_button)
{
a_button.ToolBar = this;
this.Buttons[a_button.Title] = a_button;
}
ToolBar.prototype.Render = function($container)
{
if ($container) {
var tmp = '';
for (var i in this.Buttons) {
btn = this.Buttons[i];
tmp += btn.GetHTML();
}
$container.innerHTML = tmp; // container will contain only buttons
// init all buttons after because objects are not yet created directly after assigning to innerHTML
for (var i in this.Buttons) {
btn = this.Buttons[i];
btn.Init();
}
}
else {
for (var i in this.Buttons) {
btn = this.Buttons[i];
document.write( btn.GetHTML() );
btn.Init();
}
}
}
ToolBar.prototype.EnableButton = function(button_id) {
if(this.ButtonExists(button_id)) this.Buttons[button_id].Enable();
}
ToolBar.prototype.DisableButton = function(button_id) {
if(this.ButtonExists(button_id)) this.Buttons[button_id].Disable();
}
ToolBar.prototype.HideButton = function(button_id) {
if(this.ButtonExists(button_id)) this.Buttons[button_id].Hide();
}
ToolBar.prototype.ShowButton = function(button_id) {
if(this.ButtonExists(button_id)) this.Buttons[button_id].Show();
}
ToolBar.prototype.SetEnabled = function(button_id, $enabled) {
var $ret = $enabled ? this.EnableButton(button_id) : this.DisableButton(button_id);
}
ToolBar.prototype.SetVisible = function(button_id, $visible) {
var $ret = $visible ? this.ShowButton(button_id) : this.HideButton(button_id);
}
ToolBar.prototype.GetButtonImage = function(button_id) {
if( this.ButtonExists(button_id) ) return this.Buttons[button_id].imgObject;
}
ToolBar.prototype.ButtonExists = function(button_id) {
return typeof(this.Buttons[button_id]) == 'object';
}
Property changes on: trunk/core/admin_templates/js/toolbar.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property
Index: trunk/core/admin_templates/img/tab_back3.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/tab_back3.jpg
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/perm_red.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/perm_red.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/perm_green.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/perm_green.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/icons/icon46_list_modules.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/icons/icon46_list_modules.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/icons/icon24_modules.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/icons/icon24_modules.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/icons/icon46_modules.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/icons/icon46_modules.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/install/steps_db.xml
===================================================================
--- trunk/core/install/steps_db.xml (revision 7634)
+++ trunk/core/install/steps_db.xml (revision 7635)
@@ -1,43 +1,46 @@
<steps>
<step name="db_config" title="Database Configuration">
<![CDATA[Host name (<i>normally "localhost"</i>), Database user name, and database Password.
These fields are required to connect to the database.</p><p>If you would like In-Portal
to use a table prefix, enter it in the field provided. This prefix can be any
text which can be used in the names of tables on your system. The characters entered in this field
are placed <i>before</i> the names of the tables used by In-Portal. For example, if you enter "inp_"
into the prefix field, the table named Category will be named inp_Category.</p>]]>
</step>
<step name="root_password" title="Set Root Password" help_title="Set Admin Root Password">
<![CDATA[<p>The Root Password is initially required to access the admin sections of In-Portal.
The root user cannot be used to access the front-end of the system, so it is recommended that you
create additional users with admin privlidges.</p>]]>
</step>
<step name="choose_modules" title="Select Modules to Install">
<![CDATA[<p>Select the In-Portal modules you wish to install. The modules listed to the right
are all modules included in this installation that are licensed to run on this server. </p>]]>
</step>
<step name="check_paths" title="Filesystem Check">
<![CDATA[<b>Write</b><br />Shows folder and files, that write permissions should be adjusted
to allow web server to write data into them.]]>
</step>
<step name="finish" title="Installation Complete" help_title="Thank You!">
<![CDATA[<p>Thanks for using In-Portal! Be sure to visit <a target="_new" href="http://www.in-portal.net">www.in-portal.net</a>
for the latest news, module releases and support. </p>
<p>*Make sure to clean your browser' cache after upgrading In-portal version</p>]]>
</step>
<step name="install_setup" title="Installation Maintenance">
<![CDATA[<p>A Configuration file has been detected on your system and it appears In-Portal is correctly installed.
In order to work with the maintenance functions provided to the left you must provide the Intechnic
Username and Password you used when obtaining the license file residing on the server, or your admin Root password.
<i>(Use Username 'root' if using your root password)</i></p>
<p>To removing your existing database and start with a fresh installation, select the first option
provided. Note that this operation cannot be undone and no backups are made! Use at your own risk.</p>
<p>If you wish to scrap your current installation and install to a new location, choose the second option.
If this option is selected you will be prompted for new database configuration information.</p>
<p>The <i>Update License Information</i> option is used to update your In-Portal license data. Select this option if you have
modified your licensing status with Intechnic, or you have received new license data via email</p>
<p>The <i>Fix Paths</i> option should be used when the location of the In-portal files has changed.
For example, if you moved them from one folder to another. It will update all settings and ensure the
program is operational at the new location.</p>]]>
</step>
+ <step name="upgrade_modules" title="Select Modules to Upgrade">
+ <![CDATA[help missing]]>
+ </step>
</steps>
\ No newline at end of file
Property changes on: trunk/core/install/steps_db.xml
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/install/upgrades.sql
===================================================================
--- trunk/core/install/upgrades.sql (nonexistent)
+++ trunk/core/install/upgrades.sql (revision 7635)
@@ -0,0 +1,13 @@
+# ===== v 1.3.5 =====
+SELECT * FROM Modules;
+SELECT Name FROM Modules;
+
+# ===== v 4.0.1 =====
+ALTER TABLE Modules ADD COLUMN NotCool VARCHAR(255);
+
+# ===== v 4.0.12 =====
+# multiline
+UPDATE Modules SET Name = 'dummy' WHERE Name = 'dummy';
+
+# ===== v 4.0.15 =====
+UPDATE Modules SET Name = 'dummy' WHERE Name = 'dummy';
\ No newline at end of file
Property changes on: trunk/core/install/upgrades.sql
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/install/step_templates/install_setup.tpl
===================================================================
--- trunk/core/install/step_templates/install_setup.tpl (revision 7634)
+++ trunk/core/install/step_templates/install_setup.tpl (revision 7635)
@@ -1,51 +1,56 @@
<tr class="table_color2">
<td colspan="2">
In order to use the installation tool, please provide your Intechnic account information:
</td>
</tr>
<tr class="table_color2">
<td class="text">
<b>Username<span class="error">*</span>:</b>
</td>
<td width="80%">
- <input type="text" name="user_name" value="<?php $this->GetVar('user_name'); ?>" class="text" />
+ <input type="text" name="login" value="" class="text" />
</td>
</tr>
<tr class="table_color2">
<td class="text">
<b>Password<span class="error">*</span>:</b>
</td>
<td>
- <input type="password" name="user_password" class="text" />
+ <input type="password" name="password" class="text" />
</td>
</tr>
<?php
ob_start();
?>
<tr class="%4$s">
<td colspan="2">
- <input type="radio" value="%1$s" name="inp_opt" id="inp_opt_%1$s"%2$s><label for="inp_opt_%1$s">%3$s</label></span>
+ <input type="radio" value="%1$s" name="next_preset" id="next_preset_%1$s"%2$s><label for="next_preset_%1$s">%3$s</label></span>
</td>
</tr>
<?php
$option_tpl = ob_get_clean();
$options = Array (
- 6 => 'Upgrade In-Portal',
- 1 => 'Clean out the In-Portal database and reinstall',
- 4 => 'Clean out the In-Portal database and reinstall from backup',
- 2 => 'Install to a new database',
- 3 => 'Update License Information',
- 5 => 'Change Database Configuration',
- 7 => 'Fix Paths',
+ 'upgrade' => 'Upgrade In-Portal',
+ 1 => 'Clean out the In-Portal database and reinstall',
+ 4 => 'Clean out the In-Portal database and reinstall from backup',
+ 2 => 'Install to a new database',
+ 3 => 'Update License Information',
+ 'db_reconfig' => 'Change Database Configuration',
+ 'fix_paths' => 'Fix Paths',
);
+ $upgradable_modules = $this->GetUpgradableModules();
+ if (!$upgradable_modules) {
+ unset($options['upgrade']);
+ }
+
$td_class = 'table_color1';
foreach ($options as $option_key => $option_title) {
- $checked = $this->GetVar('inp_opt') == $option_key ? ' checked' : '';
+ $checked = $this->GetVar('next_preset') == $option_key ? ' checked' : '';
echo sprintf($option_tpl, $option_key, $checked, $option_title, $td_class);
$td_class = ($td_class == 'table_color1') ? 'table_color2' : 'table_color1';
}
?>
\ No newline at end of file
Property changes on: trunk/core/install/step_templates/install_setup.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/core/install/step_templates/choose_modules.tpl
===================================================================
--- trunk/core/install/step_templates/choose_modules.tpl (revision 7634)
+++ trunk/core/install/step_templates/choose_modules.tpl (revision 7635)
@@ -1,16 +1,21 @@
<?php
ob_start();
?>
<tr class="table_color2">
<td class="text" colspan="2" valign="middle">
- <input type="checkbox" name="modules[]" id="module_%1$s" value="%1$s"/><label for="module_%1$s">%1$s</label>
+ <table cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" name="modules[]" id="module_%1$s" value="%1$s"/></td>
+ <td><label for="module_%1$s">%1$s</label></td>
+ </tr>
+ </table>
</td>
</tr>
<?php
$module_tpl = ob_get_clean();
$modules = $this->ScanModules();
foreach ($modules as $module) {
echo sprintf($module_tpl, $module);
}
?>
\ No newline at end of file
Property changes on: trunk/core/install/step_templates/choose_modules.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/core/install/step_templates/upgrade_modules.tpl
===================================================================
--- trunk/core/install/step_templates/upgrade_modules.tpl (nonexistent)
+++ trunk/core/install/step_templates/upgrade_modules.tpl (revision 7635)
@@ -0,0 +1,31 @@
+<?php
+ ob_start();
+?>
+<tr class="table_color2">
+ <td class="text" colspan="2" valign="middle">
+ <table cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input type="checkbox" name="modules[]" id="module_%1$s" value="%1$s"/></td>
+ <td><label for="module_%1$s">%2$s</label></td>
+ </tr>
+ </table>
+ </td>
+</tr>
+<?php
+ $module_tpl = ob_get_clean();
+
+ $modules = $this->GetUpgradableModules();
+ foreach ($modules as $module_name => $module_params) {
+ $module_title = $module_name.' ('.$module_params['Version'].' to '.$module_params['ToVersion'].')';
+ if ($this->Application->isDebugMode()) {
+ $module_title .= ' [from: '.$module_params['FromVersion'].']';
+ }
+ echo sprintf($module_tpl, $module_name, $module_title);
+ }
+?>
+<tr class="table_color1">
+ <td class="hint" colspan="2" valign="middle">
+ <img src="incs/img/icon_warning.gif" width="14" height="14" align="absmiddle" />
+ Your data will be modified during the upgrade. We strongly recommend that you make a backup of your database. Proceed with the upgrade ?
+ </td>
+</tr>
\ No newline at end of file
Property changes on: trunk/core/install/step_templates/upgrade_modules.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/install/incs/install.tpl
===================================================================
--- trunk/core/install/incs/install.tpl (revision 7634)
+++ trunk/core/install/incs/install.tpl (revision 7635)
@@ -1,153 +1,153 @@
<html>
<head>
<title>In-Portal Installation</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<base href="<?php echo $this->baseURL; ?>"/>
<link rel="stylesheet" type="text/css" href="incs/style.css" />
<script type="text/javascript" src="incs/script.js"></script>
</head>
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" style="height: 100%">
<form enctype="multipart/form-data" id="install_form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
<!-- header: begin -->
<tr>
<td height="90">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="90">
<tr>
<td rowspan="3" valign="top"><a href="http://www.in-portal.net" target="_top"><img title="In-portal" src="incs/img/globe.gif" width="84" height="91" border="0" alt="In-Portal"/></a></td>
<td rowspan="3" valign="top"><a href="http://www.in-portal.net" target="_top"><img title="In-portal" src="incs/img/logo.gif" width="150" height="91" border="0" alt="In-Portal"/></a></td>
<td rowspan="3" width="100%" align="right">&nbsp;</td>
<td width="400"><img title="" src="incs/img/blocks.gif" width="400" height="73" alt="blocks" /></td>
</tr>
- <tr><td align="right" background="incs/img/version_bg.gif" class="head_version" valign="top"><img title="" src="incs/img/spacer.gif" width="1" height="14" alt=""/>In-Portal Version <?php echo $this->GetModuleVersion('In-Portal'); ?>: English US</td></tr>
+ <tr><td align="right" background="incs/img/version_bg.gif" class="head_version" valign="top"><img title="" src="incs/img/spacer.gif" width="1" height="14" alt=""/>In-Portal Version <?php echo $this->GetMaxModuleVersion('Core'); ?>: English US</td></tr>
<tr><td><img title="" src="incs/img/blocks2.gif" width="400" height="2" alt="blocks2"/><br /></td></tr>
<tr><td bgcolor="black" colspan="4"><img title="" src="incs/img/spacer.gif" width="1" height="1" alt=""/><br /></td></tr>
</table>
</td>
</tr>
<!-- header: end -->
<tr height="100%">
<td valign="top">
<table cellpadding=10 cellspacing=0 border=0 width="100%" height="100%">
<tr valign="top">
<td style="width: 200px; background: #009ff0 url(incs/img/bg_install_menu.gif) no-repeat bottom right; border-right: 1px solid #000">
<img src="incs/img/spacer.gif" width="180" height="1" border="0" alt="" /><br />
<span class="admintitle-white">Installation</span>
<ol class="install-steps">
<?php
echo $this->PrintSteps('<li class="current-step">%s</li>', '<li>%s</li>');
?>
</ol>
</td>
<td>
<img src="incs/img/icon_install.gif" width="46" height="46" alt="" align="absmiddle" />&nbsp;<span class="admintitle"><?php echo $this->GetStepInfo('step_title'); ?></span><br /><br />
<!-- section header: begin -->
<table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
<tr>
<td class="tablenav" width="580" nowrap background="incs/img/tabnav_left.jpg">
<span class="tablenav_link"><?php echo 'Step '.$this->GetStepNumber().' - '.$this->GetStepInfo('step_title'); ?></span>
</td>
<td align="right" class="tablenav" background="incs/img/tabnav_back.jpg" width="100%">
<a class="link" onclick="ShowHelp('in-portal:install');">
<img src="incs/img/blue_bar_help.gif" border="0">
</a>
</td>
</tr>
</table>
<!-- section header: end -->
<!-- toolbar: begin -->
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<tr>
<td>
<a href="javascript:continue_install();">
<img border="0" src="incs/img/toolbar/tool_select.gif" id="img_Save" width="32" height="32" border="0" alt="Save" onmouseout="swap_image('img_Save', 'toolbar/tool_select.gif');" onmouseover="swap_image('img_Save','toolbar/tool_select_f2.gif');" /><br />
</a>
</td>
<td>
<img src="incs/img/toolbar/tool_cancel.gif" id="img_Cancel" width="32" height="32" border="0" alt="Cancel" onmouseout="swap_image('img_Cancel', 'toolbar/tool_cancel.gif');" onmouseover="swap_image('img_Cancel','toolbar/tool_cancel_f2.gif');" onclick="history.go(-1);" /><br />
</td>
<td width="100%">&nbsp;</td>
</tr>
</table>
<!-- toolbar: end -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<!-- step body: begin -->
<?php echo $this->GetStepBody(); ?>
<!-- step body: end -->
<!-- step error message: begin -->
<tr class="table_color2">
<td colspan="2">
<p class="error">
<?php echo $this->errorMessage; ?>
</p>
<br/>
</td>
</tr>
<!-- step error message: end -->
<!-- next, prev buttons: begin -->
<tr>
<td colspan="2">
<br />
<input type="submit" name="submit_form" value="Continue" class="button" />
<?php
if ($this->GetStepNumber() > 1 && $this->GetNextStep() != -1) {
echo '<input type="reset" name="cancel" value="Cancel" class="button" onclick="history.go(-1);" />';
}
?>
<input type="hidden" name="step" value="<?php echo $this->currentStep; ?>"/>
<input type="hidden" name="preset" value="<?php echo $this->stepsPreset; ?>"/>
</td>
</tr>
<!-- next, prev buttons: end -->
</table>
</td>
<td width="40%" style="border-left: 1px solid #000; background: #f0f0f0">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td class="subsectiontitle" style="border-bottom: 1px solid #000000; background-color: #999"><?php echo $this->GetStepInfo('help_title'); ?></td>
</tr>
<tr>
<td class="text"><?php echo $this->GetStepInfo('help_body'); ?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
</td>
</tr>
<tr>
<td class="footer">
Powered by In-portal &copy; 1997-<?php echo date('Y'); ?>, Intechnic Corporation. All rights reserved.
<br /><img src="incs/img/spacer.gif" width="1" height="10" alt="" />
</td>
</tr>
</table>
</form>
</body>
</html>
\ No newline at end of file
Property changes on: trunk/core/install/incs/install.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/core/install/incs/style.css
===================================================================
--- trunk/core/install/incs/style.css (revision 7634)
+++ trunk/core/install/incs/style.css (revision 7635)
@@ -1,206 +1,213 @@
html, body {
margin: 0;
padding: 0;
background: #FFFFFF;
color: #333333;
}
ol.install-steps {
font: bold 12px verdana, sans-serif;
color: #fff;
line-height: 20px
}
.install-steps li.current-step {
color: #005786
}
/*#nav {
margin-left: -1px;
text-align: center;
float: left
}
#content {
padding: 10px;
color: darkblue;
float: right
}
#header {
background-color: #fff;
color: #006;
border-bottom: 1px solid #006;
margin-bottom: 0px
}
*/
.footer {
background-color: #FFFFFF;
color: #006;
border-top: 1px solid #006;
font-size: 11px;
text-align: right;
padding: 2px 10px 0 0;
clear: both;
}
p {
padding: 0;
margin-top: 0px;
font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Helvetica, Arial, sans-serif;
}
/*
.spacer {clear: both}
dd, dt {
font: 0.95em 'Lucida Grande', Verdana, Geneva, Lucida, Helvetica, Arial, sans-serif;
}
*/
.head_version {
padding-right: 5px;
font-weight: normal;
font-size: 10px;
color: white;
font-family: verdana, arial;
text-decoration: none;
}
.admintitle, .admintitle-white {
font-weight: bold;
font-size: 20px;
color: #009FF0;
font-family: verdana, arial;
text-decoration: none;
}
.admintitle-white {
color: #fff
}
.subsectiontitle {
font-weight: bold;
font-size: 14px;
color: white;
font-family: verdana, arial;
background-color: #999999;
text-decoration: none;
height: 24px;
}
.subsectiontitle:hover {
font-weight: bold;
font-size: 14px;
color: #ffcc00;
font-family: verdana, arial;
background-color: #999999;
text-decoration: none;
}
.text {
font-weight: normal;
font-size: 12px;
font-family: verdana, arial;
text-decoration: none;
}
.toolbar {
border-right: #000000 1px solid;
border-top: #000000 0px solid;
font-size: 10pt;
border-left: #000000 1px solid;
border-bottom: #000000 1px solid;
font-family: Arial, Helvetica, sans-serif;
background-color: #F0F1EB;
}
.tableborder {
border-right: #000000 1px solid;
border-top: #000000 0px solid;
font-size: 10pt;
border-left: #000000 1px solid;
border-bottom: #000000 1px solid;
font-family: Arial, Helvetica, sans-serif;
}
.tableborder_full {
border-right: #000000 1px solid;
border-top: #000000 1px solid;
font-size: 10pt;
border-left: #000000 1px solid;
border-bottom: #000000 1px solid;
font-family: Arial, Helvetica, sans-serif;
background-image: url(img/tab_middle.gif);
background-repeat: repeat-x;
}
.tablenav {
font-weight: bold;
font-size: 14px;
color: white;
font-family: verdana, arial;
background-color: #73C4F5;
text-decoration: none;
}
.tablenav_link {
font-weight: bold;
font-size: 14px;
color: white;
font-family: verdana, arial;
text-decoration: none;
}
.tablenav_link:hover {
font-weight: bold;
font-size: 14px;
color: #FFCC00;
font-family: verdana, arial;
text-decoration: none;
}
/*.table_color1 {
font-weight: normal;
font-size: 14px;
color: black;
font-family: verdana, arial;
background-color: #F6F6F6;
text-decoration: none;
}*/
.table_color2 {
font-weight: normal;
font-size: 14px;
color: black;
font-family: verdana, arial;
background-color: #EBEBEB;
text-decoration: none;
}
.error {
font-weight: bold;
font-size: 9pt;
color: #ff0000;
font-family: Arial, Helvetica, sans-serif;
}
.button {
font-weight: normal;
font-size: 12px;
background: url(img/button_back.gif) #F9EEAE repeat-x;
color: black;
font-family: Arial, Verdana;
text-decoration: none;
}
td {
font-size: 10pt;
font-family: Verdana, Helvetica;
text-decoration: none;
}
.link {
cursor: pointer;
}
+
+.hint {
+ font-size: 12px;
+ color: #666666;
+ font-style: normal;
+ font-family: Arial, Helvetica, sans-serif;
+}
Property changes on: trunk/core/install/incs/style.css
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/core/install/incs/img/icon_warning.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/install/incs/img/icon_warning.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/install/install_data.sql
===================================================================
--- trunk/core/install/install_data.sql (revision 7634)
+++ trunk/core/install/install_data.sql (revision 7635)
@@ -1,576 +1,578 @@
INSERT INTO ConfigurationAdmin VALUES ('Site_Name', 'la_Text_Website', 'la_config_website_name', 'text', '', '', 10.02, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Site_Path', 'la_Text_Website', 'la_config_web_address', 'text', '', '', 10.01, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Backup_Path', 'la_Text_BackupPath', 'la_config_backup_path', 'text', '', '', 40.01, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Domain_Detect', 'la_Text_Website', 'la_config_detect_domain', 'text', '', '', 8, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_Sortfield', 'la_Text_General', 'la_category_sortfield_prompt', 'select', '', 'Name=la_Category_Name,Description=la_Category_Description,CreatedOn=la_Category_Date,EditorsPick=la_Category_Pick,<SQL>SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM <PREFIX>CustomField WHERE (Type = 1) AND (IsSystem = 0)</SQL>', 10.01, 1, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_Sortorder', 'la_Text_General', 'la_category_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.01, 2, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_Sortfield2', 'la_Text_General', 'la_category_sortfield2_prompt', 'select', '', 'Name=la_Category_Name,Description=la_Category_Description,CreatedOn=la_Category_Date,EditorsPick=la_Category_Pick,<SQL>SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM <PREFIX>CustomField WHERE (Type = 1) AND (IsSystem = 0)</SQL>', 10.02, 1, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_Sortorder2', 'la_Text_General', 'la_category_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.02, 2, 1);
INSERT INTO ConfigurationAdmin VALUES ('Perpage_Category', 'la_Text_General', 'la_category_perpage_prompt', 'text', '', '', 10.03, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_DaysNew', 'la_Text_General', 'la_category_daysnew_prompt', 'text', '', '', 10.05, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_ShowPick', 'la_Text_General', 'la_category_showpick_prompt', 'checkbox', '', '', 10.06, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_MetaKey', 'la_Text_MetaInfo', 'la_category_metakey', 'text', '', '', 20.01, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_MetaDesc', 'la_Text_MetaInfo', 'la_category_metadesc', 'text', '', '', 20.02, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('User_NewGroup', 'la_Text_General', 'la_users_new_group', 'select', NULL, '0=lu_none,<SQL+>SELECT GroupId as OptionValue, Name as OptionName FROM <PREFIX>PortalGroup WHERE Enabled=1 AND Personal=0</SQL>', 10.08, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('User_GuestGroup', 'la_Text_General', 'la_users_guest_group', 'select', NULL, '0=lu_none,<SQL+>SELECT GroupId as OptionValue, Name as OptionName FROM <PREFIX>PortalGroup WHERE Enabled=1 AND Personal=0</SQL>', 10.1, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('RootPass', 'la_Text_General', 'la_prompt_root_pass', 'password', NULL, NULL, 10.12, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('Users_AllowReset', 'la_Text_General', 'la_prompt_allow_reset', 'text', NULL, NULL, 10.05, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('User_Allow_New', 'la_Text_General', 'la_users_allow_new', 'radio', '', '1=la_User_Instant,2=la_User_Not_Allowed,3=la_User_Upon_Approval', 10.01, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('User_Password_Auto', 'la_Text_General', 'la_users_password_auto', 'checkbox', '', '', 10.06, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('User_Votes_Deny', 'la_Text_Restrictions', 'la_users_votes_deny', 'text', '', '', 20.01, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('User_MembershipExpirationReminder', 'la_Text_General', 'la_MembershipExpirationReminder', 'text', NULL, '', 10.07, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('User_Review_Deny', 'la_Text_Restrictions', 'la_users_review_deny', 'text', '', '', 20.02, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Server_Name', 'la_Text_Website', 'la_config_server_name', 'text', '', '', 4, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('Config_Server_Time', 'la_Text_Date_Time_Settings', 'la_config_time_server', 'select', '', '1=la_m12,2=la_m11,3=la_m10,5=la_m9,6=la_m8,7=la_m7,8=la_m6,9=la_m5,10=la_m4,11=la_m3,12=la_m2,13=la_m1,14=la_m0,15=la_p1,16=la_p2,17=la_p3,18=la_p4,19=la_p5,20=la_p6,21=la_p7,22=la_p8,23=la_p9,24=la_p10,25=la_p11,26=la_p12,27=la_p13', 20.01, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Config_Site_Time', 'la_Text_Date_Time_Settings', 'la_config_site_zone', 'select', '', '1=la_m12,2=la_m11,3=la_m10,5=la_m9,6=la_m8,7=la_m7,8=la_m6,9=la_m5,10=la_m4,11=la_m3,12=la_m2,13=la_m1,14=la_m0,15=la_p1,16=la_p2,17=la_p3,18=la_p4,19=la_p5,20=la_p6,21=la_p7,22=la_p8,23=la_p9,24=la_p10,25=la_p11,26=la_p12,27=la_p13', 20.02, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Smtp_Server', 'la_Text_smtp_server', 'la_prompt_mailserver', 'text', NULL, NULL, 30.01, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Smtp_Port', 'la_Text_smtp_server', 'la_prompt_mailport', 'text', NULL, NULL, 30.02, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Smtp_Authenticate', 'la_Text_smtp_server', 'la_prompt_mailauthenticate', 'checkbox', NULL, NULL, 30.03, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Smtp_User', 'la_Text_smtp_server', 'la_prompt_smtp_user', 'text', NULL, NULL, 30.04, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Smtp_Pass', 'la_Text_smtp_server', 'la_prompt_smtp_pass', 'text', NULL, NULL, 30.05, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Smtp_DefaultHeaders', 'la_Text_smtp_server', 'la_prompt_smtpheaders', 'textarea', NULL, 'COLS=40 ROWS=5', 30.06, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('Smtp_AdminMailFrom', 'la_Text_smtp_server', 'la_prompt_AdminMailFrom', 'text', NULL, NULL, 30.07, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Perpage_Category_Short', 'la_Text_General', 'la_category_perpage__short_prompt', 'text', '', '', 10.04, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('CookieSessions', 'la_Text_Website', 'la_prompt_session_management', 'select', NULL, '0=lu_query_string,1=lu_cookies,2=lu_auto', 10.03, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_category', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_category', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_category', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_category', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SessionTimeout', 'la_Text_Website', 'la_prompt_session_timeout', 'text', '', '', 10.05, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SystemTagCache', 'la_Text_Website', 'la_prompt_syscache_enable', 'checkbox', NULL, NULL, 10.07, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('User_SubscriberGroup', 'la_Text_General', 'la_users_subscriber_group', 'select', NULL, '0=lu_none,<SQL+>SELECT GroupId as OptionValue, Name as OptionName FROM <PREFIX>PortalGroup WHERE Enabled=1 AND Personal=0</SQL>', 10.11, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Root_Name', 'la_Text_General', 'la_prompt_root_name', 'text', '', '', 10.07, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SocketBlockingMode', 'la_Text_Website', 'la_prompt_socket_blocking_mode', 'checkbox', NULL, NULL, 10.08, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('Min_UserName', 'la_Text_General', 'la_text_min_username', 'text', '', '', 10.03, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('Min_Password', 'la_Text_General', 'la_text_min_password', 'text', '', '', 10.04, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('Email_As_Login', 'la_Text_General', 'la_use_emails_as_login', 'checkbox', NULL, NULL, 10.02, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('User_LoggedInGroup', 'la_Text_General', 'la_users_assign_all_to', 'select', NULL, '0=lu_none,<SQL+>SELECT GroupId as OptionValue, Name as OptionName FROM <PREFIX>PortalGroup WHERE Enabled=1 AND Personal=0</SQL>', 10.09, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('FirstDayOfWeek', 'la_Text_Date_Time_Settings', 'la_config_first_day_of_week', 'select', '', '0=la_sunday,1=la_monday', 20.03, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SSL_URL', 'la_Text_Website', 'la_config_ssl_url', 'text', '', '', 10.09, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Require_SSL', 'la_Text_Website', 'la_config_require_ssl', 'checkbox', '', '', 10.1, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Force_HTTP_When_SSL_Not_Required', 'la_Text_Website', 'la_config_force_http', 'checkbox', '', '', 10.11, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SessionCookieName', 'la_Text_Website', 'la_prompt_session_cookie_name', 'text', '', '', 10.04, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SessionReferrerCheck', 'la_Text_Website', 'la_promt_ReferrerCheck', 'checkbox', NULL, NULL, 10.06, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('UseModRewrite', 'la_Text_Website', 'la_config_use_modrewrite', 'checkbox', '', '', 10.12, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('UseModRewriteWithSSL', 'la_Text_Website', 'la_config_use_modrewrite_with_ssl', 'checkbox', '', '', 10.13, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('ErrorTemplate', 'la_Text_Website', 'la_config_error_template', 'text', '', '', 10.16, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('UseJSRedirect', 'la_Text_Website', 'la_config_use_js_redirect', 'checkbox', '', '', 10.14, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('MaxImportCategoryLevels', 'la_Text_General', 'la_prompt_max_import_category_levels', 'text', '', '', 10.08, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('UseCronForRegularEvent', 'la_Text_Website', 'la_UseCronForRegularEvent', 'checkbox', NULL, NULL, 10.15, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('NoPermissionTemplate', 'la_Text_Website', 'la_config_nopermission_template', 'text', '', '', 10.17, 0, 0);
INSERT INTO ConfigurationAdmin (VariableName, heading, prompt, element_type, validation, ValueList, DisplayOrder, GroupDisplayOrder, Install) VALUES ('UseOutputCompression', 'la_Text_Website', 'la_config_UseOutputCompression', 'checkbox', '', '', 10.18, 0, 1);
INSERT INTO ConfigurationAdmin (VariableName, heading, prompt, element_type, validation, ValueList, DisplayOrder, GroupDisplayOrder, Install) VALUES ('OutputCompressionLevel', 'la_Text_Website', 'la_config_OutputCompressionLevel', 'text', '', '', 10.19, 0, 1);
INSERT INTO ConfigurationValues VALUES (NULL, 'Columns_Category', '2', 'In-Portal', 'Categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'DomainSelect','1','In-Portal','in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Site_Path', '/', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Archive', '25', 'inportal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'debug', '1', 'inportal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_User', '100', 'inportal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LangEmail', '20', 'inportal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Default_FromAddr', '', 'inportal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'email_replyto', '', 'inportal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'email_footer', 'message footer goes here', 'inportal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Default_Theme', 'default', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Default_Language', 'English', 'inportal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'SessionTimeout', '3600', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'User_SortOrder', 'asc', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Suggest_MinInterval', '3600', 'inportal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'SubCat_ListCount', '3', 'inportal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Timeout_Rating', '3600', 'In-Portal', 'System');
INSERT INTO ConfigurationValues VALUES (NULL, 'User_SortField', 'u.CreatedOn', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Relations', '10', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Group_SortField', 'GroupName', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Group_SortOrder', 'asc', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Default_FromName', 'Webmaster', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Category', '10', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_Sortfield', 'Name', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_Sortorder', 'asc', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'MetaKeywords', NULL, 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Relation_LV_Sortfield', 'ItemType', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'ampm_time', '1', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Template', '10', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Phrase', '40', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Sessionlist', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_Sortfield2', 'Description', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_Sortorder2', 'asc', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_DaysNew', '8', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_ShowPick', '', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_MetaKey', '', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_MetaDesc', '', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'MetaDescription', NULL, 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'User_NewGroup', '13', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'User_Allow_New', '3', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'User_Password_Auto', '0', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'User_Votes_Deny', '5', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'User_Review_Deny', '5', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'Config_Name', '', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Config_Company', '', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Config_Reg_Number', '', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Config_Website_Name', '', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Config_Web_Address', '', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Config_Server_Time', '14', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Config_Site_Time', '14', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Site_Name', 'In-Portal', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Backup_Path', '', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Items', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'GuestSessions', '1', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_Server', NULL, 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_Port', NULL, 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_User', NULL, 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_Pass', NULL, 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_SendHTML', '1', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_Authenticate', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Email', '10', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_DefaultHeaders', 'X-Priority: 1\r\nX-MSMail-Priority: High\r\nX-Mailer: In-Portal', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_AdminMailFrom', 'portal@user.domain.name', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_Highlight_OpenTag', '<span class="match">', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_Highlight_CloseTag', '</span>', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'User_GuestGroup', '14', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'RootPass', '', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Category_Short', '3', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'CookieSessions', '2', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_category', '30', 'In-Portal', 'in-portal:configuration_search');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_category', '90', 'In-Portal', 'in-portal:configuration_search');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_category', '5', 'In-Portal', 'in-portal:configuration_search');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_category', '5', 'In-Portal', 'in-portal:configuration_search');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_DefaultIncrease', '30', 'In-Portal', 'inportal:configure_searchdefault');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_DefaultKeyword', '80', 'In-Portal', 'SearchRel_DefaultKeyword');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_DefaultPop', '10', 'In-Portal', 'inportal:configuration_searchdefault');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_DefaultRating', '10', 'In-Portal', 'inportal:configure_searchdefault');
INSERT INTO ConfigurationValues VALUES (NULL, 'SystemTagCache', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Root_Name', 'lu_rootcategory_name', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'User_SubscriberGroup', '12', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'SocketBlockingMode', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Min_UserName', '3', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'Min_Password', '5', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'LinksValidation_LV_Sortfield', 'ValidationTime', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'CustomConfig_LV_Sortfield', 'FieldName', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Event_LV_SortField', 'Description', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Theme_LV_SortField', 'Name', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Template_LV_SortField', 'FileName', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Lang_LV_SortField', 'PackName', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Phrase_LV_SortField', 'Phrase', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'LangEmail_LV_SortField', 'Description', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'CustomData_LV_SortField', 'FieldName', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Summary_SortField', 'Module', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Session_SortField', 'UserName', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchLog_SortField', 'Keyword', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_StatItem', '10', 'inportal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Groups', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Event', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_BanRules', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_SearchLog', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LV_lang', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LV_Themes', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LV_Catlist', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Reviews', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Modules', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Grouplist', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Images', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'EmailsL_SortField', 'time_sent', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_EmailsL', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_CustomData', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Review', '10', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Search_MinKeyword_Length', '3', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Users_AllowReset', '180', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'Email_As_Login', '0', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'User_LoggedInGroup', '15', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'User_MembershipExpirationReminder', '10', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'FirstDayOfWeek', '1', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'SSL_URL', '', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Require_SSL', '', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Force_HTTP_When_SSL_Not_Required', '1', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'SessionCookieName', 'sid', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'UseModRewrite', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'UseModRewriteWithSSL', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'SessionReferrerCheck', '1', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'ErrorTemplate', 'error_notfound', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'UseJSRedirect', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'MaxImportCategoryLevels', '10', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'UseCronForRegularEvent', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'NoPermissionTemplate', 'no_permission', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues (VariableName, VariableValue, ModuleOwner, Section) VALUES ('UseOutputCompression', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues (VariableName, VariableValue, ModuleOwner, Section) VALUES ('OutputCompressionLevel', '7', 'In-Portal', 'in-portal:configure_general');
INSERT INTO Events VALUES (30, 'USER.ADD', 1, 0, 'In-Portal:Users', 'la_event_user.add', 0);
INSERT INTO Events VALUES (32, 'USER.ADD', 2, 0, 'In-Portal:Users', 'la_event_user.add', 1);
INSERT INTO Events VALUES (31, 'USER.APPROVE', 1, 0, 'In-Portal:Users', 'la_event_user.approve', 0);
INSERT INTO Events VALUES (33, 'USER.APPROVE', 2, 0, 'In-Portal:Users', 'la_event_user.approve', 1);
INSERT INTO Events VALUES (34, 'USER.VALIDATE', 1, 0, 'In-Portal:Users', 'la_event_user.validate', 0);
INSERT INTO Events VALUES (35, 'USER.VALIDATE', 2, 0, 'In-Portal:Users', 'la_event_user.validate', 1);
INSERT INTO Events VALUES (36, 'USER.DENY', 1, 0, 'In-Portal:Users', 'la_event_user.deny', 0);
INSERT INTO Events VALUES (37, 'USER.DENY', 2, 0, 'In-Portal:Users', 'la_event_user.deny', 1);
INSERT INTO Events VALUES (38, 'USER.PSWD', 2, 0, 'In-Portal:Users', 'la_event_user.forgotpw', 1);
INSERT INTO Events VALUES (39, 'USER.PSWD', 1, 0, 'In-Portal:Users', 'la_event_user.forgotpw', 0);
INSERT INTO Events VALUES (45, 'USER.ADD.PENDING', 1, 0, 'In-Portal:Users', 'la_event_user.add.pending', 0);
INSERT INTO Events VALUES (68, 'USER.ADD.PENDING', 2, 0, 'In-Portal:Users', 'la_event_user.add.pending', 1);
INSERT INTO Events VALUES (47, 'CATEGORY.ADD', 1, 0, 'In-Portal:Category', 'la_event_category.add', 0);
INSERT INTO Events VALUES (48, 'CATEGORY.ADD.PENDING', 1, 0, 'In-Portal:Category', 'la_event_category.add.pending', 0);
INSERT INTO Events VALUES (49, 'CATEGORY.ADD.PENDING', 2, 0, 'In-Portal:Category', 'la_event_category.add.pending', 1);
INSERT INTO Events VALUES (50, 'CATEGORY.ADD', 2, 0, 'In-Portal:Category', 'la_event_category.add', 1);
INSERT INTO Events VALUES (51, 'CATEGORY.DELETE', 1, 0, 'In-Portal:Category', 'la_event_category_delete', 0);
INSERT INTO Events VALUES (52, 'CATEGORY.DELETE', 2, 0, 'In-Portal:Category', 'la_event_category_delete', 1);
INSERT INTO Events VALUES (53, 'CATEGORY.MODIFY', 1, 0, 'In-Portal:Category', 'la_event_category.modify', 0);
INSERT INTO Events VALUES (54, 'CATEGORY.MODIFY', 2, 0, 'In-Portal:Category', 'la_event_category.modify', 1);
INSERT INTO Events VALUES (56, 'CATEGORY.APPROVE', 1, 0, 'In-Portal:Category', 'la_event_category.approve', 0);
INSERT INTO Events VALUES (57, 'CATEGORY.APPROVE', 2, 0, 'In-Portal:Category', 'la_event_category.approve', 1);
INSERT INTO Events VALUES (58, 'CATEGORY.DENY', 1, 0, 'In-Portal:Category', 'la_event_category.deny', 0);
INSERT INTO Events VALUES (59, 'CATEGORY.DENY', 2, 0, 'In-Portal:Category', 'la_event_category.deny', 1);
INSERT INTO Events VALUES (60, 'USER.SUBSCRIBE', 1, 0, 'In-Portal:Users', 'la_event_user.subscribe', 0);
INSERT INTO Events VALUES (61, 'USER.SUBSCRIBE', 2, 0, 'In-Portal:Users', 'la_event_user.subscribe', 1);
INSERT INTO Events VALUES (62, 'USER.UNSUBSCRIBE', 1, 0, 'In-Portal:Users', 'la_event_user.unsubscribe', 0);
INSERT INTO Events VALUES (63, 'USER.UNSUBSCRIBE', 2, 0, 'In-Portal:Users', 'la_event_user.unsubscribe', 1);
INSERT INTO Events VALUES (64, 'USER.SUGGEST', '1', '0', 'In-Portal:Users', 'la_event_user.suggest', '0');
INSERT INTO Events VALUES (65, 'USER.SUGGEST', '2', '0', 'In-Portal:Users', 'la_event_user.suggest', '1');
INSERT INTO Events VALUES (67, 'USER.PSWDC', '1', '0', 'In-Portal:Users', 'la_event_user.pswd_confirm', '0');
INSERT INTO Events VALUES ('', 'USER.MEMBERSHIP.EXPIRED', '1', '0', 'In-Portal:Users', 'la_event_user.membership_expired', '0');
INSERT INTO Events VALUES ('', 'USER.MEMBERSHIP.EXPIRED', '1', '0', 'In-Portal:Users', 'la_event_user.membership_expired', '1');
INSERT INTO Events VALUES ('', 'USER.MEMBERSHIP.EXPIRATION.NOTICE', '1', '0', 'In-Portal:Users', 'la_event_user.membership_expiration_notice', '0');
INSERT INTO Events VALUES ('', 'USER.MEMBERSHIP.EXPIRATION.NOTICE', '1', '0', 'In-Portal:Users', 'la_event_user.membership_expiration_notice', '1');
INSERT INTO Events (Event, Enabled, FromUserId, Module, Description, Type) VALUES ('COMMON.FOOTER', 1, 0, 'In-Portal', 'la_event_common.footer', 1);
INSERT INTO IdGenerator VALUES ('100');
INSERT INTO PortalGroup VALUES (15, 'Everyone', 'Everyone', 0, 1, 0, 1, 15);
INSERT INTO PortalGroup VALUES (13, 'Member', '', '1054738682', 0, 0, 1, 13);
INSERT INTO PortalGroup VALUES (12, 'Subscribers', '', '1054738670', 0, 0, 1, 12);
INSERT INTO PortalGroup VALUES (14, 'Guest', 'Guest User', '0', 1, 0, 1, 14);
INSERT INTO PortalGroup VALUES (11, 'admin', '', '1054738405', 0, 0, 1, 11);
INSERT INTO StdDestinations VALUES (1, 1, NULL, 'la_country_AFG', 'AFG', 'AF');
INSERT INTO StdDestinations VALUES (2, 1, NULL, 'la_country_ALB', 'ALB', 'AL');
INSERT INTO StdDestinations VALUES (3, 1, NULL, 'la_country_DZA', 'DZA', 'DZ');
INSERT INTO StdDestinations VALUES (4, 1, NULL, 'la_country_ASM', 'ASM', 'AS');
INSERT INTO StdDestinations VALUES (5, 1, NULL, 'la_country_AND', 'AND', 'AD');
INSERT INTO StdDestinations VALUES (6, 1, NULL, 'la_country_AGO', 'AGO', 'AO');
INSERT INTO StdDestinations VALUES (7, 1, NULL, 'la_country_AIA', 'AIA', 'AI');
INSERT INTO StdDestinations VALUES (8, 1, NULL, 'la_country_ATA', 'ATA', 'AQ');
INSERT INTO StdDestinations VALUES (9, 1, NULL, 'la_country_ATG', 'ATG', 'AG');
INSERT INTO StdDestinations VALUES (10, 1, NULL, 'la_country_ARG', 'ARG', 'AR');
INSERT INTO StdDestinations VALUES (11, 1, NULL, 'la_country_ARM', 'ARM', 'AM');
INSERT INTO StdDestinations VALUES (12, 1, NULL, 'la_country_ABW', 'ABW', 'AW');
INSERT INTO StdDestinations VALUES (13, 1, NULL, 'la_country_AUS', 'AUS', 'AU');
INSERT INTO StdDestinations VALUES (14, 1, NULL, 'la_country_AUT', 'AUT', 'AT');
INSERT INTO StdDestinations VALUES (15, 1, NULL, 'la_country_AZE', 'AZE', 'AZ');
INSERT INTO StdDestinations VALUES (16, 1, NULL, 'la_country_BHS', 'BHS', 'BS');
INSERT INTO StdDestinations VALUES (17, 1, NULL, 'la_country_BHR', 'BHR', 'BH');
INSERT INTO StdDestinations VALUES (18, 1, NULL, 'la_country_BGD', 'BGD', 'BD');
INSERT INTO StdDestinations VALUES (19, 1, NULL, 'la_country_BRB', 'BRB', 'BB');
INSERT INTO StdDestinations VALUES (20, 1, NULL, 'la_country_BLR', 'BLR', 'BY');
INSERT INTO StdDestinations VALUES (21, 1, NULL, 'la_country_BEL', 'BEL', 'BE');
INSERT INTO StdDestinations VALUES (22, 1, NULL, 'la_country_BLZ', 'BLZ', 'BZ');
INSERT INTO StdDestinations VALUES (23, 1, NULL, 'la_country_BEN', 'BEN', 'BJ');
INSERT INTO StdDestinations VALUES (24, 1, NULL, 'la_country_BMU', 'BMU', 'BM');
INSERT INTO StdDestinations VALUES (25, 1, NULL, 'la_country_BTN', 'BTN', 'BT');
INSERT INTO StdDestinations VALUES (26, 1, NULL, 'la_country_BOL', 'BOL', 'BO');
INSERT INTO StdDestinations VALUES (27, 1, NULL, 'la_country_BIH', 'BIH', 'BA');
INSERT INTO StdDestinations VALUES (28, 1, NULL, 'la_country_BWA', 'BWA', 'BW');
INSERT INTO StdDestinations VALUES (29, 1, NULL, 'la_country_BVT', 'BVT', 'BV');
INSERT INTO StdDestinations VALUES (30, 1, NULL, 'la_country_BRA', 'BRA', 'BR');
INSERT INTO StdDestinations VALUES (31, 1, NULL, 'la_country_IOT', 'IOT', 'IO');
INSERT INTO StdDestinations VALUES (32, 1, NULL, 'la_country_BRN', 'BRN', 'BN');
INSERT INTO StdDestinations VALUES (33, 1, NULL, 'la_country_BGR', 'BGR', 'BG');
INSERT INTO StdDestinations VALUES (34, 1, NULL, 'la_country_BFA', 'BFA', 'BF');
INSERT INTO StdDestinations VALUES (35, 1, NULL, 'la_country_BDI', 'BDI', 'BI');
INSERT INTO StdDestinations VALUES (36, 1, NULL, 'la_country_KHM', 'KHM', 'KH');
INSERT INTO StdDestinations VALUES (37, 1, NULL, 'la_country_CMR', 'CMR', 'CM');
INSERT INTO StdDestinations VALUES (38, 1, NULL, 'la_country_CAN', 'CAN', 'CA');
INSERT INTO StdDestinations VALUES (39, 1, NULL, 'la_country_CPV', 'CPV', 'CV');
INSERT INTO StdDestinations VALUES (40, 1, NULL, 'la_country_CYM', 'CYM', 'KY');
INSERT INTO StdDestinations VALUES (41, 1, NULL, 'la_country_CAF', 'CAF', 'CF');
INSERT INTO StdDestinations VALUES (42, 1, NULL, 'la_country_TCD', 'TCD', 'TD');
INSERT INTO StdDestinations VALUES (43, 1, NULL, 'la_country_CHL', 'CHL', 'CL');
INSERT INTO StdDestinations VALUES (44, 1, NULL, 'la_country_CHN', 'CHN', 'CN');
INSERT INTO StdDestinations VALUES (45, 1, NULL, 'la_country_CXR', 'CXR', 'CX');
INSERT INTO StdDestinations VALUES (46, 1, NULL, 'la_country_CCK', 'CCK', 'CC');
INSERT INTO StdDestinations VALUES (47, 1, NULL, 'la_country_COL', 'COL', 'CO');
INSERT INTO StdDestinations VALUES (48, 1, NULL, 'la_country_COM', 'COM', 'KM');
INSERT INTO StdDestinations VALUES (49, 1, NULL, 'la_country_COD', 'COD', 'CD');
INSERT INTO StdDestinations VALUES (50, 1, NULL, 'la_country_COG', 'COG', 'CG');
INSERT INTO StdDestinations VALUES (51, 1, NULL, 'la_country_COK', 'COK', 'CK');
INSERT INTO StdDestinations VALUES (52, 1, NULL, 'la_country_CRI', 'CRI', 'CR');
INSERT INTO StdDestinations VALUES (53, 1, NULL, 'la_country_CIV', 'CIV', 'CI');
INSERT INTO StdDestinations VALUES (54, 1, NULL, 'la_country_HRV', 'HRV', 'HR');
INSERT INTO StdDestinations VALUES (55, 1, NULL, 'la_country_CUB', 'CUB', 'CU');
INSERT INTO StdDestinations VALUES (56, 1, NULL, 'la_country_CYP', 'CYP', 'CY');
INSERT INTO StdDestinations VALUES (57, 1, NULL, 'la_country_CZE', 'CZE', 'CZ');
INSERT INTO StdDestinations VALUES (58, 1, NULL, 'la_country_DNK', 'DNK', 'DK');
INSERT INTO StdDestinations VALUES (59, 1, NULL, 'la_country_DJI', 'DJI', 'DJ');
INSERT INTO StdDestinations VALUES (60, 1, NULL, 'la_country_DMA', 'DMA', 'DM');
INSERT INTO StdDestinations VALUES (61, 1, NULL, 'la_country_DOM', 'DOM', 'DO');
INSERT INTO StdDestinations VALUES (62, 1, NULL, 'la_country_TLS', 'TLS', 'TL');
INSERT INTO StdDestinations VALUES (63, 1, NULL, 'la_country_ECU', 'ECU', 'EC');
INSERT INTO StdDestinations VALUES (64, 1, NULL, 'la_country_EGY', 'EGY', 'EG');
INSERT INTO StdDestinations VALUES (65, 1, NULL, 'la_country_SLV', 'SLV', 'SV');
INSERT INTO StdDestinations VALUES (66, 1, NULL, 'la_country_GNQ', 'GNQ', 'GQ');
INSERT INTO StdDestinations VALUES (67, 1, NULL, 'la_country_ERI', 'ERI', 'ER');
INSERT INTO StdDestinations VALUES (68, 1, NULL, 'la_country_EST', 'EST', 'EE');
INSERT INTO StdDestinations VALUES (69, 1, NULL, 'la_country_ETH', 'ETH', 'ET');
INSERT INTO StdDestinations VALUES (70, 1, NULL, 'la_country_FLK', 'FLK', 'FK');
INSERT INTO StdDestinations VALUES (71, 1, NULL, 'la_country_FRO', 'FRO', 'FO');
INSERT INTO StdDestinations VALUES (72, 1, NULL, 'la_country_FJI', 'FJI', 'FJ');
INSERT INTO StdDestinations VALUES (73, 1, NULL, 'la_country_FIN', 'FIN', 'FI');
INSERT INTO StdDestinations VALUES (74, 1, NULL, 'la_country_FRA', 'FRA', 'FR');
INSERT INTO StdDestinations VALUES (75, 1, NULL, 'la_country_FXX', 'FXX', 'FX');
INSERT INTO StdDestinations VALUES (76, 1, NULL, 'la_country_GUF', 'GUF', 'GF');
INSERT INTO StdDestinations VALUES (77, 1, NULL, 'la_country_PYF', 'PYF', 'PF');
INSERT INTO StdDestinations VALUES (78, 1, NULL, 'la_country_ATF', 'ATF', 'TF');
INSERT INTO StdDestinations VALUES (79, 1, NULL, 'la_country_GAB', 'GAB', 'GA');
INSERT INTO StdDestinations VALUES (80, 1, NULL, 'la_country_GMB', 'GMB', 'GM');
INSERT INTO StdDestinations VALUES (81, 1, NULL, 'la_country_GEO', 'GEO', 'GE');
INSERT INTO StdDestinations VALUES (82, 1, NULL, 'la_country_DEU', 'DEU', 'DE');
INSERT INTO StdDestinations VALUES (83, 1, NULL, 'la_country_GHA', 'GHA', 'GH');
INSERT INTO StdDestinations VALUES (84, 1, NULL, 'la_country_GIB', 'GIB', 'GI');
INSERT INTO StdDestinations VALUES (85, 1, NULL, 'la_country_GRC', 'GRC', 'GR');
INSERT INTO StdDestinations VALUES (86, 1, NULL, 'la_country_GRL', 'GRL', 'GL');
INSERT INTO StdDestinations VALUES (87, 1, NULL, 'la_country_GRD', 'GRD', 'GD');
INSERT INTO StdDestinations VALUES (88, 1, NULL, 'la_country_GLP', 'GLP', 'GP');
INSERT INTO StdDestinations VALUES (89, 1, NULL, 'la_country_GUM', 'GUM', 'GU');
INSERT INTO StdDestinations VALUES (90, 1, NULL, 'la_country_GTM', 'GTM', 'GT');
INSERT INTO StdDestinations VALUES (91, 1, NULL, 'la_country_GIN', 'GIN', 'GN');
INSERT INTO StdDestinations VALUES (92, 1, NULL, 'la_country_GNB', 'GNB', 'GW');
INSERT INTO StdDestinations VALUES (93, 1, NULL, 'la_country_GUY', 'GUY', 'GY');
INSERT INTO StdDestinations VALUES (94, 1, NULL, 'la_country_HTI', 'HTI', 'HT');
INSERT INTO StdDestinations VALUES (95, 1, NULL, 'la_country_HMD', 'HMD', 'HM');
INSERT INTO StdDestinations VALUES (96, 1, NULL, 'la_country_HND', 'HND', 'HN');
INSERT INTO StdDestinations VALUES (97, 1, NULL, 'la_country_HKG', 'HKG', 'HK');
INSERT INTO StdDestinations VALUES (98, 1, NULL, 'la_country_HUN', 'HUN', 'HU');
INSERT INTO StdDestinations VALUES (99, 1, NULL, 'la_country_ISL', 'ISL', 'IS');
INSERT INTO StdDestinations VALUES (100, 1, NULL, 'la_country_IND', 'IND', 'IN');
INSERT INTO StdDestinations VALUES (101, 1, NULL, 'la_country_IDN', 'IDN', 'ID');
INSERT INTO StdDestinations VALUES (102, 1, NULL, 'la_country_IRN', 'IRN', 'IR');
INSERT INTO StdDestinations VALUES (103, 1, NULL, 'la_country_IRQ', 'IRQ', 'IQ');
INSERT INTO StdDestinations VALUES (104, 1, NULL, 'la_country_IRL', 'IRL', 'IE');
INSERT INTO StdDestinations VALUES (105, 1, NULL, 'la_country_ISR', 'ISR', 'IL');
INSERT INTO StdDestinations VALUES (106, 1, NULL, 'la_country_ITA', 'ITA', 'IT');
INSERT INTO StdDestinations VALUES (107, 1, NULL, 'la_country_JAM', 'JAM', 'JM');
INSERT INTO StdDestinations VALUES (108, 1, NULL, 'la_country_JPN', 'JPN', 'JP');
INSERT INTO StdDestinations VALUES (109, 1, NULL, 'la_country_JOR', 'JOR', 'JO');
INSERT INTO StdDestinations VALUES (110, 1, NULL, 'la_country_KAZ', 'KAZ', 'KZ');
INSERT INTO StdDestinations VALUES (111, 1, NULL, 'la_country_KEN', 'KEN', 'KE');
INSERT INTO StdDestinations VALUES (112, 1, NULL, 'la_country_KIR', 'KIR', 'KI');
INSERT INTO StdDestinations VALUES (113, 1, NULL, 'la_country_PRK', 'PRK', 'KP');
INSERT INTO StdDestinations VALUES (114, 1, NULL, 'la_country_KOR', 'KOR', 'KR');
INSERT INTO StdDestinations VALUES (115, 1, NULL, 'la_country_KWT', 'KWT', 'KW');
INSERT INTO StdDestinations VALUES (116, 1, NULL, 'la_country_KGZ', 'KGZ', 'KG');
INSERT INTO StdDestinations VALUES (117, 1, NULL, 'la_country_LAO', 'LAO', 'LA');
INSERT INTO StdDestinations VALUES (118, 1, NULL, 'la_country_LVA', 'LVA', 'LV');
INSERT INTO StdDestinations VALUES (119, 1, NULL, 'la_country_LBN', 'LBN', 'LB');
INSERT INTO StdDestinations VALUES (120, 1, NULL, 'la_country_LSO', 'LSO', 'LS');
INSERT INTO StdDestinations VALUES (121, 1, NULL, 'la_country_LBR', 'LBR', 'LR');
INSERT INTO StdDestinations VALUES (122, 1, NULL, 'la_country_LBY', 'LBY', 'LY');
INSERT INTO StdDestinations VALUES (123, 1, NULL, 'la_country_LIE', 'LIE', 'LI');
INSERT INTO StdDestinations VALUES (124, 1, NULL, 'la_country_LTU', 'LTU', 'LT');
INSERT INTO StdDestinations VALUES (125, 1, NULL, 'la_country_LUX', 'LUX', 'LU');
INSERT INTO StdDestinations VALUES (126, 1, NULL, 'la_country_MAC', 'MAC', 'MO');
INSERT INTO StdDestinations VALUES (127, 1, NULL, 'la_country_MKD', 'MKD', 'MK');
INSERT INTO StdDestinations VALUES (128, 1, NULL, 'la_country_MDG', 'MDG', 'MG');
INSERT INTO StdDestinations VALUES (129, 1, NULL, 'la_country_MWI', 'MWI', 'MW');
INSERT INTO StdDestinations VALUES (130, 1, NULL, 'la_country_MYS', 'MYS', 'MY');
INSERT INTO StdDestinations VALUES (131, 1, NULL, 'la_country_MDV', 'MDV', 'MV');
INSERT INTO StdDestinations VALUES (132, 1, NULL, 'la_country_MLI', 'MLI', 'ML');
INSERT INTO StdDestinations VALUES (133, 1, NULL, 'la_country_MLT', 'MLT', 'MT');
INSERT INTO StdDestinations VALUES (134, 1, NULL, 'la_country_MHL', 'MHL', 'MH');
INSERT INTO StdDestinations VALUES (135, 1, NULL, 'la_country_MTQ', 'MTQ', 'MQ');
INSERT INTO StdDestinations VALUES (136, 1, NULL, 'la_country_MRT', 'MRT', 'MR');
INSERT INTO StdDestinations VALUES (137, 1, NULL, 'la_country_MUS', 'MUS', 'MU');
INSERT INTO StdDestinations VALUES (138, 1, NULL, 'la_country_MYT', 'MYT', 'YT');
INSERT INTO StdDestinations VALUES (139, 1, NULL, 'la_country_MEX', 'MEX', 'MX');
INSERT INTO StdDestinations VALUES (140, 1, NULL, 'la_country_FSM', 'FSM', 'FM');
INSERT INTO StdDestinations VALUES (141, 1, NULL, 'la_country_MDA', 'MDA', 'MD');
INSERT INTO StdDestinations VALUES (142, 1, NULL, 'la_country_MCO', 'MCO', 'MC');
INSERT INTO StdDestinations VALUES (143, 1, NULL, 'la_country_MNG', 'MNG', 'MN');
INSERT INTO StdDestinations VALUES (144, 1, NULL, 'la_country_MSR', 'MSR', 'MS');
INSERT INTO StdDestinations VALUES (145, 1, NULL, 'la_country_MAR', 'MAR', 'MA');
INSERT INTO StdDestinations VALUES (146, 1, NULL, 'la_country_MOZ', 'MOZ', 'MZ');
INSERT INTO StdDestinations VALUES (147, 1, NULL, 'la_country_MMR', 'MMR', 'MM');
INSERT INTO StdDestinations VALUES (148, 1, NULL, 'la_country_NAM', 'NAM', 'NA');
INSERT INTO StdDestinations VALUES (149, 1, NULL, 'la_country_NRU', 'NRU', 'NR');
INSERT INTO StdDestinations VALUES (150, 1, NULL, 'la_country_NPL', 'NPL', 'NP');
INSERT INTO StdDestinations VALUES (151, 1, NULL, 'la_country_NLD', 'NLD', 'NL');
INSERT INTO StdDestinations VALUES (152, 1, NULL, 'la_country_ANT', 'ANT', 'AN');
INSERT INTO StdDestinations VALUES (153, 1, NULL, 'la_country_NCL', 'NCL', 'NC');
INSERT INTO StdDestinations VALUES (154, 1, NULL, 'la_country_NZL', 'NZL', 'NZ');
INSERT INTO StdDestinations VALUES (155, 1, NULL, 'la_country_NIC', 'NIC', 'NI');
INSERT INTO StdDestinations VALUES (156, 1, NULL, 'la_country_NER', 'NER', 'NE');
INSERT INTO StdDestinations VALUES (157, 1, NULL, 'la_country_NGA', 'NGA', 'NG');
INSERT INTO StdDestinations VALUES (158, 1, NULL, 'la_country_NIU', 'NIU', 'NU');
INSERT INTO StdDestinations VALUES (159, 1, NULL, 'la_country_NFK', 'NFK', 'NF');
INSERT INTO StdDestinations VALUES (160, 1, NULL, 'la_country_MNP', 'MNP', 'MP');
INSERT INTO StdDestinations VALUES (161, 1, NULL, 'la_country_NOR', 'NOR', 'NO');
INSERT INTO StdDestinations VALUES (162, 1, NULL, 'la_country_OMN', 'OMN', 'OM');
INSERT INTO StdDestinations VALUES (163, 1, NULL, 'la_country_PAK', 'PAK', 'PK');
INSERT INTO StdDestinations VALUES (164, 1, NULL, 'la_country_PLW', 'PLW', 'PW');
INSERT INTO StdDestinations VALUES (165, 1, NULL, 'la_country_PSE', 'PSE', 'PS');
INSERT INTO StdDestinations VALUES (166, 1, NULL, 'la_country_PAN', 'PAN', 'PA');
INSERT INTO StdDestinations VALUES (167, 1, NULL, 'la_country_PNG', 'PNG', 'PG');
INSERT INTO StdDestinations VALUES (168, 1, NULL, 'la_country_PRY', 'PRY', 'PY');
INSERT INTO StdDestinations VALUES (169, 1, NULL, 'la_country_PER', 'PER', 'PE');
INSERT INTO StdDestinations VALUES (170, 1, NULL, 'la_country_PHL', 'PHL', 'PH');
INSERT INTO StdDestinations VALUES (171, 1, NULL, 'la_country_PCN', 'PCN', 'PN');
INSERT INTO StdDestinations VALUES (172, 1, NULL, 'la_country_POL', 'POL', 'PL');
INSERT INTO StdDestinations VALUES (173, 1, NULL, 'la_country_PRT', 'PRT', 'PT');
INSERT INTO StdDestinations VALUES (174, 1, NULL, 'la_country_PRI', 'PRI', 'PR');
INSERT INTO StdDestinations VALUES (175, 1, NULL, 'la_country_QAT', 'QAT', 'QA');
INSERT INTO StdDestinations VALUES (176, 1, NULL, 'la_country_REU', 'REU', 'RE');
INSERT INTO StdDestinations VALUES (177, 1, NULL, 'la_country_ROU', 'ROU', 'RO');
INSERT INTO StdDestinations VALUES (178, 1, NULL, 'la_country_RUS', 'RUS', 'RU');
INSERT INTO StdDestinations VALUES (179, 1, NULL, 'la_country_RWA', 'RWA', 'RW');
INSERT INTO StdDestinations VALUES (180, 1, NULL, 'la_country_KNA', 'KNA', 'KN');
INSERT INTO StdDestinations VALUES (181, 1, NULL, 'la_country_LCA', 'LCA', 'LC');
INSERT INTO StdDestinations VALUES (182, 1, NULL, 'la_country_VCT', 'VCT', 'VC');
INSERT INTO StdDestinations VALUES (183, 1, NULL, 'la_country_WSM', 'WSM', 'WS');
INSERT INTO StdDestinations VALUES (184, 1, NULL, 'la_country_SMR', 'SMR', 'SM');
INSERT INTO StdDestinations VALUES (185, 1, NULL, 'la_country_STP', 'STP', 'ST');
INSERT INTO StdDestinations VALUES (186, 1, NULL, 'la_country_SAU', 'SAU', 'SA');
INSERT INTO StdDestinations VALUES (187, 1, NULL, 'la_country_SEN', 'SEN', 'SN');
INSERT INTO StdDestinations VALUES (188, 1, NULL, 'la_country_SYC', 'SYC', 'SC');
INSERT INTO StdDestinations VALUES (189, 1, NULL, 'la_country_SLE', 'SLE', 'SL');
INSERT INTO StdDestinations VALUES (190, 1, NULL, 'la_country_SGP', 'SGP', 'SG');
INSERT INTO StdDestinations VALUES (191, 1, NULL, 'la_country_SVK', 'SVK', 'SK');
INSERT INTO StdDestinations VALUES (192, 1, NULL, 'la_country_SVN', 'SVN', 'SI');
INSERT INTO StdDestinations VALUES (193, 1, NULL, 'la_country_SLB', 'SLB', 'SB');
INSERT INTO StdDestinations VALUES (194, 1, NULL, 'la_country_SOM', 'SOM', 'SO');
INSERT INTO StdDestinations VALUES (195, 1, NULL, 'la_country_ZAF', 'ZAF', 'ZA');
INSERT INTO StdDestinations VALUES (196, 1, NULL, 'la_country_SGS', 'SGS', 'GS');
INSERT INTO StdDestinations VALUES (197, 1, NULL, 'la_country_ESP', 'ESP', 'ES');
INSERT INTO StdDestinations VALUES (198, 1, NULL, 'la_country_LKA', 'LKA', 'LK');
INSERT INTO StdDestinations VALUES (199, 1, NULL, 'la_country_SHN', 'SHN', 'SH');
INSERT INTO StdDestinations VALUES (200, 1, NULL, 'la_country_SPM', 'SPM', 'PM');
INSERT INTO StdDestinations VALUES (201, 1, NULL, 'la_country_SDN', 'SDN', 'SD');
INSERT INTO StdDestinations VALUES (202, 1, NULL, 'la_country_SUR', 'SUR', 'SR');
INSERT INTO StdDestinations VALUES (203, 1, NULL, 'la_country_SJM', 'SJM', 'SJ');
INSERT INTO StdDestinations VALUES (204, 1, NULL, 'la_country_SWZ', 'SWZ', 'SZ');
INSERT INTO StdDestinations VALUES (205, 1, NULL, 'la_country_SWE', 'SWE', 'SE');
INSERT INTO StdDestinations VALUES (206, 1, NULL, 'la_country_CHE', 'CHE', 'CH');
INSERT INTO StdDestinations VALUES (207, 1, NULL, 'la_country_SYR', 'SYR', 'SY');
INSERT INTO StdDestinations VALUES (208, 1, NULL, 'la_country_TWN', 'TWN', 'TW');
INSERT INTO StdDestinations VALUES (209, 1, NULL, 'la_country_TJK', 'TJK', 'TJ');
INSERT INTO StdDestinations VALUES (210, 1, NULL, 'la_country_TZA', 'TZA', 'TZ');
INSERT INTO StdDestinations VALUES (211, 1, NULL, 'la_country_THA', 'THA', 'TH');
INSERT INTO StdDestinations VALUES (212, 1, NULL, 'la_country_TGO', 'TGO', 'TG');
INSERT INTO StdDestinations VALUES (213, 1, NULL, 'la_country_TKL', 'TKL', 'TK');
INSERT INTO StdDestinations VALUES (214, 1, NULL, 'la_country_TON', 'TON', 'TO');
INSERT INTO StdDestinations VALUES (215, 1, NULL, 'la_country_TTO', 'TTO', 'TT');
INSERT INTO StdDestinations VALUES (216, 1, NULL, 'la_country_TUN', 'TUN', 'TN');
INSERT INTO StdDestinations VALUES (217, 1, NULL, 'la_country_TUR', 'TUR', 'TR');
INSERT INTO StdDestinations VALUES (218, 1, NULL, 'la_country_TKM', 'TKM', 'TM');
INSERT INTO StdDestinations VALUES (219, 1, NULL, 'la_country_TCA', 'TCA', 'TC');
INSERT INTO StdDestinations VALUES (220, 1, NULL, 'la_country_TUV', 'TUV', 'TV');
INSERT INTO StdDestinations VALUES (221, 1, NULL, 'la_country_UGA', 'UGA', 'UG');
INSERT INTO StdDestinations VALUES (222, 1, NULL, 'la_country_UKR', 'UKR', 'UA');
INSERT INTO StdDestinations VALUES (223, 1, NULL, 'la_country_ARE', 'ARE', 'AE');
INSERT INTO StdDestinations VALUES (224, 1, NULL, 'la_country_GBR', 'GBR', 'GB');
INSERT INTO StdDestinations VALUES (225, 1, NULL, 'la_country_USA', 'USA', 'US');
INSERT INTO StdDestinations VALUES (226, 1, NULL, 'la_country_UMI', 'UMI', 'UM');
INSERT INTO StdDestinations VALUES (227, 1, NULL, 'la_country_URY', 'URY', 'UY');
INSERT INTO StdDestinations VALUES (228, 1, NULL, 'la_country_UZB', 'UZB', 'UZ');
INSERT INTO StdDestinations VALUES (229, 1, NULL, 'la_country_VUT', 'VUT', 'VU');
INSERT INTO StdDestinations VALUES (230, 1, NULL, 'la_country_VAT', 'VAT', 'VA');
INSERT INTO StdDestinations VALUES (231, 1, NULL, 'la_country_VEN', 'VEN', 'VE');
INSERT INTO StdDestinations VALUES (232, 1, NULL, 'la_country_VNM', 'VNM', 'VN');
INSERT INTO StdDestinations VALUES (233, 1, NULL, 'la_country_VGB', 'VGB', 'VG');
INSERT INTO StdDestinations VALUES (234, 1, NULL, 'la_country_VIR', 'VIR', 'VI');
INSERT INTO StdDestinations VALUES (235, 1, NULL, 'la_country_WLF', 'WLF', 'WF');
INSERT INTO StdDestinations VALUES (236, 1, NULL, 'la_country_ESH', 'ESH', 'EH');
INSERT INTO StdDestinations VALUES (237, 1, NULL, 'la_country_YEM', 'YEM', 'YE');
INSERT INTO StdDestinations VALUES (238, 1, NULL, 'la_country_YUG', 'YUG', 'YU');
INSERT INTO StdDestinations VALUES (239, 1, NULL, 'la_country_ZMB', 'ZMB', 'ZM');
INSERT INTO StdDestinations VALUES (240, 1, NULL, 'la_country_ZWE', 'ZWE', 'ZW');
INSERT INTO StdDestinations VALUES (370, 2, 38, 'la_state_YT', 'YT', NULL);
INSERT INTO StdDestinations VALUES (369, 2, 38, 'la_state_SK', 'SK', NULL);
INSERT INTO StdDestinations VALUES (368, 2, 38, 'la_state_QC', 'QC', NULL);
INSERT INTO StdDestinations VALUES (367, 2, 38, 'la_state_PE', 'PE', NULL);
INSERT INTO StdDestinations VALUES (366, 2, 38, 'la_state_ON', 'ON', NULL);
INSERT INTO StdDestinations VALUES (365, 2, 38, 'la_state_NU', 'NU', NULL);
INSERT INTO StdDestinations VALUES (364, 2, 38, 'la_state_NS', 'NS', NULL);
INSERT INTO StdDestinations VALUES (363, 2, 38, 'la_state_NT', 'NT', NULL);
INSERT INTO StdDestinations VALUES (362, 2, 38, 'la_state_NL', 'NL', NULL);
INSERT INTO StdDestinations VALUES (361, 2, 38, 'la_state_NB', 'NB', NULL);
INSERT INTO StdDestinations VALUES (360, 2, 38, 'la_state_MB', 'MB', NULL);
INSERT INTO StdDestinations VALUES (359, 2, 38, 'la_state_BC', 'BC', NULL);
INSERT INTO StdDestinations VALUES (358, 2, 38, 'la_state_AB', 'AB', NULL);
INSERT INTO StdDestinations VALUES (357, 2, 225, 'la_state_DC', 'DC', NULL);
INSERT INTO StdDestinations VALUES (356, 2, 225, 'la_state_WY', 'WY', NULL);
INSERT INTO StdDestinations VALUES (355, 2, 225, 'la_state_WI', 'WI', NULL);
INSERT INTO StdDestinations VALUES (354, 2, 225, 'la_state_WV', 'WV', NULL);
INSERT INTO StdDestinations VALUES (353, 2, 225, 'la_state_WA', 'WA', NULL);
INSERT INTO StdDestinations VALUES (352, 2, 225, 'la_state_VA', 'VA', NULL);
INSERT INTO StdDestinations VALUES (351, 2, 225, 'la_state_VT', 'VT', NULL);
INSERT INTO StdDestinations VALUES (350, 2, 225, 'la_state_UT', 'UT', NULL);
INSERT INTO StdDestinations VALUES (349, 2, 225, 'la_state_TX', 'TX', NULL);
INSERT INTO StdDestinations VALUES (348, 2, 225, 'la_state_TN', 'TN', NULL);
INSERT INTO StdDestinations VALUES (347, 2, 225, 'la_state_SD', 'SD', NULL);
INSERT INTO StdDestinations VALUES (346, 2, 225, 'la_state_SC', 'SC', NULL);
INSERT INTO StdDestinations VALUES (345, 2, 225, 'la_state_RI', 'RI', NULL);
INSERT INTO StdDestinations VALUES (344, 2, 225, 'la_state_PR', 'PR', NULL);
INSERT INTO StdDestinations VALUES (343, 2, 225, 'la_state_PA', 'PA', NULL);
INSERT INTO StdDestinations VALUES (342, 2, 225, 'la_state_OR', 'OR', NULL);
INSERT INTO StdDestinations VALUES (341, 2, 225, 'la_state_OK', 'OK', NULL);
INSERT INTO StdDestinations VALUES (340, 2, 225, 'la_state_OH', 'OH', NULL);
INSERT INTO StdDestinations VALUES (339, 2, 225, 'la_state_ND', 'ND', NULL);
INSERT INTO StdDestinations VALUES (338, 2, 225, 'la_state_NC', 'NC', NULL);
INSERT INTO StdDestinations VALUES (337, 2, 225, 'la_state_NY', 'NY', NULL);
INSERT INTO StdDestinations VALUES (336, 2, 225, 'la_state_NM', 'NM', NULL);
INSERT INTO StdDestinations VALUES (335, 2, 225, 'la_state_NJ', 'NJ', NULL);
INSERT INTO StdDestinations VALUES (334, 2, 225, 'la_state_NH', 'NH', NULL);
INSERT INTO StdDestinations VALUES (333, 2, 225, 'la_state_NV', 'NV', NULL);
INSERT INTO StdDestinations VALUES (332, 2, 225, 'la_state_NE', 'NE', NULL);
INSERT INTO StdDestinations VALUES (331, 2, 225, 'la_state_MT', 'MT', NULL);
INSERT INTO StdDestinations VALUES (330, 2, 225, 'la_state_MO', 'MO', NULL);
INSERT INTO StdDestinations VALUES (329, 2, 225, 'la_state_MS', 'MS', NULL);
INSERT INTO StdDestinations VALUES (328, 2, 225, 'la_state_MN', 'MN', NULL);
INSERT INTO StdDestinations VALUES (327, 2, 225, 'la_state_MI', 'MI', NULL);
INSERT INTO StdDestinations VALUES (326, 2, 225, 'la_state_MA', 'MA', NULL);
INSERT INTO StdDestinations VALUES (325, 2, 225, 'la_state_MD', 'MD', NULL);
INSERT INTO StdDestinations VALUES (324, 2, 225, 'la_state_ME', 'ME', NULL);
INSERT INTO StdDestinations VALUES (323, 2, 225, 'la_state_LA', 'LA', NULL);
INSERT INTO StdDestinations VALUES (322, 2, 225, 'la_state_KY', 'KY', NULL);
INSERT INTO StdDestinations VALUES (321, 2, 225, 'la_state_KS', 'KS', NULL);
INSERT INTO StdDestinations VALUES (320, 2, 225, 'la_state_IA', 'IA', NULL);
INSERT INTO StdDestinations VALUES (319, 2, 225, 'la_state_IN', 'IN', NULL);
INSERT INTO StdDestinations VALUES (318, 2, 225, 'la_state_IL', 'IL', NULL);
INSERT INTO StdDestinations VALUES (317, 2, 225, 'la_state_ID', 'ID', NULL);
INSERT INTO StdDestinations VALUES (316, 2, 225, 'la_state_HI', 'HI', NULL);
INSERT INTO StdDestinations VALUES (315, 2, 225, 'la_state_GA', 'GA', NULL);
INSERT INTO StdDestinations VALUES (314, 2, 225, 'la_state_FL', 'FL', NULL);
INSERT INTO StdDestinations VALUES (313, 2, 225, 'la_state_DE', 'DE', NULL);
INSERT INTO StdDestinations VALUES (312, 2, 225, 'la_state_CT', 'CT', NULL);
INSERT INTO StdDestinations VALUES (311, 2, 225, 'la_state_CO', 'CO', NULL);
INSERT INTO StdDestinations VALUES (310, 2, 225, 'la_state_CA', 'CA', NULL);
INSERT INTO StdDestinations VALUES (309, 2, 225, 'la_state_AR', 'AR', NULL);
INSERT INTO StdDestinations VALUES (308, 2, 225, 'la_state_AZ', 'AZ', NULL);
INSERT INTO StdDestinations VALUES (307, 2, 225, 'la_state_AK', 'AK', NULL);
INSERT INTO StdDestinations VALUES (306, 2, 225, 'la_state_AL', 'AL', NULL);
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('CATEGORY.VIEW', 'lu_PermName_Category.View_desc', 'lu_PermName_Category.View_error', 'In-Portal');
INSERT INTO PermCache (CategoryId, PermId, ACL) VALUES (0, 1, '11,12,13,14,15');
INSERT INTO Permissions VALUES (0, 'LOGIN', 13, 1, 1, 0);
INSERT INTO Permissions VALUES (0, 'LOGIN', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (0, 'ADMIN', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (0, 'in-portal:root.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (0, 'in-portal:system.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (0, 'in-portal:user_list.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (0, 'in-portal:user_list.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (0, 'in-portal:user_list.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (0, 'in-portal:user_list.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (0, 'in-portal:configure_lang.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (0, 'in-portal:configure_lang.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (0, 'in-portal:configure_lang.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (0, 'in-portal:configure_lang.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (0, 'CATEGORY.VIEW', 11, 1, 0, 0);
INSERT INTO Permissions VALUES (0, 'CATEGORY.ADD', 11, 1, 0, 0);
INSERT INTO Permissions VALUES (0, 'CATEGORY.DELETE', 11, 1, 0, 0);
INSERT INTO Permissions VALUES (0, 'CATEGORY.MODIFY', 11, 1, 0, 0);
INSERT INTO Permissions VALUES (0, 'in-portal:service.view', 11, 1, 1, 0);
+
+INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('Core', 'core/', 'adm', '0.0.0', 1, 1, '', 0, '0');
Property changes on: trunk/core/install/install_data.sql
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property

Event Timeline