Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Tue, Feb 25, 1:37 PM

in-portal

This file is larger than 256 KB, so syntax highlighting was skipped.
Index: branches/RC/core/kernel/event_handler.php
===================================================================
--- branches/RC/core/kernel/event_handler.php (revision 11545)
+++ branches/RC/core/kernel/event_handler.php (revision 11546)
@@ -1,347 +1,348 @@
<?php
/**
* 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')
*
*/
/**
* Default event handler. Mostly abstract class
*
*/
class kEventHandler extends kBase {
/**
* In case if event should be handled with mehod,
* which name differs from event name, then it
* should be specified here.
* key - event name, value - event method
*
* @var Array
* @access protected
*/
var $eventMethods = Array();
/**
* Defines mapping vs event names and permission names
*
* @var Array
*/
var $permMapping = Array();
/**
* Define alternative event processing method names
*
* @see $eventMethods
* @access protected
*/
function mapEvents()
{
}
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
}
function getPrefixSpecial()
{
trigger_error('Usage of getPrefixSpecial() this method is forbidden in kEventHandler class children. Use $event->getPrefixSpecial(true); instead', E_USER_ERROR);
}
/**
* Set's prefix and special
*
* @param string $prefix
* @param string $special
* @access public
*/
function Init($prefix,$special)
{
parent::Init($prefix,$special);
$this->mapEvents();
$this->mapPermissions();
}
/**
* Process Event
*
* @param kEvent $event
* @access public
*/
function processEvent(&$event)
{
$event_name=$event->Name;
if( isset($this->eventMethods[$event_name]) ) $event_name=$this->eventMethods[$event_name];
if( method_exists($this,$event_name) )
{
$this->$event_name($event);
}
else
{
trigger_error('event <b>'.$event->Name.'</b> not implemented in class <b>'.get_class($this).'</b>', E_USER_ERROR);
}
}
/**
* Sample dummy event
*
* @param kEvent $event
* @access protected
*/
function OnBuild(&$event)
{
/*echo 'building: <br>';
print_pre($event);*/
}
/**
* Returns to previous template in opener stack
*
* @param kEvent $event
*/
function OnGoBack(&$event)
{
$url = $this->Application->RecallVar('export_finish_url');
if ($url) {
$this->Application->Redirect('external:'.$url);
}
+
$event->SetRedirectParam('opener', 'u');
}
/**
* 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)
{
// processing here
}
/**
* Creates new event as child of
* event passed as $event param
*
* @param kEvent $event
* @access protected
*/
function &inheritEvent(&$event, $name=null)
{
$child_event = new kEvent();
$child_event->MasterEvent =& $event;
$child_event->Prefix=$event->Prefix;
$child_event->Special=$event->Special;
$child_event->Prefix_Special=$event->Prefix_Special;
$child_event->Name = $name;
return $child_event;
}
/**
* Created url part for this module
*
* @param kEvent $event
*/
function BuildEnv(&$event)
{
$prefix_special = $event->getPrefixSpecial();
$url_params = $event->getEventParam('url_params');
$pass_events = $event->getEventParam('pass_events');
$query_vars = $this->Application->getUnitOption($event->Prefix, 'QueryString');
$event_key = array_search('event', $query_vars);
if ($event_key) {
// pass through event of this prefix
unset($query_vars[$event_key]);
}
if (!getArrayValue($url_params, $prefix_special.'_event')) {
// if empty event, then remove it from url
unset( $url_params[$prefix_special.'_event'] );
}
//if pass events is off and event is not implicity passed
if ( !$pass_events && !isset($url_params[$prefix_special.'_event']) )
{
unset($url_params[$prefix_special.'_event']); // remove event from url if requested
//otherwise it will use value from get_var
}
if(!$query_vars) return true;
$processed_params = Array();
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;
$processed_params[$var_name] = isset( $url_params[$var_name] ) ? $url_params[$var_name] : $this->Application->GetVar($var_name);
if ( isset($url_params[$var_name]) ) unset( $url_params[$var_name] );
}
$ret = '';
/*if($processed_params[$prefix_special.'_Page'] > 1 && !$processed_params[$prefix_special.'_id'])
{
$ret .= $processed_params[$prefix_special.'_Page'].'/';
}*/
if (!$processed_params[$prefix_special.'_id']) {
if ($processed_params[$prefix_special.'_Page'] == 1) {
// when printing "items" from category, there is 1st page -> nothing from "item prefix" in url
// and auto-guess pass_category will not be added to url
$url_params['pass_category'] = 1;
}
else {
$ret .= $processed_params[$prefix_special.'_Page'].'/';
}
}
if ($processed_params[$prefix_special.'_id']) {
// this allows to fill 3 cache records with one query (see this method for details)
$category_id = isset($url_params['m_cat_id']) ? $url_params['m_cat_id'] : $this->Application->GetVar('m_cat_id');
$category_filename = $this->Application->getFilename('c', $category_id);
// if template is also item template of category, then remove template
$template = getArrayValue($url_params, 't');
$item_template = $this->Application->getCache('item_templates', $category_id);
if ($template == $item_template || strtolower($template) == '__default__') {
unset($url_params['t']);
}
// get item's filename
$filename = $this->Application->getFilename($event->Prefix, $processed_params[$prefix_special.'_id'], $category_id );
if($filename !== false) $ret .= $filename.'/';
}
if( getArrayValue($processed_params, $prefix_special.'_Reviews_Page') > 1)
{
if($processed_params[$prefix_special.'_id']) $ret = rtrim($ret, '/');
$ret .= '_'.$processed_params[$prefix_special.'_Reviews_Page'].'/';
}
$event->setEventParam('url_params', $url_params);
$event->setEventParam('env_string', mb_strtolower($ret) );
}
/**
* Process mod_rewrite url part left after previous parser
*
* @param kEvent $event
*/
function ParseEnv(&$event)
{
// <module_page>/<item_filename>_<reviews_page>
$url_parts = $event->getEventParam('url_parts');
$defaults = Array('id' => 0, 'Page' => 1, 'Reviews_Page' => 1);
foreach ($defaults as $var_name => $var_value)
{
$this->Application->SetVar($event->getPrefixSpecial().'_'.$var_name, $var_value);
}
if (!$url_parts) {
// $event->status = erFAIL;
return false;
}
$ret = '';
$url_part = array_shift($url_parts);
// match module page
if( is_numeric($url_part) )
{
$this->Application->SetVar( $event->getPrefixSpecial().'_Page', $url_part);
$url_part = $url_parts ? array_shift($url_parts) : '';
}
if (!$url_part) {
$event->setEventParam('url_parts', $url_parts);
// $event->status = erFAIL;
return true;
}
// match module reviews page
if( preg_match('/(.*)_([\d]+)$/', $url_part, $rets) )
{
$url_part = $rets[1];
$this->Application->SetVar( $event->getPrefixSpecial().'_Reviews_Page', $rets[2]);
}
// match item's filename
$db =& $this->Application->GetADODBConnection();
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'SELECT item_table.'.$id_field.'
FROM '.$table.' item_table
LEFT JOIN '.TABLE_PREFIX.'CategoryItems cat_items ON item_table.ResourceId = cat_items.ItemResourceId
WHERE (item_table.Filename = '.$db->qstr($url_part).') AND (cat_items.CategoryId = '.$this->Application->GetVar('m_cat_id').')';
$item_id = $db->GetOne($sql);
if($item_id !== false)
{
$this->Application->SetVar($event->getPrefixSpecial().'_id', $item_id);
}
elseif ($url_part !== 'index') // otherwise category/index.html is parsed as /index.tpl
{
array_unshift($url_parts, $url_part);
$event->status = erFAIL;
}
$event->setEventParam('url_parts', $url_parts);
}
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
return $perm_helper->CheckEventPermission($event, $this->permMapping);
}
/**
* Occurs, when config was parsed, allows to change config data dynamically
*
* @param kEvent $event
*/
function OnAfterConfigRead(&$event)
{
// readonly, for hooking only!
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/kernel/event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.35.2.1
\ No newline at end of property
+1.35.2.2
\ No newline at end of property
Index: branches/RC/core/kernel/db/db_event_handler.php
===================================================================
--- branches/RC/core/kernel/db/db_event_handler.php (revision 11545)
+++ branches/RC/core/kernel/db/db_event_handler.php (revision 11546)
@@ -1,2471 +1,2451 @@
<?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');
}
if ($event->Name == 'OnSaveWidths') {
return $this->Application->IsAdmin() && $this->Application->LoggedIn();
}
return parent::CheckPermission($event);
}
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnLoad' => Array('self' => 'view', 'subitem' => 'view'),
'OnItemBuild' => Array('self' => 'view', 'subitem' => 'view'),
'OnBuild' => Array('self' => true),
'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'),
'OnDeleteAll' => 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'),
'OnExportProgress' => Array('self' => 'view|advanced:export'),
'OnSetAutoRefreshInterval' => Array ('self' => true, 'subitem' => true),
'OnAutoRefreshToggle' => Array ('self' => true, 'subitem' => true),
// 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),
'OnResetSorting' => 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),
// it checks permission itself since flash uploader does not send cookies
'OnUploadFile' => Array ('self' => true, 'subitem' => true),
'OnDeleteFile' => Array ('self' => true, 'subitem' => true),
'OnViewFile' => Array ('self' => true, 'subitem' => true),
'OnSaveWidths' => Array ('self' => true, 'subitem' => true),
'OnValidateMInputFields' => Array ('self' => 'view'),
);
$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);
}
if (preg_match('/^auto-(.*)/', $event->Special, $regs) && $this->Application->prefixRegistred($regs[1])) {
// <inp2:lang.auto-phrase_Field name="DateFormat"/> - returns field DateFormat value from language (LanguageId is extracted from current phrase object)
$main_object =& $this->Application->recallObject($regs[1]);
/* @var $main_object kDBItem */
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
return $main_object->GetDBField($id_field);
}
// 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( $event->getEventParam('populate_ml_fields') || $this->Application->getUnitOption($event->Prefix, 'PopulateMlFields') );
$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);
}
/**
* Checks, that currently loaded item is allowed for viewing (non permission-based)
*
* @param kEvent $event
* @return bool
*/
function checkItemStatus(&$event)
{
$status_fields = $this->Application->getUnitOption($event->Prefix,'StatusField');
if (!$status_fields) {
return true;
}
$status_field = array_shift($status_fields);
if ($status_field == 'Status' || $status_field == 'Enabled') {
$object =& $event->getObject();
if (!$object->isLoaded()) {
return true;
}
return $object->GetDBField($status_field) == STATUS_ACTIVE;
}
return true;
}
/**
* Shows not found template content
*
* @param kEvent $event
*
*/
function _errorNotFound(&$event)
{
if ($event->getEventParam('raise_warnings') === 0) {
// when it's possible, that autoload fails do nothing
return ;
}
if ($this->Application->isDebugMode()) {
$this->Application->Debugger->appendTrace();
}
trigger_error('ItemLoad Permission Failed for prefix [' . $event->getPrefixSpecial() . '] in <strong>checkItemStatus</strong>, leading to "404 Not Found"', E_USER_WARNING);
header('HTTP/1.0 404 Not Found');
while (ob_get_level()) {
ob_end_clean();
}
// object is used inside template parsing, so break out any parsing and return error document
$error_template = $this->Application->ConfigValue('ErrorTemplate');
$this->Application->HTML = $this->Application->ParseBlock( Array ('name' => $error_template) );
$this->Application->Done();
exit;
}
/**
* 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) {
$perm_status = true;
$user_id = $this->Application->RecallVar('user_id');
$event->setEventParam('top_prefix', $this->Application->GetTopmostPrefix($event->Prefix, true));
$status_checked = false;
if ($user_id == -1 || $this->CheckPermission($event)) {
// don't autoload item, when user doesn't have view permission
$this->LoadItem($event);
$status_checked = true;
if ($user_id != -1 && !$this->Application->IsAdmin() && !$this->checkItemStatus($event)) {
$perm_status = false;
}
}
else {
$perm_status = false;
}
if (!$perm_status) {
// when no permission to view item -> redirect to no pemrission template
if ($this->Application->isDebugMode()) {
$this->Application->Debugger->appendTrace();
}
trigger_error('ItemLoad Permission Failed for prefix ['.$event->getPrefixSpecial().'] in <strong>'.($status_checked ? 'checkItemStatus' : 'CheckPermission').'</strong>', E_USER_WARNING);
$next_template = $this->Application->IsAdmin() ? 'no_permission' : $this->Application->ConfigValue('NoPermissionTemplate');
$this->Application->Redirect($next_template, Array('next_template' => $this->Application->GetVar('t')));
}
}
$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...
+ * Checks, that object used in event should use temp tables
*
* @param kEvent $event
- * @return unknown
+ * @return bool
*/
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;
+ return $this->Application->IsTempMode($event->Prefix, $event->Special);
}
/**
* 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->isLoaded() && ($object->GetID() == $id)) {
// object is already loaded by same id
return ;
}
if ($object->Load($id)) {
$actions =& $this->Application->recallObject('kActions');
$actions->Set($event->Prefix_Special.'_id', $object->GetID() );
}
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->Counted = false; // when requery="1" should re-count records too!
$object->ClearOrderFields(); // prevents duplicate order fields, when using requery="1"
$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');
$storage_prefix = $event->getEventParam('same_special') ? $event->Prefix : $event->getPrefixSpecial();
$per_page = $this->Application->RecallPersistentVar($storage_prefix.'_PerPage.'.$view_name, '_USE_DEFAULT_USER_DATA_');
if (!$per_page) {
// per-page is stored to current session
$per_page = $this->Application->RecallVar($storage_prefix.'_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
$default_per_page = $event->getEventParam('default_per_page');
$per_page = is_numeric($default_per_page) ? $default_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();
$storage_prefix = $event->getEventParam('same_special') ? $event->Prefix : $event->Prefix_Special;
$cur_sort1 = $this->Application->RecallVar($storage_prefix.'_Sort1');
$cur_sort1_dir = $this->Application->RecallVar($storage_prefix.'_Sort1_Dir');
$cur_sort2 = $this->Application->RecallVar($storage_prefix.'_Sort2');
$cur_sort2_dir = $this->Application->RecallVar($storage_prefix.'_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') {
$object->AddOrderField('RAND()', '');
}
else {
$tag_sort_by = explode('|', $tag_sort_by);
foreach ($tag_sort_by as $sorting_element) {
list ($by, $dir) = explode(',', $sorting_element);
$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');
$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 {
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);
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 (used for category item sorting (front-end), grid sorting (admin, view menu)
*
* @param kEvent $event
*/
function OnSetSortingDirect(&$event)
{
$combined = $this->Application->GetVar($event->Prefix.'_CombinedSorting');
if ($combined) {
list($field, $dir) = explode('|', $combined);
$this->Application->StoreVar($event->Prefix.'_Sort1', $field);
$this->Application->StoreVar($event->Prefix.'_Sort1_Dir', $dir);
return ;
}
$field_pos = $this->Application->GetVar($event->Prefix.'_SortPos');
$this->Application->LinkVar($event->Prefix.'_Sort'.$field_pos, $event->Prefix.'_Sort'.$field_pos);
$this->Application->LinkVar($event->Prefix.'_Sort'.$field_pos.'_Dir', $event->Prefix.'_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');
}
/**
* Sets grid refresh interval
*
* @param kEvent $event
*/
function OnSetAutoRefreshInterval(&$event)
{
$refresh_interval = $this->Application->GetVar('refresh_interval');
$view_name = $this->Application->RecallVar($event->getPrefixSpecial().'_current_view');
$this->Application->StorePersistentVar($event->getPrefixSpecial().'_refresh_interval.'.$view_name, $refresh_interval);
}
/**
* Changes auto-refresh state for grid
*
* @param kEvent $event
*/
function OnAutoRefreshToggle(&$event)
{
$refresh_intervals = $this->Application->ConfigValue('AutoRefreshIntervals');
if (!$refresh_intervals) {
return ;
}
$view_name = $this->Application->RecallVar($event->getPrefixSpecial().'_current_view');
$auto_refresh = $this->Application->RecallPersistentVar($event->getPrefixSpecial().'_auto_refresh.'.$view_name);
if ($auto_refresh === false) {
$refresh_intervals = explode(',', $refresh_intervals);
$this->Application->StorePersistentVar($event->getPrefixSpecial().'_refresh_interval.'.$view_name, $refresh_intervals[0]);
}
$this->Application->StorePersistentVar($event->getPrefixSpecial().'_auto_refresh.'.$view_name, $auto_refresh ? 0 : 1);
}
/**
* 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', Array ());
$special = array_key_exists($event->Special, $sqls) ? $event->Special : '';
if (!array_key_exists($special, $sqls)) {
// preferred special not found in ItemSQLs -> use analog from ListSQLs
return $this->ListPrepareQuery($event);
}
return $sqls[$special];
}
/**
* 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', Array ());
return $sqls[ array_key_exists($event->Special, $sqls) ? $event->Special : '' ];
}
/**
* 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) );
/* @var $object kDBItem */
$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)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
/* @var $temp kTempTablesHandler */
$temp->DeleteItems($event->Prefix, $event->Special, Array($this->getPassedID($event)));
}
/**
* Deletes all records from table
*
* @param kEvent $event
*/
function OnDeleteAll(&$event)
{
$sql = 'SELECT ' . $this->Application->getUnitOption($event->Prefix, 'IDField') . '
FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName');
$ids = $this->Conn->GetCol($sql);
if ($ids) {
$temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler');
/* @var $temp_handler kTempTablesHandler */
$temp_handler->DeleteItems($event->Prefix, $event->Special, $ids);
}
}
/**
* Prepares new kDBItem object
*
* @param kEvent $event
* @access protected
*/
function OnNew(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
/* @var $object kDBItem */
$object->Clear(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);
$var_name = $event->getPrefixSpecial().'_file_pending_actions'.$this->Application->GetVar('m_wid');
$this->Application->RemoveVar($var_name);
$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');
$changes_var_name = $this->Prefix.'_changes_'.$this->Application->GetTopmostWid($this->Prefix);
if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
$live_ids = $temp->SaveEdit($event->getEventParam('master_ids') ? $event->getEventParam('master_ids') : Array());
// Deleteing files scheduled for delete
$var_name = $event->getPrefixSpecial().'_file_pending_actions'.$this->Application->GetVar('m_wid');
$schedule = $this->Application->RecallVar($var_name);
$schedule = $schedule ? unserialize($schedule) : array();
foreach ($schedule as $data) {
if ($data['action'] == 'delete') {
unlink($data['file']);
}
}
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->SaveLoggedChanges($changes_var_name);
}
else {
$this->Application->RemoveVar($changes_var_name);
}
$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', '');
}
}
function SaveLoggedChanges($changes_var_name)
{
$ses_log_id = $this->Application->RecallVar('_SessionLogId_');
if (!$ses_log_id) {
return ;
}
$changes = $this->Application->RecallVar($changes_var_name);
$changes = $changes ? unserialize($changes) : Array ();
if (!$changes) {
return ;
}
$add_fields = Array (
'PortalUserId' => $this->Application->RecallVar('user_id'),
'SessionLogId' => $ses_log_id,
);
$changelog_table = $this->Application->getUnitOption('change-log', 'TableName');
$sessionlog_table = $this->Application->getUnitOption('session-log', 'TableName');
foreach ($changes as $rec) {
$this->Conn->doInsert(array_merge($rec, $add_fields), $changelog_table);
}
$sql = 'UPDATE '.$sessionlog_table.'
SET AffectedItems = AffectedItems + '.count($changes).'
WHERE SessionLogId = '.$ses_log_id;
$this->Conn->Query($sql);
$this->Application->RemoveVar($changes_var_name);
}
/**
* 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)
{
$object =& $event->getObject( Array ('raise_warnings' => 0) );
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;
}
}
}
}
/**
* [HOOK] Saves subitem
*
* @param kEvent $event
*/
function OnPreSaveSubItem(&$event)
{
$not_created = $this->isNewItemCreate($event);
$event->CallSubEvent($not_created ? 'OnCreate' : 'OnUpdate');
if ($event->status == erSUCCESS) {
$object =& $event->getObject();
/* @var $object kDBItem */
$this->Application->SetVar($event->getPrefixSpecial() . '_id', $object->GetID());
}
$event->SetRedirectParam('opener', 's');
}
/**
* 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->SetRedirectParam($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') );
$order_field = $this->Application->getUnitOption($event->Prefix,'OrderField');
if (!$order_field) {
$order_field = 'Priority';
}
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($order_field, $object->GetDBField($order_field) + 1);
break;
case 'OnMassMoveDown':
$object->SetDBField($order_field, $object->GetDBField($order_field) - 1);
break;
}
if ($object->Update()) {
$event->status = erSUCCESS;
}
else {
$event->status = erFAIL;
$event->redirect = false;
break;
}
}
}
$this->clearSelectedIDs($event);
}
/**
* 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)
{
}
/**
* Occures after list is queried
*
* @param kEvent $event
*/
function OnAfterListQuery(&$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');
/* @var $search_helper kSearchHelper */
$search_helper->performSearch($event);
}
/**
* Clear search keywords
*
* @param kEvent $event
* @access protected
*/
function OnSearchReset(&$event)
{
$search_helper =& $this->Application->recallObject('SearchHelper');
/* @var $search_helper kSearchHelper */
$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']);
}
}
}
/**
* 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);
$event->redirect = true;
}
$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);
+ $selected_ids = $this->StoreSelectedIDs($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'));
+ /*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);
+ $this->Application->StoreVar('export_finish_url', $finish_url);*/
- $redirect_params = Array(
- $this->Prefix.'.export_event' => 'OnNew',
- 'pass' => 'all,'.$this->Prefix.'.export');
+ $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'];
$export_settings = $this->Application->RecallPersistentVar('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]);
$this->Application->StorePersistentVar('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'));
$pass_vars = Array ('st_id', 'cms_id');
foreach ($pass_vars as $pass_var) {
$data = $this->Application->GetVar($pass_var);
if ($data) {
$event->SetRedirectParam($pass_var, $data);
}
}
}
}
/**
* Used to save files uploaded via swfuploader
*
* @param kEvent $event
*/
function OnUploadFile(&$event)
{
$event->status = erSTOP;
define('DBG_SKIP_REPORTING', 1);
echo "Flash requires that we output something or it won't fire the uploadSuccess event";
if (!$this->Application->HttpQuery->Post) {
// Variables {field, id, flashsid} are always submitted through POST!
// When file size is larger, then "upload_max_filesize" (in php.ini),
// then theese variables also are not submitted -> handle such case.
header('HTTP/1.0 413 File size exceeds allowed limit');
return ;
}
if (!$this->_checkFlashUploaderPermission($event)) {
// 403 Forbidden
header('HTTP/1.0 403 You don\'t have permissions to upload');
return ;
}
$value = $this->Application->GetVar('Filedata');
if (!$value || ($value['error'] != UPLOAD_ERR_OK)) {
// 413 Request Entity Too Large (file uploads disabled OR uploaded file was
// to large for web server to accept, see "upload_max_filesize" in php.ini)
header('HTTP/1.0 413 File size exceeds allowed limit');
return ;
}
$tmp_path = defined('WRITEABLE') ? WRITEABLE.'/tmp/' : FULL_PATH.'/kernel/cache/';
$fname = $value['name'];
$id = $this->Application->GetVar('id');
if ($id) {
$fname = $id.'_'.$fname;
}
$fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
$upload_dir = $fields[ $this->Application->GetVar('field') ]['upload_dir'];
if (!is_writable($tmp_path) || !is_writable(FULL_PATH . $upload_dir)) {
// 500 Internal Server Error
// check both temp and live upload directory
header('HTTP/1.0 500 Write permissions not set on the server');
return ;
}
move_uploaded_file($value['tmp_name'], $tmp_path.$fname);
}
/**
* Checks, that flash uploader is allowed to perform upload
*
* @param kEvent $event
* @return bool
*/
function _checkFlashUploaderPermission(&$event)
{
// Flash uploader does NOT send correct cookies, so we need to make our own check
$cookie_name = 'adm_' . $this->Application->ConfigValue('SessionCookieName');
$this->Application->HttpQuery->Cookie['cookies_on'] = 1;
$this->Application->HttpQuery->Cookie[$cookie_name] = $this->Application->GetVar('flashsid');
// this prevents session from auto-expiring when KeepSessionOnBrowserClose & FireFox is used
$this->Application->HttpQuery->Cookie[$cookie_name . '_live'] = $this->Application->GetVar('flashsid');
$admin_ses =& $this->Application->recallObject('Session.admin');
/* @var $admin_ses Session */
$backup_user_id = $this->Application->RecallVar('user_id'); // 1. backup user
$this->Application->StoreVar('user_id', $admin_ses->RecallVar('user_id')); // 2. fake user_id
$check_event = new kEvent($event->getPrefixSpecial() . ':OnProcessSelected'); // 3. event, that have "add|edit" rule
$allowed_to_upload = $this->CheckPermission($check_event); // 4. check permission
$this->Application->StoreVar('user_id', $backup_user_id); // 5. restore user id
return $allowed_to_upload;
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnDeleteFile(&$event)
{
$event->status = erSTOP;
if (strpos($this->Application->GetVar('file'), '../') !== false) {
return ;
}
$object =& $event->getObject( Array ('skip_autoload' => true) );
$options = $object->GetFieldOptions( $this->Application->GetVar('field') );
$var_name = $event->getPrefixSpecial() . '_file_pending_actions' . $this->Application->GetVar('m_wid');
$schedule = $this->Application->RecallVar($var_name);
$schedule = $schedule ? unserialize($schedule) : Array ();
$schedule[] = Array ('action' => 'delete', 'file' => $path = FULL_PATH . $options['upload_dir'] . $this->Application->GetVar('file'));
$this->Application->StoreVar($var_name, serialize($schedule));
$this->Application->Session->SaveData();
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnViewFile(&$event)
{
if (strpos($this->Application->GetVar('file'), '../') !== false) return ;
if ($this->Application->GetVar('tmp')) {
$path = (defined('WRITEABLE') ? WRITEABLE.'/tmp/' : FULL_PATH.'/kernel/cache/').$this->Application->GetVar('id').'_'.$this->Application->GetVar('file');
}
else {
$object =& $event->getObject(array('skip_autoload'=>true));
$options = $object->GetFieldOptions($this->Application->GetVar('field'));
$path = FULL_PATH.$options['upload_dir'].$this->Application->GetVar('file');
}
$type = mime_content_type($path);
header('Content-Length: '.filesize($path));
header('Content-Type: '.$type);
safeDefine('DBG_SKIP_REPORTING',1);
readfile($path);
exit();
}
/**
* Validates MInput control fields
*
* @param kEvent $event
*/
function OnValidateMInputFields(&$event)
{
$minput_helper =& $this->Application->recallObject('MInputHelper');
/* @var $minput_helper MInputHelper */
$minput_helper->OnValidateMInputFields($event);
}
/**
* Returns auto-complete values for ajax-dropdown
*
* @param kEvent $event
*/
function OnSuggestValues(&$event)
{
$this->Application->XMLHeader();
$field = $this->Application->GetVar('field');
$cur_value = $this->Application->GetVar('cur_value');
if (!$field || !$cur_value) {
exit;
}
$object =& $event->getObject();
$sql = 'SELECT DISTINCT '.$field.'
FROM '.$object->TableName.'
WHERE '.$field.' LIKE '.$this->Conn->qstr($cur_value.'%').'
ORDER BY '.$field.'
LIMIT 0,20';
$data = $this->Conn->GetCol($sql);
echo '<suggestions>';
foreach ($data as $item) {
echo '<item>'.$item.'</item>';
}
echo '</suggestions>';
$event->status = erSTOP;
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnSaveWidths(&$event)
{
$event->status = erSTOP;
$lang =& $this->Application->recallObject('lang.current');
// header('Content-type: text/xml; charset='.$lang->GetDBField('Charset'));
$picker_helper =& $this->Application->RecallObject('ColumnPickerHelper');
/* @var $picker_helper kColumnPickerHelper */
$picker_helper->PreparePicker($event->getPrefixSpecial(), $this->Application->GetVar('grid_name'));
$picker_helper->SaveWidths($event->getPrefixSpecial(), $this->Application->GetVar('widths'));
echo 'OK';
}
/**
* Called from CSV import script after item fields
* are set and validated, but before actual item create/update.
* If event status is erSUCCESS, line will be imported,
* else it will not be imported but added to skipped lines
* and displayed in the end of import.
* Event status is preset from import script.
*
* @param kEvent $event
*/
function OnBeforeCSVLineImport(&$event)
{
// abstract, for hooking
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/kernel/db/db_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.99.2.43
\ No newline at end of property
+1.99.2.44
\ No newline at end of property
Index: branches/RC/core/kernel/application.php
===================================================================
--- branches/RC/core/kernel/application.php (revision 11545)
+++ branches/RC/core/kernel/application.php (revision 11546)
@@ -1,2821 +1,2851 @@
<?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 NParser object
* @access private
* @var NParser
*/
var $Parser;
/**
* New Parser (Experimental)
*
* @var NParser
*/
var $NParser;
/**
* 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
var $LambdaElements = 1; // for autonumbering unnamed RenderElements [any better place for this prop? KT]
/**
* Holds current NParser tag while parsing, can be used in error messages to display template file and line
*
* @var unknown_type
*/
var $CurrentNTag = null;
/**
* Memcache object pointer
*
* @var Memcache
*/
var $Memcached = null;
/**
* 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;
}
function InitMemcached()
{
return ;
$memcached_servers = 'localhost:11211'; // $this->Application->ConfigValue('MemcachedServers');
if ($memcached_servers && class_exists('Memcache')) {
$this->Memcached = new Memcache();
$servers = explode(';', $memcached_servers);
foreach ($servers as $server) {
list ($server, $port) = strpos($server, ':') !== false ? explode(':', $server, 2) : Array ($server, 11211);
$this->Memcached->addServer($server, $port);
}
}
//try to set something to cache, if not working - set $this->Memcached to null
}
function CacheSet($name, $value, $expiration)
{
if (isset($this->Memcached)) {
return $this->Memcached->set($name, $value, 0, $expiration);
}
return false;
}
function CacheGet($name)
{
if (isset($this->Memcached)) {
return $this->Memcached->get($name);
}
return false;
}
/**
* 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;
$this->InitMemcached();
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) {
// wrap around previous error handler, if any was set
$this->errorHandlers[] = $error_handler;
}
}
$this->Conn = new kDBConnection(SQL_TYPE, Array(&$this, 'handleSQLError') );
$this->Conn->debugMode = $this->isDebugMode();
$this->Conn->Connect(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB);
$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();
if( defined('DEBUG_MODE') && $this->isDebugMode() ) {
$this->Debugger->appendTimestamp('Before UnitConfigReader');
}
$this->UnitConfigReader =& $this->recallObject('kUnitConfigReader');
$this->UnitConfigReader->scanModules(MODULES_PATH);
$this->registerModuleConstants();
if( defined('DEBUG_MODE') && $this->isDebugMode() ) {
$this->Debugger->appendTimestamp('After UnitConfigReader');
}
$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');
if( defined('DEBUG_MODE') && $this->isDebugMode() ) {
$this->Debugger->appendTimestamp('Processed HTTPQuery initial');
}
$this->Session =& $this->recallObject('Session');
if( defined('DEBUG_MODE') && $this->isDebugMode() ) {
$this->Debugger->appendTimestamp('Processed Session');
}
if (!$this->RecallVar('UserGroups')) {
$user_groups = trim($this->Session->GetField('GroupList'), ',');
if (!$user_groups) {
$user_groups = $this->ConfigValue('User_GuestGroup');
}
$this->Session->SetField('GroupList', $user_groups);
$this->StoreVar('UserGroups', $user_groups);
}
$this->HttpQuery->AfterInit();
$this->Session->ValidateExpired();
if( defined('DEBUG_MODE') && $this->isDebugMode() ) {
$this->Debugger->appendTimestamp('Processed HTTPQuery AfterInit');
}
$this->LoadCache();
$this->InitConfig();
$this->Phrases->Init('phrases');
if( defined('DEBUG_MODE') && $this->isDebugMode() ) {
$this->Debugger->appendTimestamp('Loaded cache and phrases');
}
$this->UnitConfigReader->AfterConfigRead();
if( defined('DEBUG_MODE') && $this->isDebugMode() ) {
$this->Debugger->appendTimestamp('Processed 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->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) );
if (preg_match('/utf-8/', $language->GetDBField('Charset'))) {
setlocale(LC_ALL, 'en_US.UTF-8');
mb_internal_encoding('UTF-8');
}
$this->ValidateLogin();
if( defined('DEBUG_MODE') && $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()
{
if (defined('IS_INSTALL') && IS_INSTALL && !$this->TableFound('Modules')) {
$this->registerModuleConstants();
return false;
}
$modules_helper =& $this->recallObject('ModulesHelper');
$this->ModuleInfo = $this->Conn->Query('SELECT * FROM '.TABLE_PREFIX.'Modules WHERE Loaded = 1 ORDER BY LoadOrder', 'Name');
$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 Unknown 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!
$theme_id = 'default';
}
$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($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 (!$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',null, 'kDBTagProcessor');
$this->registerClass('Template', KERNEL_PATH.'/parser/template.php');
$this->registerClass('TemplateParser', KERNEL_PATH.'/parser/template_parser.php',null, 'kDBTagProcessor');
$this->registerClass('NParser', KERNEL_PATH.'/nparser/nparser.php');
$this->registerClass('kEmailSendingHelper', KERNEL_PATH.'/utility/email_send.php', 'EmailSender', Array('kHelper'));
$this->registerClass('kSocket', KERNEL_PATH.'/utility/socket.php', 'Socket');
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, CachedTemplate, TreeLeft, TreeRight
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['CachedTemplate']);
$this->setCache('category_tree', $id, $category_data['TreeLeft'] . ';' . $category_data['TreeRight']);
// $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, $expiration=3600)
{
$cache =& $this->recallObject('Cache');
/* @var $cache kCache */
return $cache->setCache($cache_name, $key, $value, $expiration);
}
/**
* 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() // 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('module_key'); // for common search 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' && !$this->GetVar('debug_ajax')) {
// hide debug output from ajax requests automatically
define('DBG_SKIP_REPORTING', 1);
}
}
elseif ($this->GetVar('admin')) {
// viewing front-end through admin's frame
$admin_session =& $this->Application->recallObject('Session.admin');
$user = (int)$admin_session->RecallVar('user_id'); // in case, when no valid admin session found
$perm_helper =& $this->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
if ($perm_helper->CheckUserPermission($user, 'CATEGORY.MODIFY', 0, 0)) {
// user can edit cms blocks
$editing_mode = $this->GetVar('editing_mode');
define('EDITING_MODE', $editing_mode ? $editing_mode : EDITING_MODE_CMS);
}
}
safeDefine('EDITING_MODE', ''); // user can't edit anything
if (!$this->RequestProcessed) $this->ProcessRequest();
$this->InitParser();
$t = $this->GetVar('t');
$cms_handler =& $this->recallObject('st_EventHandler');
/* @var $cms_handler CategoriesEventHandler */
if (!$this->TemplatesCache->TemplateExists($t) && !$this->IsAdmin()) {
$t = $cms_handler->GetDesignTemplate();
if ($this->isDebugMode()) {
$this->Debugger->appendHTML('<strong>Design Template</strong>: ' . $t . '; <strong>CategoryID</strong>: ' . $this->GetVar('m_cat_id'));
}
}
/*else {
$cms_handler->SetCatByTemplate();
}*/
if($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Parsing:');
}
if (defined('NPARSER') && 'NPARSER') {
$this->HTML = $this->NParser->Run( $t );
}
else {
$this->HTML = $this->Parser->ParseTemplate( $t );
}
if ($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application after Parsing:');
}
}
function InitParser()
{
if (defined('NPARSER') && 'NPARSER') {
if( !is_object($this->NParser) ) {
$this->NParser =& $this->recallObject('NParser');
$this->TemplatesCache =& $this->recallObject('TemplatesCache');
// can be removed in future
// $this->Parser =& $this->recallObject('TemplateParser');
$this->Parser =& $this->NParser;
}
}
else {
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()
{
$this->HandleEvent( new kEvent('adm:OnBeforeShutdown') );
if ($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Done:');
}
//eval("?".">".$this->HTML);
if ($this->isDebugMode()) {
$this->EventManager->RunRegularEvents(reAFTER);
$this->Session->SaveData();
if (constOn('DBG_CACHE')) {
$cache =& $this->recallObject('Cache');
$cache->printStatistics();
}
$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()) {
$this->EventManager->RunRegularEvents(reAFTER);
$this->Session->SaveData();
}
if (defined('DBG_CAPTURE_STATISTICS') && DBG_CAPTURE_STATISTICS && !$this->IsAdmin()) {
$this->_storeStatistics();
}
}
/**
* Stores script execution statistics to database
*
*/
function _storeStatistics()
{
global $start;
$script_time = getmicrotime() - $start;
$query_statistics = $this->Conn->getQueryStatistics(); // time & count
$sql = 'SELECT *
FROM ' . TABLE_PREFIX . 'StatisticsCapture
WHERE TemplateName = "' . $this->GetVar('t') . '"';
$data = $this->Conn->GetRow($sql);
if ($data) {
$this->_updateAverageStatistics($data, 'ScriptTime', $script_time);
$this->_updateAverageStatistics($data, 'SqlTime', $query_statistics['time']);
$this->_updateAverageStatistics($data, 'SqlCount', $query_statistics['count']);
$data['Hits']++;
$data['LastHit'] = adodb_mktime();
$this->Conn->doUpdate($data, TABLE_PREFIX . 'StatisticsCapture', 'StatisticsId = ' . $data['StatisticsId']);
}
else {
$data['ScriptTimeMin'] = $data['ScriptTimeAvg'] = $data['ScriptTimeMax'] = $script_time;
$data['SqlTimeMin'] = $data['SqlTimeAvg'] = $data['SqlTimeMax'] = $query_statistics['time'];
$data['SqlCountMin'] = $data['SqlCountAvg'] = $data['SqlCountMax'] = $query_statistics['count'];
$data['TemplateName'] = $this->GetVar('t');
$data['Hits'] = 1;
$data['LastHit'] = adodb_mktime();
$this->Conn->doInsert($data, TABLE_PREFIX . 'StatisticsCapture');
}
}
/**
* Calculates average time for statistics
*
* @param Array $data
* @param string $field_prefix
* @param float $current_value
*/
function _updateAverageStatistics(&$data, $field_prefix, $current_value)
{
$data[$field_prefix . 'Avg'] = (($data['Hits'] * $data[$field_prefix . 'Avg']) + $current_value) / ($data['Hits'] + 1);
if ($current_value < $data[$field_prefix . 'Min']) {
$data[$field_prefix . 'Min'] = $current_value;
}
if ($current_value > $data[$field_prefix . 'Max']) {
$data[$field_prefix . 'Max'] = $current_value;
}
}
function logSlowQuery($slow_sql, $time)
{
$query_crc = crc32($slow_sql);
$sql = 'SELECT *
FROM ' . TABLE_PREFIX . 'SlowSqlCapture
WHERE QueryCrc = ' . $query_crc;
$data = $this->Conn->Query($sql, null, true);
if ($data) {
$this->_updateAverageStatistics($data, 'Time', $time);
$template_names = explode(',', $data['TemplateNames']);
array_push($template_names, $this->GetVar('t'));
$data['TemplateNames'] = implode(',', array_unique($template_names));
$data['Hits']++;
$data['LastHit'] = adodb_mktime();
$this->Conn->doUpdate($data, TABLE_PREFIX . 'SlowSqlCapture', 'CaptureId = ' . $data['CaptureId']);
}
else {
$data['TimeMin'] = $data['TimeAvg'] = $data['TimeMax'] = $time;
$data['SqlQuery'] = $slow_sql;
$data['QueryCrc'] = $query_crc;
$data['TemplateNames'] = $this->GetVar('t');
$data['Hits'] = 1;
$data['LastHit'] = adodb_mktime();
$this->Conn->doInsert($data, TABLE_PREFIX . 'SlowSqlCapture');
}
}
/**
* 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)
{
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)
{
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, $optional = false)
{
$session =& $this->recallObject('Session');
$this->Session->StoreVar($var, $val, $optional);
}
function StorePersistentVar($var, $val)
{
$this->Session->StorePersistentVar($var, $val);
}
function StoreVarDefault($var, $val, $optional=false)
{
$session =& $this->recallObject('Session');
$this->Session->StoreVarDefault($var, $val, $optional);
}
/**
* 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 = '', $optional = false)
{
if (!isset($ses_var)) $ses_var = $var;
if ($this->GetVar($var) !== false) {
$this->StoreVar($ses_var, $this->GetVar($var), $optional);
}
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)
{
if (defined('NPARSER') && NPARSER) {
$p = $this->Parser->GetProcessor($prefix);
return $p->ProcessParsedTag($tag, $params, $prefix);
}
$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;
}
/**
* Allows to parse given block name or include template
*
* @param Array $params Parameters to pass to block/template. Reserved parameter "name" used to specify block/template name.
* @param Array $pass_params Forces to pass current parser params to this block/template. Use with cauntion, because you can accidently pass "block_no_data" parameter.
* @param bool $as_template
* @return string
*/
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()
$t = preg_replace('/^Content\//i', '', $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_DIRECTORY;
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 = defined('ADMIN') && ADMIN ? $this->ConfigValue('AdminSSL_URL') : false;
if (!$target_url) {
$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 (isset($params['opener']) && $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);
$params = array_merge($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')
{
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] ...
// we need to keep that sorting despite the sorting below, because this sorts prefixes with same priority by name
sort($pass_info, SORT_STRING); // to be prefix1,prefix1.special1,prefix1.special2,prefix3.specialX
foreach ($pass_info as $prefix) {
list($prefix_only) = explode('.', $prefix, 1);
$sorted[$prefix] = $this->getUnitOption($prefix_only, 'PassPriority', 0);
}
arsort($sorted);
$pass_info = array_keys($sorted);
// 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 || preg_match('/c\.[-\d]*/', implode(',', $pass_info))) {
$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'], $params['opener'], $params['m_event']);
if ($this->GetVar('admin') && !isset($params['admin'])) {
$params['admin'] = 1;
if (!array_key_exists('editing_mode', $params)) {
$params['editing_mode'] = EDITING_MODE;
}
}
if (array_key_exists('escape', $params) && $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) {
$base_url = defined('ADMIN') && ADMIN ? $this->ConfigValue('AdminSSL_URL') : false;
if (!$base_url) {
$base_url = $this->ConfigValue('SSL_URL');
}
return rtrim($base_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
$session =& $this->Application->recallObject('Session');
/* @var $session Session */
$this->HandleEvent( new kEvent('adm:OnBeforeShutdown') );
$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->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();
if (isset($this->Caches['ConfigVariables'])) {
$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;
}
if (defined('IS_INSTALL') && IS_INSTALL && !$this->TableFound('ConfigurationValues')) {
return false;
}
$sql = 'SELECT VariableId, VariableValue
FROM '.TABLE_PREFIX.'ConfigurationValues
WHERE VariableName = '.$this->Conn->qstr($name);
$res = $this->Conn->GetRow($sql);
if ($res !== false) {
$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)
{
$this->InitParser(); // because kDBTagProcesor is in TemplateParser dependencies
$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->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( mb_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 || (defined('DEBUG_MODE') && DEBUG_MODE && defined('DBG_SKIP_REPORTING') && DBG_SKIP_REPORTING)) {
// when debugger absent OR it's present, but we actually can't see it's error report (e.g. during ajax request)
if ($errno == E_USER_ERROR) {
header('HTTP/1.0 500 Script Fatal Error');
echo ('<div style="background-color: #FEFFBF; margin: auto; padding: 10px; border: 2px solid red; text-align: center">
<strong>Fatal Error: </strong>
'."$errstr in $errfile on line $errline".'
</div>');
exit;
}
return true;
}
$res = false;
$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];
$res = $object->$method($errno, $errstr, $errfile, $errline, $errcontext);
}
else {
$function = $this->errorHandlers[$i];
$res = $function($errno, $errstr, $errfile, $errline, $errcontext);
}
$i++;
}
return $res;
}
/**
* 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') ) {
if (!$this->prefixRegistred($parent_prefix)) {
// stop searching, when parent prefix is not registered
break;
}
$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('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)
{
$event =& $this->EmailEvent($email_event_name, 1, $to_user_id, $send_params);
return $event;
}
/**
* 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)
{
$event =& $this->EmailEvent($email_event_name, 0, $to_user_id, $send_params);
return $event;
}
/**
* 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;
}
/**
* Allows to check if user in this session is logged in or not
*
* @return bool
*/
function LoggedIn()
{
// no session during expiration process
return is_null($this->Session) ? false : $this->Session->LoggedIn();
}
/**
* 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);
}
/**
+ * Checks, that given prefix is in temp mode
+ *
+ * @param string $prefix
+ * @return bool
+ */
+ function IsTempMode($prefix, $special = '')
+ {
+ $top_prefix = $this->Application->GetTopmostPrefix($prefix);
+
+ $var_names = Array (
+ $top_prefix,
+ rtrim($top_prefix . '_' . $special, '_'), // from post
+ rtrim($top_prefix . '.' . $special, '.'), // assembled locally
+ );
+
+ $var_names = array_unique($var_names);
+
+ $temp_mode = false;
+ foreach ($var_names as $var_name) {
+ $value = $this->Application->GetVar($var_name . '_mode');
+ if ($value && (substr($value, 0, 1) == 't')) {
+ $temp_mode = true;
+ break;
+ }
+ }
+
+ return $temp_mode;
+ }
+
+ /**
* 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)
{
if ($time_zone == 'GMT') {
return (-1) * adodb_date('Z');
}
$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;
}
/**
* Allows to detect if page is browsed by spider (293 agents supported)
*
* @return bool
*/
function IsSpider()
{
static $is_spider = null;
if (!isset($is_spider)) {
$user_agent = trim($_SERVER['HTTP_USER_AGENT']);
$robots = file(FULL_PATH.'/core/robots_list.txt');
foreach ($robots as $robot_info) {
$robot_info = explode("\t", $robot_info, 3);
if ($user_agent == trim($robot_info[2])) {
$is_spider = true;
break;
}
}
}
return $is_spider;
}
/**
* Allows to detect table's presense in database
*
* @param string $table_name
* @return bool
*/
function TableFound($table_name)
{
return $this->Conn->TableFound($table_name);
}
/**
* Returns counter value
*
* @param string $name counter name
* @param Array $params counter parameters
* @param string $query_name specify query name directly (don't generate from parmeters)
* @param bool $multiple_results
* @return mixed
*/
function getCounter($name, $params = Array (), $query_name = null, $multiple_results = false)
{
$count_helper =& $this->Application->recallObject('CountHelper');
/* @var $count_helper kCountHelper */
return $count_helper->getCounter($name, $params, $query_name, $multiple_results);
}
/**
* Resets counter, whitch are affected by one of specified tables
*
* @param string $tables comma separated tables list used in counting sqls
*/
function resetCounters($tables)
{
if (constOn('IS_INSTALL')) {
return ;
}
$count_helper =& $this->Application->recallObject('CountHelper');
/* @var $count_helper kCountHelper */
return $count_helper->resetCounters($tables);
}
/**
* Sends XML header + optionally displays xml heading
*
* @param string $xml_version
* @return string
* @author Alex
*/
function XMLHeader($xml_version = false)
{
$lang =& $this->recallObject('lang.current');
header('Content-type: text/xml; charset='.$lang->GetDBField('Charset'));
return $xml_version ? '<?xml version="'.$xml_version.'" encoding="'.$lang->GetDBField('Charset').'"?>' : '';
}
/**
* Returns category tree
*
* @param int $category_id
* @return Array
*/
function getTreeIndex($category_id)
{
$category_template = $this->getFilename('c', $category_id); // to rebuild "category_tree" cache
$tree_index = $this->getCache('category_tree', $category_id);
if ($tree_index) {
$ret = Array ();
list ($ret['TreeLeft'], $ret['TreeRight']) = explode(';', $tree_index);
return $ret;
}
return false;
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/kernel/application.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.186.2.32
\ No newline at end of property
+1.186.2.33
\ No newline at end of property
Index: branches/RC/core/kernel/nparser/ntags.php
===================================================================
--- branches/RC/core/kernel/nparser/ntags.php (revision 11545)
+++ branches/RC/core/kernel/nparser/ntags.php (revision 11546)
@@ -1,531 +1,546 @@
<?php
class _BlockTag extends kBase {
/**
* Enter description here...
*
* @var NParser
*/
var $Parser = null;
var $Tag = null;
/**
* Contains parameter names, that should be given to tag in any case
*
* @var Array
*/
var $_requiredParams = Array ();
function _BlockTag($tag)
{
parent::kBase();
$this->Tag = $tag;
}
function Open($tag)
{
if (!$this->_checkRequiredParams($tag)) {
return false;
}
return '';
}
/**
* Checks, that all required attributes for tag are passed
*
* @param Array $tag
* @return bool
*/
function _checkRequiredParams($tag)
{
$missing_params = array_diff($this->_requiredParams, array_keys($tag['NP']));
if (!$missing_params) {
return true;
}
$error_msg = 'Tag ' . $this->Parser->TagInfo($tag, true) . ' called <b> without required ' . implode(', ', $missing_params) . ' </b> attribute';
if (count($missing_params) > 1) {
$error_msg .= '(-s)';
}
$this->Application->handleError(E_USER_ERROR, $error_msg, $tag['file'], $tag['line']);
return false;
}
/**
* All tags inside block tag are passed through to this method
* Any returned result is appened to current level's buffer
* This can be used to implement special handling of such tags as <inp2:m_else/>
*
* @param unknown_type $tag
* @return unknown
*/
function PassThrough(&$tag)
{
return '';
}
function Close($tag)
{
return $this->Parser->Buffers[$this->Parser->Level];
}
function AppendCode(&$o, $code, $php_tags=true)
{
if ($php_tags) {
$o .= '<?'."php\n" . ( is_array($code) ? "\t".implode("\n\t", $code)."\n" : $code) .'?>';
}
else {
$o .= ( is_array($code) ? "\t".implode("\n\t", $code)."\n" : $code);
}
}
}
class _Tag_Comment extends _BlockTag {
function PassThrough(&$tag)
{
$tag['processed'] = true;
}
function Close($tag)
{
return '';
}
}
class _Tag_DefineElement extends _BlockTag {
/*var $ElemName;
function Open($tag)
{
$o = '';
$pointer = abs(crc32($tag['file'])).'_'.$tag['line'];
$f_name = $tag['NP']['name'].'_'.$pointer;
$this->ElemName = $tag['NP']['name'];
$code[] = "\$_parser->Elements['{$tag['NP']['name']}'] = '$f_name';";
// function_exists is required here, because a template may be included more than once
// leading to Cannot redeclare error
$code[] = "if (!function_exists('{$f_name}')) {";
$code[] = "function $f_name(&\$_parser, \$params) {";
$code[] = "global \$application;";
$code[] = "if (!\$_output = \$_parser->CacheStart('{$pointer}')) {";
$defaults = $this->Parser->CompileParamsArray($tag['NP']);
$code[] = "\$params = array_merge($defaults, \$params);";
$code[] = "if (!isset(\$params['PrefixSpecial']) && isset(\$params['prefix'])) {\$params['PrefixSpecial'] = \$params['prefix'];};";
$code[] = "extract(\$params);";
$code[] = "\$_parser->SetParams(\$params);";
$code[] = 'ob_start();';
$this->AppendCode($o, $code, false);
return $o . '?'.'>';
}
function Close($tag)
{
$o = $this->Parser->Buffers[$this->Parser->Level];
$code[] = "\$_parser->CacheEnd();\n";
$code[] = '$_output = ob_get_contents();';
$code[] = 'ob_end_clean();';
$code[] = '}';
$code[] = "return \$_output === true ? '' : \$_output;";
$code[] = '}}';
$code[] = "\$_parser->CachableElements['".$this->ElemName."'] = ".($this->Parser->Cachable[$this->Parser->Level] ? 'true':'false').';';
$o .= '<?'.'php';
$this->AppendCode($o, $code, false);
return $o;
// $this->Parser->Definitions .= $o."\n";
// return '';
} */
function _Tag_DefineElement($tag)
{
parent::_BlockTag($tag);
$this->_requiredParams = Array ('name');
}
function Open($tag)
{
$o = parent::Open($tag);
if ($o === false) {
// some required params not passed
return $o;
}
$f_name = $tag['NP']['name'].'_'.abs(crc32($tag['file'])).'_'.$tag['line'];
$this->Tag['function_name'] = $f_name; // for later use in closing tag
$code[] = "\$_parser->Elements['{$tag['NP']['name']}'] = '$f_name';";
// function_exists is required here, because a template may be included more than once
// leading to Cannot redeclare error
$code[] = "if (!function_exists('{$f_name}')) {";
$code[] = "function $f_name(&\$_parser, \$params) {";
$code[] = "global \$application;";
$tag['NP'] = $this->_extractParams($tag['NP']);
$defaults = $this->Parser->CompileParamsArray($tag['NP']);
$code[] = "\$params = array_merge($defaults, \$params);";
$code[] = "if (!isset(\$params['PrefixSpecial']) && isset(\$params['prefix'])) {\$params['PrefixSpecial'] = \$params['prefix'];};";
$code[] = "extract(\$params);";
$code[] = "\$_parser->SetParams(\$params);";
$code[] = 'ob_start();';
$this->AppendCode($o, $code);
return $o;
}
/**
* Converts $param_name to $params['param_name']
*
* @param Array $params
* @return Array
*/
function _extractParams($params)
{
foreach ($params as $param_name => $param_value) {
$params[$param_name] = preg_replace('/[\{]{0,1}([\$])(.*?[^\$\s\{\}]*)[\}]{0,1}/', '{$params[\'\\2\']}', $param_value);
}
return $params;
}
function Close($tag)
{
$o = $this->Parser->Buffers[$this->Parser->Level];
$code[] = '$_output = ob_get_contents();';
$code[] = 'ob_end_clean();';
$code[] = 'return $_output;';
$code[] = '}}';
$end_pos = $tag['pos'] + strlen($tag['opening']) + strlen($tag['tag']) + strlen($tag['closing']) + TAG_NAMESPACE_LENGTH;
$code[] = "\$_parser->ElementLocations['{$this->Tag['function_name']}'] = Array('template' => '{$this->Tag['template']}', 'start_pos' => {$this->Tag['pos']}, 'end_pos' => {$end_pos});";
$this->AppendCode($o, $code);
return $o;
}
}
class _Tag_Capture extends _Tag_DefineElement {
function _Tag_Capture($tag)
{
parent::_Tag_DefineElement($tag);
$this->_requiredParams = Array ('to_var');
}
function Open($tag)
{
if (!$this->_checkRequiredParams($tag)) {
return false;
}
$tag['NP']['name'] = '__capture_'.$tag['NP']['to_var'];
$o = '';
// $this->AppendCode($o, "\$_parser->Captures['{$tag['NP']['to_var']}'] = 1;", false);
$this->AppendCode($o, "\$_parser->Captures['{$tag['NP']['to_var']}'] = 1;");
$o .= parent::Open($tag);
return $o;
}
}
class _Tag_RenderElement extends _Tag_DefineElement {
var $Single = true;
var $OriginalTag;
function _Tag_RenderElement($tag)
{
parent::_Tag_DefineElement($tag);
if (!$tag['is_closing']) {
$this->_requiredParams = Array ('design');
}
}
function Open($tag)
{
if (!$this->_checkRequiredParams($tag)) {
return false;
}
$o = '';
if ($tag['is_closing']) {
if (isset($tag['NP']['design'])) {
$this->RenderDesignCode($o, $tag['NP']);
return $o;
}
$to_pass = $this->Parser->CompileParamsArray($tag['NP']);
/* $pointer = abs(crc32($tag['file'])).'_'.$tag['line'];
// $code[] = "}";
// $code[] = "if (!\$_parser->CachableElements['".$tag['NP']['name']."']) {";
// $code[] = "\$_parser->CacheEndInside();";
// $code[] = "}";
$o .= '<?'.'php ';
$this->AppendCode($o, $this->Parser->BreakCache('', $pointer.'a', "\$_parser->CachableElements['".$tag['NP']['name']."']"), false);
$this->AppendCode($o, "echo (\$_parser->ParseBlock($to_pass));\n", false);
$this->AppendCode($o, $this->Parser->BreakCache('', $pointer.'b') . " ?".">\n", false);
// $this->AppendCode($o, "if (!\$_parser->CacheStartOrContinue(\$_parser->CachableElements['".$tag['NP']['name']."'], '{$pointer}')) {".' ?'.'>', false);
*/
$this->AppendCode($o, "echo (\$_parser->ParseBlock($to_pass));");
return $o;
}
$this->Single = false;
$this->OriginalTag = $tag;
$tag['NP']['name'] = '__lambda';
return parent::Open($tag);
}
function RenderDesignCode(&$o, $params)
{
$to_pass = $this->Parser->CompileParamsArray($params);
$code[] = "echo (\$_parser->ParseBlock(array_merge($to_pass, array('name'=>\"{$params['design']}\",'content'=>\$_parser->ParseBlock($to_pass), 'keep_data_exists'=>1))));";
$this->AppendCode($o, $code);
}
function Close($tag)
{
if ($this->Single) {
return $this->Parser->Buffers[$this->Parser->Level];
}
$o = parent::Close($tag);
$this->OriginalTag['NP']['name'] = '__lambda';
$this->RenderDesignCode($o, $this->OriginalTag['NP']);
return $o;
}
}
class _Tag_RenderElements extends _BlockTag {
function _Tag_RenderElements($tag)
{
parent::_BlockTag($tag);
$this->_requiredParams = Array ('elements');
}
function Open($tag)
{
$o = parent::Open($tag);
if ($o === false) {
// some required params not passed
return $o;
}
$element_names = array_map('trim', explode(',', $tag['NP']['elements']));
unset($tag['NP']['elements']);
$class = '_Tag_RenderElement';
$instance = new $class($tag);
/* @var $instance _Tag_RenderElement */
$instance->Parser =& $this->Parser;
$skip_elements = array_key_exists('skip', $tag['NP']) ? array_map('trim', explode(',', $tag['NP']['skip'])) : Array ();
foreach ($element_names as $element_name) {
if (in_array($element_name, $skip_elements) || !$element_name) {
// empty element name OR element should be excluded
continue;
}
$tag['NP']['name'] = $element_name;
$o .= $instance->Open($tag);
}
return $o;
}
}
class _Tag_Param extends _BlockTag {
function _Tag_Param($tag)
{
parent::_BlockTag($tag);
$this->_requiredParams = Array ('name');
}
function Open($tag)
{
$o = parent::Open($tag);
if ($o === false) {
// some required params not passed
return $o;
}
$capture_params = $tag['NP'];
$capture_params['name'] = '__capture_' . $tag['NP']['name'];
$capture_to_pass = $this->Parser->CompileParamsArray($capture_params);
$code[] = "if (isset(\$_parser->Captures['{$tag['NP']['name']}'])) {";
$code[] = "\${$tag['NP']['name']} = \$_parser->ParseBlock($capture_to_pass);";
$code[] = "}";
$code[] = "else {";
$to_pass = $this->Parser->CompileParamsArray($tag['NP']);
$code[] = '$_p_ =& $_parser->GetProcessor(\'m\');';
$code[] = '$_tag_params = ' . $to_pass . ';';
$code[] = "\${$tag['NP']['name']} = \$_p_->PostProcess(\${$tag['NP']['name']}, \$_p_->PreparePostProcess(\$_tag_params));";
$code[] = "}";
if (array_key_exists('plus', $tag['NP'])) {
$code[] = "\${$tag['NP']['name']} += {$tag['NP']['plus']};";
}
$code[] = "\$params['{$tag['NP']['name']}'] = \${$tag['NP']['name']};";
$code[] = "echo (\${$tag['NP']['name']});";
$this->AppendCode($o, $code);
return $o;
}
}
class _Tag_Include extends _BlockTag {
function Open($tag)
{
$o = '';
$to_pass = $this->Parser->CompileParamsArray($tag['NP']);
$this->AppendCode($o, "echo (\$_parser->IncludeTemplate($to_pass))");
return $o;
}
}
class _Tag_If extends _BlockTag {
/**
* Permanently inverses if tag (used in ifnot tag)
*
* @var bool
*/
var $_Inversed = false;
function _Tag_If($tag)
{
parent::_BlockTag($tag);
$this->_requiredParams = Array ('check');
}
function Open($tag)
{
$o = parent::Open($tag);
if ($o === false) {
// some required params not passed
return $o;
}
$to_pass = $this->Parser->CompileParamsArray($tag['NP']);
$code[] = "\$_splited = \$_parser->SplitTag(array('tag'=>\"{$tag['NP']['check']}\", 'file'=>'{$tag['file']}', 'line'=>{$tag['line']}));";
$code[] = 'if ($_splited[\'prefix\'] == \'__auto__\') {$_splited[\'prefix\'] = $PrefixSpecial;}';
$code[] = '$_p_ =& $_parser->GetProcessor($_splited[\'prefix\']);';
if (isset($tag['NP']['inverse']) || $this->_Inversed) {
$code[] = "if (!\$_p_->ProcessParsedTag(\$_splited['name'], $to_pass, \$_splited['prefix'], '{$tag['file']}', {$tag['line']})) {";
}
else {
$code[] = "if (\$_p_->ProcessParsedTag(\$_splited['name'], $to_pass, \$_splited['prefix'], '{$tag['file']}', {$tag['line']})) {";
}
$this->AppendCode($o, $code);
return $o;
}
function PassThrough(&$tag)
{
$o = '';
if ($tag['name'] == 'else') {
$this->AppendCode($o, '} else {');
$tag['processed'] = true;
}
if ($tag['name'] == 'elseif') {
if (!$this->_checkRequiredParams($tag)) {
return '';
}
$to_pass = $this->Parser->CompileParamsArray($tag['NP']);
$code[] = "\$_splited = \$_parser->SplitTag(array('tag'=>\"{$tag['NP']['check']}\", 'file'=>'{$tag['file']}', 'line'=>{$tag['line']}));";
$code[] = 'if ($_splited[\'prefix\'] == \'__auto__\') {$_splited[\'prefix\'] = $PrefixSpecial;}';
$code[] = '$_p_ =& $_parser->GetProcessor($_splited[\'prefix\']);';
if (isset($tag['NP']['inverse']) || $this->_Inversed) {
$code[] = "} else if (!\$_p_->ProcessParsedTag(\$_splited['name'], $to_pass, \$_splited['prefix'], '{$tag['file']}', {$tag['line']})) {";
}
else {
$code[] = "} else if (\$_p_->ProcessParsedTag(\$_splited['name'], $to_pass, \$_splited['prefix'], '{$tag['file']}', {$tag['line']})) {";
}
$this->AppendCode($o, $code);
$tag['processed'] = true;
}
return $o;
}
function Close($tag)
{
$o = $this->Parser->Buffers[$this->Parser->Level];
$this->AppendCode($o, "}\n");
return $o;
}
}
class _Tag_IfNot extends _Tag_If {
function _Tag_IfNot($tag)
{
parent::_Tag_If($tag);
$this->_Inversed = true;
}
}
class _Tag_DefaultParam extends _BlockTag {
function Open($tag)
{
$o = '';
foreach ($tag['NP'] as $key => $val) {
$code[] = 'if (!isset($' . $key . ')) $params[\'' . $key . '\'] = \'' . $val . '\';';
$code[] = '$' . $key . ' = isset($' . $key . ') ? $' . $key . ' : \'' . $val . '\';';
$code[] = '$_parser->SetParam(\'' . $key . '\', $' . $key . ');';
}
$this->AppendCode($o, $code);
return $o;
}
}
+class _Tag_SetParam extends _BlockTag {
+
+ function Open($tag)
+ {
+ $o = '';
+ foreach ($tag['NP'] as $key => $val) {
+ $code[] = '$params[\'' . $key . '\'] = \'' . $val . '\';';
+ $code[] = '$' . $key . ' = \'' . $val . '\';';
+ $code[] = '$_parser->SetParam(\'' . $key . '\', $' . $key . ');';
+ }
+ $this->AppendCode($o, $code);
+ return $o;
+ }
+}
+
class _Tag_Cache extends _BlockTag {
function Open($tag)
{
$pointer = abs(crc32($tag['file'])).'_'.$tag['line'];
$o = '';
$this->AppendCode($o, "if (!\$_parser->CacheStart('{$pointer}')) {\n");
return $o;
}
function Close($tag)
{
$o = $this->Parser->Buffers[$this->Parser->Level];
$this->AppendCode($o, "\$_parser->CacheEnd();\n}\n");
return $o;
}
}
Property changes on: branches/RC/core/kernel/nparser/ntags.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.10
\ No newline at end of property
+1.1.2.11
\ No newline at end of property
Index: branches/RC/core/units/agents/agents_config.php
===================================================================
--- branches/RC/core/units/agents/agents_config.php (revision 11545)
+++ branches/RC/core/units/agents/agents_config.php (revision 11546)
@@ -1,134 +1,134 @@
<?php
$config = Array (
'Prefix' => 'agent',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'AgentEventHandler', 'file' => 'agent_eh.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array (
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'Hooks' => Array (
Array (
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'adm',
'HookToSpecial' => '*',
'HookToEvent' => Array ('OnAfterCacheRebuild'),
'DoPrefix' => '',
'DoSpecial' => '*',
'DoEvent' => 'OnRefreshAgents',
),
),
'IDField' => 'AgentId',
'TableName' => TABLE_PREFIX . 'Agents',
'TitleField' => 'AgentName',
'StatusField' => Array ('Status'),
'TitlePresets' => Array (
'default' => Array (
'new_status_labels' => Array ('agent' => '!la_title_AddingAgent!'),
'edit_status_labels' => Array ('agent' => '!la_title_EditingAgent!'),
'new_titlefield' => Array ('agent' => '!la_title_NewAgent!'),
),
- 'agent_list' => Array ('prefixes' => Array ('agent_List'), 'format' => "!la_title_Agents! (#agent_recordcount#)"),
+ 'agent_list' => Array ('prefixes' => Array ('agent_List'), 'format' => "!la_title_Agents!"),
'agent_edit' => Array ('prefixes' => Array ('agent'), 'format' => "#agent_status# '#agent_titlefield#'"),
),
'PermSection' => Array('main' => 'in-portal:agents'),
'Sections' => Array (
'in-portal:agents' => Array (
'parent' => 'in-portal:system',
'icon' => 'agents',
'label' => 'la_title_Agents',
'url' => Array('t' => 'agents/agent_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 3.1, // after Themes section
'type' => stTREE,
),
),
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s FROM %1$s',
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('AgentName' => 'asc'),
)
),
'Fields' => Array (
'AgentId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'AgentName' => Array (
'type' => 'string', 'max_len' => 255,
'unique' => Array (),
'required' => 1, 'not_null' => 1, 'default' => ''
),
'AgentType' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_User', 2 => 'la_opt_System'), 'use_phrases' => 1,
'required' => 1, 'not_null' => 1, 'default' => 1
),
'Status' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Active', 0 => 'la_opt_Disabled'), 'use_phrases' => 1,
'required' => 1, 'not_null' => 1, 'default' => 1
),
'Event' => Array (
'type' => 'string', 'max_len' => 255,
'formatter' => 'kFormatter', 'regexp' => '/^[a-z-]*[.]{0,1}[a-z-]*:On[A-Za-z0-9]*$/',
'required' => 1, 'not_null' => 1, 'default' => ''
),
'RunInterval' => Array ('type' => 'int', 'required' => 1, 'not_null' => 1, 'default' => 0),
'RunMode' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (reBEFORE => 'la_opt_Before', reAFTER => 'la_opt_After'), 'use_phrases' => 1,
'required' => 1, 'not_null' => 1, 'default' => 2
),
'LastRunOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => NULL),
'LastRunStatus' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Success', 0 => 'la_opt_Failed', 2 => 'la_opt_Running'), 'use_phrases' => 1,
'not_null' => 1, 'default' => 1
),
'NextRunOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
'RunTime' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array ('default' => 'icon16_agent.gif'),
'Fields' => Array (
'AgentId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ),
'AgentName' => Array ('title' => 'la_col_Name', 'filter_block' => 'grid_like_filter',),
'AgentType' => Array ('title' => 'la_col_Type', 'filter_block' => 'grid_options_filter',),
'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter',),
'Event' => Array ('title' => 'la_col_Event', 'filter_block' => 'grid_like_filter',),
'RunInterval' => Array ('title' => 'la_col_RunInterval', 'filter_block' => 'grid_range_filter',),
'RunMode' => Array ('title' => 'la_col_RunMode', 'filter_block' => 'grid_options_filter',),
'LastRunOn' => Array ('title' => 'la_col_LastRunOn', 'filter_block' => 'grid_date_range_filter',),
'LastRunStatus' => Array ('title' => 'la_col_LastRunStatus', 'filter_block' => 'grid_options_filter',),
'NextRunOn' => Array ('title' => 'la_col_NextRunOn', 'filter_block' => 'grid_date_range_filter',),
),
),
),
);
\ No newline at end of file
Property changes on: branches/RC/core/units/agents/agents_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.4
\ No newline at end of property
+1.1.2.5
\ No newline at end of property
Index: branches/RC/core/units/visits/visits_tag_processor.php
===================================================================
--- branches/RC/core/units/visits/visits_tag_processor.php (revision 11545)
+++ branches/RC/core/units/visits/visits_tag_processor.php (revision 11546)
@@ -1,172 +1,178 @@
<?php
class VisitsTagProcessor extends kDBTagProcessor {
-
+
function UserFound($params)
{
$virtual_users = Array(-1,-2, 0);
$object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params );
return !in_array( $object->GetDBField( $params['user_field'] ) , $virtual_users );
- }
-
-
+ }
+
+
function UserLink($params)
{
$object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params );
$user_id = $object->GetDBField( $params['user_field'] );
- if($user_id)
- {
- //return $this->Application->HREF('in-commerce/users/users_edit_general','', Array('u_id' => $user_id) );
- $resource_id = $this->Conn->GetOne('SELECT ResourceId FROM '.TABLE_PREFIX.'PortalUser WHERE PortalUserId = '.$user_id);
- return 'javascript:OpenUserEdit('.$resource_id.');';
+
+ if ($user_id) {
+ $url_params = Array (
+ 'm_opener' => 'd',
+ 'u_mode' => 't',
+ 'u_event' => 'OnEdit',
+ 'u_id' => $user_id,
+ 'pass' => 'all,u'
+ );
+
+ return $this->Application->HREF($params['edit_template'], '', $url_params);
}
}
-
+
function getDateLimitClause($field)
{
$search_filter = $this->Application->RecallVar( $this->getPrefixSpecial().'_search_filter');
if($search_filter)
{
$search_filter = unserialize($search_filter);
return $search_filter[$field]['value'];
}
return '';
}
-
+
function AffiliateOrderInfo($params)
{
$list =& $this->GetList($params);
-
+
$date_limit = str_replace($list->TableName, 'vis', $this->getDateLimitClause('VisitDate') );
-
+
$affil_table = $this->Application->getUnitOption('affil', 'TableName');
$affil_idfield = $this->Application->getUnitOption('affil', 'IDField');
$sql = 'SELECT '.$affil_idfield.' FROM '.$affil_table.' WHERE PortalUserId = '.$this->Application->RecallVar('user_id');
$affiliate_id = $this->Conn->GetOne($sql);
-
+
$sql = 'SELECT COUNT(ord.OrderId) AS OrderCount
FROM '.$list->TableName.' vis
LEFT JOIN '.TABLE_PREFIX.'Orders ord ON ord.VisitId = vis.VisitId
WHERE (vis.AffiliateId = '.$affiliate_id.') AND (ord.Status = '.ORDER_STATUS_PROCESSED.')'.($date_limit ? ' AND '.$date_limit : '');
$result = $this->Conn->GetRow($sql);
-
+
$sql = 'SELECT COUNT(*) FROM '.$list->TableName.' vis
WHERE AffiliateId = '.$affiliate_id.($date_limit ? ' AND '.$date_limit : '');
-
+
$result['TotalVisitors'] = $this->Conn->GetOne($sql);
$result['OrderTotalAmount'] = $list->getTotal('OrderTotalAmount', 'SUM');
$result['OrderAffiliateCommission'] = $list->getTotal('OrderAffiliateCommission', 'SUM');
-
+
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
$format_fields = Array('OrderTotalAmount', 'OrderAffiliateCommission');
-
+
if( $this->HasParam($params, 'currency') )
{
$iso = $this->GetISO($params['currency']);
foreach($format_fields as $format_field)
{
$value = sprintf($list->Fields[$format_field]['format'], $result[$format_field]);
$value = $this->ConvertCurrency($value, $iso);
$value = $this->AddCurrencySymbol($value, $iso);
$result[$format_field] = $value;
}
}
-
+
$block_params = array_merge_recursive2($block_params, $result);
-
+
return $this->Application->ParseBlock($block_params);
}
-
-
+
+
/*function ShowTotals($params)
{
$list =& $this->GetList($params);
$block_params = $this->prepareTagParams($params);
$block_params = array_merge_recursive2($block_params, $list->Totals);
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
return $this->Application->ParseBlock($block_params);
}*/
-
+
function ListVisitors($params)
{
$o = '';
$params['render_as'] = $params['item_render_as'];
-
+
$o_visitors = $this->PrintList2($params);
-
+
if($o_visitors)
{
$header = '';
$footer = '';
-
+
$block_params = $this->prepareTagParams($params);
-
+
$header_block = getArrayValue($params, 'header_render_as');
if($header_block)
{
$block_params['name'] = $header_block;
$header = $this->Application->ParseBlock($block_params);
}
-
+
$footer_block = getArrayValue($params, 'footer_render_as');
if($footer_block)
{
$block_params['name'] = $footer_block;
$footer = $this->Application->ParseBlock($block_params);
}
-
+
$o = $header.$o_visitors.$footer;
}
else
{
$visitors_params = array('name' => $params['empty_myvisitors_render_as']);
$o = $this->Application->ParseBlock($visitors_params);
}
-
- return $o;
-
- }
+
+ return $o;
+
+ }
/*
function OrderLink($params){
$object = &$this->Application->recallObject($this->getPrefixSpecial());
$params['ord_id'] = $object->GetDBField('OrderId');
$main_processor =& $this->Application->recallObject('m_TagProcessor');
return $main_processor->T($params);
}
*/
-
+
/**
* Enter description here...
*
* @param unknown_type $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');
}
$types = $this->SelectParam($params, 'types');
$special='';
if ($types=='myvisitororders' || $types=='myvisitors'){
$special = 'incommerce';
$names_mapping = $this->Application->GetVar('NamesToSpecialMapping');
$names_mapping[$this->Prefix][$list_name] = $special;
$this->Application->SetVar('NamesToSpecialMapping', $names_mapping);
-
+
}
-
+
return parent::GetList($params);
}
-
+
}
-
+
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/visits/visits_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.14
\ No newline at end of property
+1.14.2.1
\ No newline at end of property
Index: branches/RC/core/units/categories/categories_config.php
===================================================================
--- branches/RC/core/units/categories/categories_config.php (revision 11545)
+++ branches/RC/core/units/categories/categories_config.php (revision 11546)
@@ -1,422 +1,422 @@
<?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' => ''),
),
'ConfigPriority' => 0,
'Hooks' => Array (
Array (
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'adm', //self
'HookToSpecial' => '*',
'HookToEvent' => Array('OnRebuildThemes'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnAfterRebuildThemes',
),
Array (
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => '',
'HookToSpecial' => '*',
'HookToEvent' => Array('OnAfterConfigRead'),
'DoPrefix' => 'cdata',
'DoSpecial' => '*',
'DoEvent' => 'OnDefineCustomFields',
),
),
'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 ('IsMenu'), // 'Status'
'TitleField' => 'Name',
'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' => 'catalog/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',
- 'CatalogTabIcon' => 'icon16_cat.gif',
+ 'CatalogTabIcon' => 'icon16_folder.gif',
'TitlePresets' => Array (
'default' => Array (
'new_status_labels' => Array ('c' => '!la_title_Adding_Page!'), // la_title_Adding_Category
'edit_status_labels' => Array ('c' => '!la_title_Editing_Page!'), // la_title_Editing_Category
),
'category_list' => Array ('prefixes' => Array ('c_List'), 'format' => "!la_title_Categories! (#c_recordcount#)"),
'catalog' => Array ('prefixes' => Array ('c_List'), 'format' => "<span id='category_path'>!la_title_Categories!</span>"),
'advanced_view' => Array ('prefixes' => Array ('c_List'), 'format' => "!la_title_AdvancedView!"),
'reviews' => Array ('prefixes' => Array (), 'format' => "!la_title_Reviews!"),
'review_edit' => Array ('prefixes' => Array (), 'format' => "!la_title_Editing_Review!"),
'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_related_searches' => Array ('prefixes' => Array ('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_RelatedSearches!"),
'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' => ''),
'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#",
),
'related_searches_edit' => Array (
'prefixes' => Array ('c', 'c-search'),
'new_status_labels' => Array ('c-search' => "!la_title_Adding_RelatedSearch_Keyword!"),
'edit_status_labels' => Array ('c-search' => '!la_title_Editing_RelatedSearch_Keyword!'),
'format' => "#c_status# '#c_titlefield#' - #c-search_status#",
),
'edit_content' => Array ('format' => '!la_EditingContent!'),
'tree_site' => Array ('format' => '!la_selecting_categories!'),
),
'EditTabPresets' => Array (
'Default' => Array (
'general' => Array ('title' => 'la_tab_General', 't' => 'categories/categories_edit', 'priority' => 1),
'properties' => Array ('title' => 'la_tab_Properties', 't' => 'categories/categories_edit_properties', 'priority' => 2),
'relations' => Array ('title' => 'la_tab_Relations', 't' => 'categories/categories_edit_relations', 'priority' => 3),
'related_searches' => Array ('title' => 'la_tab_Related_Searches', 't' => 'categories/categories_edit_related_searches', 'priority' => 4),
'images' => Array ('title' => 'la_tab_Images', 't' => 'categories/categories_edit_images', 'priority' => 5),
'permissions' => Array ('title' => 'la_tab_Permissions', 't' => 'categories/categories_edit_permissions', 'priority' => 6),
'custom' => Array ('title' => 'la_tab_Custom', 't' => 'categories/categories_edit_custom', 'priority' => 7),
),
),
'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' => 'catalog/catalog', 'pass' => 'm'),
'late_load' => Array ('t' => 'categories/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' => 'catalog/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' => '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.'Images img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
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-search','c-img', 'c-cdata', 'c-perm', 'content'),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('Priority' => 'desc', 'Name' => 'asc'),
)
),
'CalculatedFields' => Array (
'' => Array (
'CurrentSort' => "REPLACE(ParentPath, CONCAT('|', ".'%1$s'.".CategoryId, '|'), '')",
'SameImages' => 'img.SameImages',
'LocalThumb' => 'img.LocalThumb',
'ThumbPath' => 'img.ThumbPath',
'ThumbUrl' => 'img.ThumbUrl',
'LocalImage' => 'img.LocalImage',
'LocalPath' => 'img.LocalPath',
'FullUrl' => 'img.Url',
)
),
'CacheModRewrite' => true,
'Fields' => Array (
'CategoryId' => Array ('type' => 'int', 'not_null' => 1,'default' => 0),
'Type' => Array ('type' => 'int', 'not_null' => 1,'default' => 0),
'SymLinkCategoryId' => Array ('type' => 'int', 'default' => NULL),
'ParentId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'not_null' => 1,'default' => 0, 'required' => 1),
'Name' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'format'=>'no_default', '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', 'format'=>'no_default', 'default' => null),
'CreatedOn' => Array ('type' => 'int', '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' => 1),
'Priority' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => 0),
'MetaKeywords' => Array ('type' => 'string', 'default' => null),
'CachedDescendantCatsQty' => Array ('type' => 'int', 'default' => 0),
'CachedNavbar' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'default' => null),
'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), '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' => null),
'ParentPath' => Array ('type' => 'string', 'default' => null),
'TreeLeft' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'TreeRight' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'NamedParentPath' => Array ('type' => 'string', 'default' => null),
'MetaDescription' => Array ('type' => 'string', 'default' => null),
'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', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), '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),
'CachedTemplate' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
// fields from Pages
'Template' => Array (
'type' => 'string',
'formatter' => 'kOptionsFormatter', 'options_sql' => ' SELECT CONCAT(tf.Description, " (", TRIM(TRAILING ".des" FROM TRIM(TRAILING ".tpl" FROM FileName) ), ")") AS Title,
CONCAT(FilePath, "/", TRIM(TRAILING ".tpl" FROM FileName)) AS Value
FROM ' . TABLE_PREFIX . 'ThemeFiles AS tf
LEFT JOIN ' . TABLE_PREFIX . 'Theme AS t ON t.ThemeId = tf.ThemeId
WHERE (t.Enabled = 1) AND (tf.FileName NOT LIKE "%%.elm.tpl") AND (tf.FilePath = "/designs")',
'option_key_field' => 'Value', 'option_title_field' => 'Title',
/*'required' => 1,*/ 'default' => null
),
'UseExternalUrl' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1,
'not_null' => 1, 'default' => 0
),
'ExternalUrl' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
'UseMenuIconUrl' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1,
'not_null' => 1, 'default' => 0
),
'MenuIconUrl' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
'Title' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'format'=>'no_default', 'default' => '', 'not_null'=>1),
'MenuTitle' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'format'=>'no_default', 'not_null' => 1, 'default' => ''),
'MetaTitle' => Array ('type' => 'string', 'default' => null),
'IndexTools' => Array ('type' => 'string', 'default' => null),
'IsIndex' =>
Array (
'type' => 'int', 'not_null' => 1, 'default' => 0,
'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_Regular', 1 => 'la_CategoryIndex', 2 => 'la_Container'), 'use_phrases' => 1,
),
'IsMenu' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Show', 0 => 'la_Hide'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
'IsSystem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_System', 0 => 'la_Regular'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'FormId' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array ('' => ''),
'options_sql' => 'SELECT Title, FormId FROM '.TABLE_PREFIX.'Forms ORDER BY Title',
'option_key_field' => 'FormId', 'option_title_field' => 'Title',
'default' => 0
),
'FormSubmittedTemplate' => Array ('type' => 'string', 'default' => null),
'Translated' => Array ('type' => 'int', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'default' => 0, 'db_type' => 'tinyint', 'index_type' => 'int'),
'FriendlyURL' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
'ThemeId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
),
'VirtualFields' => Array (
'CurrentSort' => Array('type' => 'string', 'default' => ''),
'IsNew' => Array('type' => 'int', 'default' => 0),
'OldPriority' => Array('type' => 'int', 'default' => 0),
// for primary image
'SameImages' => Array('type' => 'string', 'default' => ''),
'LocalThumb' => Array('type' => 'string', 'default' => ''),
'ThumbPath' => Array('type' => 'string', 'default' => ''),
'ThumbUrl' => Array('type' => 'string', 'default' => ''),
'LocalImage' => Array('type' => 'string', 'default' => ''),
'LocalPath' => Array('type' => 'string', 'default' => ''),
'FullUrl' => Array('type' => 'string', 'default' => ''),
),
'Grids' => Array(
'Default' => Array (
'Icons' => Array(1 => 'icon16_folder.gif', 0 => 'icon16_folder-red.gif'),
'Fields' => Array(
'CategoryId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ),
'Name' => Array( 'title'=>'la_col_PageTitle', 'data_block' => 'page_browse_td', 'filter_block' => 'grid_like_filter'),
'Modified_formatted' => Array( 'title'=>'la_col_Modified', 'sort_field' => 'Modified', 'filter_block' => 'grid_date_range_filter' ),
'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter' ),
'IsMenu' => Array( 'title'=>'la_col_Visible', 'filter_block' => 'grid_options_filter' ),
'IsSystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', ),
'Priority' => Array( 'title'=>'la_col_Priority', 'filter_block' => 'grid_options_filter', ),
),
),
'Radio' => Array (
'Selector' => 'radio',
'Icons' => Array(1 => 'icon16_folder.gif', 0 => 'icon16_folder-red.gif'),
'Fields' => Array(
'CategoryId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_radio_td', 'filter_block' => 'grid_range_filter', ),
'Name' => Array( 'title'=>'la_col_PageTitle', 'data_block' => 'page_browse_td', 'filter_block' => 'grid_like_filter'),
'Modified_formatted' => Array( 'title'=>'la_col_Modified', 'sort_field' => 'Modified', 'filter_block' => 'grid_date_range_filter' ),
'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter' ),
'IsMenu' => Array( 'title'=>'la_col_Visible', 'filter_block' => 'grid_options_filter' ),
'IsSystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', ),
'Priority' => Array( 'title'=>'la_col_Priority', 'filter_block' => 'grid_options_filter', ),
),
),
'Structure' => Array (
'Icons' => Array(1 => 'icon16_folder.gif', 0 => 'icon16_folder-red.gif'),
'Fields' => Array(
'CategoryId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ),
'Name' => Array( 'title'=>'la_col_PageTitle', 'data_block' => 'page_browse_td', 'filter_block' => 'grid_like_filter'),
'Modified_formatted' => Array( 'title'=>'la_col_Modified', 'sort_field' => 'Modified', 'filter_block' => 'grid_date_range_filter' ),
'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter' ),
'IsMenu' => Array( 'title'=>'la_col_Visible', 'filter_block' => 'grid_options_filter' ),
'Path' => Array( 'title'=>'la_col_Path', 'data_block' => 'page_entercat_td', 'filter_block' => 'grid_like_filter' ),
'IsSystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', ),
'Priority' => Array( 'title'=>'la_col_Priority', 'filter_block' => 'grid_options_filter', ),
),
),
),
'ConfigMapping' => Array (
'PerPage' => 'Perpage_Category',
'ShortListPerPage' => 'Perpage_Category_Short',
'DefaultSorting1Field' => 'Category_Sortfield',
'DefaultSorting2Field' => 'Category_Sortfield2',
'DefaultSorting1Dir' => 'Category_Sortorder',
'DefaultSorting2Dir' => 'Category_Sortorder2',
),
);
\ No newline at end of file
Property changes on: branches/RC/core/units/categories/categories_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.66.2.15
\ No newline at end of property
+1.66.2.16
\ No newline at end of property
Index: branches/RC/core/units/themes/themes_config.php
===================================================================
--- branches/RC/core/units/themes/themes_config.php (revision 11545)
+++ branches/RC/core/units/themes/themes_config.php (revision 11546)
@@ -1,123 +1,123 @@
<?php
$config = Array(
'Prefix' => 'theme',
'ItemClass' => Array('class'=>'ThemeItem','file'=>'theme_item.php','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'ThemesEventHandler','file'=>'themes_eh.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'ThemesTagProcessor','file'=>'themes_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'Hooks' => Array(),
'QueryString' => Array(
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'ThemeId',
'StatusField' => Array('Enabled', 'PrimaryTheme'),
'PermSection' => Array('main' => 'in-portal:configure_themes'),
'Sections' => Array (
'in-portal:configure_themes' => Array (
'parent' => 'in-portal:system',
'icon' => 'conf_themes',
'label' => 'la_tab_Themes',
'url' => Array('t' => 'themes/themes_list', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 3,
'type' => stTREE,
),
),
'TitleField' => 'Name',
'TitlePresets' => Array (
'default' => Array (
'new_status_labels' => Array('theme' => '!la_title_Adding_Theme!'),
'edit_status_labels' => Array('theme' => '!la_title_Editing_Theme!'),
'new_titlefield' => Array('theme' => '!la_title_NewTheme!'),
),
'themes_list' => Array('prefixes' => Array('theme_List'), 'format' => "!la_tab_Themes!"),
'themes_edit_general' => Array('prefixes' => Array('theme'), 'format' => "#theme_status# '#theme_titlefield#' - !la_title_General!"),
- 'themes_edit_files' => Array('prefixes' => Array('theme', 'theme-file_List'), 'format' => "#theme_status# '#theme_titlefield#' - !la_title_ThemeFiles! (#theme-file_recordcount#)"),
+ 'themes_edit_files' => Array('prefixes' => Array('theme', 'theme-file_List'), 'format' => "#theme_status# '#theme_titlefield#' - !la_title_ThemeFiles!"),
),
'EditTabPresets' => Array (
'Default' => Array (
'general' => Array ('title' => 'la_tab_General', 't' => 'themes/themes_edit', 'priority' => 1),
'files' => Array ('title' => 'la_tab_Files', 't' => 'themes/themes_edit_files', 'priority' => 2),
),
),
'TableName' => TABLE_PREFIX.'Theme',
'SubItems' => Array('theme-file'),
'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 %1$s.* %2$s
FROM %s
LEFT JOIN '.TABLE_PREFIX.'Stylesheets st ON st.StylesheetId = %1$s.StylesheetId'),
'ItemSQLs' => Array ( '' => ' SELECT %1$s.* %2$s
FROM %s
LEFT JOIN '.TABLE_PREFIX.'Stylesheets st ON st.StylesheetId = %1$s.StylesheetId'),
'ListSortings' => Array (
'' => Array(
'Sorting' => Array('Name' => 'asc'),
)
),
'CalculatedFields' => Array (
'' => Array (
'StyleName' => 'st.Name',
'LastCompiled' => 'st.LastCompiled',
),
),
'Fields' => Array(
'ThemeId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'Name' => Array('type' => 'string','not_null' => 1, 'required' => 1, 'default' => ''),
'Enabled' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1=>'la_Enabled', 0=>'la_Disabled'), 'use_phrases'=>1, 'not_null' => 1, 'default' => 1),
'Description' => Array('type' => 'string','default' => null),
'PrimaryTheme' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'CacheTimeout' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'StylesheetId' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Stylesheets', 'option_key_field' => 'StylesheetId', 'option_title_field' => 'Name', 'not_null' => 1, 'default' => 0),
),
'VirtualFields' => Array (
'StyleName' => Array ('type' => 'string', 'default' => ''),
'LastCompiled' => Array ('type' => 'int', 'default' => null),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_custom.gif', '1_1' => 'icon16_theme_primary.gif', '1_0' => 'icon16_theme.gif', '0_0' => 'icon16_theme_disabled.gif'),
'Fields' => Array(
'ThemeId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
'Name' => Array( 'title'=>'la_col_Name', 'filter_block' => 'grid_like_filter'),
'Description' => Array( 'title'=>'la_col_Description', 'filter_block' => 'grid_like_filter'),
'Enabled' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
// 'PrimaryTheme' => Array( 'title'=>'la_col_Primary', 'filter_block' => 'grid_options_filter'),
),
),
),
);
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/themes/themes_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.17.2.5
\ No newline at end of property
+1.17.2.6
\ No newline at end of property
Index: branches/RC/core/units/statistics/statistics_config.php
===================================================================
--- branches/RC/core/units/statistics/statistics_config.php (revision 11545)
+++ branches/RC/core/units/statistics/statistics_config.php (revision 11546)
@@ -1,65 +1,65 @@
<?php
$config = Array(
'Prefix' => 'stat',
'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array('class' => 'StatisticsEventHandler', 'file' => 'statistics_event_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array('class' => 'StatisticsTagProcessor', 'file' => 'statistics_tag_processor.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
-
+
'IDField' => 'StatItemId',
-
+
'TitleField' => 'ListLabel',
-
+
'TitlePresets' => Array(
- 'statistics_list' => Array('prefixes' => Array('stat_List'), 'format' => "!la_title_Statistics! (#stat_recordcount#)"),
+ 'statistics_list' => Array('prefixes' => Array('stat_List'), 'format' => "!la_title_Statistics!"),
),
-
+
'TableName' => TABLE_PREFIX.'StatItem',
'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('Priority' => 'asc'),
)
),
-
+
'Fields' => Array(
'StatItemId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'Module' => Array('type' => 'string','not_null' => '1','default' => ''),
'ValueSQL' => Array('type' => 'string','default' => null),
'ResetSQL' => Array('type' => 'string','default' => null),
'ListLabel' => Array('type' => 'string','not_null' => 1, 'default' => ''),
'Priority' => Array('type' => 'int','not_null' => 1, 'default' => 0),
'AdminSummary' => Array('type' => 'int','not_null' => 1, 'default' => 0),
),
-
+
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default' => 'icon16_custom.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'),
),
),
-
-
+
+
),
);
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/statistics/statistics_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.3.2.1
\ No newline at end of property
Index: branches/RC/core/units/mailing_lists/mailing_lists_config.php
===================================================================
--- branches/RC/core/units/mailing_lists/mailing_lists_config.php (revision 11545)
+++ branches/RC/core/units/mailing_lists/mailing_lists_config.php (revision 11546)
@@ -1,122 +1,122 @@
<?php
$config = Array (
'Prefix' => 'mailing-list',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'MailingListEventHandler', 'file' => 'mailing_list_eh.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'MailingListTagProcessor', 'file' => 'mailing_list_tp.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array (
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'RegularEvents' => Array (
'generate_mailing_queue' => Array ('EventName' => 'OnGenerateEmailQueue', 'RunInterval' => 1800, 'Type' => reAFTER),
'process_mailing_queue' => Array ('EventName' => 'OnProcessEmailQueue', 'RunInterval' => 1800, 'Type' => reAFTER),
),
'IDField' => 'MailingId',
'TableName' => TABLE_PREFIX . 'MailingLists',
'TitlePresets' => Array (
'default' => Array (
'new_status_labels' => Array ('mailing-list' => '!la_title_AddingMailingList!'),
'edit_status_labels' => Array ('mailing-list' => '!la_title_ViewingMailingList!'),
),
- 'mailing_list_list' => Array ('prefixes' => Array ('mailing-list_List'), 'format' => "!la_title_MailingLists! (#mailing-list_recordcount#)"),
+ 'mailing_list_list' => Array ('prefixes' => Array ('mailing-list_List'), 'format' => "!la_title_MailingLists!"),
'mailing_list_edit' => Array ('prefixes' => Array ('mailing-list'), 'format' => "#mailing-list_status#"),
),
'PermSection' => Array('main' => 'in-portal:mailing_lists'),
'Sections' => Array (
'in-portal:mailing_folder' => Array (
'parent' => 'in-portal:users',
'icon' => 'custom',
'label' => 'la_title_MailingLists',
'permissions' => Array (),
'priority' => 3.1,
'type' => stTREE,
),
'in-portal:mailing_lists' => Array (
'parent' => 'in-portal:mailing_folder',
'icon' => 'custom',
'label' => 'la_title_MailingLists',
'url' => Array('t' => 'mailing_lists/mailing_list_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 1,
'type' => stTAB,
),
),
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s FROM %1$s',
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('MailingId' => 'desc'),
)
),
'Fields' => Array (
'MailingId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'PortalUserId' => Array(
'type' => 'int',
'formatter' => 'kLEFTFormatter',
'options' => Array (-1 => 'root'),
'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,
),
'To' => Array ('type' => 'string', 'required' => 1, 'default' => NULL),
'ToParsed' => Array ('type' => 'string', 'default' => NULL),
'Attachments' => Array (
'type' => 'string',
'formatter' => 'kUploadFormatter', 'upload_dir' => ITEM_FILES_PATH, 'max_size' => 50000000,
'multiple' => 10, 'direct_links' => true, 'file_types' => '*.*', 'files_description' => 'All Files',
'default' => NULL
),
'Subject' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'required' => 1, 'default' => ''),
'MessageText' => Array ('type' => 'string', 'default' => NULL),
'MessageHtml' => Array ('type' => 'string', 'default' => NULL),
'Status' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_NotProcessed', 2 => 'la_opt_PartiallyProcessed', 3 => 'la_opt_Processed', 4 => 'la_opt_Cancelled'), 'use_phrases' => 1,
'not_null' => 1, 'required' => 1, 'default' => 1
),
'EmailsQueued' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'EmailsSent' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'EmailsTotal' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array ('default' => 'icon16_custom.gif'),
'Fields' => Array (
'MailingId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ),
'Subject' => Array ('title' => 'la_col_Subject', 'filter_block' => 'grid_like_filter', ),
'MessageText' => Array ('title' => 'la_col_MessageText', 'filter_block' => 'grid_like_filter', 'cut_first' => 100),
'MessageHtml' => Array ('title' => 'la_col_MessageHtml', 'filter_block' => 'grid_like_filter', 'cut_first' => 100),
'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter',),
'EmailsQueued' => Array ('title' => 'la_col_EmailsQueued', 'filter_block' => 'grid_range_filter',),
'EmailsSent' => Array ('title' => 'la_col_EmailsSent', 'filter_block' => 'grid_range_filter',),
'EmailsTotal' => Array ('title' => 'la_col_EmailsTotal', 'filter_block' => 'grid_range_filter',),
),
),
),
);
\ No newline at end of file
Property changes on: branches/RC/core/units/mailing_lists/mailing_lists_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.1
\ No newline at end of property
+1.1.2.2
\ No newline at end of property
Index: branches/RC/core/units/users/users_config.php
===================================================================
--- branches/RC/core/units/users/users_config.php (revision 11545)
+++ branches/RC/core/units/users/users_config.php (revision 11546)
@@ -1,333 +1,333 @@
<?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,
'ConfigPriority' => 0,
'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',
),
Array (
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => '',
'HookToSpecial' => '*',
'HookToEvent' => Array('OnAfterConfigRead'),
'DoPrefix' => 'cdata',
'DoSpecial' => '*',
'DoEvent' => 'OnDefineCustomFields',
),
Array (
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'adm',
'HookToSpecial' => '*',
'HookToEvent' => Array('OnStartup'),
'DoPrefix' => '',
'DoSpecial' => '*',
'DoEvent' => 'OnAutoLoginUser',
),
// Captcha processing
Array (
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => '',
'HookToSpecial' => '*',
'HookToEvent' => Array('OnAfterConfigRead'),
'DoPrefix' => 'captcha',
'DoSpecial' => '*',
'DoEvent' => 'OnPrepareCaptcha',
),
/*Array (
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => '',
'HookToSpecial' => '*',
'HookToEvent' => Array('OnBeforeItemCreate'),
'DoPrefix' => 'captcha',
'DoSpecial' => '*',
'DoEvent' => 'OnValidateCode',
),*/
),
'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' => '#url#',
'url' => Array('t' => 'users/users_list', 'pass' => 'm,u', 'u_event' => 'OnSetFilterPattern', 'u_filters' => 'show_active=0,show_pending=1,show_disabled=0'),
'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!'),
),
'users_list' => Array (
'prefixes' => Array ('u_List'), 'format' => "!la_title_Users!",
'toolbar_buttons' => Array ('new_user', 'edit', 'delete', 'approve', 'decline', 'e-mail', 'export', 'view'),
),
'users_edit' => Array ('prefixes' => Array ('u'), 'format' => "#u_status# #u_titlefield#"),
'user_edit_images' => Array ('prefixes' => Array ('u', 'u-img_List'), 'format' => "#u_status# '#u_titlefield#' - !la_title_Images!"),
'user_edit_groups' => Array ('prefixes' => Array ('u', 'u-ug_List'), 'format' => "#u_status# '#u_titlefield#' - !la_title_Groups!"),
'user_edit_items' => Array ('prefixes' => Array ('u'), 'format' => "#u_status# '#u_titlefield#' - !la_title_Items!"),
'user_edit_custom' => Array ('prefixes' => Array ('u'), 'format' => "#u_status# '#u_titlefield#' - !la_title_Custom!"),
'admin_list' => Array ('prefixes' => Array ('u.admins_List'), 'format' => "!la_title_Administrators!"),
'admins_edit' => Array ('prefixes' => Array ('u'), 'format' => "#u_status# #u_titlefield#"),
'regular_users_list' => Array ('prefixes' => Array ('u.regular_List'), 'format' => "!la_title_Users!"),
'root_edit' => Array ('prefixes' => Array ('u'), 'format' => "!la_title_Editing_User! 'root'"),
'user_edit_group' => Array (
'prefixes' => Array ('u', 'u-ug'),
'edit_status_labels' => Array ('u-ug' => '!la_title_EditingMembership!'),
'format' => "#u_status# '#u_titlefield#' - #u-ug_status# '#u-ug_titlefield#'",
),
'user_image_edit' => Array (
'prefixes' => Array ('u', 'u-img'),
'new_status_labels' => Array ('u-img' => '!la_title_Adding_Image!'),
'edit_status_labels' => Array ('u-img' => '!la_title_Editing_Image!'),
'new_titlefield' => Array ('u-img' => '!la_title_New_Image!'),
'format' => "#u_status# '#u_titlefield#' - #u-img_status# '#u-img_titlefield#'",
),
'user_select' => Array ('prefixes' => Array ('u_List'), 'format' => "!la_title_Users! - !la_title_SelectUser!"),
'group_user_select' => Array ('prefixes' => Array ('u.group_List'), 'format' => "!la_title_Users! - !la_title_SelectUser!"),
'tree_users' => Array('format' => '!la_section_overview!'),
),
'EditTabPresets' => Array (
'Default' => Array (
'general' => Array ('title' => 'la_tab_General', 't' => 'users/users_edit', 'priority' => 1),
'groups' => Array ('title' => 'la_tab_Groups', 't' => 'users/users_edit_groups', 'priority' => 2),
'images' => Array ('title' => 'la_tab_Images', 't' => 'users/user_edit_images', 'priority' => 3),
'items' => Array ('title' => 'la_tab_Items', 't' => 'users/user_edit_items', 'priority' => 4),
'custom' => Array ('title' => 'la_tab_Custom', 't' => 'users/users_edit_custom', 'priority' => 5),
),
'Admins' => Array (
'general' => Array ('title' => 'la_tab_General', 't' => 'users/admins_edit', 'priority' => 1),
'groups' => Array ('title' => 'la_tab_Groups', 't' => 'users/admins_edit_groups', 'priority' => 2),
),
),
'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',
'online' => ' SELECT %1$s.* %2$s FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'UserSession s ON s.PortalUserId = %1$s.PortalUserId
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', 'u-img', 'fav', 'user-profile'),
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array('show_active','show_disabled','show_pending'), 'type' => WHERE_FILTER),
),
'Filters' => Array(
'show_active' => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
)
),
'CalculatedFields' => Array(
'' => Array(
'PrimaryGroup' => 'g.Name',
'FullName' => 'CONCAT(FirstName, " ", LastName)',
),
),
'Fields' => Array
(
'PortalUserId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'Login' => Array('type' => 'string', 'unique'=>Array('Login'), 'default' => null,'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', 'not_null' => 1, 'default' => ''),
'LastName' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
'Company' => Array('type' => 'string','not_null' => '1','default' => ''),
'Email' => Array('type' => 'string', 'formatter'=>'kFormatter', 'regexp'=>'/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', '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#'),
'Phone' => Array('type' => 'string','default' => null),
'Fax' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
'Street' => Array('type' => 'string', 'default' => null),
'Street2' => Array('type' => 'string', 'not_null' => '1', 'default' => ''),
'City' => Array('type' => 'string','default' => null),
'State' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter',
'options' => Array(),
'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
'not_null' => '1','default' => ''),
'Zip' => Array('type' => 'string','default' => null),
'Country' => Array('type' => 'string', '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', 'default' => null),
'tz' => Array('type' => 'int','default' => 0),
'ip' => Array('type' => 'string','default' => null),
'IsBanned' => Array('type' => 'int','not_null' => 1, 'default' => 0),
'PassResetTime' => Array('type' => 'int','default' => null),
'PwResetConfirm' => Array('type' => 'string','default' => null),
'PwRequestTime' => Array('type' => 'int','default' => null),
'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' => 1800),
),
'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('') ),
'FullName' => Array ('type' => 'string', 'default' => ''),
'UserGroup' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %1$s FROM ' . TABLE_PREFIX . 'PortalGroup WHERE Enabled = 1 AND FrontRegistration = 1', 'option_key_field' => 'GroupId', 'option_title_field' => 'Name',
'not_null' => 1, 'default' => 0,
),
),
'Grids' => Array(
// not in use
'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'),
+ 'Login' => Array('title' => 'la_col_Username', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_like_filter'),
+ 'LastName' => Array( 'title'=>'la_col_LastName', 'filter_block' => 'grid_like_filter'),
+ 'FirstName' => Array( 'title'=>'la_col_FirstName', 'filter_block' => 'grid_like_filter'),
+ 'Email' => Array( 'title'=>'la_col_Email', 'filter_block' => 'grid_like_filter'),
+ 'PrimaryGroup' => Array( 'title'=>'la_col_PrimaryGroup', 'filter_block' => 'grid_options_filter'),
+ 'CreatedOn' => Array('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter'),
),
),
// used
'UserSelector' => Array(
'Icons' => Array(0 => 'icon16_user_disabled.gif', 1 => 'icon16_user.gif', 2 => 'icon16_user_pending.gif'),
'Selector' => 'radio',
'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'),
+ 'Login' => Array('title' => 'la_col_Username', 'data_block' => 'grid_login_td', 'filter_block' => 'grid_like_filter'),
+ 'LastName' => Array( 'title'=>'la_col_LastName', 'filter_block' => 'grid_like_filter'),
+ 'FirstName' => Array( 'title'=>'la_col_FirstName', 'filter_block' => 'grid_like_filter'),
+ 'Email' => Array( 'title'=>'la_col_Email', 'filter_block' => 'grid_like_filter'),
+ 'PrimaryGroup' => Array( 'title'=>'la_col_PrimaryGroup', 'filter_block' => 'grid_options_filter'),
+ 'CreatedOn' => Array('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter'),
),
),
// used
'Admins' => Array (
'Icons' => Array(0 => 'icon16_user_disabled.gif', 1 => 'icon16_user.gif', 2 => 'icon16_user_pending.gif'),
'Fields' => Array (
'PortalUserId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60),
'Login' => Array ('title' => 'la_col_Username', 'filter_block' => 'grid_like_filter', 'width'=>100),
'FirstName' => Array ('title' => 'la_col_FirstName', 'filter_block' => 'grid_like_filter', 'width'=>100),
'LastName' => Array ('title' => 'la_col_LastName', 'filter_block' => 'grid_like_filter', 'width'=>150),
'Email' => Array ('title' => 'la_col_Email', 'filter_block' => 'grid_like_filter', 'width'=>140),
),
),
// used
'RegularUsers' => Array (
'Icons' => Array(0 => 'icon16_user_disabled.gif', 1 => 'icon16_user.gif', 2 => 'icon16_user_pending.gif'),
'Fields' => Array(
'PortalUserId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60),
'Login' => Array ('title' => 'la_col_Username', 'filter_block' => 'grid_like_filter', 'width'=>100),
'FirstName' => Array ('title' => 'la_col_FirstName', 'filter_block' => 'grid_like_filter', 'width'=>100),
'LastName' => Array ('title' => 'la_col_LastName', 'filter_block' => 'grid_like_filter', 'width'=>150),
'Email' => Array ('title' => 'la_col_Email', 'filter_block' => 'grid_like_filter', 'width'=>140),
'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width'=>100),
),
),
),
);
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/users/users_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.40.2.19
\ No newline at end of property
+1.40.2.20
\ No newline at end of property
Index: branches/RC/core/units/stop_words/stop_words_config.php
===================================================================
--- branches/RC/core/units/stop_words/stop_words_config.php (revision 11545)
+++ branches/RC/core/units/stop_words/stop_words_config.php (revision 11546)
@@ -1,73 +1,73 @@
<?php
$config = Array (
'Prefix' => 'stop-word',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'kDBEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array (
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'StopWordId',
'TableName' => TABLE_PREFIX.'StopWords',
'TitleField' => 'StopWord',
'TitlePresets' => Array (
'default' => Array (
'new_status_labels' => Array ('stop-word' => '!la_title_AddingStopWord!'),
'edit_status_labels' => Array ('stop-word' => '!la_title_EditingStopWord!'),
),
- 'stop_word_list' => Array ('prefixes' => Array ('stop-word_List'), 'format' => "!la_title_StopWords! (#stop-word_recordcount#)"),
+ 'stop_word_list' => Array ('prefixes' => Array ('stop-word_List'), 'format' => "!la_title_StopWords!"),
'stop_word_edit' => Array ('prefixes' => Array ('stop-word'), 'format' => "#stop-word_status# '#stop-word_titlefield#'"),
),
'PermSection' => Array('main' => 'in-portal:stop_words'),
'Sections' => Array (
'in-portal:stop_words' => Array (
'parent' => 'in-portal:system',
'icon' => 'custom',
'label' => 'la_title_StopWords',
'url' => Array('t' => 'stop_words/stop_word_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 3.3,
'type' => stTREE,
),
),
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s FROM %1$s',
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('StopWord' => 'asc'),
)
),
'Fields' => Array (
'StopWordId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'StopWord' => Array ('type' => 'string', 'unique' => Array (), 'max_len' => 255, 'required' => 1, 'not_null' => 1, 'default' => ''),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array ('default' => 'icon16_custom.gif'),
'Fields' => Array (
'StopWordId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ),
'StopWord' => Array ('title' => 'la_col_StopWord', 'filter_block' => 'grid_like_filter',),
),
),
),
);
\ No newline at end of file
Property changes on: branches/RC/core/units/stop_words/stop_words_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.1
\ No newline at end of property
+1.1.2.2
\ No newline at end of property
Index: branches/RC/core/units/groups/groups_config.php
===================================================================
--- branches/RC/core/units/groups/groups_config.php (revision 11545)
+++ branches/RC/core/units/groups/groups_config.php (revision 11546)
@@ -1,129 +1,129 @@
<?php
$config = Array (
'Prefix' => 'g',
'ItemClass' => Array ('class' => 'GroupsItem', 'file' => 'groups_item.php', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'GroupsEventHandler', 'file' => 'groups_event_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'GroupTagProcessor', 'file' => 'group_tp.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array (
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'GroupId',
'StatusField' => Array ('Enabled'),
'TitleField' => 'Name',
'SubItems' => Array ('g-perm', 'g-ug'),
'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' => ''),
),
'group_list' => Array ('prefixes' => Array ('g.total_List'), 'format' => "!la_title_Groups!"),
'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_users' => Array ('prefixes' => Array ('g', 'g-ug_List'), 'format' => "#g_status# '#g_titlefield#' - !la_title_Users!" ),
'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!" ),
'select_group' => Array('prefixes' => Array ('g.user_List'), 'format' => "!la_title_Groups! - !la_title_SelectGroup!"),
),
'EditTabPresets' => Array (
'Default' => Array (
'general' => Array ('title' => 'la_tab_General', 't' => 'groups/groups_edit', 'priority' => 1),
'users' => Array ('title' => 'la_tab_Users', 't' => 'groups/groups_edit_users', 'priority' => 2),
'permissions' => Array ('title' => 'la_tab_Permissions', 't' => 'groups/groups_edit_permissions', 'priority' => 3),
),
),
'PermSection' => Array ('main' => 'in-portal:user_groups'),
'TableName' => TABLE_PREFIX.'PortalGroup',
'ListSQLs' => Array (
'' => 'SELECT %1$s.* %2$s FROM %1$s',
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('Name' => 'asc'),
),
),
'CalculatedFields' => Array (
'total' => Array (
'UserCount' => 'SELECT COUNT(*) FROM ' . TABLE_PREFIX . 'UserGroup ug WHERE ug.GroupId = %1$s.GroupId',
),
),
'Fields' => Array (
'GroupId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Name' => Array ('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
'Description' => Array ('type' => 'string', 'default' => null),
'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', '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),
'FrontRegistration' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
'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', 'filter_block' => 'grid_range_filter'),
'Name' => Array ('title' => 'la_col_GroupName'),
'UserCount' => Array ('title' => 'la_col_UserCount', 'filter_block' => 'grid_range_filter'),
'FrontRegistration' => Array ('title' => 'la_col_FrontRegistration', 'filter_block' => 'grid_options_filter'),
),
),
'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', 'filter_block' => 'grid_range_filter'),
'Name' => Array ('title' => 'la_col_GroupName'),
),
),
'Radio' => Array (
'Icons' => Array (1 => 'icon16_group.gif', 0 => 'icon16_group_disabled.gif'),
'Selector' => 'radio',
'Fields' => Array (
'GroupId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_radio_td', 'filter_block' => 'grid_range_filter'),
'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', 'filter_block' => 'grid_range_filter'),
'Name' => Array ('title' => 'la_col_GroupName'),
'Description' => Array ('title' => 'la_col_Description'),
),
),
),
);
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/groups/groups_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.21.2.5
\ No newline at end of property
+1.21.2.6
\ No newline at end of property
Index: branches/RC/core/units/email_queue/email_queue_config.php
===================================================================
--- branches/RC/core/units/email_queue/email_queue_config.php (revision 11545)
+++ branches/RC/core/units/email_queue/email_queue_config.php (revision 11546)
@@ -1,82 +1,82 @@
<?php
$config = Array (
'Prefix' => 'email-queue',
'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'kDBEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'EmailQueueTagProcessor', 'file' => 'email_queue_tp.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array (
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'EmailQueueId',
'TableName' => TABLE_PREFIX . 'EmailQueue',
'TitlePresets' => Array (
- 'email_queue_list' => Array ('prefixes' => Array('email-queue_List'), 'format' => '!la_tab_EmailQueue! (#email-queue_recordcount#)',),
+ 'email_queue_list' => Array ('prefixes' => Array('email-queue_List'), 'format' => '!la_tab_EmailQueue!',),
),
'PermSection' => Array ('main' => 'in-portal:email_queue'),
'Sections' => Array (
'in-portal:email_queue' => Array (
'parent' => 'in-portal:mailing_folder',
'icon' => 'email_log',
'label' => 'la_tab_EmailQueue',
'url' => Array('t' => 'logs/email_logs/email_queue_list', 'pass' => 'm'),
'permissions' => Array ('view', 'delete'),
'priority' => 2,
'type' => stTAB,
),
),
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s FROM %1$s',
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('Queued' => 'desc'),
)
),
'Fields' => Array (
'EmailQueueId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'ToEmail' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
'Subject' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
'MessageHeaders' => Array ('type' => 'string', 'default' => NULL),
'MessageBody' => Array ('type' => 'string', 'default' => NULL),
'Queued' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1, 'default' => 0),
'SendRetries' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'LastSendRetry' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1, 'default' => 0),
'MailingId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array ('default' => 'icon16_custom.gif'),
'Fields' => Array (
'EmailQueueId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter',),
'ToEmail' => Array ('title' => 'la_prompt_AddressTo', 'filter_block' => 'grid_like_filter', ),
'Subject' => Array ('title' => 'la_col_Subject', 'filter_block' => 'grid_like_filter', ),
'MessageHeaders' => Array ('title' => 'la_col_MessageHeaders', 'data_block' => 'grid_headers_td', 'filter_block' => 'grid_like_filter', ),
'Queued' => Array ('title' => 'la_col_Queued', 'filter_block' => 'grid_date_range_filter', ),
'SendRetries' => Array ('title' => 'la_col_SendRetries', 'filter_block' => 'grid_range_filter', ),
'LastSendRetry' => Array ('title' => 'la_col_LastSendRetry', 'filter_block' => 'grid_date_range_filter', ),
'MailingId' => Array ('title' => 'la_col_MailingList', 'filter_block' => 'grid_range_filter', ),
),
),
),
'ConfigMapping' => Array(
'PerPage' => 'Perpage_EmailsL',
),
);
\ No newline at end of file
Property changes on: branches/RC/core/units/email_queue/email_queue_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.4
\ No newline at end of property
+1.1.2.5
\ No newline at end of property
Index: branches/RC/core/units/languages/languages_config.php
===================================================================
--- branches/RC/core/units/languages/languages_config.php (revision 11545)
+++ branches/RC/core/units/languages/languages_config.php (revision 11546)
@@ -1,204 +1,204 @@
<?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'=>''),
),
- 'languages_list' => Array( 'prefixes' => Array('lang_List'), 'format' => "!la_title_Configuration! - !la_title_LanguagePacks! (#lang_recordcount#)"),
+ 'languages_list' => Array( 'prefixes' => Array('lang_List'), 'format' => "!la_title_Configuration! - !la_title_LanguagePacks!"),
'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#)"),
+ 'phrases_list' => Array( 'prefixes' => Array('lang','phrases_List'), 'format' => "#lang_status# '#lang_titlefield#' - !la_title_Labels!"),
'phrase_edit' => Array (
'prefixes' => Array('phrases'),
'new_status_labels' => Array('phrases'=>'!la_title_Adding_Phrase!'),
'edit_status_labels' => Array('phrases' => '!la_title_Editing_Phrase!'),
'format' => "#phrases_status# '#phrases_titlefield#'"
),
'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(), 'format' => "!la_title_ExportLanguagePackResults!"),
- 'events_list' => Array( 'prefixes' => Array('lang','emailevents_List'), 'format' => "#lang_status# '#lang_titlefield#' - !la_title_EmailEvents! (#emailevents_recordcount#)"),
+ 'events_list' => Array( 'prefixes' => Array('lang','emailevents_List'), 'format' => "#lang_status# '#lang_titlefield#' - !la_title_EmailEvents!"),
'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' => ''),
'format' => "#lang_status# '#lang_titlefield#' - !la_title_EditingEmailEvent! '#emailmessages_titlefield#'"),
),
'EditTabPresets' => Array (
'Default' => Array (
'general' => Array ('title' => 'la_tab_General', 't' => 'regional/languages_edit', 'priority' => 1),
'labels' => Array ('title' => 'la_tab_Labels', 't' => 'regional/languages_edit_phrases', 'priority' => 2),
'email_events' => Array ('title' => 'la_tab_EmailEvents', 't' => 'regional/languages_edit_email_events', 'priority' => 3),
),
),
'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 ('Priority' => 'desc', 'PackName' => 'asc'),
),
),
'Fields' => Array(
'LanguageId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'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', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'AdminInterfaceLang' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'IconURL' => Array('type' => 'string','default' => null),
'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' => 'mm/dd/yyyy', 'd/m/Y' => 'dd/mm/yyyy', 'm.d.Y' => 'mm.dd.yyyy', 'd.m.Y' => 'dd.mm.yyyy'), '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, 'required' => 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),
'FilenameReplacements' => Array('type' => 'string'),
'Locale' => Array('type' => 'string','not_null' => 1, 'default' => 'en-US', 'formatter' => 'kOptionsFormatter',
'options' => Array('' => ''),
'options_sql' => "SELECT CONCAT(LocaleName, ' ' ,'\/',Locale,'\/') AS name, Locale FROM ".TABLE_PREFIX."LocalesList ORDER BY LocaleId", 'option_title_field' => "name", 'option_key_field' => 'Locale',
),
'UserDocsUrl' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
),
'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(
'LanguageId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
'PackName' => Array ('title' => 'la_col_PackName',),
'LocalName' => Array ('title' => 'la_col_LocalName'),
'Enabled' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter'),
'PrimaryLang' => Array ('title' => 'la_col_IsPrimary', 'filter_block' => 'grid_options_filter'),
'AdminInterfaceLang' => Array ('title' => 'la_col_AdminInterfaceLang', 'filter_block' => 'grid_options_filter'),
),
),
),
);
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/languages/languages_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.27.2.8
\ No newline at end of property
+1.27.2.9
\ No newline at end of property
Index: branches/RC/core/units/ban_rules/ban_rules_config.php
===================================================================
--- branches/RC/core/units/ban_rules/ban_rules_config.php (revision 11545)
+++ branches/RC/core/units/ban_rules/ban_rules_config.php (revision 11546)
@@ -1,107 +1,107 @@
<?php
$config = Array (
'Prefix' => 'ban-rule',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'kDBEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array (
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'RuleId',
'TableName' => TABLE_PREFIX.'BanRules',
'TitleField' => 'ItemValue',
'TitlePresets' => Array (
'default' => Array (
'new_status_labels' => Array ('ban-rule' => '!la_title_AddingBanRule!'),
'edit_status_labels' => Array ('ban-rule' => '!la_title_EditingBanRule!'),
),
- 'ban_rule_list' => Array ('prefixes' => Array ('ban-rule_List'), 'format' => "!la_tab_BanList! (#ban-rule_recordcount#)"),
+ 'ban_rule_list' => Array ('prefixes' => Array ('ban-rule_List'), 'format' => "!la_tab_BanList!"),
'ban_rule_edit' => Array ('prefixes' => Array ('ban-rule'), 'format' => "#ban-rule_status# '#ban-rule_titlefield#'"),
),
'PermSection' => Array('main' => 'in-portal:user_banlist'),
'Sections' => Array (
'in-portal:user_banlist' => Array (
'parent' => 'in-portal:users',
'icon' => 'banlist',
'label' => 'la_tab_BanList',
'url' => Array('t' => 'ban_rules/ban_rule_list', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 7,
'type' => stTREE,
),
),
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s FROM %1$s',
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('Priority' => 'desc'),
)
),
'Fields' => Array (
'RuleId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'RuleType' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0, 'use_phrases' => 1, 'formatter'=>'kOptionsFormatter', 'options'=>Array(
0 => 'la_opt_Deny',
// 1 => 'la_opt_Allow'
)
),
'ItemField' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL, 'use_phrases' => 1, 'formatter'=>'kOptionsFormatter', 'options'=>Array(
'ip' => 'la_opt_IP_Address',
'Login' => 'la_opt_Username',
'Email' => 'la_opt_Email',
'FirstName' => 'la_opt_FirstName',
'LastName' => 'la_opt_LastName',
'Address' => 'la_opt_Address',
'City' => 'la_opt_City',
'State' => 'la_opt_State',
'Zip' => 'la_opt_Zip',
'Phone' => 'la_opt_Phone',
)
),
'ItemVerb' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0, 'use_phrases' => 1, 'formatter'=>'kOptionsFormatter', 'options'=>Array(
1 => 'la_opt_Exact',
3 => 'la_opt_Sub-match'
)
),
'ItemValue' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'required'=>1, 'default' => ''),
'ItemType' => Array ('type' => 'int', 'not_null' => 1, 'default' => 6),
'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Status' => Array ('type' => 'int', 'not_null' => 1, 'default' => 1, 'use_phrases' => 1, 'formatter'=>'kOptionsFormatter', 'options'=>Array(
1 => 'la_Enabled',
0 => 'la_Disabled'
)
),
'ErrorTag' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array ('default' => 'icon16_custom.gif'),
'Fields' => Array (
'RuleId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ),
'RuleType' => Array ('title' => 'la_col_RuleType', 'filter_block' => 'grid_options_filter', ),
'ItemField' => Array ('title' => 'la_col_ItemField', 'filter_block' => 'grid_options_filter', ),
'ItemVerb' => Array ('title' => 'la_col_FieldComparision', 'filter_block' => 'grid_options_filter', ),
'ItemValue' => Array ('title' => 'la_col_FieldValue', 'filter_block' => 'grid_like_filter', ),
'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', ),
),
),
),
);
\ No newline at end of file
Property changes on: branches/RC/core/units/ban_rules/ban_rules_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.6
\ No newline at end of property
+1.1.2.7
\ No newline at end of property
Index: branches/RC/core/units/general/general_config.php
===================================================================
--- branches/RC/core/units/general/general_config.php (revision 11545)
+++ branches/RC/core/units/general/general_config.php (revision 11546)
@@ -1,37 +1,38 @@
<?php
$config = Array(
'Prefix' => 'm',
'EventHandlerClass' => Array('class' => 'MainEventHandler', 'file' => 'main_event_handler.php', 'build_event' => 'OnBuild'),
/*'TagProcessorClass' => Array('class'=>'kMainTagProcessor','file'=>'','build_event'=>'OnBuild'),*/
'QueryString' => Array(
1 => 'cat_id',
2 => 'cat_page',
3 => 'lang',
4 => 'theme',
5 => 'opener',
6 => 'wid',
),
'TitleField' => 'CachedNavbar',
'TitlePhrase' => 'la_Text_Category',
+ 'CatalogTabIcon' => 'icon16_folder.gif',
'ItemType' => 1,
'TableName' => TABLE_PREFIX.'Category',
'CatalogItem' => true,
'PortalStyleEnv' => true,
'PermTabText' => 'In-Portal',
'PermSection' => Array('search' => 'in-portal:configuration_search', 'custom' => 'in-portal:configuration_custom'),
'RegisterClasses' => Array(
Array('class'=>'InpCustomFieldsHelper','pseudo'=>'InpCustomFieldsHelper','file'=>'custom_fields.php','build_event'=>'','require_classes'=>'kHelper'),
Array('class'=>'kCountryStatesHelper','pseudo'=>'CountryStatesHelper','file'=>'country_states.php','build_event'=>'','require_classes'=>'kHelper'),
Array('class'=>'kBracketsHelper','pseudo'=>'BracketsHelper','file'=>'brackets.php','build_event'=>'','require_classes'=>'kHelper'),
Array('class'=>'kXMLHelper','pseudo'=>'kXMLHelper','file'=>'xml_helper.php','build_event'=>'','require_classes'=>'kHelper'),
),
);
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/general/general_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.11
\ No newline at end of property
+1.11.2.1
\ No newline at end of property
Index: branches/RC/core/admin_templates/agents/agent_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/agents/agent_edit.tpl (revision 11545)
+++ branches/RC/core/admin_templates/agents/agent_edit.tpl (revision 11546)
@@ -1,90 +1,90 @@
<inp2:adm_SetPopupSize width="550" height="400"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:agents" prefix="agent" title_preset="agent_edit"/>
<!-- 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('agent', '<inp2:agent_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
cancel_edit('agent', 'OnCancelEdit','<inp2:agent_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('agent', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('agent', '<inp2:agent_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('agent', '<inp2:agent_NextId/>');
}
) );
a_toolbar.Render();
<inp2:m_if check="agent_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="agent_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="agent_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:agent_SaveWarning name="grid_save_warning"/>
<inp2:agent_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="inp_id_label" prefix="agent" field="AgentId" title="la_fld_Id"/>
<inp2:m_if check="agent_Field" name="AgentType" equals_to="1" db="db">
<inp2:m_RenderElement name="inp_edit_box" prefix="agent" field="AgentName" title="la_fld_Name"/>
<inp2:m_RenderElement name="inp_label" prefix="agent" field="AgentType" title="la_fld_Type" has_empty="1"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="agent" field="Status" title="la_fld_Status" has_empty="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="agent" field="Event" title="la_fld_Event"/>
<inp2:m_else/>
<inp2:m_RenderElement name="inp_label" prefix="agent" field="AgentName" title="la_fld_Name"/>
<inp2:m_RenderElement name="inp_label" prefix="agent" field="AgentType" title="la_fld_Type" has_empty="1"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="agent" field="Status" title="la_fld_Status" has_empty="1"/>
<inp2:m_RenderElement name="inp_label" prefix="agent" field="Event" title="la_fld_Event"/>
</inp2:m_if>
<inp2:m_RenderElement name="inp_edit_box" prefix="agent" field="RunInterval" title="la_fld_RunInterval"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="agent" field="RunMode" title="la_fld_RunMode" has_empty="1"/>
<inp2:m_RenderElement name="inp_label" prefix="agent" field="LastRunOn" title="la_fld_LastRunOn"/>
<inp2:m_RenderElement name="inp_label" prefix="agent" field="LastRunStatus" title="la_fld_LastRunStatus"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="agent" field="NextRunOn" title="la_fld_NextRunOn"/>
<inp2:m_RenderElement name="inp_label" prefix="agent" field="RunTime" title="la_fld_RunTime"/>
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
-<inp2:m_include t="incs/footer"/>
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/agents/agent_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.4
\ No newline at end of property
+1.1.2.5
\ No newline at end of property
Index: branches/RC/core/admin_templates/no_permission.tpl
===================================================================
--- branches/RC/core/admin_templates/no_permission.tpl (revision 11545)
+++ branches/RC/core/admin_templates/no_permission.tpl (revision 11546)
@@ -1,63 +1,70 @@
+<inp2:m_Set m_wid="1"/>
<inp2:m_include t="incs/header"/>
<inp2:m_Set skip_last_template="1"/>
-<inp2:m_RenderElement name="section_header" icon="icon46_banlist" title="!la_title_NoPermissions!"/>
-
<inp2:m_RenderElement name="blue_bar" prefix="adm" title_preset="no_permissions" module="in-portal" icon="icon46_banlist"/>
<!-- 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('prev', '<inp2:m_phrase label="la_ToolTip_Back" escape="1"/>',
function() {
if (getWindowOpener(window) != null) {
window_close();
}
else {
history.back();
}
} ) );
a_toolbar.Render();
<inp2:m_ifnot check="m_LoggedIn">
$(document).ready(
function () {
window.location.href = '<inp2:m_t t="index" expired="1" escape="1" no_amp="1" m_wid=""/>';
}
);
</inp2:m_ifnot>
+
+ $(document).ready(
+ function() {
+ Application.removeDebuggerStatistics();
+ maximizeElement('#permission_error');
+
+ $('#permission_error_container').css('background-color', '#F6F6F6');
+ }
+ );
</script>
</td>
</tr>
</tbody>
</table>
-<div id="scroll_container">
- <table class="edit-table">
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
- <td height="400" valign="middle" align="left">
- <center><b><inp2:m_Phrase name="la_text_NoPermission"/></b></center><br />
- <inp2:m_if check="m_IsDebugMode">
- <inp2:m_if check="m_GetEquals" name="from_template" value="1">
- Permissions Checked: <b><inp2:m_get name="perms"/></b><br />
- Template: <b><inp2:m_get name="next_template"/></b><br />
- Redirect From Tag: <b>yes</b><br />
- <inp2:m_else/>
- Section: <b><inp2:m_get name="section"/></b><br />
- Event: <b><inp2:m_get name="main_prefix"/>:<inp2:m_get name="event_name"/></b><br />
- Redirect From Tag: <b>no</b><br />
- </inp2:m_if></b><br />
- </inp2:m_if>
- </td>
- </tr>
- </table>
+<div id="permission_error" class="table-color1" style="bottom: 50%; text-align: center; vertical-align: middle;">
+ <br />
+ <strong><inp2:m_Phrase name="la_text_NoPermission"/></strong>
+ <inp2:m_if check="m_IsDebugMode">
+ <br /><br />
+ <div style="text-align: left;">
+ <inp2:m_if check="m_GetEquals" name="from_template" value="1">
+ Permissions Checked: <b><inp2:m_get name="perms"/></b><br />
+ Template: <b><inp2:m_get name="next_template"/></b><br />
+ Redirect From Tag: <b>yes</b><br />
+ <inp2:m_else/>
+ Section: <b><inp2:m_get name="section"/></b><br />
+ Event: <b><inp2:m_get name="main_prefix"/>:<inp2:m_get name="event_name"/></b><br />
+ Redirect From Tag: <b>no</b><br />
+ </inp2:m_if></b>
+ </div>
+ </inp2:m_if>
</div>
+<inp2:m_Set _force_popup="1"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/no_permission.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5.2.4
\ No newline at end of property
+1.5.2.5
\ No newline at end of property
Index: branches/RC/core/admin_templates/categories/categories_edit_permissions.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/categories_edit_permissions.tpl (revision 11545)
+++ branches/RC/core/admin_templates/categories/categories_edit_permissions.tpl (revision 11546)
@@ -1,201 +1,189 @@
<inp2:adm_SetPopupSize width="880" height="680"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" perm_section="CATEGORY" g[grid]="Radio" permission_type="VIEW" system_permission="0" title_preset="categories_permissions" tab_preset="Default"/>
<inp2:m_include template="catalog/catalog_elements"/>
<inp2:m_include t="categories/categories_tabs"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript" src="js/ajax.js"></script>
<script type="text/javascript" src="js/catalog.js"></script>
<script type="text/javascript">
Request.progressText = '<inp2:m_phrase name="la_title_Loading" escape="1"/>';
Catalog.prototype.AfterInit = function () {
Grids['g'].SelectFirst();
}
Catalog.prototype.go_to_group = function($group_id) {
if (!isset($group_id)) {
$group_id = 0; // gets current group
}
else {
set_hidden_field('current_group_id', $group_id);
}
this.switchTab(); // refresh current item tab
}
Catalog.prototype.refreshTab = function($prefix, $div_id, $force) {
var $group_id = get_hidden_field('current_group_id');
// alert('refreshTab. GroupID: '+$group_id);
var $tab_group_id = document.getElementById($div_id).getAttribute('group_id');
if ($group_id != $tab_group_id || $force) {
// query tab content only in case if not queried or category don't match
var $url = this.URLMask.replace('#ITEM_PREFIX#', $prefix).replace('#GROUP_ID#', $group_id);
this.BusyRequest[$prefix] = false;
Request.makeRequest($url, this.BusyRequest[$prefix], $div_id, this.successCallback, this.errorCallback, $div_id, this);
}
/*else {
alert('refresh disabled = {tab: '+this.ActivePrefix+'; group_id: '+$group_id+'}');
}*/
}
// adds information about tab to tab_registry
Catalog.prototype.registerTab = function($tab_id) {
var $tab = document.getElementById($tab_id + '_div');
var $index = this.TabRegistry.length;
this.TabRegistry[$index] = new Array();
this.TabRegistry[$index]['tab_id'] = $tab_id;
this.TabRegistry[$index]['prefix'] = $tab.getAttribute('prefix');
this.TabRegistry[$index]['dep_buttons'] = new Array();
this.TabRegistry[$index]['index'] = $index;
}
Catalog.prototype.displaySearch = function ($prefix) {
}
Catalog.prototype.submit_event = function($prefix_special, $event, $t) {
var $prev_template = get_hidden_field('t');
if (isset($event)) set_hidden_field('events[' + $prefix_special + ']', $event);
if (isset($t)) set_hidden_field('t', $t);
var $tab_id = this.queryTabRegistry('prefix', this.ActivePrefix, 'tab_id');
this.submit_kernel_form();
set_hidden_field('t', $prev_template);
}
var $PermManager = new Catalog('<inp2:m_Link template="categories/permissions_tab" item_prefix="#ITEM_PREFIX#" group_id="#GROUP_ID#" no_amp="1" pass="m,c"/>', 'permmanager_', 0);
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('c','<inp2:c_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('c','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('c', '<inp2:c_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('c', '<inp2:c_NextId/>');
}
) );
function edit(){ }
a_toolbar.Render();
<inp2:m_if check="c_IsSingle">
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="c_IsLast">
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="c_IsFirst">
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="g" grid="Radio"/>
</tr>
</tbody>
</table>
<inp2:c_SaveWarning name="grid_save_warning"/>
<inp2:m_RenderElement name="grid" PrefixSpecial="g" IdField="GroupId" per_page="-1" grid="Radio" header_block="grid_column_title_no_sorting" grid_height="220" grid_status="0"/>
<br />
<!-- 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="$PermManager.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_param name="title"/>
- </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:adm_ListCatalogTabs render_as="item_tab" title_property="PermTabText"/>
- </tr>
-</table>
+<inp2:m_DefineElement name="item_tab" title="" special="">
+ <td class="tab-spacer"><img src="img/spacer.gif" width="3" height="1"/></td>
+ <td id="<inp2:m_param name="prefix"/><inp2:m_param name="special"/>_tab" class="tab">
+ <img src="<inp2:m_TemplatesBase module='$icon_module'/>/img/itemicons/<inp2:m_Param name='icon'/>" width="16" height="16" align="absmiddle" alt=""/>
+ <a href="#" onclick="$PermManager.switchTab('<inp2:m_param name="prefix"/>'); return false;" class="tab-link">
+ <inp2:m_param name="title"/>
+ </a>
+ </td>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="permission_tabs">
+ <inp2:adm_ListCatalogTabs render_as="item_tab" title_property="PermTabText"/>
+</inp2:m_DefineElement>
+
+<inp2:m_RenderElement name="tabs_container" tabs_render_as="permission_tabs"/>
<!-- item tabs: end -->
<inp2:c-perm_PrintTabs template="categories/permissions_tab" tab_init="1"/>
<inp2:m_include t="incs/footer"/>
<script type="text/javascript">
Grids['g'].OnSelect = function ($id) {
$PermManager.go_to_group($id);
}
Grids['g'].OnUnSelect = function ($id) {
set_hidden_field('group_id', $id);
set_hidden_field('item_prefix', $PermManager.ActivePrefix);
$PermManager.submit_event('c', 'OnPreSave', 'categories/permissions_tab');
}
Grids['g'].SelectFirst = function () {
for (var $i in this.Items) {
this.Items[$i].Select();
break;
}
}
function update_light(perm_name, value)
{
document.getElementById('light_'+perm_name).src = 'img/perm_' + (value ? 'green' : 'red') + '.gif';
}
function inherited_click(perm_name, inherited_value, state, access_cb_id)
{
if (state) {
update_light(perm_name, inherited_value);
document.getElementById(access_cb_id).disabled = true;
}
else {
update_light(perm_name, document.getElementById(access_cb_id).checked)
document.getElementById(access_cb_id).disabled = false;
}
}
$(document).ready(
function() {
$PermManager.Init();
}
);
-</script>
-
+</script>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/categories/categories_edit_permissions.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.13.2.6
\ No newline at end of property
+1.13.2.7
\ No newline at end of property
Index: branches/RC/core/admin_templates/categories/permissions_tab.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/permissions_tab.tpl (revision 11545)
+++ branches/RC/core/admin_templates/categories/permissions_tab.tpl (revision 11546)
@@ -1,79 +1,77 @@
<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"/>);
+ maximizeElement( jq('#<inp2:m_get name="item_prefix"/>_div') );
}
+
<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
type="checkbox"
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
type="checkbox"
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>
- <div style="overflow: auto; height: 250px;">
- <div>
- <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>
- </div>
- </div>
+ <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: branches/RC/core/admin_templates/categories/permissions_tab.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.9.2.1
\ No newline at end of property
+1.9.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/custom_fields/custom_fields_list.tpl
===================================================================
--- branches/RC/core/admin_templates/custom_fields/custom_fields_list.tpl (revision 11545)
+++ branches/RC/core/admin_templates/custom_fields/custom_fields_list.tpl (revision 11546)
@@ -1,76 +1,76 @@
<inp2:m_include t="incs/header"/>
<inp2:m_Get name="section" result_to_var="section"/>
<inp2:m_RenderElement name="combined_header" prefix="cf" section="$section" perm_event="cf:OnLoad" title_preset="custom_fields_list" pagination="1"/>
<!-- 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('cf', 'custom_fields/custom_fields_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_New_CustomField" escape="1"/>',
function() {
std_precreate_item('cf', 'custom_fields/custom_fields_edit')
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('cf')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
<inp2:m_if check="m_isDebugMode">
a_toolbar.AddButton( new ToolBarButton('clone', '<inp2:m_phrase label="la_ToolTip_Clone" escape="1"/>',
function() {
submit_event('cf', 'OnMassClone')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
</inp2:m_if>
a_toolbar.AddButton( new ToolBarButton('move_up', '<inp2:m_phrase label="la_ToolTip_MoveUp" escape="1"/>', function() {
submit_event('cf','OnMassMoveUp');
}
) );
a_toolbar.AddButton( new ToolBarButton('move_down', '<inp2:m_phrase label="la_ToolTip_MoveDown" escape="1"/>', function() {
submit_event('cf','OnMassMoveDown');
}
) );
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();
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_DefineElement name="cf_grid_data_td">
<inp2:Field field="$field" grid="$grid" no_special="no_special" as_label="1" />
</inp2:m_DefineElement>
-<inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" grid="Default" header_block="grid_column_title" data_block="grid_data_td" search="on"/>
+<inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" grid="Default"/>
<script type="text/javascript">
Grids['cf'].SetDependantToolbarButtons( new Array('edit','delete', 'clone', 'move_down', 'move_up') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/custom_fields/custom_fields_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5.2.3
\ No newline at end of property
+1.5.2.4
\ No newline at end of property
Index: branches/RC/core/admin_templates/users/user_edit_items.tpl
===================================================================
--- branches/RC/core/admin_templates/users/user_edit_items.tpl (revision 11545)
+++ branches/RC/core/admin_templates/users/user_edit_items.tpl (revision 11546)
@@ -1,174 +1,165 @@
<inp2:adm_SetPopupSize width="720" height="500"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" prefix="u" title_preset="user_edit_items" tab_preset="Default"/>
<inp2:m_include template="catalog/catalog_elements"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<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="js/ajax.js"></script>
<script type="text/javascript" src="js/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"/>';
Catalog.prototype.AfterInit = function () {
this.switchTab(); // refresh current item tab
}
/*Catalog.prototype.refreshTab = function($prefix, $div_id, $force) {
// query tab content only in case if not queried or category don't match
var $cat_id = get_hidden_field('m_cat_id');
var $tab_cat_id = document.getElementById($div_id).getAttribute('category_id');
if ($cat_id != $tab_cat_id || $force) {
var $url = this.URLMask.replace('#TEMPLATE_NAME#', this.queryTabRegistry('prefix', $prefix, 'module_path') + '/user_item_tab');
this.BusyRequest[$prefix] = false;
Request.makeRequest($url, this.BusyRequest[$prefix], $div_id, this.successCallback, this.errorCallback, $div_id, this);
}
}*/
var $Catalog = new Catalog('<inp2:m_Link template="#TEMPLATE_NAME#" pass_through="ts" ts="user" pass="m,u" no_amp="1"/>', 'useritems_', 0);
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('u','<inp2:u_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('u','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('u', '<inp2:u_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('u', '<inp2:u_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
var $template = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'view_template');
$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';
set_hidden_field('remove_specials[' + $Catalog.ActivePrefix + '.user]', 1);
std_delete_items($Catalog.ActivePrefix, $template, 1);
} ) );
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');
}
) );
function edit() {
$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';
var $kf = document.getElementById($form_name);
var $prev_action = $kf.action;
$kf.action = '<inp2:m_t pass="all" no_pass_through="1"/>';
set_hidden_field('remove_specials[' + $Catalog.ActivePrefix + ']', 1);
std_edit_item($Catalog.ActivePrefix, $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'edit_template'));
$kf.action = $prev_action;
}
a_toolbar.Render();
<inp2:m_if check="u_IsSingle">
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="u_IsLast">
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="u_IsFirst">
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
<inp2:m_RenderElement name="catalog_search_box"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="kernel_form_end"/>
<inp2:u_SaveWarning name="grid_save_warning"/>
<inp2:u_ErrorWarning name="form_error_warning"/>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <inp2:m_RenderElement name="subsection" title="la_section_General"/>
- <inp2:m_RenderElement name="inp_id_label" prefix="u" field="PortalUserId" title="!la_fld_Id!"/>
- <inp2:m_RenderElement name="inp_label" prefix="u" field="Login" title="la_fld_Username"/>
- <inp2:m_RenderElement name="subsection" title="la_section_Items"/>
-</table>
+<div id="scroll_container" mode="minimal">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" title="la_section_General"/>
+ <inp2:m_RenderElement name="inp_id_label" prefix="u" field="PortalUserId" title="!la_fld_Id!"/>
+ <inp2:m_RenderElement name="inp_label" prefix="u" field="Login" title="la_fld_Username"/>
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ <inp2:m_RenderElement name="subsection" title="la_section_Items"/>
+ </table>
+</div>
<br />
<!-- 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"/>.user_tab" cellpadding="0" cellspacing="0" width="100%" class="catalog-tab-unselected" onclick="$Catalog.switchTab('<inp2:m_param name="prefix"/>.user');">
- <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"/>.user_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="item_tab" title="" special=".user">
+ <td class="tab-spacer"><img src="img/spacer.gif" width="3" height="1"/></td>
+ <td id="<inp2:m_param name="prefix"/><inp2:m_param name="special"/>_tab" class="tab">
+ <img src="<inp2:m_TemplatesBase module='$icon_module'/>/img/itemicons/<inp2:m_Param name='icon'/>" width="16" height="16" align="absmiddle" alt=""/>
+ <a href="#" onclick="$Catalog.switchTab('<inp2:m_param name="prefix"/><inp2:m_Param name="special"/>'); return false;" class="tab-link">
+ <inp2:m_Phrase name="$title"/> <span class="cats_stats" style="color: inherit;">(<span id="<inp2:m_param name="prefix"/><inp2:m_Param name="special"/>_item_count">?</span>)</span>
+ </a>
+ </td>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="permission_tabs">
+ <inp2:m_ModuleInclude template="user_item_tab" tab_init="2" title_property="ViewMenuPhrase" skip_prefixes="m,adm,cms"/>
+</inp2:m_DefineElement>
- <inp2:m_ModuleInclude template="user_item_tab" tab_init="2" title_property="ViewMenuPhrase" skip_prefixes="m,adm,cms"/>
- </tr>
-</table>
+<inp2:m_RenderElement name="tabs_container" tabs_render_as="permission_tabs"/>
<!-- item tabs: end -->
<inp2:m_set ts="user"/>
<inp2:m_ModuleInclude template="user_item_tab" tab_init="1" skip_prefixes="m,adm,cms"/>
<script type="text/javascript">
addLoadEvent(
function() {
$Catalog.Init();
}
);
</script>
<inp2:m_include t="incs/footer" noform="yes"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/users/user_edit_items.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.3
\ No newline at end of property
+1.1.2.4
\ No newline at end of property
Index: branches/RC/core/admin_templates/logs/visits/visits_list.tpl
===================================================================
--- branches/RC/core/admin_templates/logs/visits/visits_list.tpl (revision 11545)
+++ branches/RC/core/admin_templates/logs/visits/visits_list.tpl (revision 11546)
@@ -1,68 +1,68 @@
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="visits" section="in-portal:visits" title_preset="visits_list" pagination="1"/>
<!-- 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();
function edit()
{
}
a_toolbar.AddButton( new ToolBarButton('refresh', '<inp2:m_phrase label="la_ToolTip_Refresh" escape="1"/>', function() {
window.location.href = window.location.href;
}
) );
a_toolbar.AddButton( new ToolBarButton('reset', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
std_delete_items('visits');
}
) );
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>
<inp2:m_RenderElement name="search_main_toolbar" prefix="visits" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_DefineElement name="grid_userlink_td">
<inp2:m_if check="UserFound" user_field="$user_field">
- <a href="<inp2:UserLink user_field="$user_field"/>" title="<inp2:m_phrase name="la_Edit_User"/>"><inp2:Field field="$field" grid="$grid"/></a>
+ <a href="<inp2:UserLink edit_template='users/users_edit' user_field="$user_field"/>" onclick="return direct_edit('<inp2:m_Param name="PrefixSpecial"/>', this.href);" title="<inp2:m_phrase name="la_Edit_User"/>"><inp2:Field field="$field" grid="$grid"/></a>
<inp2:m_else/>
<inp2:Field field="$field" grid="$grid"/>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_referer_td">
<div style="overflow: hidden">
<inp2:m_if check="FieldEquals" field="$field" value="">
<span style="white-space: nowrap;"><inp2:m_Phrase label="la_visit_DirectReferer"/></span>
<inp2:m_else/>
<a href="<inp2:Field field="$field" grid="$grid"/>"><inp2:Field field="$field" grid="$grid" /></a>
</inp2:m_if>
</div>
</inp2:m_DefineElement>
<inp2:adm_SaveReturnScript/>
-<inp2:m_RenderElement name="grid" PrefixSpecial="visits" IdField="VisitId" grid="Default" header_block="grid_column_title" data_block="grid_data_td" search="on" grid_filters="1"/>
+<inp2:m_RenderElement name="grid" PrefixSpecial="visits" IdField="VisitId" grid="Default" grid_filters="1"/>
<script type="text/javascript">
Grids['visits'].SetDependantToolbarButtons( new Array('reset') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/logs/visits/visits_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.16.2.2
\ No newline at end of property
+1.16.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/js/script.js
===================================================================
--- branches/RC/core/admin_templates/js/script.js (revision 11545)
+++ branches/RC/core/admin_templates/js/script.js (revision 11546)
@@ -1,1673 +1,1752 @@
if ( !( isset($init_made) && $init_made ) ) {
var Application = new kApplication();
var Grids = new Array();
var GridScrollers = 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 unload_legal = 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
replaceFireBug();
}
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 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, $ajax)
{
submit_event($prefix_special,'OnResetSorting', null, null, $ajax);
}
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 set_refresh_interval($prefix_special, $refresh_interval, $ajax)
{
set_form($prefix_special, $ajax);
set_hidden_field('refresh_interval', $refresh_interval);
submit_event($prefix_special, 'OnSetAutoRefreshInterval', null, null, $ajax);
}
function submit_event(prefix_special, event, t, form_action, $ajax)
{
if (!Application.processHooks(prefix_special + ':' + event)) {
return false;
}
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();
// reset remove special mark (otherwise all future events will have special removed too)
set_hidden_field('remove_specials[' + prefix_special + ']', null);
}
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;
unload_legal = true; // bug: when opening new popup from this window, then this window is not refreshed and this mark stays forever
var $form = document.getElementById($form_name);
if (typeof $form.onsubmit == 'function') {
$form.onsubmit();
}
$form.submit();
$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, $before_callback)
{
var $window_name = 'select_' + t.replace(/(\/|-)/g, '_');
var $options = {
onAfterShow: function () {
getFrame('main').initTranslatorOnAfterShow(prefix, field, t, multi_line, $before_callback);
}
};
openwin('', $window_name, 750, 400, $options);
}
function initTranslatorOnAfterShow(prefix, field, t, multi_line, $before_callback) {
var $popup_window = $('#' + TB.getId('TB_iframeContent')).get(0).contentWindow;
if (!$.isFunction($popup_window.onLoad)) {
// iframe onload happens on frame content change too -> don't react on it
return ;
}
var $window_name = 'select_' + t.replace(/(\/|-)/g, '_');
$popup_window.onLoad();
$popup_window.name = $window_name;
TB.setWindowMetaData('window_name', $window_name); // used to simulate window.opener functionality
var $opener = getWindowOpener($popup_window);
var $prev_opener = get_hidden_field('m_opener');
$opener.set_hidden_field('m_opener', 'p');
$opener.set_hidden_field('translator_wnd_name', $window_name);
$opener.set_hidden_field('translator_field', field);
$opener.set_hidden_field('translator_t', t);
$opener.set_hidden_field('translator_prefixes', prefix);
$opener.set_hidden_field('translator_multi_line', isset(multi_line) ? multi_line : 0);
if ($.isFunction($before_callback)) {
$before_callback($opener);
}
$opener.document.getElementById($opener.$form_name).target = $window_name;
var split_prefix = prefix.split(',');
$opener.submit_event(split_prefix[0], 'OnPreSaveAndOpenTranslator');
$opener.set_hidden_field('m_opener', $prev_opener);
}
function PreSaveAndOpenTranslator(prefix, field, t, multi_line)
{
InitTranslator(prefix, field, t, multi_line);
}
function PreSaveAndOpenTranslatorCV(prefix, field, t, resource_id, multi_line)
{
InitTranslator(
prefix, field, t, multi_line,
function ($opener) {
$opener.set_hidden_field('translator_resource_id', resource_id);
}
);
}
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, $options)
{
var $settings = {
url: base_url + 'core/admin_templates/blank.html?width=' + $width + '&height=' + $height + '&TB_iframe=true&modal=true',
caption: 'Loading ...',
onAfterShow: function () {
getFrame('main').onAfterWindowOpen($url, $name);
}
};
if ($options !== undefined) {
$.extend($settings, $options);
}
if (window.name != 'main') {
// all popups are opened based on main frame
return getFrame('main').TB.show($settings);
}
TB.show($settings);
return ;
-
-
// 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 onAfterWindowOpen($url, $window_name) {
// this is always invoked from "main" frame
var $popup_window = $('#' + TB.getId('TB_iframeContent')).get(0).contentWindow;
if (!$.isFunction($popup_window.onLoad)) {
// iframe onload happens on frame content change too -> don't react on it
return ;
}
$popup_window.onLoad();
$popup_window.name = $window_name;
$popup_window.location.href = $url;
TB.setWindowMetaData('window_name', $window_name); // used to simulate window.opener functionality
}
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, $onAfterOpenPopup) {
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, $onAfterOpenPopup);
}
+
$pm.GetSize($t);
return ;
}
+
$window_size = $default_size;
}
$window_size = $window_size.split('x');
var $window_name = $t.replace(/(\/|-)/g, '_'); // replace "/" and "-" with "_"
var $options = {
onAfterShow: function () {
getFrame('main').onAfterOpenPopup($prefix_special, $event, $t);
if ($onAfterOpenPopup !== undefined && $.isFunction($onAfterOpenPopup)) {
$onAfterOpenPopup();
}
}
};
openwin('', $window_name, $window_size[0], $window_size[1], $options);
}
function onAfterOpenPopup($prefix_special, $event, $t) {
// this is always invoked from "main" frame
var $popup_window = $('#' + TB.getId('TB_iframeContent')).get(0).contentWindow;
if (!$.isFunction($popup_window.onLoad)) {
// iframe onload happens on frame content change too -> don't react on it
return ;
}
var $window_name = $t.replace(/(\/|-)/g, '_'); // replace "/" and "-" with "_"
$popup_window.onLoad();
$popup_window.name = $window_name;
TB.setWindowMetaData('window_name', $window_name); // used to simulate window.opener functionality
var $opener = getWindowOpener($popup_window);
if ($opener === null) {
// we are already in main window
$opener = window;
}
$opener.document.getElementById($opener.$form_name).target = $window_name;
var $prev_opener = $opener.opener_action('p');
event_bak = $opener.get_hidden_field('events[' + $prefix_special + ']')
if (!event_bak) {
event_bak = '';
}
$opener.submit_event($prefix_special, $event, $t);
$opener.opener_action($prev_opener); // restore opener in parent window
$opener.set_hidden_field('events[' + $prefix_special + ']', event_bak); // restore event
// AJAX popup size respoce is received after std_edit_item/std_precreate_item function exit
$opener.set_hidden_field($prefix_special + '_mode', null);
$opener.Application.processHooks($prefix_special + ':OnAfterOpenPopup');
}
function openSelector($prefix, $url, $dst_field, $window_size, $event)
{
// 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 = '';
}
Application.processHooks($prefix + ':OnBeforeOpenSelector');
// set variables need for selector to work
set_hidden_field('main_prefix', $prefix);
set_hidden_field('dst_field', $dst_field);
+// alert('openSelector(' + $prefix + ', ' + $event + ', ' + $t + ', ' + $window_size + ')');
open_popup(
$prefix, $event, $t, $window_size,
function() {
// restore form action back
$kf.action = $prev_action;
}
);
}
function translate_phrase($label, $template) {
set_hidden_field('phrases_label', $label);
open_popup('phrases', 'OnNew', $template);
}
function direct_edit($prefix_special, $url) {
if (use_popups($prefix_special, '')) {
openSelector($prefix_special, $url);
}
else {
redirect($url);
}
return false;
}
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);
}
// set_hidden_field(prefix_special+'_mode', '');
}
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);
}
}
function std_edit_item(prefix_special, edit_template, $onAfterOpenPopup)
{
set_hidden_field(prefix_special+'_mode', 't');
if (use_popups(prefix_special, 'OnEdit')) {
open_popup(prefix_special, 'OnEdit', edit_template, null, $onAfterOpenPopup);
}
else {
opener_action('d');
submit_event(prefix_special,'OnEdit',edit_template);
}
// set_hidden_field(prefix_special+'_mode', '');
}
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)
{
var phrase = phrases['la_Delete_Confirm'] ? phrases['la_Delete_Confirm'] : 'Are you sure you want to delete selected items?';
if (inpConfirm(phrase)) {
submit_event(prefix_special, 'OnMassDelete', t, null, $ajax);
}
}
function std_csv_export(prefix_special, grid, template)
{
set_hidden_field('PrefixSpecial', prefix_special);
set_hidden_field('grid', grid);
open_popup(prefix_special, '', template);
}
function std_csv_import(prefix_special, grid, template)
{
set_hidden_field('PrefixSpecial', prefix_special);
set_hidden_field('grid', grid);
if (use_popups(prefix_special, '')) {
open_popup(prefix_special, '', template);
}
else {
submit_event(prefix_special, '', template);
}
}
// 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, $has_id)
{
var $kf = document.getElementById($form_name);
var $field = $kf.elements[$field_id];
if ($value === null) {
if ($field) {
// alert('tag name on remove: ' + $field.parentNode.tagName);
$field.parentNode.removeChild($field); // bug: sometimes hidden fields are inside BODY tag in DOM model, why?
}
return true;
}
if ($field) {
$field.value = $value;
return true;
}
$field = document.createElement('INPUT');
$field.type = 'hidden';
$field.name = $field_id;
if (!isset($has_id) || $has_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.name != 'main') {
// traverse through real popups
$window = getFrame('main');
}
$window.top.document.title = (main_title.length ? main_title + ' - ' : '') + $title;
$window.TB.setWindowTitle($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 filter_toggle($row_id, $prefix) {
// var $row = $('#' + jq($row_id));
var $row = $('tr.to-range-filter');
var $hidden = $row.hasClass('hidden-filter');
if ($hidden) {
$('td', $row).show();
$row.removeClass('hidden-filter');
}
else {
$('td', $row).hide();
$row.addClass('hidden-filter');
}
// recalculate filter row heights/widths
var $grid = GridScrollers[$prefix];
$grid.UpdateColWidths();
if ($hidden && $grid.FiltersExpanded !== true) {
$grid.AdjustInputWidths();
$grid.FiltersExpanded = true;
}
// $grid.SetLeftHeights();
// $grid.UpdateTotalDimensions();
// $grid.SyncScroll();
// $grid.Resize( $grid.GetAutoSize() );
}
function RemoveTranslationLink($string, $escaped)
{
if (!isset($escaped)) $escaped = true;
if ($escaped) {
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(/,$/, '');
}
function update_multiple_options($hidden_id) {
var $select = document.getElementById($hidden_id + '_select');
var $result = '';
for (var $i = 0; $i < $select.options.length; $i++) {
if ($select.options[$i].selected) {
$result += $select.options[$i].value + '|';
}
}
document.getElementById($hidden_id).value = $result ? '|' + $result : '';
}
// related to lists operations (moving)
function move_selected($from_list, $to_list, $error_msg)
{
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(isset($error_msg) ? $error_msg : '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;
break;
}
}
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 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);
}
function setCookie($Name, $Value)
{
// set cookie
if (getCookie($Name) != $Value) {
document.cookie = $Name+'='+escape($Value);
}
}
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)) {
var d = new Date();
document.cookie = $Name + '=;expires=' + d.toGMTString() + ';' + ';';
}
}
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, is_phrase)
{
if (isset(is_phrase) && is_phrase) {
str = RemoveTranslationLink(str, false);
}
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
var $i = 0;
- while ($main_window.opener) {
+ var $opener;
+
+ do {
if ($i == 10) {
break;
}
- $main_window = $main_window.opener;
+ // get popup opener
+ $opener = $main_window.opener;
+
+ if (!$opener) {
+ // when no opener found, then try parent window
+ $opener = $main_window.parent;
+ }
+
+ if ($opener) {
+ $main_window = $opener;
+ }
+
$i++;
- }
+ } while ($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(RemoveTranslationLink(msg, true))) {
submit_event(prefix, event)
}
}
function cancel_edit(prefix, cancel_ev, save_ev, msg)
{
if ((!Form || (Form && Form.HasChanged)) && confirm(RemoveTranslationLink(msg, true))) {
submit_event(prefix, save_ev)
}
else {
submit_event(prefix, cancel_ev)
}
}
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)
{
if (num == '') return 0;
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;
}
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;
result.outerHeight = obj.clientHeight + border[0] + border[2];
result.outerWidth = obj.clientHeight + border[1] + border[3];
return result;
}
function findPos(obj, with_scroll) {
if (!with_scroll) var with_scroll = false;
var curleft = curtop = 0;
if (obj.offsetParent) {
// could raise "Unspecified error" in IE
curleft = obj.offsetLeft - (with_scroll ? obj.scrollLeft : 0)
curtop = obj.offsetTop - (with_scroll ? obj.scrollTop : 0)
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft - (with_scroll ? obj.scrollLeft : 0)
curtop += obj.offsetTop - (with_scroll ? obj.scrollTop : 0)
}
}
return [curleft,curtop];
}
+function scrollbarWidth() {
+ // Scrollbalken im Body ausschalten
+ var $overflow_backup = document.body.style.overflow;
+ document.body.style.overflow = 'hidden';
+
+ var width = document.body.clientWidth;
+
+ // Scrollbalken
+ document.body.style.overflow = 'scroll';
+ width -= document.body.clientWidth;
+
+ // Der IE im Standardmode
+ if (!width) {
+ width = document.body.offsetWidth - document.body.clientWidth;
+ }
+
+ // urspr?ngliche Einstellungen
+ document.body.style.overflow = $overflow_backup;
+
+ return width;
+}
+
+function maximizeElement($selector, $max_height) {
+ if ($max_height === undefined) {
+ $max_height = false;
+ }
+
+ var $element = $($selector);
+ if ($element.length == 0) {
+ return ;
+ }
+
+ $element.width('100%');
+
+ var $container_id = $element.attr('id') + '_container';
+ var $container = $( jq('#' + $container_id) );
+
+ if ($container.length == 0) {
+ // don't create same container twice
+
+ // all <script> tags will be executed again after wrap method is called, so remove them to prevent that
+ $('script', $element).remove();
+ $element.wrap('<div id="' + $container_id + '" style="position: relative; overflow: auto; width: 100%;"></div>');
+ $container = $( jq('#' + $container_id) );
+ }
+
+ var $offset_top = $container.offset().top;
+ var $window_height = $(window).height();
+
+ var $height_left = $window_height - $offset_top;
+
+ if (($max_height !== false) && ($max_height < $height_left)) {
+ $height_left = $max_height;
+ }
+
+ $height_left -= ($element.outerHeight() - $element.height());
+ $container.height($height_left);
+
+ var $element_width = $(window).width() - ($element.outerWidth() - $element.width());
+ if ( $height_left < $element.height() ) {
+ // needs vertical scrolling, so substract vertical scrollbar width
+ $element_width -= scrollbarWidth();
+ }
+
+ $element.width($element_width);
+}
+
function addEvent(el, evname, func, traditional) {
if (traditional) {
eval('el.on'+evname+'='+func);
return;
}
if (evname.match(/mousedown|mousemove|mouseup/)) {
$(el)
.unbind(evname) // don't allow more then one
.bind(evname, func);
return ;
}
if (is.ie) {
el.attachEvent("on" + evname, func);
} else {
el.addEventListener(evname, func, true);
}
};
/*function removeEvent(el, evname, func) {
if (is.ie) {
el.detachEvent('on' + evname, func);
} else {
el.removeEventListener(evname, func, true);
}
}*/
function addLoadEvent(func, wnd)
{
Application.setHook('m:OnAfterWindowLoad', func);
}
function replaceFireBug() {
if (window.console === undefined || !console.firebug) {
var names = [
'log', 'debug', 'info', 'warn', 'error', 'assert', 'dir', 'dirxml',
'group', 'groupEnd', 'time', 'timeEnd', 'count', 'trace', 'profile', 'profileEnd'
];
if (window.top.console !== undefined || window.top.firebug) {
// console is not defined in iframes, so define it here
window.console = window.top.console;
+ window._getFirebugConsoleElement = window.top._getFirebugConsoleElement;
}
else {
window.console = {};
for (var i = 0; i < names.length; ++i) {
window.console[names[i]] = function($msg) {
alert('FireBug console object methods are not available outside Firefox!' + "\n" + $msg);
}
}
}
}
}
function runOnChange(elId) {
var evt;
var el = typeof(elId) == 'string' ? document.getElementById(elId) : elId
if (document.createEvent) {
evt = document.createEvent("HTMLEvents");
evt.initEvent("change", true, false);
(evt) ? el.dispatchEvent(evt) : (el.onchange && el.onchange());
return;
}
if (el.fireEvent) {
el.fireEvent('onchange');
}
}
function WatchClosing(win, $url)
{
window.setTimeout(function() {
if (win.closed) {
var req = Request.getRequest();
var $ajax_mark = ($url.indexOf('?') ? '&' : '?') + 'ajax=yes';
req.open('GET', $url + $ajax_mark, false); //!!!SYNCRONIOUS!!! REQUEST (3rd param = false!!!)
req.send(null);
}
},
2000
)
}
function IterateUploaders($method) {
if (typeof UploadsManager != 'undefined') {
UploadsManager.iterate($method);
}
}
String.prototype.trim = function () {
return this.replace(/\s*((\S+\s*)*)/, "$1").replace(/((\s*\S+)*)\s*/, "$1");
}
String.prototype.toNumeric = function () {
return parseInt( this.replace(/(auto|medium)/, '0px').replace(/[a-z]/gi,'') );
}
function jq($selector) {
- return $selector.replace(/(\[|\])/g, '\\$1');
+ return $selector.replace(/(\[|\]|\.)/g, '\\$1');
}
function setHelpLink($user_docs_url, $title_preset) {
if (!$user_docs_url) {
return ;
}
$('#help_link', getFrame('head').document).attr('href', $user_docs_url + '/' + $title_preset);
}
// window management functions:
function getWindowOpener($window) {
// use this intead of "window.opener"
if ($window.name == 'main' || $window.name == 'main_frame') {
return null;
}
return getFrame('main').TB.findWindow($window.name, -1);
}
function window_close($close_callback) {
// use this instead of "window.close();"
if (window.name == 'main') {
return ;
}
if ($close_callback !== undefined) {
return getFrame('main').TB.remove(null, $close_callback);
}
return getFrame('main').TB.remove();
}
Property changes on: branches/RC/core/admin_templates/js/script.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.11.2.25
\ No newline at end of property
+1.11.2.26
\ No newline at end of property
Index: branches/RC/core/admin_templates/js/catalog.js
===================================================================
--- branches/RC/core/admin_templates/js/catalog.js (revision 11545)
+++ branches/RC/core/admin_templates/js/catalog.js (revision 11546)
@@ -1,408 +1,421 @@
function Catalog($url_mask, $cookie_prefix, $tab_shift) {
this.CookiePrefix = $cookie_prefix ? $cookie_prefix : '';
this.BusyRequest = new Array();
this.URLMask = $url_mask;
this.Separator = '#separator#';
this.ParentCategoryID = 0;
this.OnResponceMethod = null;
this.TabRegistry = new Array();
if (window.location.hash && window.location.hash.match(/^#tab-(.*)/)) {
// get active tab from anchor
this.ActivePrefix = RegExp.$1;
}
else {
// get active tab from cookie
this.ActivePrefix = getCookie(this.CookiePrefix + 'active_prefix');
}
this.PreviousPrefix = this.ActivePrefix;
this.TabByCategory = false; // preselect tab by category (used in catalog only)
$ViewMenus = new Array('c');
this.searchInfo = {}; // information about search (for each tab)
}
Catalog.prototype.Init = function () {
var $prefix = this.queryTabRegistry('prefix', this.ActivePrefix, 'prefix');
if ($prefix !== this.ActivePrefix && this.TabRegistry.length > 0) {
// ActivePrefix not set or has non-existing prefix value
this.ActivePrefix = this.TabRegistry[0]['prefix'];
}
this.SetAlternativeTabs();
this.AfterInit();
}
Catalog.prototype.AfterInit = function () {
this.go_to_cat();
}
Catalog.prototype.SetAlternativeTabs = function () {
// set alternative grids between all items (catalog is set when tab is loaded via AJAX first time)
var $i = 0;
while ($i < this.TabRegistry.length) {
// run through all prefixes
var $j = 0;
while ($j < this.TabRegistry.length) {
if (this.TabRegistry[$i]['prefix'] == this.TabRegistry[$j]['prefix']) {
$j++;
continue;
}
// and set alternative to all other prefixes
$GridManager.AddAlternativeGrid(this.TabRegistry[$i]['prefix'], this.TabRegistry[$j]['prefix']);
$j++;
}
$i++;
}
}
Catalog.prototype.submit_kernel_form = function($tab_id) {
var $prefix = 'dummy';
var $result_div = '';
if (isset($tab_id)) {
// responce result + progress are required
$prefix = this.queryTabRegistry('tab_id', $tab_id, 'prefix');
$result_div = $tab_id + '_div';
}
var $kf = document.getElementById($form_name);
Request.params = Request.serializeForm($kf);
Request.method = $kf.method.toUpperCase();
this.BusyRequest[$prefix] = false;
Request.makeRequest($kf.action, this.BusyRequest[$prefix], $result_div, this.successCallback, this.errorCallback, $result_div, this);
$form_name = 'kernel_form'; // restore back to main form with current category id of catalog
}
Catalog.prototype.successCallback = function($request, $params, $object) {
if (Request.processRedirect($request)) {
return ;
}
var $text = $request.responseText;
$params = $params.split(',');
var $js_end = $text.indexOf($object.Separator);
if ($js_end != -1) {
// allow to detect if output is permitted by ajax request parameters
var $request_visible = '$request_visible = ' + ($params[0].length ? 'true' : 'false') + "\n";
if ($params[0].length) {
document.getElementById($params[0]).innerHTML = $text.substring($js_end + $object.Separator.length);
eval($request_visible + $text.substring(0, $js_end));
}
else {
// eval JS only & set mark that js should not use HTML as usual in grids
eval($request_visible + $text.substring(0, $js_end));
}
}
else if ($params[0].length) {
document.getElementById($params[0]).innerHTML = $text;
}
if (typeof($object.OnResponceMethod) == 'function') {
$object.OnResponceMethod($object);
$object.OnResponceMethod = null;
}
if (typeof($Debugger) != 'undefined') {
$Debugger.Clear();
}
// var $tab_id = $params[0].replace(/_div$/, '');
// var $prefix = $object.queryTabRegistry('tab_id', $tab_id, 'prefix');
}
Catalog.prototype.resizeGrid = function ($prefix) {
if ($prefix != this.ActivePrefix) {
// no need to resize, because grid is already visible
return true;
}
var $grid = GridScrollers[$prefix];
if ($grid) {
$grid.RefreshPos();
$grid.Resize( $grid.GetAutoSize('auto') );
return true;
}
return false;
}
Catalog.prototype.trim = function ($string) {
return $string.replace(/\s*((\S+\s*)*)/, "$1").replace(/((\s*\S+)*)\s*/, "$1");
}
Catalog.prototype.errorCallback = function($request, $params, $object) {
// $Debugger.ShowProps($request, 'req');
alert('AJAX Error; class: Catalog; ' + Request.getErrorHtml($request));
}
Catalog.prototype.submit_event = function($prefix_special, $event, $t, $OnResponceMethod) {
if (typeof($OnResponceMethod) == 'function') {
this.OnResponceMethod = $OnResponceMethod;
}
var $prev_template = get_hidden_field('t');
if (!isset($prefix_special)) $prefix_special = this.getCurrentPrefix();
var $tab_id = this.queryTabRegistry('prefix', $prefix_special, 'tab_id');
$form_name = $tab_id + '_form'; // set firstly, because set_hidden_field uses it
if (isset($event)) set_hidden_field('events[' + $prefix_special + ']', $event);
if (isset($t)) set_hidden_field('t', $t);
this.submit_kernel_form($tab_id);
set_hidden_field('t', $prev_template);
}
Catalog.prototype.go_to_cat = function($cat_id, $module_prefix) {
if (!isset($cat_id)) {
// gets current category
$cat_id = get_hidden_field('m_cat_id');
}
else {
// sets new category to kernel_form in case if item tab
// loads faster and will check if it's category is same
// as parent category of categories list
if (get_hidden_field('m_cat_id') == $cat_id) {
// it's the same category, then don't reload category list
return ;
}
set_hidden_field('m_cat_id', $cat_id);
}
// 1. make all tabs unselected
this.resetTabs(false);
// 2. update grid for current tab
this.switchTab(this.TabByCategory ? $module_prefix : null); // refresh current item tab
// 3. update counters for all tabs
var $prefix = this.TabRegistry[0]['prefix'];
var $url = this.URLMask.replace('#TEMPLATE_NAME#', 'catalog/catalog_counters').replace('#CATEGORY_ID#', $cat_id);
this.BusyRequest[$prefix] = false;
Request.makeRequest($url, this.BusyRequest[$prefix], '', this.updateCounters, this.errorCallback, '', this);
}
Catalog.prototype.updateCounters = function($request, $params, $object) {
if (Request.processRedirect($request)) {
return ;
}
eval($request.responseText);
}
// set all item tabs counters to "?" before quering catagories
Catalog.prototype.resetTabs = function($reset_content) {
var $i = 0;
while ($i < this.TabRegistry.length) {
this.setItemCount(this.TabRegistry[$i]['prefix'], '?');
$i++;
}
if ($reset_content) {
// set category for all tabs to -1 (forces reload next time)
$i = 0;
while ($i < this.TabRegistry.length) {
document.getElementById(this.TabRegistry[$i]['tab_id'] + '_div').setAttribute('category_id', -1);
$i++;
}
}
}
Catalog.prototype.switchTab = function($prefix, $force) {
if (this.queryTabRegistry('prefix', this.ActivePrefix, 'prefix') != this.ActivePrefix) {
// active prefix is not registred -> cookie left, but not modules installed/enabled at the moment
return false;
}
if (!isset($prefix) || $prefix == '') {
// prefix not given OR empty prefix
$prefix = this.ActivePrefix;
}
if (this.BusyRequest[$prefix]) {
alert('prefix: ['+$prefix+']; request busy: ['+this.BusyRequest[$prefix]+']');
}
if (this.ActivePrefix != $prefix) {
// hide source tab
this.PreviousPrefix = this.ActivePrefix;
$( jq('#' + this.PreviousPrefix + '_tab') ).removeClass('tab-active');
- document.getElementById(this.queryTabRegistry('prefix', this.PreviousPrefix, 'tab_id') + '_div').style.display = 'none';
+ var $prev_div_id = this.queryTabRegistry('prefix', this.PreviousPrefix, 'tab_id') + '_div';
+ document.getElementById($prev_div_id).style.display = 'none';
+
+ var $prev_div_container = $( jq('#' + $prev_div_id + '_container') );
+ if ($prev_div_container.length) {
+ $prev_div_container.hide();
+ }
+
this.HideDependentButtons(this.PreviousPrefix);
}
// show destination tab
this.ActivePrefix = $prefix;
$( jq('#' + this.ActivePrefix + '_tab') ).addClass('tab-active');
var $div_id = this.queryTabRegistry('prefix', this.ActivePrefix, 'tab_id') + '_div'; // destination tab
document.getElementById($div_id).style.display = 'block';
+
+ var $div_container = $( jq('#' + $div_id + '_container') );
+ if ($div_container.length) {
+ $div_container.show();
+ }
+
this.ShowDependentButtons(this.ActivePrefix);
this.displaySearch($prefix);
this.setViewMenu(this.ActivePrefix);
setCookie(this.CookiePrefix + 'active_prefix', this.ActivePrefix);
window.location.hash = '#tab-' + this.ActivePrefix;
this.refreshTab($prefix, $div_id, $force);
}
Catalog.prototype.refreshTab = function($prefix, $div_id, $force) {
var $cat_id = get_hidden_field('m_cat_id');
var $tab_cat_id = document.getElementById($div_id).getAttribute('category_id');
if ($cat_id != $tab_cat_id || $force) {
// query tab content only in case if not queried or category don't match
var $url = this.URLMask.replace('#TEMPLATE_NAME#', this.queryTabRegistry('prefix', $prefix, 'view_template'));
$url = $url.replace('#CATEGORY_ID#', $cat_id);
$url = $url.replace('#PREFIX#', $prefix);
this.BusyRequest[$prefix] = false;
Request.makeRequest($url, this.BusyRequest[$prefix], $div_id, this.successCallback, this.errorCallback, $div_id, this);
}
else {
// alert('refresh disabled = {tab: '+this.ActivePrefix+'; cat_id: '+$cat_id+'; form_name: '+$form_name+'}');
this.resizeGrid($prefix);
}
}
// adds information about tab to tab_registry
Catalog.prototype.registerTab = function($tab_id) {
var $tab = document.getElementById($tab_id + '_div');
var $index = this.TabRegistry.length;
this.TabRegistry[$index] = new Array();
this.TabRegistry[$index]['tab_id'] = $tab_id;
this.TabRegistry[$index]['prefix'] = $tab.getAttribute('prefix');
if ($tab_id == 'categories') {
this.TabRegistry[$index]['module_path'] = 'in-portal/';
}
else {
this.TabRegistry[$index]['module_path'] = $tab.getAttribute('edit_template').substring(0, $tab.getAttribute('edit_template').indexOf('/'));
}
this.TabRegistry[$index]['view_template'] = $tab.getAttribute('view_template');
this.TabRegistry[$index]['edit_template'] = $tab.getAttribute('edit_template');
this.TabRegistry[$index]['dep_buttons'] = $tab.getAttribute('dep_buttons').length > 0 ? $tab.getAttribute('dep_buttons').split(',') : new Array();
this.TabRegistry[$index]['index'] = $index;
}
// allows to get any information about tab
Catalog.prototype.queryTabRegistry = function($search_key, $search_value, $return_key) {
var $i = 0;
// alert('looking in '+$search_key+' for '+$search_value+' will return '+$return_key)
while ($i < this.TabRegistry.length) {
if (this.TabRegistry[$i][$search_key] == $search_value) {
// alert('got '+this.TabRegistry[$i][$return_key])
return this.TabRegistry[$i][$return_key];
break;
}
$i++;
}
return false;
}
Catalog.prototype.ShowDependentButtons = function($prefix) {
/*var $tab_id = this.queryTabRegistry('prefix', $prefix, 'tab_id')
if (!document.getElementById($tab_id + '_form')) {
// tab form not found => no permission to view -> no permission to do any actions
alert('no form: ['+$tab_id + '_form'+']');
return ;
}
else {
alert('has form: ['+$tab_id + '_form'+']');
}*/
var $dep_buttons = this.queryTabRegistry('prefix', $prefix, 'dep_buttons');
var $i = 0;
while ($i < $dep_buttons.length) {
a_toolbar.ShowButton($dep_buttons[$i]);
$i++;
}
}
Catalog.prototype.HideDependentButtons = function($prefix) {
var $dep_buttons = this.queryTabRegistry('prefix', $prefix, 'dep_buttons');
var $i = 0;
while ($i < $dep_buttons.length) {
a_toolbar.HideButton($dep_buttons[$i]);
$i++;
}
}
Catalog.prototype.setItemCount = function($prefix, $count) {
setInnerHTML($prefix + '_item_count', $count);
}
Catalog.prototype.saveSearch = function ($prefix, $keyword, $grid_name) {
this.searchInfo[$prefix] = {
'keyword': $keyword,
'grid': $grid_name
}
this.displaySearch($prefix);
}
Catalog.prototype.displaySearch = function ($prefix) {
var $search_input = document.getElementById('search_keyword')
$search_input.setAttribute('PrefixSpecial', $prefix);
if (this.searchInfo[$prefix]) {
$search_input.value = this.searchInfo[$prefix].keyword;
$search_input.setAttribute('Grid', this.searchInfo[$prefix].grid);
}
}
Catalog.prototype.setCurrentCategory = function($prefix, $category_id) {
var $tab_id = this.queryTabRegistry('prefix', $prefix, 'tab_id');
// alert('setting current category for prefix: ['+$prefix+']; tab_id ['+$tab_id+'] = ['+$category_id+']');
document.getElementById($tab_id + '_div').setAttribute('category_id', $category_id);
}
Catalog.prototype.getCurrentPrefix = function() {
return this.ActivePrefix;
}
Catalog.prototype.setViewMenu = function($item_prefix) {
$ViewMenus = isset($item_prefix) ? new Array($item_prefix) : new Array();
}
Catalog.prototype.reflectPasteButton = function($status) {
a_toolbar.SetEnabled('paste', $status);
a_toolbar.SetEnabled('clear_clipboard', $status);
}
Catalog.prototype.storeIDs = function ($category_variable) {
if ($category_variable) {
var $category_ids = '';
if (Grids['c'] != undefined) {
$category_ids = Grids['c'].GetSelected().join(',');
}
if (!$category_ids) {
$category_ids = get_hidden_field('m_cat_id'); // current category
}
set_hidden_field($category_variable, $category_ids);
}
// get selectes category items
for (var $i in Grids[this.ActivePrefix].Items) {
if (Grids[this.ActivePrefix].Items[$i].selected) {
set_hidden_field(Grids[this.ActivePrefix].Items[$i].CheckBox.id, 'on', false);
}
}
}
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/js/catalog.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.32.2.10
\ No newline at end of property
+1.32.2.11
\ No newline at end of property
Index: branches/RC/core/admin_templates/js/forms.js
===================================================================
--- branches/RC/core/admin_templates/js/forms.js (revision 11545)
+++ branches/RC/core/admin_templates/js/forms.js (revision 11546)
@@ -1,323 +1,341 @@
var last_shown_error = false;
var errors = new Object();
var first_error = new Object();
var fields = new Object();
function show_form_error(prefix, field, sticky)
{
if (isset(errors[prefix]) && isset(errors[prefix][field])) {
span = document.getElementById('error_msg_'+prefix);
span.innerHTML = fields[prefix][field] + ' - ' + errors[prefix][field];
if (sticky) last_shown_error = field;
}
}
function hide_form_error(prefix)
{
span = document.getElementById('error_msg_'+prefix);
if (!span) return;
span.innerHTML = '<br/>';
if (typeof(last_shown_error) != 'undefined' && last_shown_error) {
show_form_error(prefix, last_shown_error);
}
}
function add_form_error(prefix, field, element, error_msg) {
if (error_msg != '') {
if (typeof(errors[prefix]) == 'undefined') {
errors[prefix] = new Object();
}
errors[prefix][field] = error_msg;
if (document.getElementById(element)) {
// some controls don't have element to focus on (e.g. swf uploader)
addEvent(
document.getElementById(element),
'focus',
function() {
show_form_error(prefix, field, true)
}
);
addEvent(
document.getElementById(element),
'blur',
function() {
last_shown_error = false
}
);
}
/*else {
console.log('error: focusing failed for [', prefix, '.', field, '] = ', element);
}*/
if (typeof(first_error[prefix]) == 'undefined' || first_error[prefix] == false) {
first_error[prefix] = [field, element];
}
}
}
function FCKeditor_OnComplete( editor )
{
Form.Resize();
}
function InitEditors()
{
var iframes = document.getElementsByTagName('IFRAME');
for (var i=0; i<iframes.length; i++) {
if (iframes[i].id.match(/___Frame$/)) {
iframes[i].src = iframes[i].getAttribute('latesrc');
}
}
}
function Form() {}
Form = new Form();
Form.Controls = new Array();
Form.Div = false;
Form.MinControlsHeight = 0;
Form.Options = new Object();
Form.FlexibleCount = 0;
Form.ScrollerW = 17;
Form.ScrollerH = 17;
Form.HasChanged = false;
-Form.Init = function(id)
-{
+Form.Init = function(id) {
this.Div = document.getElementById(id);
for (var i in this.Controls) {
- dim = getDimensions(document.getElementById(this.Controls[i]));
+ dim = getDimensions( document.getElementById(this.Controls[i]) );
options = this.Options[this.Controls[i]];
+
if (options.height) { // fixed height
options.min_height = options.height;
options.max_height = options.height;
}
- if (!options.min_height) options.min_height = dim.innerHeight;
- this.MinControlsHeight += options.min_height;
+
+ if (!options.min_height) {
+ options.min_height = $( jq('#' + this.Controls[i]) ).outerHeight(); // dim.innerHeight
+ }
+
+// if ( $( jq('#' + this.Controls[i]) ).parents('tr:first').is(':visible') ) {
+ this.MinControlsHeight += options.min_height;
+// }
+
if (dim.innerHeight < options.min_height) {
document.getElementById(this.Controls[i]).style.height = options.min_height+'px';
}
// alert('adding element '+this.Controls[i]+' height: '+options.min_height+' total: '+this.MinControlsHeight)
}
- var a_div = document.createElement('DIV');
- a_div.style.position = 'relative';
- a_div.style.overflow = 'auto';
- a_div.style.width = '100%';
+ // all <script> tags will be executed again after wrap method is called, so remove them to prevent that
+ $('script', this.Div).remove();
+ $(this.Div).wrap('<div id="' + this.Div.id + '_container" style="position: relative; overflow: auto; width: 100%;"></div>');
- a_div.id = this.Div.id + '_container';
- a_div.appendChild(this.Div.parentNode.replaceChild(a_div, this.Div));
+ Application.removeDebuggerStatistics();
- this.Table = this.Div.getElementsByTagName('table')[0];
+ this.Table = $('table:first', this.Div).get(0);
this.Table.style.height = 'auto';
// this.Table.style.width = 'auto';
this.MinHeight = this.Table.offsetHeight;
this.MinWidth = this.Table.offsetWidth;
// alert('Measuring min width now')
addEvent(window, 'resize', function() {Form.Resize()})
- this.Resize()
+ this.Resize();
if (isset(first_error)) {
for (var i in first_error) {
if (first_error[i] != false) {
if (document.getElementById(first_error[i][1])) {
// some controls don't have element to focus on (e.g. swf uploader)
document.getElementById(first_error[i][1]).focus();
}
show_form_error(i, first_error[i][0], true);
// alert('focused on '+first_error[i][1])
}
}
}
if (_Simultanious_Edit_Message != '') {
alert(_Simultanious_Edit_Message);
}
this.InitOnChange();
Application.processHooks('m:OnAfterFormInit');
InitEditors();
}
Form.InitOnChange = function()
{
var inputs = window.document.getElementsByTagName('INPUT');
var selects = window.document.getElementsByTagName('SELECT');
var textareas = window.document.getElementsByTagName('TEXTAREA');
var groups = [inputs, selects, textareas];
for (var g=0; g<groups.length; g++) {
for (var i=0; i<groups[g].length; i++) {
var elem = groups[g][i];
if (elem.tagName == 'INPUT' && elem.type == 'hidden') continue;
addEvent(elem, elem.type=='button' ? 'click' : 'change', function() {Form.Changed()});
}
}
}
Form.Changed = function()
{
this.HasChanged = true;
}
Form.addControl = function(id, options) {
this.Controls.push(id);
if (!options) {
options = {coeff: 1, max_height: 0, min_height: 0};
}
else {
if (typeof(options['coeff']) == 'undefined') options['coeff'] = 1;
if (typeof(options['max_height']) == 'undefined') options['max_height'] = 0;
if (typeof(options['min_height']) == 'undefined') options['min_height'] = 0;
}
options['real_height'] = 0;
this.Options[id] = options; // for future use
// print_pre(this.Options[id]);
}
Form._parseSize = function ($size) {
if ($size.toString().match(/^([\d]+)px$/)) {
return parseInt(RegExp.$1);
}
return parseInt($size);
}
Form.Resize = function()
{
var h = (document.all ? window.document.body.offsetHeight : window.innerHeight);
- var pos = findPos(this.Div);
- var dim = getDimensions(this.Div);
- h -= pos[1] + dim.padding[0] + dim.padding[2] + dim.borders[0] + dim.borders[2];
+ var $div = $(this.Div);
+ var pos = $div.offset();
+
+ h -= pos.top;
if (this.Div.style.height.length) {
// height set for scroll_container overrides automatic container height detection
- var h = this._parseSize(this.Div.style.height);
+ h = this._parseSize(this.Div.style.height);
}
+ if ($div.attr('mode') == 'minimal') {
+ // height will become minimal required (when data height is smaller, then window)
+ h = this.MinHeight;
+ }
+
+ h -= ($div.outerHeight() - $div.height());
+
// alert('h after correction is '+h);
window.document.body.style.width = '100%';
var w = (document.all ? window.document.body.offsetWidth : window.innerWidth);
- w -= pos[0] + dim.padding[1] + dim.padding[3] + dim.borders[1] + dim.borders[3];
- scroller_height = this.MinWidth > w ? this.ScrollerH : 0;
- scroller_width = this.MinHeight > h - scroller_height ? this.ScrollerW : 0;
- scroller_height = this.MinWidth > w - scroller_width ? this.ScrollerH : 0;
+ w -= pos.left + ($div.outerWidth() - $div.width());
+
+ scroller_height = this.MinWidth > w ? this.ScrollerH : 0; // width of 1st table in scroll_container is larger, then window width?
+ scroller_width = this.MinHeight > h - scroller_height ? this.ScrollerW : 0; // table height > total height - scroller_height -> vertical scroller is found
+ scroller_height = this.MinWidth > w - scroller_width ? this.ScrollerH : 0; // table width > total width - scroller_width -> horizontal scroller is found
var st = document.getElementById('width_status');
if (st) st.innerHTML = 'minWdith: '+this.MinWidth+' minHeight: '+this.MinHeight+' w: '+w+' h: '+h+' scroll_w: '+scroller_width+' scroll_h: '+scroller_height;
// alert('scroller W x H = '+scroller_width+' x '+scroller_height);
// alert('resize: '+w+'x'+h)
-// h -= 100;
-
this.Table.style.width = (w-scroller_width) + 'px';
- this.Div.parentNode.style.width = (w)+'px';
- this.Div.style.width = (w-scroller_width)+'px';
- this.Div.parentNode.style.height = (h)+'px';
+ this.Div.parentNode.style.width = w + 'px';
+ this.Div.style.width = (w-scroller_width) + 'px';
+ this.Div.parentNode.style.height = h + 'px';
var count = this.Controls.length;
// -count here is adjustment - 1px for each control
- var split = h - count*2 - this.MinHeight + this.MinControlsHeight;
- if (split < this.MinControlsHeight) split = this.MinControlsHeight;
+ var split = h /*- (count * 2)*/ - this.MinHeight + this.MinControlsHeight;
+
+ if (split < this.MinControlsHeight) {
+ split = this.MinControlsHeight;
+ }
this.ResetHeights();
var used = this.SetMinHeights();
+
split -= used;
var cur_diff = 0;
var iterations = 0;
do {
var prev_diff = cur_diff;
var cur_diff = this.SplitExtra(split);
split = cur_diff;
iterations++;
} while (cur_diff != 0 && cur_diff != prev_diff && iterations < 10);
for (var i in this.Controls) {
- document.getElementById(this.Controls[i]).style.height = this.Options[this.Controls[i]]['real_height'] + 'px';
+ document.getElementById(this.Controls[i]).style.height = this.Options[ this.Controls[i] ]['real_height'] + 'px';
// document.getElementById(this.Controls[i]).value = this.Options[this.Controls[i]]['real_height'];
}
-// alert('h is: '+h+' min height is '+this.MinHeight+' MinControlsHeight is '+this.MinControlsHeight+' -> '+split+' to split between '+count+' new height is '+new_height);
+// alert('h is: '+h+' min height is '+this.MinHeight+' MinControlsHeight is '+this.MinControlsHeight+' -> '+split+' to split between '+count);
// print_pre(this.Controls)
+
IterateUploaders('syncBrowseButton');
}
Form.ResetHeights = function()
{
for (var i in this.Controls) {
var options = this.Options[this.Controls[i]]
options['real_height'] = 0;
options.fixed = false;
}
this.FlexibleCount = this.Controls.length;
}
// Enlarge heights when possible
// Return any not split pixels number
-Form.SplitExtra = function(split)
-{
+Form.SplitExtra = function(split) {
var number = 0;
for (var i in this.Controls) {
- var options = this.Options[this.Controls[i]]
- if (options['max_height'] ==0 || options['real_height'] < options.max_height) {
+ var options = this.Options[ this.Controls[i] ];
+ if (options['max_height'] == 0 || options['real_height'] < options.max_height) {
number++;
}
}
- if (number == 0) return 0;
+ if (number == 0) {
+ return 0;
+ }
var delta = Math.floor(split / number);
// alert('splitting '+split+' between '+number+' delta is '+delta)
var added = 0;
for (var i in this.Controls) {
var options = this.Options[this.Controls[i]];
var to_add;
- if (options['max_height'] != 0 && options['real_height']+delta > options['max_height']) {
- to_add = options['max_height']-options['real_height'];
+ if (options['max_height'] != 0 && options['real_height'] + delta > options['max_height']) {
+ to_add = options['max_height'] - options['real_height'];
}
else {
to_add = delta;
}
// alert('delta: '+delta+' current real: '+options['real_height']+' min: '+options['min_height']+' max:'+options['max_height']+' to_add: '+to_add)
- options['real_height'] = options['real_height']+to_add;
+ options['real_height'] = options['real_height'] + to_add;
added += to_add;
}
// alert('added total '+added)
// removing extra added from the last (any) control
if (added > split) {
- extra = added-split;
+ extra = added - split;
options['real_height'] -= extra;
added -= extra;
}
return split - added;
}
Form.SetMinHeights = function()
{
var used = 0;
for (var i in this.Controls) {
var options = this.Options[this.Controls[i]]
if (options['real_height'] < options['min_height']) {
options['real_height'] = options.min_height;
used += options.min_height;
}
}
return used;
}
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/js/forms.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4.2.13
\ No newline at end of property
+1.4.2.14
\ No newline at end of property
Index: branches/RC/core/admin_templates/js/grid_scroller.js
===================================================================
--- branches/RC/core/admin_templates/js/grid_scroller.js (revision 11545)
+++ branches/RC/core/admin_templates/js/grid_scroller.js (revision 11546)
@@ -1,1204 +1,1206 @@
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, s, value)
{
if (!this.Inited) this.InitStyles()
rule = this.Map[selector.toLowerCase()];
if (!rule) {
if (this.AddStyle(selector, s, value)) {
return true;
}
alert('rule '+selector+' not found')
return;
}
alert('adjusting rule '+selector+' setting '+s+' to '+value+' from '+rule.style[s])
rule.style[s] = value;
alert('now it is '+rule.style[s])
}
StyleManager.AddStyle = function(selector, style, value)
{
var sheet = document.styleSheets[0];
var rule = false;
if (sheet.insertRule) {
sheet.insertRule(selector+'{'+style+':'+value+'}', sheet.cssRules.length);
rule = sheet.cssRules[sheet.cssRules.length-1];
}
else if(sheet.addRule) {
sheet.addRule(selector, style+':'+value);
rule = sheet.rules[sheet.rules.length-1];
}
if (rule) {
alert ('adding rule as '+selector);
this.Map[selector.toLowerCase()] = sheet.cssRules[sheet.cssRules.length-1];
return true;
}
return false;
}
StyleManager.GetStyle = function(selector)
{
if (!this.Inited) this.InitStyles()
rule = this.Map[selector.toLowerCase()];
if (!rule) return false;
return rule;
}
StyleManager.GetStyleValue = function(selector, style)
{
rule = this.GetStyle(selector);
if (!rule) return false;
return rule.selector;
}
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)
}
var startTime,endTime;
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 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.MaxHeight = h; // maximal grid height from constructor (also save here, because this.Height will be changed after Resize method call)
this.AutoWidth = true;
this.ScrollerW = 0;
this.ScrollerH = 0;
this.MinWidths = [];
this.IDs = [];
this.Rendered = false;
this.PickerCRC = '';
this.MaxHeaderHeights = [50,30];
this.MaxRowHeight = 45;
this.Html = ''; // html from last grid rendering
}
GridScroller.prototype._getMeasureHtml = function() {
return '<div id="my_measure_'+this.GridId+'" style="width: auto; height: 0px; z-index: -105;"></div>';
}
GridScroller.prototype._prepareHtml = function($container) {
if (typeof($container) == 'undefined') {
var dot = this._getMeasureHtml();
// console.log('dot without container');
document.write(dot);
}
else {
// console.log('dot inside container');
var dot = document.createElement('div');
dot.id = 'my_measure_'+this.GridId;
dot.style.width = 'auto';
dot.style.height = '0px';
dot.style.zIndex = '-105';
document.getElementById($container).appendChild(dot);
}
var dot = document.getElementById('my_measure_'+this.GridId);
var measure = document.getElementById('my_measure_'+this.GridId);
this.pos = findPos(dot);
// alert('dot: '+this.pos[0]+','+this.pos[1])
var collapse_correction = this._getCollapseCorrection();
if (is.ie) this.pos[0] += 1;
// this.MainOuter.style.width = 'auto'
var w = measure.offsetWidth;
var h = document.body.clientHeight;
var dim = getDimensions(measure);
h -= this.pos[1] + dim.padding[0] + dim.padding[2] + dim.borders[0] + dim.borders[2] + this.BottomOffset;
var $html = this.AltHTML(this.pos[0],this.pos[1], w, h);
return $html;
}
GridScroller.prototype._getCollapseCorrection = function() {
return is.ie ? 0 : -1;
}
GridScroller.prototype.Render = function(id)
{
+ Application.removeDebuggerStatistics();
+
ResetStart();
// var widths = this.PrepareWidths();
// this.MinWidths = [40,null,null,250]
this.MinWidths = this.PrepareWidths(); // [50,70,90,150,150,110,70,111];
document.body.style.height = '100%';
document.body.style.overflow = 'hidden';
- document.body.scroll = 'no'
+ document.body.scroll = 'no';
// this.Html = this.AltHTML();
// Profile('Getting HTML',1);
// console.log('GridScroller.Render(', id, ')');
if (id && id != '') {
// console.log('id given');
if (this.Html.length == 0) {
// 1st render and inside container -> prepare html
// console.log('1st render and no html');
this.Html = this._prepareHtml(id);
var collapse_correction = this._getCollapseCorrection();
document.getElementById(id).innerHTML = this._getMeasureHtml() + '<div id="main_div_'+this.GridId+'" style="margin-left: '+collapse_correction+'px">'+this.Html+'</div>';
}
else {
document.getElementById(id).innerHTML = '<div id="main_div_'+this.GridId+'">'+this.Html+'</div>';
}
execJS(document.getElementById(id))
}
else {
// console.log('id not given');
if (this.Rendered) {
// console.log('rendering inside container');
this.Render('main_div_'+this.GridId);
return;
}
// console.log('just rendering');
this.Html = this._prepareHtml();
var collapse_correction = this._getCollapseCorrection();
document.write('<div id="main_div_'+this.GridId+'" style="margin-left: '+collapse_correction+'px">'+this.Html+'</div>');
}
this.Rendered = true;
// Profile('Main render & refs',1)
this.SetReferences();
// return;
if (getFrame('head').ScrollerW) {
this.ScrollerW = getFrame('head').ScrollerW;
this.ScrollerH = getFrame('head').ScrollerH;
}
else {
this.ScrollerW = 17;
this.ScrollerH = 17;
/*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(this.Height) );
}
else {
this.Resize();
}
this.AdjustInputWidths();
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();
}
if (this.LeftCells > 0) {
this.LeftDataInner.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);
if (this.LeftCells > 0) {
this.LeftDataInner.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.RefreshPos();
the_grid.AutoResize();
the_grid.SetResizeHandles();
}
);
}
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.LeftHeaderInner = document.getElementById('inner_left_header_'+this.GridId);
this.LeftDataTable = document.getElementById('left_data_'+this.GridId);
this.LeftDataOuter = document.getElementById('outer_left_data_'+this.GridId);
this.LeftDataInner = document.getElementById('inner_left_data_'+this.GridId);
if (this.HasFooter) {
this.LeftFooterTable = document.getElementById('left_footer_'+this.GridId);
this.LeftFooterInner = document.getElementById('inner_left_footer_'+this.GridId);
this.LeftFooterOuter = document.getElementById('outer_left_footer_'+this.GridId);
}
}
this.DataScroller.TheGrid = this;
this.MainInner.TheGrid = this;
if (this.LeftCells > 0) this.LeftDataInner.TheGrid = this;
// this.Dot = document.getElementById('my_dot_'+this.GridId)
this.MainOuter.className = 'grid-scrollable'
if (!is.ie) {
// this.MainOuter.style.marginLeft = '-1px';
}
}
GridScroller.prototype.SetLeftHeights = function() {
if (this.LeftCells != 0) {
this.SetHeights('left_header_'+this.GridId, 'header_'+this.GridId);
this.SetHeights('left_data_'+this.GridId, 'data_'+this.GridId);
if (this.HasFooter()) {
this.SetHeights('left_footer_'+this.GridId, 'footer_'+this.GridId);
}
}
}
GridScroller.prototype.UpdateColWidths = function() {
// pos = findPos(this.Dot)
pos = this.pos;
this.TheGrid.style.left = (pos[0])+ 'px'
this.TheGrid.style.top = (pos[1]) + 'px'
this.SetLeftHeights();
if (this.HasFooter()) {
this.FooterHeight = this.FooterTable.offsetHeight;
this.FooterOuter.style.height = this.FooterHeight + 'px'
}
else {
this.FooterHeight = 0;
}
this.HeadHeight = this.HeadTable.offsetHeight;
// console.log('measured Head Height: '+this.HeadHeight);
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);
}
// console.log('measured Left Width: '+this.LeftWidth);
}
this.MainInner.onscroll = function() {
this.TheGrid.SyncScroll()
}
this.MainOuter.style.width = 'auto'
this.UpdateTotalDimensions();
return true;
}
GridScroller.prototype.UpdateTotalDimensions = function()
{
this.HeadHeight = this.HeadTable.offsetHeight;
this.DataHeight = this.DataTable.offsetHeight;
this.HeaderWidth = this.HeadTable.offsetWidth + this.LeftWidth - this.HeadTable.rows[0].cells[(this.HeadTable.rows[0].cells.length-1)].offsetWidth;
this.DataTotalHeight = this.DataHeight + this.HeadHeight + this.FooterHeight;
}
GridScroller.prototype.ResetHeights = function(table1_id, table2_id)
{
var table1 = document.getElementById(table1_id);
var table2 = document.getElementById(table2_id);
var height1_div, height2_div;
for (var row=0; row<table1.rows.length; row++)
{
// reseting heights
table1.rows[row].cells[0].style.height = 'auto';
table2.rows[row].cells[0].style.height = 'auto';
table1.rows[row].style.height = 'auto';
table2.rows[row].style.height = 'auto';
var height1_div = document.getElementById(table1_id+'_left_height_'+row);
if (height1_div) {
height1_div.style.height = 'auto';
}
var height2_div = document.getElementById(table2_id+'_left_height_'+row);
if (height2_div) {
height2_div.style.height = 'auto';
}
}
}
GridScroller.prototype.SetHeights = function(table1_id, table2_id)
{
var table1 = document.getElementById(table1_id);
var table2 = document.getElementById(table2_id);
var height1_div, height2_div;
this.ResetHeights(table1_id, table2_id);
var heights1 = this.GetHeights(table1_id);
var heights2 = this.GetHeights(table2_id);
var table, the_height, num;
for (var row=0; row<table1.rows.length; row++)
{
if (heights1[row] > heights2[row])
{
the_height = heights1[row];
table = table2;
id = table2_id;
}
else {
the_height = heights2[row];
table = table1;
id = table1_id;
}
var height_div = document.getElementById(id+'_left_height_'+row);
if (height_div) { // the div only exists for FF
height_div.style.height = the_height+'px';
height_div.style.width = table.rows[row].cells[0].clientWidth+'px'
}
else {
if (!is.ie) { // firefox needs div, but it can display it as table-cell
var width = table.rows[row].cells[0].clientWidth;
// table.rows[row].cells[0].innerHTML = '<div id="'+id+'_left_height_'+row+'" style="display: table-cell; background-color: inherit; width: '+width+'px; height: '+(the_height) +'px; overflow: hidden;">' + table.rows[row].cells[0].innerHTML + '</div>'
}
}
// IE can't display div as table-cell, but it respects the tr height
table.rows[row].cells[0].style.height = the_height+'px';
table.rows[row].style.height = the_height+'px';
}
}
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++)
{
var dim = getDimensions( table.rows[row].cells[0] );
height = dim.innerHeight + (is.ie ? 0 : dim.padding[0] + dim.padding[2] + dim.borders[0] + dim.borders[2]);
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);
var widths = new Array();
if (!table.rows[0]) return [];
for (var col=0; col<table.rows[0].cells.length; col++)
{
var tmp = getDimensions(table.rows[0].cells[col]);
widths.push( tmp.innerWidth )
// 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.SetResizeHandles = function()
{
var points = new Array();
if (this.LeftCells > 0) {
var table = this.LeftHeaderTable;
var points = new Array();
if (!table.rows[0]) return [];
for (var col=0; col<table.rows[0].cells.length; col++)
{
var tmp = findPos(table.rows[0].cells[col]);
points.push(tmp);
}
}
var table = this.HeadTable;
if (!table.rows[0]) return [];
for (var col=0; col<table.rows[0].cells.length; col++)
{
var tmp = findPos(table.rows[0].cells[col]);
points.push(tmp);
}
var scroller = this;
var resize_bar = document.getElementById(this.GridId + '[resize_bar]');
if (!resize_bar) {
resize_bar = addElement(document.body, 'div');
resize_bar.id = this.GridId + '[resize_bar]';
}
resize_bar.style.display = 'none';
resize_bar.style.width = '2px';
resize_bar.style.height = '200px';
resize_bar.style.backgroundColor = '#777';
resize_bar.style.zIndex = 40;
resize_bar.style.position = 'absolute';
for (var i=1; i<points.length; i++) {
var handle = document.getElementById(this.GridId + '[grid_resize_handle_' + i + ']');
if (!handle) {
handle = addElement(document.body, 'div');
handle.id = this.GridId + '[grid_resize_handle_' + i + ']';
}
handle.style.width='6px';
handle.style.height=this.HeadTable.offsetHeight+'px';
handle.style.position='absolute';
// handle.style.backgroundColor='red';
handle.style.left = (points[i][0] - 3)+'px';
handle.style.top = points[i][1]+'px';
handle.style.zIndex = 50;
handle.style.cursor = 'col-resize';
handle.col_num = i-1;
DragManager.MakeDragable(this.GridId + '[grid_resize_handle_' + i + ']',
function(a_handle) {
var resize_bar = document.getElementById(scroller.GridId + '[resize_bar]');
var pos = findPos(a_handle);
resize_bar.style.left = (pos[0])+'px';
resize_bar.style.top = pos[1]+'px';
resize_bar.style.height = scroller.Height+'px';
resize_bar.style.display = 'block';
var col_num = a_handle.col_num;
DragManager.DragObject.min_col_width = scroller.GetColWidth(col_num);
},
function(drag_object, coords) {
var offset = coords.x - DragManager.MouseOffset[0] - DragManager.InitialPos[0];
if (parseInt(DragManager.DragObject.min_col_width) + offset > 15) {
var resize_bar = document.getElementById(scroller.GridId + '[resize_bar]');
resize_bar.style.left = (coords.x - DragManager.MouseOffset[0] + 2) + 'px';
}
},
function(a_handle) {
var resize_bar = document.getElementById(scroller.GridId + '[resize_bar]');
resize_bar.style.display = 'none';
coords = findPos(a_handle);
var offset = (coords[0] - DragManager.InitialPos[0]);
// alert('offset: '+offset+' ('+coords[0]+' - '+DragManager.MouseOffset[0]+' - '+DragManager.InitialPos[0]+')');
var col_num = a_handle.col_num;
var cur_w = scroller.GetColWidth(col_num);
if (cur_w + offset < 15) {
offset = 15-cur_w;
}
scroller.SetColWidth(col_num, cur_w+offset);
scroller.Resize( scroller.GetAutoSize() );
scroller.ScrollResizeHandles();
DragManager.InitialPos = [coords[0] - DragManager.MouseOffset[0], coords[1] - DragManager.MouseOffset[1]];
},
{VerticalDrag: false}
)
}
}
GridScroller.prototype.GetColWidth = function(col)
{
return this.MinWidths[col];
}
GridScroller.prototype.AdjustInputWidths = function()
{
var elems = new Array();
var inputs = this.HeadTable.getElementsByTagName('INPUT');
for (var i=0; i<inputs.length; i++) {elems[elems.length] = inputs[i];}
var selects = this.HeadTable.getElementsByTagName('SELECT');
for (var i=0; i<selects.length; i++) {elems[elems.length] = selects[i];}
if (this.LeftCells > 0) {
var left_inputs = this.LeftHeaderTable.getElementsByTagName('INPUT');
for (var i=0; i<left_inputs.length; i++) {elems[elems.length] = left_inputs[i];}
var left_selects = this.LeftHeaderTable.getElementsByTagName('SELECT');
for (var i=0; i<left_selects.length; i++) {elems[elems.length] = left_selects[i];}
}
var widths = new Array()
for (var i=0; i<elems.length; i++) {
elems[i].style.width = '1px';
}
for (var i=0; i<elems.length; i++) {
var input_dim = getDimensions(elems[i]);
var parent_dim = getDimensions(elems[i].parentNode);
widths[i] = (parent_dim.innerWidth - parent_dim.borders[1] - parent_dim.borders[3] - input_dim.borders[1] - input_dim.borders[3] - 2)+'px';
}
for (var i=0; i<elems.length; i++) {
try {
elems[i].style.width = widths[i];
}
catch (e) {
// IE don't allow to set width for hidden element
// alert('IE exception:' + e);
}
}
}
GridScroller.prototype.SetColWidth = function(col, width)
{
if (col >= this.LeftCells) {
if (this.DataTable.rows.length) this.DataTable.rows[0].cells[col - this.LeftCells].style.width = width+'px';
for (var row=0; row < this.HeadTable.rows.length; row++)
{
this.HeadTable.rows[row].cells[col - this.LeftCells].style.width = width+'px';
var a = document.getElementById(this.GridId + '[cursor_work_around_A_'+col+'_'+row+']');
var b = document.getElementById(this.GridId + '[cursor_work_around_B_'+col+'_'+row+']');
if (a) a.style.width = width+'px';
if (b) b.style.width = width+'px';
}
if (this.HasFooter()) {
this.FooterTable.rows[0].cells[col - this.LeftCells].style.width = width+'px';
}
}
else {
if (this.LeftDataTable.rows.length) this.LeftDataTable.rows[0].cells[col].style.width = width+'px';
for (var row=0; row < this.LeftHeaderTable.rows.length; row++)
{
this.LeftHeaderTable.rows[row].cells[col].style.width = width+'px';
var a = document.getElementById(this.GridId + '[cursor_work_around_A_'+col+'_'+row+']');
var b = document.getElementById(this.GridId + '[cursor_work_around_B_'+col+'_'+row+']');
if (a) a.style.width = width+'px';
if (b) b.style.width = width+'px';
}
if (this.HasFooter()) {
this.LeftFooterTable.rows[0].cells[col].style.width = width+'px';
}
var cur_left_total_w = 0;
var new_left_total_w = 0;
for (var i=0; i < this.LeftCells; i++) {
cur_left_total_w += this.MinWidths[i];
new_left_total_w += i==col? width : this.MinWidths[i];
};
var left_diff = this.LeftWidth - cur_left_total_w;
this.SetLeftWidth(new_left_total_w+left_diff);
}
this.AdjustInputWidths();
this.MinWidths[col] = width;
this.SetLeftHeights();
this.UpdateTotalDimensions();
this.SyncScroll();
this.ScheduleSaveWidths();
}
GridScroller.prototype.ScrollResizeHandles = function()
{
for (var col=1; col<this.LeftHeaderTable.rows[0].cells.length; col++)
{
var handle = document.getElementById(this.GridId + '[grid_resize_handle_' + col + ']');
if (!handle) return;
var pos = findPos(this.LeftHeaderTable.rows[0].cells[col]);
handle.style.left = (pos[0]-3)+'px';
}
if (this.HeadTable.rows[0].cells.length) {
var left_most_pos = findPos(this.HeadTable.rows[0].cells[0]);
var handle = document.getElementById(this.GridId + '[grid_resize_handle_' + (this.LeftCells) + ']');
if (handle) handle.style.left = (left_most_pos[0]-3)+'px';
}
for (var col=1; col<this.HeadTable.rows[0].cells.length; col++)
{
var handle = document.getElementById(this.GridId + '[grid_resize_handle_'+(col+this.LeftCells)+']');
if (!handle) continue;
var pos = findPos(this.HeadTable.rows[0].cells[col]);
var n_left = pos[0]-this.MainInner.scrollLeft-3
if (n_left <= left_most_pos[0] || n_left > left_most_pos[0] + this.DataOuter.clientWidth) {
handle.style.display = 'none'; //resize handle is outside of visible range
}
else {
handle.style.display = 'block';
}
handle.style.left = n_left+'px';
}
}
GridScroller.prototype.GetAutoSize = function(h)
{
this.MainOuter.style.width = 'auto'
var w = this.MainInner.offsetWidth;
if (!isset(h)) {
h = this.MaxHeight; // 'auto';
}
if (h == 'auto') {
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.RefreshPos();
obj.Resize( obj.GetAutoSize() );
obj.ResizeHappening = false;
}, 300)
}
GridScroller.prototype.RefreshPos = function() {
var dot = document.getElementById('my_measure_'+this.GridId);
this.pos = findPos(dot);
if (is.ie) {
// measure div is moved left for 1 pixel in IE during resize (nothing strange, it's IE)
this.pos[0] += 1;
}
}
GridScroller.prototype.Resize = function(w,h)
{
// alert('-1');
if (typeof(w) == 'object') {
h = w[1];
w = w[0];
}
if (w) this.Width = w;
if (h) this.Height = h;
var x,y;
// pos = findPos(this.Dot)
pos = this.pos;
x = pos[0];
y = pos[1];
this.TheGrid.style.left = (x)+ 'px'
this.TheGrid.style.top = (y) + 'px'
// alert('moved');
// alert('0');
this.MainOuter.style.height = (this.Height)+'px'
this.MainOuter.style.width = (this.Width)+'px'
// alert('1');
var scroller_width;
// this.HeadTable.rows[0].cells[(this.HeadTable.rows[0].cells.length-1)].offsetWidth
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';
// alert('1.2');
this.TheGrid.style.width = (this.Width - scroller_width) + 'px';
this.TheGrid.style.height = (this.Height - scroller_height) + 'px';
// alert('1.5');
this.SetLeftWidth();
// alert('2');
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'
}
// alert('3');
this.MainScroller.style.width = (this.HeadTable.offsetWidth + this.LeftWidth)+'px'
this.MainScroller.style.height = ( this.DataHeight + this.HeadHeight + this.FooterHeight)+'px'
// alert('4');
}
GridScroller.prototype.SetLeftWidth = function(left_width)
{
if (left_width) this.LeftWidth = left_width;
if (this.LeftCells != 0) {
// there was -1 for Mozilla, but somehow it's not needed anymore...
this.LeftHeaderOuter.parentNode.style.width = (this.LeftWidth + (is.ie ? 0 : 0) ) + 'px';
this.LeftHeaderOuter.style.width = (this.LeftWidth) + 'px';
this.LeftHeaderInner.style.width = (this.LeftWidth) + 'px';
this.LeftDataOuter.style.width = (this.LeftWidth) + 'px';
this.LeftDataInner.style.width = (this.LeftWidth) + 'px';
if (this.HasFooter()) {
this.LeftFooterOuter.style.width = (this.LeftWidth) + 'px';
this.LeftFooterInner.style.width = (this.LeftWidth) + 'px'
}
// this is IE workaround, we have to set inner div width to given px (above) and then back to 100%
// for IE to readjust the surrounding tables, otherwise it memorizes inner div pixel width and
// cannot make surrounding table cells smaller then that
this.LeftHeaderInner.style.width = '100%';
this.LeftDataInner.style.width = '100%';
if (this.HasFooter()) {
this.LeftFooterInner.style.width = '100%';
}
}
}
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.LeftDataInner.scrollTop = this.MainInner.scrollTop;
}
this.ScrollResizeHandles();
}
GridScroller.prototype.AltHTML = function(x,y,w,h)
{
var o = '';
o += this.CreateScroller( '<div id="main_scroller_'+this.GridId+'" style="background-color: inherit; position: relative; width: auto; z-index: 20; height: '+(h)+'px;"></div>', w, h, 'main_'+this.GridId, false, 1, 'grid-scrollable' );
// console.log(o)
// return o+'</div>'
o += '<div id="'+this.GridId+'" class="grid-container" style="background-color: inherit; position: absolute; left: '+(x)+'px; top: '+(y)+'px; visibility: visible; z-index: 10; width: auto; height: '+(h)+'px; overflow: hidden;">';
var header_rows = this.Header.length;
var cols = this.Header[0].length;
var data_rows = this.Data.length;
var footer_rows = this.Footer.length;
var header_h = 80;
if (this.LimitedHeights) {
for (var i=0; i<this.MaxHeaderHeights.length; i++) {header_h += this.MaxHeaderHeights[i]};
header_h += this.MaxHeaderHeightCorrection;
}
data_h = h - header_h;
// console.log('header_h: %i, data_h: %i', header_h, data_h)
var header = 'b';
var data = 'd';
var footer = 'f';
var left_header = '1';
var left_data = 'c';
var left_footer = 'e';
var header = this.GetTableWithScroller(this.Header, [this.LeftCells, 0, cols, header_rows], 'header', null, null, null, header_h)
var data = this.GetTableWithScroller(this.Data, [this.LeftCells, 0, cols, data_rows], 'data', 'grid-data-row-even', '', null, data_h)
var footer = this.HasFooter() ? this.GetTableWithScroller(this.Footer, [this.LeftCells, 0, cols, footer_rows], 'footer') : '';
var left_header = this.GetTableWithScroller(this.Header, [0,0,this.LeftCells, header_rows], ['header','left_header'], null, null, null, header_h)
var left_data = this.GetTableWithScroller(this.Data, [0,0,this.LeftCells, data_rows], ['data','left_data'], 'grid-data-row-even', 'left_', null, data_h)
var left_footer = this.GetTableWithScroller(this.Footer, [0,0,this.LeftCells, footer_rows], ['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="width: 100%; table-layout: fixed; border-collapse: collapse;">\n'
o += '<tr>\n<td style="vertical-align: top; margin: 0px; padding: 0px;">\n' + left_header + '\n</td>\n'
o += '<td style="vertical-align: top; margin: 0px; padding: 0px;">\n' + header + '\n</td>\n</tr>\n'
o += '<tr>\n<td style="vertical-align: top; margin: 0px; padding: 0px;">\n' + left_data + '\n</td>\n'
o += '<td style="vertical-align: top; margin: 0px; padding: 0px;">\n' + data + '\n</td>\n</tr>\n'
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>\n'
}
else {
o += header + data + footer;
}
o += '</div>';
return o;
}
GridScroller.prototype.PrepareWidths = function()
{
cache = getFrame('head').grid_widths_cache;
if (!isset(cache)) {
cache = new Object
}
if (this.MinWidths.length >= this.Header[0].length) {
var has_all_widths = true;
for (var i=0; i < this.MinWidths.length; i++) {
if (isNaN(parseInt(this.MinWidths[i]))) {
this.MinWidths[i] = 100;
// 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]
}
// print_pre(this.MinWidths)
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) {
var data= this.GetTableCells(this.Data, [0,0,this.Data[0].length,this.Data.length], 'data', null, null, false, true)[0];
o += data;
}
var w = document.all ? window.document.body.offsetWidth : window.innerWidth
var table_width = w < 500 ? '1024px' : 'auto';
// console.log('tmp table width: %s (window width: %s)', table_width, w)
o = '<table style="visibility: visible; width: '+table_width+'; 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, w, h)
{
// console.log(source, dim, class_mode, even_class, id_prefix, w, h)
var tmp = this.GetIdAndClassName(class_mode);
var id = tmp[1];
if (!h) h = 100;
var cells = this.GetTableCells(source, dim, class_mode, even_class, id_prefix);
// var cells = this.GetTableCells(source, dim, class_mode, even_class, id_prefix, false, true);
// console.log('createing scroller %s w,h: %i,%i', id, cells[1],h)
return this.CreateScroller('<table style="table-layout: fixed; width: 100%;" id="'+id+'_'+this.GridId+'">\n'+cells[0]+'\n</table>\n\n', cells[1], h, 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].data ? source[0].data.length : source[0].length)) : needs_last;
var total_width = 0;
var width_printed = false;
for (var row=start_row; row<end_row; row++) {
row_data = source[row].data ? source[row].data : source[row];
var rh = '';
var row_id = this.IDs[row] ? 'id="'+id_prefix+this.IDs[row]+'"' : '';
var row_class = 'grid-'+class_name+'-row '+(even ? even_class : '')+' grid-'+class_name+'-row-'+row + (source[row].row_class ? ' '+source[row].row_class : '');
rh +='<tr '+row_id+' class="'+row_class+'" sequence="'+(row+1)+'">'+"\n"
even = !even;
total_width = 0;
if (this.LimitedHeights) {
var row_height = id.match(/^(left_)?header/) ? this.MaxHeaderHeights[row]+'px;' : this.MaxRowHeight+'px;'
var height_style = id.match(/^(left_)?header/) ? 'height: '+this.MaxHeaderHeights[row]+'px;' : 'height: '+this.MaxRowHeight+'px;';
}
else {
var row_height = 'auto'
var height_style = '';
}
for (var col=start_col; col<end_col; col++) {
total_width += this.MinWidths[col]+12;
var cursor_workaround = ['',''];
if (id.match(/^(left_)?header/) && is.gecko) {
cursor_workaround = ['<div id="' + this.GridId + '[cursor_work_around_A_'+col+'_'+row+']" style="width: '+(this.MinWidths[col])+'px; overflow: auto;"><div id="' + this.GridId + '[cursor_work_around_B_'+col+'_'+row+']" style="width: '+(this.MinWidths[col])+'px; overflow: hidden;">', '</div></div>'];
}
else {
if (this.LimitedHeights) {
cursor_workaround = ['<div id="_clipper_'+col+'_'+row+'" style="'+(is.ie ? '' : 'display: table-cell; ')+'vertical-align: inherit; overflow: hidden; max-height: '+row_height+'"><div style="overflow: hidden; max-height: '+row_height+'">','</div></div>'];
}
}
var width_style = width_printed ? '' : 'width: '+this.MinWidths[col]+'px;"'
var td_style = 'style="overflow: hidden; max-height: '+row_height+'; '+width_style+'"';
var td_class = 'grid-'+class_name+'-col-'+col;
if (this.FieldNames) {
td_class += ' '+this.FieldNames[col];
}
rh += "\t"+'<td '+td_style+' class="'+td_class+'">'+cursor_workaround[0]+row_data[col]+cursor_workaround[1]+'</td>'+"\n"
}
width_printed = true; // print widths in first row only
if (needs_last) {
rh += "\t"+'<td class="grid-'+class_name+'-last-cell"><img src="'+this.Spacer+'" width="1" height="1" alt=""/></td>'+"\n"
}
rh += '</tr>'+"\n"
o += rh;
}
return [o, total_width];
}
GridScroller.prototype.HasFooter = function()
{
return (this.Footer != false)
}
var colors = ['red', 'blue', 'green', 'pink', 'orange', 'brown', 'yellow', 'magenta', '#999', '#AAA', '#BBB', '#CCC', '#DDD', '#EEE', '#FFF'];
var next_color = 0;
GridScroller.prototype.CreateScroller = function(content, w, h, id, hidden, z, outer_class)
{
// console.log('creating scroller: ',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 = '';
if (!outer_class) outer_class='scoller-outer';
o += '<div '+outer_id+' class="'+outer_class+'" 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;
this.MaxHeaderHeightCorrection = (6*this.Header.length)+1;
}
GridScroller.prototype.SetFooter = function(a_footer)
{
this.Footer = a_footer;
}
GridScroller.prototype.SaveWidths = function()
{
if (!this.SaveURL) return;
var w = this.MinWidths.join(':');
Request.makeRequest(this.SaveURL.replace('#WIDTHS#', w), this.BusyRequest, '', this.successCallback, this.errorCallback, '', this);
}
GridScroller.prototype.ScheduleSaveWidths = function()
{
var obj = this;
if (this.SaveWidthsScheduled && this.SaveWidthsTimer) {
window.clearTimeout(this.SaveWidthsTimer);
this.SaveWidthsTimer = false;
}
this.SaveWidthsScheduled = true;
this.SaveWidthsTimer = window.setTimeout(function() {
obj.SaveWidths();
obj.SaveWidthsScheduled = false;
}, 800)
}
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/js/grid_scroller.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4.2.11
\ No newline at end of property
+1.4.2.12
\ No newline at end of property
Index: branches/RC/core/admin_templates/js/application.js
===================================================================
--- branches/RC/core/admin_templates/js/application.js (revision 11545)
+++ branches/RC/core/admin_templates/js/application.js (revision 11546)
@@ -1,121 +1,132 @@
function kApplication() {
this.Hooks = new Array ();
}
kApplication.prototype.footerInit = function () {
if (use_popups() && window.name.match(/[\d]+$/)) {
addEvent(
window, 'unload',
function() {
// alert('unload event; unload legal: ' + unload_legal);
if (!unload_legal && window.name != 'main') {
// it's set in submit_kernel_form - if we are submitting form, the unload is already handled
// if we got here, it means that we are closing window ilegally (through OS interace X button)
// alert('closing window');
// we need to clear temp tables then
getFrame('head').WatchClosing(window, _DropTempUrl);
}
}
);
// we need to set unload_legal to true if we are refreshing current window, because onunload will still fire
addEvent(document, 'keydown',
function(e) {
var code;
if (!e) var e = window.event;
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
if (code == 116 || (e.ctrlKey && code == 82)) {
unload_legal = true; //F5 or Ctrl+R
// alert('[document.keydown] setting unload_legal = true');
}
}
);
}
}
+kApplication.prototype.removeDebuggerStatistics = function () {
+ var $debug_statistics = $('table.dbg_stats_table:first');
+ if ($debug_statistics.length > 0) {
+ // remove debugger short report and preceeding line break, because
+ // this adds additional vertical scrollbar (no matter what document.style.overflow is)
+ // when used in Opera & Google Chrome
+ $debug_statistics.prev('br').remove();
+ $debug_statistics.remove();
+ }
+}
+
kApplication.prototype.SetVar = function ($name, $value) {
set_hidden_field($name, $value);
}
// hidden fields are printed in footer, that's why use this in m:OnAfterWindowLoad hook
kApplication.prototype.GetVar = function ($name) {
return get_hidden_field($name);
}
kApplication.prototype.setHook = function ($hook_to, $do_code, $hook_mode) {
if (!isset($hook_mode)) {
$hook_mode = hBEFORE;
}
if (typeof $hook_to == 'string') {
if ($hook_to == 'm:OnAfterWindowLoad') {
$(document).ready($do_code);
// call add load method here, when jquery not available
// this.addLoadEvent($do_code);
return ;
}
setArrayValue(this.Hooks, $hook_to, $hook_mode, $do_code);
}
else {
var $i = 0;
while ($i < $hook_to.length) {
this.setHook($hook_to[$i], $do_code, $hook_mode);
$i++;
}
}
}
kApplication.prototype.addLoadEvent = function (func, wnd) {
if (!wnd) wnd = window
var oldonload = wnd.onload;
if (typeof wnd.onload != 'function') {
wnd.onload = func;
} else {
wnd.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
kApplication.prototype.processHooks = function ($hook_to, $hook_mode) {
if (!isset($hook_mode)) {
$hook_mode = hBEFORE;
}
var $i = 0;
var $defined_hooks = getArrayValue(this.Hooks, $hook_to, $hook_mode);
while($i < $defined_hooks.length) {
var $do_event = new kEvent($hook_to);
$defined_hooks[$i]($do_event);
if (!$do_event.status) {
return false;
break;
}
$i++;
}
return true;
}
// =======================================
function kEvent($params) {
if ($params.match(/([^.:]*)[.]{0,1}([^:]*):(.*)/, $params)) {
this.Prefix = RegExp.$1;
this.Special = RegExp.$2;
this.Name = RegExp.$3;
}
else {
this.Prefix = '';
this.Special = '';
this.Name = '';
}
this.status = true;
}
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/js/application.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.4.3
\ No newline at end of property
+1.1.4.4
\ No newline at end of property
Index: branches/RC/core/admin_templates/popups/editor.tpl
===================================================================
--- branches/RC/core/admin_templates/popups/editor.tpl (revision 11545)
+++ branches/RC/core/admin_templates/popups/editor.tpl (revision 11546)
@@ -1,89 +1,86 @@
-<inp2:m_RequireLogin/><inp2:m_Set skip_last_template="1"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
-
-<body style="margin: 0px">
-
-<inp2:m_RenderElement name="blue_bar" prefix="trans" title_preset="trans_edit" module="in-portal"/>
+<inp2:m_Set skip_last_template="1"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="trans" section="in-portal:root" title_preset="trans_edit"/>
<!-- 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>
<div id="scroll_container" style="">
<table class="edit-form">
<tr><td style="padding: 0px">
<script type="text/javascript">
var $TargetField = '<inp2:m_Get var="TargetField"/>';
function FCKeditor_OnComplete( editorInstance )
{
var $opener = getWindowOpener(window);
if ($opener && !$opener.closed) {
current = $opener.document.getElementById($TargetField).value;
editorInstance.SetHTML(current);
}
else {
window_close();
}
Form.Resize();
}
function update_opener()
{
d = document.getElementById('Content');
if (d.form) {
if (d.form.onsubmit) {
d.form.onsubmit()
}
}
var $opener = getWindowOpener(window);
if (!$opener) {
return;
}
if (!$opener.closed) {
current = $opener.document.getElementById($TargetField);
current.value = document.getElementById('Content').value;
}
window_close();
}
</script>
<form name="frm" id="frm" action="javascript:update_opener();">
<inp2:adm_FCKEditor name="Content" width="100%" height="100" late_load="1"/>
</form>
<script type="text/javascript">
Form.addControl('Content___Frame');
</script>
</td></tr>
</table>
</div>
<inp2:m_Set _force_popup="1"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/popups/editor.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4.2.3
\ No newline at end of property
+1.4.2.4
\ No newline at end of property
Index: branches/RC/core/admin_templates/popups/translator.tpl
===================================================================
--- branches/RC/core/admin_templates/popups/translator.tpl (revision 11545)
+++ branches/RC/core/admin_templates/popups/translator.tpl (revision 11546)
@@ -1,52 +1,50 @@
-<inp2:m_RequireLogin perm_event="trans:OnLoad"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
-
-<body style="margin: 0px 8px 0px 8px; background-color: #fff;">
-
-<inp2:m_RenderElement name="blue_bar" prefix="trans" title_preset="trans_edit"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="trans" perm_event="trans:OnLoad" section="in-portal:root" title_preset="trans_edit"/>
<!-- 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"/>">
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="inp_edit_hidden" prefix="trans" field="Language"/>
<inp2:m_RenderElement name="subsection" title="!la_section_Translation!"/>
<inp2:m_RenderElement name="inp_label" prefix="trans" title="!la_fld_Original!" field="Original"/>
<inp2:m_RenderElement 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_RenderElement name="inp_edit_textarea" prefix="trans" field="Translation" title="!la_fld_Translation!" cols="70" rows="13"/>
<inp2:m_else/>
<inp2:m_RenderElement name="inp_edit_box" prefix="trans" field="Translation" title="!la_fld_Translation!" size="50"/>
</inp2:m_if>
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+
</table>
</div>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/popups/translator.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4.2.5
\ No newline at end of property
+1.4.2.6
\ No newline at end of property
Index: branches/RC/core/admin_templates/popups/column_picker.tpl
===================================================================
--- branches/RC/core/admin_templates/popups/column_picker.tpl (revision 11545)
+++ branches/RC/core/admin_templates/popups/column_picker.tpl (revision 11546)
@@ -1,90 +1,91 @@
<inp2:adm_SetPopupSize width="600" height="500"/>
-<inp2:m_RequireLogin login_template="login"/>
+
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="blue_bar" prefix="adm" title_preset="column_picker" module="in-portal"/>
+<inp2:m_RenderElement name="combined_header" prefix="adm" section="in-portal:root" title_preset="column_picker"/>
<!-- 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');
}
) );
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>
+
<div id="scroll_container">
-<table width="100%" border="0" cellspacing="0" cellpadding="4" >
- <tr>
- <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>
+ <table width="100%" border="0" cellspacing="0" cellpadding="4">
+ <tr>
+ <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>
</div>
-<input type="hidden" name="main_prefix" value="<inp2:m_get var='main_prefix'/>"/>
+<input type="hidden" name="main_prefix" value="<inp2:m_get var='main_prefix'/>"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/popups/column_picker.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4.2.2
\ No newline at end of property
+1.4.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/catalog/item_selector/item_selector_catalog.tpl
===================================================================
--- branches/RC/core/admin_templates/catalog/item_selector/item_selector_catalog.tpl (revision 11545)
+++ branches/RC/core/admin_templates/catalog/item_selector/item_selector_catalog.tpl (revision 11546)
@@ -1,42 +1,44 @@
+<inp2:adm_SetPopupSize width="970" height="580"/>
+
<inp2:m_include t="incs/header" noform="yes"/>
<inp2:m_include template="catalog/catalog_elements"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:browse" prefix="c" title_preset="catalog" tabs="catalog/item_selector/item_selector_tabs" additional_title_render_as="mode_selector_radio" additional_blue_bar_render_as="theme_selector"/>
<!-- 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="catalog/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>
<inp2:m_RenderElement name="catalog_search_box"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="kernel_form_end"/>
<!-- main kernel_form: 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" replace_m="yes"/>
<script type="text/javascript">
Application.setHook(
'm:OnAfterWindowLoad',
function() {
$Catalog.Init();
}
);
</script>
<inp2:m_include t="incs/footer" noform="yes"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/catalog/item_selector/item_selector_catalog.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5.2.7
\ No newline at end of property
+1.5.2.8
\ No newline at end of property
Index: branches/RC/core/admin_templates/catalog/item_selector/item_selector_advanced_view.tpl
===================================================================
--- branches/RC/core/admin_templates/catalog/item_selector/item_selector_advanced_view.tpl (revision 11545)
+++ branches/RC/core/admin_templates/catalog/item_selector/item_selector_advanced_view.tpl (revision 11546)
@@ -1,52 +1,54 @@
+<inp2:adm_SetPopupSize width="970" height="580"/>
+
<inp2:m_include t="incs/header" noform="yes"/>
<inp2:m_include template="catalog/catalog_elements"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:browse" prefix="c" title_preset="advanced_view" tabs="catalog/item_selector/item_selector_tabs" special=".showall" additional_title_render_as="mode_selector_radio" additional_blue_bar_render_as="theme_selector"/>
<inp2:m_set ts="showall" td="no"/>
<!-- 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="catalog/item_selector/item_selector_toolbar" is_catalog="0"/>
<script type="text/javascript">
Catalog.prototype.AfterInit = function() {
this.switchTab();
}
var $Catalog = new Catalog('<inp2:m_Link template="#TEMPLATE_NAME#" pass_through="ts,td,tm" ts="showall" td="no" m_cat_id="#CATEGORY_ID#" no_amp="1"/>', 'is_advanced_view_', 0);
</script>
</td>
<inp2:m_RenderElement name="catalog_search_box"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="kernel_form_end"/>
<!-- main kernel_form: end -->
<inp2:m_DefineElement name="tab_bodies">
<inp2:m_ModuleInclude template="catalog_tab" skip_prefixes="$skip_prefixes" replace_m="yes" tab_init="2"/>
</inp2:m_DefineElement>
<inp2:m_if check="m_Get" name="tp" equals_to="none|all">
<inp2:c_InitCatalog render_as="tab_bodies" replace_m="yes"/>
<inp2:m_else/>
<inp2:c_InitCatalog render_as="tab_bodies" replace_m="yes" skip_prefixes="c"/>
</inp2:m_if>
<script type="text/javascript">
Application.setHook(
'm:OnAfterWindowLoad',
function() {
$Catalog.Init();
}
);
</script>
<inp2:m_include t="incs/footer" noform="yes"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/catalog/item_selector/item_selector_advanced_view.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4.2.4
\ No newline at end of property
+1.4.2.5
\ No newline at end of property
Index: branches/RC/core/admin_templates/stylesheets/stylesheets_edit_base.tpl
===================================================================
--- branches/RC/core/admin_templates/stylesheets/stylesheets_edit_base.tpl (revision 11545)
+++ branches/RC/core/admin_templates/stylesheets/stylesheets_edit_base.tpl (revision 11546)
@@ -1,100 +1,100 @@
<inp2:adm_SetPopupSize width="750" height="400"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:configure_styles" prefix="css" title_preset="base_styles" pagination="1" pagination_prefix="selectors.base" tab_preset="Default"/>
<!-- 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('css','<inp2:css_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('css','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('css', '<inp2:css_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('css', '<inp2:css_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('new_selector', '<inp2:m_phrase label="la_ToolTip_NewBaseStyle" escape="1"/>',
function() {
set_hidden_field('remove_specials[selectors.base]',1);
std_new_item('selectors.base', 'stylesheets/base_style_edit')
} ) );
function edit()
{
set_hidden_field('remove_specials[selectors.base]',1);
std_edit_temp_item('selectors.base', 'stylesheets/base_style_edit');
}
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('selectors.base')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('clone', '<inp2:m_phrase label="la_ToolTip_Clone" escape="1"/>', function() {
set_hidden_field('remove_specials[selectors.base]',1);
submit_event('selectors.base','OnMassClone');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep4') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
<inp2:m_if check="css_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
//a_toolbar.HideButton('sep2');
<inp2:m_else/>
<inp2:m_if check="css_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="css_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="selectors.base" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_DefineElement name="grid_description_td">
<inp2:Field field="$field" grid="$grid" no_special="$no_special" cut_first="100"/>
</inp2:m_DefineElement>
-<inp2:m_RenderElement name="grid" PrefixSpecial="selectors.base" IdField="SelectorId" grid="Default" header_block="grid_column_title" data_block="grid_data_td" search="on"/>
+<inp2:m_RenderElement name="grid" PrefixSpecial="selectors.base" IdField="SelectorId" grid="Default"/>
<script type="text/javascript">
Grids['selectors.base'].SetDependantToolbarButtons( new Array('edit','delete','clone') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/stylesheets/stylesheets_edit_base.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.9.2.3
\ No newline at end of property
+1.9.2.4
\ No newline at end of property
Index: branches/RC/core/admin_templates/stylesheets/stylesheets_edit_block.tpl
===================================================================
--- branches/RC/core/admin_templates/stylesheets/stylesheets_edit_block.tpl (revision 11545)
+++ branches/RC/core/admin_templates/stylesheets/stylesheets_edit_block.tpl (revision 11546)
@@ -1,108 +1,108 @@
<inp2:adm_SetPopupSize width="750" height="400"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:configure_styles" prefix="css" grid="BlockStyles" title_preset="block_styles" pagination="1" pagination_prefix="selectors.block" tab_preset="Default"/>
<!-- 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('css','<inp2:css_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('css','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('css', '<inp2:css_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('css', '<inp2:css_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
//Relations related:
a_toolbar.AddButton( new ToolBarButton('new_selector', '<inp2:m_phrase label="la_ToolTip_NewBlockStyle" escape="1"/>',
function() {
set_hidden_field('remove_specials[selectors.block]',1);
std_new_item('selectors.block', 'stylesheets/block_style_edit')
} ) );
function edit()
{
set_hidden_field('remove_specials[selectors.block]',1);
std_edit_temp_item('selectors.block', 'stylesheets/block_style_edit');
}
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('selectors.block')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('clone', '<inp2:m_phrase label="la_ToolTip_Clone" escape="1"/>', function() {
set_hidden_field('remove_specials[selectors.block]',1);
submit_event('selectors.block','OnMassClone');
}
) );
a_toolbar.AddButton( new ToolBarButton('reset_to_base', '<inp2:m_phrase label="la_ToolTip_ResetToBase" escape="1"/>', function() {
set_hidden_field('remove_specials[selectors.block]',1);
submit_event('selectors.block','OnMassResetToBase');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep4') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
<inp2:m_if check="css_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
//a_toolbar.HideButton('sep2');
<inp2:m_else/>
<inp2:m_if check="css_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="css_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="selectors.block" grid="BlockStyles"/>
</tr>
</tbody>
</table>
<inp2:m_DefineElement name="grid_description_td">
<inp2:Field field="$field" grid="$grid" no_special="$no_special" cut_first="100"/>
</inp2:m_DefineElement>
-<inp2:m_RenderElement name="grid" PrefixSpecial="selectors.block" IdField="SelectorId" grid="BlockStyles" header_block="grid_column_title" data_block="grid_data_td" search="on"/>
+<inp2:m_RenderElement name="grid" PrefixSpecial="selectors.block" IdField="SelectorId" grid="BlockStyles"/>
<script type="text/javascript">
Grids['selectors.block'].SetDependantToolbarButtons( new Array('edit','delete','clone','reset_to_base') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/stylesheets/stylesheets_edit_block.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.10.2.4
\ No newline at end of property
+1.10.2.5
\ No newline at end of property
Index: branches/RC/core/admin_templates/stylesheets/block_style_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/stylesheets/block_style_edit.tpl (revision 11545)
+++ branches/RC/core/admin_templates/stylesheets/block_style_edit.tpl (revision 11546)
@@ -1,119 +1,114 @@
<inp2:adm_SetPopupSize width="750" height="400"/>
-<inp2:m_RequireLogin permissions="in-portal:configure_styles.view" system="1"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
-<inp2:m_RenderElement name="section_header" prefix="css" icon="icon46_style" module="in-portal" title="!la_title_Stylesheets!"/>
-
-
-<inp2:m_RenderElement name="blue_bar" prefix="css" title_preset="block_style_edit" module="in-portal" icon="icon46_style"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="css" section="in-portal:configure_styles" title_preset="block_style_edit"/>
<!-- 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('selectors','<inp2:selectors_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('selectors','OnCancel');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('reset_to_base', '<inp2:m_phrase label="la_ToolTip_ResetToBase" escape="1"/>', function() {
submit_event('selectors','OnResetToBase');
}
) );
a_toolbar.Render();
function ValidateRequired()
{
var $fields = new Array('<inp2:selectors_InputName field="Name"/>',
'<inp2:selectors_InputName field="SelectorName"/>');
var $ret = true;
var $i = 0;
var $value = '';
while($i < $fields.length)
{
$value = document.getElementById( $fields[$i] ).value;
$value = $value.replace(' ','');
if($value.length == 0)
{
$ret = false;
break;
}
$i++;
}
return $ret;
}
function editStyle()
{
if( ValidateRequired() )
{
openSelector('selectors', '<inp2:m_t t="stylesheets/style_editor" pass="all"/>', '', '850x460', 'OnOpenStyleEditor');
}
else
{
alert( RemoveTranslationLink('<inp2:m_phrase name="la_RequiredWarning"/>') );
}
}
</script>
</td>
</tr>
</tbody>
</table>
<inp2:selectors_SaveWarning name="grid_save_warning"/>
<inp2:selectors_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="selectors" field="StylesheetId"/>
<input type="hidden" name="<inp2:selectors_InputName field="Type"/>" value="2">
<inp2:m_RenderElement name="inp_id_label" prefix="selectors" field="SelectorId" title="!la_fld_SelectorId!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorName" title="!la_fld_SelectorName!" size="40"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="selectors" field="ParentId" title="!la_fld_SelectorBase!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="Name" title="!la_fld_Name!" size="40"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="selectors" field="Description" title="!la_fld_Description!" rows="10" cols="40"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="selectors" field="AdvancedCSS" title="!la_fld_AdvancedCSS!" rows="10" cols="40"/>
<tr class="<inp2:m_odd_even odd="edit-form-odd" even="edit-form-even"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="label-cell">
<inp2:m_phrase name="la_fld_SelectorData"/>:<br>
<a href="javascript:editStyle();"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
</td>
<td class="control-mid">&nbsp;</td>
<td class="control-cell">
<table width="100%">
<tr>
<td><inp2:m_phrase name="la_StyleDefinition"/>:</td>
<td>
<inp2:selectors_PrintStyle field="SelectorData"/>
</td>
<td><inp2:m_phrase name="la_StylePreview"/>:</td>
<td style="<inp2:selectors_PrintStyle field="SelectorData" inline="inline"/>">
<inp2:m_phrase name="la_SampleText"/>
</td>
</tr>
</table>
</td>
</tr>
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
<input type="hidden" name="main_prefix" id="main_prefix" value="selectors">
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/stylesheets/block_style_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.11.2.4
\ No newline at end of property
+1.11.2.5
\ No newline at end of property
Index: branches/RC/core/admin_templates/user_selector.tpl
===================================================================
--- branches/RC/core/admin_templates/user_selector.tpl (revision 11545)
+++ branches/RC/core/admin_templates/user_selector.tpl (revision 11546)
@@ -1,45 +1,60 @@
<inp2:adm_SetPopupSize width="582" height="504"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="u" section="in-portal:user_list" grid="UserSelector" title_preset="user_select" pagination="1"/>
<!-- 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()
- {
- submit_event('<inp2:m_Recall name="main_prefix"/>', 'OnSelectUser');
+ function edit() {
+ var $opener = getWindowOpener(window);
+
+ if ( $.isFunction($opener.processUserSelector) ) {
+ $opener.processUserSelector('<inp2:m_Recall name="dst_field"/>', window);
+ window_close();
+ }
+ else {
+ submit_event('<inp2:m_Recall name="main_prefix"/>', 'OnSelectUser');
+ }
}
+
+ var $user_logins = {};
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="u" grid="UserSelector"/>
</tr>
</tbody>
</table>
+<inp2:m_DefineElement name="grid_login_td" format="" no_special="1" nl2br="" first_chars="" td_style="">
+ <inp2:Field field="$field" first_chars="$first_chars" nl2br="$nl2br" grid="$grid" no_special="$no_special" format="$format"/>
+ <script type="text/javascript">
+ $user_logins[ <inp2:Field name="$IdField"/> ] = '<inp2:Field name="Login" js_ecape="1"/>';
+ </script>
+</inp2:m_DefineElement>
+
<inp2:m_RenderElement name="grid" PrefixSpecial="u" IdField="PortalUserId" grid="UserSelector" menu_filters="yes"/>
<script type="text/javascript">
Grids['u'].SetDependantToolbarButtons( new Array('select') );
-// Grids['u'].DblClick = function() {return false};
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/user_selector.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2.2.3
\ No newline at end of property
+1.2.2.4
\ No newline at end of property
Index: branches/RC/core/install/upgrades.sql
===================================================================
--- branches/RC/core/install/upgrades.sql (revision 11545)
+++ branches/RC/core/install/upgrades.sql (revision 11546)
@@ -1,1094 +1,1096 @@
# ===== v 4.0.1 =====
ALTER TABLE EmailLog ADD EventParams TEXT NOT NULL;
INSERT INTO ConfigurationAdmin VALUES ('MailFunctionHeaderSeparator', 'la_Text_smtp_server', 'la_config_MailFunctionHeaderSeparator', 'radio', NULL, '1=la_Linux,2=la_Windows', 30.08, 0, 0);
INSERT INTO ConfigurationValues VALUES (0, 'MailFunctionHeaderSeparator', 1, 'In-Portal', 'in-portal:configure_general');
ALTER TABLE PersistantSessionData DROP PRIMARY KEY ;
ALTER TABLE PersistantSessionData ADD INDEX ( `PortalUserId` ) ;
# ===== v 4.1.0 =====
ALTER TABLE EmailMessage ADD ReplacementTags TEXT AFTER Template;
ALTER TABLE Phrase
CHANGE Translation Translation TEXT NOT NULL,
CHANGE Module Module VARCHAR(30) NOT NULL DEFAULT 'In-Portal';
ALTER TABLE Category
CHANGE Description Description TEXT,
CHANGE l1_Description l1_Description TEXT,
CHANGE l2_Description l2_Description TEXT,
CHANGE l3_Description l3_Description TEXT,
CHANGE l4_Description l4_Description TEXT,
CHANGE l5_Description l5_Description TEXT,
CHANGE CachedNavbar CachedNavbar text,
CHANGE l1_CachedNavbar l1_CachedNavbar text,
CHANGE l2_CachedNavbar l2_CachedNavbar text,
CHANGE l3_CachedNavbar l3_CachedNavbar text,
CHANGE l4_CachedNavbar l4_CachedNavbar text,
CHANGE l5_CachedNavbar l5_CachedNavbar text,
CHANGE ParentPath ParentPath TEXT NULL DEFAULT NULL,
CHANGE NamedParentPath NamedParentPath TEXT NULL DEFAULT NULL;
ALTER TABLE ConfigurationAdmin CHANGE ValueList ValueList TEXT;
ALTER TABLE EmailQueue
CHANGE `Subject` `Subject` TEXT,
CHANGE toaddr toaddr TEXT,
CHANGE fromaddr fromaddr TEXT;
ALTER TABLE Category DROP Pop;
ALTER TABLE PortalUser
CHANGE CreatedOn CreatedOn INT DEFAULT NULL,
CHANGE dob dob INT(11) NULL DEFAULT NULL,
CHANGE PassResetTime PassResetTime INT(11) UNSIGNED NULL DEFAULT NULL,
CHANGE PwRequestTime PwRequestTime INT(11) UNSIGNED NULL DEFAULT NULL,
CHANGE `Password` `Password` VARCHAR(255) NULL DEFAULT 'd41d8cd98f00b204e9800998ecf8427e';
ALTER TABLE Modules
CHANGE BuildDate BuildDate INT UNSIGNED NULL DEFAULT NULL,
CHANGE Version Version VARCHAR(10) NOT NULL DEFAULT '0.0.0',
CHANGE `Var` `Var` VARCHAR(100) NOT NULL DEFAULT '';
ALTER TABLE Language
CHANGE Enabled Enabled INT(11) NOT NULL DEFAULT '1',
CHANGE InputDateFormat InputDateFormat VARCHAR(50) NOT NULL DEFAULT 'm/d/Y',
CHANGE InputTimeFormat InputTimeFormat VARCHAR(50) NOT NULL DEFAULT 'g:i:s A',
CHANGE DecimalPoint DecimalPoint VARCHAR(10) NOT NULL DEFAULT '',
CHANGE ThousandSep ThousandSep VARCHAR(10) NOT NULL DEFAULT '';
ALTER TABLE Events CHANGE FromUserId FromUserId INT(11) NOT NULL DEFAULT '-1';
ALTER TABLE StdDestinations CHANGE DestAbbr2 DestAbbr2 CHAR(2) NULL DEFAULT NULL;
ALTER TABLE PermCache DROP DACL;
ALTER TABLE PortalGroup CHANGE CreatedOn CreatedOn INT UNSIGNED NULL DEFAULT NULL;
ALTER TABLE UserSession
CHANGE SessionKey SessionKey INT UNSIGNED NULL DEFAULT NULL ,
CHANGE CurrentTempKey CurrentTempKey INT UNSIGNED NULL DEFAULT NULL ,
CHANGE PrevTempKey PrevTempKey INT UNSIGNED NULL DEFAULT NULL ,
CHANGE LastAccessed LastAccessed INT UNSIGNED NOT NULL DEFAULT '0',
CHANGE PortalUserId PortalUserId INT(11) NOT NULL DEFAULT '-2',
CHANGE Language Language INT(11) NOT NULL DEFAULT '1',
CHANGE Theme Theme INT(11) NOT NULL DEFAULT '1';
CREATE TABLE Counters (
CounterId int(10) unsigned NOT NULL auto_increment,
Name varchar(100) NOT NULL default '',
CountQuery text,
CountValue text,
LastCounted int(10) unsigned default NULL,
LifeTime int(10) unsigned NOT NULL default '3600',
IsClone tinyint(3) unsigned NOT NULL default '0',
TablesAffected text,
PRIMARY KEY (CounterId),
UNIQUE KEY Name (Name)
);
CREATE TABLE Skins (
`SkinId` int(11) NOT NULL auto_increment,
`Name` varchar(255) default NULL,
`CSS` text,
`Logo` varchar(255) default NULL,
`Options` text,
`LastCompiled` int(11) NOT NULL default '0',
`IsPrimary` int(1) NOT NULL default '0',
PRIMARY KEY (`SkinId`)
);
INSERT INTO Skins VALUES (DEFAULT, 'Default', '/* General elements */\r\n\r\nhtml {\r\n height: 100%;\r\n}\r\n\r\nbody {\r\n font-family: verdana,arial,helvetica,sans-serif;\r\n font-size: 9pt;\r\n color: #000000;\r\n overflow-x: auto; overflow-y: auto;\r\n margin: 0px 0px 0px 0px;\r\n text-decoration: none;\r\n}\r\n\r\na {\r\n color: #006699;\r\n text-decoration: none;\r\n}\r\n\r\na:hover {\r\n color: #009ff0;\r\n text-decoration: none;\r\n}\r\n\r\nform {\r\n display: inline;\r\n}\r\n\r\nimg { border: 0px; }\r\n\r\nbody.height-100 {\r\n height: 100%;\r\n}\r\n\r\nbody.regular-body {\r\n margin: 0px 10px 5px 10px;\r\n color: #000000;\r\n background-color: @@SectionBgColor@@;\r\n}\r\n\r\nbody.edit-popup {\r\n margin: 0px 0px 0px 0px;\r\n}\r\n\r\ntable.collapsed {\r\n border-collapse: collapse;\r\n}\r\n\r\n.bordered, table.bordered, .bordered-no-bottom {\r\n border: 1px solid #000000;\r\n border-collapse: collapse;\r\n}\r\n\r\n.bordered-no-bottom {\r\n border-bottom: none;\r\n}\r\n\r\n.login-table td {\r\n padding: 1px;\r\n}\r\n\r\n.disabled {\r\n background-color: #ebebeb;\r\n}\r\n\r\n/* Head frame */\r\n.head-table tr td {\r\n background-color: @@HeadBgColor@@;\r\n color: @@HeadColor@@\r\n}\r\n\r\ntd.kx-block-header, .head-table tr td.kx-block-header{\r\n color: @@HeadBarColor@@;\r\n background-color: @@HeadBarBgColor@@;\r\n padding-left: 7px;\r\n padding-right: 7px;\r\n}\r\n\r\na.kx-header-link {\r\n text-decoration: underline;\r\n color: #FFFFFF;\r\n}\r\n\r\na.kx-header-link:hover {\r\n color: #FFCB05;\r\n text-decoration: none;\r\n}\r\n\r\n.kx-secondary-foreground {\r\n color: @@HeadBarColor@@;\r\n background-color: @@HeadBarBgColor@@;\r\n}\r\n\r\n.kx-login-button {\r\n background-color: #2D79D6;\r\n color: #FFFFFF;\r\n}\r\n\r\n/* General form button (yellow) */\r\n.button {\r\n font-size: 12px;\r\n font-weight: normal;\r\n color: #000000;\r\n background: url(@@base_url@@/proj-base/admin_templates/img/button_back.gif) #f9eeae repeat-x;\r\n text-decoration: none;\r\n}\r\n\r\n/* Disabled (grayed-out) form button */\r\n.button-disabled {\r\n font-size: 12px;\r\n font-weight: normal;\r\n color: #676767;\r\n background: url(@@base_url@@/proj-base/admin_templates/img/button_back_disabled.gif) #f9eeae repeat-x;\r\n text-decoration: none;\r\n}\r\n\r\n/* Tabs bar */\r\n\r\n.tab, .tab-active {\r\n background-color: #F0F1EB;\r\n padding: 3px 7px 2px 7px;\r\n border-top: 1px solid black;\r\n border-left: 1px solid black;\r\n border-right: 1px solid black;\r\n}\r\n\r\n.tab-active {\r\n background-color: #2D79D6;\r\n border-bottom: 1px solid #2D79D6;\r\n}\r\n\r\n.tab a {\r\n color: #00659C;\r\n font-weight: bold;\r\n}\r\n\r\n.tab-active a {\r\n color: #fff;\r\n font-weight: bold;\r\n}\r\n\r\n\r\n/* Toolbar */\r\n\r\n.toolbar {\r\n font-size: 8pt;\r\n border: 1px solid #000000;\r\n border-width: 0px 1px 1px 1px;\r\n background-color: @@ToolbarBgColor@@;\r\n border-collapse: collapse;\r\n}\r\n\r\n.toolbar td {\r\n height: 100%;\r\n}\r\n\r\n.toolbar-button, .toolbar-button-disabled, .toolbar-button-over {\r\n float: left;\r\n text-align: center;\r\n font-size: 8pt;\r\n padding: 5px 5px 5px 5px;\r\n vertical-align: middle;\r\n color: #006F99;\r\n}\r\n\r\n.toolbar-button-over {\r\n color: #000;\r\n}\r\n\r\n.toolbar-button-disabled {\r\n color: #444;\r\n}\r\n\r\n/* Scrollable Grids */\r\n\r\n\r\n/* Main Grid class */\r\n.grid-scrollable {\r\n padding: 0px;\r\n border: 1px solid black !important;\r\n border-top: none !important;\r\n}\r\n\r\n/* Div generated by js, which contains all the scrollable grid elements, affects the style of scrollable area without data (if there are too few rows) */\r\n.grid-container {\r\n background-color: #fff;\r\n}\r\n\r\n.grid-container table {\r\n border-collapse: collapse;\r\n}\r\n\r\n/* Inner div generated in each data-cell */\r\n.grid-cell-div {\r\n overflow: hidden;\r\n height: auto;\r\n}\r\n\r\n/* Main row definition */\r\n.grid-data-row td, .grid-data-row-selected td, .grid-data-row-even-selected td, .grid-data-row-mouseover td, .table-color1, .table-color2 {\r\n font-weight: normal;\r\n color: @@OddColor@@;\r\n background-color: @@OddBgColor@@;\r\n padding: 3px 5px 3px 5px;\r\n height: 30px;\r\n overflow: hidden;\r\n /* border-right: 1px solid black; */\r\n}\r\n.grid-data-row-even td, .table-color2 {\r\n background-color: @@EvenBgColor@@;\r\n color: @@EvenColor@@;\r\n}\r\n.grid-data-row td a, .grid-data-row-selected td a, .grid-data-row-mouseover td a {\r\n text-decoration: underline;\r\n}\r\n\r\n/* mouse-over rows */\r\n.grid-data-row-mouseover td {\r\n background: #FFFDF4;\r\n}\r\n\r\n/* Selected row, applies to both checkbox and data areas */\r\n.grid-data-row-selected td {\r\n background: #FEF2D6;\r\n}\r\n\r\n.grid-data-row-even-selected td {\r\n background: #FFF7E0;\r\n}\r\n\r\n/* General header cell definition */\r\n.grid-header-row td {\r\n font-weight: bold;\r\n background-color: @@ColumnTitlesBgColor@@;\r\n text-decoration: none;\r\n padding: 3px 5px 3px 5px;\r\n color: @@ColumnTitlesColor@@;\r\n border-right: none;\r\n text-align: left;\r\n vertical-align: middle !important;\r\n white-space: nowrap;\r\n /* border-right: 1px solid black; */\r\n}\r\n\r\n/* Filters row */\r\ntr.grid-header-row-0 td {\r\n background-color: @@FiltersBgColor@@;\r\n border-bottom: 1px solid black;\r\n}\r\n\r\n/* Grid Filters */\r\ntable.range-filter {\r\n width: 100%;\r\n}\r\n\r\n.range-filter td {\r\n padding: 0px 0px 2px 2px !important;\r\n border: none !important;\r\n font-size: 8pt !important;\r\n font-weight: normal !important;\r\n text-align: left;\r\n color: #000000 !important;\r\n}\r\n\r\ninput.filter, select.filter {\r\n margin-bottom: 0px;\r\n width: 85%;\r\n}\r\n\r\ninput.filter-active {\r\n background-color: #FFFF00;\r\n}\r\n\r\nselect.filter-active {\r\n background-color: #FFFF00;\r\n}\r\n\r\n/* Column titles row */\r\ntr.grid-header-row-1 td {\r\n height: 25px;\r\n font-weight: bold;\r\n background-color: @@ColumnTitlesBgColor@@;\r\n color: @@ColumnTitlesColor@@;\r\n}\r\n\r\ntr.grid-header-row-1 td a {\r\n color: @@ColumnTitlesColor@@;\r\n}\r\n\r\ntr.grid-header-row-1 td a:hover {\r\n color: #FFCC00;\r\n}\r\n\r\n\r\n.grid-footer-row td {\r\n background-color: #D7D7D7;\r\n font-weight: bold;\r\n border-right: none;\r\n padding: 3px 5px 3px 5px;\r\n}\r\n\r\ntd.grid-header-last-cell, td.grid-data-last-cell, td.grid-footer-last-cell {\r\n border-right: none !important;\r\n}\r\n\r\ntd.grid-data-col-0, td.grid-data-col-0 div {\r\n text-align: center;\r\n vertical-align: middle !important;\r\n}\r\n\r\ntr.grid-header-row-0 td.grid-header-col-0 {\r\n text-align: center;\r\n vertical-align: middle !important;\r\n}\r\n\r\ntr.grid-header-row-0 td.grid-header-col-0 div {\r\n display: table-cell;\r\n vertical-align: middle;\r\n}\r\n\r\n.grid-status-bar {\r\n border: 1px solid black;\r\n border-top: none;\r\n padding: 0px;\r\n width: 100%;\r\n border-collapse: collapse;\r\n height: 30px;\r\n}\r\n\r\n.grid-status-bar td {\r\n background-color: @@TitleBarBgColor@@;\r\n color: @@TitleBarColor@@;\r\n font-size: 11pt;\r\n font-weight: normal;\r\n padding: 2px 8px 2px 8px;\r\n}\r\n\r\n/* /Scrollable Grids */\r\n\r\n\r\n/* Forms */\r\ntable.edit-form {\r\n border: none;\r\n border-top-width: 0px;\r\n border-collapse: collapse;\r\n width: 100%;\r\n}\r\n\r\n.edit-form-odd, .edit-form-even {\r\n padding: 0px;\r\n}\r\n\r\n.subsectiontitle {\r\n font-size: 10pt;\r\n font-weight: bold;\r\n background-color: #4A92CE;\r\n color: #fff;\r\n height: 25px;\r\n border-top: 1px solid black;\r\n}\r\n\r\n.label-cell {\r\n background: #DEE7F6 url(@@base_url@@/proj-base/admin_templates/img/bgr_input_name_line.gif) no-repeat right bottom;\r\n font: 12px arial, sans-serif;\r\n padding: 4px 20px;\r\n width: 150px;\r\n}\r\n\r\n.control-mid {\r\n width: 13px;\r\n border-left: 1px solid #7A95C2;\r\n background: #fff url(@@base_url@@/proj-base/admin_templates/img/bgr_mid.gif) repeat-x left bottom;\r\n}\r\n\r\n.control-cell {\r\n font: 11px arial, sans-serif;\r\n padding: 4px 10px 5px 5px;\r\n background: #fff url(@@base_url@@/proj-base/admin_templates/img/bgr_input_line.gif) no-repeat left bottom;\r\n width: auto;\r\n vertical-align: middle;\r\n}\r\n\r\n.label-cell-filler {\r\n background: #DEE7F6 none;\r\n}\r\n.control-mid-filler {\r\n background: #fff none;\r\n border-left: 1px solid #7A95C2;\r\n}\r\n.control-cell-filler {\r\n background: #fff none;\r\n}\r\n\r\n\r\n.error-cell {\r\n background-color: #fff;\r\n color: red;\r\n}\r\n\r\n.form-warning {\r\n color: red;\r\n}\r\n\r\n.req-note {\r\n font-style: italic;\r\n color: #333;\r\n}\r\n\r\n#scroll_container table.tableborder {\r\n border-collapse: separate\r\n}\r\n\r\n\r\n/* Uploader */\r\n\r\n.uploader-main {\r\n position: absolute;\r\n display: none;\r\n z-index: 10;\r\n border: 1px solid #777;\r\n padding: 10px;\r\n width: 350px;\r\n height: 120px;\r\n overflow: hidden;\r\n background-color: #fff;\r\n}\r\n\r\n.uploader-percent {\r\n width: 100%;\r\n padding-top: 3px;\r\n text-align: center;\r\n position: relative;\r\n z-index: 20;\r\n float: left;\r\n font-weight: bold;\r\n}\r\n\r\n.uploader-left {\r\n width: 100%;\r\n border: 1px solid black;\r\n height: 20px;\r\n background: #fff url(@@base_url@@/core/admin_templates/img/progress_left.gif);\r\n}\r\n\r\n.uploader-done {\r\n width: 0%;\r\n background-color: green;\r\n height: 20px;\r\n background: #4A92CE url(@@base_url@@/core/admin_templates/img/progress_done.gif);\r\n}\r\n\r\n\r\n/* To be sorted */\r\n\r\n\r\n/* Section title, right to the big icon */\r\n.admintitle {\r\n font-size: 16pt;\r\n font-weight: bold;\r\n color: @@SectionColor@@;\r\n text-decoration: none;\r\n}\r\n\r\n/* Left sid of bluebar */\r\n.header_left_bg {\r\n background-color: @@TitleBarBgColor@@;\r\n background-image: none;\r\n padding-left: 5px;\r\n}\r\n\r\n/* Right side of bluebar */\r\n.tablenav, tablenav a {\r\n font-size: 11pt;\r\n font-weight: bold;\r\n color: @@TitleBarColor@@;\r\n\r\n text-decoration: none;\r\n background-color: @@TitleBarBgColor@@;\r\n background-image: none;\r\n}\r\n\r\n/* Section title in the bluebar * -- why ''link''? :S */\r\n.tablenav_link {\r\n font-size: 11pt;\r\n font-weight: bold;\r\n color: @@TitleBarColor@@;\r\n text-decoration: none;\r\n}\r\n\r\n/* Active page in top and bottom bluebars pagination */\r\n.current_page {\r\n font-size: 10pt;\r\n font-weight: bold;\r\n background-color: #fff;\r\n color: #2D79D6;\r\n padding: 3px 2px 3px 3px;\r\n}\r\n\r\n/* Other pages and arrows in pagination on blue */\r\n.nav_url {\r\n font-size: 10pt;\r\n font-weight: bold;\r\n color: #fff;\r\n padding: 3px 2px 3px 3px;\r\n}\r\n\r\n/* Tree */\r\n.tree-body {\r\n background-color: @@TreeBgColor@@;\r\n height: 100%\r\n}\r\n\r\n.tree_head.td, .tree_head, .tree_head:hover {\r\n font-weight: bold;\r\n font-size: 10px;\r\n color: #FFFFFF;\r\n font-family: Verdana, Arial;\r\n text-decoration: none;\r\n}\r\n\r\n.tree {\r\n padding: 0px;\r\n border: none;\r\n border-collapse: collapse;\r\n}\r\n\r\n.tree tr td {\r\n padding: 0px;\r\n margin: 0px;\r\n font-family: helvetica, arial, verdana,;\r\n font-size: 11px;\r\n white-space: nowrap;\r\n}\r\n\r\n.tree tr td a {\r\n font-size: 11px;\r\n color: @@TreeColor@@;\r\n font-family: Helvetica, Arial, Verdana;\r\n text-decoration: none;\r\n padding: 2px 0px 2px 2px;\r\n}\r\n\r\n.tree tr.highlighted td a {\r\n background-color: @@TreeHighBgColor@@;\r\n color: @@TreeHighColor@@;\r\n}\r\n\r\n.tree tr.highlighted td a:hover {\r\n color: #fff;\r\n}\r\n\r\n.tree tr td a:hover {\r\n color: #000000;\r\n}', 'just_logo.gif', 'a:20:{s:11:"HeadBgColor";a:2:{s:11:"Description";s:27:"Head frame background color";s:5:"Value";s:7:"#1961B8";}s:9:"HeadColor";a:2:{s:11:"Description";s:21:"Head frame text color";s:5:"Value";s:7:"#CCFF00";}s:14:"SectionBgColor";a:2:{s:11:"Description";s:28:"Section bar background color";s:5:"Value";s:7:"#FFFFFF";}s:12:"SectionColor";a:2:{s:11:"Description";s:22:"Section bar text color";s:5:"Value";s:7:"#2D79D6";}s:12:"HeadBarColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:14:"HeadBarBgColor";a:1:{s:5:"Value";s:7:"#1961B8";}s:13:"TitleBarColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:15:"TitleBarBgColor";a:1:{s:5:"Value";s:7:"#2D79D6";}s:14:"ToolbarBgColor";a:1:{s:5:"Value";s:7:"#F0F1EB";}s:14:"FiltersBgColor";a:1:{s:5:"Value";s:7:"#D7D7D7";}s:17:"ColumnTitlesColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:19:"ColumnTitlesBgColor";a:1:{s:5:"Value";s:7:"#999999";}s:8:"OddColor";a:1:{s:5:"Value";s:7:"#000000";}s:10:"OddBgColor";a:1:{s:5:"Value";s:7:"#F6F6F6";}s:9:"EvenColor";a:1:{s:5:"Value";s:7:"#000000";}s:11:"EvenBgColor";a:1:{s:5:"Value";s:7:"#EBEBEB";}s:9:"TreeColor";a:1:{s:5:"Value";s:7:"#006F99";}s:11:"TreeBgColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:13:"TreeHighColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:15:"TreeHighBgColor";a:1:{s:5:"Value";s:7:"#4A92CE";}}', 1178706881, 1);
INSERT INTO Permissions VALUES (0, 'in-portal:skins.view', 11, 1, 1, 0), (0, 'in-portal:skins.add', 11, 1, 1, 0), (0, 'in-portal:skins.edit', 11, 1, 1, 0), (0, 'in-portal:skins.delete', 11, 1, 1, 0);
# ===== v 4.1.1 =====
DROP TABLE EmailQueue;
CREATE TABLE EmailQueue (
EmailQueueId int(10) unsigned NOT NULL auto_increment,
ToEmail varchar(255) NOT NULL default '',
`Subject` varchar(255) NOT NULL default '',
MessageHeaders text,
MessageBody longtext,
Queued int(10) unsigned NOT NULL default '0',
SendRetries int(10) unsigned NOT NULL default '0',
LastSendRetry int(10) unsigned NOT NULL default '0',
PRIMARY KEY (EmailQueueId),
KEY LastSendRetry (LastSendRetry),
KEY SendRetries (SendRetries)
);
ALTER TABLE Events ADD ReplacementTags TEXT AFTER Event;
# ===== v 4.2.0 =====
ALTER TABLE CustomField ADD MultiLingual TINYINT UNSIGNED NOT NULL DEFAULT '1' AFTER FieldLabel;
ALTER TABLE Category
ADD TreeLeft BIGINT NOT NULL AFTER ParentPath,
ADD TreeRight BIGINT NOT NULL AFTER TreeLeft;
ALTER TABLE Category ADD INDEX (TreeLeft);
ALTER TABLE Category ADD INDEX (TreeRight);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CategoriesRebuildSerial', '0', 'In-Portal', '');
UPDATE ConfigurationAdmin SET `element_type` = 'textarea' WHERE `VariableName` IN ('Category_MetaKey', 'Category_MetaDesc');
ALTER TABLE PortalUser
CHANGE FirstName FirstName VARCHAR(255) NOT NULL DEFAULT '',
CHANGE LastName LastName VARCHAR(255) NOT NULL DEFAULT '';
# ===== v 4.2.1 =====
INSERT INTO ConfigurationAdmin VALUES ('UseSmallHeader', 'la_Text_Website', 'la_config_UseSmallHeader', 'checkbox', '', '', 10.21, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseSmallHeader', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationAdmin VALUES ('User_Default_Registration_Country', 'la_Text_General', 'la_config_DefaultRegistrationCountry', 'select', NULL , '=+,<SQL>SELECT DestName AS OptionName, DestId AS OptionValue FROM <PREFIX>StdDestinations WHERE DestParentId IS NULL Order BY OptionName</SQL>', 10.111, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'User_Default_Registration_Country', '', 'In-Portal:Users', 'in-portal:configure_users');
ALTER TABLE Category ADD SymLinkCategoryId INT UNSIGNED NULL DEFAULT NULL AFTER `Type`, ADD INDEX (SymLinkCategoryId);
ALTER TABLE ConfigurationValues CHANGE VariableValue VariableValue TEXT NULL DEFAULT NULL;
ALTER TABLE Language
ADD AdminInterfaceLang TINYINT UNSIGNED NOT NULL AFTER PrimaryLang,
ADD Priority INT NOT NULL AFTER AdminInterfaceLang;
UPDATE Language SET AdminInterfaceLang = 1 WHERE PrimaryLang = 1;
DELETE FROM PersistantSessionData WHERE VariableName = 'lang_columns_.';
ALTER TABLE SessionData CHANGE VariableValue VariableValue longtext NOT NULL;
INSERT INTO ConfigurationAdmin VALUES ('CSVExportDelimiter', 'la_Text_CSV_Export', 'la_config_CSVExportDelimiter', 'select', NULL, '0=la_Tab,1=la_Comma,2=la_Semicolon,3=la_Space,4=la_Colon', 40.1, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('CSVExportEnclosure', 'la_Text_CSV_Export', 'la_config_CSVExportEnclosure', 'radio', NULL, '0=la_Doublequotes,1=la_Quotes', 40.2, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('CSVExportSeparator', 'la_Text_CSV_Export', 'la_config_CSVExportSeparator', 'radio', NULL, '0=la_Linux,1=la_Windows', 40.3, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('CSVExportEncoding', 'la_Text_CSV_Export', 'la_config_CSVExportEncoding', 'radio', NULL, '0=la_Unicode,1=la_Regular', 40.4, 0, 1);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportDelimiter', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportEnclosure', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportSeparator', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportEncoding', '0', 'In-Portal', 'in-portal:configure_general');
# ===== v 4.2.2 =====
INSERT INTO ConfigurationAdmin VALUES ('UseColumnFreezer', 'la_Text_Website', 'la_config_UseColumnFreezer', 'checkbox', '', '', 10.22, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseColumnFreezer', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationAdmin VALUES ('TrimRequiredFields', 'la_Text_Website', 'la_config_TrimRequiredFields', 'checkbox', '', '', 10.23, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'TrimRequiredFields', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationAdmin VALUES ('MenuFrameWidth', 'la_title_General', 'la_prompt_MenuFrameWidth', 'text', NULL, NULL, '11', '0', '0');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'MenuFrameWidth', 200, 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationAdmin VALUES ('DefaultSettingsUserId', 'la_title_General', 'la_prompt_DefaultUserId', 'text', NULL, NULL, '12', '0', '0');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'DefaultSettingsUserId', -1, 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationAdmin VALUES ('KeepSessionOnBrowserClose', 'la_title_General', 'la_prompt_KeepSessionOnBrowserClose', 'checkbox', NULL, NULL, '13', '0', '0');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'KeepSessionOnBrowserClose', 0, 'In-Portal', 'in-portal:configure_general');
ALTER TABLE PersistantSessionData ADD VariableId BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
# ===== v 4.3.0 =====
INSERT INTO ConfigurationAdmin VALUES ('u_MaxImageCount', 'la_section_ImageSettings', 'la_config_MaxImageCount', 'text', '', '', 30.01, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('u_ThumbnailImageWidth', 'la_section_ImageSettings', 'la_config_ThumbnailImageWidth', 'text', '', '', 30.02, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('u_ThumbnailImageHeight', 'la_section_ImageSettings', 'la_config_ThumbnailImageHeight', 'text', '', '', 30.03, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('u_FullImageWidth', 'la_section_ImageSettings', 'la_config_FullImageWidth', 'text', '', '', 30.04, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('u_FullImageHeight', 'la_section_ImageSettings', 'la_config_FullImageHeight', 'text', '', '', 30.05, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_MaxImageCount', 5, 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_ThumbnailImageWidth', 120, 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_ThumbnailImageHeight', 120, 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_FullImageWidth', 450, 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_FullImageHeight', 450, 'In-Portal:Users', 'in-portal:configure_users');
CREATE TABLE ChangeLogs (
ChangeLogId bigint(20) NOT NULL auto_increment,
PortalUserId int(11) NOT NULL default '0',
SessionLogId int(11) NOT NULL default '0',
`Action` tinyint(4) NOT NULL default '0',
OccuredOn int(11) NOT NULL default '0',
Prefix varchar(255) NOT NULL default '',
ItemId bigint(20) NOT NULL default '0',
Changes text NOT NULL,
MasterPrefix varchar(255) NOT NULL default '',
MasterId bigint(20) NOT NULL default '0',
PRIMARY KEY (ChangeLogId),
KEY PortalUserId (PortalUserId),
KEY SessionLogId (SessionLogId),
KEY `Action` (`Action`),
KEY OccuredOn (OccuredOn),
KEY Prefix (Prefix),
KEY MasterPrefix (MasterPrefix)
);
CREATE TABLE SessionLogs (
SessionLogId bigint(20) NOT NULL auto_increment,
PortalUserId int(11) NOT NULL default '0',
SessionId int(10) NOT NULL default '0',
`Status` tinyint(4) NOT NULL default '1',
SessionStart int(11) NOT NULL default '0',
SessionEnd int(11) default NULL,
IP varchar(15) NOT NULL default '',
AffectedItems int(11) NOT NULL default '0',
PRIMARY KEY (SessionLogId),
KEY SessionId (SessionId),
KEY `Status` (`Status`),
KEY PortalUserId (PortalUserId)
);
ALTER TABLE CustomField ADD INDEX (MultiLingual), ADD INDEX (DisplayOrder), ADD INDEX (OnGeneralTab), ADD INDEX (IsSystem);
ALTER TABLE ConfigurationAdmin ADD INDEX (DisplayOrder), ADD INDEX (GroupDisplayOrder), ADD INDEX (Install);
ALTER TABLE EmailSubscribers ADD INDEX (EmailMessageId), ADD INDEX (PortalUserId);
ALTER TABLE Events ADD INDEX (`Type`), ADD INDEX (Enabled);
ALTER TABLE Language ADD INDEX (Enabled), ADD INDEX (PrimaryLang), ADD INDEX (AdminInterfaceLang), ADD INDEX (Priority);
ALTER TABLE Modules ADD INDEX (Loaded), ADD INDEX (LoadOrder);
ALTER TABLE PhraseCache ADD INDEX (CacheDate), ADD INDEX (ThemeId), ADD INDEX (StylesheetId);
ALTER TABLE PortalGroup ADD INDEX (CreatedOn);
ALTER TABLE PortalUser ADD INDEX (Status), ADD INDEX (Modified), ADD INDEX (dob), ADD INDEX (IsBanned);
ALTER TABLE Theme ADD INDEX (Enabled), ADD INDEX (StylesheetId), ADD INDEX (PrimaryTheme);
ALTER TABLE UserGroup ADD INDEX (MembershipExpires), ADD INDEX (ExpirationReminderSent);
ALTER TABLE EmailLog ADD INDEX (`timestamp`);
ALTER TABLE StdDestinations ADD INDEX (DestType), ADD INDEX (DestParentId);
ALTER TABLE Category ADD INDEX (Status), ADD INDEX (CreatedOn), ADD INDEX (EditorsPick);
ALTER TABLE Stylesheets ADD INDEX (Enabled), ADD INDEX (LastCompiled);
ALTER TABLE Counters ADD INDEX (IsClone), ADD INDEX (LifeTime), ADD INDEX (LastCounted);
ALTER TABLE Skins ADD INDEX (IsPrimary), ADD INDEX (LastCompiled);
INSERT INTO ConfigurationAdmin VALUES ('UseChangeLog', 'la_Text_Website', 'la_config_UseChangeLog', 'checkbox', '', '', 10.25, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseChangeLog', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationAdmin VALUES ('AutoRefreshIntervals', 'la_Text_Website', 'la_config_AutoRefreshIntervals', 'text', '', '', 10.26, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AutoRefreshIntervals', '1,5,15,30,60,120,240', 'In-Portal', 'in-portal:configure_general');
DELETE FROM Cache WHERE SUBSTRING(VarName, 1, 7) = 'mod_rw_';
ALTER TABLE Category CHANGE `Status` `Status` TINYINT(4) NOT NULL DEFAULT '2';
# ===== v 4.3.1 =====
INSERT INTO ConfigurationAdmin VALUES ('RememberLastAdminTemplate', 'la_Text_General', 'la_config_RememberLastAdminTemplate', 'checkbox', '', '', 10.13, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'RememberLastAdminTemplate', '', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationAdmin VALUES ('AllowSelectGroupOnFront', 'la_Text_General', 'la_config_AllowSelectGroupOnFront', 'checkbox', NULL, NULL, 10.13, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AllowSelectGroupOnFront', '0', 'In-Portal:Users', 'in-portal:configure_users');
CREATE TABLE StatisticsCapture (
StatisticsId int(10) unsigned NOT NULL auto_increment,
TemplateName varchar(255) NOT NULL default '',
Hits int(10) unsigned NOT NULL default '0',
LastHit int(11) NOT NULL default '0',
ScriptTimeMin decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
ScriptTimeAvg decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
ScriptTimeMax decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
SqlTimeMin decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
SqlTimeAvg decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
SqlTimeMax decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
SqlCountMin decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
SqlCountAvg decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
SqlCountMax decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
PRIMARY KEY (StatisticsId),
KEY TemplateName (TemplateName),
KEY Hits (Hits),
KEY LastHit (LastHit),
KEY ScriptTimeMin (ScriptTimeMin),
KEY ScriptTimeAvg (ScriptTimeAvg),
KEY ScriptTimeMax (ScriptTimeMax),
KEY SqlTimeMin (SqlTimeMin),
KEY SqlTimeAvg (SqlTimeAvg),
KEY SqlTimeMax (SqlTimeMax),
KEY SqlCountMin (SqlCountMin),
KEY SqlCountAvg (SqlCountAvg),
KEY SqlCountMax (SqlCountMax)
);
CREATE TABLE SlowSqlCapture (
CaptureId int(10) unsigned NOT NULL auto_increment,
TemplateNames text,
Hits int(10) unsigned NOT NULL default '0',
LastHit int(11) NOT NULL default '0',
SqlQuery text,
TimeMin decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
TimeAvg decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
TimeMax decimal(40,20) unsigned NOT NULL default '0.00000000000000000000',
QueryCrc int(11) NOT NULL default '0',
PRIMARY KEY (CaptureId),
KEY Hits (Hits),
KEY LastHit (LastHit),
KEY TimeMin (TimeMin),
KEY TimeAvg (TimeAvg),
KEY TimeMax (TimeMax),
KEY QueryCrc (QueryCrc)
);
ALTER TABLE PortalGroup ADD FrontRegistration TINYINT UNSIGNED NOT NULL;
UPDATE PortalGroup SET FrontRegistration = 1 WHERE GroupId = 13;
INSERT INTO ConfigurationAdmin VALUES ('ForceImageMagickResize', 'la_Text_Website', 'la_config_ForceImageMagickResize', 'checkbox', '', '', 10.28, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'ForceImageMagickResize', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationAdmin VALUES ('AdminSSL_URL', 'la_Text_Website', 'la_config_AdminSSL_URL', 'text', '', '', 10.091, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AdminSSL_URL', '', 'In-Portal', 'in-portal:configure_general');
# ===== v 4.3.9 =====
ALTER TABLE CustomField
CHANGE ValueList ValueList TEXT NULL DEFAULT NULL,
ADD DefaultValue VARCHAR(255) NOT NULL AFTER ValueList,
ADD INDEX (DefaultValue);
UPDATE CustomField SET ValueList = REPLACE(ValueList, ',', '||');
CREATE TABLE Agents (
AgentId int(11) NOT NULL auto_increment,
AgentName varchar(255) NOT NULL default '',
AgentType tinyint(3) unsigned NOT NULL default '1',
Status tinyint(3) unsigned NOT NULL default '1',
Event varchar(255) NOT NULL default '',
RunInterval int(10) unsigned NOT NULL default '0',
RunMode tinyint(3) unsigned NOT NULL default '2',
LastRunOn int(10) unsigned default NULL,
LastRunStatus tinyint(3) unsigned NOT NULL default '1',
NextRunOn int(11) default NULL,
RunTime int(10) unsigned NOT NULL default '0',
PRIMARY KEY (AgentId),
KEY Status (Status),
KEY RunInterval (RunInterval),
KEY RunMode (RunMode),
KEY AgentType (AgentType),
KEY LastRunOn (LastRunOn),
KEY LastRunStatus (LastRunStatus),
KEY RunTime (RunTime),
KEY NextRunOn (NextRunOn)
);
INSERT INTO Permissions VALUES(DEFAULT, 'in-portal:agents.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'in-portal:agents.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'in-portal:agents.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'in-portal:agents.view', 11, 1, 1, 0);
INSERT INTO ConfigurationAdmin VALUES ('FilenameSpecialCharReplacement', 'la_Text_General', 'la_config_FilenameSpecialCharReplacement', 'select', NULL, '_=+_,-=+-', 10.16, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'FilenameSpecialCharReplacement', '_', 'In-Portal', 'in-portal:configure_categories');
CREATE TABLE SpellingDictionary (
SpellingDictionaryId int(11) NOT NULL auto_increment,
MisspelledWord varchar(255) NOT NULL default '',
SuggestedCorrection varchar(255) NOT NULL default '',
PRIMARY KEY (SpellingDictionaryId),
KEY MisspelledWord (MisspelledWord),
KEY SuggestedCorrection (SuggestedCorrection)
);
INSERT INTO ConfigurationValues VALUES(NULL, 'YahooApplicationId', '', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationAdmin VALUES('YahooApplicationId', 'la_Text_General', 'la_config_YahooApplicationId', 'text', NULL, NULL, 10.15, 0, 0);
CREATE TABLE Thesaurus (
ThesaurusId int(11) NOT NULL auto_increment,
SearchTerm varchar(255) NOT NULL default '',
ThesaurusTerm varchar(255) NOT NULL default '',
ThesaurusType tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (ThesaurusId),
KEY ThesaurusType (ThesaurusType),
KEY SearchTerm (SearchTerm)
);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:ban_rulelist.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:ban_rulelist.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:ban_rulelist.add', 11, 1, 1, 0);
ALTER TABLE Language ADD FilenameReplacements TEXT NULL AFTER UnitSystem;
ALTER TABLE Language ADD Locale varchar(10) NOT NULL default 'en-US' AFTER FilenameReplacements;
CREATE TABLE LocalesList (
LocaleId int(11) NOT NULL auto_increment,
LocaleIdentifier varchar(6) NOT NULL default '',
LocaleName varchar(255) NOT NULL default '',
Locale varchar(20) NOT NULL default '',
ScriptTag varchar(255) NOT NULL default '',
ANSICodePage varchar(10) NOT NULL default '',
PRIMARY KEY (LocaleId)
);
INSERT INTO LocalesList VALUES
(1, '0x0436', 'Afrikaans (South Africa)', 'af-ZA', 'Latn', '1252'),
(2, '0x041c', 'Albanian (Albania)', 'sq-AL', 'Latn', '1252'),
(3, '0x0484', 'Alsatian (France)', 'gsw-FR', '', ''),
(4, '0x045e', 'Amharic (Ethiopia)', 'am-ET', '', 'UTF-8'),
(5, '0x1401', 'Arabic (Algeria)', 'ar-DZ', 'Arab', '1256'),
(6, '0x3c01', 'Arabic (Bahrain)', 'ar-BH', 'Arab', '1256'),
(7, '0x0c01', 'Arabic (Egypt)', 'ar-EG', 'Arab', '1256'),
(8, '0x0801', 'Arabic (Iraq)', 'ar-IQ', 'Arab', '1256'),
(9, '0x2c01', 'Arabic (Jordan)', 'ar-JO', 'Arab', '1256'),
(10, '0x3401', 'Arabic (Kuwait)', 'ar-KW', 'Arab', '1256'),
(11, '0x3001', 'Arabic (Lebanon)', 'ar-LB', 'Arab', '1256'),
(12, '0x1001', 'Arabic (Libya)', 'ar-LY', 'Arab', '1256'),
(13, '0x1801', 'Arabic (Morocco)', 'ar-MA', 'Arab', '1256'),
(14, '0x2001', 'Arabic (Oman)', 'ar-OM', 'Arab', '1256'),
(15, '0x4001', 'Arabic (Qatar)', 'ar-QA', 'Arab', '1256'),
(16, '0x0401', 'Arabic (Saudi Arabia)', 'ar-SA', 'Arab', '1256'),
(17, '0x2801', 'Arabic (Syria)', 'ar-SY', 'Arab', '1256'),
(18, '0x1c01', 'Arabic (Tunisia)', 'ar-TN', 'Arab', '1256'),
(19, '0x3801', 'Arabic (U.A.E.)', 'ar-AE', 'Arab', '1256'),
(20, '0x2401', 'Arabic (Yemen)', 'ar-YE', 'Arab', '1256'),
(21, '0x042b', 'Armenian (Armenia)', 'hy-AM', 'Armn', 'UTF-8'),
(22, '0x044d', 'Assamese (India)', 'as-IN', '', 'UTF-8'),
(23, '0x082c', 'Azeri (Azerbaijan, Cyrillic)', 'az-Cyrl-AZ', 'Cyrl', '1251'),
(24, '0x042c', 'Azeri (Azerbaijan, Latin)', 'az-Latn-AZ', 'Latn', '1254'),
(25, '0x046d', 'Bashkir (Russia)', 'ba-RU', '', ''),
(26, '0x042d', 'Basque (Basque)', 'eu-ES', 'Latn', '1252'),
(27, '0x0423', 'Belarusian (Belarus)', 'be-BY', 'Cyrl', '1251'),
(28, '0x0445', 'Bengali (India)', 'bn-IN', 'Beng', 'UTF-8'),
(29, '0x201a', 'Bosnian (Bosnia and Herzegovina, Cyrillic)', 'bs-Cyrl-BA', 'Cyrl', '1251'),
(30, '0x141a', 'Bosnian (Bosnia and Herzegovina, Latin)', 'bs-Latn-BA', 'Latn', '1250'),
(31, '0x047e', 'Breton (France)', 'br-FR', 'Latn', '1252'),
(32, '0x0402', 'Bulgarian (Bulgaria)', 'bg-BG', 'Cyrl', '1251'),
(33, '0x0403', 'Catalan (Catalan)', 'ca-ES', 'Latn', '1252'),
(34, '0x0c04', 'Chinese (Hong Kong SAR, PRC)', 'zh-HK', 'Hant', '950'),
(35, '0x1404', 'Chinese (Macao SAR)', 'zh-MO', 'Hant', '950'),
(36, '0x0804', 'Chinese (PRC)', 'zh-CN', 'Hans', '936'),
(37, '0x1004', 'Chinese (Singapore)', 'zh-SG', 'Hans', '936'),
(38, '0x0404', 'Chinese (Taiwan)', 'zh-TW', 'Hant', '950'),
(39, '0x101a', 'Croatian (Bosnia and Herzegovina, Latin)', 'hr-BA', 'Latn', '1250'),
(40, '0x041a', 'Croatian (Croatia)', 'hr-HR', 'Latn', '1250'),
(41, '0x0405', 'Czech (Czech Republic)', 'cs-CZ', 'Latn', '1250'),
(42, '0x0406', 'Danish (Denmark)', 'da-DK', 'Latn', '1252'),
(43, '0x048c', 'Dari (Afghanistan)', 'prs-AF', 'Arab', '1256'),
(44, '0x0465', 'Divehi (Maldives)', 'dv-MV', 'Thaa', 'UTF-8'),
(45, '0x0813', 'Dutch (Belgium)', 'nl-BE', 'Latn', '1252'),
(46, '0x0413', 'Dutch (Netherlands)', 'nl-NL', 'Latn', '1252'),
(47, '0x0c09', 'English (Australia)', 'en-AU', 'Latn', '1252'),
(48, '0x2809', 'English (Belize)', 'en-BZ', 'Latn', '1252'),
(49, '0x1009', 'English (Canada)', 'en-CA', 'Latn', '1252'),
(50, '0x2409', 'English (Caribbean)', 'en-029', 'Latn', '1252'),
(51, '0x4009', 'English (India)', 'en-IN', 'Latn', '1252'),
(52, '0x1809', 'English (Ireland)', 'en-IE', 'Latn', '1252'),
(53, '0x2009', 'English (Jamaica)', 'en-JM', 'Latn', '1252'),
(54, '0x4409', 'English (Malaysia)', 'en-MY', 'Latn', '1252'),
(55, '0x1409', 'English (New Zealand)', 'en-NZ', 'Latn', '1252'),
(56, '0x3409', 'English (Philippines)', 'en-PH', 'Latn', '1252'),
(57, '0x4809', 'English (Singapore)', 'en-SG', 'Latn', '1252'),
(58, '0x1c09', 'English (South Africa)', 'en-ZA', 'Latn', '1252'),
(59, '0x2c09', 'English (Trinidad and Tobago)', 'en-TT', 'Latn', '1252'),
(60, '0x0809', 'English (United Kingdom)', 'en-GB', 'Latn', '1252'),
(61, '0x0409', 'English (United States)', 'en-US', 'Latn', '1252'),
(62, '0x3009', 'English (Zimbabwe)', 'en-ZW', 'Latn', '1252'),
(63, '0x0425', 'Estonian (Estonia)', 'et-EE', 'Latn', '1257'),
(64, '0x0438', 'Faroese (Faroe Islands)', 'fo-FO', 'Latn', '1252'),
(65, '0x0464', 'Filipino (Philippines)', 'fil-PH', 'Latn', '1252'),
(66, '0x040b', 'Finnish (Finland)', 'fi-FI', 'Latn', '1252'),
(67, '0x080c', 'French (Belgium)', 'fr-BE', 'Latn', '1252'),
(68, '0x0c0c', 'French (Canada)', 'fr-CA', 'Latn', '1252'),
(69, '0x040c', 'French (France)', 'fr-FR', 'Latn', '1252'),
(70, '0x140c', 'French (Luxembourg)', 'fr-LU', 'Latn', '1252'),
(71, '0x180c', 'French (Monaco)', 'fr-MC', 'Latn', '1252'),
(72, '0x100c', 'French (Switzerland)', 'fr-CH', 'Latn', '1252'),
(73, '0x0462', 'Frisian (Netherlands)', 'fy-NL', 'Latn', '1252'),
(74, '0x0456', 'Galician (Spain)', 'gl-ES', 'Latn', '1252'),
(75, '0x0437', 'Georgian (Georgia)', 'ka-GE', 'Geor', 'UTF-8'),
(76, '0x0c07', 'German (Austria)', 'de-AT', 'Latn', '1252'),
(77, '0x0407', 'German (Germany)', 'de-DE', 'Latn', '1252'),
(78, '0x1407', 'German (Liechtenstein)', 'de-LI', 'Latn', '1252'),
(79, '0x1007', 'German (Luxembourg)', 'de-LU', 'Latn', '1252'),
(80, '0x0807', 'German (Switzerland)', 'de-CH', 'Latn', '1252'),
(81, '0x0408', 'Greek (Greece)', 'el-GR', 'Grek', '1253'),
(82, '0x046f', 'Greenlandic (Greenland)', 'kl-GL', 'Latn', '1252'),
(83, '0x0447', 'Gujarati (India)', 'gu-IN', 'Gujr', 'UTF-8'),
(84, '0x0468', 'Hausa (Nigeria, Latin)', 'ha-Latn-NG', 'Latn', '1252'),
(85, '0x040d', 'Hebrew (Israel)', 'he-IL', 'Hebr', '1255'),
(86, '0x0439', 'Hindi (India)', 'hi-IN', 'Deva', 'UTF-8'),
(87, '0x040e', 'Hungarian (Hungary)', 'hu-HU', 'Latn', '1250'),
(88, '0x040f', 'Icelandic (Iceland)', 'is-IS', 'Latn', '1252'),
(89, '0x0470', 'Igbo (Nigeria)', 'ig-NG', '', ''),
(90, '0x0421', 'Indonesian (Indonesia)', 'id-ID', 'Latn', '1252'),
(91, '0x085d', 'Inuktitut (Canada, Latin)', 'iu-Latn-CA', 'Latn', '1252'),
(92, '0x045d', 'Inuktitut (Canada, Syllabics)', 'iu-Cans-CA', 'Cans', 'UTF-8'),
(93, '0x083c', 'Irish (Ireland)', 'ga-IE', 'Latn', '1252'),
(94, '0x0410', 'Italian (Italy)', 'it-IT', 'Latn', '1252'),
(95, '0x0810', 'Italian (Switzerland)', 'it-CH', 'Latn', '1252'),
(96, '0x0411', 'Japanese (Japan)', 'ja-JP', 'Hani;Hira;Kana', '932'),
(97, '0x044b', 'Kannada (India)', 'kn-IN', 'Knda', 'UTF-8'),
(98, '0x043f', 'Kazakh (Kazakhstan)', 'kk-KZ', 'Cyrl', '1251'),
(99, '0x0453', 'Khmer (Cambodia)', 'kh-KH', 'Khmr', 'UTF-8'),
(100, '0x0486', 'K''iche (Guatemala)', 'qut-GT', 'Latn', '1252'),
(101, '0x0487', 'Kinyarwanda (Rwanda)', 'rw-RW', 'Latn', '1252'),
(102, '0x0457', 'Konkani (India)', 'kok-IN', 'Deva', 'UTF-8'),
(103, '0x0812', 'Windows 95, Windows NT 4.0 only: Korean (Johab)', '', '', ''),
(104, '0x0412', 'Korean (Korea)', 'ko-KR', 'Hang;Hani', '949'),
(105, '0x0440', 'Kyrgyz (Kyrgyzstan)', 'ky-KG', 'Cyrl', '1251'),
(106, '0x0454', 'Lao (Lao PDR)', 'lo-LA', 'Laoo', 'UTF-8'),
(107, '0x0426', 'Latvian (Latvia)', 'lv-LV', 'Latn', '1257'),
(108, '0x0427', 'Lithuanian (Lithuania)', 'lt-LT', 'Latn', '1257'),
(109, '0x082e', 'Lower Sorbian (Germany)', 'dsb-DE', 'Latn', '1252'),
(110, '0x046e', 'Luxembourgish (Luxembourg)', 'lb-LU', 'Latn', '1252'),
(111, '0x042f', 'Macedonian (Macedonia, FYROM)', 'mk-MK', 'Cyrl', '1251'),
(112, '0x083e', 'Malay (Brunei Darussalam)', 'ms-BN', 'Latn', '1252'),
(113, '0x043e', 'Malay (Malaysia)', 'ms-MY', 'Latn', '1252'),
(114, '0x044c', 'Malayalam (India)', 'ml-IN', 'Mlym', 'UTF-8'),
(115, '0x043a', 'Maltese (Malta)', 'mt-MT', 'Latn', '1252'),
(116, '0x0481', 'Maori (New Zealand)', 'mi-NZ', 'Latn', '1252'),
(117, '0x047a', 'Mapudungun (Chile)', 'arn-CL', 'Latn', '1252'),
(118, '0x044e', 'Marathi (India)', 'mr-IN', 'Deva', 'UTF-8'),
(119, '0x047c', 'Mohawk (Canada)', 'moh-CA', 'Latn', '1252'),
(120, '0x0450', 'Mongolian (Mongolia)', 'mn-Cyrl-MN', 'Cyrl', '1251'),
(121, '0x0850', 'Mongolian (PRC)', 'mn-Mong-CN', 'Mong', 'UTF-8'),
(122, '0x0850', 'Nepali (India)', 'ne-IN', '__', 'UTF-8'),
(123, '0x0461', 'Nepali (Nepal)', 'ne-NP', 'Deva', 'UTF-8'),
(124, '0x0414', 'Norwegian (Bokmål, Norway)', 'nb-NO', 'Latn', '1252'),
(125, '0x0814', 'Norwegian (Nynorsk, Norway)', 'nn-NO', 'Latn', '1252'),
(126, '0x0482', 'Occitan (France)', 'oc-FR', 'Latn', '1252'),
(127, '0x0448', 'Oriya (India)', 'or-IN', 'Orya', 'UTF-8'),
(128, '0x0463', 'Pashto (Afghanistan)', 'ps-AF', '', ''),
(129, '0x0429', 'Persian (Iran)', 'fa-IR', 'Arab', '1256'),
(130, '0x0415', 'Polish (Poland)', 'pl-PL', 'Latn', '1250'),
(131, '0x0416', 'Portuguese (Brazil)', 'pt-BR', 'Latn', '1252'),
(132, '0x0816', 'Portuguese (Portugal)', 'pt-PT', 'Latn', '1252'),
(133, '0x0446', 'Punjabi (India)', 'pa-IN', 'Guru', 'UTF-8'),
(134, '0x046b', 'Quechua (Bolivia)', 'quz-BO', 'Latn', '1252'),
(135, '0x086b', 'Quechua (Ecuador)', 'quz-EC', 'Latn', '1252'),
(136, '0x0c6b', 'Quechua (Peru)', 'quz-PE', 'Latn', '1252'),
(137, '0x0418', 'Romanian (Romania)', 'ro-RO', 'Latn', '1250'),
(138, '0x0417', 'Romansh (Switzerland)', 'rm-CH', 'Latn', '1252'),
(139, '0x0419', 'Russian (Russia)', 'ru-RU', 'Cyrl', '1251'),
(140, '0x243b', 'Sami (Inari, Finland)', 'smn-FI', 'Latn', '1252'),
(141, '0x103b', 'Sami (Lule, Norway)', 'smj-NO', 'Latn', '1252'),
(142, '0x143b', 'Sami (Lule, Sweden)', 'smj-SE', 'Latn', '1252'),
(143, '0x0c3b', 'Sami (Northern, Finland)', 'se-FI', 'Latn', '1252'),
(144, '0x043b', 'Sami (Northern, Norway)', 'se-NO', 'Latn', '1252'),
(145, '0x083b', 'Sami (Northern, Sweden)', 'se-SE', 'Latn', '1252'),
(146, '0x203b', 'Sami (Skolt, Finland)', 'sms-FI', 'Latn', '1252'),
(147, '0x183b', 'Sami (Southern, Norway)', 'sma-NO', 'Latn', '1252'),
(148, '0x1c3b', 'Sami (Southern, Sweden)', 'sma-SE', 'Latn', '1252'),
(149, '0x044f', 'Sanskrit (India)', 'sa-IN', 'Deva', 'UTF-8'),
(150, '0x1c1a', 'Serbian (Bosnia and Herzegovina, Cyrillic)', 'sr-Cyrl-BA', 'Cyrl', '1251'),
(151, '0x181a', 'Serbian (Bosnia and Herzegovina, Latin)', 'sr-Latn-BA', 'Latn', '1250'),
(152, '0x0c1a', 'Serbian (Serbia, Cyrillic)', 'sr-Cyrl-CS', 'Cyrl', '1251'),
(153, '0x081a', 'Serbian (Serbia, Latin)', 'sr-Latn-CS', 'Latn', '1250'),
(154, '0x046c', 'Sesotho sa Leboa/Northern Sotho (South Africa)', 'ns-ZA', 'Latn', '1252'),
(155, '0x0432', 'Setswana/Tswana (South Africa)', 'tn-ZA', 'Latn', '1252'),
(156, '0x045b', 'Sinhala (Sri Lanka)', 'si-LK', 'Sinh', 'UTF-8'),
(157, '0x041b', 'Slovak (Slovakia)', 'sk-SK', 'Latn', '1250'),
(158, '0x0424', 'Slovenian (Slovenia)', 'sl-SI', 'Latn', '1250'),
(159, '0x2c0a', 'Spanish (Argentina)', 'es-AR', 'Latn', '1252'),
(160, '0x400a', 'Spanish (Bolivia)', 'es-BO', 'Latn', '1252'),
(161, '0x340a', 'Spanish (Chile)', 'es-CL', 'Latn', '1252'),
(162, '0x240a', 'Spanish (Colombia)', 'es-CO', 'Latn', '1252'),
(163, '0x140a', 'Spanish (Costa Rica)', 'es-CR', 'Latn', '1252'),
(164, '0x1c0a', 'Spanish (Dominican Republic)', 'es-DO', 'Latn', '1252'),
(165, '0x300a', 'Spanish (Ecuador)', 'es-EC', 'Latn', '1252'),
(166, '0x440a', 'Spanish (El Salvador)', 'es-SV', 'Latn', '1252'),
(167, '0x100a', 'Spanish (Guatemala)', 'es-GT', 'Latn', '1252'),
(168, '0x480a', 'Spanish (Honduras)', 'es-HN', 'Latn', '1252'),
(169, '0x080a', 'Spanish (Mexico)', 'es-MX', 'Latn', '1252'),
(170, '0x4c0a', 'Spanish (Nicaragua)', 'es-NI', 'Latn', '1252'),
(171, '0x180a', 'Spanish (Panama)', 'es-PA', 'Latn', '1252'),
(172, '0x3c0a', 'Spanish (Paraguay)', 'es-PY', 'Latn', '1252'),
(173, '0x280a', 'Spanish (Peru)', 'es-PE', 'Latn', '1252'),
(174, '0x500a', 'Spanish (Puerto Rico)', 'es-PR', 'Latn', '1252'),
(175, '0x0c0a', 'Spanish (Spain)', 'es-ES', 'Latn', '1252'),
(176, '0x040a', 'Spanish (Spain, Traditional Sort)', 'es-ES_tradnl', 'Latn', '1252'),
(177, '0x540a', 'Spanish (United States)', 'es-US', '', ''),
(178, '0x380a', 'Spanish (Uruguay)', 'es-UY', 'Latn', '1252'),
(179, '0x200a', 'Spanish (Venezuela)', 'es-VE', 'Latn', '1252'),
(180, '0x0441', 'Swahili (Kenya)', 'sw-KE', 'Latn', '1252'),
(181, '0x081d', 'Swedish (Finland)', 'sv-FI', 'Latn', '1252'),
(182, '0x041d', 'Swedish (Sweden)', 'sv-SE', 'Latn', '1252'),
(183, '0x045a', 'Syriac (Syria)', 'syr-SY', 'Syrc', 'UTF-8'),
(184, '0x0428', 'Tajik (Tajikistan)', 'tg-Cyrl-TJ', 'Cyrl', '1251'),
(185, '0x085f', 'Tamazight (Algeria, Latin)', 'tzm-Latn-DZ', 'Latn', '1252'),
(186, '0x0449', 'Tamil (India)', 'ta-IN', 'Taml', 'UTF-8'),
(187, '0x0444', 'Tatar (Russia)', 'tt-RU', 'Cyrl', '1251'),
(188, '0x044a', 'Telugu (India)', 'te-IN', 'Telu', 'UTF-8'),
(189, '0x041e', 'Thai (Thailand)', 'th-TH', 'Thai', '874'),
(190, '0x0851', 'Tibetan (Bhutan)', 'bo-BT', 'Tibt', 'UTF-8'),
(191, '0x0451', 'Tibetan (PRC)', 'bo-CN', 'Tibt', 'UTF-8'),
(192, '0x041f', 'Turkish (Turkey)', 'tr-TR', 'Latn', '1254'),
(193, '0x0442', 'Turkmen (Turkmenistan)', 'tk-TM', 'Cyrl', '1251'),
(194, '0x0480', 'Uighur (PRC)', 'ug-CN', 'Arab', '1256'),
(195, '0x0422', 'Ukrainian (Ukraine)', 'uk-UA', 'Cyrl', '1251'),
(196, '0x042e', 'Upper Sorbian (Germany)', 'wen-DE', 'Latn', '1252'),
(197, '0x0820', 'Urdu (India)', 'tr-IN', '', ''),
(198, '0x0420', 'Urdu (Pakistan)', 'ur-PK', 'Arab', '1256'),
(199, '0x0843', 'Uzbek (Uzbekistan, Cyrillic)', 'uz-Cyrl-UZ', 'Cyrl', '1251'),
(200, '0x0443', 'Uzbek (Uzbekistan, Latin)', 'uz-Latn-UZ', 'Latn', '1254'),
(201, '0x042a', 'Vietnamese (Vietnam)', 'vi-VN', 'Latn', '1258'),
(202, '0x0452', 'Welsh (United Kingdom)', 'cy-GB', 'Latn', '1252'),
(203, '0x0488', 'Wolof (Senegal)', 'wo-SN', 'Latn', '1252'),
(204, '0x0434', 'Xhosa/isiXhosa (South Africa)', 'xh-ZA', 'Latn', '1252'),
(205, '0x0485', 'Yakut (Russia)', 'sah-RU', 'Cyrl', '1251'),
(206, '0x0478', 'Yi (PRC)', 'ii-CN', 'Yiii', 'UTF-8'),
(207, '0x046a', 'Yoruba (Nigeria)', 'yo-NG', '', ''),
(208, '0x0435', 'Zulu/isiZulu (South Africa)', 'zu-ZA', 'Latn', '1252');
UPDATE Phrase SET Module = 'Core' WHERE Module IN ('Proj-Base', 'In-Portal');
UPDATE Phrase SET Module = 'Core' WHERE Phrase IN ('la_fld_Phone', 'la_fld_City', 'la_fld_State', 'la_fld_Zip');
UPDATE Phrase SET Module = 'Core' WHERE Phrase IN ('la_col_Image', 'la_col_Username', 'la_fld_AddressLine1', 'la_fld_AddressLine2', 'la_fld_Comments', 'la_fld_Country', 'la_fld_Email', 'la_fld_Language', 'la_fld_Login', 'la_fld_MessageText', 'la_fld_MetaDescription', 'la_fld_MetaKeywords', 'la_fld_Password', 'la_fld_Username', 'la_fld_Type');
UPDATE Phrase SET Phrase = 'la_Add' WHERE Phrase = 'LA_ADD';
UPDATE Phrase SET Phrase = 'la_col_MembershipExpires' WHERE Phrase = 'la_col_membershipexpires';
UPDATE Phrase SET Phrase = 'la_ShortToolTip_Clone' WHERE Phrase = 'la_shorttooltip_clone';
UPDATE Phrase SET Phrase = 'la_ShortToolTip_Edit' WHERE Phrase = 'LA_SHORTTOOLTIP_EDIT';
UPDATE Phrase SET Phrase = 'la_ShortToolTip_Export' WHERE Phrase = 'LA_SHORTTOOLTIP_EXPORT';
UPDATE Phrase SET Phrase = 'la_ShortToolTip_GoUp' WHERE Phrase = 'LA_SHORTTOOLTIP_GOUP';
UPDATE Phrase SET Phrase = 'la_ShortToolTip_Import' WHERE Phrase = 'LA_SHORTTOOLTIP_IMPORT';
UPDATE Phrase SET Phrase = 'la_ShortToolTip_MoveUp' WHERE Phrase = 'la_shorttooltip_moveup';
UPDATE Phrase SET Phrase = 'la_ShortToolTip_MoveDown' WHERE Phrase = 'la_shorttooltip_movedown';
UPDATE Phrase SET Phrase = 'la_ShortToolTip_RescanThemes' WHERE Phrase = 'la_shorttooltip_rescanthemes';
UPDATE Phrase SET Phrase = 'la_ShortToolTip_SetPrimary' WHERE Phrase = 'LA_SHORTTOOLTIP_SETPRIMARY';
UPDATE Phrase SET Phrase = 'la_ShortToolTip_Rebuild' WHERE Phrase = 'LA_SHORTTOOLTIP_REBUILD';
UPDATE Phrase SET Phrase = 'la_Tab_Service' WHERE Phrase = 'la_tab_service';
UPDATE Phrase SET Phrase = 'la_tab_Files' WHERE Phrase = 'la_tab_files';
UPDATE Phrase SET Phrase = 'la_ToolTipShort_Edit_Current_Category' WHERE Phrase = 'LA_TOOLTIPSHORT_EDIT_CURRENT_CATEGORY';
UPDATE Phrase SET Phrase = 'la_ToolTip_Add' WHERE Phrase = 'LA_TOOLTIP_ADD';
UPDATE Phrase SET Phrase = 'la_ToolTip_Add_Product' WHERE Phrase = 'LA_TOOLTIP_ADD_PRODUCT';
UPDATE Phrase SET Phrase = 'la_ToolTip_NewSearchConfig' WHERE Phrase = 'LA_TOOLTIP_NEWSEARCHCONFIG';
UPDATE Phrase SET Phrase = 'la_ToolTip_Prev' WHERE Phrase = 'la_tooltip_prev';
UPDATE Phrase SET Phrase = 'la_Invalid_Password' WHERE Phrase = 'la_invalid_password';
UPDATE Events SET Module = REPLACE(Module, 'In-Portal', 'Core');
DROP TABLE ImportScripts;
CREATE TABLE BanRules (
RuleId int(11) NOT NULL auto_increment,
RuleType tinyint(4) NOT NULL default '0',
ItemField varchar(255) default NULL,
ItemVerb tinyint(4) NOT NULL default '0',
ItemValue varchar(255) NOT NULL default '',
ItemType int(11) NOT NULL default '0',
Priority int(11) NOT NULL default '0',
Status tinyint(4) NOT NULL default '1',
ErrorTag varchar(255) default NULL,
PRIMARY KEY (RuleId),
KEY Status (Status),
KEY Priority (Priority),
KEY ItemType (ItemType)
);
CREATE TABLE CountCache (
ListType int(11) NOT NULL default '0',
ItemType int(11) NOT NULL default '-1',
Value int(11) NOT NULL default '0',
CountCacheId int(11) NOT NULL auto_increment,
LastUpdate int(11) NOT NULL default '0',
ExtraId varchar(50) default NULL,
TodayOnly tinyint(4) NOT NULL default '0',
PRIMARY KEY (CountCacheId)
);
CREATE TABLE Favorites (
FavoriteId int(11) NOT NULL auto_increment,
PortalUserId int(11) NOT NULL default '0',
ResourceId int(11) NOT NULL default '0',
ItemTypeId int(11) NOT NULL default '0',
Modified int(11) NOT NULL default '0',
PRIMARY KEY (FavoriteId),
UNIQUE KEY main (PortalUserId,ResourceId),
KEY Modified (Modified),
KEY ItemTypeId (ItemTypeId)
);
CREATE TABLE Images (
ImageId int(11) NOT NULL auto_increment,
ResourceId int(11) NOT NULL default '0',
Url varchar(255) NOT NULL default '',
Name varchar(255) NOT NULL default '',
AltName VARCHAR(255) NOT NULL DEFAULT '',
ImageIndex int(11) NOT NULL default '0',
LocalImage tinyint(4) NOT NULL default '1',
LocalPath varchar(240) NOT NULL default '',
Enabled int(11) NOT NULL default '1',
DefaultImg int(11) NOT NULL default '0',
ThumbUrl varchar(255) default NULL,
Priority int(11) NOT NULL default '0',
ThumbPath varchar(255) default NULL,
LocalThumb tinyint(4) NOT NULL default '1',
SameImages tinyint(4) NOT NULL default '1',
PRIMARY KEY (ImageId),
KEY ResourceId (ResourceId),
KEY Enabled (Enabled),
KEY Priority (Priority)
);
CREATE TABLE ItemRating (
RatingId int(11) NOT NULL auto_increment,
IPAddress varchar(255) NOT NULL default '',
CreatedOn INT UNSIGNED NULL DEFAULT NULL,
RatingValue int(11) NOT NULL default '0',
ItemId int(11) NOT NULL default '0',
PRIMARY KEY (RatingId),
KEY CreatedOn (CreatedOn),
KEY ItemId (ItemId),
KEY RatingValue (RatingValue)
);
CREATE TABLE ItemReview (
ReviewId int(11) NOT NULL auto_increment,
CreatedOn INT UNSIGNED NULL DEFAULT NULL,
ReviewText longtext NOT NULL,
Rating tinyint(3) unsigned default NULL,
IPAddress varchar(255) NOT NULL default '',
ItemId int(11) NOT NULL default '0',
CreatedById int(11) NOT NULL default '-1',
ItemType tinyint(4) NOT NULL default '0',
Priority int(11) NOT NULL default '0',
Status tinyint(4) NOT NULL default '2',
TextFormat int(11) NOT NULL default '0',
Module varchar(255) NOT NULL default '',
PRIMARY KEY (ReviewId),
KEY CreatedOn (CreatedOn),
KEY ItemId (ItemId),
KEY ItemType (ItemType),
KEY Priority (Priority),
KEY Status (Status)
);
CREATE TABLE ItemTypes (
ItemType int(11) NOT NULL default '0',
Module varchar(50) NOT NULL default '',
Prefix varchar(20) NOT NULL default '',
SourceTable varchar(100) NOT NULL default '',
TitleField varchar(50) default NULL,
CreatorField varchar(255) NOT NULL default '',
PopField varchar(255) default NULL,
RateField varchar(255) default NULL,
LangVar varchar(255) NOT NULL default '',
PrimaryItem int(11) NOT NULL default '0',
EditUrl varchar(255) NOT NULL default '',
ClassName varchar(40) NOT NULL default '',
ItemName varchar(50) NOT NULL default '',
PRIMARY KEY (ItemType),
KEY Module (Module)
);
CREATE TABLE ItemFiles (
FileId int(11) NOT NULL auto_increment,
ResourceId int(11) unsigned NOT NULL default '0',
FileName varchar(255) NOT NULL default '',
FilePath varchar(255) NOT NULL default '',
Size int(11) NOT NULL default '0',
`Status` tinyint(4) NOT NULL default '1',
CreatedOn int(11) unsigned NOT NULL default '0',
CreatedById int(11) NOT NULL default '-1',
MimeType varchar(255) NOT NULL default '',
PRIMARY KEY (FileId),
KEY ResourceId (ResourceId),
KEY CreatedOn (CreatedOn),
KEY Status (Status)
);
CREATE TABLE Relationship (
RelationshipId int(11) NOT NULL auto_increment,
SourceId int(11) default NULL,
TargetId int(11) default NULL,
SourceType tinyint(4) NOT NULL default '0',
TargetType tinyint(4) NOT NULL default '0',
Type int(11) NOT NULL default '0',
Enabled int(11) NOT NULL default '1',
Priority int(11) NOT NULL default '0',
PRIMARY KEY (RelationshipId),
KEY RelSource (SourceId),
KEY RelTarget (TargetId),
KEY `Type` (`Type`),
KEY Enabled (Enabled),
KEY Priority (Priority),
KEY SourceType (SourceType),
KEY TargetType (TargetType)
);
CREATE TABLE SearchConfig (
TableName varchar(40) NOT NULL default '',
FieldName varchar(40) NOT NULL default '',
SimpleSearch tinyint(4) NOT NULL default '1',
AdvancedSearch tinyint(4) NOT NULL default '1',
Description varchar(255) default NULL,
DisplayName varchar(80) default NULL,
ModuleName VARCHAR(20) NOT NULL DEFAULT 'In-Portal',
ConfigHeader varchar(255) default NULL,
DisplayOrder int(11) NOT NULL default '0',
SearchConfigId int(11) NOT NULL auto_increment,
Priority int(11) NOT NULL default '0',
FieldType varchar(20) NOT NULL default 'text',
ForeignField TEXT,
JoinClause TEXT,
IsWhere text,
IsNotWhere text,
ContainsWhere text,
NotContainsWhere text,
CustomFieldId int(11) default NULL,
PRIMARY KEY (SearchConfigId),
KEY SimpleSearch (SimpleSearch),
KEY AdvancedSearch (AdvancedSearch),
KEY DisplayOrder (DisplayOrder),
KEY Priority (Priority),
KEY CustomFieldId (CustomFieldId)
);
CREATE TABLE SearchLog (
SearchLogId int(11) NOT NULL auto_increment,
Keyword varchar(255) NOT NULL default '',
Indices bigint(20) NOT NULL default '0',
SearchType int(11) NOT NULL default '0',
PRIMARY KEY (SearchLogId),
KEY SearchType (SearchType)
);
CREATE TABLE IgnoreKeywords (
keyword varchar(20) NOT NULL default '',
PRIMARY KEY (keyword)
);
CREATE TABLE SpamControl (
ItemResourceId int(11) NOT NULL default '0',
IPaddress varchar(20) NOT NULL default '',
Expire INT UNSIGNED NULL DEFAULT NULL,
PortalUserId int(11) NOT NULL default '0',
DataType varchar(20) default NULL,
KEY PortalUserId (PortalUserId),
KEY Expire (Expire),
KEY ItemResourceId (ItemResourceId)
);
CREATE TABLE StatItem (
StatItemId int(11) NOT NULL auto_increment,
Module varchar(20) NOT NULL default '',
ValueSQL varchar(255) default NULL,
ResetSQL varchar(255) default NULL,
ListLabel varchar(255) NOT NULL default '',
Priority int(11) NOT NULL default '0',
AdminSummary int(11) NOT NULL default '0',
PRIMARY KEY (StatItemId),
KEY AdminSummary (AdminSummary),
KEY Priority (Priority)
);
CREATE TABLE SuggestMail (
email varchar(255) NOT NULL default '',
sent INT UNSIGNED NULL DEFAULT NULL,
PRIMARY KEY (email),
KEY sent (sent)
);
CREATE TABLE SysCache (
SysCacheId int(11) NOT NULL auto_increment,
Name varchar(255) NOT NULL default '',
Value mediumtext,
Expire INT UNSIGNED NULL DEFAULT NULL,
Module varchar(20) default NULL,
Context varchar(255) default NULL,
GroupList varchar(255) NOT NULL default '',
PRIMARY KEY (SysCacheId),
KEY Name (Name)
);
CREATE TABLE TagLibrary (
TagId int(11) NOT NULL auto_increment,
name varchar(255) NOT NULL default '',
description text,
example text,
scope varchar(20) NOT NULL default 'global',
PRIMARY KEY (TagId)
);
CREATE TABLE TagAttributes (
AttrId int(11) NOT NULL auto_increment,
TagId int(11) NOT NULL default '0',
Name varchar(255) NOT NULL default '',
AttrType varchar(20) default NULL,
DefValue varchar(255) default NULL,
Description TEXT,
Required int(11) NOT NULL default '0',
PRIMARY KEY (AttrId),
KEY TagId (TagId)
);
CREATE TABLE ImportScripts (
ImportId INT(11) NOT NULL auto_increment,
Name VARCHAR(255) NOT NULL DEFAULT '',
Description TEXT NOT NULL,
Prefix VARCHAR(10) NOT NULL DEFAULT '',
Module VARCHAR(50) NOT NULL DEFAULT '',
ExtraFields VARCHAR(255) NOT NULL DEFAULT '',
Type VARCHAR(10) NOT NULL DEFAULT '',
Status TINYINT NOT NULL,
PRIMARY KEY (ImportId),
KEY Module (Module),
KEY Status (Status)
);
CREATE TABLE StylesheetSelectors (
SelectorId int(11) NOT NULL auto_increment,
StylesheetId int(11) NOT NULL default '0',
Name varchar(255) NOT NULL default '',
SelectorName varchar(255) NOT NULL default '',
SelectorData text NOT NULL,
Description text NOT NULL,
Type tinyint(4) NOT NULL default '0',
AdvancedCSS text NOT NULL,
ParentId int(11) NOT NULL default '0',
PRIMARY KEY (SelectorId),
KEY StylesheetId (StylesheetId),
KEY ParentId (ParentId),
KEY `Type` (`Type`)
);
CREATE TABLE Visits (
VisitId int(11) NOT NULL auto_increment,
VisitDate int(10) unsigned NOT NULL default '0',
Referer varchar(255) NOT NULL default '',
IPAddress varchar(15) NOT NULL default '',
AffiliateId int(10) unsigned NOT NULL default '0',
PortalUserId int(11) NOT NULL default '-2',
PRIMARY KEY (VisitId),
KEY PortalUserId (PortalUserId),
KEY AffiliateId (AffiliateId),
KEY VisitDate (VisitDate)
);
CREATE TABLE ImportCache (
CacheId int(11) NOT NULL auto_increment,
CacheName varchar(255) NOT NULL default '',
VarName int(11) NOT NULL default '0',
VarValue text NOT NULL,
PRIMARY KEY (CacheId),
KEY CacheName (CacheName),
KEY VarName (VarName)
);
CREATE TABLE RelatedSearches (
RelatedSearchId int(11) NOT NULL auto_increment,
ResourceId int(11) NOT NULL default '0',
Keyword varchar(255) NOT NULL default '',
ItemType tinyint(4) NOT NULL default '0',
Enabled tinyint(4) NOT NULL default '1',
Priority int(11) NOT NULL default '0',
PRIMARY KEY (RelatedSearchId),
KEY Enabled (Enabled),
KEY ItemType (ItemType),
KEY ResourceId (ResourceId)
);
UPDATE Modules SET Path = 'core/', Version='4.3.9' WHERE Name = 'In-Portal';
UPDATE Skins SET Logo = 'just_logo.gif' WHERE Logo = 'just_logo_1.gif';
UPDATE ConfigurationAdmin SET prompt = 'la_config_PathToWebsite' WHERE VariableName = 'Site_Path';
# ===== v 5.0.0 =====
CREATE TABLE StopWords (
StopWordId int(11) NOT NULL auto_increment,
StopWord varchar(255) NOT NULL default '',
PRIMARY KEY (StopWordId),
KEY StopWord (StopWord)
);
INSERT INTO StopWords VALUES (90, '~'),(152, 'on'),(157, 'see'),(156, 'put'),(128, 'and'),(154, 'or'),(155, 'other'),(153, 'one'),(126, 'as'),(127, 'at'),(125, 'are'),(91, '!'),(92, '@'),(93, '#'),(94, '$'),(95, '%'),(96, '^'),(97, '&'),(98, '*'),(99, '('),(100, ')'),(101, '-'),(102, '_'),(103, '='),(104, '+'),(105, '['),(106, '{'),(107, ']'),(108, '}'),(109, '\\'),(110, '|'),(111, ';'),(112, ':'),(113, ''''),(114, '"'),(115, '<'),(116, '.'),(117, '>'),(118, '/'),(119, '?'),(120, 'ah'),(121, 'all'),(122, 'also'),(123, 'am'),(124, 'an'),(151, 'of'),(150, 'note'),(149, 'not'),(148, 'no'),(147, 'may'),(146, 'its'),(145, 'it'),(144, 'is'),(143, 'into'),(142, 'in'),(141, 'had'),(140, 'has'),(139, 'have'),(138, 'from'),(137, 'form'),(136, 'for'),(135, 'end'),(134, 'each'),(133, 'can'),(132, 'by'),(130, 'be'),(131, 'but'),(129, 'any'),(158, 'that'),(159, 'the'),(160, 'their'),(161, 'there'),(162, 'these'),(163, 'they'),(164, 'this'),(165, 'through'),(166, 'thus'),(167, 'to'),(168, 'two'),(169, 'too'),(170, 'up'),(171, 'where'),(172, 'which'),(173, 'with'),(174, 'were'),(175, 'was'),(176, 'you'),(177, 'yet');
INSERT INTO ConfigurationAdmin VALUES ('CheckStopWords', 'la_Text_Website', 'la_config_CheckStopWords', 'checkbox', '', '', 10.29, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CheckStopWords', '0', 'In-Portal', 'in-portal:configure_general');
ALTER TABLE SpamControl ADD INDEX (DataType);
CREATE TABLE MailingLists (
MailingId int(10) unsigned NOT NULL auto_increment,
PortalUserId int(11) NOT NULL,
`To` longtext,
ToParsed longtext,
Attachments text,
`Subject` varchar(255) NOT NULL,
MessageText longtext,
MessageHtml longtext,
`Status` tinyint(3) unsigned NOT NULL default '1',
EmailsQueued int(10) unsigned NOT NULL,
EmailsSent int(10) unsigned NOT NULL,
EmailsTotal int(10) unsigned NOT NULL,
PRIMARY KEY (MailingId),
KEY EmailsTotal (EmailsTotal),
KEY EmailsSent (EmailsSent),
KEY EmailsQueued (EmailsQueued),
KEY `Status` (`Status`),
KEY PortalUserId (PortalUserId)
);
ALTER TABLE EmailQueue
ADD MailingId INT UNSIGNED NOT NULL,
ADD INDEX (MailingId);
INSERT INTO ConfigurationAdmin VALUES ('MailingListQueuePerStep', 'la_Text_smtp_server', 'la_config_MailingListQueuePerStep', 'text', NULL, NULL, 30.09, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'MailingListQueuePerStep', 10, 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationAdmin VALUES ('MailingListSendPerStep', 'la_Text_smtp_server', 'la_config_MailingListSendPerStep', 'text', NULL, NULL, 30.10, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'MailingListSendPerStep', 10, 'In-Portal', 'in-portal:configure_general');
ALTER TABLE Events ADD INDEX (Event);
ALTER TABLE SearchLog ADD INDEX (Keyword);
ALTER TABLE Skins ADD LogoBottom VARCHAR(255) NOT NULL AFTER Logo;
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SiteNameSubTitle', '', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationAdmin VALUES ('SiteNameSubTitle', 'la_Text_Website', 'la_config_SiteNameSubTitle', 'text', '', '', 10.021, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('ResizableFrames', 'la_Text_Website', 'la_config_ResizableFrames', 'checkbox', '', '', 10.30, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'ResizableFrames', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationAdmin VALUES ('QuickCategoryPermissionRebuild', 'la_Text_General', 'la_config_QuickCategoryPermissionRebuild', 'checkbox', NULL , NULL , 10.12, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'QuickCategoryPermissionRebuild', '1', 'In-Portal', 'in-portal:configure_categories');
ALTER TABLE Language ADD UserDocsUrl VARCHAR(255) NOT NULL;
UPDATE Category SET Template = CategoryTemplate WHERE CategoryTemplate <> '';
ALTER TABLE Category
ADD ThemeId INT UNSIGNED NOT NULL,
ADD INDEX (ThemeId),
ADD COLUMN UseExternalUrl tinyint(3) unsigned NOT NULL default '0' AFTER Path,
ADD COLUMN ExternalUrl varchar(255) NOT NULL default '' AFTER UseExternalUrl,
ADD COLUMN UseMenuIconUrl tinyint(3) unsigned NOT NULL default '0' AFTER ExternalUrl,
ADD COLUMN MenuIconUrl varchar(255) NOT NULL default '' AFTER UseMenuIconUrl,
CHANGE MetaKeywords MetaKeywords TEXT,
CHANGE MetaDescription MetaDescription TEXT,
CHANGE CachedCategoryTemplate CachedTemplate VARCHAR(255) NOT NULL,
DROP CategoryTemplate;
UPDATE Category SET l1_MenuTitle = l1_Name WHERE l1_MenuTitle = '' OR l1_MenuTitle LIKE '_Auto: %';
UPDATE Category SET l2_MenuTitle = l2_Name WHERE l2_MenuTitle = '' OR l2_MenuTitle LIKE '_Auto: %';
UPDATE Category SET l3_MenuTitle = l3_Name WHERE l3_MenuTitle = '' OR l3_MenuTitle LIKE '_Auto: %';
UPDATE Category SET l4_MenuTitle = l4_Name WHERE l4_MenuTitle = '' OR l4_MenuTitle LIKE '_Auto: %';
UPDATE Category SET l5_MenuTitle = l5_Name WHERE l5_MenuTitle = '' OR l5_MenuTitle LIKE '_Auto: %';
UPDATE Category SET Template = '/platform/designs/default_design.des' WHERE Template = '/in-edit/designs/general';
UPDATE Category SET CachedTemplate = '/platform/designs/default_design.des' WHERE CachedTemplate = '/in-edit/designs/general';
CREATE TABLE PageContent (
PageContentId int(11) NOT NULL auto_increment,
ContentNum int(11) NOT NULL default '0',
PageId int(11) NOT NULL default '0',
l1_Content text,
l2_Content text,
l3_Content text,
l4_Content text,
l5_Content text,
l1_Translated tinyint(4) NOT NULL default '0',
l2_Translated tinyint(4) NOT NULL default '0',
l3_Translated tinyint(4) NOT NULL default '0',
l4_Translated tinyint(4) NOT NULL default '0',
l5_Translated tinyint(4) NOT NULL default '0',
PRIMARY KEY (PageContentId),
KEY ContentNum (ContentNum,PageId)
);
CREATE TABLE FormFields (
FormFieldId int(11) NOT NULL auto_increment,
FormId int(11) NOT NULL default '0',
Type int(11) NOT NULL default '0',
FieldName varchar(255) NOT NULL default '',
FieldLabel varchar(255) default NULL,
Heading varchar(255) default NULL,
Prompt varchar(255) default NULL,
ElementType varchar(50) NOT NULL default '',
ValueList varchar(255) default NULL,
Priority int(11) NOT NULL default '0',
IsSystem tinyint(3) unsigned NOT NULL default '0',
Required tinyint(1) NOT NULL default '0',
DisplayInGrid tinyint(1) NOT NULL default '1',
DefaultValue text NOT NULL,
Validation TINYINT NOT NULL DEFAULT '0',
PRIMARY KEY (FormFieldId),
KEY `Type` (`Type`),
KEY FormId (FormId),
KEY Priority (Priority),
KEY IsSystem (IsSystem),
KEY DisplayInGrid (DisplayInGrid)
);
CREATE TABLE FormSubmissions (
FormSubmissionId int(11) NOT NULL auto_increment,
FormId int(11) NOT NULL default '0',
SubmissionTime int(11) NOT NULL default '0',
PRIMARY KEY (FormSubmissionId),
KEY FormId (FormId),
KEY SubmissionTime (SubmissionTime)
);
CREATE TABLE Forms (
FormId int(11) NOT NULL auto_increment,
Title VARCHAR(255) NOT NULL DEFAULT '',
Description text,
PRIMARY KEY (FormId)
-);
\ No newline at end of file
+);
+
+DELETE FROM PersistantSessionData WHERE VariableName LIKE '%img%';
\ No newline at end of file
Property changes on: branches/RC/core/install/upgrades.sql
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.19.2.81
\ No newline at end of property
+1.19.2.82
\ No newline at end of property

Event Timeline