Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Tue, May 20, 6:40 AM

in-portal

This file is larger than 256 KB, so syntax highlighting was skipped.
Index: branches/RC/themes/default2009/platform/elements/content_boxes.elm.tpl
===================================================================
--- branches/RC/themes/default2009/platform/elements/content_boxes.elm.tpl (revision 11537)
+++ branches/RC/themes/default2009/platform/elements/content_boxes.elm.tpl (revision 11538)
@@ -1,175 +1,175 @@
<!--## MAIN CONTENT BOX ELEMENT DESIGN ##-->
<inp2:m_DefineElement name="content_box">
<table class="fullwidth groupItem">
<tr>
<td colspan="3">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="1" height="20" alt=""/><br />
</td>
</tr>
<tr>
<td width="13">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="13" height="1" alt=""/><br />
</td>
<td class="content-box-header table-border itemHeader">
<div class="content-box-title"><inp2:m_param name="header"/></div>
</td>
<td width="13">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="13" height="1" alt=""/><br />
</td>
</tr>
<tr>
<td width="13">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="13" height="1" alt=""/><br />
</td>
<td class="content-box-content">
<inp2:m_param name="content"/>
</td>
<td width="13">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="13" height="1" alt=""/><br />
</td>
</tr>
</table>
</inp2:m_DefineElement>
<!--## /MAIN CONTENT BOX ELEMENT DESIGN ##-->
<!--## DESIGN OF CONTENT BOX SUB-SECTION ELEMENT##-->
<inp2:m_DefineElement name="content_box_subsection">
<table class="fullwidth groupItem">
<tr>
<td colspan="3">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="1" height="20" alt=""/><br />
</td>
</tr>
<tr>
<td width="13">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="13" height="1" alt=""/><br />
</td>
<td class="content-box-header table-border itemHeader">
<div class="content-box-title"><inp2:m_param name="subsection_header"/></div>
</td>
<td width="13">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="13" height="1" alt=""/><br />
</td>
</tr>
<tr>
<td width="13">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="13" height="1" alt=""/><br />
</td>
<td class="content-box-content">
<inp2:m_param name="content"/>
</td>
<td width="13">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="13" height="1" alt=""/><br />
</td>
</tr>
</table>
</inp2:m_DefineElement>
<!--## //DESIGN OF CONTENT BOX SUB-SECTION ELEMENT##-->
<!--## CONTENT BOX NO-HEADER ELEMENT DESIGN ##-->
<inp2:m_DefineElement name="content_box_noheader">
<table class="fullwidth groupItem">
<tr>
<td width="13">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="13" height="1" alt=""/><br />
</td>
<td class="content-box-content itemHeader">
<inp2:m_param name="content"/>
</td>
<td width="13">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="13" height="1" alt=""/><br />
</td>
</tr>
</table>
</inp2:m_DefineElement>
<!--## /CONTENT BOX NO-HEADER ELEMENT DESIGN ##-->
<inp2:m_DefineElement name="menu_element" current="">
<inp2:m_if check="m_Param" name="current">
<td>
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/menu_active_border.gif" width="1" height="37" alt=""/><br />
</td>
<td class="menu-top-active-icon top-menu-padding">
<a href="<inp2:m_param name="menu_href" no_editing="1"/>"><inp2:m_if check="m_Param" name="menu_icon_src"><img src="<inp2:m_Param name="menu_icon_src"/>"/><inp2:m_else/><inp2:m_param name="menu_icon" no_editing="1"/></inp2:m_if></a>
</td>
<td class="menu-top-active-text top-menu-padding">
<a href="<inp2:m_param name="menu_href" no_editing="1"/>" class="top-menu-link"><inp2:m_param name="menu_title" no_editing="1"/></a>
</td>
<td>
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/menu_active_border.gif" width="1" height="37" alt=""/><br />
</td>
<inp2:m_else/>
<td>
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="1" height="37" alt=""/><br />
</td>
<td class="menu-top-noactive-icon top-menu-padding">
<a href="<inp2:m_param name="menu_href" no_editing="1"/>"><inp2:m_if check="m_Param" name="menu_icon_src"><img src="<inp2:m_Param name="menu_icon_src"/>"/><inp2:m_else/><inp2:m_param name="menu_icon" no_editing="1"/></inp2:m_if></a>
</td>
<td class="menu-top-noactive-text top-menu-padding">
<a href="<inp2:m_param name="menu_href" no_editing="1"/>" class="top-menu-link"><inp2:m_param name="menu_title" no_editing="1"/></a>
</td>
<td>
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="1" height="37" alt=""/><br />
</td>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="box_element" prefix="">
<tr>
<td>
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/menu-li-2-level.gif" alt="" width="4" height="4" border="0" /><br />
</td>
<td>
<inp2:m_if check="m_Param" name="prefix">
<a href="<inp2:{$prefix}_SuggestItemLink template="$template"/>"><inp2:m_Phrase label="$title"/></a>
<inp2:m_else/>
<a href="<inp2:m_Link template="$template" m_cat_id="0" m_cat_page="1" />"><inp2:m_Phrase label="$title"/></a>
</inp2:m_if>
</td>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="review_element">
<tr>
<td>
<strong><inp2:m_Phrase name="lu_fld_ReviewBy"/>:</strong> <inp2:Field name="ReviewedBy"/> [<inp2:Field name="CreatedOn" format="_regional_DateFormat"/>]<br />
<strong><inp2:m_Phrase name="lu_fld_ReviewText"/>:</strong> <inp2:Field name="ReviewText"/>
<br /><br />
</td>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="rating_element">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/star<inp2:m_if check="m_Param" name="active">_rate</inp2:m_if>.gif" width="10" height="11" alt=""/>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="category_path_element">
- <inp2:m_if check="m_ParamEquals" name="cat_id" value="0" inverse="inverse">
+ <inp2:m_ifnot check="c_HomeCategory" equals_to="$cat_id">
<inp2:m_param name="separator"/>
- </inp2:m_if>
+ </inp2:m_ifnot>
<inp2:m_param name="cat_name"/>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="image_element">
<img src="<inp2:m_param name="img_path" />" title="<inp2:m_param name="alt" />" alt="<inp2:m_param name="alt" />" <inp2:m_param name="img_size" /> border="0" align="<inp2:m_param name="align"/>" />
</inp2:m_DefineElement>
<inp2:m_DefineElement name="tab">
<td class="<inp2:m_if check="m_IsActive" template="$template">active-tab<inp2:m_else/>inactive-tab</inp2:m_if>">
<a href="<inp2:m_Link template="$template" m_cat_id="0" m_cat_page="1"/>"><inp2:m_phrase name="$title"/></a>
</td>
<td width="8">&nbsp;
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="file_element">
<tr>
<td class="file-list-icon">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/file_icons/<inp2:FileIcon default="icon_file.gif"/>" alt="<inp2:Field name="FileName"/>" border="0" /><br />
</td>
<td class="file-list-label">
<a href="<inp2:DownloadFileLink />"><inp2:Field name="FileName"/></a>
</td>
<tr>
</inp2:m_DefineElement>
\ No newline at end of file
Property changes on: branches/RC/themes/default2009/platform/elements/content_boxes.elm.tpl
___________________________________________________________________
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/themes/default2009/index.tpl
===================================================================
--- branches/RC/themes/default2009/index.tpl (revision 11537)
+++ branches/RC/themes/default2009/index.tpl (revision 11538)
@@ -1,67 +1,73 @@
<!--##
<NAME>Home</NAME>
<DESC>Welcome page</DESC>
<SECTION></SECTION>
##-->
<!--## 0PAGE TITLE ELEMENT ##-->
<inp2:m_DefineElement name="page_title">
<inp2:m_phrase name="lu_title_WelcomeTitle"/>
</inp2:m_DefineElement>
<!--## //PAGE TITLE ELEMENT ##-->
<!--## SIDE-BAR ELEMENT ##-->
<inp2:m_DefineElement name="sidebar">
<div class="movable-element">
<inp2:m_RenderElement name="platform/elements/side_boxes/login.elm" design="blue_box"/>
</div>
<div class="movable-element">
<inp2:m_RenderElement name="platform/elements/side_boxes/search.elm" design="blue_box"/>
</div>
<div class="movable-element">
<inp2:m_RenderElement name="platform/elements/side_boxes/recommend_site.elm" design="blue_box"/>
</div>
<div class="movable-element">
<inp2:m_RenderElement name="platform/elements/side_boxes/mailing_list.elm" design="blue_box"/>
</div>
</inp2:m_DefineElement>
<!--## /SIDE-BAR ELEMENT ##-->
<!--## MAIN CONTENT ##-->
<inp2:m_DefineElement name="content">
<div class="movable-element">
<inp2:m_include template="platform/elements/navigation_bar.elm"/>
</div>
<inp2:m_RenderElement design="content_box">
<inp2:m_Capture to_var="header">
<inp2:m_phrase name="lu_title_WelcomeTitle"/>
</inp2:m_Capture>
<div class="movable-element">
<!--## if In-edit (CMS) installed! ##-->
<inp2:m_if check="m_ModuleEnabled" module="In-Edit">
<inp2:m_include template="in-edit/elements/content_boxes/edit_block.elm" block_num="1"/>
<inp2:m_else/>
<!--## Welcome text => In-edit (CMS) NOT installed! ##-->
In-portal is a revolutionary web site management system that allows you to automate and
facilitate management of large portal and community web sites. Regardless of whether you
are running a directory site or a content news portal, a community site or an online mall,
In-portal will enhance your web site management experience with innovative.
<!--## /Welcome text => In-edit (CMS) NOT installed! ##-->
</inp2:m_if>
</div>
</inp2:m_RenderElement>
<div class="movable-element">
+ <!--## SUB-CATEGORIES ##-->
+ <inp2:m_include template="platform/elements/content_boxes/sub_categories.elm"/>
+ <!--## /SUB-CATEGORIES ##-->
+ </div>
+
+ <div class="movable-element">
<!--## INCLUDE HOME PAGE ELEMENTS FOR EACH MODULE ##-->
<inp2:m_ModuleInclude template="elements/content_boxes/home_page_items.elm" data_exists="1"/>
<!--## /HOME PAGE ELEMENTS ##-->
</div>
</inp2:m_DefineElement>
<!--## /MAIN CONTENT ##-->
<!--## DESIGN TEMPLATE ##-->
<inp2:m_include template="platform/designs/default_design.des" pass_params="1"/>
<!--## /DESIGN TEMPLATE ##-->
\ No newline at end of file
Property changes on: branches/RC/themes/default2009/index.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.9
\ No newline at end of property
+1.1.2.10
\ No newline at end of property
Index: branches/RC/core/kernel/event_manager.php
===================================================================
--- branches/RC/core/kernel/event_manager.php (revision 11537)
+++ branches/RC/core/kernel/event_manager.php (revision 11538)
@@ -1,680 +1,708 @@
<?php
define('hBEFORE', 1);
define('hAFTER', 2);
define('reBEFORE', 1);
define('reAFTER', 2);
class kEventManager extends kBase {
/**
* Connection to database
*
* @var kDBConnection
* @access public
*/
var $Conn;
/**
* Cache of QueryString parameters
* from config, that are represented
* in enviroment variable
*
* @var Array
*/
var $queryMaps = Array();
/**
* Build events registred for
* pseudo classes. key - pseudo class
* value - event name
*
* @var Array
* @access private
*/
var $buildEvents=Array();
/**
* Events, that should be run before parser initialization
*
* @var Array
*/
var $beforeRegularEvents = Array();
/**
* Events, that should be run after parser initialization
*
* @var Array
*/
var $afterRegularEvents = Array();
/**
* Holds before hooks
* key - prefix.event (to link to)
* value - hooked event info
*
* @var Array
* @access private
*/
var $beforeHooks=Array();
/**
* Holds after hooks
* key - prefix.event (to link to)
* value - hooked event info
*
* @var Array
* @access private
*/
var $afterHooks = Array();
var $recursionStack = Array();
function kEventManager()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
/**
* Returns information about registered regular events
*
* @param bool $from_cache
*
* @return Array
*/
function getRegularEvents($from_cache = false)
{
static $agents = null;
if ($from_cache) {
return Array (
reBEFORE => $this->beforeRegularEvents,
reAFTER => $this->afterRegularEvents,
);
}
else {
if (!isset($agents)) {
$sql = 'SELECT *
FROM ' . $this->Application->getUnitOption('agent', 'TableName') . '
WHERE Status = ' . STATUS_ACTIVE . ' AND LastRunStatus <> ' . AGENT_LAST_RUN_RUNNING;
$all_agents = $this->Conn->Query($sql);
$agents = Array (
reBEFORE => Array (),
reAFTER => Array (),
);
foreach ($all_agents as $agent_data) {
$agents[ $agent_data['RunMode'] ][ $agent_data['AgentName'] ] = Array (
'EventName' => $agent_data['Event'],
'RunInterval' => (int)$agent_data['RunInterval'],
'LastRunOn' => (int)$agent_data['LastRunOn'],
'NextRunOn' => (int)$agent_data['NextRunOn'],
);
}
}
return $agents;
}
}
/**
* Set's new enviroment parameter mappings
* between their names as application vars
*
* @param Array $new_query_maps
* @access public
*/
/*function setQueryMaps($new_query_maps)
{
$this->queryMaps = $new_query_maps;
}*/
/**
* Adds new query map to already parsed query maps
*
* @param string $prefix
*/
function setQueryMap($prefix_special)
{
list($prefix) = explode('.', $prefix_special);
$query_map = $this->getQueryMap($prefix);
if ($query_map) {
$this->queryMaps[$prefix_special] = $query_map;
}
else {
unset($this->queryMaps[$prefix]);
}
// 'passed' is set later in ProcessRequest - do we really need it here? (it breakes HTTPQuery initialization...)
// $this->Application->SetVar('passed', implode(',', array_keys($this->queryMaps)) );
return $query_map;
}
/**
* Returns QueryMap for requested unit config. In case if unit config is a clone, then get parent item's (from prefix) config to create clone
*
* @param string $prefix
* @return Array
*/
function getQueryMap($prefix)
{
$query_map = $this->Application->getUnitOption($prefix, 'QueryString');
if (!$query_map) {
if (preg_match('/(.*?)-(.*)/', $prefix, $regs)) {
// #prefix - format for configs, that are only cloned & optionally used for hooking (without # is old format)
$check_prefixes = Array ('#'.$regs[2], $regs[2]);
foreach ($check_prefixes as $check_prefix) {
if ($this->Application->UnitConfigReader->prefixRegistred($check_prefix)) {
return $this->Application->getUnitOption($check_prefix, 'QueryString');
}
}
}
}
return $query_map;
}
/**
* Registers new regular event
*
* @param string $short_name name to be used to store last maintenace run info
* @param string $event_name
* @param int $run_interval run interval in seconds
* @param int $type before or after regular event
*/
function registerRegularEvent($short_name, $event_name, $run_interval, $type = reBEFORE)
{
if($type == reBEFORE)
{
$this->beforeRegularEvents[$short_name] = Array('EventName' => $event_name, 'RunInterval' => $run_interval);
}
else
{
$this->afterRegularEvents[$short_name] = Array('EventName' => $event_name, 'RunInterval' => $run_interval);
}
}
function registerBuildEvent($pseudo_class,$build_event_name)
{
$this->buildEvents[$pseudo_class]=$build_event_name;
}
/**
* Returns build event by pseudo class
* name if any defined in config
*
* @param string $pseudo_class
* @return kEvent
* @access public
*/
function &getBuildEvent($pseudo_class)
{
$false = false;
if( !isset($this->buildEvents[$pseudo_class]) ) return $false;
$event = new kEvent();
$event->Name=$this->buildEvents[$pseudo_class];
$event->MasterEvent=null;
return $event;
}
/**
* Check if event is called twice, that causes recursion
*
* @param kEvent $event
*/
function isRecursion(&$event)
{
$event_key = $event->getPrefixSpecial().':'.$event->Name;
return in_array($event_key, $this->recursionStack) ? true : false;
}
function pushEvent(&$event)
{
$event_key = $event->getPrefixSpecial().':'.$event->Name;
array_push($this->recursionStack, $event_key);
}
function popEvent()
{
array_pop($this->recursionStack);
}
/**
* Allows to process any type of event
*
* @param kEvent $event
* @access public
*/
function HandleEvent(&$event)
{
if ($this->isRecursion($event)) {
return true;
}
$this->pushEvent($event);
if( !$this->Application->prefixRegistred($event->Prefix) )
{
$unit_config_reader =& $this->Application->recallObject('kUnitConfigReader');
$unit_config_reader->loadConfig($event->Prefix);
if( !$this->Application->prefixRegistred($event->Prefix) )
{
trigger_error('Prefix <b>'.$event->Prefix.'</b> not registred (requested event <b>'.$event->Name.'</b>)', E_USER_NOTICE);
return false;
}
}
if (!$event->SkipBeforeHooks) {
$this->processHooks($event, hBEFORE);
if ($event->status == erFATAL) return true;
}
$event_handler =& $this->Application->recallObject($event->Prefix.'_EventHandler');
/* @var $event_handler kEventHandler */
$event_handler->processEvent($event);
if ($event->status == erFATAL) return true;
if (!$event->SkipAfterHooks) {
$this->processHooks($event, hAFTER);
}
$this->popEvent();
return true;
}
+ /**
+ * Returns event names given in POST
+ *
+ * @return Array
+ */
+ function _getEventsFromPost()
+ {
+ $events = $this->Application->GetVar('events');
+ if ($events === false) {
+ return Array ();
+ }
+
+ $ret = Array ();
+ foreach ($events as $prefix_special => $event_name) {
+ if (!$event_name) {
+ continue;
+ }
+
+ if (is_array($event_name)) {
+ // HTML-input names like "events[prefix.special][event_name]", input value don't matter
+ $event_name = key($event_name);
+ $this->Application->SetVar($prefix_special . '_event', $event_name);
+ }
+
+ // HTML-input names like "events[prefix.special]", input value is event name
+ $ret[$prefix_special] = $event_name;
+ }
+
+ return $ret;
+ }
+
function ProcessRequest()
{
$this->processOpener();
// 1. get events from $_POST
- $events = $this->Application->GetVar('events');
- if ($events === false) $events = Array();
+ $events = $this->_getEventsFromPost();
+
// 2. if nothing there, then try to find them in $_GET
if ($this->queryMaps && !$events) {
// if we got $_GET type submit (links, not javascript)
foreach ($this->queryMaps as $prefix_special => $query_map) {
$query_map = array_flip($query_map);
if (isset($query_map['event'])) {
- $event_name = $this->Application->GetVar($prefix_special.'_event');
+ $event_name = $this->Application->GetVar($prefix_special . '_event');
if ($event_name) {
$events[$prefix_special] = $event_name;
}
}
}
+
+ // used ?
$actions = $this->Application->GetVar('do');
if ($actions) {
- list($prefix, $event_name) = explode('_', $actions);
- $events[$prefix] = $event_name;
+ list ($prefix, $event_name) = explode('_', $actions);
+ if ($event_name) {
+ $events[$prefix] = $event_name;
+ }
}
}
// 3. store all prefixes passed before event processing, because they are used by GetTopmostPrefix
$all_passed = explode(',', $this->Application->GetVar('passed'));
foreach ($events as $prefix_special => $event_name) {
if (!$event_name) continue;
$prefix_special = explode('.',$prefix_special);
array_push($all_passed, $prefix_special[0]);
}
$this->Application->SetVar('all_passed', implode(',', $all_passed));
foreach ($events as $prefix_special => $event_name) {
- if (!$event_name) continue;
- if (is_array($event_name)) {
- $event_name = key($event_name);
- $events[$prefix_special] = $event_name;
- $this->Application->SetVar($prefix_special.'_event', $event_name);
- }
-
$event = new kEvent();
$event->Name = $event_name;
$event->Prefix_Special = $prefix_special;
$prefix_special = explode('.',$prefix_special);
$event->Prefix = $prefix_special[0];
// array_push($passed, $prefix_special[0]);
$event->Special = isset($prefix_special[1]) ? $prefix_special[1] : '';
$event->redirect_params = Array('opener' => 's', 'pass' => 'all');
$event->redirect = true;
$event_handler =& $this->Application->recallObject($event->Prefix.'_EventHandler');
/* @var $event_handler kEventHandler */
if (preg_match('/(.*?)-(.*)/', $event->Prefix, $regs) && $this->Application->UnitConfigReader->prefixRegistred($regs[1])) {
// this is event from cloned config -> load parent config to create valid clone
$this->Application->UnitConfigReader->loadConfig($regs[1]);
$this->Application->HandleEvent( new kEvent($regs[1].':OnAfterConfigRead') );
}
$event->setEventParam('top_prefix', $this->Application->GetTopmostPrefix($event->Prefix, true));
if (($this->Application->RecallVar('user_id') == -1) || $event_handler->CheckPermission($event)) {
$this->HandleEvent($event);
}
if ($event->status == erSTOP) {
// event requested to stop processing at this point
safeDefine('DBG_SKIP_REPORTING', 1);
$this->Application->Session->SaveData();
exit;
}
if ($event->status == erPERM_FAIL) {
// should do redirect but to no_permissions template
$event->redirect = $this->Application->IsAdmin() ? 'no_permission' : $this->Application->ConfigValue('NoPermissionTemplate');
$event->redirect_params['pass'] = 'm';
$event->redirect_params['m_cat_id'] = 0;
// restore stuff, that processOpener() changed
$wid = $this->Application->GetVar('m_wid');
$this->Application->RestoreVar(rtrim('opener_stack_'.$wid, '_'));
// don't save last_template, because no_permission template does js history.back and could cause invalid opener_stack content
$this->Application->SetVar('skip_last_template', 1);
}
if ( ($event->status == erSUCCESS || $event->status == erPERM_FAIL) && ($event->redirect === true || strlen($event->redirect) > 0)) {
// we need to pass category if the action was submitted to self-template, with the category passed
// and it has not explicly set redirect template or pass_cateogry param
if ($event->redirect === true && !isset($event->redirect_params['pass_category']) && $this->Application->GetVar('m_cat_id')) {
$event->redirect_params['pass_category'] = 1;
}
$wid = $this->Application->GetVar('m_wid');
if ($wid && $event->redirect_params['opener'] == 'u') {
$event->redirect_params['opener'] = 's'; // because Application->HREF will react differently when 'opener' = 'u'
$event->redirect = defined('CLOSE_POPUP_TPL') ? CLOSE_POPUP_TPL : 'incs/close_popup';
}
$this->Application->Redirect($event->redirect, $event->redirect_params, null, $event->redirect_script);
}
}
$this->Application->SetVar('events', $events);
$this->Application->SetVar('passed', implode(',', $all_passed));
}
function processOpener()
{
$wid = $this->Application->GetVar('m_wid');
$opener_stack = $this->Application->RecallVar(rtrim('opener_stack_'.$wid, '_'));
$opener_stack = $opener_stack ? unserialize($opener_stack) : Array();
$opener_action = $this->Application->GetVar('m_opener');
switch ($opener_action) {
case 'r': // "reset" opener stack
$opener_stack = Array();
break;
case 'd': // "down/push" new template to opener stack, deeplevel++
if ($this->Application->GetVar('front')) {
$front_session =& $this->Application->recallObject('Session.front');
array_push($opener_stack, '../'.$front_session->RecallVar('last_template') );
}
else {
array_push($opener_stack, $this->Application->RecallVar('last_template') );
}
break;
case 'u': // "up/pop" last template from opener stack, deeplevel--
array_pop($opener_stack);
break;
case 'p': // pop-up - generate new wid
$parent_wid = $this->Application->GetVar('m_wid'); // window_id of popup's parent window
$popup_wid = (int)$this->Application->RecallVar('last_wid') + 1;
$this->Application->StoreVar('last_wid', $popup_wid);
$this->Application->SetVar('m_wid', $popup_wid);
if ($this->Application->GetVar('front')) {
$front_session =& $this->Application->recallObject('Session.front');
$last_template = $front_session->RecallVar(rtrim('last_template_popup_'.$parent_wid, '_'));
$last_template = '../'.$last_template;
}
else {
$last_template = $this->Application->RecallVar(rtrim('last_template_popup_'.$parent_wid, '_'));
}
$opener_stack = Array ( $last_template );
$this->Application->SetVar('m_opener', 's');
$wid = $popup_wid;
break;
default: // "s/0," stay on same deep level
break;
}
$this->Application->SetVar('m_opener', 's');
$this->Application->StoreVar(rtrim('opener_stack_'.$wid, '_'), serialize($opener_stack));
}
/**
* Used from relationship event handler
*
* @param string $t
* @param Array $params
* @param string $pass
*/
function openerStackPush($t, $params, $pass = 'all', $wid=null)
{
if (!isset($wid)) $wid = $this->Application->GetVar('m_wid');
$stack_name = rtrim('opener_stack_'.$wid, '_');
$opener_stack = $this->Application->RecallVar($stack_name);
$opener_stack = $opener_stack ? unserialize($opener_stack) : Array();
$redirect_params = array_merge_recursive2(Array('m_opener' => 'u', '__URLENCODE__' => 1), $params);
$new_level = $this->Application->BuildEnv($t, $redirect_params, $pass, true);
array_push($opener_stack, 'index.php|'.ltrim($new_level, ENV_VAR_NAME.'=') );
$this->Application->StoreVar($stack_name, serialize($opener_stack));
}
function registerHook($hookto_prefix, $hookto_special, $hookto_event, $mode, $do_prefix, $do_special, $do_event, $conditional)
{
if ( !$this->Application->prefixRegistred($hookto_prefix) && $hookto_prefix != '*' ) {
if ($this->Application->isDebugMode()) {
trigger_error('Prefix <b>'.$hookto_prefix.'</b> doesn\'t exist when trying to hook from <b>'.$do_prefix.':'.$do_event.'</b>', E_USER_WARNING);
}
return;
}
$hookto_prefix_special = rtrim($hookto_prefix.'.'.$hookto_special, '.');
if ($mode == hBEFORE) {
$this->beforeHooks[strtolower($hookto_prefix_special.'.'.$hookto_event)][] = Array(
'DoPrefix' => $do_prefix,
'DoSpecial' => $do_special,
'DoEvent' => $do_event,
'Conditional' => $conditional,
);
}
elseif ($mode == hAFTER) {
$this->afterHooks[strtolower($hookto_prefix_special.'.'.$hookto_event)][] = Array(
'DoPrefix' => $do_prefix,
'DoSpecial' => $do_special,
'DoEvent' => $do_event,
'Conditional' => $conditional,
);
}
}
/**
* Enter description here...
*
* @param kEvent $event
* @param int $mode hBEFORE or hAFTER
* @param string $event_key
* @return Array
*/
function &_getHooks(&$event, $mode, $event_key = null)
{
$event_key = isset($event_key) ? $event_key : $event->Prefix_Special;
if ($mode == hBEFORE) {
$mode_hooks =& $this->beforeHooks;
}
else {
$mode_hooks =& $this->afterHooks;
}
if (!isset($mode_hooks[strtolower($event_key.'.'.$event->Name)])) {
$hooks = array();
return $hooks;
}
return $mode_hooks[strtolower($event_key.'.'.$event->Name)];
}
/**
* Enter description here...
*
* @param kEvent $event
* @param int $mode hBEFORE or hAFTER
*/
function processHooks(&$event, $mode)
{
// * - get hooks that are valid with any special of given prefix
$hooks = array_merge(
// given prefix, any special
$this->_getHooks($event, $mode, $event->Prefix.'.*'),
// given special, given special
$this->_getHooks($event, $mode),
// any prefix, any special
$this->_getHooks($event, $mode, '*.*'),
// any prefix, given special
$this->_getHooks($event, $mode, rtrim('*.' . $event->Special, '.'))
);
if ($hooks) {
foreach ($hooks as $hook) {
if ($hook['DoSpecial'] == '*') {
// use same special as master event
$hook['DoSpecial'] = $event->Special;
}
$prefix_special = rtrim($hook['DoPrefix'].'_'.$hook['DoSpecial'], '_');
if ( $hook['Conditional'] && !$this->Application->GetVar($prefix_special) ) {
continue;
}
if ($this->Application->prefixRegistred($hook['DoPrefix'])) {
// run hook only, when it's config is found
$hook_event = new kEvent( Array('name'=>$hook['DoEvent'],'prefix'=>$hook['DoPrefix'],'special'=>$hook['DoSpecial']) );
$hook_event->MasterEvent =& $event;
$this->HandleEvent($hook_event);
}
}
}
}
/**
* Set's new event for $prefix_special
* passed
*
* @param string $prefix_special
* @param string $event_name
* @access public
*/
function setEvent($prefix_special,$event_name)
{
$actions =& $this->Application->recallObject('kActions');
$actions->Set('events['.$prefix_special.']',$event_name);
}
/**
* Run registred regular events with specified event type
*
* @param int $event_type
*/
function RunRegularEvents($event_type = reBEFORE, $from_cron=false)
{
if (defined('IS_INSTALL')) return ;
// if RegularEvents are set to run from cron
if (!$from_cron && $this->Application->ConfigValue('UseCronForRegularEvent')) return ;
$agents = $this->getRegularEvents();
$events_source = $agents[$event_type];
$user_id = $this->Application->RecallVar('user_id');
$this->Application->StoreVar('user_id', -1, true); // to prevent permission checking inside events, true for optional storage
foreach ($events_source as $short_name => $event_data) {
$next_run = $event_data['NextRunOn'];
$last_run = $event_data['LastRunOn'];
if ($next_run && ($next_run > adodb_mktime())) {
continue;
}
else {
$event = new kEvent($event_data['EventName']);
if (!$this->Application->prefixRegistred($event->Prefix)) {
// don't process agents, left from disabled modules
continue;
}
$start_time = adodb_mktime();
$fields_hash = Array (
'LastRunOn' => $start_time,
'LastRunStatus' => AGENT_LAST_RUN_RUNNING,
'NextRunOn' => $start_time + $event_data['RunInterval'],
);
$this->Conn->doUpdate(
$fields_hash,
$this->Application->getUnitOption('agent', 'TableName'),
'AgentName = ' . $this->Conn->qstr($short_name)
);
$event->redirect = false;
$this->Application->HandleEvent($event);
$now = adodb_mktime();
$next_run = $event_data['RunInterval'] ? $start_time + $event_data['RunInterval'] : $now;
while ($next_run < $now) {
// in case event execution took longer, then RunInterval (don't use <=, because RunInterval can be 0)
$next_run += $event_data['RunInterval'];
}
$fields_hash = Array (
'NextRunOn' => $next_run,
'RunTime' => round(($now - $start_time) / 60),
'LastRunStatus' => $event->status == erSUCCESS ? AGENT_LAST_RUN_SUCCEDED : AGENT_LAST_RUN_FAILED,
);
$this->Conn->doUpdate(
$fields_hash,
$this->Application->getUnitOption('agent', 'TableName'),
'AgentName = ' . $this->Conn->qstr($short_name)
);
}
}
$this->Application->StoreVar('user_id', $user_id, true); // true for optional
}
/**
* Allows to determine, that required event is beeing processed right now
*
* @param string $event_key Event name in format prefix[.special]:event_name
* @return bool
*/
function eventRunning($event_key)
{
return array_search($event_key, $this->recursionStack) !== false;
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/kernel/event_manager.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.44.18.9
\ No newline at end of property
+1.44.18.10
\ No newline at end of property
Index: branches/RC/core/kernel/processors/tag_processor.php
===================================================================
--- branches/RC/core/kernel/processors/tag_processor.php (revision 11537)
+++ branches/RC/core/kernel/processors/tag_processor.php (revision 11538)
@@ -1,277 +1,295 @@
<?php
class TagProcessor extends kBase {
/**
* Processes tag
*
* @param Tag $tag
* @return string
* @access public
*/
function ProcessTag(&$tag)
{
return $this->ProcessParsedTag($tag->Tag, $tag->NP, $tag->getPrefixSpecial());
/*$Method=$tag->Tag;
if(method_exists($this, $Method))
{
//echo htmlspecialchars($tag->GetFullTag()).'<br>';
return $this->$Method($tag->NP);
}
else
{
if ($this->Application->hasObject('TagsAggregator')) {
$aggregator =& $this->Application->recallObject('TagsAggregator');
$tag_mapping = $aggregator->GetArrayValue($tag->Prefix, $Method);
if ($tag_mapping) {
$mapped_tag = new Tag('', $this->Application->Parser);
$mapped_tag->CopyFrom($tag);
$mapped_tag->Processor = $tag_mapping[0];
$mapped_tag->Tag = $tag_mapping[1];
$mapped_tag->NP['PrefixSpecial'] = $tag->getPrefixSpecial();
$mapped_tag->RebuildTagData();
return $mapped_tag->DoProcessTag();
}
}
trigger_error('Tag '.$Method.' Undefined in '.get_class($this).'[Agregated Tag]:<br><b>'.$tag->RebuildTagData().'</b>',E_USER_WARNING);
return false;
}*/
}
function CheckTag($tag, $prefix)
{
$Method = $tag;
if(method_exists($this, $Method))
{
return true;
}
else {
if ($this->Application->hasObject('TagsAggregator')) {
$aggregator =& $this->Application->recallObject('TagsAggregator');
$tmp = $this->Application->processPrefix($prefix);
$tag_mapping = $aggregator->GetArrayValue($tmp['prefix'], $Method);
if ($tag_mapping) {
return true;
}
}
}
}
function FormCacheKey($tag, $params, $prefix)
{
$k = $this->Application->Parser->TemplateName;
$k .= $prefix.'_'.$tag;
foreach (array('m_cat_id','m_cat_page','m_lang','m_theme') as $m_var) {
$params[$m_var] = $this->Application->GetVar($m_var);
}
ksort($params);
foreach ($params as $p => $v) {
$k .= "$p=$v&";
}
return md5($k);
}
-
+
function ProcessParsedTag($tag, $params, $prefix, $file='unknown', $line=0)
{
$Method = $tag;
if (method_exists($this, $Method)) {
if ($this->Application->isDebugMode() && constOn('DBG_SHOW_TAGS')) {
$this->Application->Debugger->appendHTML('Processing PreParsed Tag '.$Method.' in '.$this->Prefix);
}
$backup_prefix = $this->Prefix;
$backup_special = $this->Special;
-
+
if ($this->Application->ConfigValue('SystemTagCache') && isset($params['cache_timeout'])) {
if ($res = $this->Application->CacheGet($this->FormCacheKey($tag, $params, $prefix))) {
return $res;
}
}
-
+
$original_params = $params;
$flag_values = $this->PreparePostProcess($params);
// pass_params for non ParseBlock tags :)
if ($flag_values['pass_params']) {
$params = array_merge_recursive2($this->Application->Parser->Params, $params);
}
$ret = $this->$Method($params);
$this->Prefix = $backup_prefix;
$this->Special = $backup_special;
$ret = $this->PostProcess($ret, $flag_values);
if ($this->Application->ConfigValue('SystemTagCache') && $flag_values['cache_timeout'] && isset($this->Application->Memcached)) {
$this->Application->CacheSet($this->FormCacheKey($tag, $original_params, $prefix), $ret, $flag_values['cache_timeout']);
}
return $ret;
}
else {
list ($ret, $tag_found) = $this->processAggregatedTag($tag, $params, $prefix, $file, $line);
if ($tag_found) {
return $ret;
}
$this->Application->handleError(E_USER_ERROR, 'Tag Undefined:<br><b>'.$prefix.':'.$tag.'</b>', $file, $line);
return false;
}
}
function processAggregatedTag($tag, $params, $prefix, $file = 'unknown', $line = 0)
{
if ($this->Application->hasObject('TagsAggregator')) {
$Method = $tag;
$aggregator =& $this->Application->recallObject('TagsAggregator');
$tmp = $this->Application->processPrefix($prefix);
$tag_mapping = $aggregator->GetArrayValue($tmp['prefix'], $Method);
if ($tag_mapping) {
// aggregated tag defined
$tmp = $this->Application->processPrefix($tag_mapping[0]);
$__tag_processor = $tmp['prefix'].'_TagProcessor';
$processor =& $this->Application->recallObject($__tag_processor);
$processor->Prefix = $tmp['prefix'];
$processor->Special = getArrayValue($tag_mapping, 2) ? $tag_mapping[2] : $tmp['special'];
$params['original_tag'] = $Method; // allows to define same method for different aggregated tags in same tag processor
$params['PrefixSpecial'] = $this->getPrefixSpecial(); // $prefix;
$ret = $processor->ProcessParsedTag($tag_mapping[1], $params, $prefix);
if (isset($params['result_to_var'])) {
$this->Application->Parser->SetParam($params['result_to_var'], $ret);
$ret = '';
}
return Array ($ret, true);
}
else {
// aggregated tag not defined
if ($this->Application->isDebugMode()) {
$this->Application->Debugger->appendTrace();
}
$this->Application->handleError(E_USER_ERROR, 'Tag <b>'.$Method.'</b> Undefined in '.get_class($this).'[Agregated Tag]:<br><b>'.$tag.'</b>', $file, $line);
}
}
return Array ('', false);
}
function PreparePostProcess(&$params)
{
$flags = Array('js_escape', 'equals_to', 'result_to_var', 'pass_params', 'html_escape', 'strip_nl', 'trim', 'cache_timeout');
$flag_values = Array();
foreach ($flags as $flag_name) {
$flag_values[$flag_name] = false;
if (isset($params[$flag_name])) {
$flag_values[$flag_name] = $params[$flag_name];
unset($params[$flag_name]);
}
}
return $flag_values;
}
function PostProcess($ret, $flag_values)
{
if ($flag_values['html_escape']) {
$ret = htmlspecialchars($ret);
}
if ($flag_values['js_escape']) {
$ret = addslashes($ret);
$ret = str_replace(Array("\r", "\n"), Array('\r', '\n'), $ret);
$ret = str_replace('</script>', "</'+'script>", $ret);
}
if ($flag_values['strip_nl']) {
// 1 - strip \r,\n; 2 - strip tabs too
$ret = preg_replace($flag_values['strip_nl'] == 2 ? "/[\r\n\t]/" : "/[\r\n]/", '', $ret);
}
if ($flag_values['trim']) {
$ret = trim($ret);
}
// TODO: in new parser implement this parameter in compiled code (by Alex)
if ($flag_values['equals_to'] !== false) {
$equals_to = explode('|', $flag_values['equals_to']);
$ret = in_array($ret, $equals_to);
}
if ($flag_values['result_to_var']) {
$this->Application->Parser->SetParam($flag_values['result_to_var'], $ret);
$ret = '';
}
return $ret;
}
/**
* Not tag, method for parameter
* selection from list in this TagProcessor
*
* @param Array $params
* @param string $possible_names
* @return string
* @access public
*/
- function SelectParam($params, $possible_names)
+ function SelectParam($params, $possible_names = null)
{
- if (!is_array($params)) return;
- if (!is_array($possible_names))
+ if (!isset($possible_names)) {
+ // select 1st parameter non-empty parameter value
+ $possible_names = explode(',', $params['possible_names']);
+ foreach ($possible_names as $param_name) {
+ $value = $this->Application->Parser->GetParam($param_name);
+ if ((string)$value != '') {
+ return $value;
+ }
+ }
- $possible_names = explode(',', $possible_names);
- foreach ($possible_names as $name)
- {
+ return '';
+ }
+
+ if (!is_array($params)) {
+ // really happens?
+ return;
+ }
+
+ if (!is_array($possible_names)) {
+ $possible_names = explode(',', $possible_names);
+ }
+
+ foreach ($possible_names as $name) {
if( isset($params[$name]) ) return $params[$name];
}
+
return false;
}
}
/*class ProcessorsPool {
var $Processors = Array();
var $Application;
var $Prefixes = Array();
var $S;
function ProcessorsPool()
{
$this->Application =& KernelApplication::Instance();
$this->S =& $this->Application->Session;
}
function RegisterPrefix($prefix, $path, $class)
{
// echo " RegisterPrefix $prefix, $path, $class <br>";
$prefix_item = Array(
'path' => $path,
'class' => $class
);
$this->Prefixes[$prefix] = $prefix_item;
}
function CreateProcessor($prefix, &$tag)
{
// echo " prefix : $prefix <br>";
if (!isset($this->Prefixes[$prefix]))
$this->Application->ApplicationDie ("<b>Filepath and ClassName for prefix $prefix not defined while processing ".htmlspecialchars($tag->GetFullTag())."!</b>");
include_once($this->Prefixes[$prefix]['path']);
$ClassName = $this->Prefixes[$prefix]['class'];
$a_processor = new $ClassName($prefix);
$this->SetProcessor($prefix, $a_processor);
}
function SetProcessor($prefix, &$a_processor)
{
$this->Processors[$prefix] =& $a_processor;
}
function &GetProcessor($prefix, &$tag)
{
if (!isset($this->Processors[$prefix]))
$this->CreateProcessor($prefix, $tag);
return $this->Processors[$prefix];
}
}*/
?>
\ No newline at end of file
Property changes on: branches/RC/core/kernel/processors/tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.22.2.7
\ No newline at end of property
+1.22.2.8
\ No newline at end of property
Index: branches/RC/core/kernel/db/db_tag_processor.php
===================================================================
--- branches/RC/core/kernel/db/db_tag_processor.php (revision 11537)
+++ branches/RC/core/kernel/db/db_tag_processor.php (revision 11538)
@@ -1,2409 +1,2420 @@
<?php
class kDBTagProcessor extends TagProcessor {
/**
* Description
*
* @var kDBConnection
* @access public
*/
var $Conn;
function kDBTagProcessor()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
/**
* Returns true if "new" button was pressed in toolbar
*
* @param Array $params
* @return bool
*/
function IsNewMode($params)
{
$object =& $this->getObject($params);
return $object->GetID() <= 0;
}
/**
* Returns view menu name for current prefix
*
* @param Array $params
* @return string
*/
function GetItemName($params)
{
$item_name = $this->Application->getUnitOption($this->Prefix, 'ViewMenuPhrase');
return $this->Application->Phrase($item_name);
}
function ViewMenu($params)
{
$block_params = $params;
unset($block_params['block']);
$block_params['name'] = $params['block'];
$list =& $this->GetList($params);
$block_params['PrefixSpecial'] = $list->getPrefixSpecial();
return $this->Application->ParseBlock($block_params);
}
function SearchKeyword($params)
{
$list =& $this->GetList($params);
return $this->Application->RecallVar($list->getPrefixSpecial().'_search_keyword');
}
/**
* Draw filter menu content (for ViewMenu) based on filters defined in config
*
* @param Array $params
* @return string
*/
function DrawFilterMenu($params)
{
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['spearator_block'];
$separator = $this->Application->ParseBlock($block_params);
$filter_menu = $this->Application->getUnitOption($this->Prefix,'FilterMenu');
if (!$filter_menu) {
trigger_error('<span class="debug_error">no filters defined</span> for prefix <b>'.$this->Prefix.'</b>, but <b>DrawFilterMenu</b> tag used', E_USER_WARNING);
return '';
}
// Params: label, filter_action, filter_status
$block_params['name'] = $params['item_block'];
$view_filter = $this->Application->RecallVar($this->getPrefixSpecial().'_view_filter');
if ($view_filter === false) {
$event_params = Array ('prefix' => $this->Prefix, 'special' => $this->Special, 'name' => 'OnRemoveFilters');
$this->Application->HandleEvent( new kEvent($event_params) );
$view_filter = $this->Application->RecallVar($this->getPrefixSpecial().'_view_filter');
}
$view_filter = unserialize($view_filter);
$filters = Array();
$prefix_special = $this->getPrefixSpecial();
foreach ($filter_menu['Filters'] as $filter_key => $filter_params) {
$group_params = isset($filter_params['group_id']) ? $filter_menu['Groups'][ $filter_params['group_id'] ] : Array();
if (!isset($group_params['element_type'])) {
$group_params['element_type'] = 'checkbox';
}
if (!$filter_params) {
$filters[] = $separator;
continue;
}
$block_params['label'] = addslashes( $this->Application->Phrase($filter_params['label']) );
if (getArrayValue($view_filter,$filter_key)) {
$submit = 0;
if (isset($params['old_style'])) {
$status = $group_params['element_type'] == 'checkbox' ? 1 : 2;
}
else {
$status = $group_params['element_type'] == 'checkbox' ? '[\'img/check_on.gif\']' : '[\'img/menu_dot.gif\']';
}
}
else {
$submit = 1;
$status = 'null';
}
$block_params['filter_action'] = 'set_filter("'.$prefix_special.'","'.$filter_key.'","'.$submit.'",'.$params['ajax'].');';
$block_params['filter_status'] = $status; // 1 - checkbox, 2 - radio, 0 - no image
$filters[] = $this->Application->ParseBlock($block_params);
}
return implode('', $filters);
}
/**
* Draws auto-refresh submenu in View Menu.
*
* @param Array $params
* @return string
*/
function DrawAutoRefreshMenu($params)
{
$refresh_intervals = $this->Application->ConfigValue('AutoRefreshIntervals');
if (!$refresh_intervals) {
trigger_error('<span class="debug_error">no filters defined</span> for prefix <strong>'.$this->Prefix.'</strong>, but <strong>DrawAutoRefreshMenu</strong> tag used', E_USER_WARNING);
return '';
}
$refresh_intervals = explode(',', $refresh_intervals);
$view_name = $this->Application->RecallVar($this->getPrefixSpecial().'_current_view');
$current_refresh_interval = $this->Application->RecallPersistentVar($this->getPrefixSpecial().'_refresh_interval.'.$view_name);
if ($current_refresh_interval === false) {
// if no interval was selected before, then choose 1st interval
$current_refresh_interval = $refresh_intervals[0];
}
$ret = '';
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
foreach ($refresh_intervals as $refresh_interval) {
$block_params['label'] = $this->_formatInterval($refresh_interval);
$block_params['refresh_interval'] = $refresh_interval;
$block_params['selected'] = $current_refresh_interval == $refresh_interval;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
/**
* Tells, that current grid is using auto refresh
*
* @param Array $params
* @return bool
*/
function UseAutoRefresh($params)
{
$view_name = $this->Application->RecallVar($this->getPrefixSpecial().'_current_view');
return $this->Application->RecallPersistentVar($this->getPrefixSpecial().'_auto_refresh.'.$view_name);
}
/**
* Returns current grid refresh interval
*
* @param Array $params
* @return bool
*/
function AutoRefreshInterval($params)
{
$view_name = $this->Application->RecallVar($this->getPrefixSpecial().'_current_view');
return $this->Application->RecallPersistentVar($this->getPrefixSpecial().'_refresh_interval.'.$view_name);
}
/**
* Formats time interval using given text for hours and minutes
*
* @param int $intervalmMinutes
* @param string $hour_text Text for hours
* @param string $min_text Text for minutes
* @return unknown
*/
function _formatInterval($interval, $hour_text = 'h', $min_text = 'min')
{
// 65
$minutes = $interval % 60;
$hours = ($interval - $minutes) / 60;
$ret = '';
if ($hours) {
$ret .= $hours.$hour_text.' ';
}
if ($minutes) {
$ret .= $minutes.$min_text;
}
return $ret;
}
function IterateGridFields($params)
{
$mode = $params['mode'];
$def_block = isset($params['block']) ? $params['block'] : '';
$force_block = isset($params['force_block']) ? $params['force_block'] : false;
$grids = $this->Application->getUnitOption($this->Prefix,'Grids');
$grid_config = $grids[$params['grid']]['Fields'];
$picker_helper =& $this->Application->RecallObject('ColumnPickerHelper');
/* @var $picker_helper kColumnPickerHelper */
$picker_helper->ApplyPicker($this->getPrefixSpecial(), $grid_config, $params['grid']);
if ($mode == 'fields') {
return "'".join("','", array_keys($grid_config))."'";
}
$std_params['pass_params'] = 'true';
$std_params['PrefixSpecial'] = $this->getPrefixSpecial();
$object =& $this->GetList($params);
$o = '';
$i = 0;
foreach ($grid_config as $field => $options) {
$i++;
$block_params = Array();
$block_params['name'] = $force_block ? $force_block : (isset($options[$mode.'_block']) ? $options[$mode.'_block'] : $def_block);
$block_params['field'] = $field;
$block_params['sort_field'] = isset($options['sort_field']) ? $options['sort_field'] : $field;
$block_params['filter_field'] = isset($options['filter_field']) ? $options['filter_field'] : $field;
$w = $picker_helper->GetWidth($field);
if ($w) $options['width'] = $w;
/*if (isset($options['filter_width'])) {
$block_params['filter_width'] = $options['filter_width'];
}
elseif (isset($options['width'])) {
if (isset($options['filter_block']) && preg_match('/range/', $options['filter_block'])) {
if ($options['width'] < 60) {
$options['width'] = 60;
$block_params['filter_width'] = 20;
}
else {
$block_params['filter_width'] = $options['width'] - 40;
}
}
else {
$block_params['filter_width'] = max($options['width']-10, 20);
}
}*/
/*if (isset($block_params['filter_width'])) $block_params['filter_width'] .= 'px';
if (isset($options['filter_block']) && preg_match('/range/', $options['filter_block'])) {
$block_params['filter_width'] = '20px';
}
else {
$block_params['filter_width'] = '97%';
// $block_params['filter_width'] = max($options['width']-10, 20);
}*/
$field_options = $object->GetFieldOptions($field);
if (array_key_exists('use_phrases', $field_options)) {
$block_params['use_phrases'] = $field_options['use_phrases'];
}
$block_params['is_last'] = ($i == count($grid_config));
$block_params = array_merge($std_params, $options, $block_params);
$o.= $this->Application->ParseBlock($block_params, 1);
}
return $o;
}
function PickerCRC($params)
{
/* @var $picker_helper kColumnPickerHelper */
$picker_helper =& $this->Application->RecallObject('ColumnPickerHelper');
$picker_helper->SetGridName($params['grid']);
$data = $picker_helper->LoadColumns($this->getPrefixSpecial());
return $data['crc'];
}
function FreezerPosition($params)
{
/* @var $picker_helper kColumnPickerHelper */
$picker_helper =& $this->Application->RecallObject('ColumnPickerHelper');
$picker_helper->SetGridName($params['grid']);
$data = $picker_helper->LoadColumns($this->getPrefixSpecial());
$freezer_pos = array_search('__FREEZER__', $data['order']);
return $freezer_pos === false || in_array('__FREEZER__', $data['hidden_fields']) ? 1 : ++$freezer_pos;
}
function GridFieldsCount($params)
{
$grids = $this->Application->getUnitOption($this->Prefix, 'Grids');
$grid_config = $grids[$params['grid']]['Fields'];
return count($grid_config);
}
/**
* Prints list content using block specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintList($params)
{
$params['no_table'] = 1;
return $this->PrintList2($params);
}
function InitList($params)
{
$list_name = isset($params['list_name']) ? $params['list_name'] : '';
$names_mapping = $this->Application->GetVar('NamesToSpecialMapping');
if( !getArrayValue($names_mapping, $this->Prefix, $list_name) )
{
$list =& $this->GetList($params);
}
}
function BuildListSpecial($params)
{
return $this->Special;
}
/**
* Returns key, that identifies each list on template (used internally, not tag)
*
* @param Array $params
* @return string
*/
function getUniqueListKey($params)
{
$types = $this->SelectParam($params, 'types');
$except = $this->SelectParam($params, 'except');
$list_name = $this->SelectParam($params, 'list_name');
if (!$list_name) {
$list_name = $this->Application->Parser->GetParam('list_name');
}
return $types.$except.$list_name;
}
/**
* Enter description here...
*
* @param Array $params
* @return kDBList
*/
function &GetList($params)
{
$list_name = $this->SelectParam($params, 'list_name,name');
if (!$list_name) {
$list_name = $this->Application->Parser->GetParam('list_name');
}
$requery = isset($params['requery']) && $params['requery'];
if ($list_name && !$requery){
$names_mapping = $this->Application->GetVar('NamesToSpecialMapping');
$special = is_array($names_mapping) && isset($names_mapping[$this->Prefix]) && isset($names_mapping[$this->Prefix][$list_name]) ? $names_mapping[$this->Prefix][$list_name] : false;
// $special = getArrayValue($names_mapping, $this->Prefix, $list_name);
if(!$special)
{
$special = $this->BuildListSpecial($params);
}
}
else
{
$special = $this->BuildListSpecial($params);
}
$prefix_special = rtrim($this->Prefix.'.'.$special, '.');
$params['skip_counting'] = true;
$list =& $this->Application->recallObject( $prefix_special, $this->Prefix.'_List', $params);
/* @var $list kDBList */
if ($requery) {
$this->Application->HandleEvent($an_event, $prefix_special.':OnListBuild', $params);
}
if (array_key_exists('offset', $params)) {
$list->Offset += $params['offset']; // apply custom offset
}
$list->Query($requery);
if (array_key_exists('offset', $params)) {
$list->Offset -= $params['offset']; // remove custom offset
}
$this->Special = $special;
if ($list_name) {
$names_mapping[$this->Prefix][$list_name] = $special;
$this->Application->SetVar('NamesToSpecialMapping', $names_mapping);
}
return $list;
}
function ListMarker($params)
{
$list =& $this->GetList($params);
$ret = $list->getPrefixSpecial();
if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/');
return $ret;
}
/**
* Prepares name for field with event in it (used only on front-end)
*
* @param Array $params
* @return string
*/
function SubmitName($params)
{
$list =& $this->GetList($params);
$prefix_special = $list->getPrefixSpecial();
return 'events['.$prefix_special.']['.$params['event'].']';
}
/**
* Prints list content using block specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintList2($params)
{
$per_page = $this->SelectParam($params, 'per_page,max_items');
if ($per_page !== false) $params['per_page'] = $per_page;
$list =& $this->GetList($params);
$o = '';
$direction = (isset($params['direction']) && $params['direction']=="H")?"H":"V";
$columns = (isset($params['columns'])) ? $params['columns'] : 1;
$id_field = (isset($params['id_field'])) ? $params['id_field'] : $this->Application->getUnitOption($this->Prefix, 'IDField');
if ($columns > 1 && $direction == 'V') {
$records_left = array_splice($list->Records, $list->SelectedCount); // because we have 1 more record for "More..." link detection (don't need to sort it)
$list->Records = $this->LinearToVertical($list->Records, $columns, $list->GetPerPage());
$list->Records = array_merge($list->Records, $records_left);
}
$list->GoFirst();
$block_params=$this->prepareTagParams($params);
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
$block_params['pass_params'] = 'true';
$block_params['column_width'] = $params['column_width'] = 100 / $columns;
$block_start_row_params = $this->prepareTagParams($params);
$block_start_row_params['name'] = $this->SelectParam($params, 'row_start_render_as,block_row_start,row_start_block');
$block_end_row_params=$this->prepareTagParams($params);
$block_end_row_params['name'] = $this->SelectParam($params, 'row_end_render_as,block_row_end,row_end_block');
$block_empty_cell_params = $this->prepareTagParams($params);
$block_empty_cell_params['name'] = $this->SelectParam($params, 'empty_cell_render_as,block_empty_cell,empty_cell_block');
$i=0;
$backup_id=$this->Application->GetVar($this->Prefix."_id");
$displayed = array();
$column_number = 1;
$cache_mod_rw = $this->Application->getUnitOption($this->Prefix, 'CacheModRewrite') && $this->Application->RewriteURLs();
while (!$list->EOL())
{
$this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET
$this->Application->SetVar( $this->Prefix.'_id', $list->GetDBField($id_field) );
$block_params['is_last'] = ($i == $list->SelectedCount - 1);
$block_params['not_last'] = !$block_params['is_last']; // for front-end
if ($cache_mod_rw) {
if ($this->Prefix == 'c') {
// for listing subcategories in category
$this->Application->setCache('filenames', $this->Prefix.'_'.$list->GetDBField($id_field), $list->GetDBField('NamedParentPath'));
$this->Application->setCache('category_tree', $list->GetDBField($id_field), $list->GetDBField('TreeLeft') . ';' . $list->GetDBField('TreeRight'));
} else {
// for listing items in category
$this->Application->setCache('filenames', 'c_'.$list->GetDBField('CategoryId'), $list->GetDBField('CategoryFilename'));
$this->Application->setCache('filenames', $this->Prefix.'_'.$list->GetDBField($id_field), $list->GetDBField('Filename'));
}
}
if ($i % $columns == 0) {
// record in this iteration is first in row, then open row
$column_number = 1;
$o.= $block_start_row_params['name'] ?
$this->Application->ParseBlock($block_start_row_params, 1) :
(!isset($params['no_table']) ? '<tr>' : '');
}
else {
$column_number++;
}
$block_params['first_col'] = $column_number == 1 ? 1 : 0;
$block_params['last_col'] = $column_number == $columns ? 1 : 0;
$block_params['column_number'] = $column_number;
$this->PrepareListElementParams($list, $block_params); // new, no need to rewrite PrintList
$o.= $this->Application->ParseBlock($block_params, 1);
array_push($displayed, $list->GetDBField($id_field));
if($direction == 'V' && $list->SelectedCount % $columns > 0 && $column_number == ($columns - 1) && ceil(($i + 1) / $columns) > $list->SelectedCount % ceil($list->SelectedCount / $columns)) {
// if vertical output, then draw empty cells vertically, not horizontally
$o .= $block_empty_cell_params['name'] ? $this->Application->ParseBlock($block_empty_cell_params, 1) : '<td>&nbsp;</td>';
$i++;
}
if (($i + 1) % $columns == 0) {
// record in next iteration is first in row too, then close this row
$o.= $block_end_row_params['name'] ?
$this->Application->ParseBlock($block_end_row_params, 1) :
(!isset($params['no_table']) ? '</tr>' : '');
}
$list->GoNext();
$i++;
}
// append empty cells in place of missing cells in last row
while ($i % $columns != 0) {
// until next cell will be in new row append empty cells
$o .= $block_empty_cell_params['name'] ? $this->Application->ParseBlock($block_empty_cell_params, 1) : '<td>&nbsp;</td>';
if (($i+1) % $columns == 0) {
// record in next iteration is first in row too, then close this row
$o .= $block_end_row_params['name'] ? $this->Application->ParseBlock($block_end_row_params, 1) : '</tr>';
}
$i++;
}
$cur_displayed = $this->Application->GetVar($this->Prefix.'_displayed_ids');
if (!$cur_displayed) {
$cur_displayed = Array();
}
else {
$cur_displayed = explode(',', $cur_displayed);
}
$displayed = array_unique(array_merge($displayed, $cur_displayed));
$this->Application->SetVar($this->Prefix.'_displayed_ids', implode(',',$displayed));
$this->Application->SetVar( $this->Prefix.'_id', $backup_id);
$this->Application->SetVar( $this->getPrefixSpecial().'_id', '');
if (isset($params['more_link_render_as'])) {
$block_params = $params;
$params['render_as'] = $params['more_link_render_as'];
$o .= $this->MoreLink($params);
}
return $o;
}
/**
* Allows to modify block params & current list record before PrintList parses record
*
* @param kDBList $object
* @param Array $block_params
*/
function PrepareListElementParams(&$object, &$block_params)
{
// $fields_hash =& $object->getCurrentRecord();
}
function MoreLink($params)
{
$per_page = $this->SelectParam($params, 'per_page,max_items');
if ($per_page !== false) $params['per_page'] = $per_page;
$list =& $this->GetList($params);
if ($list->PerPage < $list->RecordsCount) {
$block_params = array();
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
return $this->Application->ParseBlock($block_params, 1);
}
}
function NotLastItem($params)
{
$object =& $this->getList($params); // maybe we should use $this->GetList($params) instead
return ($object->CurrentIndex < min($object->PerPage == -1 ? $object->RecordsCount : $object->PerPage, $object->RecordsCount) - 1);
}
function PageLink($params)
{
$t = isset($params['template']) ? $params['template'] : '';
unset($params['template']);
if (!$t) $t = $this->Application->GetVar('t');
if (isset($params['page'])) {
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $params['page']);
unset($params['page']);
}
if (!isset($params['pass'])) {
$params['pass'] = 'm,'.$this->getPrefixSpecial();
}
return $this->Application->HREF($t, '', $params);
}
function ColumnWidth($params)
{
$columns = $this->Application->Parser->GetParam('columns');
return round(100/$columns).'%';
}
/**
* Append prefix and special to tag
* params (get them from tagname) like
* they were really passed as params
*
* @param Array $tag_params
* @return Array
* @access protected
*/
function prepareTagParams($tag_params = Array())
{
/*if (isset($tag_params['list_name'])) {
$list =& $this->GetList($tag_params);
$this->Init($list->Prefix, $list->Special);
}*/
$ret = $tag_params;
$ret['Prefix'] = $this->Prefix;
$ret['Special'] = $this->Special;
$ret['PrefixSpecial'] = $this->getPrefixSpecial();
return $ret;
}
function GetISO($currency)
{
if ($currency == 'selected') {
$iso = $this->Application->RecallVar('curr_iso');
}
elseif ($currency == 'primary' || $currency == '') {
$iso = $this->Application->GetPrimaryCurrency();
}
else { //explicit currency
$iso = $currency;
}
return $iso;
}
function ConvertCurrency($value, $iso)
{
$converter =& $this->Application->recallObject('kCurrencyRates');
// convery primary currency to selected (if they are the same, converter will just return)
$value = $converter->Convert($value, 'PRIMARY', $iso);
return $value;
}
function AddCurrencySymbol($value, $iso)
{
$currency =& $this->Application->recallObject('curr.-'.$iso, null, Array('skip_autoload' => true));
if( !$currency->isLoaded() ) $currency->Load($iso, 'ISO');
$symbol = $currency->GetDBField('Symbol');
if (!$symbol) $symbol = $currency->GetDBField('ISO').'&nbsp;';
if ($currency->GetDBField('SymbolPosition') == 0) {
$value = $symbol.$value;
}
if ($currency->GetDBField('SymbolPosition') == 1) {
$value = $value.$symbol;
}
return $value;
}
/**
* Get's requested field value
*
* @param Array $params
* @return string
* @access public
*/
function Field($params)
{
$field = $this->SelectParam($params, 'name,field');
if( !$this->Application->IsAdmin() ) $params['no_special'] = 'no_special';
$object =& $this->getObject($params);
if ( $this->HasParam($params, 'db') )
{
$value = $object->GetDBField($field);
}
else
{
if( $this->HasParam($params, 'currency') )
{
$iso = $this->GetISO($params['currency']);
$original = $object->GetDBField($field);
$value = $this->ConvertCurrency($original, $iso);
$object->SetDBField($field, $value);
$object->Fields[$field]['converted'] = true;
}
$format = getArrayValue($params, 'format');
if (!$format || $format == '$format') {
$format = null;
}
$value = $object->GetField($field, $format);
if( $this->SelectParam($params, 'negative') )
{
if(strpos($value, '-') === 0)
{
$value = substr($value, 1);
}
else
{
$value = '-'.$value;
}
}
if( $this->HasParam($params, 'currency') )
{
$value = $this->AddCurrencySymbol($value, $iso);
$params['no_special'] = 1;
}
}
if( !$this->HasParam($params, 'no_special') ) $value = htmlspecialchars($value);
if( getArrayValue($params,'checked' ) ) $value = ($value == ( isset($params['value']) ? $params['value'] : 1)) ? 'checked' : '';
if( isset($params['plus_or_as_label']) ) {
$value = substr($value, 0,1) == '+' ? substr($value, 1) : $this->Application->Phrase($value);
}
elseif( isset($params['as_label']) && $params['as_label'] ) $value = $this->Application->Phrase($value);
$first_chars = $this->SelectParam($params,'first_chars,cut_first');
if($first_chars)
{
$needs_cut = mb_strlen($value) > $first_chars;
$value = mb_substr($value, 0, $first_chars);
if ($needs_cut) $value .= ' ...';
}
if( getArrayValue($params,'nl2br' ) ) $value = nl2br($value);
if ($value != '') $this->Application->Parser->DataExists = true;
if( $this->HasParam($params, 'currency') )
{
//restoring value in original currency, for other Field tags to work properly
$object->SetDBField($field, $original);
}
return $value;
}
function SetField($params)
{
// <inp2:SetField field="Value" src=p:cust_{$custom_name}"/>
$object =& $this->getObject($params);
$dst_field = $this->SelectParam($params, 'name,field');
list($prefix_special, $src_field) = explode(':', $params['src']);
$src_object =& $this->Application->recallObject($prefix_special);
$object->SetDBField($dst_field, $src_object->GetDBField($src_field));
}
/**
* Checks if parameter is passed
* Note: works like Tag and line simple method too
*
* @param Array $params
* @param string $param_name
* @return bool
*/
function HasParam($params, $param_name = null)
{
if( !isset($param_name) )
{
$param_name = $this->SelectParam($params, 'name');
$params = $this->Application->Parser->Params;
}
$value = isset($params[$param_name]) ? $params[$param_name] : false;
return $value && ($value != '$'.$param_name);
}
function PhraseField($params)
{
$field_label = $this->Field($params);
$translation = $this->Application->Phrase( $field_label );
return $translation;
}
function Error($params)
{
$field = $this->SelectParam($params, 'name,field');
$object =& $this->getObject($params);
$msg = $object->GetErrorMsg($field, false);
return $msg;
}
function HasError($params)
{
if ($params['field'] == 'any')
{
$object =& $this->getObject($params);
$skip_fields = getArrayValue($params, 'except');
$skip_fields = $skip_fields ? explode(',', $skip_fields) : Array();
return $object->HasErrors($skip_fields);
}
else
{
$fields = $this->SelectParam($params, 'field,fields');
$fields = explode(',', $fields);
$res = false;
foreach($fields as $field)
{
$params['field'] = $field;
$res = $res || ($this->Error($params) != '');
}
return $res;
}
}
function ErrorWarning($params)
{
if (!isset($params['field'])) {
$params['field'] = 'any';
}
if ($this->HasError($params)) {
$params['prefix'] = $this->getPrefixSpecial();
return $this->Application->ParseBlock($params);
}
}
function IsRequired($params)
{
$field = $params['field'];
$object =& $this->getObject($params);;
$formatter_class = getArrayValue($object->Fields, $field, 'formatter');
if ($formatter_class == 'kMultiLanguage')
{
$formatter =& $this->Application->recallObject($formatter_class);
$field = $formatter->LangFieldName($field);
}
$options = $object->GetFieldOptions($field);
return getArrayValue($options,'required');
}
function FieldOption($params)
{
$object =& $this->getObject($params);;
$options = $object->GetFieldOptions($params['field']);
$ret = isset($options[$params['option']]) ? $options[$params['option']] : '';
if (isset($params['as_label']) && $params['as_label']) $ret = $this->Application->ReplaceLanguageTags($ret);
return $ret;
}
function PredefinedOptions($params)
{
$object =& $this->getObject($params);
$field = $params['field'];
$value = array_key_exists('value', $params) ? $params['value'] : $object->GetDBField($field);
$field_options = $object->GetFieldOptions($field);
if (!array_key_exists('options', $field_options) || !is_array($field_options['options'])) {
trigger_error('Options not defined for <strong>'.$object->Prefix.'</strong> field <strong>'.$field.'</strong>', E_USER_WARNING);
return '';
}
$options = $field_options['options'];
if ($this->HasParam($params, 'has_empty')) {
$empty_value = array_key_exists('empty_value', $params) ? $params['empty_value'] : '';
$options = array_merge_recursive2(Array ($empty_value => ''), $options); // don't use other array merge function, because they will reset keys !!!
}
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
$block_params['pass_params'] = 'true';
if (method_exists($object, 'EOL') && count($object->Records) == 0) {
// for drawing grid column filter
$block_params['field_name'] = '';
}
else {
$block_params['field_name'] = $this->InputName($params); // depricated (produces warning when used as grid filter), but used in Front-End (submission create), admin (submission view)
}
$selected_param_name = getArrayValue($params, 'selected_param');
if (!$selected_param_name) {
$selected_param_name = $params['selected'];
}
$selected = $params['selected'];
$o = '';
if ($this->HasParam($params, 'no_empty') && !getArrayValue($options, '')) {
// removes empty option, when present (needed?)
array_shift($options);
}
if (strpos($value, '|') !== false) {
// multiple checkboxes OR multiselect
$value = explode('|', substr($value, 1, -1) );
foreach ($options as $key => $val) {
$block_params['key'] = $key;
$block_params['option'] = $val;
$block_params[$selected_param_name] = ( in_array($key, $value) ? ' '.$selected : '');
$o .= $this->Application->ParseBlock($block_params, 1);
}
}
else {
// single selection radio OR checkboxes OR dropdown
foreach ($options as $key => $val) {
$block_params['key'] = $key;
$block_params['option'] = $val;
$block_params[$selected_param_name] = (strlen($key) == strlen($value) && ($key == $value) ? ' '.$selected : '');
$o .= $this->Application->ParseBlock($block_params, 1);
}
}
return $o;
}
function PredefinedSearchOptions($params)
{
$object =& $this->getObject($params);
/* @var $object kDBList */
$params['value'] = $this->SearchField($params);
$view_name = $this->Application->RecallVar($this->getPrefixSpecial().'_current_view');
$custom_filter = $this->Application->RecallPersistentVar($this->getPrefixSpecial().'_custom_filter.'.$view_name, ALLOW_DEFAULT_SETTINGS);
return $this->PredefinedOptions($params);
}
function Format($params)
{
$field = $this->SelectParam($params, 'name,field');
$object =& $this->getObject($params);
$options = $object->GetFieldOptions($field);
$format = $options[ $this->SelectParam($params, 'input_format') ? 'input_format' : 'format' ];
$formatter_class = getArrayValue($options,'formatter');
if ($formatter_class) {
$formatter =& $this->Application->recallObject($formatter_class);
$human_format = getArrayValue($params,'human');
$edit_size = getArrayValue($params,'edit_size');
$sample = getArrayValue($params,'sample');
if($sample)
{
return $formatter->GetSample($field, $options, $object);
}
elseif($human_format || $edit_size)
{
$format = $formatter->HumanFormat($format);
return $edit_size ? strlen($format) : $format;
}
}
return $format;
}
/**
* Returns grid padination information
* Can return links to pages
*
* @param Array $params
* @return mixed
*/
function PageInfo($params)
{
$object =& $this->GetList($params);
/* @var $object kDBList */
$type = $params['type'];
unset($params['type']); // remove parameters used only by current tag
$ret = '';
switch ($type) {
case 'current':
$ret = $object->Page;
break;
case 'total':
$ret = $object->GetTotalPages();
break;
case 'prev':
$ret = $object->Page > 1 ? $object->Page - 1 : false;
break;
case 'next':
$ret = $object->Page < $object->GetTotalPages() ? $object->Page + 1 : false;
break;
}
if ($ret && isset($params['as_link']) && $params['as_link']) {
unset($params['as_link']); // remove parameters used only by current tag
$params['page'] = $ret;
$current_page = $object->Page; // backup current page
$ret = $this->PageLink($params);
$this->Application->SetVar($object->getPrefixSpecial().'_Page', $current_page); // restore page
}
return $ret;
}
/**
* Print grid pagination using
* block names specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintPages($params)
{
$list =& $this->GetList($params);
$prefix_special = $list->getPrefixSpecial();
$total_pages = $list->GetTotalPages();
if ($total_pages > 1) $this->Application->Parser->DataExists = true;
if($total_pages == 0) $total_pages = 1; // display 1st page as selected in case if we have no pages at all
$o = '';
// what are these 2 lines for?
$this->Application->SetVar($prefix_special.'_event','');
$this->Application->SetVar($prefix_special.'_id','');
$current_page = $list->Page; // $this->Application->RecallVar($prefix_special.'_Page');
$block_params = $this->prepareTagParams($params);
$split = ( isset($params['split'] ) ? $params['split'] : 10 );
$split_start = $current_page - ceil($split/2);
if ($split_start < 1){
$split_start = 1;
}
$split_end = $split_start + $split-1;
if ($split_end > $total_pages) {
$split_end = $total_pages;
$split_start = max($split_end - $split + 1, 1);
}
if ($current_page > 1){
$prev_block_params = $this->prepareTagParams();
if ($total_pages > $split){
$prev_block_params['page'] = max($current_page-$split, 1);
$prev_block_params['name'] = $this->SelectParam($params, 'prev_page_split_render_as,prev_page_split_block');
if ($prev_block_params['name']){
$o .= $this->Application->ParseBlock($prev_block_params, 1);
}
}
$prev_block_params['name'] = 'page';
$prev_block_params['page'] = $current_page-1;
$prev_block_params['name'] = $this->SelectParam($params, 'prev_page_render_as,block_prev_page,prev_page_block');
if ($prev_block_params['name']) {
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $current_page-1);
$o .= $this->Application->ParseBlock($prev_block_params, 1);
}
}
else {
if ( $no_prev_page_block = $this->SelectParam($params, 'no_prev_page_render_as,block_no_prev_page') ) {
$block_params['name'] = $no_prev_page_block;
$o .= $this->Application->ParseBlock($block_params, 1);
}
}
$separator_params['name'] = $this->SelectParam($params, 'separator_render_as,block_separator');
for ($i = $split_start; $i <= $split_end; $i++)
{
if ($i == $current_page) {
$block = $this->SelectParam($params, 'current_render_as,active_render_as,block_current,active_block');
}
else {
$block = $this->SelectParam($params, 'link_render_as,inactive_render_as,block_link,inactive_block');
}
$block_params['name'] = $block;
$block_params['page'] = $i;
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $i);
$o .= $this->Application->ParseBlock($block_params, 1);
if ($this->SelectParam($params, 'separator_render_as,block_separator')
&& $i < $split_end)
{
$o .= $this->Application->ParseBlock($separator_params, 1);
}
}
if ($current_page < $total_pages){
$next_block_params = $this->prepareTagParams();
$next_block_params['page']=$current_page+1;
$next_block_params['name'] = $this->SelectParam($params, 'next_page_render_as,block_next_page,next_page_block');
if ($next_block_params['name']){
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $current_page+1);
$o .= $this->Application->ParseBlock($next_block_params, 1);
}
if ($total_pages > $split){
$next_block_params['page']=min($current_page+$split, $total_pages);
$next_block_params['name'] = $this->SelectParam($params, 'next_page_split_render_as,next_page_split_block');
if ($next_block_params['name']){
$o .= $this->Application->ParseBlock($next_block_params, 1);
}
}
}
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $current_page);
return $o;
}
/**
* Print grid pagination using
* block names specified
*
* @param Array $params
* @return string
* @access public
*/
function PaginationBar($params)
{
return $this->PrintPages($params);
}
/**
* Returns field name (processed by kMultiLanguage formatter
* if required) and item's id from it's IDField or field required
*
* @param Array $params
* @return Array (id,field)
* @access private
*/
function prepareInputName($params)
{
$field = $this->SelectParam($params, 'name,field');
$object =& $this->getObject($params);
$formatter_class = getArrayValue($object->Fields, $field, 'formatter');
if ($formatter_class == 'kMultiLanguage') {
$formatter =& $this->Application->recallObject($formatter_class);
/* @var $formatter kMultiLanguage */
$force_primary = isset($object->Fields[$field]['force_primary']) && $object->Fields[$field]['force_primary'];
$field = $formatter->LangFieldName($field, $force_primary);
}
if (array_key_exists('force_id', $params)) {
$id = $params['force_id'];
}
else {
$id_field = getArrayValue($params, 'IdField');
$id = $id_field ? $object->GetDBField($id_field) : $object->GetID();
}
return Array($id, $field);
}
/**
* Returns input field name to
* be placed on form (for correct
* event processing)
*
* @param Array $params
* @return string
* @access public
*/
function InputName($params)
{
list($id, $field) = $this->prepareInputName($params);
$ret = $this->getPrefixSpecial().'['.$id.']['.$field.']';
if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/');
return $ret;
}
/**
* Allows to override various field options through hidden fields with specific names in submit.
* This tag generates this special names
*
* @param Array $params
* @return string
* @author Alex
*/
function FieldModifier($params)
{
list($id, $field) = $this->prepareInputName($params);
$ret = 'field_modifiers['.$this->getPrefixSpecial().']['.$field.']['.$params['type'].']';
if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/');
if (isset($params['value'])) {
$object =& $this->getObject($params);
$field_modifiers[$field][$params['type']] = $params['value'];
$object->ApplyFieldModifiers($field_modifiers);
}
return $ret;
}
/**
* Returns index where 1st changable sorting field begins
*
* @return int
* @access private
*/
function getUserSortIndex()
{
$list_sortings = $this->Application->getUnitOption($this->Prefix, 'ListSortings');
$sorting_prefix = getArrayValue($list_sortings, $this->Special) ? $this->Special : '';
$user_sorting_start = 0;
if ( $forced_sorting = getArrayValue($list_sortings, $sorting_prefix, 'ForcedSorting') ) {
$user_sorting_start = count($forced_sorting);
}
return $user_sorting_start;
}
/**
* Returns order direction for given field
*
*
*
* @param Array $params
* @return string
* @access public
*/
function Order($params)
{
$field = $params['field'];
$user_sorting_start = $this->getUserSortIndex();
$list =& $this->GetList($params);
if ($list->GetOrderField($user_sorting_start) == $field)
{
return strtolower($list->GetOrderDirection($user_sorting_start));
}
elseif($list->GetOrderField($user_sorting_start+1) == $field)
{
return '2_'.strtolower($list->GetOrderDirection($user_sorting_start+1));
}
else
{
return 'no';
}
}
/**
* Detects, that current sorting is not default
*
* @param Array $params
* @return bool
*/
function OrderChanged($params)
{
$list =& $this->GetList($params);
$user_sorting_start = $this->getUserSortIndex();
$sorting_configs = $this->Application->getUnitOption($this->Prefix, 'ConfigMapping', Array ());
$list_sortings = $this->Application->getUnitOption($this->Prefix, 'ListSortings', Array ());
$sorting_prefix = getArrayValue($list_sortings, $this->Special) ? $this->Special : '';
if (array_key_exists('DefaultSorting1Field', $sorting_configs)) {
$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']),
);
}
$sorting = getArrayValue($list_sortings, $sorting_prefix, 'Sorting');
$sort_fields = is_array($sorting) ? array_keys($sorting) : Array ();
for ($order_number = 0; $order_number < 2; $order_number++) {
// currect sorting in list
$sorting_pos = $user_sorting_start + $order_number;
$current_order_field = $list->GetOrderField($sorting_pos, true);
$current_order_direction = $list->GetOrderDirection($sorting_pos, true);
if (!$current_order_field || !$current_order_direction) {
// no sorting defined for this sorting position
continue;
}
// user sorting found
if (array_key_exists($order_number, $sort_fields)) {
// default sorting found
$default_order_field = $sort_fields[$order_number];
$default_order_direction = $sorting[$default_order_field];
if ($current_order_field != $default_order_field || $current_order_direction != $default_order_direction) {
// #1. user sorting differs from default sorting -> changed
return true;
}
}
else {
// #2. user sorting + no default sorting -> changed
return true;
}
}
// #3. user sorting match default or not defined -> not changed
return false;
}
/**
* Get's information of sorting field at "pos" position,
* like sorting field name (type="field") or sorting direction (type="direction")
*
* @param Array $params
* @return mixed
*/
function OrderInfo($params)
{
$user_sorting_start = $this->getUserSortIndex() + --$params['pos'];
$list =& $this->GetList($params);
// $object =& $this->Application->recallObject( $this->getPrefixSpecial() );
if($params['type'] == 'field') return $list->GetOrderField($user_sorting_start);
if($params['type'] == 'direction') return $list->GetOrderDirection($user_sorting_start);
}
/**
* Checks if sorting field/direction matches passed field/direction parameter
*
* @param Array $params
* @return bool
*/
function IsOrder($params)
{
$params['type'] = isset($params['field']) ? 'field' : 'direction';
$value = $this->OrderInfo($params);
if( isset($params['field']) ) return $params['field'] == $value;
if( isset($params['direction']) ) return $params['direction'] == $value;
}
/**
* Returns list perpage
*
* @param Array $params
* @return int
*/
function PerPage($params)
{
$object =& $this->getObject($params);
return $object->PerPage;
}
/**
* Checks if list perpage matches value specified
*
* @param Array $params
* @return bool
*/
function PerPageEquals($params)
{
$object =& $this->getObject($params);
return $object->PerPage == $params['value'];
}
function SaveEvent($params)
{
// SaveEvent is set during OnItemBuild, but we may need it before any other tag calls OnItemBuild
$object =& $this->getObject($params);
return $this->Application->GetVar($this->getPrefixSpecial().'_SaveEvent');
}
function NextId($params)
{
$object =& $this->getObject($params);
$wid = $this->Application->GetTopmostWid($this->Prefix);
$session_name = rtrim($this->getPrefixSpecial().'_selected_ids_'.$wid, '_');
$ids = explode(',', $this->Application->RecallVar($session_name));
$cur_id = $object->GetID();
$i = array_search($cur_id, $ids);
if ($i !== false) {
return $i < count($ids) - 1 ? $ids[$i + 1] : '';
}
return '';
}
function PrevId($params)
{
$object =& $this->getObject($params);
$wid = $this->Application->GetTopmostWid($this->Prefix);
$session_name = rtrim($this->getPrefixSpecial().'_selected_ids_'.$wid, '_');
$ids = explode(',', $this->Application->RecallVar($session_name));
$cur_id = $object->GetID();
$i = array_search($cur_id, $ids);
if ($i !== false) {
return $i > 0 ? $ids[$i - 1] : '';
}
return '';
}
function IsSingle($params)
{
return ($this->NextId($params) === '' && $this->PrevId($params) === '');
}
function IsLast($params)
{
return ($this->NextId($params) === '');
}
function IsFirst($params)
{
return ($this->PrevId($params) === '');
}
/**
* Checks if field value is equal to proposed one
*
* @param Array $params
* @return bool
*/
function FieldEquals($params)
{
$object =& $this->getObject($params);
$ret = $object->GetDBField($this->SelectParam($params, 'name,field')) == $params['value'];
// if( getArrayValue($params,'inverse') ) $ret = !$ret;
return $ret;
}
/**
* Checks, that grid has icons defined and they should be shown
*
* @param Array $params
* @return bool
*/
function UseItemIcons($params)
{
$grids = $this->Application->getUnitOption($this->Prefix, 'Grids');
return array_key_exists('Icons', $grids[ $params['grid'] ]);
}
/**
* Returns corresponding to grid layout selector column width
*
* @param Array $params
* @return int
*/
function GridSelectorColumnWidth($params)
{
$width = 0;
if ($params['selector']) {
$width += $params['selector_width'];
}
if ($this->UseItemIcons($params)) {
$width += $params['icon_width'];
}
return $width;
}
/**
* Returns grids item selection mode (checkbox, radio, )
*
* @param Array $params
* @return string
*/
function GridSelector($params)
{
$grids = $this->Application->getUnitOption($this->Prefix, 'Grids');
return array_key_exists('Selector', $grids[ $params['grid'] ]) ? $grids[ $params['grid'] ]['Selector'] : $params['default'];
}
function ItemIcon($params)
{
$object =& $this->getObject($params);
$grids = $this->Application->getUnitOption($this->Prefix,'Grids');
$icons =& $grids[ $params['grid'] ]['Icons'];
$key = '';
$status_fields = $this->Application->getUnitOption($this->Prefix,'StatusField');
if(!$status_fields) return $icons['default'];
foreach($status_fields as $status_field)
{
$key .= $object->GetDBField($status_field).'_';
}
$key = rtrim($key,'_');
$value = ($key !== false) ? $key : 'default';
return isset($icons[$value]) ? $icons[$value] : $icons['default'];
}
/**
* Generates bluebar title + initializes prefixes used on page
*
* @param Array $params
* @return string
*/
function SectionTitle($params)
{
$preset_name = replaceModuleSection($params['title_preset']);
$title_presets = $this->Application->getUnitOption($this->Prefix,'TitlePresets');
$title_info = getArrayValue($title_presets, $preset_name);
if ($title_info === false) {
$title = str_replace('#preset_name#', $preset_name, $params['title']);
if ($this->Application->ConfigValue('UseSmallHeader') && isset($params['group_title']) && $params['group_title']) {
$title .= ' - '.$params['group_title'];
}
return $title;
}
if (getArrayValue($title_presets,'default')) {
// use default labels + custom labels specified in preset used
$title_info = array_merge_recursive2($title_presets['default'], $title_info);
}
$title = $title_info['format'];
// 1. get objects in use for title construction
$objects = Array();
$object_status = Array();
$status_labels = Array();
$prefixes = getArrayValue($title_info,'prefixes');
$all_tag_params = getArrayValue($title_info,'tag_params');
if ($prefixes) {
// extract tag_perams passed directly to SectionTitle tag for specific prefix
foreach ($params as $tp_name => $tp_value) {
if (preg_match('/(.*)\[(.*)\]/', $tp_name, $regs)) {
$all_tag_params[ $regs[1] ][ $regs[2] ] = $tp_value;
unset($params[$tp_name]);
}
}
$tag_params = Array();
foreach ($prefixes as $prefix_special) {
$prefix_data = $this->Application->processPrefix($prefix_special);
$prefix_data['prefix_special'] = rtrim($prefix_data['prefix_special'],'.');
if ($all_tag_params) {
$tag_params = getArrayValue($all_tag_params, $prefix_data['prefix_special']);
if (!$tag_params) $tag_params = Array();
}
$tag_params = array_merge_recursive2($params, $tag_params);
$objects[ $prefix_data['prefix_special'] ] =& $this->Application->recallObject($prefix_data['prefix_special'], $prefix_data['prefix'], $tag_params);
$object_status[ $prefix_data['prefix_special'] ] = $objects[ $prefix_data['prefix_special'] ]->IsNewItem() ? 'new' : 'edit';
// a. set object's status field (adding item/editing item) for each object in title
if (getArrayValue($title_info[ $object_status[ $prefix_data['prefix_special'] ].'_status_labels' ],$prefix_data['prefix_special'])) {
$status_labels[ $prefix_data['prefix_special'] ] = $title_info[ $object_status[ $prefix_data['prefix_special'] ].'_status_labels' ][ $prefix_data['prefix_special'] ];
$title = str_replace('#'.$prefix_data['prefix_special'].'_status#', $status_labels[ $prefix_data['prefix_special'] ], $title);
}
// b. setting object's titlefield value (in titlebar ONLY) to default in case if object beeing created with no titlefield filled in
if ($object_status[ $prefix_data['prefix_special'] ] == 'new') {
$new_value = $this->getInfo( $objects[ $prefix_data['prefix_special'] ], 'titlefield' );
if(!$new_value && getArrayValue($title_info['new_titlefield'],$prefix_data['prefix_special']) ) $new_value = $this->Application->Phrase($title_info['new_titlefield'][ $prefix_data['prefix_special'] ]);
$title = str_replace('#'.$prefix_data['prefix_special'].'_titlefield#', $new_value, $title);
}
}
}
// 2. replace phrases if any found in format string
$title = $this->Application->ReplaceLanguageTags($title,false);
// 3. find and replace any replacement vars
preg_match_all('/#(.*_.*)#/Uis',$title,$rets);
if ($rets[1]) {
$replacement_vars = array_keys( array_flip($rets[1]) );
foreach ($replacement_vars as $replacement_var) {
$var_info = explode('_',$replacement_var,2);
$object =& $objects[ $var_info[0] ];
$new_value = $this->getInfo($object,$var_info[1]);
$title = str_replace('#'.$replacement_var.'#', $new_value, $title);
}
}
// replace trailing spaces inside title preset + '' occurences into single space
$title = preg_replace('/[ ]*\'\'[ ]*/', ' ', $title);
if ($this->Application->ConfigValue('UseSmallHeader') && isset($params['group_title']) && $params['group_title']) {
$title .= ' - '.$params['group_title'];
}
$cut_first = getArrayValue($params, 'cut_first');
if ($cut_first && mb_strlen($title) > $cut_first) {
if (!preg_match('/<a href="(.*)">(.*)<\/a>/',$title)) {
$title = mb_substr($title, 0, $cut_first).' ...';
}
}
return $title;
}
function getInfo(&$object, $info_type)
{
switch ($info_type)
{
case 'titlefield':
$field = $this->Application->getUnitOption($object->Prefix,'TitleField');
return $field !== false ? $object->GetField($field) : 'TitleField Missing';
break;
case 'recordcount':
$of_phrase = $this->Application->Phrase('la_of');
return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' '.$of_phrase.' '.$object->NoFilterCount : $object->RecordsCount;
break;
default:
return $object->GetField($info_type);
break;
}
}
function GridInfo($params)
{
$object =& $this->GetList($params);
/* @var $object kDBList */
switch ($params['type']) {
case 'filtered':
return $object->GetRecordsCount();
case 'total':
return $object->GetNoFilterCount();
case 'from':
return $object->RecordsCount ? $object->Offset+1 : 0; //0-based
case 'to':
return $object->PerPage > 0 ? min($object->Offset + $object->PerPage, $object->RecordsCount) : $object->RecordsCount;
case 'total_pages':
return $object->GetTotalPages();
case 'needs_pagination':
return ($object->RecordsCount > $object->PerPage) || ($object->Page > 1);
}
}
/**
* Parses block depending on its element type.
* For radio and select elements values are taken from 'value_list_field' in key1=value1,key2=value2
* format. key=value can be substituted by <SQL>SELECT f1 AS OptionName, f2 AS OptionValue... FROM <PREFIX>TableName </SQL>
* where prefix is TABLE_PREFIX
*
* @param Array $params
* @return string
*/
function ConfigFormElement($params)
{
$object =& $this->getObject($params);
$field = $params['field'];
$helper =& $this->Application->recallObject('InpCustomFieldsHelper');
/* @var $helper InpCustomFieldsHelper */
$element_type = $object->GetDBField($params['element_type_field']);
if($element_type == 'label') $element_type = 'text';
$params['name'] = $params['blocks_prefix'].$element_type;
switch ($element_type) {
case 'select':
case 'multiselect':
case 'radio':
$field_options = $object->GetFieldOptions($field, 'options');
if ($object->GetDBField('DirectOptions')) {
// used for custom fields
$field_options['options'] = $object->GetDBField('DirectOptions');
}
else {
// used for configuration
$field_options['options'] = $helper->GetValuesHash($object->GetDBField($params['value_list_field']), ',');
}
$object->SetFieldOptions($field, $field_options);
break;
case 'text':
case 'textarea':
$params['field_params'] = $helper->ParseConfigSQL($object->GetDBField($params['value_list_field']));
break;
case 'password':
case 'checkbox':
default:
break;
}
return $this->Application->ParseBlock($params, 1);
}
/**
* Get's requested custom field value
*
* @param Array $params
* @return string
* @access public
*/
function CustomField($params)
{
$params['name'] = 'cust_'.$this->SelectParam($params, 'name,field');
return $this->Field($params);
}
function CustomFieldLabel($params)
{
$object =& $this->getObject($params);
$field = $this->SelectParam($params, 'name,field');
$sql = 'SELECT FieldLabel
FROM '.$this->Application->getUnitOption('cf', 'TableName').'
WHERE FieldName = '.$this->Conn->qstr($field);
return $this->Application->Phrase($this->Conn->GetOne($sql));
}
/**
* transposes 1-dimensional array elements for vertical alignment according to given columns and per_page parameters
*
* @param array $arr
* @param int $columns
* @param int $per_page
* @return array
*/
function LinearToVertical(&$arr, $columns, $per_page)
{
$rows = $columns;
// in case if after applying per_page limit record count less then
// can fill requrested column count, then fill as much as we can
$cols = min(ceil($per_page / $columns), ceil(count($arr) / $columns));
$imatrix = array();
for ($row = 0; $row < $rows; $row++) {
for ($col = 0; $col < $cols; $col++) {
$source_index = $row * $cols + $col;
if (!isset($arr[$source_index])) {
// in case if source array element count is less then element count in one row
continue;
}
$imatrix[$col * $rows + $row] = $arr[$source_index];
}
}
ksort($imatrix);
return array_values($imatrix);
}
/**
* If data was modfied & is in TempTables mode, then parse block with name passed;
* remove modification mark if not in TempTables mode
*
* @param Array $params
* @return string
* @access public
* @author Alexey
*/
function SaveWarning($params)
{
$main_prefix = getArrayValue($params, 'main_prefix');
if ($main_prefix && $main_prefix != '$main_prefix') {
$top_prefix = $main_prefix;
}
else {
$top_prefix = $this->Application->GetTopmostPrefix($this->Prefix);
}
$temp_tables = substr($this->Application->GetVar($top_prefix.'_mode'), 0, 1) == 't';
$modified = $this->Application->RecallVar($top_prefix.'_modified');
if ($temp_tables && $modified) {
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $this->SelectParam($params, 'render_as,name');
$block_params['edit_mode'] = $temp_tables ? 1 : 0;
return $this->Application->ParseBlock($block_params);
}
$this->Application->RemoveVar($top_prefix.'_modified');
return '';
}
/**
* Returns list record count queries (on all pages)
*
* @param Array $params
* @return int
*/
function TotalRecords($params)
{
$list =& $this->GetList($params);
if (!$list->Counted) $list->CountRecs();
return $list->RecordsCount;
}
/**
* Range filter field name
*
* @param Array $params
* @return string
*/
function SearchInputName($params)
{
$field = $this->SelectParam($params, 'field,name');
$ret = 'custom_filters['.$this->getPrefixSpecial().']['.$params['grid'].']['.$field.']['.$params['filter_type'].']';
if (isset($params['type'])) {
$ret .= '['.$params['type'].']';
}
return $ret;
}
/**
* Return range filter field value
*
* @param Array $params
* @return string
*/
function SearchField($params) // RangeValue
{
$field = $this->SelectParam($params, 'field,name');
$view_name = $this->Application->RecallVar($this->getPrefixSpecial().'_current_view');
$custom_filter = $this->Application->RecallPersistentVar($this->getPrefixSpecial().'_custom_filter.'.$view_name, ALLOW_DEFAULT_SETTINGS);
$custom_filter = $custom_filter ? unserialize($custom_filter) : Array();
if (isset($custom_filter[ $params['grid'] ][$field])) {
$ret = $custom_filter[ $params['grid'] ][$field][ $params['filter_type'] ]['submit_value'];
if (isset($params['type'])) {
$ret = $ret[ $params['type'] ];
}
if( !$this->HasParam($params, 'no_special') ) $ret = htmlspecialchars($ret);
return $ret;
}
return '';
}
function SearchFormat($params)
{
$field = $params['field'];
$object =& $this->GetList($params);
$options = $object->GetFieldOptions($field);
$format = $options[ $this->SelectParam($params, 'input_format') ? 'input_format' : 'format' ];
$formatter_class = getArrayValue($options,'formatter');
if($formatter_class)
{
$formatter =& $this->Application->recallObject($formatter_class);
$human_format = getArrayValue($params,'human');
$edit_size = getArrayValue($params,'edit_size');
$sample = getArrayValue($params,'sample');
if($sample)
{
return $formatter->GetSample($field, $options, $object);
}
elseif($human_format || $edit_size)
{
$format = $formatter->HumanFormat($format);
return $edit_size ? strlen($format) : $format;
}
}
return $format;
}
/**
* Returns error of range field
*
* @param unknown_type $params
* @return unknown
*/
function SearchError($params)
{
$field = $this->SelectParam($params, 'field,name');
$error_var_name = $this->getPrefixSpecial().'_'.$field.'_error';
$pseudo = $this->Application->RecallVar($error_var_name);
if ($pseudo) {
$this->Application->RemoveVar($error_var_name);
}
$object =& $this->Application->recallObject($this->Prefix.'.'.$this->Special.'-item', null, Array('skip_autoload' => true));
/* @var $object kDBItem */
$object->SetError($field, $pseudo);
return $object->GetErrorMsg($field, false);
}
/**
* Returns templates path for module, which is gathered from prefix module
*
* @param Array $params
* @return string
* @author Alex
*/
function ModulePath($params)
{
$force_module = getArrayValue($params, 'module');
if ($force_module) {
if ($force_module == '#session#') {
$force_module = preg_replace('/([^:]*):.*/', '\1', $this->Application->RecallVar('module'));
if (!$force_module) $force_module = 'core';
}
else {
$force_module = mb_strtolower($force_module);
}
if ($force_module == 'core') {
$module_folder = 'core';
}
else {
$module_folder = trim( $this->Application->findModule('Name', $force_module, 'Path'), '/');
}
}
else {
$module_folder = $this->Application->getUnitOption($this->Prefix, 'ModuleFolder');
}
return '../../'.$module_folder.'/admin_templates/';
}
/**
* Returns object used in tag processor
*
* @access public
* @return kDBBase
*/
function &getObject($params = Array())
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
if (isset($params['requery']) && $params['requery']) {
$this->Application->HandleEvent($q_event, $this->getPrefixSpecial().':LoadItem', $params);
}
return $object;
}
/**
* Checks if object propery value matches value passed
*
* @param Array $params
* @return bool
*/
function PropertyEquals($params)
{
$object =& $this->getObject($params);
$property_name = $this->SelectParam($params, 'name,var,property');
return $object->$property_name == $params['value'];
}
/**
* Group list records by header, saves internal order in group
*
* @param Array $records
* @param string $heading_field
*/
function groupRecords(&$records, $heading_field)
{
$sorted = Array();
$i = 0; $record_count = count($records);
while ($i < $record_count) {
$sorted[ $records[$i][$heading_field] ][] = $records[$i];
$i++;
}
$records = Array();
foreach ($sorted as $heading => $heading_records) {
$records = array_merge_recursive($records, $heading_records);
}
}
function DisplayOriginal($params)
{
return false;
}
function MultipleEditing($params)
{
$wid = $this->Application->GetTopmostWid($this->Prefix);
$session_name = rtrim($this->getPrefixSpecial().'_selected_ids_'.$wid, '_');
$selected_ids = explode(',', $this->Application->RecallVar($session_name));
$ret = '';
if ($selected_ids) {
$selected_ids = explode(',', $selected_ids);
$object =& $this->getObject( array_merge_recursive2($params, Array('skip_autoload' => true)) );
$params['name'] = $params['render_as'];
foreach ($selected_ids as $id) {
$object->Load($id);
$ret .= $this->Application->ParseBlock($params);
}
}
return $ret;
}
function ExportStatus($params)
{
$export_object =& $this->Application->recallObject('CatItemExportHelper');
$event = new kEvent($this->getPrefixSpecial().':OnDummy');
$action_method = 'perform'.ucfirst($this->Special);
$field_values = $export_object->$action_method($event);
// finish code is done from JS now
if ($field_values['start_from'] >= $field_values['total_records'])
{
if ($this->Special == 'import') {
$this->Application->StoreVar('PermCache_UpdateRequired', 1);
$this->Application->Redirect('categories/cache_updater', Array('m_opener' => 'r', 'pass' => 'm', 'continue' => 1, 'no_amp' => 1));
}
elseif ($this->Special == 'export') {
$finish_t = $this->Application->RecallVar('export_finish_t');
$this->Application->Redirect($finish_t, Array('pass' => 'all'));
$this->Application->RemoveVar('export_finish_t');
}
}
$export_options = $export_object->loadOptions($event);
return $export_options['start_from'] * 100 / $export_options['total_records'];
}
/**
* Returns path where exported category items should be saved
*
* @param Array $params
*/
function ExportPath($params)
{
$ret = EXPORT_PATH.'/';
if( getArrayValue($params, 'as_url') )
{
$ret = str_replace( FULL_PATH.'/', $this->Application->BaseURL(), $ret);
}
$export_options = unserialize($this->Application->RecallVar($this->getPrefixSpecial().'_options'));
$ret .= $export_options['ExportFilename'].'.'.($export_options['ExportFormat'] == 1 ? 'csv' : 'xml');
return $ret;
}
function FieldTotal($params)
{
$list =& $this->GetList($params);
return $list->GetFormattedTotal($this->SelectParam($params, 'field,name'), $params['function']);
}
function SetFCKDefaultLanguage()
{
$lang_id = $this->Application->GetDefaultLanguageId();
$sql="SELECT Locale FROM ".TABLE_PREFIX."Language WHERE LanguageId = ".$lang_id;
$lang_prefix = strtolower($this->Conn->GetOne($sql));
$lang_file=strtolower($this->Conn->GetOne($sql)).'.js';
if (file_exists(FULL_PATH.EDITOR_PATH.'/editor/lang/'.$lang_file))
{
return $lang_prefix;
}
$aLangPrefix = explode("-",$lang_prefix);
if (file_exists(FULL_PATH.EDITOR_PATH.'/editor/lang/'.$aLangPrefix[0].'.js'))
{
return $aLangPrefix[0];
}
return 'en';
}
function FCKEditor($params)
{
$params['no_special'] = 1;
$value = $this->Field($params);
$name = array_key_exists('name', $params) ? $params['name'] : $this->InputName($params);
$theme_path = substr($this->Application->GetFrontThemePath(), 1) . '/inc/';
if (!file_exists(FULL_PATH . '/' . $theme_path . 'style.css')) {
$theme_path = EDITOR_PATH;
}
$styles_xml = $this->Application->BaseURL() . $theme_path . 'styles.xml';
$styles_css = $this->Application->BaseURL() . $theme_path . 'style.css';
$bgcolor = array_key_exists('bgcolor', $params) ? $params['bgcolor'] : $this->Application->GetVar('bgcolor');
if (!$bgcolor) {
$bgcolor = '#ffffff';
}
$url = '';
$st_id = $this->Application->GetVar('st_id');
if ($st_id) {
$sql = 'SELECT NamedParentPath
FROM ' . $this->Application->getUnitOption('st', 'TableName') . '
WHERE ' . $this->Application->getUnitOption('st', 'IDField') . ' = ' . $st_id;
$tpl = $this->Conn->GetOne($sql);
$url_params = Array ('pass' => 'm', 'm_cat_id' => $st_id, 'index_file' => 'index.php');
$url = $this->Application->HREF($tpl, '_FRONT_END_', $url_params);
}
include_once(FULL_PATH . EDITOR_PATH . 'fckeditor.php');
$oFCKeditor = new FCKeditor($name);
$oFCKeditor->FullUrl = $this->Application->BaseURL();
$oFCKeditor->BaseUrl = BASE_PATH . '/';
$oFCKeditor->BasePath = BASE_PATH . EDITOR_PATH;
$oFCKeditor->Width = $params['width'] ;
$oFCKeditor->Height = $params['height'] ;
$oFCKeditor->ToolbarSet = $st_id ? 'Advanced' : 'Default';
$oFCKeditor->Value = $value;
$oFCKeditor->PreviewUrl = $url;
$oFCKeditor->DefaultLanguage = $this->SetFCKDefaultLanguage();
$oFCKeditor->LateLoad = array_key_exists('late_load', $params) && $params['late_load'];
$oFCKeditor->Config = Array (
//'UserFilesPath' => $pathtoroot.'kernel/user_files',
'ProjectPath' => BASE_PATH . '/',
'CustomConfigurationsPath' => $this->Application->BaseURL() . 'core/admin_templates/js/inp_fckconfig.js',
'StylesXmlPath' => $styles_xml,
'EditorAreaCSS' => $styles_css,
'DefaultStyleLabel' => $this->Application->Phrase('la_editor_default_style'),
// 'Debug' => 1,
'Admin' => 1,
'K4' => 1,
'newBgColor' => $bgcolor,
'PreviewUrl' => $url,
'BaseUrl' => BASE_PATH . '/',
'DefaultLanguage' => $this->SetFCKDefaultLanguage(),
'EditorAreaStyles' => 'body { background-color: '.$bgcolor.' }',
);
return $oFCKeditor->CreateHtml();
}
function IsNewItem($params)
{
$object =& $this->getObject($params);
return $object->IsNewItem();
}
/**
* Creates link to an item including only it's id
*
* @param Array $params
* @return string
*/
function ItemLink($params)
{
$object =& $this->getObject($params);
if (!isset($params['pass'])) {
$params['pass'] = 'm';
}
$params[$object->getPrefixSpecial().'_id'] = $object->GetID();
$m =& $this->Application->recallObject('m_TagProcessor');
return $m->t($params);
}
/**
* Calls OnNew event from template, when no other event submitted
*
* @param Array $params
*/
function PresetFormFields($params)
{
$prefix = $this->getPrefixSpecial();
if (!$this->Application->GetVar($prefix.'_event')) {
$this->Application->HandleEvent(new kEvent($prefix.':OnNew'));
}
}
function PrintSerializedFields($params)
{
$object =& $this->getObject();
$field = $this->SelectParam($params, 'field');
$data = unserialize($object->GetDBField($field));
$o = '';
$std_params['name'] = $params['render_as'];
$std_params['field'] = $params['field'];
$std_params['pass_params'] = true;
foreach ($data as $key => $row) {
$block_params = array_merge($std_params, $row, array('key'=>$key));
$o .= $this->Application->ParseBlock($block_params);
}
return $o;
}
/**
* Checks if current prefix is main item
*
* @param Array $params
* @return bool
*/
function IsTopmostPrefix($params)
{
return $this->Prefix == $this->Application->GetTopmostPrefix($this->Prefix);
}
function PermSection($params)
{
$section = $this->SelectParam($params, 'section,name');
$perm_sections = $this->Application->getUnitOption($this->Prefix, 'PermSection');
return isset($perm_sections[$section]) ? $perm_sections[$section] : '';
}
function PerPageSelected($params)
{
$list =& $this->GetList($params);
return $list->PerPage == $params['per_page'] ? $params['selected'] : '';
}
/**
* Returns prefix + generated sepcial + any word
*
* @param Array $params
* @return string
*/
function VarName($params)
{
$list =& $this->GetList($params);
return $list->getPrefixSpecial().'_'.$params['type'];
}
/**
* Returns edit tabs by specified preset name or false in case of error
*
* @param string $preset_name
* @return mixed
*/
function getEditTabs($preset_name)
{
$presets = $this->Application->getUnitOption($this->Prefix, 'EditTabPresets');
if (!$presets || !isset($presets[$preset_name]) || count($presets[$preset_name]) == 0) {
return false;
}
- return $presets[$preset_name];
+ return count($presets[$preset_name]) > 1 ? $presets[$preset_name] : false;
}
/**
* Detects if specified preset has tabs in it
*
* @param Array $params
* @return bool
*/
function HasEditTabs($params)
{
return $this->getEditTabs($params['preset_name']) ? true : false;
}
/**
* Sorts edit tabs based on their priority
*
* @param Array $tab_a
* @param Array $tab_b
* @return int
*/
function sortEditTabs($tab_a, $tab_b)
{
if ($tab_a['priority'] == $tab_b['priority']) {
return 0;
}
return $tab_a['priority'] < $tab_b['priority'] ? -1 : 1;
}
/**
* Prints edit tabs based on preset name specified
*
* @param Array $params
* @return string
*/
function PrintEditTabs($params)
{
$edit_tabs = $this->getEditTabs($params['preset_name']);
if (!$edit_tabs) {
return ;
}
usort($edit_tabs, Array (&$this, 'sortEditTabs'));
$ret = '';
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
foreach ($edit_tabs as $tab_info) {
$block_params['title'] = $tab_info['title'];
$block_params['template'] = $tab_info['t'];
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
/**
* Performs image resize to required dimensions and returns resulting url (cached resized image)
*
* @param Array $params
* @return string
*/
function ImageSrc($params)
{
$max_width = isset($params['MaxWidth']) ? $params['MaxWidth'] : false;
$max_height = isset($params['MaxHeight']) ? $params['MaxHeight'] : false;
$logo_filename = isset($params['LogoFilename']) ? $params['LogoFilename'] : false;
$logo_h_margin = isset($params['LogoHMargin']) ? $params['LogoHMargin'] : false;
$logo_v_margin = isset($params['LogoVMargin']) ? $params['LogoVMargin'] : false;
$object =& $this->getObject($params);
$field = $this->SelectParam($params, 'name,field');
return $object->GetField($field, 'resize:'.$max_width.'x'.$max_height.';wm:'.$logo_filename.'|'.$logo_h_margin.'|'.$logo_v_margin);
}
/**
* Allows to retrieve given setting from unit config
*
* @param Array $params
* @return mixed
*/
function UnitOption($params)
{
return $this->Application->getUnitOption($this->Prefix, $params['name']);
}
/**
* Returns list of allowed toolbar buttons or false, when all is allowed
*
* @param Array $params
* @return string
*/
function VisibleToolbarButtons($params)
{
$preset_name = $params['title_preset'];
$title_presets = $this->Application->getUnitOption($this->Prefix, 'TitlePresets');
if (!array_key_exists($preset_name, $title_presets)) {
trigger_error('Title preset not specified or missing (in tag "<strong>' . $this->getPrefixSpecial() . ':' . __METHOD__ . '</strong>")', E_USER_WARNING);
return false;
}
$preset_info = $title_presets[$preset_name];
if (!array_key_exists('toolbar_buttons', $preset_info) || !is_array($preset_info['toolbar_buttons'])) {
return false;
}
// always add search buttons
array_push($preset_info['toolbar_buttons'], 'search', 'search_reset_alt');
$toolbar_buttons = array_map('addslashes', $preset_info['toolbar_buttons']);
return $toolbar_buttons ? "'" . implode("', '", $toolbar_buttons) . "'" : 'false';
}
/**
* Checks, that "To" part of at least one of range filters is used
*
* @param Array $params
* @return bool
*/
function RangeFiltersUsed($params)
{
$search_helper =& $this->Application->recallObject('SearchHelper');
/* @var $search_helper kSearchHelper */
return $search_helper->rangeFiltersUsed($this->getPrefixSpecial(), $params['grid']);
}
+
+ /**
+ * This is abstract tag, used to modify unit config data based on template, where it's used.
+ * Tag is called from "combined_header" block in admin only.
+ *
+ * @param Array $params
+ */
+ function ModifyUnitConfig($params)
+ {
+
+ }
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/kernel/db/db_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.97.2.44
\ No newline at end of property
+1.97.2.45
\ No newline at end of property
Index: branches/RC/core/kernel/application.php
===================================================================
--- branches/RC/core/kernel/application.php (revision 11537)
+++ branches/RC/core/kernel/application.php (revision 11538)
@@ -1,2803 +1,2821 @@
<?php
/**
* Basic class for Kernel3-based Application
*
* This class is a Facade for any other class which needs to deal with Kernel3 framework.<br>
* The class incapsulates the main run-cycle of the script, provide access to all other objects in the framework.<br>
* <br>
* The class is a singleton, which means that there could be only one instance of KernelApplication in the script.<br>
* This could be guranteed by NOT calling the class constuctor directly, but rather calling KernelApplication::Instance() method,
* which returns an instance of the application. The method gurantees that it will return exactly the same instance for any call.<br>
* See singleton pattern by GOF.
* @package kernel4
*/
class kApplication {
/**
* Is true, when Init method was called already, prevents double initialization
*
* @var bool
*/
var $InitDone = false;
/**
- * Holds internal TemplateParser object
+ * Holds internal NParser object
* @access private
- * @var TemplateParser
+ * @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;
}
- function ParseBlock($params,$pass_params=0,$as_template=false)
+ /**
+ * 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);
}
/**
* 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.31
\ No newline at end of property
+1.186.2.32
\ No newline at end of property
Index: branches/RC/core/kernel/globals.php
===================================================================
--- branches/RC/core/kernel/globals.php (revision 11537)
+++ branches/RC/core/kernel/globals.php (revision 11538)
@@ -1,649 +1,650 @@
<?php
if( !function_exists('array_merge_recursive2') )
{
/**
* array_merge_recursive2()
*
* Similar to array_merge_recursive but keyed-valued are always overwritten.
* Priority goes to the 2nd array.
*
* @static yes
* @param $paArray1 array
* @param $paArray2 array
* @return array
* @access public
*/
function array_merge_recursive2($paArray1, $paArray2)
{
if (!is_array($paArray1) or !is_array($paArray2)) { return $paArray2; }
foreach ($paArray2 AS $sKey2 => $sValue2)
{
$paArray1[$sKey2] = isset($paArray1[$sKey2]) ? array_merge_recursive2($paArray1[$sKey2], $sValue2) : $sValue2;
// $paArray1[$sKey2] = array_merge_recursive2( getArrayValue($paArray1,$sKey2), $sValue2);
}
return $paArray1;
}
}
/**
* @return int
* @param $array array
* @param $value mixed
* @desc Prepend a reference to an element to the beginning of an array. Renumbers numeric keys, so $value is always inserted to $array[0]
*/
function array_unshift_ref(&$array, &$value)
{
$return = array_unshift($array,'');
$array[0] =& $value;
return $return;
}
/**
* Same as print_r, budet designed for viewing in web page
*
* @param Array $data
* @param string $label
*/
function print_pre($data, $label='', $on_screen = false)
{
$is_debug = false;
if (class_exists('kApplication') && !$on_screen) {
$application =& kApplication::Instance();
$is_debug = $application->isDebugMode();
}
if ($is_debug) {
if ($label) $application->Debugger->appendHTML('<b>'.$label.'</b>');
$application->Debugger->dumpVars($data);
}
else
{
if ($label) echo '<b>', $label, '</b><br>';
echo '<pre>', print_r($data, true), '</pre>';
}
}
/**
* Returns array value if key exists
*
* @param Array $array searchable array
* @param int $key array key
* @return string
* @access public
*/
//
function getArrayValue(&$array, $key)
{
// global $debugger;
// if (is_object($debugger)) $debugger->ProfilePoint('getArrayValue', 1);
$ret = isset($array[$key]) ? $array[$key] : false;
if ($ret && func_num_args() > 2) {
for ($i = 2; $i < func_num_args(); $i++) {
$cur_key = func_get_arg($i);
$ret = getArrayValue( $ret, $cur_key );
if ($ret === false) break;
}
}
return $ret;
}
/**
* Rename key in associative array, maintaining keys order
*
* @param Array $array Associative Array
* @param mixed $old Old key name
* @param mixed $new New key name
* @access public
*/
function array_rename_key(&$array, $old, $new)
{
- foreach ($array as $key => $val)
- {
+ $new_array = Array ();
+ foreach ($array as $key => $val) {
$new_array[ $key == $old ? $new : $key] = $val;
}
+
$array = $new_array;
}
/**
* Define constant if it was not already defined before
*
* @param string $const_name
* @param string $const_value
* @access public
*/
function safeDefine($const_name, $const_value)
{
if(!defined($const_name)) define($const_name,$const_value);
}
if( !function_exists('parse_portal_ini') )
{
function parse_portal_ini($file, $parse_section = false)
{
if (!file_exists($file)) return false;
if( file_exists($file) && !is_readable($file) ) die('Could Not Open Ini File');
$contents = file($file);
$retval = Array();
$section = '';
$ln = 1;
$resave = false;
foreach($contents as $line) {
if ($ln == 1 && $line != '<'.'?'.'php die() ?'.">\n") {
$resave = true;
}
$ln++;
$line = trim($line);
$line = eregi_replace(';[.]*','',$line);
if(strlen($line) > 0) {
//echo $line . " - ";
if(eregi('^[[a-z]+]$',str_replace(' ', '', $line))) {
//echo 'section';
$section = mb_substr($line,1,(mb_strlen($line)-2));
if ($parse_section) {
$retval[$section] = array();
}
continue;
} elseif(eregi('=',$line)) {
//echo 'main element';
list($key,$val) = explode(' = ',$line);
if (!$parse_section) {
$retval[trim($key)] = str_replace('"', '', $val);
}
else {
$retval[$section][trim($key)] = str_replace('"', '', $val);
}
} //end if
//echo '<br />';
} //end if
} //end foreach
if($resave)
{
$fp = fopen($file, 'w');
reset($contents);
fwrite($fp,'<'.'?'.'php die() ?'.">\n\n");
foreach($contents as $line) fwrite($fp,"$line");
fclose($fp);
}
return $retval;
}
}
if( !function_exists('getmicrotime') )
{
function getmicrotime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
}
if( !function_exists('k4_include_once') )
{
function k4_include_once($file)
{
global $debugger;
if ( defined('DEBUG_MODE') && DEBUG_MODE && isset($debugger) && constOn('DBG_PROFILE_INCLUDES') )
{
if ( in_array($file, get_required_files()) ) return;
global $debugger;
/* $debugger->IncludeLevel++;
$before_mem = memory_get_usage();
*/
$debugger->ProfileStart('inc_'.crc32($file), $file);
include_once($file);
$debugger->ProfileFinish('inc_'.crc32($file));
$debugger->profilerAddTotal('includes', 'inc_'.crc32($file));
/* $used_mem = memory_get_usage() - $before_mem;
$debugger->IncludeLevel--;
$debugger->IncludesData['file'][] = str_replace(FULL_PATH, '', $file);
$debugger->IncludesData['mem'][] = $used_mem;
$debugger->IncludesData['time'][] = $used_time;
$debugger->IncludesData['level'][] = $debugger->IncludeLevel;
*/
}
else
{
include_once($file);
}
}
}
/**
* Checks if string passed is serialized array
*
* @param string $string
* @return bool
*/
function IsSerialized($string)
{
if( is_array($string) ) return false;
return preg_match('/a:([\d]+):{/', $string);
}
if (!function_exists('makepassword4')){
function makepassword4($length=10)
{
$pass_length=$length;
$p1=array('b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z');
$p2=array('a','e','i','o','u');
$p3=array('1','2','3','4','5','6','7','8','9');
$p4=array('(','&',')',';','%'); // if you need real strong stuff
// how much elements in the array
// can be done with a array count but counting once here is faster
$s1=21;// this is the count of $p1
$s2=5; // this is the count of $p2
$s3=9; // this is the count of $p3
$s4=5; // this is the count of $p4
// possible readable combinations
$c1='121'; // will be like 'bab'
$c2='212'; // will be like 'aba'
$c3='12'; // will be like 'ab'
$c4='3'; // will be just a number '1 to 9' if you dont like number delete the 3
// $c5='4'; // uncomment to active the strong stuff
$comb='4'; // the amount of combinations you made above (and did not comment out)
for ($p=0;$p<$pass_length;)
{
mt_srand((double)microtime()*1000000);
$strpart=mt_rand(1,$comb);
// checking if the stringpart is not the same as the previous one
if($strpart<>$previous)
{
$pass_structure.=${'c'.$strpart};
// shortcutting the loop a bit
$p=$p+mb_strlen(${'c'.$strpart});
}
$previous=$strpart;
}
// generating the password from the structure defined in $pass_structure
for ($g=0;$g<mb_strlen($pass_structure);$g++)
{
mt_srand((double)microtime()*1000000);
$sel=mb_substr($pass_structure,$g,1);
$pass.=${'p'.$sel}[mt_rand(0,-1+${'s'.$sel})];
}
return $pass;
}
}
if( !function_exists('unhtmlentities') )
{
function unhtmlentities($string)
{
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
return strtr($string, $trans_tbl);
}
}
if( !function_exists('curl_post') )
{
/**
* submits $url with $post as POST
*
* @param string $url
* @param unknown_type $post
* @return unknown
*/
function curl_post($url, $post, $headers=null, $request_type = 'POST', $curl_options=null)
{
if( is_array($post) )
{
$params_str = '';
foreach($post as $key => $value) $params_str .= $key.'='.urlencode($value).'&';
$post = $params_str;
}
$ch = curl_init($url);
$dbg = false;
if (defined('DEBUG_MODE') && DEBUG_MODE && constOn('DBG_CURL')) {
$dbg = true;
safeDefine('DBG_CURL_LOGFILE', '/curl.log');
$log = fopen(FULL_PATH.DBG_CURL_LOGFILE, 'a');
curl_setopt($ch, CURLOPT_FILE, $log);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_STDERR, $log);
//curl_setopt($ch, CURLOPT_WRITEHEADER, $log);
}
if (!is_null($headers)) {
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
}
// if we have post data, then POST else use GET method instead
if ($request_type == 'POST') {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
elseif ($request_type == 'GET' && isset($post) && strlen($post) > 0) {
curl_setopt($ch, CURLOPT_URL, preg_match('/\?/', $url) ? $url.'&'.$post : $url.'?'.$post);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_REFERER, PROTOCOL.SERVER_NAME);
curl_setopt($ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
if (is_array($curl_options)) {
foreach ($curl_options as $option => $value) {
curl_setopt($ch, $option, $value);
}
}
$ret = curl_exec($ch);
$GLOBALS['curl_errorno'] = curl_errno($ch);
$GLOBALS['curl_error'] = curl_error($ch);
curl_close($ch);
if ($dbg) {
fwrite($log, "\n".$ret);
fclose($log);
}
return $ret;
}
}
if( !function_exists('memory_get_usage') )
{
function memory_get_usage(){ return -1; }
}
function &ref_call_user_func_array($callable, $args)
{
if( is_scalar($callable) )
{
// $callable is the name of a function
$call = $callable;
}
else
{
if( is_object($callable[0]) )
{
// $callable is an object and a method name
$call = "\$callable[0]->{$callable[1]}";
}
else
{
// $callable is a class name and a static method
$call = "{$callable[0]}::{$callable[1]}";
}
}
// Note because the keys in $args might be strings
// we do this in a slightly round about way.
$argumentString = Array();
$argumentKeys = array_keys($args);
foreach($argumentKeys as $argK)
{
$argumentString[] = "\$args[$argumentKeys[$argK]]";
}
$argumentString = implode($argumentString, ', ');
// Note also that eval doesn't return references, so we
// work around it in this way...
eval("\$result =& {$call}({$argumentString});");
return $result;
}
/**
* Checks if constant is defined and has positive value
*
* @param string $const_name
* @return bool
*/
function constOn($const_name)
{
return defined($const_name) && constant($const_name);
}
function Kg2Pounds($kg, $pounds_only = false)
{
$major = floor( round($kg / POUND_TO_KG, 3) );
$minor = abs(round(($kg - $major * POUND_TO_KG) / POUND_TO_KG * 16, 2));
if ($pounds_only) {
$major += round($minor * 0.0625, 2);
$minor = 0;
}
return array($major, $minor);
}
function Pounds2Kg($pounds, $ounces=0)
{
return round(($pounds + ($ounces / 16)) * POUND_TO_KG, 5);
}
/**
* Formats file/memory size in nice way
*
* @param int $bytes
* @return string
* @access public
*/
function formatSize($bytes)
{
if ($bytes >= 1099511627776) {
$return = round($bytes / 1024 / 1024 / 1024 / 1024, 2);
$suffix = "TB";
} elseif ($bytes >= 1073741824) {
$return = round($bytes / 1024 / 1024 / 1024, 2);
$suffix = "GB";
} elseif ($bytes >= 1048576) {
$return = round($bytes / 1024 / 1024, 2);
$suffix = "MB";
} elseif ($bytes >= 1024) {
$return = round($bytes / 1024, 2);
$suffix = "KB";
} else {
$return = $bytes;
$suffix = "Byte";
}
$return .= ' '.$suffix;
return $return;
}
/**
* Enter description here...
*
* @param resource $filePointer the file resource to write to
* @param Array $data the data to write out
* @param string $delimiter the field separator
* @param string $enclosure symbol to enclose field data to
* @param string $recordSeparator symbols to separate records with
*/
function fputcsv2($filePointer, $data, $delimiter = ',', $enclosure = '"', $recordSeparator = "\r\n")
{
foreach($data as $field_index => $field_value) {
// replaces an enclosure with two enclosures
$data[$field_index] = str_replace($enclosure, $enclosure.$enclosure, $field_value);
}
$line = $enclosure.implode($enclosure.$delimiter.$enclosure, $data).$enclosure.$recordSeparator;
$line = preg_replace('/'.preg_quote($enclosure).'([0-9\.]+)'.preg_quote($enclosure).'/', '$1', $line);
fwrite($filePointer, $line);
}
/**
* Enter description here...
*
* @param resource $filePointer the file resource to write to
* @param Array $data the data to write out
* @param string $delimiter the field separator
* @param string $enclosure symbol to enclose field data to
* @param string $recordSeparator symbols to separate records with
*/
function getcsvline($data, $delimiter = ',', $enclosure = '"', $recordSeparator = "\r\n")
{
foreach($data as $field_index => $field_value) {
// replaces an enclosure with two enclosures
$data[$field_index] = str_replace($enclosure, $enclosure.$enclosure, $field_value);
}
$line = $enclosure.implode($enclosure.$delimiter.$enclosure, $data).$enclosure.$recordSeparator;
$line = preg_replace('/'.preg_quote($enclosure).'([0-9\.]+)'.preg_quote($enclosure).'/', '$1', $line);
return $line;
}
/**
* Allows to replace #section# within any string with current section
*
* @param string $string
* @return string
*/
function replaceModuleSection($string)
{
$application =& kApplication::Instance();
$module_section = $application->RecallVar('section');
if ($module_section) {
// substitute section instead of #section# parameter in title preset name
$module_section = explode(':', $module_section);
$section = preg_replace('/(configuration|configure)_(.*)/i', '\\2', $module_section[count($module_section) == 2 ? 1 : 0]);
$string = str_replace('#section#', mb_strtolower($section), $string);
}
return $string;
}
/**
* Checks, that user IP address is within allowed range
*
* @param string $ip_list semi-column (by default) separated ip address list
* @param string $separator ip address separator (default ";")
*
* @return bool
*/
function ipMatch($ip_list, $separator = ';')
{
$ip_match = false;
$ip_addresses = $ip_list ? explode($separator, $ip_list) : Array ();
foreach ($ip_addresses as $ip_address) {
if (netMatch($ip_address, $_SERVER['REMOTE_ADDR'])) {
$ip_match = true;
break;
}
}
return $ip_match;
}
function netMatch($network, $ip) {
$network = trim($network);
$ip = trim($ip);
if ($network == $ip) {
// comparing 2 ip addresses directly
return true;
}
$d = strpos($network, '-');
if ($d === false) {
// sigle subnet specified
$ip_arr = explode('/', $network);
if (!preg_match("@\d*\.\d*\.\d*\.\d*@", $ip_arr[0], $matches)) {
$ip_arr[0] .= '.0'; // Alternate form 194.1.4/24
}
$network_long = ip2long($ip_arr[0]);
$x = ip2long($ip_arr[1]);
$mask = long2ip($x) == $ip_arr[1] ? $x : (0xffffffff << (32 - $ip_arr[1]));
$ip_long = ip2long($ip);
return ($ip_long & $mask) == ($network_long & $mask);
}
else {
// ip address range specified
$from = ip2long(trim(substr($network, 0, $d)));
$to = ip2long(trim(substr($network, $d + 1)));
$ip = ip2long($ip);
return ($ip >= $from && $ip <= $to);
}
}
function request_headers()
{
if(function_exists("apache_request_headers")) // If apache_request_headers() exists...
{
if($headers = apache_request_headers()) // And works...
{
return $headers; // Use it
}
}
$headers = array();
foreach(array_keys($_SERVER) as $skey)
{
if(substr($skey, 0, 5) == "HTTP_")
{
$headername = str_replace(" ", "-", ucwords(strtolower(str_replace("_", " ", substr($skey, 0, 5)))));
$headers[$headername] = $_SERVER[$skey];
}
}
return $headers;
}
/**
* Checks that file is writable by group or others
*
* @param string $file
* @return boolean
*/
function check_write_permissions($file)
{
$permissions = fileperms($file);
return $permissions & 0x0010 || $permissions & 0x0002;
}
if (!function_exists('easter_date')) {
// calculates easter date, when calendar extension not installed in php
// see also: http://php.prod.intechnic.lv/manual/en/function.easter-date.php
function easter_date ($Year) {
/*
G is the Golden Number-1
H is 23-Epact (modulo 30)
I is the number of days from 21 March to the Paschal full moon
J is the weekday for the Paschal full moon (0=Sunday,
1=Monday, etc.)
L is the number of days from 21 March to the Sunday on or before
the Paschal full moon (a number between -6 and 28)
*/
$G = $Year % 19;
$C = (int)($Year / 100);
$H = (int)($C - ($C / 4) - ((8*$C+13) / 25) + 19*$G + 15) % 30;
$I = (int)$H - (int)($H / 28)*(1 - (int)($H / 28)*(int)(29 / ($H + 1))*((int)(21 - $G) / 11));
$J = ($Year + (int)($Year/4) + $I + 2 - $C + (int)($C/4)) % 7;
$L = $I - $J;
$m = 3 + (int)(($L + 40) / 44);
$d = $L + 28 - 31 * ((int)($m / 4));
$y = $Year;
$E = mktime(0,0,0, $m, $d, $y);
return $E;
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/kernel/globals.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.37.2.5
\ No newline at end of property
+1.37.2.6
\ No newline at end of property
Index: branches/RC/core/units/visits/visits_config.php
===================================================================
--- branches/RC/core/units/visits/visits_config.php (revision 11537)
+++ branches/RC/core/units/visits/visits_config.php (revision 11538)
@@ -1,143 +1,142 @@
<?php
$config = Array(
'Prefix' => 'visits',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'VisitsList','file'=>'visits_list.php','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'VisitsEventHandler','file'=>'visits_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'VisitsTagProcessor','file'=>'visits_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array(
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'Hooks' => Array(
Array(
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => 'adm',
'HookToSpecial' => '',
'HookToEvent' => Array( 'OnStartup' ),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnRegisterVisit',
),
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'u',
'HookToSpecial' => '*',
'HookToEvent' => Array( 'OnLogin' ),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnUserLogin',
),
),
'IDField' => 'VisitId',
'TableName' => TABLE_PREFIX.'Visits',
'PermSection' => Array('main' => 'in-portal:visits'),
'TitlePresets' => Array(
- 'default' => Array(),
- 'visits_list' => Array('prefixes' => Array('visits_List'), 'format' => "!la_title_Visits! (#visits_recordcount#)"),
- 'visits.incommerce_list' => Array('prefixes' => Array('visits.incommerce_List'), 'format' => "!la_title_Visits! (#visits.incommerce_recordcount#)"),
+ 'visits_list' => Array('prefixes' => Array('visits_List'), 'format' => "!la_title_Visits!"),
+ 'visits.incommerce_list' => Array('prefixes' => Array('visits.incommerce_List'), 'format' => "!la_title_Visits!"),
),
'CalculatedFields' => Array(
'' => Array (
'UserName' => 'IF( ISNULL(u.Login), IF (%1$s.PortalUserId = -1, \'root\', IF (%1$s.PortalUserId = -2, \'Guest\', \'n/a\')), u.Login)',
),
'incommerce' => Array (
'UserName' => 'IF( ISNULL(u.Login), IF (%1$s.PortalUserId = -1, \'root\', IF (%1$s.PortalUserId = -2, \'Guest\', \'n/a\')), u.Login)',
'AffiliateUser' => 'IF( LENGTH(au.Login),au.Login,\'!la_None!\')',
'AffiliatePortalUserId' => 'af.PortalUserId',
'OrderTotalAmount' => 'IF(ord.Status = 4, ord.SubTotal+ord.ShippingCost+ord.VAT, 0)',
'OrderAffiliateCommission' => 'IF(ord.Status = 4, ord.AffiliateCommission, 0)',
'OrderNumber' => 'CONCAT(LPAD(Number,6,"0"),\'-\',LPAD(SubNumber,3,"0") )',
'OrderId' => 'ord.OrderId',
),
),
'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.PortalUserId = u.PortalUserId',
'incommerce'=>'
SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.PortalUserId = u.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'Affiliates af ON %1$s.AffiliateId = af.AffiliateId
LEFT JOIN '.TABLE_PREFIX.'PortalUser au ON af.PortalUserId = au.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'Orders ord ON %1$s.VisitId = ord.VisitId',
),
'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.PortalUserId = u.PortalUserId',
'incommerce'=>' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.PortalUserId = u.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'Affiliates af ON %1$s.AffiliateId = af.AffiliateId
LEFT JOIN '.TABLE_PREFIX.'PortalUser au ON af.PortalUserId = au.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'Orders ord ON %1$s.VisitId = ord.VisitId',
),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('VisitDate' => 'desc'),
)
),
'Fields' => Array(
'VisitId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'VisitDate' => Array('type' => 'int', 'formatter'=>'kDateFormatter', 'custom_filter' => 'date_range', 'not_null' => 1, 'default' => 0),
'Referer' => Array('type' => 'string','not_null' => '1','default' => ''),
'IPAddress' => Array('type' => 'string','not_null' => '1','default' => ''),
'AffiliateId' => Array('type'=>'int','formatter'=>'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(0 => 'lu_None'), 'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'Affiliates af LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = af.PortalUserId WHERE `%s` = \'%s\'','left_key_field'=>'AffiliateId','left_title_field'=>'Login','not_null'=>1,'default'=>0),
'PortalUserId' => Array('type' => 'int','not_null' => '1','default' => -2),
),
'VirtualFields' => Array(
'UserName' => Array('type'=>'string'),
'AffiliateUser' => Array('type'=>'string'),
'AffiliatePortalUserId' => Array('type'=>'int'),
'OrderTotalAmount' => Array('type' => 'float', 'formatter'=>'kFormatter', 'format'=>'%01.2f', 'not_null' => '1','default' => '0.00', 'totals' => 'SUM'),
'OrderTotalAmountSum' => Array('type' => 'float', 'formatter'=>'kFormatter', 'format'=>'%01.2f', 'not_null' => '1','default' => '0.00'),
'OrderAffiliateCommission' => Array('type' => 'double', 'formatter'=>'kFormatter','format'=>'%.02f', 'not_null' => '1','default' => '0.0000', 'totals' => 'SUM'),
'OrderAffiliateCommissionSum' => Array('type' => 'double', 'formatter'=>'kFormatter','format'=>'%.02f', 'not_null' => '1','default' => '0.0000'),
'OrderId' => Array('type' => 'int', 'default' => '0'),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_custom.gif'), // icons for each StatusField values, if no matches or no statusfield selected, then "default" icon is used
'Fields' => Array(
'VisitDate' => Array( 'title'=>'la_col_VisitDate', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_date_range_filter'),
'IPAddress' => Array( 'title'=>'la_col_IPAddress', 'filter_block' => 'grid_like_filter' ),
'Referer' => Array( 'title'=>'la_col_Referer', 'data_block' => 'grid_referer_td', 'filter_block' => 'grid_like_filter' ),
'UserName' => Array('title' => 'la_col_Username', 'data_block' => 'grid_userlink_td', 'user_field' => 'PortalUserId', 'filter_block' => 'grid_like_filter'),
),
),
'visitsincommerce' => Array(
'Icons' => Array('default'=>'icon16_custom.gif'), // icons for each StatusField values, if no matches or no statusfield selected, then "default" icon is used
'Fields' => Array(
'VisitDate' => Array( 'title'=>'la_col_VisitDate', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_date_range_filter' ),
'IPAddress' => Array( 'title'=>'la_col_IPAddress', 'filter_block' => 'grid_like_filter' ),
'Referer' => Array( 'title'=>'la_col_Referer', 'data_block' => 'grid_referer_td', 'filter_block' => 'grid_like_filter' ),
'UserName' => Array('title' => 'la_col_Username', 'data_block' => 'grid_userlink_td', 'user_field' => 'PortalUserId', 'filter_block' => 'grid_like_filter'),
'AffiliateUser' => Array( 'title' => 'la_col_AffiliateUser', 'data_block' => 'grid_userlink_td', 'user_field' => 'AffiliatePortalUserId', 'filter_block' => 'grid_like_filter'),
'OrderTotalAmountSum' => Array( 'title' => 'la_col_OrderTotal', 'filter_block' => 'grid_range_filter'),
'OrderAffiliateCommissionSum' => Array( 'title' => 'la_col_Commission', 'filter_block' => 'grid_range_filter'),
),
),
),
);
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/visits/visits_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.27.2.1
\ No newline at end of property
+1.27.2.2
\ No newline at end of property
Index: branches/RC/core/units/thesaurus/thesaurus_config.php
===================================================================
--- branches/RC/core/units/thesaurus/thesaurus_config.php (revision 11537)
+++ branches/RC/core/units/thesaurus/thesaurus_config.php (revision 11538)
@@ -1,85 +1,85 @@
<?php
$config = Array (
'Prefix' => 'thesaurus',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'ThesaurusEventHandler', 'file' => 'thesaurus_eh.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'ThesaurusTagProcessor', 'file' => 'thesaurus_tp.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array (
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'ThesaurusId',
'TableName' => TABLE_PREFIX.'Thesaurus',
'TitleField' => 'SearchTerm',
'TitlePresets' => Array (
'default' => Array (
'new_status_labels' => Array ('thesaurus' => '!la_title_AddingThesaurus!'),
'edit_status_labels' => Array ('thesaurus' => '!la_title_EditingThesaurus!'),
),
- 'thesaurus_list' => Array ('prefixes' => Array ('thesaurus_List'), 'format' => "!la_title_Thesaurus! (#thesaurus_recordcount#)"),
+ 'thesaurus_list' => Array ('prefixes' => Array ('thesaurus_List'), 'format' => "!la_title_Thesaurus!"),
'thesaurus_edit' => Array ('prefixes' => Array ('thesaurus'), 'format' => "#thesaurus_status# '#thesaurus_titlefield#'"),
),
'PermSection' => Array('main' => 'in-portal:thesaurus'),
'Sections' => Array (
'in-portal:thesaurus' => Array (
'parent' => 'in-portal:system',
'icon' => 'custom',
'label' => 'la_title_Thesaurus',
'url' => Array('t' => 'thesaurus/thesaurus_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 3.4,
'type' => stTREE,
),
),
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s FROM %1$s',
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('SearchTerm' => 'asc'),
)
),
'Fields' => Array (
'ThesaurusId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'SearchTerm' => Array ('type' => 'string', 'max_len' => 255, 'required' => 1, 'not_null' => 1, 'default' => ''),
'ThesaurusTerm' => Array ('type' => 'string', 'max_len' => 255, 'required' => 1, 'not_null' => 1, 'default' => ''),
'ThesaurusType' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (
0 => 'NT',
// 1 => 'RT',
// 2 => 'USE'
),
'not_null' => 1, 'required' => 1, 'default' => 0
),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array ('default' => 'icon16_custom.gif'),
'Fields' => Array (
'ThesaurusId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ),
'SearchTerm' => Array ('title' => 'la_col_SearchTerm', 'filter_block' => 'grid_like_filter',),
'ThesaurusTerm' => Array ('title' => 'la_col_ThesaurusTerm', 'filter_block' => 'grid_like_filter',),
// 'ThesaurusType' => Array ('title' => 'la_col_ThesaurusType', 'filter_block' => 'grid_options_filter',),
),
),
),
);
\ No newline at end of file
Property changes on: branches/RC/core/units/thesaurus/thesaurus_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/categories/categories_config.php
===================================================================
--- branches/RC/core/units/categories/categories_config.php (revision 11537)
+++ branches/RC/core/units/categories/categories_config.php (revision 11538)
@@ -1,408 +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',
'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 (
- 'ForcedSorting' => Array (/*"CurrentSort" => 'asc',*/ 'Priority' => 'desc'),
- 'Sorting' => Array ('Name' => 'asc'),
+ '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.14
\ No newline at end of property
+1.66.2.15
\ No newline at end of property
Index: branches/RC/core/units/categories/categories_tag_processor.php
===================================================================
--- branches/RC/core/units/categories/categories_tag_processor.php (revision 11537)
+++ branches/RC/core/units/categories/categories_tag_processor.php (revision 11538)
@@ -1,1901 +1,1952 @@
<?php
class CategoriesTagProcessor extends kDBTagProcessor {
/**
* Cached version of site menu
*
* @var Array
*/
var $Menu = null;
/**
* Parent path mapping used in CachedMenu tag
*
* @var Array
*/
var $ParentPaths = Array ();
function SubCatCount($params)
{
$object =& $this->getObject($params);
if (isset($params['today']) && $params['today']) {
$sql = 'SELECT COUNT(*)
FROM '.$object->TableName.'
WHERE (ParentPath LIKE "'.$object->GetDBField('ParentPath').'%") AND (CreatedOn > '.(adodb_mktime() - 86400).')';
return $this->Conn->GetOne($sql) - 1;
}
return $object->GetDBField('CachedDescendantCatsQty');
}
/**
* Returns category count in system
*
* @param Array $params
* @return int
*/
function CategoryCount($params)
{
$count_helper =& $this->Application->recallObject('CountHelper');
/* @var $count_helper kCountHelper */
$today_only = isset($params['today']) && $params['today'];
return $count_helper->CategoryCount($today_only);
}
function IsNew($params)
{
$object =& $this->getObject($params);
return $object->GetDBField('IsNew') ? 1 : 0;
}
function IsPick($params)
{
return $this->IsEditorsPick($params);
}
/**
* Returns item's editors pick status (using not formatted value)
*
* @param Array $params
* @return bool
*/
function IsEditorsPick($params)
{
$object =& $this->getObject($params);
return $object->GetDBField('EditorsPick') == 1;
}
function ItemIcon($params)
{
// only for categories, not structure
if ($this->Prefix != 'c') {
return parent::ItemIcon($params);
}
$object =& $this->getObject($params);
if ($object->GetDBField('IsMenu')) {
$status = $object->GetDBField('Status');
if ($status == 1) {
$ret = $object->GetDBField('IsNew') ? 'icon16_cat_new.gif' : 'icon16_folder.gif';
}
else {
$ret = $status ? 'icon16_cat_pending.gif' : 'icon16_cat_disabled.gif';
}
}
else {
$ret = 'icon16_folder-red.gif';
}
return $ret;
}
function ItemCount($params)
{
$object =& $this->getObject($params);
$ci_table = $this->Application->getUnitOption('l-ci', 'TableName');
$sql = 'SELECT COUNT(*)
FROM ' . $object->TableName . ' c
LEFT JOIN ' . $ci_table . ' ci ON c.CategoryId = ci.CategoryId
WHERE (c.TreeLeft BETWEEN ' . $object->GetDBField('TreeLeft') . ' AND ' . $object->GetDBField('TreeRight') . ') AND NOT (ci.CategoryId IS NULL)';
return $this->Conn->GetOne($sql);
}
function ListCategories($params)
{
return $this->PrintList2($params);
}
function RootCategoryName($params)
{
return $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params);
}
function CheckModuleRoot($params)
{
$module_name = getArrayValue($params, 'module') ? $params['module'] : 'In-Commerce';
$module_root_cat = $this->Application->findModule('Name', $module_name, 'RootCat');
$additional_cats = $this->SelectParam($params, 'add_cats');
if ($additional_cats) {
$additional_cats = explode(',', $additional_cats);
}
else {
$additional_cats = array();
}
if ($this->Application->GetVar('m_cat_id') == $module_root_cat || in_array($this->Application->GetVar('m_cat_id'), $additional_cats)) {
$home_template = getArrayValue($params, 'home_template');
if (!$home_template) return;
$this->Application->Redirect($home_template, Array('pass'=>'all'));
};
}
function CategoryPath($params)
{
$category_helper =& $this->Application->recallObject('CategoryHelper');
/* @var $category_helper CategoryHelper */
return $category_helper->NavigationBar($params);
}
/**
* Shows category path to specified category
*
* @param Array $params
* @return string
*/
function FieldCategoryPath($params)
{
$object =& $this->getObject();
/* @var $object kDBItem */
$field = $this->SelectParam($params, 'name,field');
$category_id = $object->GetDBField($field);
if ($category_id) {
$params['cat_id'] = $category_id;
return $this->CategoryPath($params);
}
return '';
}
function CurrentCategoryName($params)
{
$cat_object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix.'_List');
$sql = 'SELECT '.$this->getTitleField().'
FROM '.$cat_object->TableName.'
WHERE CategoryId = '.$this->Application->GetVar('m_cat_id');
return $this->Conn->GetOne($sql);
}
/**
* Returns current category name
*
* @param Array $params
* @return string
* @todo Find where it's used
*/
function CurrentCategory($params)
{
return $this->CurrentCategoryName($params);
}
function getTitleField()
{
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
return $ml_formatter->LangFieldName('Name');
}
function getCategorySymLink($category_id)
{
static $cache = null;
if (!isset($cache)) {
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($this->Prefix, 'TableName');
$sql = 'SELECT SymLinkCategoryId, '.$id_field.'
FROM '.$table_name.'
WHERE SymLinkCategoryId IS NOT NULL';
$cache = $this->Conn->GetCol($sql, $id_field);
}
if (isset($cache[$category_id])) {
//check if sym. link category is valid
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($this->Prefix, 'TableName');
$sql = 'SELECT '.$id_field.'
FROM '.$table_name.'
WHERE '.$id_field.' = '.$cache[$category_id];
$category_id = $this->Conn->GetOne($sql)? $cache[$category_id] : $category_id;
}
return $category_id;
}
function CategoryLink($params)
{
$category_id = getArrayValue($params, 'cat_id');
if ($category_id === false) {
$category_id = $this->Application->GetVar($this->getPrefixSpecial().'_id');
}
if ("$category_id" == 'Root') {
$category_id = $this->Application->findModule('Name', $params['module'], 'RootCat');
}
elseif ("$category_id" == 'current') {
$category_id = $this->Application->GetVar('m_cat_id');
}
$category_id = $this->getCategorySymLink($category_id);
unset($params['cat_id'], $params['module']);
$new_params = Array ('pass' => 'm', 'm_cat_id' => $category_id, 'pass_category' => 1);
$params = array_merge_recursive2($params, $new_params);
return $this->Application->ProcessParsedTag('m', 't', $params);
}
function CategoryList($params)
{
//$object =& $this->Application->recallObject( $this->getPrefixSpecial() , $this->Prefix.'_List', $params );
$object =& $this->GetList($params);
if ($object->RecordsCount == 0)
{
if (isset($params['block_no_cats'])) {
$params['name'] = $params['block_no_cats'];
return $this->Application->ParseBlock($params);
}
else {
return '';
}
}
if (isset($params['block'])) {
return $this->PrintList($params);
}
else {
$params['block'] = $params['block_main'];
if (isset($params['block_row_start'])) {
$params['row_start_block'] = $params['block_row_start'];
}
if (isset($params['block_row_end'])) {
$params['row_end_block'] = $params['block_row_end'];
}
return $this->PrintList2($params);
}
}
function Meta($params)
{
$object =& $this->Application->recallObject($this->Prefix); // .'.-item'
/* @var $object CategoriesItem */
$meta_type = $params['name'];
if ($object->isLoaded()) {
// 1. get module prefix by current category
$category_helper =& $this->Application->recallObject('CategoryHelper');
/* @var $category_helper CategoryHelper */
$category_path = explode('|', substr($object->GetDBField('ParentPath'), 1, -1));
$module_info = $category_helper->getCategoryModule($params, $category_path);
// In-Edit & Proj-CMS module prefixes doesn't have custom field with item template
if ($module_info && $module_info['Var'] != 'cms' && $module_info['Var'] != 'st') {
// 2. get item template by current category & module prefix
$mod_rewrite_helper = $this->Application->recallObject('ModRewriteHelper');
/* @var $mod_rewrite_helper kModRewriteHelper */
$category_params = Array (
'CategoryId' => $object->GetID(),
'ParentPath' => $object->GetDBField('ParentPath'),
);
$item_template = $mod_rewrite_helper->GetItemTemplate($category_params, $module_info['Var']);
if ($this->Application->GetVar('t') == $item_template) {
// we are located on item's details page
$item =& $this->Application->recallObject($module_info['Var']);
/* @var $item kCatDBItem */
// 3. get item's meta data
$value = $item->GetField('Meta'.$meta_type);
if ($value) {
return $value;
}
}
// 4. get category meta data
$value = $object->GetField('Meta'.$meta_type);
if ($value) {
return $value;
}
}
}
// 5. get default meta data
switch ($meta_type) {
case 'Description':
$config_name = 'Category_MetaDesc';
break;
case 'Keywords':
$config_name = 'Category_MetaKey';
break;
}
return $this->Application->ConfigValue($config_name);
}
function BuildListSpecial($params)
{
if ( isset($params['parent_cat_id']) ) {
$parent_cat_id = $params['parent_cat_id'];
}
else {
$parent_cat_id = $this->Application->GetVar($this->Prefix.'_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
if (!$parent_cat_id) {
$parent_cat_id = 0;
}
}
$no_special = isset($params['no_special']) && $params['no_special'];
if ($no_special) return $this->Special;
$list_unique_key = $this->getUniqueListKey($params);
if (!$this->Application->IsAdmin()) {
// add parent category to special, when on Front-End,
// because there can be many category lists on same page
$list_unique_key .= $parent_cat_id;
}
if ($list_unique_key == '') {
return parent::BuildListSpecial($params);
}
return crc32($list_unique_key);
}
function IsCurrent($params)
{
$object =& $this->getObject($params);
if ($object->GetID() == $this->Application->GetVar('m_cat_id')) {
return true;
}
else {
return false;
}
}
/**
* Substitutes category in last template base on current category
* This is required becasue when you navigate catalog using AJAX, last_template is not updated
* but when you open item edit from catalog last_template is used to build opener_stack
* So, if we don't substitute m_cat_id in last_template, after saving item we'll get redirected
* to the first category we've opened, not the one we navigated to using AJAX
*
* @param Array $params
*/
function UpdateLastTemplate($params)
{
$category_id = $this->Application->GetVar('m_cat_id');
$wid = $this->Application->GetVar('m_wid');
list($index_file, $env) = explode('|', $this->Application->RecallVar(rtrim('last_template_'.$wid, '_')), 2);
$vars = $this->Application->HttpQuery->processQueryString( str_replace('%5C', '\\', $env) );
foreach ($vars as $var_name => $var_value) {
$this->Application->SetVar($var_name, $var_value);
}
// update required fields
$this->Application->SetVar('m_cat_id', $category_id);
$this->Application->Session->SaveLastTemplate($params['template']);
}
function GetParentCategory($params)
{
$parent_id = 0;
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$table = $this->Application->getUnitOption($this->Prefix,'TableName');
$cat_id = $this->Application->GetVar('m_cat_id');
if ($cat_id > 0) {
$sql = 'SELECT ParentId
FROM '.$table.'
WHERE '.$id_field.' = '.$cat_id;
$parent_id = $this->Conn->GetOne($sql);
}
return $parent_id;
}
function InitCacheUpdater($params)
{
safeDefine('CACHE_PERM_CHUNK_SIZE', 30);
$continue = $this->Application->GetVar('continue');
$total_cats = (int) $this->Conn->GetOne('SELECT COUNT(*) FROM '.TABLE_PREFIX.'Category');
if ($continue === false && $total_cats > CACHE_PERM_CHUNK_SIZE) {
// first step, if category count > CACHE_PERM_CHUNK_SIZE, then ask for cache update
return true;
}
if ($continue === false) {
// if we don't have to ask, then assume user selected "Yes" in permcache update dialog
$continue = 1;
}
$updater =& $this->Application->recallObject('kPermCacheUpdater', null, Array('continue' => $continue));
/* @var $updater kPermCacheUpdater */
if ($continue === '0') { // No in dialog
$updater->clearData();
$this->Application->Redirect($params['destination_template']);
}
$ret = false; // don't ask for update
if ($continue == 1) { // Initial run
$updater->setData();
}
if ($continue == 2) { // Continuing
// called from AJAX request => returns percent
$needs_more = true;
while ($needs_more && $updater->iteration <= CACHE_PERM_CHUNK_SIZE) {
// until proceeeded in this step category count exceeds category per step limit
$needs_more = $updater->DoTheJob();
}
if ($needs_more) {
// still some categories are left for next step
$updater->setData();
}
else {
// all done -> redirect
$updater->SaveData();
$this->Application->RemoveVar('PermCache_UpdateRequired');
$this->Application->Redirect($params['destination_template']);
}
$ret = $updater->getDonePercent();
}
return $ret;
}
/**
* Parses warning block, but with style="display: none;". Used during permissions saving from AJAX
*
* @param Array $params
* @return string
*/
function SaveWarning($params)
{
- if ($this->Prefix != 'c') {
+ if ($this->Prefix == 'st') {
// don't use this method for other prefixes then Category, that use this tag processor
- parent::SaveWarning($params);
- return ;
+ return parent::SaveWarning($params);
}
$main_prefix = getArrayValue($params, 'main_prefix');
if ($main_prefix && $main_prefix != '$main_prefix') {
$top_prefix = $main_prefix;
}
else {
$top_prefix = $this->Application->GetTopmostPrefix($this->Prefix);
}
$temp_tables = substr($this->Application->GetVar($top_prefix.'_mode'), 0, 1) == 't';
$modified = $this->Application->RecallVar($top_prefix.'_modified');
if (!$temp_tables) {
$this->Application->RemoveVar($top_prefix.'_modified');
return '';
}
$block_name = $this->SelectParam($params, 'render_as,name');
if ($block_name) {
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $block_name;
$block_params['edit_mode'] = $temp_tables ? 1 : 0;
$block_params['display'] = $temp_tables && $modified ? 1 : 0;
return $this->Application->ParseBlock($block_params);
}
else {
return $temp_tables && $modified ? 1 : 0;
}
return ;
}
/**
* Allows to detect if this prefix has something in clipboard
*
* @param Array $params
* @return bool
*/
function HasClipboard($params)
{
$clipboard = $this->Application->RecallVar('clipboard');
if ($clipboard) {
$clipboard = unserialize($clipboard);
foreach ($clipboard as $prefix => $clipboard_data) {
foreach ($clipboard_data as $mode => $ids) {
if (count($ids)) return 1;
}
}
}
return 0;
}
/**
* Allows to detect if root category being edited
*
* @param Array $params
*/
function IsRootCategory($params)
{
$object =& $this->getObject($params);
return $object->IsRoot();
}
/**
+ * Returns home category id
+ *
+ * @param Array $params
+ * @return int
+ */
+ function HomeCategory($params)
+ {
+ static $root_category = null;
+
+ if (!isset($root_category)) {
+ $root_category = $this->Application->findModule('Name', 'Proj-CMS', 'RootCat');
+ }
+
+ return $root_category;
+ }
+
+ /**
* Used for disabling "Home" and "Up" buttons in category list
*
* @param Array $params
* @return bool
*/
function ModuleRootCategory($params)
{
- $root_category = $this->Application->findModule('Name', 'Proj-CMS', 'RootCat');
-
- return $this->Application->GetVar('m_cat_id') == $root_category;
+ return $this->Application->GetVar('m_cat_id') == $this->HomeCategory($params);
}
function CatalogItemCount($params)
{
$object =& $this->GetList($params);
if (!$object->Counted) {
$object->CountRecs();
}
return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' / '.$object->NoFilterCount : $object->RecordsCount;
}
/**
* Print grid pagination using
* block names specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintPages($params)
{
if ($this->Application->Parser->GetParam('no_special')) {
$params['no_special'] = $this->Application->Parser->GetParam('no_special');
}
return parent::PrintPages($params);
}
function InitCatalog($params)
{
$tab_prefixes = $this->Application->GetVar('tp'); // {all, <prefixes_list>, none}
if ($tab_prefixes === false) $tab_prefixes = 'all';
$skip_prefixes = isset($params['skip_prefixes']) && $params['skip_prefixes'] ? explode(',', $params['skip_prefixes']) : Array();
$replace_main = isset($params['replace_m']) && $params['replace_m'];
// get all prefixes available
$prefixes = Array();
foreach ($this->Application->ModuleInfo as $module_name => $module_data) {
$prefix = $module_data['Var'];
if ($prefix == 'adm'/* || $prefix == 'm'*/) continue;
if ($prefix == 'm' && $replace_main) {
$prefix = 'c';
}
$prefixes[] = $prefix;
}
if ($tab_prefixes == 'none') {
$skip_prefixes = array_unique(array_merge($skip_prefixes, $prefixes));
unset($skip_prefixes[ array_search($replace_main ? 'c' : 'm', $skip_prefixes) ]);
}
elseif ($tab_prefixes != 'all') {
// prefix list here
$tab_prefixes = explode(',', $tab_prefixes); // list of prefixes that should stay
$skip_prefixes = array_unique(array_merge($skip_prefixes, array_diff($prefixes, $tab_prefixes)));
}
$params['name'] = $params['render_as'];
$params['skip_prefixes'] = implode(',', $skip_prefixes);
return $this->Application->ParseBlock($params, 1);
}
/**
* Determines, that printed category/menu item is currently active (will also match parent category)
*
* @param Array $params
* @return bool
*/
function IsActive($params)
{
static $current_path = null;
if (!isset($current_path)) {
$sql = 'SELECT ParentPath
FROM ' . TABLE_PREFIX . 'Category
WHERE CategoryId = ' . $this->Application->GetVar('m_cat_id');
$current_path = $this->Conn->GetOne($sql);
}
if (array_key_exists('parent_path', $params)) {
$test_path = $params['parent_path'];
}
else {
$template = $params['template'];
if ($template) {
// when using from "c:CachedMenu" tag
$sql = 'SELECT ParentPath
FROM ' . TABLE_PREFIX . 'Category
WHERE NamedParentPath = ' . $this->Conn->qstr('Content/' . $template);
$test_path = $this->Conn->GetOne($sql);
}
else {
// when using from "c:PrintList" tag
$cat_id = array_key_exists('cat_id', $params) && $params['cat_id'] ? $params['cat_id'] : false;
if ($cat_id === false) {
// category not supplied -> get current from PrintList
$category =& $this->getObject($params);
}
else {
if ("$cat_id" == 'Root') {
$cat_id = $this->Application->findModule('Name', $params['module'], 'RootCat');
}
$category =& $this->Application->recallObject($this->Prefix . '.-c' . $cat_id, $this->Prefix, Array ('skip_autoload' => true));
$category->Load($cat_id);
}
$test_path = $category->GetDBField('ParentPath');
}
}
return strpos($current_path, $test_path) !== false;
}
/**
* Checks if user have one of required permissions
*
* @param Array $params
* @return bool
*/
function HasPermission($params)
{
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
$params['raise_warnings'] = 0;
$object =& $this->getObject($params);
/* @var $object kDBItem */
$params['cat_id'] = $object->isLoaded() ? $object->GetDBField('ParentPath') : $this->Application->GetVar('m_cat_id');
return $perm_helper->TagPermissionCheck($params);
}
/**
* Prepares name for field with event in it (used only on front-end)
*
* @param Array $params
* @return string
*/
function SubmitName($params)
{
return 'events['.$this->Prefix.']['.$params['event'].']';
}
/**
* Returns last modification date of items in category / system
*
* @param Array $params
* @return string
*/
function LastUpdated($params)
{
$category_id = $this->Application->GetVar('m_cat_id');
$table_name = $this->Application->getUnitOption($this->Prefix, 'TableName');
if (isset($params['local']) && $params['local'] && $category_id > 0) {
// scan only current category & it's children
$sql = 'SELECT TreeLeft, TreeRight
FROM '.TABLE_PREFIX.'Category
WHERE CategoryId = '.$category_id;
$tree_info = $this->Conn->GetRow($sql);
$sql = 'SELECT MAX(c.Modified) AS ModDate, MAX(c.CreatedOn) AS NewDate
FROM '.TABLE_PREFIX.'Category c
WHERE c.TreeLeft BETWEEN '.$tree_info['TreeLeft'].' AND '.$tree_info['TreeRight'];
}
else {
// scan all categories in system
$sql = 'SELECT MAX(Modified) AS ModDate, MAX(CreatedOn) AS NewDate
FROM '.$table_name;
}
$row_data = $this->Conn->GetRow($sql);
if (!$row_data) {
return '';
}
$date = $row_data[ $row_data['NewDate'] > $row_data['ModDate'] ? 'NewDate' : 'ModDate' ];
// format date
$format = isset($params['format']) ? $params['format'] : '_regional_DateTimeFormat';
if (preg_match("/_regional_(.*)/", $format, $regs)) {
$lang =& $this->Application->recallObject('lang.current');
if ($regs[1] == 'DateTimeFormat') {
// combined format
$format = $lang->GetDBField('DateFormat').' '.$lang->GetDBField('TimeFormat');
}
else {
// simple format
$format = $lang->GetDBField($regs[1]);
}
}
return adodb_date($format, $date);
}
function CategoryItemCount($params)
{
$object =& $this->getObject($params);
/* @var $object kDBList */
$params['cat_id'] = $object->GetID();
$count_helper =& $this->Application->recallObject('CountHelper');
/* @var $count_helper kCountHelper */
return $count_helper->CategoryItemCount($params['prefix'], $params);
}
/**
* Returns prefix + any word (used for shared between categories per page settings)
*
* @param Array $params
* @return string
*/
function VarName($params)
{
return $this->Prefix.'_'.$params['type'];
}
/**
* Checks if current category is valid symbolic link to another category
*
* @param Array $params
* @return string
*/
function IsCategorySymLink($params)
{
$object =& $this->getObject($params);
/* @var $object kDBList */
$sym_category_id = $object->GetDBField('SymLinkCategoryId');
if (is_null($sym_category_id))
{
return false;
}
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($this->Prefix, 'TableName');
$sql = 'SELECT '.$id_field.'
FROM '.$table_name.'
WHERE '.$id_field.' = '.$sym_category_id;
return $this->Conn->GetOne($sql)? true : false;
}
/**
* Returns module prefix based on root category for given
*
* @param Array $params
* @return string
*/
function GetModulePrefix($params)
{
$object =& $this->getObject($params);
/* @var $object kDBItem */
$parent_path = explode('|', substr($object->GetDBField('ParentPath'), 1, -1));
$category_helper =& $this->Application->recallObject('CategoryHelper');
/* @var $category_helper CategoryHelper */
$module_info = $category_helper->getCategoryModule($params, $parent_path);
return $module_info['Var'];
}
function ImageSrc($params)
{
list ($ret, $tag_processed) = $this->processAggregatedTag('ImageSrc', $params, $this->getPrefixSpecial());
return $tag_processed ? $ret : false;
}
function PageLink($params)
{
$t = isset($params['template']) ? $params['template'] : '';
unset($params['template']);
if (!$t) $t = $this->Application->GetVar('t');
if (isset($params['page'])) {
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $params['page']);
unset($params['page']);
}
$params['m_cat_page'] = $this->Application->GetVar($this->getPrefixSpecial().'_Page');
if (!isset($params['pass'])) {
$params['pass'] = 'm,'.$this->getPrefixSpecial();
}
return $this->Application->HREF($t, '', $params);
}
/**
* Returns spelling suggestions against search keyword
*
* @param Array $params
* @return string
*/
function SpellingSuggestions($params)
{
$keywords = unhtmlentities( trim($this->Application->GetVar('keywords')) );
if (!$keywords) {
return ;
}
// 1. try to get already cached suggestion
$suggestion = $this->Application->getCache('search.suggestion', $keywords);
if ($suggestion !== false) {
return $suggestion;
}
$table_name = $this->Application->getUnitOption('spelling-dictionary', 'TableName');
// 2. search suggestion in database
$sql = 'SELECT SuggestedCorrection
FROM ' . $table_name . '
WHERE MisspelledWord = ' . $this->Conn->qstr($keywords);
$suggestion = $this->Conn->GetOne($sql);
if ($suggestion !== false) {
$this->Application->setCache('search.suggestion', $keywords, $suggestion);
return $suggestion;
}
// 3. suggestion not found in database, ask webservice
$app_id = $this->Application->ConfigValue('YahooApplicationId');
$url = 'http://search.yahooapis.com/WebSearchService/V1/spellingSuggestion?appid=' . $app_id . '&query=';
$curl_helper =& $this->Application->recallObject('CurlHelper');
/* @var $curl_helper kCurlHelper */
$xml_data = $curl_helper->Send($url . urlencode($keywords));
$xml_helper =& $this->Application->recallObject('kXMLHelper');
/* @var $xml_helper kXMLHelper */
$root_node =& $xml_helper->Parse($xml_data);
$result = $root_node->FindChild('RESULT');
/* @var $result kXMLNode */
if (is_object($result)) {
// webservice responded -> save in local database
$fields_hash = Array (
'MisspelledWord' => $keywords,
'SuggestedCorrection' => $result->Data,
);
$this->Conn->doInsert($fields_hash, $table_name);
$this->Application->setCache('search.suggestion', $keywords, $result->Data);
return $result->Data;
}
return '';
}
/**
* Shows link for searching by suggested word
*
* @param Array $params
* @return string
*/
function SuggestionLink($params)
{
$params['keywords'] = $this->SpellingSuggestions($params);
return $this->Application->ProcessParsedTag('m', 'Link', $params);
}
function InitCatalogTab($params)
{
$tab_params['mode'] = $this->Application->GetVar('tm'); // single/multi selection possible
$tab_params['special'] = $this->Application->GetVar('ts'); // use special for this tab
$tab_params['dependant'] = $this->Application->GetVar('td'); // is grid dependant on categories grid
// set default params (same as in catalog)
if ($tab_params['mode'] === false) $tab_params['mode'] = 'multi';
if ($tab_params['special'] === false) $tab_params['special'] = '';
if ($tab_params['dependant'] === false) $tab_params['dependant'] = 'yes';
// pass params to block with tab content
$params['name'] = $params['render_as'];
$params['prefix'] = trim($this->Prefix.'.'.($tab_params['special'] ? $tab_params['special'] : $this->Special), '.');
$prefix_append = $this->Application->GetVar('prefix_append');
if ($prefix_append) {
$params['prefix'] .= $prefix_append;
}
$default_grid = array_key_exists('default_grid', $params) ? $params['default_grid'] : 'Default';
$radio_grid = array_key_exists('radio_grid', $params) ? $params['radio_grid'] : 'Radio';
$params['cat_prefix'] = trim('c.'.($tab_params['special'] ? $tab_params['special'] : $this->Special), '.');
$params['tab_mode'] = $tab_params['mode'];
$params['grid_name'] = ($tab_params['mode'] == 'multi') ? $default_grid : $radio_grid;
$params['tab_dependant'] = $tab_params['dependant'];
$params['show_category'] = $tab_params['special'] == 'showall' ? 1 : 0; // this is advanced view -> show category name
return $this->Application->ParseBlock($params, 1);
}
/**
* Show CachedNavbar of current item primary category
*
* @param Array $params
* @return string
*/
function CategoryName($params)
{
// show category cachednavbar of
$object =& $this->getObject($params);
$category_id = isset($params['cat_id']) ? $params['cat_id'] : $object->GetDBField('CategoryId');
$category_path = $this->Application->getCache('category_paths', $category_id);
if ($category_path === false) {
// not chached
if ($category_id > 0) {
$cached_navbar = preg_replace('/^Content&\|&/i', '', $object->GetField('CachedNavbar'));
$category_path = trim($this->CategoryName( Array('cat_id' => 0) ).' > '.str_replace('&|&', ' > ', $cached_navbar), ' > ');
}
else {
$category_path = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') );
}
$this->Application->setCache('category_paths', $category_id, $category_path);
}
return $category_path;
}
// structure related
/**
* Returns page object based on requested params
*
* @param Array $params
* @return PagesItem
*/
function &_getPage($params)
{
$page =& $this->Application->recallObject($this->Prefix . '.-virtual', null, $params);
/* @var $page kDBItem */
// 1. load by given id
$page_id = array_key_exists('page_id', $params) ? $params['page_id'] : false;
if ($page_id) {
if ($page_id != $page->GetID()) {
// load if different
$page->Load($page_id);
}
return $page;
}
// 2. load by template
$template = array_key_exists('page', $params) ? $params['page'] : '';
if (!$template) {
$template = $this->Application->GetVar('t');
}
// different path in structure AND design template differes from requested template
$structure_path_match = strtolower( $page->GetDBField('NamedParentPath') ) == strtolower('Content/' . $template);
$design_match = $page->GetDBField('CachedTemplate') == $template;
if (!$structure_path_match && !$design_match) {
// Same sql like in "c:getPassedID". Load, when current page object doesn't match requested page object
$themes_helper =& $this->Application->recallObject('ThemesHelper');
/* @var $themes_helper kThemesHelper */
$sql = 'SELECT ' . $page->IDField . '
FROM ' . $page->TableName . '
WHERE
(
(NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR
(IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ')
)
AND (ThemeId = ' . $themes_helper->getCurrentThemeId() . ' OR ThemeId = 0)';
$page_id = $this->Conn->GetOne($sql);
$page->Load($page_id);
}
return $page;
}
/**
* Returns requested content block content of current or specified page
*
* @param Array $params
* @return string
*/
function ContentBlock($params)
{
$num = getArrayValue($params, 'num');
if (!$num) {
return 'NO CONTENT NUM SPECIFIED';
}
$page =& $this->_getPage($params);
/* @var $page kDBItem */
if (!$page->isLoaded()) {
// page is not created yet => all blocks are empty
return '';
}
$page_id = $page->GetID();
$data = Array ('PageId' => $page_id, 'ContentNum' => $num);
$content =& $this->Application->recallObject('content.-block', null, Array ('skip_autoload' => true));
/* @var $content kDBItem */
$content->Load($data);
if (!$content->isLoaded()) {
// bug: missing content blocks are created even if user have no SMS-management rights
$content->SetFieldsFromHash($data);
$content->Create();
}
$edit_code = '';
if (EDITING_MODE == EDITING_MODE_CMS) {
$bg_color = isset($params['bgcolor']) ? $params['bgcolor'] : '#ffffff';
$url_params = Array (
'pass' => 'm,c,content',
'm_opener' => 'd',
'c_id' => $page->GetID(),
'content_id' => $content->GetID(),
'front' => 1,
'admin' => 1,
'__URLENCODE__' => 1,
'__NO_REWRITE__'=> 1,
'escape' => 1,
'index_file' => 'index.php',
// 'bgcolor' => $bg_color,
// '__FORCE_SID__' => 1
);
if (isset($params['float'])) {
$pos_float = 'position: relative; float: '.$params['float'].';';
}
else {
$pos_float = 'width: auto; position: absolute;';
}
// link from Front-End to admin, don't remove "index.php"
$edit_url = $this->Application->HREF('categories/edit_content', ADMIN_DIRECTORY, $url_params, 'index.php');
$button_css = 'font-family: Arial, Verdana; font-size: 9pt; '.$pos_float.' z-index: 99; background-color: #F7C300; color: #CE0031; border: 1px solid #CE0031; padding: 1px 10px 1px 10px; cursor: pointer;';
$edit_code = '<div style="'.$button_css.'" onclick="$form_name=\'kf_cont_'.$content->GetID().'\'; open_popup(\'content\', \'OnEdit\', \'categories/edit_content\');">Edit '.(defined('DEBUG_MODE') && DEBUG_MODE ? "({$num})" : '').'</div>';
if (isset($params['forms_later']) && $params['forms_later']) {
$tmp = $edit_code;
$edit_code = '';
}
$edit_code .= '<form method="POST" style="display: inline; margin: 0px" name="kf_cont_'.$content->GetID().'" id="kf_cont_'.$content->GetID().'" action="'.$edit_url.'">';
$edit_code .= '<input type="hidden" name="c_id" value="'.$page->GetID().'"/>';
$edit_code .= '<input type="hidden" name="content_id" value="'.$content->GetID().'"/>';
$edit_code .= '<input type="hidden" name="front" value="1"/>';
$edit_code .= '<input type="hidden" name="bgcolor" value="'.$bg_color.'"/>';
$edit_code .= '<input type="hidden" name="m_lang" value="'.$this->Application->GetVar('m_lang').'"/>';
$edit_code .= '</form>';
if (isset($params['forms_later']) && $params['forms_later']) {
$all_forms = $this->Application->GetVar('all_forms');
$all_forms .= $edit_code;
$this->Application->SetVar('all_forms', $all_forms);
$edit_code = $tmp;
}
}
if ($this->Application->GetVar('_editor_preview_') == 1) {
$data = $this->Application->RecallVar('_editor_preview_content_');
} else {
$data = $content->GetField('Content');
}
return $edit_code . $this->_replacePageIds($data);
}
/**
* Replace links like "@@ID@@" to actual template names in given text
*
* @param string $text
* @return string
*/
function _replacePageIds($text)
{
if (!preg_match_all('/@@(\\d+)@@/', $text, $regs)) {
return $text;
}
$page_ids = $regs[1];
$sql = 'SELECT NamedParentPath, CategoryId
FROM ' . TABLE_PREFIX . 'Category
WHERE CategoryId IN (' . implode(',', $page_ids) . ')';
$templates = $this->Conn->GetCol($sql, 'CategoryId');
foreach ($page_ids as $page_id) {
$text = preg_replace('/@@' . $page_id . '@@/', $this->Application->HREF($templates[$page_id], '', Array ('pass' => 'm')), $text);
}
return $text;
}
/**
* Returns current page name or page based on page/page_id parameters
*
* @param Array $params
* @return string
* @todo Used?
*/
function PageName($params)
{
$page =& $this->_getPage($params);
return $page->GetDBField('Name');
}
/**
* Returns current/given page information
*
* @param Array $params
* @return string
*/
function PageInfo($params)
{
$page =& $this->_getPage($params);
if ($params['type'] == 'index_tools') {
$page_info = $page->GetDBField('IndexTools');
if ($page_info) {
return $page_info;
}
else {
if (PROTOCOL == 'https://') {
return $this->Application->ConfigValue('cms_DefaultIndextoolsCode_SSL');
}
else {
return $this->Application->ConfigValue('cms_DefaultIndextoolsCode');
}
}
}
switch ($params['type']) {
case 'title':
$db_field = 'Title';
break;
case 'htmlhead_title':
$db_field = 'Name';
break;
case 'meta_title':
$db_field = 'MetaTitle';
break;
case 'meta_keywords':
$db_field = 'MetaKeywords';
$cat_field = 'Keywords';
break;
case 'meta_description':
$db_field = 'MetaDescription';
$cat_field = 'Description';
break;
default:
return '';
}
$default = isset($params['default']) ? $params['default'] : '';
$val = $page->GetField($db_field);
if (!$default) {
if ($this->Application->isModuleEnabled('In-Portal')) {
if (!$val && ($params['type'] == 'meta_keywords' || $params['type'] == 'meta_description')) {
// take category meta if it's not set for the page
return $this->Application->ProcessParsedTag('c', 'Meta', Array('name' => $cat_field));
}
}
}
if (isset($params['force_default']) && $params['force_default']) {
return $default;
}
if (preg_match('/^_Auto:/', $val)) {
$val = $default;
/*if ($db_field == 'Title') {
$page->SetDBField($db_field, $default);
$page->Update();
}*/
}
elseif ($page->GetID() == false) {
return $default;
}
return $val;
}
/**
* Prints "Edit Page" button on cms page
*
* @param Array $params
* @return string
*/
function EditPage($params)
{
if (!EDITING_MODE) {
return '';
}
$page =& $this->_getPage($params);
$url_params = Array(
'pass' => 'm,c',
'm_opener' => 'd',
'c_id' => $page->GetID(),
'c_mode' => 't',
'c_event' => 'OnEdit',
'front' => 1,
'__URLENCODE__' => 1,
'__NO_REWRITE__'=> 1,
'escape' => 1,
'index_file' => 'index.php',
);
$edit_url = $this->Application->HREF('categories/categories_edit', '/admin', $url_params);
$button_css = 'position: absolute; z-index: 1; top: 1; left 1; font-family: Arial, Verdana; font-size: 9px; background-color: #F7C300; color: #CE0031; border: 1px solid #CE0031; width: auto; padding: 2px 10px 2px 10px; cursor: pointer;';
$edit_code = '<div style="'.$button_css.'" onmouseover="window.status=\''.$edit_url.'\'; return true" onclick="$form_name=\'kf_'.$page->GetID().'\'; open_popup(\'c\', \'OnEdit\', \'categories/categories_edit\');">Page Properties';
$title = $this->PageInfo(array('type' => 'htmlhead_title'));
$edit_code .= '<form method="POST" style="display: inline; margin: 0px" name="kf_'.$page->GetID().'" id="kf_'.$page->GetID().'" action="'.$edit_url.'">';
/* $edit_code .= '<input type="hidden" name="c_id" value="'.$page->GetID().'"/>';
$edit_code .= '<input type="hidden" name="c_mode" value="t"/>';
$edit_code .= '<input type="hidden" name="front" value="1"/>'; */
$edit_code .= '</form>';
if (!$this->Application->GetVar('admin_scripts_included')) {
$this->Application->SetVar('admin_script_included', 1);
$js_url = $this->Application->BaseURL() . 'core/admin_templates/js';
/*$edit_code .= '
<link rel="stylesheet" rev="stylesheet" href="' . $js_url . '/../incs/style.css" type="text/css" />
<style type="text/css">
body {
height: auto;
margin: 0px;
}
</style>';*/
/* $edit_code .= $this->Application->ProcessParsedTag('adm', 'AdminSkin', Array ()) . "\n";*/
$edit_code .= '<link rel="stylesheet" href="' . $js_url . '/jquery/thickbox/thickbox.css" type="text/css" media="screen"/>' . "\n";
$edit_code .= '<script type="text/javascript" src="' . $js_url . '/jquery/jquery.pack.js"></script>' . "\n";
$edit_code .= '<script type="text/javascript" src="' . $js_url . '/jquery/jquery-ui.custom.min.js"></script>' . "\n";
$edit_code .= '<script type="text/javascript" src="' . $js_url . '/is.js"></script>' . "\n";
$edit_code .= '<script type="text/javascript" src="' . $js_url . '/application.js"></script>' . "\n";
$edit_code .= '<script type="text/javascript" src="' . $js_url . '/script.js"></script>' . "\n";
$edit_code .= '<script type="text/javascript" src="' . $js_url . '/jquery/thickbox/thickbox.js"></script>' . "\n";
$edit_code .= '<script language="javascript">' . "\n";
$edit_code .= "TB.pathToImage = 'js/jquery/thickbox/loadingAnimation.gif';" . "\n";
$edit_code .= "var main_title = '" . addslashes( $this->Application->ConfigValue('Site_Name') ) . "';" . "\n";
$edit_code .= "var base_url = '" . $this->Application->BaseURL() . "';" . "\n";
$edit_code .= 'TB.closeHtml = \'<img src="' . $js_url . '/../img/close_window15.gif" width="15" height="15" style="border-width: 0px;" alt="close"/><br/>\';' . "\n";
$edit_code .= '</script>' . "\n";
}
$url_params = Array('m_theme' => '', 'pass' => 'm', 'm_opener' => 'r', 'no_amp' => 1);
$browse_url = $this->Application->HREF('catalog/catalog', ADMIN_DIRECTORY, $url_params, 'index.php');
$browse_url = preg_replace('/&(admin|editing_mode)=[\d]/', '', $browse_url);
$edit_code .= '
<script type="text/javascript">
var topmost = window.top;
topmost.document.title = document.title + \' - '.$this->Application->Phrase('la_AdministrativeConsole').'\';
t = \''.$this->Application->GetVar('t').'\';
if (window.parent.frames["menu"] != undefined) {
if ( $.isFunction(window.parent.frames["menu"].SyncActive) ) {
window.parent.frames["menu"].SyncActive("' . $browse_url . '");
}
}
</script></div>'."\n";
return $edit_code;
}
/**
* Builds cached menu version
*
* @return Array
*/
function _prepareMenu()
{
static $root_cat = null;
static $root_path = null;
if (!$root_cat) {
$root_cat = $this->Application->ModuleInfo['Proj-CMS']['RootCat'];
$root_path = $this->Conn->GetOne('SELECT ParentPath FROM '.TABLE_PREFIX.'Category WHERE CategoryId = '.$root_cat);
}
if (!$this->Menu) {
$menu = $this->Conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "cms_menu"');
if ($menu && $menu['Cached'] > 0) {
$menu = unserialize($menu['Data']);
$this->ParentPaths = $menu['ParentPaths'];
}
else {
$menu = $this->_altBuildMenuStructure(array('CategoryId' => $root_cat, 'ParentPath' => $root_path));
$menu['ParentPaths'] = $this->ParentPaths;
$this->Conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("cms_menu", '.$this->Conn->qstr(serialize($menu)).', '.adodb_mktime().')');
}
unset($menu['ParentPaths']);
$this->Menu = $menu;
}
return Array ($this->Menu, $root_path);
}
/**
* Returns category id based tag parameters
*
* @param Array $params
* @return int
*/
function _getCategoryId($params)
{
$cat = isset($params['category_id']) && $params['category_id'] != '' ? $params['category_id'] : $this->Application->GetVar('m_cat_id');
if ("$cat" == 'parent') {
$this_category =& $this->Application->recallObject('c');
/* @var $this_category kDBItem */
$cat = $this_category->GetDBField('ParentId');
}
else if ($cat == 0) {
$cat = $this->Application->ModuleInfo['Proj-CMS']['RootCat'];
}
return $cat;
}
/**
* Prepares cms menu item block parameters
*
* @param Array $page
* @param int $real_cat_id
* @param string $root_path
* @return Array
*/
function _prepareMenuItem($page, $real_cat_id, $root_path)
{
static $language_id = null;
static $primary_language_id = null;
if (!isset($language_id)) {
$language_id = $this->Application->GetVar('m_lang');
$primary_language_id = $this->Application->GetDefaultLanguageId();
}
$title = $page['l'.$language_id.'_ItemName'] ? $page['l'.$language_id.'_ItemName'] : $page['l'.$primary_language_id.'_ItemName'];
$active = false;
$category_active = false;
if ($page['ItemType'] == 'cat') {
if ( isset($this->ParentPaths[$real_cat_id])) {
$active = strpos($this->ParentPaths[$real_cat_id], $page['ParentPath']) !== false;
}
$category_active = $page['CategoryId'] == $real_cat_id;
}
if ($page['ItemType'] == 'cat_index') {
$check_path = str_replace($root_path, '', $page['ParentPath']);
$active = strpos($parent_path, $check_path) !== false;
}
if ($page['ItemType'] == 'page') {
$active = $page['ItemPath'] == preg_replace('/^Content\//i', '', $this->Application->GetVar('t'));
}
$block_params = Array (
'title'=> $title,
'template'=> preg_replace('/^Content\//i', '', $page['ItemPath']),
'active'=>$active,
'category_active' => $category_active, // new
'parent_path'=>$page['ParentPath'],
'parent_id'=>$page['ParentId'],
'cat_id'=>$page['CategoryId'],
'is_index'=>$page['IsIndex'],
'item_type'=>$page['ItemType'],
'page_id'=>$page['ItemId'],
'has_sub_menu' => isset($page['sub_items']) && count($page['sub_items']) > 0,
'external_url' => $page['UseExternalUrl'] ? $page['ExternalUrl'] : false,
'menu_icon' => $page['UseMenuIconUrl'] ? $page['MenuIconUrl'] : false,
);
return $block_params;
}
/**
* Builds site menu
*
* @param Array $params
* @return string
*/
function CachedMenu($params)
{
list ($menu, $root_path) = $this->_prepareMenu();
$cat = $this->_getCategoryId($params);
$parent_path = isset($this->ParentPaths[$cat]) ? $this->ParentPaths[$cat] : '';
$parent_path = str_replace($root_path, '', $parent_path); //menu starts from module path
$levels = explode('|',trim($parent_path,'|'));
if ($levels[0] === '') $levels = array();
if (isset($params['level']) && $params['level'] > count($levels)) return ;
$level = max(isset($params['level']) ? $params['level']-1 : count($levels)-1, 0);
$parent = isset($levels[$level]) ? $levels[$level] : 0;
$cur_menu =& $menu;
$menu_path = array_slice($levels, 0, $level+1);
foreach ($menu_path as $elem) {
$cur_menu =& $cur_menu['c'.$elem]['sub_items'];
}
$ret = '';
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
$this->Application->SetVar('cur_parent_path', $parent_path);
$real_cat_id = $this->Application->GetVar('m_cat_id');
if (is_array($cur_menu) && $cur_menu) {
$cur_item = 1;
$cur_menu = $this->_removeNonMenuItems($cur_menu);
$block_params['total_items'] = count($cur_menu);
foreach ($cur_menu as $page) {
$block_params = array_merge_recursive2(
$block_params,
$this->_prepareMenuItem($page, $real_cat_id, $root_path)
);
$block_params['is_last'] = $cur_item == $block_params['total_items'];
$block_params['is_first'] = $cur_item == 1;
// bug #1: this breaks active section highlighting when 2 menu levels are printed on same page (both visible)
// bug #2: people doesn't pass cat_id parameter to m_Link tags in their blocks, so this line helps them; when removed their links will lead to nowhere
$this->Application->SetVar('m_cat_id', $page['CategoryId']);
$ret .= $this->Application->ParseBlock($block_params, 1);
$cur_item++;
}
$this->Application->SetVar('m_cat_id', $real_cat_id);
}
return $ret;
}
/**
* Returns only items, that are visible in menu
*
* @param Array $menu
* @return Array
*/
function _removeNonMenuItems($menu)
{
foreach ($menu as $menu_index => $menu_item) {
// $menu_index is in "cN" format, where N is category id
if (!$menu_item['IsMenu']) {
unset($menu[$menu_index]);
}
}
return $menu;
}
/**
* Trick to allow some kind of output formatting when using CachedMenu tag
*
* @param Array $params
* @return bool
*/
function SplitColumn($params)
{
return $this->Application->GetVar($params['i']) > ceil($params['total'] / $params['columns']);
}
/**
* Returns direct children count of given category
*
* @param Array $params
* @return int
*/
function HasSubCats($params)
{
$sql = 'SELECT COUNT(*)
FROM ' . TABLE_PREFIX . 'Category
WHERE ParentId = ' . $params['cat_id'];
return $this->Conn->GetOne($sql);
}
/**
* Prints sub-pages of given/current page.
*
* @param Array $params
* @return string
* @todo This could be reached by using "parent_cat_id" parameter. Only difference here is new block parameter "path". Need to rewrite.
*/
function PrintSubPages($params)
{
$list =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix.'_List', $params);
/* @var $list kDBList */
$category_id = array_key_exists('category_id', $params) ? $params['category_id'] : $this->Application->GetVar('m_cat_id');
$list->addFilter('current_pages', TABLE_PREFIX . 'CategoryItems.CategoryId = ' . $category_id);
$list->Query();
$list->GoFirst();
$o = '';
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
while (!$list->EOL()) {
$block_params['path'] = $list->GetDBField('Path');
$o .= $this->Application->ParseBlock($block_params, 1);
$list->GoNext();
}
return $o;
}
/**
* Builds link for browsing current page on Front-End
*
* @param Array $params
* @return string
*/
function PageBrowseLink($params)
{
$object =& $this->getObject($params);
$template = $object->GetDBField('NamedParentPath');
$url_params = Array ('admin' => 1, 'pass' => 'm', 'm_cat_id' => $object->GetID(), 'index_file' => 'index.php');
return $this->Application->HREF($template, '_FRONT_END_', $url_params);
}
/**
* Builds link to cms page (used?)
*
* @param Array $params
* @return string
*/
function ContentPageLink($params)
{
$object =& $this->getObject($params);
$params['t'] = $object->GetDBField('NamedParentPath');
$params['m_cat_id'] = 0;
return $this->Application->ProcessParsedTag('m', 'Link', $params);
}
/**
* Builds cache for children of given category (no matter, what menu status is)
*
* @param Array $parent
* @return Array
*/
function _altBuildMenuStructure($parent)
{
static $languages_count = null;
if (!isset($languages_count)) {
$sql = 'SELECT COUNT(*)
FROM ' . TABLE_PREFIX . 'Language';
$languages_count = ceil($this->Conn->GetOne($sql) / 5) * 5;
}
$items = Array ();
$lang_part = '';
for ($i = 1; $i <= $languages_count; $i++) {
// $lang_part .= 'c.l' . $i . '_Name AS l' . $i . '_ItemName,' . "\n";
$lang_part .= 'c.l' . $i . '_MenuTitle AS l' . $i . '_ItemName,' . "\n";
}
// Sub-categories from current category
$query = 'SELECT
c.CategoryId AS CategoryId,
CONCAT(\'c\', c.CategoryId) AS ItemId,
c.Priority AS ItemPriority,
' . $lang_part . '
LOWER( IF(IsIndex = 2, (
SELECT cc.NamedParentPath FROM ' . TABLE_PREFIX . 'Category AS cc
WHERE
cc.ParentId = c.CategoryId
AND
cc.Status IN (1,4)
AND
cc.IsIndex = 1
),
c.NamedParentPath) ) AS ItemPath,
0 AS IsIndex,
c.ParentPath AS ParentPath,
c.ParentId As ParentId,
\'cat\' AS ItemType,
c.IsMenu, c.UseExternalUrl, c.ExternalUrl, c.UseMenuIconUrl, c.MenuIconUrl
FROM ' . TABLE_PREFIX . 'Category AS c
WHERE
c.Status IN (1,4) AND
#c.IsMenu = 1 AND
c.ParentId = ' . $parent['CategoryId'];
$items = array_merge($items, $this->Conn->Query($query, 'ItemId'));
uasort($items, Array (&$this, '_menuSort'));
$the_items = array();
foreach ($items as $an_item) {
$the_items[ $an_item['ItemId'] ] = $an_item;
$this->ParentPaths[ $an_item['CategoryId'] ] = $an_item['ParentPath'];
}
$items = $the_items;
foreach ($items as $key => $menu_item) {
if ($menu_item['CategoryId'] == $parent['CategoryId']) {
continue;
}
$sub_items = $this->_altBuildMenuStructure($menu_item);
if ($sub_items) {
$items[$key]['sub_items'] = $sub_items;
}
}
return $items;
}
/**
* Method for sorting pages by priority in decending order
*
* @param Array $a
* @param Array $b
* @return int
*/
function _menuSort($a, $b)
{
if ($a['ItemPriority'] == $b['ItemPriority']) {
return 0;
}
return ($a['ItemPriority'] < $b['ItemPriority']) ? 1 : -1; //descending
}
/**
* Prepares cms page description for search result page
*
* @param Array $params
* @return string
*/
function SearchDescription($params)
{
$object =& $this->getObject($params);
$desc = $object->GetField('MetaDescription');
if (!$desc) {
$sql = 'SELECT *
FROM ' . TABLE_PREFIX . 'PageContent
WHERE PageId = ' . $object->GetID() . ' AND ContentNum = 1';
$content = $this->Conn->GetRow($sql);
if ($content['l'.$this->Application->GetVar('m_lang').'_Content']) {
$desc = $content['l'.$this->Application->GetVar('m_lang').'_Content'];
}
else {
$desc = $content['l'.$this->Application->GetDefaultLanguageId().'_Content'];
}
}
return mb_substr($desc, 0, 300).(mb_strlen($desc) > 300 ? '...' : '');
}
/**
* Simplified version of "c:CategoryLink" for "c:PrintList"
*
* @param Array $params
* @return string
* @todo Used? Needs refactoring.
*/
function EnterCatLink($params)
{
$object =& $this->getObject($params);
$url_params = Array ('pass' => 'm', 'm_cat_id' => $object->GetID());
return $this->Application->HREF($params['template'], '', $url_params);
}
/**
* Simplified version of "c:CategoryPath", that do not use blocks for rendering
*
* @param Array $params
* @return string
* @todo Used? Maybe needs to be removed.
*/
function PagePath($params)
{
$object =& $this->getObject($params);
$path = $object->GetField('CachedNavbar');
if ($path) {
$items = explode('&|&', $path);
array_shift($items);
return implode(' -&gt; ', $items);
}
return '';
}
/**
* Returns configuration variable value
*
* @param Array $params
* @return string
* @todo Needs to be replaced with "m:GetConfig" tag; Not used now (were used on structure_edit.tpl).
*/
function AllowManualFilenames($params)
{
return $this->Application->ConfigValue('ProjCMSAllowManualFilenames');
}
/**
* Draws path to current page (each page can be link to it)
*
* @param Array $params
* @return string
*/
function CurrentPath($params)
{
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $block_params['render_as'];
$object =& $this->Application->recallObject($this->Prefix);
/* @var $object kDBItem */
$category_ids = explode('|', substr($object->GetDBField('ParentPath'), 1, -1));
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($this->Prefix, 'TableName');
$language = $this->Application->GetVar('m_lang');
$sql = 'SELECT l'.$language.'_Name AS Name, NamedParentPath
FROM '.$table_name.'
WHERE '.$id_field.' IN ('.implode(',', $category_ids).')';
$categories_data = $this->Conn->Query($sql);
$ret = '';
foreach ($categories_data as $index => $category_data) {
if ($category_data['Name'] == 'Content') {
continue;
}
$block_params['title'] = $category_data['Name'];
$block_params['template'] = preg_replace('/^Content\//i', '', $category_data['NamedParentPath']);
$block_params['is_first'] = $index == 1; // because Content is 1st element
$block_params['is_last'] = $index == count($categories_data) - 1;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
/**
* Synonim to PrintList2 for "onlinestore" theme
*
* @param Array $params
* @return string
*/
function ListPages($params)
{
return $this->PrintList2($params);
}
/**
* Returns information about parser element locations in template
*
* @param Array $params
* @return mixed
*/
function BlockInfo($params)
{
if (!EDITING_MODE) {
return '';
}
$template_helper =& $this->Application->recallObject('TemplateHelper');
/* @var $template_helper TemplateHelper */
return $template_helper->blockInfo( $params['name'] );
}
/**
* Returns formatted title for template editor
*
* @param Array $params
* @return string
*/
function TemplateEditorTitle($params)
{
if (!EDITING_MODE) {
return '';
}
$text = $this->Application->Phrase($params['phrase']);
$template_helper =& $this->Application->recallObject('TemplateHelper');
/* @var $template_helper TemplateHelper */
$text = sprintf($text, $template_helper->blockInfo(template_file), $template_helper->blockInfo('start_pos'), $template_helper->blockInfo('end_pos'));
return $text;
}
-}
+ /**
+ * Hide all editing tabs except permission tab, when editing "Home" (ID = 0) category
+ *
+ * @param Array $params
+ */
+ function ModifyUnitConfig($params)
+ {
+ $root_category = $this->Application->RecallVar('IsRootCategory_' . $this->Application->GetVar('m_wid'));
+ if (!$root_category) {
+ return ;
+ }
-?>
\ No newline at end of file
+ $edit_tab_presets = $this->Application->getUnitOption($this->Prefix, 'EditTabPresets');
+ $edit_tab_presets['Default'] = Array (
+ 'permissions' => $edit_tab_presets['Default']['permissions'],
+ );
+ $this->Application->setUnitOption($this->Prefix, 'EditTabPresets', $edit_tab_presets);
+ }
+
+ /**
+ * Prints catalog export templates
+ *
+ * @param Array $params
+ * @return string
+ */
+ function PrintCatalogExportTemplates($params)
+ {
+ $prefixes = explode(',', $params['prefixes']);
+
+ $ret = Array ();
+ foreach ($prefixes as $prefix) {
+ $ret[$prefix] = $this->Application->getUnitOption($prefix, 'ModuleFolder') . '/export';
+ }
+
+ $json_helper =& $this->Application->recallObject('JSONHelper');
+ /* @var $json_helper JSONHelper */
+
+ return $json_helper->encode($ret);
+ }
+}
\ No newline at end of file
Property changes on: branches/RC/core/units/categories/categories_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.47.2.28
\ No newline at end of property
+1.47.2.29
\ No newline at end of property
Index: branches/RC/core/units/categories/categories_event_handler.php
===================================================================
--- branches/RC/core/units/categories/categories_event_handler.php (revision 11537)
+++ branches/RC/core/units/categories/categories_event_handler.php (revision 11538)
@@ -1,1895 +1,1911 @@
<?php
class CategoriesEventHandler extends kDBEventHandler {
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array (
'OnRebuildCache' => Array ('self' => 'add|edit'),
'OnCopy' => Array ('self' => 'add|edit'),
'OnCut' => Array ('self' => 'edit'),
'OnPasteClipboard' => Array ('self' => 'add|edit'),
'OnPaste' => Array ('self' => 'add|edit', 'subitem' => 'edit'),
'OnRecalculatePriorities' => Array ('self' => 'add|edit'), // category ordering
'OnItemBuild' => Array ('self' => true), // always allow to view individual categories (regardless of CATEGORY.VIEW right)
'OnUpdatePreviewBlock' => Array ('self' => true), // for FCKEditor integration
'OnSaveBlock' => Array ('self' => true), // saves RenderElements from Front-End
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Categories are sorted using special sorting event
*
*/
function mapEvents()
{
parent::mapEvents();
$events_map = Array (
'OnMassMoveUp' => 'OnChangePriority',
'OnMassMoveDown' => 'OnChangePriority',
);
$this->eventMethods = array_merge($this->eventMethods, $events_map);
}
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if (!$this->Application->IsAdmin()) {
if ($event->Name == 'OnSetSortingDirect') {
// allow sorting on front event without view permission
return true;
}
if ($event->Name == 'OnItemBuild') {
$category_id = $this->getPassedID($event);
if ($category_id == 0) {
return true;
}
}
}
if ($event->Name == 'OnEdit' || $event->Name == 'OnSave') {
// check each id from selected individually and only if all are allowed proceed next
if ($event->Name == 'OnEdit') {
$selected_ids = implode(',', $this->StoreSelectedIDs($event));
}
else {
$selected_ids = implode(',', $this->getSelectedIDs($event, true));
}
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
if (strlen($selected_ids) > 0) {
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'SELECT '.$id_field.', CreatedById
FROM '.$table_name.' item_table
WHERE '.$id_field.' IN ('.$selected_ids.')';
$items = $this->Conn->Query($sql, $id_field);
}
else {
// when creating new category, then no IDs are stored in session
$parent_cat = $this->Application->RecallVar('m_cat_id');
$items[$parent_cat] = Array (
$id_field => $parent_cat,
'CreatedById' => $this->Application->RecallVar('user_id'),
);
}
$perm_value = true;
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
foreach ($items as $item_id => $item_data) {
if ($perm_helper->ModifyCheckPermission($item_data['CreatedById'], $item_data[$id_field], $event->Prefix) == 0) {
// one of items selected has no permission
$perm_value = false;
break;
}
}
if (!$perm_value) {
$event->status = erPERM_FAIL;
}
return $perm_value;
}
if ($event->Name == 'OnPasteClipboard') {
// forces permission check to work by current category for "Paste In Category" operation
$category_id = $this->Application->GetVar('m_cat_id');
$this->Application->SetVar('c_id', $category_id);
}
return parent::CheckPermission($event);
}
/**
* Set's mark, that root category is edited
*
* @param kEvent $event
*/
function OnEdit(&$event)
{
$category_id = $this->Application->GetVar($event->getPrefixSpecial().'_id');
$this->Application->StoreVar('IsRootCategory_'.$this->Application->GetVar('m_wid'), $category_id === '0');
parent::OnEdit($event);
}
/**
* Adds selected link to listing
*
* @param kEvent $event
*/
function OnProcessSelected(&$event)
{
$object =& $event->getObject();
/* @var $object kDBItem */
$selected_ids = $this->Application->GetVar('selected_ids');
$this->RemoveRequiredFields($object);
$object->SetDBField($this->Application->RecallVar('dst_field'), $selected_ids['c']);
$object->Update();
$this->finalizePopup($event);
}
/**
* Apply system filter to categories list
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
parent::SetCustomQuery($event);
$object =& $event->getObject();
/* @var $object kDBList */
/*if (!$this->Application->IsAdmin()) {
// don't show categories visible in menu as sub-categories
$object->addFilter('system_categories', '%1$s.IsMenu = 0');
}*/
// show system templates from current theme only + all virtual templates
$object->addFilter('theme_filter', '%1$s.ThemeId = ' . $this->_getCurrentThemeId() . ' OR %1$s.ThemeId = 0');
if ($event->Special == 'showall') {
// if using recycle bin don't show categories from there
$recycle_bin = $this->Application->ConfigValue('RecycleBinFolder');
if ($recycle_bin) {
$sql = 'SELECT TreeLeft, TreeRight
FROM '.TABLE_PREFIX.'Category
WHERE CategoryId = '.$recycle_bin;
$tree_indexes = $this->Conn->GetRow($sql);
$object->addFilter('recyclebin_filter', '%1$s.TreeLeft < '.$tree_indexes['TreeLeft'].' OR %1$s.TreeLeft > '.$tree_indexes['TreeRight']);
}
}
if ($event->getEventParam('parent_cat_id') !== false) {
$parent_cat_id = $event->getEventParam('parent_cat_id');
if ("$parent_cat_id" == 'Root') {
$module_name = $event->getEventParam('module') ? $event->getEventParam('module') : 'In-Commerce';
$parent_cat_id = $this->Application->findModule('Name', $module_name, 'RootCat');
}
}
else {
$parent_cat_id = $this->Application->GetVar('c_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
if (!$parent_cat_id) {
$parent_cat_id = 0;
}
}
if ("$parent_cat_id" != 'any') {
if ($event->getEventParam('recursive')) {
if ($parent_cat_id > 0) {
// not "Home" category
$tree_indexes = $this->Application->getTreeIndex($parent_cat_id);
$object->addFilter('parent_filter', TABLE_PREFIX.'Category.TreeLeft BETWEEN '.$tree_indexes['TreeLeft'].' AND '.$tree_indexes['TreeRight']);
}
}
else {
$object->addFilter('parent_filter', 'ParentId = '.$parent_cat_id);
}
}
$object->addFilter('perm_filter', 'PermId = 1'); // check for CATEGORY.VIEW permission
if ($this->Application->RecallVar('user_id') != -1) {
// apply permission filters to all users except "root"
$groups = explode(',',$this->Application->RecallVar('UserGroups'));
foreach ($groups as $group) {
$view_filters[] = 'FIND_IN_SET('.$group.', acl)';
}
$view_filter = implode(' OR ', $view_filters);
$object->addFilter('perm_filter2', $view_filter);
}
if (!$this->Application->IsAdmin()) {
// apply status filter only on front
$object->addFilter('status_filter', $object->TableName.'.Status = 1');
}
// process "types" and "except" parameters
$type_clauses = Array();
$types = $event->getEventParam('types');
$types = $types ? explode(',', $types) : Array ();
$except_types = $event->getEventParam('except');
$except_types = $except_types ? explode(',', $except_types) : Array ();
if (in_array('related', $types) || in_array('related', $except_types)) {
$related_to = $event->getEventParam('related_to');
if (!$related_to) {
$related_prefix = $event->Prefix;
}
else {
$sql = 'SELECT Prefix
FROM '.TABLE_PREFIX.'ItemTypes
WHERE ItemName = '.$this->Conn->qstr($related_to);
$related_prefix = $this->Conn->GetOne($sql);
}
$rel_table = $this->Application->getUnitOption('rel', 'TableName');
$item_type = (int)$this->Application->getUnitOption($event->Prefix, 'ItemType');
if ($item_type == 0) {
trigger_error('<strong>ItemType</strong> not defined for prefix <strong>' . $event->Prefix . '</strong>', E_USER_WARNING);
}
// process case, then this list is called inside another list
$prefix_special = $event->getEventParam('PrefixSpecial');
if (!$prefix_special) {
$prefix_special = $this->Application->Parser->GetParam('PrefixSpecial');
}
$id = false;
if ($prefix_special !== false) {
$processed_prefix = $this->Application->processPrefix($prefix_special);
if ($processed_prefix['prefix'] == $related_prefix) {
// printing related categories within list of items (not on details page)
$list =& $this->Application->recallObject($prefix_special);
/* @var $list kDBList */
$id = $list->GetID();
}
}
if ($id === false) {
// printing related categories for single item (possibly on details page)
if ($related_prefix == 'c') {
$id = $this->Application->GetVar('m_cat_id');
}
else {
$id = $this->Application->GetVar($related_prefix . '_id');
}
}
$p_item =& $this->Application->recallObject($related_prefix . '.current', null, Array('skip_autoload' => true));
$p_item->Load( (int)$id );
$p_resource_id = $p_item->GetDBField('ResourceId');
$sql = 'SELECT SourceId, TargetId FROM '.$rel_table.'
WHERE
(Enabled = 1)
AND (
(Type = 0 AND SourceId = '.$p_resource_id.' AND TargetType = '.$item_type.')
OR
(Type = 1
AND (
(SourceId = '.$p_resource_id.' AND TargetType = '.$item_type.')
OR
(TargetId = '.$p_resource_id.' AND SourceType = '.$item_type.')
)
)
)';
$related_ids_array = $this->Conn->Query($sql);
$related_ids = Array();
foreach ($related_ids_array as $key => $record) {
$related_ids[] = $record[ $record['SourceId'] == $p_resource_id ? 'TargetId' : 'SourceId' ];
}
if (count($related_ids) > 0) {
$type_clauses['related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_ids).')';
$type_clauses['related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_ids).')';
}
else {
$type_clauses['related']['include'] = '0';
$type_clauses['related']['except'] = '1';
}
$type_clauses['related']['having_filter'] = false;
}
if (in_array('category_related', $type_clauses)) {
$object->removeFilter('parent_filter');
$resource_id = $this->Conn->GetOne('
SELECT ResourceId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
WHERE CategoryId = '.$parent_cat_id
);
$sql = 'SELECT DISTINCT(TargetId) FROM '.TABLE_PREFIX.'Relationship
WHERE SourceId = '.$resource_id.' AND SourceType = 1';
$related_cats = $this->Conn->GetCol($sql);
$related_cats = is_array($related_cats) ? $related_cats : Array();
$sql = 'SELECT DISTINCT(SourceId) FROM '.TABLE_PREFIX.'Relationship
WHERE TargetId = '.$resource_id.' AND TargetType = 1 AND Type = 1';
$related_cats2 = $this->Conn->GetCol($sql);
$related_cats2 = is_array($related_cats2) ? $related_cats2 : Array();
$related_cats = array_unique( array_merge( $related_cats2, $related_cats ) );
if ($related_cats) {
$type_clauses['category_related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_cats).')';
$type_clauses['category_related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_cats).')';
}
else
{
$type_clauses['category_related']['include'] = '0';
$type_clauses['category_related']['except'] = '1';
}
$type_clauses['category_related']['having_filter'] = false;
}
if (in_array('product_related', $types)) {
$object->removeFilter('parent_filter');
$product_id = $event->getEventParam('product_id') ? $event->getEventParam('product_id') : $this->Application->GetVar('p_id');
$resource_id = $this->Conn->GetOne('
SELECT ResourceId FROM '.$this->Application->getUnitOption('p', 'TableName').'
WHERE ProductId = '.$product_id
);
$sql = 'SELECT DISTINCT(TargetId) FROM '.TABLE_PREFIX.'Relationship
WHERE SourceId = '.$resource_id.' AND TargetType = 1';
$related_cats = $this->Conn->GetCol($sql);
$related_cats = is_array($related_cats) ? $related_cats : Array();
$sql = 'SELECT DISTINCT(SourceId) FROM '.TABLE_PREFIX.'Relationship
WHERE TargetId = '.$resource_id.' AND SourceType = 1 AND Type = 1';
$related_cats2 = $this->Conn->GetCol($sql);
$related_cats2 = is_array($related_cats2) ? $related_cats2 : Array();
$related_cats = array_unique( array_merge( $related_cats2, $related_cats ) );
if ($related_cats) {
$type_clauses['product_related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_cats).')';
$type_clauses['product_related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_cats).')';
}
else {
$type_clauses['product_related']['include'] = '0';
$type_clauses['product_related']['except'] = '1';
}
$type_clauses['product_related']['having_filter'] = false;
}
$type_clauses['menu']['include'] = '%1$s.IsMenu = 1';
$type_clauses['menu']['except'] = '%1$s.IsMenu = 0';
$search_helper =& $this->Application->recallObject('SearchHelper');
/* @var $search_helper kSearchHelper */
$search_helper->SetComplexFilter($event, $type_clauses, implode(',', $types), implode(',', $except_types));
}
/**
* Returns current theme id
*
* @return int
*/
function _getCurrentThemeId()
{
$themes_helper =& $this->Application->recallObject('ThemesHelper');
/* @var $themes_helper kThemesHelper */
return $themes_helper->getCurrentThemeId();
}
/**
* Enter description here...
*
* @param kEvent $event
* @return int
*/
function getPassedID(&$event)
{
static $page_by_template = Array ();
if ($event->Special == 'current') {
return $this->Application->GetVar('m_cat_id');
}
$event->setEventParam('raise_warnings', 0);
$page_id = parent::getPassedID($event);
if ($page_id === false) {
$template = $event->getEventParam('page');
if (!$template) {
$template = $this->Application->GetVar('t');
}
// bug: when template contains "-" symbols (or others, that stripDisallowed will remplace) it's not found
if (!array_key_exists($template, $page_by_template)) {
$sql = 'SELECT ' . $this->Application->getUnitOption($event->Prefix, 'IDField') . '
FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . '
WHERE
(
(NamedParentPath = ' . $this->Conn->qstr($template) . ') OR
(NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR
(IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ')
) AND (ThemeId = ' . $this->_getCurrentThemeId() . ' OR ThemeId = 0)';
$page_id = $this->Conn->GetOne($sql);
}
else {
$page_id = $page_by_template[$template];
}
if ($page_id === false && EDITING_MODE) {
// create missing pages, when in editing mode
$object =& $this->Application->recallObject($this->Prefix . '.-new', null, Array('skip_autoload' => true));
/* @var $object kDBItem */
$this->_prepareAutoPage($object, $template); // create virtual page
if ($this->Application->ConfigValue('QuickCategoryPermissionRebuild') || !$this->Application->IsAdmin()) {
$updater =& $this->Application->recallObject('kPermCacheUpdater');
/* @var $updater kPermCacheUpdater */
$updater->OneStepRun();
}
$event->CallSubEvent('OnResetMenuCache');
$this->Application->RemoveVar('PermCache_UpdateRequired');
$page_id = $object->GetID();
$this->Application->SetVar('m_cat_id', $page_id);
}
if ($page_id) {
$page_by_template[$template] = $page_id;
}
}
if (!$page_id && !$this->Application->IsAdmin()) {
$page_id = $this->Application->GetVar('m_cat_id');
}
return $page_id;
}
function ParentGetPassedId(&$event)
{
return parent::GetPassedId($event);
}
/**
* Adds calculates fields for item statuses
*
* @param kCatDBItem $object
* @param kEvent $event
*/
function prepareObject(&$object, &$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->addCalculatedField(
'IsNew',
' IF(%1$s.NewItem = 2,
IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - '.
$this->Application->ConfigValue('Category_DaysNew').
'*3600*24), 1, 0),
%1$s.NewItem
)');
}
/**
* Set correct parent path for newly created categories
*
* @param kEvent $event
*/
function OnAfterCopyToLive(&$event)
{
$parent_path = false;
$object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true, 'live_table' => true));
$object->Load($event->getEventParam('id'));
if ($event->getEventParam('temp_id') == 0) {
if ($object->isLoaded()) {
// update path only for real categories (not including "Home" root category)
$fields_hash = Array('ParentPath' => $object->buildParentPath());
$this->Conn->doUpdate($fields_hash, $object->TableName, 'CategoryId = '.$object->GetID());
$parent_path = $fields_hash['ParentPath'];
}
}
else {
$parent_path = $object->GetDBField('ParentPath');
}
if ($parent_path) {
$cache_updater =& $this->Application->recallObject('kPermCacheUpdater', null, array('strict_path' => $parent_path));
$cache_updater->OneStepRun();
$cache_updater->StrictPath = false;
}
}
/**
* Set cache modification mark if needed
*
* @param kEvent $event
*/
function OnBeforeDeleteFromLive(&$event)
{
$id = $event->getEventParam('id');
// loding anyway, because this object is needed by "c-perm:OnBeforeDeleteFromLive" event
$temp_object =& $event->getObject( Array('skip_autoload' => true) );
$temp_object->Load($id);
if ($id == 0) {
if ($temp_object->isLoaded()) {
// new category -> update cache (not loaded when "Home" category)
$this->Application->StoreVar('PermCache_UpdateRequired', 1);
}
return ;
}
// existing category was edited, check if in-cache fields are modified
$live_object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('live_table' => true, 'skip_autoload' => true));
$live_object->Load($id);
$cached_fields = Array('Name', 'Filename', 'Template', 'ParentId', 'Priority');
foreach ($cached_fields as $cached_field) {
if ($live_object->GetDBField($cached_field) != $temp_object->GetDBField($cached_field)) {
// use session instead of REQUEST because of permission editing in category can contain
// multiple submits, that changes data before OnSave event occurs
$this->Application->StoreVar('PermCache_UpdateRequired', 1);
break;
}
}
}
/**
* Calls kDBEventHandler::OnSave original event
* Used in proj-cms:StructureEventHandler->OnSave
*
* @param kEvent $event
*/
function parentOnSave(&$event)
{
parent::OnSave($event);
}
/**
* Reset root-category flag when new category is created
*
* @param kEvent $event
*/
function OnPreCreate(&$event)
{
// 1. for permission editing of Home category
$this->Application->RemoveVar('IsRootCategory_' . $this->Application->GetVar('m_wid'));
parent::OnPreCreate($event);
$object =& $event->getObject();
// 2. preset template
// $object->SetDBField('Template', $this->_getDefaultDesign());
$priority_helper =& $this->Application->recallObject('PriorityHelper');
/* @var $priority_helper kPriorityHelper */
// 3. prepare priorities dropdown
$category_id = $this->Application->GetVar('m_cat_id');
$priority_helper->preparePriorities($event, true, 'ParentId = ' . $category_id);
}
/**
* Checks cache update mark and redirect to cache if needed
*
* @param kEvent $event
*/
function OnSave(&$event)
{
$object =& $event->getObject();
if ($object->IsRoot()) {
$event->setEventParam('master_ids', Array(0));
$this->RemoveRequiredFields($object);
}
parent::OnSave($event);
if ($event->status != erSUCCESS) {
return ;
}
// 1. update priorities
$tmp = $this->Application->RecallVar('priority_changes'.$this->Application->GetVar('m_wid'));
$changes = $tmp ? unserialize($tmp) : Array ();
$changed_ids = array_keys($changes);
$priority_helper =& $this->Application->recallObject('PriorityHelper');
/* @var $priority_helper kPriorityHelper */
$priority_helper->updatePriorities($event, $changes, Array (0 => $event->getEventParam('ids')));
if ($this->Application->RecallVar('PermCache_UpdateRequired')) {
if ($this->Application->ConfigValue('QuickCategoryPermissionRebuild')) {
$updater =& $this->Application->recallObject('kPermCacheUpdater');
/* @var $updater kPermCacheUpdater */
$updater->OneStepRun();
}
else {
// "catalog" should be in opener stack by now
$wid = $this->Application->GetVar('m_wid');
$stack_name = rtrim('opener_stack_'.$wid, '_');
$this->Application->RemoveVar('IsRootCategory_'.$wid);
$opener_stack = unserialize($this->Application->RecallVar($stack_name));
$opener_stack[0] = str_replace('catalog/catalog', 'categories/cache_updater', $opener_stack[0]);
$this->Application->StoreVar($stack_name, serialize($opener_stack));
}
$this->Application->RemoveVar('PermCache_UpdateRequired');
}
$this->Application->StoreVar('RefreshStructureTree', 1);
$event->CallSubEvent('OnResetMenuCache');
}
/**
* Creates a new item in temp table and
* stores item id in App vars and Session on succsess
*
* @param kEvent $event
*/
function OnPreSaveCreated(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
/* @var $object CategoriesItem */
if ($object->IsRoot()) {
// don't create root category while saving permissions
return ;
}
$priority_helper =& $this->Application->recallObject('PriorityHelper');
/* @var $priority_helper kPriorityHelper */
$category_id = $this->Application->GetVar('m_cat_id');
$priority_helper->preparePriorities($event, true, 'ParentId = ' . $category_id);
parent::OnPreSaveCreated($event);
}
/**
* Deletes sym link to other category
*
* @param kEvent $event
*/
function OnAfterItemDelete(&$event)
{
parent::OnAfterItemDelete($event);
$object =& $event->getObject();
/* @var $object kDBItem */
$sql = 'UPDATE '.$object->TableName.'
SET SymLinkCategoryId = NULL
WHERE SymLinkCategoryId = '.$object->GetID();
$this->Conn->Query($sql);
}
/**
* Exclude root categories from deleting
*
* @param kEvent $event
*/
function customProcessing(&$event, $type)
{
if ($event->Name == 'OnMassDelete' && $type == 'before') {
$ids = $event->getEventParam('ids');
if (!$ids || $this->Application->ConfigValue('AllowDeleteRootCats')) {
return ;
}
// get module root categories and exclude them
foreach ($this->Application->ModuleInfo as $module_info) {
$root_categories[] = $module_info['RootCat'];
}
$root_categories = array_unique($root_categories);
if ($root_categories && array_intersect($ids, $root_categories)) {
$event->setEventParam('ids', array_diff($ids, $root_categories));
$this->Application->StoreVar('root_delete_error', 1);
}
}
$change_events = Array ('OnPreSave', 'OnPreSaveCreated', 'OnUpdate', 'OnSave');
if ($type == 'after' && in_array($event->Name, $change_events)) {
$object =& $event->getObject();
$tmp = $this->Application->RecallVar('priority_changes'.$this->Application->GetVar('m_wid'));
$changes = $tmp ? unserialize($tmp) : array();
if (!isset($changes[$object->GetID()])) {
$changes[$object->GetId()]['old'] = $object->GetID() == 0 ? 'new' : $object->GetDBField('OldPriority');
}
if ($changes[$object->GetId()]['old'] == $object->GetDBField('Priority')) return ;
$changes[$object->GetId()]['new'] = $object->GetDBField('Priority');
$changes[$object->GetId()]['parent'] = $object->GetDBField('ParentId');
$this->Application->StoreVar('priority_changes'.$this->Application->GetVar('m_wid'), serialize($changes));
}
}
/**
* Checks, that given template exists (physically) in given theme
*
* @param string $template
* @param int $theme_id
* @return bool
*/
function _templateFound($template, $theme_id = null)
{
if (!defined('DBG_NPARSER_FORCE_COMPILE')) {
$this->Application->InitParser();
define('DBG_NPARSER_FORCE_COMPILE', 1);
}
if (!isset($theme_id)) {
$theme_id = $this->_getCurrentThemeId();
}
$theme_name = $this->_getThemeName($theme_id);
return $this->Application->TemplatesCache->TemplateExists('theme:' . $theme_name . '/' . $template);
}
/**
* Removes ".tpl" in template path
*
* @param string $template
* @return string
*/
function _stripTemplateExtension($template)
{
// return preg_replace('/\.[^.\\\\\\/]*$/', '', $template);
return preg_replace('/^[\\/]{0,1}(.*)\.tpl$/', "$1", $template);
}
/**
* 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;
}
$ids = $this->StoreSelectedIDs($event);
$to_delete = array();
if ($recycle_bin = $this->Application->ConfigValue('RecycleBinFolder')) {
$rb =& $this->Application->recallObject('c.recycle', null, Array ('skip_autoload' => true));
$rb->Load($recycle_bin);
$cat =& $event->getObject(Array('skip_autoload' => true));
foreach ($ids as $id) {
$cat->Load($id);
if (preg_match('/^'.preg_quote($rb->GetDBField('ParentPath'),'/').'/', $cat->GetDBField('ParentPath'))) {
$to_delete[] = $id;
continue;
}
$cat->SetDBField('ParentId', $recycle_bin);
$cat->Update();
}
$ids = $to_delete;
$event->redirect = 'categories/cache_updater';
}
$event->setEventParam('ids', $ids);
$this->customProcessing($event, 'before');
$ids = $event->getEventParam('ids');
if ($ids) {
$recursive_helper =& $this->Application->recallObject('RecursiveHelper');
/* @var $recursive_helper kRecursiveHelper */
foreach ($ids as $id) {
$recursive_helper->DeleteCategory($id, $event->Prefix);
}
}
$this->clearSelectedIDs($event);
// update priorities
$priority_helper =& $this->Application->recallObject('PriorityHelper');
/* @var $priority_helper kPriorityHelper */
// after deleting categories, all priorities should be recalculated
$parent_id = $this->Application->GetVar('m_cat_id');
$priority_helper->recalculatePriorities($event, 'ParentId = ' . $parent_id);
$this->Application->StoreVar('RefreshStructureTree', 1);
$event->CallSubEvent('OnResetMenuCache');
}
/**
* Add selected items to clipboard with mode = COPY (CLONE)
*
* @param kEvent $event
*/
function OnCopy(&$event)
{
$this->Application->RemoveVar('clipboard');
$clipboard_helper =& $this->Application->recallObject('ClipboardHelper');
$clipboard_helper->setClipboard($event, 'copy', $this->StoreSelectedIDs($event));
$this->clearSelectedIDs($event);
}
/**
* Add selected items to clipboard with mode = CUT
*
* @param kEvent $event
*/
function OnCut(&$event)
{
$this->Application->RemoveVar('clipboard');
$clipboard_helper =& $this->Application->recallObject('ClipboardHelper');
$clipboard_helper->setClipboard($event, 'cut', $this->StoreSelectedIDs($event));
$this->clearSelectedIDs($event);
}
/**
* Controls all item paste operations. Can occur only with filled clipbord.
*
* @param kEvent $event
*/
function OnPasteClipboard(&$event)
{
$clipboard = unserialize( $this->Application->RecallVar('clipboard') );
foreach ($clipboard as $prefix => $clipboard_data) {
$paste_event = new kEvent($prefix.':OnPaste', Array('clipboard_data' => $clipboard_data));
$this->Application->HandleEvent($paste_event);
$event->redirect = $paste_event->redirect;
$event->redirect_params = $paste_event->redirect_params;
$event->status = $paste_event->status;
}
}
/**
* Paste categories with subitems from clipboard
*
* @param kEvent $event
*/
function OnPaste(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$clipboard_data = $event->getEventParam('clipboard_data');
if (!$clipboard_data['cut'] && !$clipboard_data['copy']) {
return false;
}
// 1. get ParentId of moved category(-es) before it gets updated!!!)
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
if ($clipboard_data['cut']) {
$sql = 'SELECT ParentId
FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . '
WHERE ' . $id_field . ' = ' . $clipboard_data['cut'][0];
$source_category_id = $this->Conn->GetOne($sql);
}
$recursive_helper =& $this->Application->recallObject('RecursiveHelper');
/* @var $recursive_helper kRecursiveHelper */
if ($clipboard_data['cut']) {
$recursive_helper->MoveCategories($clipboard_data['cut'], $this->Application->GetVar('m_cat_id'));
}
if ($clipboard_data['copy']) {
foreach ($clipboard_data['copy'] as $id) {
$recursive_helper->PasteCategory($id, $event->Prefix);
}
}
$priority_helper =& $this->Application->recallObject('PriorityHelper');
/* @var $priority_helper kPriorityHelper */
if ($clipboard_data['cut']) {
$priority_helper->recalculatePriorities($event, 'ParentId = '.$source_category_id);
}
// recalculate priorities of newly pasted categories in destination category
$parent_id = $this->Application->GetVar('m_cat_id');
$priority_helper->recalculatePriorities($event, 'ParentId = ' . $parent_id);
if ($clipboard_data['cut'] || $clipboard_data['copy']) {
// rebuild with progress bar
if ($this->Application->ConfigValue('QuickCategoryPermissionRebuild')) {
$updater =& $this->Application->recallObject('kPermCacheUpdater');
/* @var $updater kPermCacheUpdater */
$updater->OneStepRun();
}
else {
$event->redirect = 'categories/cache_updater';
}
$event->CallSubEvent('OnResetMenuCache');
$this->Application->StoreVar('RefreshStructureTree', 1);
}
}
/**
* Occurs when pasting category
*
* @param kEvent $event
*/
/*function OnCatPaste(&$event)
{
$inp_clipboard = $this->Application->RecallVar('ClipBoard');
$inp_clipboard = explode('-', $inp_clipboard, 2);
if($inp_clipboard[0] == 'COPY')
{
$saved_cat_id = $this->Application->GetVar('m_cat_id');
$cat_ids = $event->getEventParam('cat_ids');
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table = $this->Application->getUnitOption($event->Prefix, 'TableName');
$ids_sql = 'SELECT '.$id_field.' FROM '.$table.' WHERE ResourceId IN (%s)';
$resource_ids_sql = 'SELECT ItemResourceId FROM '.TABLE_PREFIX.'CategoryItems WHERE CategoryId = %s AND PrimaryCat = 1';
$object =& $this->Application->recallObject($event->Prefix.'.item', $event->Prefix, Array('skip_autoload' => true));
foreach($cat_ids as $source_cat => $dest_cat)
{
$item_resource_ids = $this->Conn->GetCol( sprintf($resource_ids_sql, $source_cat) );
if(!$item_resource_ids) continue;
$this->Application->SetVar('m_cat_id', $dest_cat);
$item_ids = $this->Conn->GetCol( sprintf($ids_sql, implode(',', $item_resource_ids) ) );
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
if($item_ids) $temp->CloneItems($event->Prefix, $event->Special, $item_ids);
}
$this->Application->SetVar('m_cat_id', $saved_cat_id);
}
}*/
/**
* Cleares clipboard content
*
* @param kEvent $event
*/
function OnClearClipboard(&$event)
{
$this->Application->RemoveVar('clipboard');
}
/**
* Sets correct status for new categories created on front-end
*
* @param kEvent $event
*/
function OnBeforeItemCreate(&$event)
{
$this->_beforeItemChange($event);
if ($this->Application->IsAdmin() || $event->Prefix == 'st') {
// don't check category permissions when auto-creating structure pages
return ;
}
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
$new_status = false;
$category_id = $this->Application->GetVar('m_cat_id');
if ($perm_helper->CheckPermission('CATEGORY.ADD', 0, $category_id)) {
$new_status = STATUS_ACTIVE;
}
else if ($perm_helper->CheckPermission('CATEGORY.ADD.PENDING', 0, $category_id)) {
$new_status = STATUS_PENDING;
}
if ($new_status) {
$object =& $event->getObject();
/* @var $object kDBItem */
$object->SetDBField('Status', $new_status);
}
else {
$event->status = erPERM_FAIL;
return ;
}
}
/**
* Sets correct status for new categories created on front-end
*
* @param kEvent $event
*/
function OnBeforeItemUpdate(&$event)
{
parent::OnBeforeItemUpdate($event);
$this->_beforeItemChange($event);
}
/**
* Performs redirect to correct suggest confirmation template
*
* @param kEvent $event
*/
function OnCreate(&$event)
{
parent::OnCreate($event);
if ($this->Application->IsAdmin() || $event->status != erSUCCESS) {
return ;
}
$object =& $event->getObject();
$cache_updater =& $this->Application->recallObject('kPermCacheUpdater', null, array('strict_path' => $object->GetDBField('ParentPath')));
$cache_updater->OneStepRun();
$cache_updater->StrictPath = false;
$is_active = ($object->GetDBField('Status') == STATUS_ACTIVE);
$next_template = $is_active ? 'suggest_confirm_template' : 'suggest_pending_confirm_template';
$event->redirect = $this->Application->GetVar($next_template);
$event->SetRedirectParam('opener', 's');
// send email events
$perm_prefix = $this->Application->getUnitOption($event->Prefix, 'PermItemPrefix');
$event_suffix = $is_active ? 'ADD' : 'ADD.PENDING';
$this->Application->EmailEventAdmin($perm_prefix.'.'.$event_suffix);
$this->Application->EmailEventUser($perm_prefix.'.'.$event_suffix, $object->GetDBField('CreatedById'));
}
/**
* Returns current per-page setting for list
*
* @param kEvent $event
* @return int
*/
function getPerPage(&$event)
{
if (!$this->Application->IsAdmin()) {
$event->setEventParam('same_special', true);
}
return parent::getPerPage($event);
}
/**
* Set's correct page for list
* based on data provided with event
*
* @param kEvent $event
* @access private
* @see OnListBuild
*/
function SetPagination(&$event)
{
parent::SetPagination($event);
if (!$this->Application->IsAdmin()) {
$page_var = $event->getEventParam('page_var');
if ($page_var !== false) {
$page = $this->Application->GetVar($page_var);
if (is_numeric($page)) {
$object =& $event->getObject();
$object->SetPage($page);
}
}
}
}
/**
* Apply same processing to each item beeing selected in grid
*
* @param kEvent $event
* @access private
*/
function iterateItems(&$event)
{
if ($event->Name != 'OnMassApprove' && $event->Name != 'OnMassDecline') {
return parent::iterateItems($event);
}
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$object =& $event->getObject( Array('skip_autoload' => true) );
$ids = $this->StoreSelectedIDs($event);
if ($ids) {
$status_field = array_shift( $this->Application->getUnitOption($event->Prefix,'StatusField') );
foreach ($ids as $id) {
$object->Load($id);
switch ($event->Name) {
case 'OnMassApprove':
$object->SetDBField($status_field, 1);
break;
case 'OnMassDecline':
$object->SetDBField($status_field, 0);
break;
}
if ($this->Application->GetVar('propagate_category_status')) {
$sql = 'UPDATE '.$object->TableName.'
SET '.$status_field.' = '.$object->GetDBField('Status').'
WHERE TreeLeft BETWEEN '.$object->GetDBField('TreeLeft').' AND '.$object->GetDBField('TreeRight');
$this->Conn->Query($sql);
}
if ($object->Update()) {
$event->status = erSUCCESS;
}
else {
$event->status = erFAIL;
$event->redirect = false;
break;
}
}
}
$this->clearSelectedIDs($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 || $object->GetDBField($status_field) == 4;
}
return true;
}
// ============= for cms page processing =======================
/**
* Returns default design template
*
* @return string
*/
function _getDefaultDesign()
{
$default_design = $this->Application->ConfigValue('cms_DefaultDesign');
return '/' . trim($default_design ? $default_design : 'designs/default_design', '/');
}
/**
* Returns default design based on given virtual template (used from kApplication::Run)
*
* @return string
*/
function GetDesignTemplate($t = null)
{
if (!isset($t)) {
$t = $this->Application->GetVar('t');
}
$page =& $this->Application->recallObject($this->Prefix . '.-virtual', null, Array ('page' => $t));
if($page->isLoaded()) {
$real_t = $page->GetDBField('CachedTemplate');
$this->Application->SetVar('m_cat_id', $page->GetDBField('CategoryId') );
if ($page->GetDBField('FormId')) {
$this->Application->SetVar('form_id', $page->GetDBField('FormId'));
}
}
else {
$real_t = $this->_getDefaultDesign();
}
// $this->Application->SetVar('t', $t);
return $real_t;
}
/**
* Sets category id based on found template (used from kApplication::Run)
*
* @deprecated
*/
/*function SetCatByTemplate()
{
$t = $this->Application->GetVar('t');
$page =& $this->Application->recallObject($this->Prefix . '.-virtual');
if ($page->isLoaded()) {
$this->Application->SetVar('m_cat_id', $page->GetDBField('CategoryId') );
}
}*/
/**
* Prepares template paths
*
* @param kEvent $event
*/
function _beforeItemChange(&$event)
{
$object =& $event->getObject();
/* @var $object kDBItem */
$object->SetDBField('Template', $this->_stripTemplateExtension( $object->GetDBField('Template') ));
if ($object->GetDBField('IsSystem') == 1) {
if (!$this->_templateFound($object->GetDBField('Template'), $object->GetDBField('ThemeId'))) {
$object->SetError('Template', 'template_file_missing', 'la_err_TemplateFileMissing');
}
}
$this->_saveTitleField($object, 'Title');
$this->_saveTitleField($object, 'MenuTitle');
}
/**
* Sets page name to requested field in case when:
* 1. page was auto created (through theme file rebuld)
* 2. requested field is emtpy
*
* @param kDBItem $object
* @param string $field
* @author Alex
*/
function _saveTitleField(&$object, $field)
{
$value = $object->GetField($field);
if ($value == '' || preg_match('/^_Auto: (.*)/', $value)) {
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
/* @var $ml_formatter kMultiLanguage */
$object->SetField(
$ml_formatter->LangFieldName($field),
$object->GetField( $ml_formatter->LangFieldName('Name') )
);
}
}
/**
* Don't allow to delete system pages, when not in debug mode
*
* @param kEvent $event
*/
function OnBeforeItemDelete(&$event)
{
$object =& $event->getObject();
if ($object->GetDBField('IsSystem') && !$this->Application->isDebugMode()) {
$event->status = erFAIL;
}
}
/**
* Enter description here...
*
* @param StructureItem $object
* @param string $template
*/
function _prepareAutoPage(&$object, $template, $theme_id = null, $system_mode = SMS_MODE_AUTO)
{
$template = $this->_stripTemplateExtension($template);
if ($system_mode == SMS_MODE_AUTO) {
$system = $this->_templateFound($template, $theme_id) ? 1 : 0;
}
else {
$system = $system_mode == SMS_MODE_FORCE ? 1 : 0;
}
if (!isset($theme_id)) {
$theme_id = $this->_getCurrentThemeId();
}
$root_category = $this->Application->findModule('Name', 'Proj-CMS', 'RootCat');
$page_category = $this->Application->GetVar('m_cat_id');
if (!$page_category) {
$page_category = $root_category;
$this->Application->SetVar('m_cat_id', $page_category);
}
if (!$system && strpos($template, '/') !== false) {
// virtual page, but have "/" in template path -> create it's path
$category_path = explode('/', $template);
$template = array_pop($category_path);
$page_category = $this->_getParentCategoryFromPath($category_path, $root_category, $theme_id);
}
$page_name = $system ? '_Auto: ' . $template : $template;
$page_description = '';
if ($system) {
$design_template = strtolower($template); // leading "/" not added !
$template_info = $this->_getTemplateInfo($design_template, $theme_id);
if ($template_info) {
if (array_key_exists('name', $template_info) && $template_info['name']) {
$page_name = $template_info['name'];
}
if (array_key_exists('desc', $template_info) && $template_info['desc']) {
$page_description = $template_info['desc'];
}
if (array_key_exists('section', $template_info) && $template_info['section']) {
// this will override any global "m_cat_id"
$page_category = $this->_getParentCategoryFromPath(explode('||', $template_info['section']), $root_category, $theme_id);
}
}
}
else {
$design_template = $this->_getDefaultDesign(); // leading "/" added !
}
// put all templates to then end of list (in their category)
$sql = 'SELECT MIN(Priority)
FROM ' . $object->TableName . '
WHERE ParentId = ' . $page_category;
$min_priority = (int)$this->Conn->GetOne($sql);
$object->Clear();
$object->SetDBField('ParentId', $page_category);
$object->SetDBField('IsSystem', $system);
// system templates don't build their NamedParentPath based on their location because they are all added under
// "Content" when theme file structure is rebuilded and for ex. file "in-edit/designs/general" will have filename
// (after stripDisallowed) like "in_edit_designs_general" witch is less readable like "in-edit/designs/general"
// as for now.
// TODO: 1. make system template NamedParentPath dependent on their location in structure.
// 2. load cms-page not only by NamedParentPath, but also by 'OR (Template = "$template" AND IsSystem = 1)'
// This way we can store CMS-blocks based on system template name on HDD no matter where it's location is
// and we can address him from template using his system path OR structure path (CMS-blocks should work too).
$object->SetDBField('IsMenu', 0);
$object->SetDBField('ThemeId', $system ? $theme_id : 0);
$object->SetDBField('Priority', $min_priority - 1);
$object->SetDBField('Template', $design_template);
$object->SetDBField('CachedTemplate', $design_template);
$primary_language = $this->Application->GetDefaultLanguageId();
$current_language = $this->Application->GetVar('m_lang');
$object->SetDBField('l' . $primary_language . '_Name', $page_name);
$object->SetDBField('l' . $current_language . '_Name', $page_name);
$object->SetDBField('l' . $primary_language . '_Description', $page_description);
$object->SetDBField('l' . $current_language . '_Description', $page_description);
return $object->Create();
}
function _getParentCategoryFromPath($category_path, $base_category, $theme_id = null)
{
static $category_ids = Array ();
if (!$category_path) {
return $base_category;
}
if (array_key_exists(implode('||', $category_path), $category_ids)) {
return $category_ids[ implode('||', $category_path) ];
}
$backup_category_id = $this->Application->GetVar('m_cat_id');
$object =& $this->Application->recallObject($this->Prefix . '.-item', null, Array ('skip_autoload' => true));
/* @var $object kDBItem */
$parent_id = $base_category;
$filenames_helper =& $this->Application->recallObject('FilenamesHelper');
/* @var $filenames_helper kFilenamesHelper */
$safe_category_path = array_map(Array (&$filenames_helper, 'replaceSequences'), $category_path);
foreach ($category_path as $category_order => $category_name) {
$this->Application->SetVar('m_cat_id', $parent_id);
// get virtual category first, when possible
$sql = 'SELECT ' . $object->IDField . '
FROM ' . $object->TableName . '
WHERE
(
Filename = ' . $this->Conn->qstr($safe_category_path[$category_order]) . ' OR
Filename = ' . $this->Conn->qstr( $filenames_helper->replaceSequences('_Auto: ' . $category_name) ) . '
) AND
(ParentId = ' . $parent_id . ') AND
(ThemeId = 0 OR ThemeId = ' . $theme_id . ')
ORDER BY ThemeId ASC';
$parent_id = $this->Conn->GetOne($sql);
if ($parent_id === false) {
// page not found
$template = implode('/', array_slice($safe_category_path, 0, $category_order + 1));
// don't process system templates in sub-categories
$system = $this->_templateFound($template, $theme_id) && (strpos($template, '/') === false);
if (!$this->_prepareAutoPage($object, $category_name, $theme_id, $system ? SMS_MODE_FORCE : false)) {
// page was not created
break;
}
$parent_id = $object->GetID();
}
}
$this->Application->SetVar('m_cat_id', $backup_category_id);
$category_ids[ implode('||', $category_path) ] = $parent_id;
return $parent_id;
}
/**
* Returns template information (name, description, path) from it's header comment
*
* @param string $template
* @param int $theme_id
* @return Array
*/
function _getTemplateInfo($template, $theme_id = null)
{
if (!defined('DBG_NPARSER_FORCE_COMPILE')) {
$this->Application->InitParser();
define('DBG_NPARSER_FORCE_COMPILE', 1);
}
if (!isset($theme_id)) {
$theme_id = $this->_getCurrentThemeId();
}
$template = 'theme:' . $this->_getThemeName($theme_id) . '/' . $template;
$template_file = $this->Application->TemplatesCache->GetRealFilename($template) . '.tpl';
if (!file_exists($template_file)) {
// when template without info it's placed in top category
return Array ();
}
$template_data = file_get_contents($template_file);
if (substr($template_data, 0, 6) == '<!--##') {
// template starts with comment in such format
/*<!--##
<NAME></NAME>
<DESC></DESC>
<SECTION>||</SECTION>
##-->*/
$comment_end = strpos($template_data, '##-->');
if ($comment_end === false) {
// badly formatted comment
return Array ();
}
$comment = trim( substr($template_data, 6, $comment_end - 6) );
if (preg_match_all('/<(NAME|DESC|SECTION)>(.*?)<\/(NAME|DESC|SECTION)>/is', $comment, $regs)) {
$ret = Array ();
foreach ($regs[1] as $param_order => $param_name) {
$ret[ strtolower($param_name) ] = trim($regs[2][$param_order]);
}
if (array_key_exists('section', $ret) && $ret['section']) {
$category_path = explode('||', $ret['section']);
$category_path = array_map('trim', $category_path);
$ret['section'] = implode('||', $category_path);
}
return $ret;
}
}
return Array ();
}
/**
* Returns theme name by it's id. Used in structure page creation.
*
* @param int $theme_id
* @return string
*/
function _getThemeName($theme_id)
{
static $themes = null;
if (!isset($themes)) {
$id_field = $this->Application->getUnitOption('theme', 'IDField');
$table_name = $this->Application->getUnitOption('theme', 'TableName');
$sql = 'SELECT Name, ' . $id_field . '
FROM ' . $table_name . '
WHERE Enabled = 1';
$themes = $this->Conn->GetCol($sql, $id_field);
}
return array_key_exists($theme_id, $themes) ? $themes[$theme_id] : false;
}
/**
* Resets SMS-menu cache
*
* @param kEvent $event
*/
function OnResetMenuCache(&$event)
{
$this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName IN ("cms_menu", "StructureTree")');
}
/**
* Updates structure config
*
* @param kEvent $event
*/
function OnAfterConfigRead(&$event)
{
parent::OnAfterConfigRead($event);
if (defined('IS_INSTALL') && IS_INSTALL) {
// skip any processing, because Category table doesn't exists until install is finished
return ;
}
$root_category = $this->Application->findModule('Name', 'Proj-CMS', 'RootCat');
// set root category
$section_ajustments = $this->Application->getUnitOption($event->Prefix, 'SectionAdjustments');
$section_ajustments['in-portal:browse'] = Array (
'url' => Array ('m_cat_id' => $root_category),
'late_load' => Array ('m_cat_id' => $root_category),
'onclick' => 'checkCatalog(' . $root_category . ')',
);
$this->Application->setUnitOption($event->Prefix, 'SectionAdjustments', $section_ajustments);
// prepare structure dropdown
$sql = 'SELECT Data
FROM ' . TABLE_PREFIX . 'Cache
WHERE VarName = "StructureTree"';
$data = $this->Conn->GetOne($sql);
if ($data) {
$data = unserialize($data);
}
else {
$data = $this->_getChildren($event, $root_category);
$fields_hash = Array (
'VarName' => 'StructureTree',
'Data' => serialize($data),
'Cached' => adodb_mktime(),
);
$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'Cache', 'REPLACE');
}
$fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
$theme_id = $this->_getCurrentThemeId();
$fields['ParentId']['default'] = $this->Application->GetVar('m_cat_id');
$fields['ParentId']['options'] = $this->_printChildren($data, $root_category, $this->Application->GetVar('m_lang'), $theme_id);
// limit design list by theme
$design_folders = Array ('tf.FilePath = "/designs"', 'tf.FilePath = "/platform/designs"', 'tf.FilePath = "/in-edit/designs"');
foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
$design_folders[] = 'tf.FilePath = "/' . $module_info['TemplatePath'] . 'designs"';
}
$design_folders = array_unique($design_folders);
$design_sql = $fields['Template']['options_sql'];
$design_sql = str_replace('(tf.FilePath = "/designs")', '(' . implode(' OR ', $design_folders) . ')', $design_sql);
$design_sql .= ' AND (t.ThemeId = ' . $theme_id . ')';
$fields['Template']['options_sql'] = $design_sql;
$this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
+
+ if ($this->Application->IsAdmin()) {
+ // don't sort by Front-End sorting fields
+ $config_mapping = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping');
+ $remove_keys = Array ('DefaultSorting1Field', 'DefaultSorting2Field', 'DefaultSorting1Dir', 'DefaultSorting2Dir');
+ foreach ($remove_keys as $remove_key) {
+ unset($config_mapping[$remove_key]);
+ }
+ $this->Application->setUnitOption($event->Prefix, 'ConfigMapping', $config_mapping);
+ }
+ else {
+ // sort by parent path on Front-End only
+ $list_sortings = $this->Application->getUnitOption($event->Prefix, 'ListSortings');
+ $list_sortings['']['ForcedSorting'] = Array ("CurrentSort" => 'asc');
+ $this->Application->setUnitOption($event->Prefix, 'ListSortings', $list_sortings);
+ }
}
function _printChildren(&$data, $parent_category_id, $language_id, $theme_id, $level = 0)
{
if ($data['ThemeId'] != $theme_id && $data['ThemeId'] != 0) {
// don't show system templates from different themes
return Array ();
}
$ret = Array($parent_category_id => str_repeat('-', $level).' '.$data['l'.$language_id.'_Name']);
if ($data['children']) {
$level++;
foreach ($data['children'] as $category_id => $category_data) {
$ret = array_merge_recursive2($ret, $this->_printChildren($data['children'][$category_id], $category_id, $language_id, $theme_id, $level));
}
}
return $ret;
}
/**
* Returns information about children under parent path (recursive)
*
* @param kEvent $event
* @param int $parent_category_id
* @param int $language_count
*/
function _getChildren(&$event, $parent_category_id)
{
static $language_count = null;
if (!isset($language_count)) {
$ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
/* @var $ml_helper kMultiLanguageHelper */
$language_count = $ml_helper->getLanguageCount();
}
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
// get category children + parent category
$sql = 'SELECT *
FROM '.$table_name.'
WHERE ParentId = '.$parent_category_id.' OR '.$id_field.' = '.$parent_category_id.'
ORDER BY Priority DESC';
$categories = $this->Conn->Query($sql, $id_field);
$parent_data = $categories[$parent_category_id];
unset($categories[$parent_category_id]);
// no children for this category
$data = Array ('id' => $parent_data[$id_field], 'children' => false, 'ThemeId' => $parent_data['ThemeId']);
for ($i = 1; $i <= $language_count; $i++) {
$data['l'.$i.'_Name'] = $parent_data['l'.$i.'_Name'];
}
if (!$categories) {
// no children
return $data;
}
// category has children
foreach ($categories as $category_id => $category_data) {
$data['children'][$category_id] = $this->_getChildren($event, $category_id);
}
return $data;
}
/**
* Removes this item and it's children (recursive) from structure dropdown
*
* @param kEvent $event
*/
function OnAfterItemLoad(&$event)
{
parent::OnAfterItemLoad($event);
if (!$this->Application->IsAdmin()) {
return ;
}
$object =& $event->getObject();
// remove this category & it's children from dropdown
$sql = 'SELECT '.$object->IDField.'
FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
WHERE ParentPath LIKE "'.$object->GetDBField('ParentPath').'%"';
$remove_categories = $this->Conn->GetCol($sql);
$field_options = $object->GetFieldOptions('ParentId');
foreach ($remove_categories as $remove_category) {
unset($field_options['options'][$remove_category]);
}
$object->SetFieldOptions('ParentId', $field_options);
$priority_helper =& $this->Application->recallObject('PriorityHelper');
/* @var $priority_helper kPriorityHelper */
$priority_helper->preparePriorities($event, false, 'ParentId = '.$object->GetDBField('ParentId'));
// storing prioriry right after load for comparing when updating
$object->SetDBField('OldPriority', $object->GetDBField('Priority'));
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnAfterRebuildThemes(&$event)
{
$sql = 'SELECT t.ThemeId, CONCAT( tf.FilePath, \'/\', tf.FileName ) AS Path
FROM '.TABLE_PREFIX.'ThemeFiles AS tf
LEFT JOIN '.TABLE_PREFIX.'Theme AS t ON t.ThemeId = tf.ThemeId
WHERE t.Enabled = 1 AND tf.FileType = 1
AND (
SELECT COUNT(CategoryId)
FROM ' . TABLE_PREFIX . 'Category
WHERE CONCAT(\'/\', ' . TABLE_PREFIX . 'Category.Template, \'.tpl\') = CONCAT( tf.FilePath, \'/\', tf.FileName )
) = 0 ';
$files = $this->Conn->GetCol($sql, 'Path');
if (!$files) {
// all possible pages are already created
return ;
}
$dummy =& $this->Application->recallObject($event->Prefix . '.-dummy', null, Array ('skip_autoload' => true));
/* @var $dummy kDBItem */
$error_count = 0;
foreach ($files as $a_file => $theme_id) {
$status = $this->_prepareAutoPage($dummy, $a_file, $theme_id, SMS_MODE_FORCE); // create system page
if (!$status) {
$error_count++;
}
}
if ($this->Application->ConfigValue('QuickCategoryPermissionRebuild')) {
$updater =& $this->Application->recallObject('kPermCacheUpdater');
/* @var $updater kPermCacheUpdater */
$updater->OneStepRun();
}
$event->CallSubEvent('OnResetMenuCache');
if ($error_count) {
// allow user to review error after structure page creation
$event->MasterEvent->redirect = false;
}
}
/**
* Processes OnMassMoveUp, OnMassMoveDown events
*
* @param kEvent $event
*/
function OnChangePriority(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$ids = $this->StoreSelectedIDs($event);
if ($ids) {
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$parent_id = $this->Application->GetVar('m_cat_id');
$sql = 'SELECT Priority, '.$id_field.'
FROM '.$table_name.'
WHERE '.$id_field.' IN ('.implode(',', $ids).')';
$priorities = $this->Conn->GetCol($sql, $id_field);
$priority_helper =& $this->Application->recallObject('PriorityHelper');
/* @var $priority_helper kPriorityHelper */
foreach ($ids as $id) {
$new_priority = $priorities[$id] + ($event->Name == 'OnMassMoveUp' ? +1 : -1);
$changes = Array (
$id => Array ('old' => $priorities[$id], 'new' => $new_priority, 'parent' => $parent_id),
);
$sql = 'UPDATE '.$table_name.'
SET Priority = '.$new_priority.'
WHERE '.$id_field.' = '.$id;
$this->Conn->Query($sql);
$priority_helper->updatePriorities($event, $changes, Array ($id => $id));
}
}
$this->clearSelectedIDs($event);
}
/**
* Completely recalculates priorities in current category
*
* @param kEvent $event
*/
function OnRecalculatePriorities(&$event)
{
$priority_helper =& $this->Application->recallObject('PriorityHelper');
/* @var $priority_helper kPriorityHelper */
$parent_id = $this->Application->GetVar('m_cat_id');
$priority_helper->recalculatePriorities($event, 'ParentId = ' . $parent_id);
}
/**
* Update Preview Block for FCKEditor
*
* @param kEvent $event
*/
function OnUpdatePreviewBlock(&$event)
{
$event->status = erSTOP;
$string = unhtmlentities($this->Application->GetVar('preview_content'));
$this->Application->StoreVar('_editor_preview_content_', $string);
}
/**
* Saves changed template block
*
* @param kEvent $event
*/
function OnSaveBlock(&$event)
{
if (!EDITING_MODE) {
$event->status = erSTOP;
echo '0';
return ;
}
$template_helper =& $this->Application->recallObject('TemplateHelper');
/* @var $template_helper TemplateHelper */
$event->status = $template_helper->saveBlock($event) ? erSTOP : erFAIL;
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/categories/categories_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.35.2.24
\ No newline at end of property
+1.35.2.25
\ No newline at end of property
Index: branches/RC/core/units/themes/themes_config.php
===================================================================
--- branches/RC/core/units/themes/themes_config.php (revision 11537)
+++ branches/RC/core/units/themes/themes_config.php (revision 11538)
@@ -1,116 +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_title_Configuration! - !la_tab_Themes! (#theme_recordcount#)"),
+ '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#)"),
),
+ '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',),
- 'Description' => Array( 'title'=>'la_col_Description', ),
+ '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.4
\ No newline at end of property
+1.17.2.5
\ No newline at end of property
Index: branches/RC/core/units/skins/skins_config.php
===================================================================
--- branches/RC/core/units/skins/skins_config.php (revision 11537)
+++ branches/RC/core/units/skins/skins_config.php (revision 11538)
@@ -1,176 +1,176 @@
<?php
$config = Array(
'Prefix' => 'skin',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'SkinEventHandler','file'=>'skin_eh.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
'AutoLoad' => true,
'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'skin',
'HookToSpecial' => '',
'HookToEvent' => Array('OnSave'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnCompileStylesheet',
),
),
'QueryString' => Array(
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'SkinId',
'StatusField' => Array('IsPrimary'),
'TableName' => TABLE_PREFIX.'Skins',
/*
'ForeignKey' => 'ParentId', // field title in TableName, linking record to a parent
'ParentTableKey' => 'ParentId', // id (or other key) field title in parent's table
'ParentPrefix' => 'parent',
'AutoDelete' => true, // delete these items when parent is being deleted
'AutoClone' => true, // clone these items when parent is being cloned
*/
'TitlePresets' => Array(
'default' => Array(
'new_status_labels' => Array('skin'=>'!la_title_AddingSkin!'),
'edit_status_labels' => Array('skin'=>'!la_title_EditingSkin!'),
'new_titlefield' => Array('skin'=>''),
),
'skin_list'=>Array(
'prefixes' => Array('skin_List'),
- 'format' => '!la_title_Skins! (#skin_recordcount#)',
+ 'format' => '!la_tab_Skins!',
),
'skin_edit'=>Array(
'prefixes' => Array('skin'),
'format' => '#skin_status# #skin_titlefield#',
),
),
'PermSection' => Array('main' => 'in-portal:skins'),
// don't forget to add corresponding permissions to install script
// INSERT INTO Permissions VALUES (0, 'custom:custom.view', 11, 1, 1, 0);
// 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);
'Sections' => Array(
'in-portal:skins' => Array(
'parent' => 'in-portal:tools',
'icon' => 'conf_general',
'label' => 'la_tab_Skins',
'url' => Array('t' => 'skins/skin_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 11,
'show_mode' => smSUPER_ADMIN,
'type' => stTREE,
),
),
'TitleField' => 'Name', // field, used in bluebar when editing existing item
// Use %1$s for local table name with prefix, %2$s for calculated fields
'ListSQLs' => Array( // key - special, value - list select sql
'' => 'SELECT %1$s.* %2$s
FROM %1$s',
),
'ItemSQLs' => Array(
'' => 'SELECT %1$s.* %2$s
FROM %1$s',
),
'ListSortings' => Array(
'' => Array(
// 'ForcedSorting' => Array('Priority' => 'desc'),
'Sorting' => Array('Name' => 'asc'),
)
),
'Fields' => Array (
'SkinId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Name' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
'CSS' => Array ('type' => 'string', 'default' => NULL),
'Logo' => Array(
'type'=>'string', 'formatter'=>'kUploadFormatter',
'max_size'=>MAX_UPLOAD_SIZE, // in Bytes !
'file_types'=>'*.jpg;*.gif;*.png', 'files_description'=>'!la_ImageFiles!',
'upload_dir' => WRITEBALE_BASE . '/user_files/', // relative to project's home
'as_image'=>true, 'thumb_width'=>100, 'thumb_height'=>100,
'multiple'=>false, // false or max number of files - will be stored as serialized array of paths
'direct_links'=>false, // use direct file urls or send files through wrapper (requires mod_mime_magic)
'default' => null,
),
'LogoBottom' => Array(
'type'=>'string', 'formatter'=>'kUploadFormatter',
'max_size'=>MAX_UPLOAD_SIZE, // in Bytes !
'file_types'=>'*.jpg;*.gif;*.png', 'files_description'=>'!la_ImageFiles!',
'upload_dir' => WRITEBALE_BASE . '/user_files/', // relative to project's home
'as_image'=>true, 'thumb_width'=>100, 'thumb_height'=>100,
'multiple'=>false, // false or max number of files - will be stored as serialized array of paths
'direct_links'=>false, // use direct file urls or send files through wrapper (requires mod_mime_magic)
'default' => null,
),
'Options' => Array(
'type' => 'string', 'default' => NULL,
'formatter' => 'kSerializedFormatter',
'default'=>serialize(
array(
'HeadBgColor' => array('Description'=>'Head frame background color', 'Value'=>'#1961B8'),
'HeadColor' => array('Description'=>'Head frame text color', 'Value'=>'#000000'),
'SectionBgColor' => array('Description'=>'Section bar background color', 'Value'=>'#2D79D6'),
'SectionColor' => array('Description'=>'Section bar text color', 'Value'=>'#000000'),
)
),
),
'LastCompiled' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'IsPrimary' => Array(
'type' => 'int', 'formatter' => 'kOptionsFormatter',
'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
'not_null' => 1, 'default' => 0
),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_test.gif'),
'Fields' => Array(
'SkinId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'width'=>50, 'filter_block' => 'grid_range_filter' ),
'Name' => Array( 'title'=>'la_col_SkinName', 'width'=>200, 'filter_block' => 'grid_like_filter'),
'IsPrimary' => Array( 'title'=>'la_col_IsPrimary', 'width'=>150, 'filter_block' => 'grid_options_filter'),
),
),
),
/*'ConfigMapping' => Array(
'PerPage' => 'Comm_Perpage_Tests',
'ShortListPerPage' => 'Comm_Perpage_Tests_Short',
),*/
);
/*
Don't forget to:
- Add table create statement to install_schema.sql
CREATE TABLE Tests (
`TestId` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`Title` VARCHAR( 255 ) NOT NULL ,
`Description` TEXT NULL ,
`Email` VARCHAR( 255 ) NOT NULL ,
`Type` TINYINT NOT NULL ,
`Phone` VARCHAR( 50 ) NOT NULL ,
`Qty` DOUBLE NOT NULL ,
`Status` TINYINT NOT NULL ,
`CreatedOn` INT NOT NULL ,
`Good` TINYINT NOT NULL
)
- Add permissions for admin gorup to install script (see 'Sections' key above)
*/
\ No newline at end of file
Property changes on: branches/RC/core/units/skins/skins_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2.4.3
\ No newline at end of property
+1.2.4.4
\ No newline at end of property
Index: branches/RC/core/units/related_searches/related_searches_config.php
===================================================================
--- branches/RC/core/units/related_searches/related_searches_config.php (revision 11537)
+++ branches/RC/core/units/related_searches/related_searches_config.php (revision 11538)
@@ -1,101 +1,93 @@
<?php
$config = Array(
'Prefix' => 'search',
'Clones' => Array(
'c-search' => Array('ParentPrefix' => 'c'),
/*'l-rel' => Array('ParentPrefix' => 'l'),
'n-rel' => Array('ParentPrefix' => 'n'),
'bb-rel'=> Array('ParentPrefix' => 'bb'),
'p-rel' => Array('ParentPrefix' => 'p'),
'cms-rel'=> Array('ParentPrefix' => 'cms'),*/
),
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'RelatedSearchEventHandler','file'=>'related_searches_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'RelatedSearchTagProcessor','file'=>'related_searches_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
),
'IDField' => 'RelatedSearchId',
'StatusField' => Array('Enabled'),
'TableName' => TABLE_PREFIX.'RelatedSearches',
'ParentTableKey' => 'ResourceId',
'ForeignKey' => 'ResourceId',
'ParentPrefix' => 'c',
'AutoDelete' => true,
'AutoClone' => true,
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array('show_active','show_disabled'), 'type' => WHERE_FILTER),
- Array('mode' => 'AND', 'filters' => Array('show_recip','show_oneway'), 'type' => WHERE_FILTER),
),
'Filters' => Array(
'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Enabled != 1' ),
'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Enabled != 0' ),
- 's1' => Array(),
- /*
- 'show_recip' => Array('label' => 'la_Reciprocal', 'on_sql' => '', 'off_sql' => '%1$s.Type != 1' ),
- 'show_oneway' => Array('label' => 'la_OneWay', 'on_sql' => '', 'off_sql' => '%1$s.Type != 2' ),
- */
)
),
'CalculatedFields' => Array(
'' => Array(
/* 'ItemName' => 'TRIM(CONCAT(#ITEM_NAMES#))',
'ItemType' => '#ITEM_TYPES#', */
),
),
'ListSQLs' => Array( ''=> 'SELECT %1$s.* %2$s FROM %1$s',
), // key - special, value - list select sql
'ListSortings' => Array(
'' => Array(
'ForcedSorting' => Array('Priority' => 'desc'),
'Sorting' => Array('Keyword' => 'asc'),
)
),
'ItemSQLs' => Array( '' => 'SELECT %1$s.* %2$s FROM %1$s',),
'Fields' => Array(
'RelatedSearchId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'ResourceId' => Array('type'=>'int', 'not_null' => 1, 'required' => 1, 'default' => 0),
'Keyword' => Array('type'=>'string', 'required' => 1, 'not_null' => 1, 'default' => ''),
/*
'SourceType' => Array('type'=>'int','not_null'=>1,'default'=>0),
'TargetType' => Array('type'=>'int','not_null'=>1,'default'=>0),
*/
'ItemType' => Array('type'=>'int', 'not_null' => 1, 'required' => 1, 'default' => 0),
'Enabled' => Array('type'=>'int','formatter'=>'kOptionsFormatter','options'=>Array(0=>'la_Disabled',1=>'la_Enabled'),'not_null'=>1,'default'=>1,'use_phrases'=>1),
'Priority' => Array('type'=>'int','not_null'=>1,'default'=>0),
),
'VirtualFields' => Array(
/*
'ItemName' => Array(),
'ItemType' => Array(),
*/
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_custom.gif','1_0'=>'icon16_relation_one-way.gif','0_0'=>'icon16_relation_one-way_disabled.gif','1_1'=>'icon16_relation_reciprocal.gif','0_1'=>'icon16_relation_reciprocal_disabled.gif'), // icons for each StatusField values, if no matches or no statusfield selected, then "default" icon is used
'Fields' => Array(
- /* 'RelatedSearchId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td'), */
- 'Keyword' => Array( 'title'=>'la_col_Keyword', 'data_block' => 'grid_keyword_td'),
- 'Enabled' => Array( 'title'=>'la_col_Status' ),
+ 'RelatedSearchId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
+ 'Keyword' => Array( 'title'=>'la_col_Keyword', 'data_block' => 'grid_keyword_td', 'filter_block' => 'grid_like_filter'),
+ 'Enabled' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
),
),
),
- );
-
-?>
\ No newline at end of file
+ );
\ No newline at end of file
Property changes on: branches/RC/core/units/related_searches/related_searches_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/related_searches/related_searches_tag_processor.php
===================================================================
--- branches/RC/core/units/related_searches/related_searches_tag_processor.php (revision 11537)
+++ branches/RC/core/units/related_searches/related_searches_tag_processor.php (revision 11538)
@@ -1,20 +1,38 @@
<?php
class RelatedSearchTagProcessor extends kDBTagProcessor {
/**
* Returns url for search on the Fornt End
*
* @param Array $params
* @return string
*/
function RelatedSearchUrl($params)
{
- $object =& $this->getObject($params);
+ $object =& $this->getObject($params);
$keyword = $object->GetDBField('Keyword');
-
+
return $this->Application->HREF($params['search_template'],'', Array('keywords' => $keyword));
}
+
+ /**
+ * If data was modfied & is in TempTables mode, then parse block with name passed;
+ * remove modification mark if not in TempTables mode
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ * @author Alexey
+ */
+ function SaveWarning($params)
+ {
+ if ($this->Prefix == 'c-search') {
+ return $this->Application->ProcessParsedTag('c', 'SaveWarning', $params);
+ }
+
+ return parent::SaveWarning($params);
+ }
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/related_searches/related_searches_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/units/custom_fields/custom_fields_tag_processor.php
===================================================================
--- branches/RC/core/units/custom_fields/custom_fields_tag_processor.php (revision 11537)
+++ branches/RC/core/units/custom_fields/custom_fields_tag_processor.php (revision 11538)
@@ -1,123 +1,142 @@
<?php
class CustomFieldsTagProcessor extends kDBTagProcessor {
/**
* Return LEFT JOINed custom field name from main item config
*
* @param Array $params
* @return string
*/
function GetMainField($params)
{
$object =& $this->getObject($params);
$append = isset($params['append']) && $params['append'] ? $params['append'] : '';
return 'cust_'.$object->GetDBField('FieldName').$append;
}
function CustomField($params)
{
$params['name'] = $this->GetMainField($params);
$source_prefix = $this->Application->Parser->GetParam('SourcePrefix');
return $this->Application->ProcessParsedTag($source_prefix, 'Field', $params);
}
function CustomFormat($params)
{
$params['name'] = $this->GetMainField($params);
$source_prefix = $this->Application->Parser->GetParam('SourcePrefix');
return $this->Application->ProcessParsedTag($source_prefix, 'Format', $params);
}
function CustomInputName($params)
{
$params['name'] = $this->GetMainField($params);
$source_prefix = $this->Application->Parser->GetParam('SourcePrefix');
return $this->Application->ProcessParsedTag($source_prefix, 'InputName', $params);
}
function setParamValue(&$params, $param_name)
{
// $deep_level if GetParam = 1 used in case if PrintList is called during parsing "grid" block (=> +1 to deep_level)
if (!isset($params[$param_name])) {
$params[$param_name] = $this->Application->Parser->GetParam($param_name, 1);
}
return $params[$param_name];
}
/**
* Prints list content using block specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintList($params)
{
$this->setParamValue($params, 'SourcePrefix');
$this->setParamValue($params, 'value_field');
$list =& $this->GetList($params);
$id_field = $this->Application->getUnitOption($this->Prefix,'IDField');
$list->Query();
$o = '';
$list->GoFirst();
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
$block_params['pass_params'] = 'true';
$prev_heading = '';
$display_original = false;
$source_prefix = getArrayValue($params, 'SourcePrefix');
if ($source_prefix) {
$source_object =& $this->Application->recallObject($source_prefix, null, Array ('raise_warnings' => 0)); // it's possible, that in some cases object will not be loaded
/* @var $source_object kCatDBItem */
$display_original = $this->Application->ProcessParsedTag($source_prefix, 'DisplayOriginal', Array('display_original' => $this->setParamValue($params, 'display_original')));
}
if ($display_original) {
$block_params['display_original'] = $display_original;
$block_params['original_title'] = $this->setParamValue($params, 'original_title');
$original_object =& $this->Application->recallObject($source_prefix.'.original', null, Array ('raise_warnings' => 0)); // it's possible, that in some cases object will not be loaded
}
if ($this->Special == 'general') {
$this->groupRecords($list->Records, 'Heading');
}
$i = 0;
while (!$list->EOL())
{
$block_params['is_last'] = ($i == $list->SelectedCount - 1);
$block_params['not_last'] = !$block_params['is_last']; // for front-end
$this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET
if ($source_prefix) {
$list->SetDBField($params['value_field'], $source_object->GetDBField('cust_'.$list->GetDBField('FieldName')));
if ($display_original) {
$list->SetDBField('OriginalValue', $original_object->GetField('cust_'.$list->GetDBField('FieldName')));
}
$block_params['field'] = $block_params['virtual_field'] = 'cust_'.$list->GetDBField('FieldName');
$block_params['show_heading'] = ($prev_heading != $list->GetDBField('Heading') ) ? 1 : 0;
$options = $source_object->GetFieldOptions('cust_'.$list->GetDBField('FieldName'));
$list->SetDBField('DirectOptions', isset($options['options']) ? $options['options'] : false);
}
$o.= $this->Application->ParseBlock($block_params, 1);
$prev_heading = $list->GetDBField('Heading');
$list->GoNext();
$i++;
}
$this->Application->SetVar( $this->getPrefixSpecial().'_id', '');
return $o;
}
+
+ /**
+ * If data was modfied & is in TempTables mode, then parse block with name passed;
+ * remove modification mark if not in TempTables mode
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ * @author Alexey
+ */
+ function SaveWarning($params)
+ {
+ $source_prefix = array_key_exists('SourcePrefix', $params) ? $params['SourcePrefix'] : false;
+ if ($source_prefix && $source_prefix == 'c') {
+ return $this->Application->ProcessParsedTag('c', 'SaveWarning', $params);
+ }
+
+ return parent::SaveWarning($params);
+ }
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/custom_fields/custom_fields_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5.2.2
\ No newline at end of property
+1.5.2.3
\ No newline at end of property
Index: branches/RC/core/units/custom_fields/custom_fields_config.php
===================================================================
--- branches/RC/core/units/custom_fields/custom_fields_config.php (revision 11537)
+++ branches/RC/core/units/custom_fields/custom_fields_config.php (revision 11538)
@@ -1,150 +1,145 @@
<?php
$config = Array(
'Prefix' => 'cf',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'CustomFieldsEventHandler','file'=>'custom_fields_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'CustomFieldsTagProcessor','file'=>'custom_fields_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'hooks' => Array(),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'type',
5 => 'mode',
),
'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'cf',
'HookToSpecial' => '*',
'HookToEvent' => Array('OnSave'), // edit cloned fields to made alters :)
'DoPrefix' => 'cf',
'DoSpecial' => '*',
'DoEvent' => 'OnSaveCustomField',
),
),
'IDField' => 'CustomFieldId',
'OrderField' => 'DisplayOrder',
'TitleField' => 'FieldName', // field, used in bluebar when editing existing item
'TitlePhrase' => 'la_title_CustomFields',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('cf'=>'!la_title_addingCustom!'),
'edit_status_labels' => Array('cf'=>'!la_title_Editing_CustomField!'),
'new_titlefield' => Array('cf'=>''),
),
'custom_fields_list'=>Array( 'prefixes' => Array('cf_List'),
- 'format' => "!la_tab_ConfigCustom! (#cf_recordcount#)",
+ 'format' => "!la_tab_ConfigCustom!",
),
'custom_fields_edit'=>Array( 'prefixes' => Array('cf'),
'new_titlefield' => Array('cf'=>''),
'format' => "#cf_status# '#cf_titlefield#'",
),
),
'TableName' => TABLE_PREFIX.'CustomField',
'ListSQLs' => Array( ''=>'SELECT * FROM %s',
), // key - special, value - list select sql
'ListSortings' => Array(
'' => Array(
'ForcedSorting' => Array('DisplayOrder' => 'asc'),
'Sorting' => Array('FieldName' => 'asc'),
),
'general' => Array(
'Sorting' => Array('DisplayOrder' => 'asc')
),
),
'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
),
'SubItems' => Array('confs-cf'),
'Fields' => Array(
'CustomFieldId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'Type' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'FieldName' => Array('required'=>'1', 'type' => 'string','not_null' => 1,'default' => ''),
'FieldLabel' => Array('type' => 'string', 'required' => 1, 'default' => null),
'MultiLingual' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
'Heading' => Array('type' => 'string', 'required' => 1, 'default' => null),
'Prompt' => Array('type' => 'string','default' => null),
'ElementType' => Array('required'=>'1', 'type'=>'string', 'not_null'=>1, 'default'=>'', 'formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options'=>Array('' => 'la_EmptyValue', 'text' => 'la_type_text', 'select' => 'la_type_select', 'multiselect' => 'la_type_multiselect', 'radio' => 'la_type_radio', 'checkbox' => 'la_type_checkbox', 'password' => 'la_type_password', 'textarea' => 'la_type_textarea', 'label' => 'la_type_label', 'date' => 'la_type_date', 'datetime' => 'la_type_datetime')),
'ValueList' => Array('type' => 'string','default' => null),
'DefaultValue' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
'DisplayOrder' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'OnGeneralTab' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'IsSystem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), ),
'VirtualFields' => Array(
'Value' => Array('type' => 'string', 'default' => ''),
'OriginalValue' => Array('type' => 'string', 'default' => ''),
'Error' => Array('type' => 'string', 'default' => ''),
'DirectOptions' => Array('type' => 'string', 'default' => ''),
'SortValues' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
'default' => 0,
),
// for ValueList field editing via "inp_edit_minput" control
'OptionKey' => Array ('type' => 'int', 'not_null' => 1, 'default' => ''),
'OptionTitle' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
'Options' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_custom.gif'),
'Fields' => Array(
- 'CustomFieldId' => Array( 'title'=>'la_prompt_FieldId', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter' ),
+ 'CustomFieldId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter' ),
'FieldName' => Array( 'title'=>'la_prompt_FieldName'),
'FieldLabel' => Array( 'title'=>'la_prompt_FieldLabel', 'data_block' => 'cf_grid_data_td' ),
'DisplayOrder' => Array('title' => 'la_prompt_DisplayOrder', 'filter_block' => 'grid_range_filter' ),
+// 'IsSystem' => Array ('title' => 'la_col_IsSystem', 'filter_block' => 'grid_options_filter'),
),
),
'SeparateTab' => Array(
'Icons' => Array('default'=>'icon16_custom.gif'),
'Selector' => '',
'Fields' => Array(
- 'FieldName' => Array( 'title'=>'la_col_FieldName', 'data_block' => 'grid_checkbox_td'),
- 'Prompt' => Array( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td', 'ElementTypeField' => 'ElementType'),
- 'Value' => Array( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td'),
- 'Error' => Array( 'title'=>'la_col_Error', 'data_block' => 'custom_error_td'),
+ 'FieldName' => Array( 'title'=>'la_col_FieldName', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_like_filter'),
+ 'Prompt' => Array( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td', 'ElementTypeField' => 'ElementType', 'filter_block' => 'grid_empty_filter'),
+ 'Value' => Array( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td', 'filter_block' => 'grid_empty_filter'),
+ 'Error' => Array( 'title'=>'la_col_Error', 'data_block' => 'custom_error_td', 'filter_block' => 'grid_empty_filter'),
),
),
'SeparateTabOriginal' => Array(
'Icons' => Array('default'=>'icon16_custom.gif'),
'Selector' => '',
'Fields' => Array(
- 'FieldName' => Array( 'title'=>'la_col_FieldName', 'data_block' => 'grid_icon_td'),
- 'Prompt' => Array( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td', 'ElementTypeField' => 'ElementType'),
- 'Value' => Array( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td'),
- 'OriginalValue' => Array( 'title'=>'la_col_OriginalValue', 'data_block' => 'grid_original_td'),
+ 'FieldName' => Array( 'title'=>'la_col_FieldName', 'data_block' => 'grid_icon_td', 'filter_block' => 'grid_like_filter'),
+ 'Prompt' => Array( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td', 'ElementTypeField' => 'ElementType', 'filter_block' => 'grid_empty_filter'),
+ 'Value' => Array( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td', 'filter_block' => 'grid_empty_filter'),
+ 'OriginalValue' => Array( 'title'=>'la_col_OriginalValue', 'data_block' => 'grid_original_td', 'filter_block' => 'grid_like_filter'),
),
),
),
- );
-
- if (constOn('DEBUG_MODE')) {
- $config['Grids']['Default']['Fields']['IsSystem'] = Array('title' => 'la_col_IsSystem');
- }
-
-?>
\ No newline at end of file
+ );
\ No newline at end of file
Property changes on: branches/RC/core/units/custom_fields/custom_fields_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.18.2.4
\ No newline at end of property
+1.18.2.5
\ No newline at end of property
Index: branches/RC/core/units/users/users_event_handler.php
===================================================================
--- branches/RC/core/units/users/users_event_handler.php (revision 11537)
+++ branches/RC/core/units/users/users_event_handler.php (revision 11538)
@@ -1,1781 +1,1780 @@
<?php
class UsersEventHandler extends kDBEventHandler
{
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array (
// admin
'OnSetPersistantVariable' => Array('self' => 'view'), // because setting to logged in user only
'OnUpdateRootPassword' => Array('self' => true),
'OnUpdatePassword' => Array('self' => true),
// front
'OnRefreshForm' => Array('self' => true),
'OnForgotPassword' => Array('self' => true),
'OnResetPassword' => Array('self' => true),
'OnResetPasswordConfirmed' => Array('self' => true),
'OnSubscribeQuery' => Array('self' => true),
'OnSubscribeUser' => Array('self' => true),
'OnRecommend' => Array('self' => true),
'OnItemBuild' => Array('self' => true),
'OnMassResetSettings' => Array('self' => 'edit'),
'OnMassCloneUsers' => Array('self' => 'add'),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Shows only admins when required
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
$object =& $event->getObject();
/* @var $object kDBList */
if ($event->Special == 'admins') {
$object->addFilter('primary_filter', 'ug.GroupId = 11');
}
if ($event->Special == 'regular') {
$object->addFilter('primary_filter', 'ug.GroupId <> 11');
}
if (!$this->Application->IsAdmin()) {
$object->addFilter('status_filter', '%1$s.Status = '.STATUS_ACTIVE);
}
if ($event->Special == 'online') {
$object->addFilter('online_users_filter', 's.PortalUserId IS NOT NULL');
}
if ($event->Special == 'group') {
$group_id = $this->Application->GetVar('g_id');
if ($group_id !== false) {
// show only users, that user doesn't belong to current group
$table_name = $this->Application->GetTempName(TABLE_PREFIX.'UserGroup', 'prefix:g');
$sql = 'SELECT PortalUserId
FROM '.$table_name.'
WHERE GroupId = '.$group_id;
$user_ids = $this->Conn->GetCol($sql);
- array_push($user_ids); // Guest & Everyone groups are set dynamically
+// array_push($user_ids); // Guest & Everyone groups are set dynamically
if ($user_ids) {
$object->addFilter('already_member_filter', '%1$s.PortalUserId NOT IN ('.implode(',', $user_ids).')');
}
}
}
}
-
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if ($event->Name == 'OnLogin' || $event->Name == 'OnLogout') {
// permission is checked in OnLogin event directly
return true;
}
if (!$this->Application->IsAdmin()) {
$user_id = $this->Application->RecallVar('user_id');
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
if ($event->Name == 'OnCreate' && $user_id == -2) {
// "Guest" can create new users
return true;
}
if ($event->Name == 'OnUpdate' && $user_id > 0) {
$user_dummy =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true));
foreach ($items_info as $id => $field_values) {
if ($id != $user_id) {
// registered users can update their record only
return false;
}
$user_dummy->Load($id);
$status_field = array_shift($this->Application->getUnitOption($event->Prefix, 'StatusField'));
if ($user_dummy->GetDBField($status_field) != STATUS_ACTIVE) {
// not active user is not allowed to update his record (he could not activate himself manually)
return false;
}
if (isset($field_values[$status_field]) && $user_dummy->GetDBField($status_field) != $field_values[$status_field]) {
// user can't change status by himself
return false;
}
}
return true;
}
if ($event->Name == 'OnUpdate' && $user_id <= 0) {
// guests are not allowed to update their record, because they don't have it :)
return false;
}
}
return parent::CheckPermission($event);
}
function OnSessionExpire()
{
$this->Application->resetCounters('UserSession');
if ($this->Application->IsAdmin()) {
$this->Application->Redirect('index', Array('expired' => 1), '', 'index.php');
}
if ($this->Application->GetVar('admin') == 1) {
$session_admin =& $this->Application->recallObject('Session.admin');
/* @var $session_admin Session */
if (!$session_admin->LoggedIn()) {
// front-end session created from admin session & both expired
$this->Application->DeleteVar('admin');
$this->Application->Redirect('index', Array('expired' => 1), '', 'admin/index.php');
}
}
$get = $this->Application->HttpQuery->getRedirectParams();
$t = $this->Application->GetVar('t');
$get['js_redirect'] = $this->Application->ConfigValue('UseJSRedirect');
$this->Application->Redirect($t ? $t : 'index', $get);
}
/**
* Checks user data and logs it in if allowed
*
* OnLogin is called from u:autoLoginUser and password is supplied
* OnLogin is called from u:OnAutoLoginUser supplying cookie with encoded username & password
*
* @param kEvent $event
*/
function OnLogin(&$event)
{
// persistent session data after login is not refreshed, because redirect will follow in any case
$prefix_special = $this->Application->IsAdmin() ? 'u.current' : 'u'; // "u" used on front not to change theme
$object =& $this->Application->recallObject($prefix_special, null, Array('skip_autoload' => true));
$password = $this->Application->GetVar('password');
$invalid_pseudo = $this->Application->IsAdmin() ? 'la_invalid_password' : 'lu_invalid_password';
$remember_login_cookie = $this->Application->GetVar('remember_login');
if (!$password && !$remember_login_cookie) {
$object->SetError('ValidateLogin', 'invalid_password', $invalid_pseudo);
$event->status = erFAIL;
return false;
}
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
list ($login_field, $submit_field) = $email_as_login && !$this->Application->IsAdmin() ? Array('Email', 'email') : Array('Login', 'login');
$login_value = $this->Application->GetVar($submit_field);
// process "Save Username" checkbox
if ($this->Application->IsAdmin()) {
$save_username = $this->Application->GetVar('cb_save_username') ? $login_value : '';
$this->Application->Session->SetCookie('save_username', $save_username, adodb_mktime() + 31104000); // 1 year expiration
$this->Application->SetVar('save_username', $save_username); // cookie will be set on next refresh, but refresh won't occur if login error present, so duplicate cookie in HTTPQuery
}
$super_admin = ($login_value == 'super-root') && $this->verifySuperAdmin();
if ($this->Application->IsAdmin() && ($login_value == 'root') || ($super_admin && $login_value == 'super-root')) {
// logging in "root" (admin only)
$login_value = 'root';
$root_password = $this->Application->ConfigValue('RootPass');
$password_formatter =& $this->Application->recallObject('kPasswordFormatter');
$test = $password_formatter->EncryptPassword($password, 'b38');
if ($root_password != $test) {
$object->SetError('ValidateLogin', 'invalid_password', $invalid_pseudo);
$event->status = erFAIL;
return false;
}
elseif ($this->checkLoginPermission($login_value)) {
$user_id = -1;
$object->Load($user_id);
$object->SetDBField('Login', $login_value);
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', $user_id);
// $session->SetField('GroupList', implode(',', $groups) );
$this->Application->SetVar('u.current_id', $user_id);
$this->Application->StoreVar('user_id', $user_id);
if ($super_admin) {
$this->Application->StoreVar('super_admin', 1);
}
$this->Application->HandleEvent($dummy, 'session-log:OnStartSession');
$this->processLoginRedirect($event, $password);
return true;
}
else {
$object->SetError('ValidateLogin', 'invalid_license', 'la_invalid_license');
$event->status = erFAIL;
return false;
}
}
/*$sql = 'SELECT PortalUserId FROM '.$object->TableName.' WHERE (%s = %s) AND (Password = MD5(%s))';
$user_id = $this->Conn->GetOne( sprintf($sql, $login_field, $this->Conn->qstr($login_value), $this->Conn->qstr($password) ) );*/
if ($remember_login_cookie) {
$user_info = explode('|', $remember_login_cookie); // 0 - username, 1 - md5(password)
$sql = 'SELECT PortalUserId
FROM '.$object->TableName.'
WHERE (Email = %1$s OR Login = %1$s) AND (Password = %2$s)';
$user_id = $this->Conn->GetOne( sprintf($sql, $this->Conn->qstr($user_info[0]), $this->Conn->qstr($user_info[1]) ) );
} else {
$sql = 'SELECT PortalUserId
FROM '.$object->TableName.'
WHERE (Email = %1$s OR Login = %1$s) AND (Password = MD5(%2$s))';
$user_id = $this->Conn->GetOne( sprintf($sql, $this->Conn->qstr($login_value), $this->Conn->qstr($password) ) );
}
if ($user_id) {
$object->Load($user_id);
if (!$this->checkBanRules($object)) {
$event->status = erFAIL;
return false;
}
if ($object->GetDBField('Status') == STATUS_ACTIVE) {
$groups = $object->getMembershipGroups(true);
if(!$groups) $groups = Array();
array_push($groups, $this->Application->ConfigValue('User_LoggedInGroup') );
$this->Application->StoreVar( 'UserGroups', implode(',', $groups) );
if ($this->checkLoginPermission($login_value)) {
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', $user_id);
$session->SetField('GroupList', implode(',', $groups) );
$this->Application->SetVar('u.current_id', $user_id);
$this->Application->StoreVar('user_id', $user_id);
$this->Application->LoadPersistentVars();
if (!$remember_login_cookie) {
// don't change last login time when auto-login is used
$this_login = (int)$this->Application->RecallPersistentVar('ThisLogin');
$this->Application->StorePersistentVar('LastLogin', $this_login);
$this->Application->StorePersistentVar('ThisLogin', adodb_mktime());
}
if ($this->Application->GetVar('cb_remember_login') == 1) {
// remember username & password when "Remember Login" checkbox us checked (when user is using login form on Front-End)
$remember_login_cookie = $login_value . '|' . md5($password);
$this->Application->Session->SetCookie('remember_login', $remember_login_cookie, adodb_mktime() + 2592000); // 30 days
}
}
else {
$object->Load(-2);
$object->SetError('ValidateLogin', 'no_permission', 'lu_no_permissions');
$event->status = erFAIL;
}
if (!$remember_login_cookie) {
$this->processLoginRedirect($event, $password);
}
}
else {
$event->redirect = $this->Application->GetVar('pending_disabled_template');
}
}
else
{
$object->SetID(-2);
$object->SetError('ValidateLogin', 'invalid_password', $invalid_pseudo);
$event->status = erFAIL;
}
$event->SetRedirectParam('pass', 'all');
// $event->SetRedirectParam('pass_category', 1); // to test
}
/**
* [HOOK] Auto-Logins Front-End user when "Remember Login" cookie is found
*
* @param kEvent $event
*/
function OnAutoLoginUser(&$event)
{
$remember_login_cookie = $this->Application->GetVar('remember_login');
if (!$remember_login_cookie || $this->Application->IsAdmin() || $this->Application->LoggedIn()) {
return ;
}
$event->CallSubEvent('OnLogin');
}
/**
* Checks that user is allowed to use super admin mode
*
* @return bool
*/
function verifySuperAdmin()
{
$sa_mode = ipMatch(defined('SA_IP') ? SA_IP : '');
return $sa_mode || $this->Application->isDebugMode();
}
/**
* Enter description here...
*
* @param string $user_name
* @return bool
*/
function checkLoginPermission($user_name)
{
$ret = true;
if ($this->Application->IsAdmin()) {
$modules_helper =& $this->Application->recallObject('ModulesHelper');
if ($user_name != 'root') {
// root is virtual user, so allow him to login to admin in any case
$ret = $this->Application->CheckPermission('ADMIN', 1);
}
$ret = $ret && $modules_helper->checkLogin();
}
else {
$ret = $this->Application->CheckPermission('LOGIN', 1);
}
return $ret;
}
/**
* Process all required data and redirect logged-in user
*
* @param kEvent $event
*/
function processLoginRedirect(&$event, $password)
{
$prefix_special = $this->Application->IsAdmin() ? 'u.current' : 'u'; // "u" used on front not to change theme
$object =& $this->Application->recallObject($prefix_special, null, Array('skip_autoload' => true));
$next_template = $this->Application->GetVar('next_template');
if ($next_template == '_ses_redirect') {
$location = $this->Application->BaseURL().$this->Application->RecallVar($next_template);
if( $this->Application->isDebugMode() && constOn('DBG_REDIRECT') )
{
$this->Application->Debugger->appendTrace();
echo "<b>Debug output above!!!</b> Proceed to redirect: <a href=\"$location\">$location</a><br>";
}
else {
header('Location: '.$location);
}
$session =& $this->Application->recallObject('Session');
$session->SaveData();
exit;
}
if ($next_template) {
$event->redirect = $next_template;
}
if ($this->Application->ConfigValue('UseJSRedirect')) {
$event->SetRedirectParam('js_redirect', 1);
}
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LoginUser', $object->GetDBField('Login'), $password);
$this->Application->resetCounters('UserSession');
}
/**
* Called when user logs in using old in-portal
*
* @param kEvent $event
*/
function OnInpLogin(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LoginUser', $event->getEventParam('user'), $event->getEventParam('pass') );
if ($event->redirect && is_string($event->redirect)) {
// some real template specified instead of true
$this->Application->Redirect($event->redirect, $event->redirect_params);
}
}
/**
* Called when user logs in using old in-portal
*
* @param kEvent $event
*/
function OnInpLogout(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LogoutUser');
}
function OnLogout(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LogoutUser');
$this->Application->HandleEvent($dummy, 'session-log:OnEndSession');
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', -2);
$this->Application->SetVar('u.current_id', -2);
$this->Application->StoreVar('user_id', -2);
$object =& $this->Application->recallObject('u.current', null, Array('skip_autoload' => true));
$object->Load(-2);
$this->Application->DestroySession();
$group_list = $this->Application->ConfigValue('User_GuestGroup').','.$this->Application->ConfigValue('User_LoggedInGroup');
$session->SetField('GroupList', $group_list);
$this->Application->StoreVar('UserGroups', $group_list);
if ($this->Application->ConfigValue('UseJSRedirect')) {
$event->SetRedirectParam('js_redirect', 1);
}
$this->Application->resetCounters('UserSession');
$this->Application->Session->SetCookie('remember_login', '', adodb_mktime() - 3600);
$event->SetRedirectParam('pass', 'all');
}
/**
* Prefill states dropdown with correct values
*
* @param kEvent $event
* @access public
*/
function OnPrepareStates(&$event)
{
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$cs_helper->PopulateStates($event, 'State', 'Country');
$object =& $event->getObject();
if( $object->isRequired('Country') && $cs_helper->CountryHasStates( $object->GetDBField('Country') ) ) $object->setRequired('State', true);
$object->setLogin();
}
/**
* Redirects user after succesfull registration to confirmation template (on Front only)
*
* @param kEvent $event
*/
function OnAfterItemCreate(&$event)
{
$this->saveUserImages($event);
if ($this->Application->GetVar('skip_set_primary')) return;
$is_subscriber = $this->Application->GetVar('IsSubscriber');
if(!$is_subscriber)
{
$object =& $event->getObject();
$ug_table = TABLE_PREFIX.'UserGroup';
if ($object->mode == 't') {
$ug_table = $this->Application->GetTempName($ug_table, 'prefix:'.$event->Prefix);
}
$sql = 'UPDATE '.$ug_table.'
SET PrimaryGroup = 0
WHERE PortalUserId = '.$object->GetDBField('PortalUserId');
$this->Conn->Query($sql);
// set primary group to user
if ($this->Application->IsAdmin() && $this->Application->GetVar('user_group')) {
// while in admin you can set any group for new users
$group_id = $this->Application->GetVar('user_group');
}
else {
$group_id = $object->GetDBField('UserGroup');
if ($group_id) {
// check, that group is allowed for Front-End
$sql = 'SELECT GroupId
FROM ' . TABLE_PREFIX . 'PortalGroup
WHERE GroupId = ' . (int)$group_id . ' AND FrontRegistration = 1';
$group_id = $this->Conn->GetOne($sql);
}
if (!$group_id) {
// when group not selected -> use default group
$group_id = $this->Application->ConfigValue('User_NewGroup');
}
}
$sql = 'REPLACE INTO '.$ug_table.'(PortalUserId,GroupId,PrimaryGroup) VALUES (%s,%s,1)';
$this->Conn->Query( sprintf($sql, $object->GetID(), $group_id) );
}
}
/**
* Login user if possible, if not then redirect to corresponding template
*
* @param kEvent $event
*/
function autoLoginUser(&$event)
{
$object =& $event->getObject();
$this->Application->SetVar('u.current_id', $object->GetID() );
if($object->GetDBField('Status') == STATUS_ACTIVE && !$this->Application->ConfigValue('User_Password_Auto'))
{
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
list($login_field, $submit_field) = $email_as_login ? Array('Email', 'email') : Array('Login', 'login');
$this->Application->SetVar($submit_field, $object->GetDBField($login_field) );
$this->Application->SetVar('password', $object->GetDBField('Password_plain') );
$event->CallSubEvent('OnLogin');
}
}
/**
* When creating user & user with such email exists then force to use OnUpdate insted of ?
*
* @param kEvent $event
*/
function OnSubstituteSubscriber(&$event)
{
$ret = false;
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
list($id, $field_values) = each($items_info);
$user_email = isset($field_values['Email']) ? $field_values['Email'] : false;
if($user_email)
{
// check if is subscriber
$verify_user =& $this->Application->recallObject('u.verify', null, Array('skip_autoload' => true) );
$verify_user->Load($user_email, 'Email');
if( $verify_user->isLoaded() && $verify_user->isSubscriberOnly() )
{
$items_info = Array( $verify_user->GetDBField('PortalUserId') => $field_values );
$this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
$ret = true;
}
}
}
if( isset($event->MasterEvent) )
{
$event->MasterEvent->setEventParam('is_subscriber_only', $ret);
}
else
{
$event->setEventParam('is_subscriber_only', $ret);
}
}
/**
* Enter description here...
*
* @param kEvent $event
* @return bool
*/
function isSubscriberOnly(&$event)
{
$event->CallSubEvent('OnSubstituteSubscriber');
$is_subscriber = false;
if( $event->getEventParam('is_subscriber_only') )
{
$is_subscriber = true;
$object =& $event->getObject( Array('skip_autoload' => true) );
$this->OnUpdate($event);
if($event->status == erSUCCESS)
{
$this->OnAfterItemCreate($event);
$object->SendEmailEvents();
if( !$this->Application->IsAdmin() && ($event->status == erSUCCESS) && $event->redirect) $this->autoLoginUser($event);
}
}
return $is_subscriber;
}
/**
* Creates new user
*
* @param kEvent $event
*/
function OnCreate(&$event)
{
if( !$this->Application->IsAdmin() ) $this->setUserStatus($event);
if( !$this->isSubscriberOnly($event) )
{
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$cs_helper->CheckStateField($event, 'State', 'Country');
$object =& $event->getObject( Array('skip_autoload' => true) );
/* @var $object kDBItem */
if ($this->Application->ConfigValue('User_Password_Auto')) {
$pass = makepassword4(rand(5,8));
$object->SetField('Password', $pass);
$object->SetField('VerifyPassword', $pass);
$this->Application->SetVar('user_password',$pass);
}
parent::OnCreate($event);
$this->Application->SetVar('u.current_id', $object->getID() ); // for affil:OnRegisterAffiliate after hook
$this->setNextTemplate($event);
if( !$this->Application->IsAdmin() && ($event->status == erSUCCESS) && $event->redirect)
{
$object->SendEmailEvents();
$this->autoLoginUser($event);
}
}
}
/**
* Set's new user status based on config options
*
* @param kEvent $event
*/
function setUserStatus(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$new_users_allowed = $this->Application->ConfigValue('User_Allow_New');
// 1 - Instant, 2 - Not Allowed, 3 - Pending
switch ($new_users_allowed)
{
case 1: // Instant
$object->SetDBField('Status', 1);
$next_template = $this->Application->GetVar('registration_confirm_template');
if($next_template) $event->redirect = $next_template;
break;
case 3: // Pending
$next_template = $this->Application->GetVar('registration_confirm_pending_template');
if($next_template) $event->redirect = $next_template;
$object->SetDBField('Status', 2);
break;
case 2: // Not Allowed
$object->SetDBField('Status', 0);
break;
}
/*if ($object->GetDBField('PaidMember') == 1) {
$this->Application->HandleEvent($add_to_cart, 'ord:OnAddToCart');
$event->redirect = 'in-commerce/checkout/shop_cart';
} */
}
/**
* Set's new unique resource id to user
*
* @param kEvent $event
*/
function OnBeforeItemCreate(&$event)
{
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
$object =& $event->getObject();
if (!$this->checkBanRules($object)) {
$event->status = erFAIL;
return false;
}
if ($email_as_login) {
$object->Fields['Email']['error_msgs']['unique'] = $this->Application->Phrase('lu_user_and_email_already_exist');
}
}
/**
* Set's new unique resource id to user
*
* @param kEvent $event
*/
function OnAfterItemValidate(&$event)
{
$object =& $event->getObject();
$resource_id = $object->GetDBField('ResourceId');
if (!$resource_id)
{
$object->SetDBField('ResourceId', $this->Application->NextResourceId() );
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnRecommend(&$event)
{
$friend_email = $this->Application->GetVar('friend_email');
$friend_name = $this->Application->GetVar('friend_email');
// used for error reporting only -> rewrite code + theme (by Alex)
$object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too
/* @var $object UsersItem */
if (preg_match('/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', $friend_email))
{
$send_params = array();
$send_params['to_email']=$friend_email;
$send_params['to_name']=$friend_name;
$user_id = $this->Application->RecallVar('user_id');
$email_event =& $this->Application->EmailEventUser('USER.SUGGEST', $user_id, $send_params);
if ($email_event->status == erSUCCESS){
$event->redirect_params = array('opener' => 's', 'pass' => 'all');
$event->redirect = $this->Application->GetVar('template_success');
}
else {
// $event->redirect_params = array('opener' => 's', 'pass' => 'all');
// $event->redirect = $this->Application->GetVar('template_fail');
$object->SetError('Email', 'send_error', 'lu_email_send_error');
$event->status = erFAIL;
}
}
else {
$object->SetError('Email', 'invalid_email', 'lu_InvalidEmail');
$event->status = erFAIL;
}
}
/**
* Saves address changes and mades no redirect
*
* @param kEvent $event
*/
function OnUpdateAddress(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
list($id,$field_values) = each($items_info);
if($id > 0) $object->Load($id);
$object->SetFieldsFromHash($field_values);
$object->setID($id);
$object->Validate();
}
$event->redirect = false;
}
/**
* Validate subscriber's email & store it to session -> redirect to confirmation template
*
* @param kEvent $event
*/
function OnSubscribeQuery(&$event)
{
$user_email = $this->Application->GetVar('subscriber_email');
if (preg_match('/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', $user_email)) {
$object =& $this->Application->recallObject($this->Prefix.'.subscriber', null, Array('skip_autoload' => true));
/* @var $object UsersItem */
$this->Application->StoreVar('SubscriberEmail', $user_email);
$object->Load($user_email, 'Email');
if ($object->isLoaded()) {
$group_info = $this->GetGroupInfo($object->GetID());
$event->redirect = $this->Application->GetVar($group_info ? 'unsubscribe_template' : 'subscribe_template');
}
else {
$event->redirect = $this->Application->GetVar('subscribe_template');
$this->Application->StoreVar('SubscriberEmail', $user_email);
}
}
else {
// used for error reporting only -> rewrite code + theme (by Alex)
$object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too
/* @var $object UsersItem */
$object->SetError('SubscribeEmail', 'invalid_email', 'lu_InvalidEmail');
$event->status = erFAIL;
}
}
/**
* Subscribe/Unsubscribe user based on email stored in previous step
*
* @param kEvent $event
*/
function OnSubscribeUser(&$event)
{
$object = &$this->Application->recallObject($this->Prefix.'.subscriber', null, Array('skip_autoload' => true));
/* @var $object UsersItem */
$user_email = $this->Application->RecallVar('SubscriberEmail');
if (preg_match('/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', $user_email)) {
$this->RemoveRequiredFields($object);
$object->Load($user_email, 'Email');
if ($object->isLoaded()) {
$group_info = $this->GetGroupInfo($object->GetID());
if ($group_info){
if ($event->getEventParam('no_unsubscribe')) return;
if ($group_info['PrimaryGroup']){
// delete user
$object->Delete();
}
else {
$this->RemoveSubscriberGroup($object->GetID());
}
$event->redirect = $this->Application->GetVar('unsubscribe_ok_template');
}
else {
$this->AddSubscriberGroup($object->GetID(), 0);
$event->redirect = $this->Application->GetVar('subscribe_ok_template');
}
}
else {
$object->SetField('Email', $user_email);
$object->SetField('Login', $user_email);
$object->SetDBField('dob', 1);
$object->SetDBField('dob_date', 1);
$object->SetDBField('dob_time', 1);
$object->SetDBField('Status', STATUS_ACTIVE); // make user subscriber Active by default
$ip = getenv('HTTP_X_FORWARDED_FOR')?getenv('HTTP_X_FORWARDED_FOR'):getenv('REMOTE_ADDR');
$object->SetDBField('ip', $ip);
$this->Application->SetVar('IsSubscriber', 1);
if ($object->Create()) {
$this->AddSubscriberGroup($object->GetID(), 1);
$event->redirect = $this->Application->GetVar('subscribe_ok_template');
}
$this->Application->SetVar('IsSubscriber', 0);
}
}
}
function AddSubscriberGroup($user_id, $is_primary){
$group_id = $this->Application->ConfigValue('User_SubscriberGroup');
$sql = 'INSERT INTO '.TABLE_PREFIX.'UserGroup(PortalUserId,GroupId,PrimaryGroup) VALUES (%s,%s,'.$is_primary.')';
$this->Conn->Query( sprintf($sql, $user_id, $group_id) );
$this->Application->EmailEventAdmin('USER.SUBSCRIBE', $user_id);
$this->Application->EmailEventUser('USER.SUBSCRIBE', $user_id);
}
function RemoveSubscriberGroup($user_id){
$group_id = $this->Application->ConfigValue('User_SubscriberGroup');
$sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup WHERE PortalUserId='.$user_id.' AND GroupId='.$this->Application->ConfigValue('User_SubscriberGroup');
$this->Conn->Query($sql);
$this->Application->EmailEventAdmin('USER.UNSUBSCRIBE', $user_id);
$this->Application->EmailEventUser('USER.UNSUBSCRIBE', $user_id);
}
/**
* Allows to detect user subscription status (subscribed or not)
*
* @param int $user_id
* @return bool
*/
function GetGroupInfo($user_id)
{
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'UserGroup
WHERE (PortalUserId = '.$user_id.') AND (GroupId = '.$this->Application->ConfigValue('User_SubscriberGroup').')';
return $this->Conn->GetRow($sql);
}
function OnForgotPassword(&$event)
{
$user_object =& $this->Application->recallObject('u.forgot', null, Array('skip_autoload' => true));
/* @var $user_object UsersItem */
// used for error reporting only -> rewrite code + theme (by Alex)
$user_current_object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too
/* @var $user_current_object UsersItem */
$username = $this->Application->GetVar('username');
$email = $this->Application->GetVar('email');
$found = false;
$allow_reset = true;
if (strlen($username)) {
$user_object->Load($username, 'Login');
if ($user_object->isLoaded()) {
$found = ($user_object->GetDBField("Login")==$username && $user_object->GetDBField("Status")==1) && strlen($user_object->GetDBField("Password"));
}
}
else if(strlen($email)) {
$user_object->Load($email, 'Email');
if ($user_object->isLoaded()) {
$found = ($user_object->GetDBField("Email")==$email && $user_object->GetDBField("Status")==1) && strlen($user_object->GetDBField("Password"));
}
}
if ($user_object->isLoaded()) {
$PwResetConfirm = $user_object->GetDBField('PwResetConfirm');
$PwRequestTime = $user_object->GetDBField('PwRequestTime');
$PassResetTime = $user_object->GetDBField('PassResetTime');
//$MinPwResetDelay = $user_object->GetDBField('MinPwResetDelay');
$MinPwResetDelay = $this->Application->ConfigValue('Users_AllowReset');
$allow_reset = (strlen($PwResetConfirm) ?
adodb_mktime() > $PwRequestTime + $MinPwResetDelay :
adodb_mktime() > $PassResetTime + $MinPwResetDelay);
}
if ($found && $allow_reset) {
$this->Application->StoreVar('tmp_user_id', $user_object->GetDBField("PortalUserId"));
$this->Application->StoreVar('tmp_email', $user_object->GetDBField("Email"));
$confirm_template = $this->Application->GetVar('reset_confirm_template');
if (!$confirm_template) {
$this->Application->SetVar('reset_confirm_template', 'platform/login/forgotpass_reset');
}
$this->Application->EmailEventUser('USER.PSWDC', $user_object->GetDBField('PortalUserId'));
$event->redirect = $this->Application->GetVar('template_success');
}
else {
if (!strlen($username) && !strlen($email)) {
$user_current_object->SetError('Login', 'forgotpw_nodata', 'lu_ferror_forgotpw_nodata');
$user_current_object->SetError('Email', 'forgotpw_nodata', 'lu_ferror_forgotpw_nodata');
}
else {
if ($allow_reset) {
if (strlen($username)) {
$user_current_object->SetError('Login', 'unknown_username', 'lu_ferror_unknown_username');
}
if (strlen($email)) {
$user_current_object->SetError('Email', 'unknown_email', 'lu_ferror_unknown_email');
}
}
else {
if (strlen($username)) {
$user_current_object->SetError('Login', 'reset_denied', 'lu_ferror_reset_denied');
}
if (strlen($email)) {
$user_current_object->SetError('Email', 'reset_denied', 'lu_ferror_reset_denied');
}
}
}
if($user_current_object->FieldErrors){
$event->redirect = false;
}
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnResetPassword(&$event)
{
$user_object =& $this->Application->recallObject('u.forgot');
if($user_object->Load($this->Application->RecallVar('tmp_user_id'))){
$this->Application->EmailEventUser('USER.PSWDC', $user_object->GetDBField("PortalUserId"));
$event->redirect = $this->Application->GetVar('template_success');
$m_cat_id = $this->Application->findModule('Name', 'In-Commerce', 'RootCat');
$this->Application->SetVar('m_cat_id', $m_cat_id);
$event->SetRedirectParam('pass', 'm');
}
}
function OnResetPasswordConfirmed(&$event)
{
// used for error reporting only -> rewrite code + theme (by Alex)
$user_current_object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true));// TODO: change theme too
/* @var $user_current_object UsersItem */
$passed_key = trim($this->Application->GetVar('user_key'));
if (!$passed_key) {
$event->redirect_params = Array('opener' => 's', 'pass' => 'all');
$event->redirect = false;
$user_current_object->SetError('PwResetConfirm', 'code_is_not_valid', 'lu_code_is_not_valid');
}
$user_object =& $this->Application->recallObject('u.forgot', null, Array('skip_autoload' => true));
/* @var $user_object UsersItem */
$user_object->Load($passed_key, 'PwResetConfirm');
if ($user_object->isLoaded()) {
$exp_time = $user_object->GetDBField('PwRequestTime') + 3600;
$user_object->SetDBField('PwResetConfirm', '');
$user_object->SetDBField('PwRequestTime', 0);
if ($exp_time > adodb_mktime()) {
$newpw = makepassword4();
$this->Application->StoreVar('password', $newpw);
$user_object->SetDBField('Password', $newpw);
$user_object->SetDBField('PassResetTime', adodb_mktime());
$user_object->SetDBField('PwResetConfirm', '');
$user_object->SetDBField('PwRequestTime', 0);
$user_object->Update();
$this->Application->SetVar('ForgottenPassword', $newpw);
$email_event_user =& $this->Application->EmailEventUser('USER.PSWD', $user_object->GetDBField('PortalUserId'));
$email_event_admin =& $this->Application->EmailEventAdmin('USER.PSWD');
$this->Application->DeleteVar('ForgottenPassword');
if ($email_event_user->status == erSUCCESS) {
$event->redirect_params = array('opener' => 's', 'pass' => 'all');
$event->redirect = $this->Application->GetVar('template_success');
}
$user_object->SetDBField('Password', md5($newpw));
$user_object->Update();
} else {
$user_current_object->SetError('PwResetConfirm', 'code_expired', 'lu_code_expired');
$event->redirect = false;
}
} else {
$user_current_object->SetError('PwResetConfirm', 'code_is_not_valid', 'lu_code_is_not_valid');
$event->redirect = false;
}
}
function OnUpdate(&$event)
{
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$cs_helper->CheckStateField($event, 'State', 'Country');
parent::OnUpdate($event);
$this->setNextTemplate($event);
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function setNextTemplate(&$event)
{
if( !$this->Application->IsAdmin() )
{
$event->redirect_params['opener'] = 's';
$object =& $event->getObject();
if($object->GetDBField('Status') == STATUS_ACTIVE)
{
$next_template = $this->Application->GetVar('next_template');
if($next_template) $event->redirect = $next_template;
}
}
}
/**
* Delete users from groups if their membership is expired
*
* @param kEvent $event
*/
function OnCheckExpiredMembership(&$event)
{
// send pre-expiration reminders: begin
$pre_expiration = adodb_mktime() + $this->Application->ConfigValue('User_MembershipExpirationReminder') * 3600 * 24;
$sql = 'SELECT PortalUserId, GroupId
FROM '.TABLE_PREFIX.'UserGroup
WHERE (MembershipExpires IS NOT NULL) AND (ExpirationReminderSent = 0) AND (MembershipExpires < '.$pre_expiration.')';
$skip_clause = $event->getEventParam('skip_clause');
if ($skip_clause) {
$sql .= ' AND !('.implode(') AND !(', $skip_clause).')';
}
$records = $this->Conn->Query($sql);
if ($records) {
$conditions = Array();
foreach ($records as $record) {
$email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRATION.NOTICE', $record['PortalUserId']);
$email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRATION.NOTICE');
$conditions[] = '(PortalUserId = '.$record['PortalUserId'].' AND GroupId = '.$record['GroupId'].')';
}
$sql = 'UPDATE '.TABLE_PREFIX.'UserGroup
SET ExpirationReminderSent = 1
WHERE '.implode(' OR ', $conditions);
$this->Conn->Query($sql);
}
// send pre-expiration reminders: end
// remove users from groups with expired membership: begin
$sql = 'SELECT PortalUserId
FROM '.TABLE_PREFIX.'UserGroup
WHERE (MembershipExpires IS NOT NULL) AND (MembershipExpires < '.adodb_mktime().')';
$user_ids = $this->Conn->GetCol($sql);
if ($user_ids) {
foreach ($user_ids as $id) {
$email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRED', $id);
$email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRED');
}
}
$sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup
WHERE (MembershipExpires IS NOT NULL) AND (MembershipExpires < '.adodb_mktime().')';
$this->Conn->Query($sql);
// remove users from groups with expired membership: end
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnRefreshForm(&$event)
{
$event->redirect = false;
$item_info = $this->Application->GetVar($event->Prefix_Special);
list($id, $fields) = each($item_info);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->setID($id);
$object->IgnoreValidation = true;
$object->SetFieldsFromHash($fields);
}
/**
* Sets persistant variable
*
* @param kEvent $event
*/
function OnSetPersistantVariable(&$event)
{
$field = $this->Application->GetVar('field');
$value = $this->Application->GetVar('value');
$this->Application->StorePersistentVar($field, $value);
$force_tab = $this->Application->GetVar('SetTab');
if ($force_tab) {
$this->Application->StoreVar('force_tab', $force_tab);
}
}
/**
* Overwritten to return user from order by special .ord
*
* @param kEvent $event
*/
function getPassedID(&$event)
{
switch ($event->Special) {
case 'ord':
$order =& $this->Application->recallObject('ord');
/* @var $order OrdersItem */
$id = $order->GetDBField('PortalUserId');
break;
case 'profile':
$id = $this->Application->GetVar('user_id');
if (!$id) {
// if none user_id given use current user id
$id = $this->Application->RecallVar('user_id');
}
break;
default:
$id = parent::getPassedID($event);
break;
}
return $id;
}
/**
* Allows to change root password
*
* @param kEvent $event
*/
function OnUpdateRootPassword(&$event)
{
return $this->OnUpdatePassword($event);
}
/**
* Allows to change root password
*
* @param kEvent $event
*/
function OnUpdatePassword(&$event)
{
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if (!$items_info) return ;
list ($id, $field_values) = each($items_info);
$user_id = $this->Application->RecallVar('user_id');
if ($id == $user_id && ($user_id > 0 || $user_id == -1)) {
$user_dummy =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true));
/* @var $user_dummy kDBItem */
$user_dummy->Load($id);
$status_field = array_shift($this->Application->getUnitOption($event->Prefix, 'StatusField'));
if ($user_dummy->GetDBField($status_field) != STATUS_ACTIVE) {
// not active user is not allowed to update his record (he could not activate himself manually)
return false;
}
}
if ($user_id == -1) {
$object =& $event->getObject( Array('skip_autoload' => true) );
/* @var $object UsersItem */
// put salt to user's config
$field_options = $object->GetFieldOptions('RootPassword');
$field_options['salt'] = 'b38';
$object->SetFieldOptions('RootPassword', $field_options);
$verify_options = $object->GetFieldOptions('VerifyRootPassword');
$verify_options['salt'] = 'b38';
$object->SetFieldOptions('VerifyRootPassword', $verify_options);
// this is internal hack to allow root/root passwords for dev
if ($this->Application->isDebugMode() && $field_values['RootPassword'] == 'root') {
$this->Application->ConfigHash['Min_Password'] = 4;
}
$this->RemoveRequiredFields($object);
$object->SetDBField('RootPassword', $this->Application->ConfigValue('RootPass'));
$object->SetFieldsFromHash($field_values);
$object->setID(-1);
$status = $object->Validate();
if ($status) {
// validation on, password match too
$fields_hash = Array (
'VariableValue' => $object->GetDBField('RootPassword')
);
$conf_table = $this->Application->getUnitOption('conf', 'TableName');
$this->Conn->doUpdate($fields_hash, $conf_table, 'VariableName = "RootPass"');
$event->SetRedirectParam('opener', 'u');
}
else {
$event->status = erFAIL;
$event->redirect = false;
return;
}
}
else {
$object =& $event->getObject();
$object->SetFieldsFromHash($field_values);
if (!$object->Update()) {
$event->status = erFAIL;
$event->redirect = false;
}
}
$event->SetRedirectParam('opener', 'u');
$event->redirect == true;
}
/**
* Apply custom processing to item
*
* @param kEvent $event
*/
function customProcessing(&$event, $type)
{
if ($event->Name == 'OnCreate' && $type == 'before') {
$object =& $event->getObject();
/* @var $object kDBItem */
// if auto password has not been set already - store real one - to be used in email events
if (!$this->Application->GetVar('user_password')) {
$this->Application->SetVar('user_password', $object->GetDirtyField('Password'));
$object->SetDBField('Password_plain', $object->GetDirtyField('Password'));
}
// validate here, because subscribing procedure should not validate captcha code
if ($this->Application->ConfigValue('RegistrationCaptcha')) {
$captcha_helper =& $this->Application->recallObject('CaptchaHelper');
/* @var $captcha_helper kCaptchaHelper */
$captcha_helper->validateCode($event, false);
}
}
}
function OnMassResetSettings(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$event->status=erSUCCESS;
$ids = $this->StoreSelectedIDs($event);
$default_user_id = $this->Application->ConfigValue('DefaultSettingsUserId');
if (in_array($default_user_id, $ids)) {
array_splice($ids, array_search($default_user_id, $ids), 1);
}
if ($ids) {
$q = 'DELETE FROM '.TABLE_PREFIX.'PersistantSessionData WHERE PortalUserId IN ('.join(',', $ids).') AND
(VariableName LIKE "%_columns_%"
OR
VariableName LIKE "%_filter%"
OR
VariableName LIKE "%_PerPage%")';
$this->Conn->Query($q);
}
$this->clearSelectedIDs($event);
}
/**
* Checks, that currently loaded item is allowed for viewing (non permission-based)
*
* @param kEvent $event
* @return bool
*/
function checkItemStatus(&$event)
{
$object =& $event->getObject();
if (!$object->isLoaded()) {
return true;
}
$virtual_users = Array (-1, -2); // root, Guest
return ($object->GetDBField('Status') == STATUS_ACTIVE) || in_array($object->GetID(), $virtual_users);
}
/**
* Sends approved/declined email event on user status change
*
* @param kEvent $event
*/
function OnAfterItemUpdate(&$event)
{
$this->saveUserImages($event);
$object =& $event->getObject();
/* @var $object UsersItem */
if (!$this->Application->IsAdmin() || $object->IsTempTable()) {
return ;
}
$this->sendStatusChangeEvent($object->GetID(), $object->GetOriginalField('Status'), $object->GetDBField('Status'));
}
/**
* Stores user's original Status before overwriting with data from temp table
*
* @param kEvent $event
*/
function OnBeforeDeleteFromLive(&$event)
{
$user_status = $this->Application->GetVar('user_status');
if (!$user_status) {
$user_status = Array ();
}
$user_id = $event->getEventParam('id');
if ($user_id > 0) {
$user_status[$user_id] = $this->getUserStatus($user_id);
$this->Application->SetVar('user_status', $user_status);
}
}
/**
* Sends approved/declined email event on user status change (in temp tables during editing)
*
* @param kEvent $event
*/
function OnAfterCopyToLive(&$event)
{
$temp_id = $event->getEventParam('temp_id');
if ($temp_id == 0) {
// this is new user create, don't send email events
return ;
}
$new_status = $this->getUserStatus($temp_id);
$user_status = $this->Application->GetVar('user_status');
$this->sendStatusChangeEvent($temp_id, $user_status[$temp_id], $new_status);
}
/**
* Returns user status (active, pending, disabled) based on ID and temp mode setting
*
* @param int $user_id
* @return int
*/
function getUserStatus($user_id)
{
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($this->Prefix, 'TableName');
$sql = 'SELECT Status
FROM '.$table_name.'
WHERE '.$id_field.' = '.$user_id;
return $this->Conn->GetOne($sql);
}
/**
* Sends approved/declined email event on user status change
*
* @param int $user_id
* @param int $prev_status
* @param int $new_status
*/
function sendStatusChangeEvent($user_id, $prev_status, $new_status)
{
$status_events = Array (
STATUS_ACTIVE => 'USER.APPROVE',
STATUS_DISABLED => 'USER.DENY',
);
$email_event = isset($status_events[$new_status]) ? $status_events[$new_status] : false;
if (($prev_status != $new_status) && $email_event) {
$this->Application->EmailEventUser($email_event, $user_id);
$this->Application->EmailEventAdmin($email_event);
}
}
/**
* OnAfterConfigRead for users
*
* @param kEvent $event
*/
function OnAfterConfigRead(&$event)
{
parent::OnAfterConfigRead($event);
// 1. arrange user registration countries
$first_country = $this->Application->ConfigValue('User_Default_Registration_Country');
if ($first_country) {
// update user country dropdown sql
$fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
$fields['Country']['options_sql'] = preg_replace('/ORDER BY (.*)/', 'ORDER BY IF (DestId = '.$first_country.', 1, 0) DESC, \\1', $fields['Country']['options_sql']);
$this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
}
// 2. set default user registration group
$virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields');
$virtual_fields['UserGroup']['default'] = $this->Application->ConfigValue('User_NewGroup');
$this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields);
// 3. allow avatar upload on Front-End
$file_helper =& $this->Application->recallObject('FileHelper');
/* @var $file_helper FileHelper */
$file_helper->createItemFiles($event->Prefix, true); // create image fields
if ($this->Application->IsAdmin()) {
// 4. when in administrative console, then create all users with Active status
$fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
// $fields['Password']['required'] = 1; // set password required (will broke approve/decline buttons)
$fields['Status']['default'] = STATUS_ACTIVE;
$this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
// 5. remove groups tab on editing forms when AdvancedUserManagement config variable not set
if (!$this->Application->ConfigValue('AdvancedUserManagement')) {
$edit_tab_presets = $this->Application->getUnitOption($event->Prefix, 'EditTabPresets');
foreach ($edit_tab_presets as $preset_name => $preset_tabs) {
if (array_key_exists('groups', $preset_tabs)) {
unset($edit_tab_presets[$preset_name]['groups']);
if (count($edit_tab_presets[$preset_name]) == 1) {
// only 1 tab left -> remove it too
$edit_tab_presets[$preset_name] = Array ();
}
}
}
$this->Application->setUnitOption($event->Prefix, 'EditTabPresets', $edit_tab_presets);
}
}
}
/**
* OnMassCloneUsers
*
* @param kEvent $event
*/
function OnMassCloneUsers(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$event->status=erSUCCESS;
$ids = $this->StoreSelectedIDs($event);
$this->Application->SetVar('skip_set_primary', 1); // otherwise it will default primary group, search for skip_set_primary above
$temp_handler =& $this->Application->recallObject($event->Prefix.'_TempHandler', 'kTempTablesHandler');
/* @var $temp_handler kTempTablesHandler */
$cloned_users = $temp_handler->CloneItems($event->Prefix, '', $ids);
$this->clearSelectedIDs($event);
}
/**
* When cloning users, reset password (set random)
*
* @param kEvent $event
*/
function OnBeforeClone(&$event)
{
$object =& $event->getObject();
/* @var $object kDBItem */
$object->setRequired('Password', 0);
$object->setRequired('VerifyPassword', 0);
$object->SetDBField('Password', rand(100000000, 999999999));
$object->SetDBField('CreatedOn', adodb_mktime());
$object->SetDBField('ResourceId', false); // this will reset it
// change email cause it should be unique
$object->NameCopy(array(), $object->GetID(), 'Email', 'copy%1$s.%2$s');
$object->UpdateFormattersSubFields();
}
/**
* Copy user groups after copying user
*
* @param kEvent $event
*/
function OnAfterClone(&$event)
{
$id = $event->getEventParam('id');
$original_id = $event->getEventParam('original_id');
$sql = 'INSERT '.TABLE_PREFIX."UserGroup SELECT $id, GroupId, MembershipExpires, PrimaryGroup, 0 FROM ".TABLE_PREFIX."UserGroup WHERE PortalUserId = $original_id";
$this->Conn->Query($sql);
}
/**
* Saves selected ids to session
*
* @param kEvent $event
*/
function OnSaveSelected(&$event)
{
$this->StoreSelectedIDs($event);
// remove current ID, otherwise group selector will use it in filters
$this->Application->DeleteVar($event->getPrefixSpecial(true).'_id');
}
/**
* Adds selected link to listing
*
* @param kEvent $event
*/
function OnProcessSelected(&$event)
{
$event->SetRedirectParam('opener', 'u');
$user_ids = $this->getSelectedIDs($event, true);
$this->clearSelectedIDs($event);
$dst_field = $this->Application->RecallVar('dst_field');
if ($dst_field != 'PrimaryGroupId') {
return ;
}
$group_ids = $this->Application->GetVar('g');
$primary_group_id = $group_ids ? array_shift( array_keys($group_ids) ) : false;
if (!$user_ids || !$primary_group_id) {
return ;
}
$table_name = $this->Application->getUnitOption('ug', 'TableName');
$sql = 'SELECT PortalUserId
FROM '.$table_name.'
WHERE (GroupId = '.$primary_group_id.') AND (PortalUserId IN ('.implode(',', $user_ids).'))';
$existing_members = $this->Conn->GetCol($sql);
// 1. reset primary group mark
$sql = 'UPDATE '.$table_name.'
SET PrimaryGroup = 0
WHERE PortalUserId IN ('.implode(',', $user_ids).')';
$this->Conn->Query($sql);
foreach ($user_ids as $user_id) {
if (in_array($user_id, $existing_members)) {
// 2. already member of that group -> just make primary
$sql = 'UPDATE '.$table_name.'
SET PrimaryGroup = 1
WHERE (PortalUserId = '.$user_id.') AND (GroupId = '.$primary_group_id.')';
$this->Conn->Query($sql);
}
else {
// 3. not member of that group -> make member & make primary
$fields_hash = Array (
'GroupId' => $primary_group_id,
'PortalUserId' => $user_id,
'PrimaryGroup' => 1,
);
$this->Conn->doInsert($fields_hash, $table_name);
}
}
}
/**
* Loads user images
*
* @param kEvent $event
*/
function OnAfterItemLoad(&$event)
{
parent::OnAfterItemLoad($event);
// linking existing images for item with virtual fields
$image_helper =& $this->Application->recallObject('ImageHelper');
/* @var $image_helper ImageHelper */
$object =& $event->getObject();
/* @var $object kDBItem */
$image_helper->LoadItemImages($object);
}
/**
* Save user images
*
* @param kEvent $event
*/
function saveUserImages(&$event)
{
if (!$this->Application->IsAdmin()) {
$image_helper =& $this->Application->recallObject('ImageHelper');
/* @var $image_helper ImageHelper */
$object =& $event->getObject();
/* @var $object kDBItem */
// process image upload in virtual fields
$image_helper->SaveItemImages($object);
}
}
/**
* Checks, if given user fields matches at least one of defined ban rules
*
* @param kDBItem $object
* @return bool
*/
function checkBanRules(&$object)
{
$table = $this->Application->getUnitOption('ban-rule', 'TableName');
if (!$this->Conn->TableFound($table)) {
// when ban table not found -> assume user is ok by default
return true;
}
$sql = 'SELECT *
FROM '.$table.'
WHERE ItemType = 6 AND Status = ' . STATUS_ACTIVE . '
ORDER BY Priority DESC';
$rules = $this->Conn->Query($sql);
$found = false;
foreach ($rules as $rule) {
$field = $rule['ItemField'];
$this_value = strtolower( $object->GetDBField($field) );
$test_value = strtolower( $rule['ItemValue'] );
switch ($rule['ItemVerb']) {
/*case 0: // any
$found = true;
break;*/
case 1: // is
if ($this_value == $test_value) {
$found = true;
}
break;
/*case 2: // is not
if ($this_value != $test_value) {
$found = true;
}
break;*/
case 3: // contains
if (strstr($this_value, $test_value)) {
$found = true;
}
break;
/*case 4: // not contains
if (!strstr($this_value, $test_value)) {
$found = true;
}
break;
case 5: // Greater Than
if ($test_value > $this_value) {
$found = true;
}
break;
case 6: // Less Than
if ($test_value < $this_value) {
$found = true;
}
break;
case 7: // exists
if (strlen($this_value) > 0) {
$found = true;
}
break;
case 8: // unique
if ($this->ValueExists($field, $this_value)) {
$found = true;
}
break;*/
}
if ($found) {
break;
}
}
return !$found;
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/users/users_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.87.2.29
\ No newline at end of property
+1.87.2.30
\ No newline at end of property
Index: branches/RC/core/units/users/users_config.php
===================================================================
--- branches/RC/core/units/users/users_config.php (revision 11537)
+++ branches/RC/core/units/users/users_config.php (revision 11538)
@@ -1,337 +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! (#u_recordcount#)",
+ '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! (#u-img_recordcount#)"),
- 'user_edit_groups' => Array ('prefixes' => Array ('u', 'u-ug_List'), 'format' => "#u_status# '#u_titlefield#' - !la_title_Groups! (#u-ug_recordcount#)"),
+ '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!"),
- 'admins_list' => Array ('prefixes' => Array ('u.admins_List'), 'format' => "!la_title_Administrators! (#u.admins_recordcount#)"),
+ '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! (#u.regular_recordcount#)"),
+ '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#'",
),
- 'users_select' => Array ('prefixes' => Array ('u_List'), 'format' => "!la_title_Users! (#u_recordcount#) - !la_title_SelectUser!"),
+ '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),
),
- 'RegularUsers' => 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),
- ),
-
'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'),
),
),
// 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'),
),
),
// 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.18
\ No newline at end of property
+1.40.2.19
\ No newline at end of property
Index: branches/RC/core/units/files/files_config.php
===================================================================
--- branches/RC/core/units/files/files_config.php (revision 11537)
+++ branches/RC/core/units/files/files_config.php (revision 11538)
@@ -1,84 +1,84 @@
<?php
$config = Array (
'Prefix' => '#file',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'FileEventHandler', 'file' => 'file_eh.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'FileTagProcessor', 'file' => 'file_tp.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array (
1 => 'id',
2 => 'page',
3 => 'event',
),
'IDField' => 'FileId',
'StatusField' => Array('Status'),
'TitleField' => 'FileName',
'TableName' => TABLE_PREFIX.'ItemFiles',
'ParentTableKey' => 'ResourceId',
'ForeignKey' => 'ResourceId',
'AutoDelete' => true,
'AutoClone' => true,
'FilterMenu' => Array (
'Groups' => Array (
Array ('mode' => 'AND', 'filters' => Array ('show_active','show_disabled'), 'type' => WHERE_FILTER),
),
'Filters' => Array(
'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
)
),
'ListSQLs' => Array (
'' => 'SELECT * FROM %s',
),
'ItemSQLs' => Array (
'' => 'SELECT * FROM %s',
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('FileName' => 'asc'),
)
),
'Fields' => Array (
'FileId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'ResourceId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'FileName' => Array ('type' => 'string', 'max_len' => 255, 'required' => 1, 'not_null' => 1, 'default' => ''),
'FilePath' => Array (
'type' => 'string', 'max_len' => 255,
'formatter' => 'kUploadFormatter', 'upload_dir' => ITEM_FILES_PATH, 'include_path' => false,
'size_field' => 'Size', 'content_type_field' => 'MimeType', 'max_size' => 50000000,
'allowed_types' => Array ('video/x-flv', 'video/quicktime', 'video/x-sgi-movie', 'video/mpeg', 'video/x-msvideo', 'video/x-msvideo', 'application/x-shockwave-flash', 'video/x-fli', 'application/pdf', 'application/msexcel', 'application/vnd.ms-excel', 'application/msword', 'application/mspowerpoint', 'application/zip', 'plain/text', 'application/x-gzip'),
'not_null' => 1, 'required' => 1, 'default' => ''
),
'Size' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Enabled', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1, 'default' => '#NOW#'),
'CreatedById' => Array ('type' => 'int', 'not_null' => 1, 'default' => -1),
'MimeType' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array (1 => 'icon16_file.gif', 0 => 'icon16_file_disabled.gif'),
'Fields' => Array(
- 'FileId' => Array ('title' => 'la_col_Id' , 'data_block' => 'grid_checkbox_td', 'module' => 'In-Portal'),
- 'FileName' => Array ('title' => 'la_col_FileName'),
- 'Status' => Array ('title' => 'la_col_Status'),
+ 'FileId' => Array ('title' => 'la_col_Id' , 'data_block' => 'grid_checkbox_td', 'module' => 'In-Portal', 'filter_block' => 'grid_range_filter'),
+ 'FileName' => Array ('title' => 'la_col_FileName', '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/files/files_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.8
\ No newline at end of property
+1.1.2.9
\ No newline at end of property
Index: branches/RC/core/units/selectors/selectors_config.php
===================================================================
--- branches/RC/core/units/selectors/selectors_config.php (revision 11537)
+++ branches/RC/core/units/selectors/selectors_config.php (revision 11538)
@@ -1,134 +1,134 @@
<?php
$config = Array(
'Prefix' => 'selectors',
'ItemClass' => Array('class'=>'SelectorsItem','file'=>'selectors_item.php','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'SelectorsEventHandler','file'=>'selectors_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'SelectorsTagProcessor','file'=>'selectors_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
-
+
'Clones' => Array(
'selectorsbase' => Array(
'Hooks' => Array(),
'Constrain' => 'Type = 1',
'SubItems' => Array('selectorsblock'),
),
-
+
'selectorsblock' => Array(
'Hooks' => Array(),
'Constrain' => 'Type = 2',
'ForeignKey' => Array('css' => 'StylesheetId', 'selectorsbase' => 'ParentId'),
'ParentTableKey' => Array('css' => 'StylesheetId', 'selectorsbase' => 'SelectorId'),
'ParentPrefix' => 'selectorsbase',
),
),
-
- 'Hooks' => Array(
+
+ 'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'selectors',
'HookToSpecial' => '',
'HookToEvent' => Array('OnItemBuild'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnPrepareBaseStyles',
),
-
+
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'selectors',
'HookToSpecial' => 'block',
'HookToEvent' => Array('OnListBuild'),
'DoPrefix' => '',
'DoSpecial' => 'block',
'DoEvent' => 'OnPrepareBaseStyles',
),
),
-
+
'MyHooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => Array('Prefix1.*', 'Prefix2.Special1'),
'HookToEvents' => Array('OnBeforeItemUpdate', 'OnBeforeItemCreate'),
'DoPrefix' => Array('Prefix1.*', 'Prefix2.Special1'),
'DoEvent' => 'OnMyEvent',
),
),
-
+
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
),
'IDField' => 'SelectorId',
-
+
'TitleField' => 'Name',
-
+
'TableName' => TABLE_PREFIX.'StylesheetSelectors',
-
+
'ForeignKey' => 'StylesheetId',
'ParentTableKey' => 'StylesheetId',
- 'ParentPrefix' => 'css',
+ 'ParentPrefix' => 'css',
'AutoDelete' => true,
'AutoClone' => true,
-
+
'ListSQLs' => Array( ''=>' SELECT %1$s.*
FROM %s',
), // key - special, value - list select sql
'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
),
- 'ListSortings' => Array(
+ 'ListSortings' => Array(
'' => Array(
'Sorting' => Array('Name' => 'asc'),
)
- ),
+ ),
'Fields' => Array(
'SelectorId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'StylesheetId' => Array('type' => 'int', 'unique'=>Array('SelectorName'), 'current_table_only' => 1, 'not_null' => 1, 'default' => 0),
'Name' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
'SelectorName' => Array('type' => 'string', 'unique'=>Array('StylesheetId'), 'current_table_only' => 1, 'not_null' => '1','default' => '','required'=>1),
'SelectorData' => Array('type' => 'string', 'not_null' => '1','default' => ''),
'Description' => Array('type' => 'string','not_null' => '1','default' => ''),
'Type' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array( 1 => 'la_BaseSelectors', 2 => 'la_BlockSelectors'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'AdvancedCSS' => Array('type' => 'string','not_null' => '1','default' => ''),
'ParentId' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'required' => 1, 'not_null' => 1, 'default' => 0),
),
'VirtualFields' => Array(
'FontStyle' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','normal'=>'normal','italic'=>'italic','oblique'=>'oblique'), 'default'=>'' ),
'FontWeight' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','100'=>'100','200'=>'200','300'=>'300','normal'=>'normal','500'=>'500','600'=>'600','bold'=>'bold','800'=>'800','900'=>'900','lighter'=>'lighter','bolder'=>'bolder') ),
'StyleCursor' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','default'=>'default','auto'=>'auto','n-resize'=>'n-resize','ne-resize'=>'ne-resize','e-resize'=>'e-resize','se-resize'=>'se-resize','s-resize'=>'s-resize','sw-resize'=>'sw-resize','w-resize'=>'w-resize','nw-resize'=>'nw-resize','crosshair'=>'crosshair','pointer'=>'pointer','move'=>'move','text'=>'text','wait'=>'wait','help'=>'help','hand'=>'hand','all-scroll'=>'all-scroll','col-resize'=>'col-resize','row-resize'=>'row-resize','no-drop'=>'no-drop','not-allowed'=>'not-allowed','progress'=>'progress','vertical-text'=>'vertical-text','alias'=>'alias','cell'=>'cell','copy'=>'copy','count-down'=>'count-down','count-up'=>'count-up','count-up-down'=>'count-up-down','grab'=>'grab','grabbing'=>'grabbing','spinning'=>'spinning') ),
'StyleDisplay' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','none'=>'none','inline'=>'inline','block'=>'block','inline-block'=>'inline-block','list-item'=>'list-item','marker'=>'marker','compact'=>'compact','run-in'=>'run-in','table-header-group'=>'table-header-group','table-footer-group'=>'table-footer-group','table'=>'table','inline-table'=>'inline-table','table-caption'=>'table-caption','table-row'=>'table-row','table-row-group'=>'table-row-group','table-column'=>'table-column','table-column-group'=>'table-column-group') ),
'TextAlign' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','left'=>'left','right'=>'right','center'=>'center','justify'=>'justify') ),
'TextDecoration' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','none'=>'none','underline'=>'underline','overline'=>'overline','line-through'=>'line-through','blink'=>'blink') ),
'StyleVisibility' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','visible'=>'visible','hidden'=>'hidden','collapse'=>'collapse') ),
'StylePosition' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','static'=>'static','relative'=>'relative','absolute'=>'absolute','fixed'=>'fixed') ),
),
-
+
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_selector.gif'),
'Fields' => Array(
- 'Name' => Array( 'title'=>'la_col_Name', 'data_block' => 'grid_checkbox_td'),
- 'SelectorName' => Array( 'title'=>'la_col_SelectorName'),
- 'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'grid_description_td' ),
+ 'Name' => Array( 'title'=>'la_col_Name', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_like_filter'),
+ 'SelectorName' => Array( 'title'=>'la_col_SelectorName', 'filter_block' => 'grid_like_filter'),
+ 'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'grid_description_td', 'filter_block' => 'grid_like_filter'),
),
),
-
+
'BlockStyles' => Array(
'Icons' => Array('default'=>'icon16_selector.gif'),
'Fields' => Array(
- 'Name' => Array( 'title'=>'la_col_Name', 'data_block' => 'grid_checkbox_td'),
- 'SelectorName' => Array( 'title'=>'la_col_SelectorName'),
- 'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'grid_description_td' ),
- 'ParentId' => Array('title'=>'la_col_Basedon'),
+ 'Name' => Array( 'title'=>'la_col_Name', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_like_filter'),
+ 'SelectorName' => Array( 'title'=>'la_col_SelectorName', 'filter_block' => 'grid_like_filter'),
+ 'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'grid_description_td', 'filter_block' => 'grid_like_filter'),
+ 'ParentId' => Array('title'=>'la_col_Basedon', 'filter_block' => 'grid_options_filter'),
),
),
),
);
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/selectors/selectors_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.10
\ No newline at end of property
+1.10.2.1
\ No newline at end of property
Index: branches/RC/core/units/logs/session_logs/session_logs_config.php
===================================================================
--- branches/RC/core/units/logs/session_logs/session_logs_config.php (revision 11537)
+++ branches/RC/core/units/logs/session_logs/session_logs_config.php (revision 11538)
@@ -1,133 +1,137 @@
<?php
$config = Array (
'Prefix' => 'session-log',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'SessionLogEventHandler', 'file' => 'session_log_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',
),
'IDField' => 'SessionLogId',
'StatusField' => Array ('Status'),
'TableName' => TABLE_PREFIX.'SessionLogs',
+ 'TitlePresets' => Array (
+ 'session_log_list' => Array ('prefixes' => Array('session-log_List'), 'format' => '!la_tab_SessionLogs!',),
+ ),
+
'PermSection' => Array('main' => 'in-portal:session_logs'),
// don't forget to add corresponding permissions to install script
// INSERT INTO Permissions VALUES (0, 'in-portal:session_logs.view', 11, 1, 1, 0), (0, 'in-portal:session_logs.delete', 11, 1, 1, 0);
'Sections' => Array (
'in-portal:session_logs' => Array (
'parent' => 'in-portal:reports',
'icon' => 'conf_general',
'label' => 'la_tab_SessionLogs',
'url' => Array('t' => 'logs/session_logs/session_log_list', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 0.1,
'show_mode' => smSUPER_ADMIN,
'type' => stTREE,
),
),
'TitleField' => 'SessionLogId',
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser AS u ON u.PortalUserId = %1$s.PortalUserId',
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('SessionLogId' => 'desc'),
)
),
'CalculatedFields' => Array(
'' => Array(
'UserLogin' => 'IF(%1$s.PortalUserId=-1, \'root\', u.Login)',
'UserFirstName' => 'u.FirstName',
'UserLastName' => 'u.LastName',
'UserEmail' => 'u.Email',
'Duration' => 'IFNULL(SessionEnd, UNIX_TIMESTAMP())-SessionStart',
),
),
'Fields' => Array (
'SessionLogId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'PortalUserId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'SessionId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Status' => Array (
'type' => 'int', 'formatter' => 'kOptionsFormatter',
'options'=> array(0=>'la_Active',1=>'la_LoggedOut',2=>'la_Expired'),
'use_phrases' => 1,
'not_null' => 1, 'default' => 1
),
'SessionStart' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1, 'time_format' => 'H:i:s', 'default' => 0),
'SessionEnd' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'time_format' => 'H:i:s', 'default' => NULL),
'IP' => Array ('type' => 'string', 'max_len' => 15, 'not_null' => 1, 'default' => ''),
'AffectedItems' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
),
'VirtualFields' => Array(
'Duration' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1, 'date_format' => '', 'time_format' => 'H:i:s', 'use_timezone' => false, 'default' => 0),
),
'Grids' => Array (
'Default' => Array (
'Fields' => Array (
'SessionLogId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ),
'PortalUserId' => Array ('title' => 'la_col_PortalUserId', 'filter_block' => 'grid_like_filter',),
'UserLogin' => Array ('title' => 'la_col_Username', 'filter_block' => 'grid_like_filter',),
'UserFirstName' => Array ('title' => 'la_col_FirstName', 'filter_block' => 'grid_like_filter',),
'UserLastName' => Array ('title' => 'la_col_LastName', 'filter_block' => 'grid_like_filter',),
'SessionStart' => Array ('title' => 'la_col_SessionStart', 'filter_block' => 'grid_date_range_filter', ),
'SessionEnd' => Array ('title' => 'la_col_SessionEnd', 'filter_block' => 'grid_date_range_filter', ),
'Duration' => Array ('title' => 'la_col_Duration', 'filter_block' => 'grid_range_filter', ),
'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', ),
'IP' => Array ('title' => 'la_col_IP', 'filter_block' => 'grid_like_filter',),
'AffectedItems' => Array ('title' => 'la_col_AffectedItems', 'data_block' => 'affected_td'),
),
),
),
'ConfigMapping' => Array(
'PerPage' => 'Perpage_SessionLogs',
),
);
/* !!! Copy the rest of the file to appropriate files and templates
* !!! DON'T FORGET TO CREAT FIELDS AND GRIDS USING SYSTEM TOOLS SECTION !!!
/*
Don't forget to:
- Add table create statement to install_schema.sql
CREATE TABLE SessionLogs (
`SessionLogId` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`Title` VARCHAR( 255 ) NOT NULL ,
`Description` TEXT NULL ,
`Email` VARCHAR( 255 ) NOT NULL ,
`Type` TINYINT NOT NULL ,
`Phone` VARCHAR( 50 ) NOT NULL ,
`Qty` DOUBLE NOT NULL ,
`Status` TINYINT NOT NULL ,
`CreatedOn` INT NOT NULL ,
`Good` TINYINT NOT NULL
)
- Add permissions for admin gorup to install script (see 'Sections' key above)
*/
\ No newline at end of file
Property changes on: branches/RC/core/units/logs/session_logs/session_logs_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/logs/change_logs/change_logs_config.php
===================================================================
--- branches/RC/core/units/logs/change_logs/change_logs_config.php (revision 11537)
+++ branches/RC/core/units/logs/change_logs/change_logs_config.php (revision 11538)
@@ -1,158 +1,159 @@
<?php
$config = Array (
'Prefix' => 'change-log',
'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'),
'RegisterClasses' => Array (
Array ('pseudo' => 'kChangesFormatter', 'class' => 'kChangesFormatter', 'file' => 'changes_formatter.php', 'build_event' => '', 'require_classes' => 'kFormatter'),
),
'AutoLoad' => true,
'QueryString' => Array (
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'ChangeLogId',
'StatusField' => Array ('Status'),
'TableName' => TABLE_PREFIX.'ChangeLogs',
'TitlePresets' => Array (
'default' => Array (
'new_status_labels' => Array ('change-log' => '!la_title_AddingChangeLog!'),
'edit_status_labels' => Array ('change-log' => '!la_title_EditingChangeLog!'),
),
+ 'change_log_list' => Array ('prefixes' => Array('change-log_List'), 'format' => '!la_tab_ChangeLog!',),
'changelog_edit' => Array ('prefixes' => Array('change-log'), 'format' => '#change-log_status# #change-log_titlefield#',),
),
'PermSection' => Array ('main' => 'in-portal:change_logs'),
// don't forget to add corresponding permissions to install script
// INSERT INTO Permissions VALUES (0, 'in-portal:change_logs.view', 11, 1, 1, 0), (0, 'in-portal:change_logs.add', 11, 1, 1, 0), (0, 'in-portal:change_logs.edit', 11, 1, 1, 0), (0, 'in-portal:change_logs.delete', 11, 1, 1, 0);
'Sections' => Array (
'in-portal:change_logs' => Array (
'parent' => 'in-portal:reports',
'icon' => 'change_logs',
'label' => 'la_tab_ChangeLog',
'url' => Array('t' => 'logs/change_logs/change_log_list', 'pass' => 'm'),
'permissions' => Array('view', 'edit', 'delete'),
'priority' => 0.2,
'show_mode' => smSUPER_ADMIN,
'type' => stTREE,
),
),
'TitleField' => 'ChangeLogId',
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser AS u ON u.PortalUserId = %1$s.PortalUserId',
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('OccuredOn' => 'desc'),
)
),
'CalculatedFields' => Array (
'' => Array (
'UserLogin' => 'IF(%1$s.PortalUserId = -1, \'root\', u.Login)',
'UserFirstName' => 'u.FirstName',
'UserLastName' => 'u.LastName',
'UserEmail' => 'u.Email',
),
),
'Fields' => Array (
'ChangeLogId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'PortalUserId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'SessionLogId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Action' => Array (
'type' => 'int', 'formatter' => 'kOptionsFormatter',
'options' => array (clCREATE => 'la_opt_ActionCreate', clUPDATE => 'la_opt_ActionUpdate', clDELETE => 'la_opt_ActionDelete'),
'use_phrases' => 1,
'not_null' => 1, 'default' => 0
),
'OccuredOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'time_format' => 'H:i:s', 'not_null' => 1, 'default' => 0),
'Prefix' => Array (
'type' => 'string', 'formatter' => 'kOptionsFormatter',
'options_sql' => 'SELECT DISTINCT %s FROM '.TABLE_PREFIX.'ChangeLogs ORDER BY Phrase',
'option_key_field' => 'Prefix',
'option_title_field' => 'CONCAT(\'la_prefix_\', Prefix) AS Phrase',
'use_phrases' => 1,
'max_len' => 255, 'not_null' => 1, 'default' => ''
),
'ItemId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Changes' => Array ('type' => 'string', 'formatter' => 'kChangesFormatter', 'not_null' => 1, 'default' => ''),
'MasterPrefix' => Array (
'type' => 'string', 'formatter' => 'kOptionsFormatter',
'options_sql' => 'SELECT DISTINCT %s FROM '.TABLE_PREFIX.'ChangeLogs ORDER BY Phrase',
'option_key_field' => 'MasterPrefix',
'option_title_field' => 'CONCAT(\'la_prefix_\',MasterPrefix) AS Phrase',
'use_phrases' => 1,
'max_len' => 255, 'not_null' => 1, 'default' => ''
),
'MasterId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
),
'Grids' => Array (
'Default' => Array (
'Fields' => Array (
'ChangeLogId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter',),
'PortalUserId' => Array ('title' => 'la_col_PortalUserId', 'filter_block' => 'grid_like_filter',),
'UserLogin' => Array ('title' => 'la_col_Username', 'filter_block' => 'grid_like_filter',),
'UserFirstName' => Array ('title' => 'la_col_FirstName', 'filter_block' => 'grid_like_filter',),
'UserLastName' => Array ('title' => 'la_col_LastName', 'filter_block' => 'grid_like_filter',),
'SessionLogId' => Array ('title' => 'la_col_SessionLogId', 'filter_block' => 'grid_like_filter',),
'Action' => Array ('title' => 'la_col_Action', 'filter_block' => 'grid_options_filter', ),
'OccuredOn' => Array ('title' => 'la_col_OccuredOn', 'filter_block' => 'grid_date_range_filter',),
'MasterPrefix' => Array ('title' => 'la_col_MasterPrefix', 'filter_block' => 'grid_options_filter', ),
'MasterId' => Array ('title' => 'la_col_MasterId', 'filter_block' => 'grid_range_filter',),
'Prefix' => Array ('title' => 'la_col_ItemPrefix', 'filter_block' => 'grid_options_filter', ),
'ItemId' => Array ('title' => 'la_col_ItemId', 'filter_block' => 'grid_range_filter',),
'Changes' => Array ('title' => 'la_col_Changes', 'data_block' => 'grid_changes_td', 'filter_block' => 'grid_like_filter',),
),
),
),
'ConfigMapping' => Array(
'PerPage' => 'Perpage_ChangeLog',
),
);
/* !!! Copy the rest of the file to appropriate files and templates
* !!! DON'T FORGET TO CREAT FIELDS AND GRIDS USING SYSTEM TOOLS SECTION !!!
/*
Don't forget to:
- Add table create statement to install_schema.sql
CREATE TABLE ChangeLogs (
`ChangeLogId` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`Title` VARCHAR( 255 ) NOT NULL ,
`Description` TEXT NULL ,
`Email` VARCHAR( 255 ) NOT NULL ,
`Type` TINYINT NOT NULL ,
`Phone` VARCHAR( 50 ) NOT NULL ,
`Qty` DOUBLE NOT NULL ,
`Status` TINYINT NOT NULL ,
`CreatedOn` INT NOT NULL ,
`Good` TINYINT NOT NULL
)
- Add permissions for admin gorup to install script (see 'Sections' key above)
*/
\ No newline at end of file
Property changes on: branches/RC/core/units/logs/change_logs/change_logs_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/units/logs/search_logs/search_logs_config.php
===================================================================
--- branches/RC/core/units/logs/search_logs/search_logs_config.php (revision 11537)
+++ branches/RC/core/units/logs/search_logs/search_logs_config.php (revision 11538)
@@ -1,76 +1,76 @@
<?php
$config = Array (
'Prefix' => 'search-log',
'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' => 'SearchLogId',
'TableName' => TABLE_PREFIX . 'SearchLog',
'TitlePresets' => Array (
- 'search_log_list' => Array ('prefixes' => Array('search-log_List'), 'format' => '!la_tab_SearchLog! (#search-log_recordcount#)',),
+ 'search_log_list' => Array ('prefixes' => Array('search-log_List'), 'format' => '!la_tab_SearchLog!',),
),
'PermSection' => Array ('main' => 'in-portal:searchlog'),
'Sections' => Array (
'in-portal:searchlog' => Array (
'parent' => 'in-portal:reports',
'icon' => 'search_log',
'label' => 'la_tab_SearchLog',
'url' => Array('t' => 'logs/search_logs/search_log_list', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 2,
'type' => stTREE,
),
),
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s FROM %1$s',
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('Keyword' => 'asc'),
)
),
'Fields' => Array (
'SearchLogId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Keyword' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
'Indices' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'SearchType' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_Text_Simple', 1 => 'la_Text_Advanced'), 'use_phrases' => 1,
'not_null' => 1, 'default' => 0
),
),
'Grids' => Array (
'Default' => Array (
'Fields' => Array (
'SearchLogId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter',),
'SearchType' => Array ('title' => 'la_prompt_SearchType', 'filter_block' => 'grid_options_filter', ),
'Keyword' => Array ('title' => 'la_col_Keyword', 'filter_block' => 'grid_like_filter', ),
'Indices' => Array ('title' => 'la_prompt_Frequency', 'filter_block' => 'grid_range_filter', ),
),
),
),
'ConfigMapping' => Array(
'PerPage' => 'Perpage_SearchLog',
),
);
\ No newline at end of file
Property changes on: branches/RC/core/units/logs/search_logs/search_logs_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/logs/email_logs/email_logs_config.php
===================================================================
--- branches/RC/core/units/logs/email_logs/email_logs_config.php (revision 11537)
+++ branches/RC/core/units/logs/email_logs/email_logs_config.php (revision 11538)
@@ -1,79 +1,79 @@
<?php
$config = Array (
'Prefix' => 'email-log',
'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' => 'EmailLogId',
'TableName' => TABLE_PREFIX . 'EmailLog',
'TitlePresets' => Array (
- 'email_log_list' => Array ('prefixes' => Array('email-log_List'), 'format' => '!la_tab_EmailLog! (#email-log_recordcount#)',),
+ 'email_log_list' => Array ('prefixes' => Array('email-log_List'), 'format' => '!la_tab_EmailLog!',),
),
'PermSection' => Array ('main' => 'in-portal:emaillog'),
'Sections' => Array (
'in-portal:emaillog' => Array (
'parent' => 'in-portal:reports',
'icon' => 'email_log',
'label' => 'la_tab_EmailLog',
'url' => Array('t' => 'logs/email_logs/email_log_list', 'pass' => 'm'),
'permissions' => Array ('view', 'delete'),
'priority' => 4,
'type' => stTREE,
),
),
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s FROM %1$s',
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('timestamp' => 'desc'),
)
),
'Fields' => Array (
'EmailLogId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'fromuser' => Array ('type' => 'string', 'max_len' => 200, 'default' => NULL),
'addressto' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
'subject' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
'timestamp' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
'event' => Array ('type' => 'string', 'max_len' => 100, 'default' => NULL),
'EventParams' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array ('default' => 'icon16_custom.gif'),
'Fields' => Array (
'EmailLogId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter',),
'fromuser' => Array ('title' => 'la_prompt_FromUsername', 'filter_block' => 'grid_like_filter', ),
'addressto' => Array ('title' => 'la_prompt_AddressTo', 'filter_block' => 'grid_like_filter', ),
'subject' => Array ('title' => 'la_col_Subject', 'filter_block' => 'grid_like_filter', ),
'event' => Array ('title' => 'la_col_Event', 'filter_block' => 'grid_like_filter', ),
'timestamp' => Array ('title' => 'la_prompt_SentOn', 'filter_block' => 'grid_date_range_filter', ),
// 'EventParams' => Array ('title' => 'la_col_EventParams', 'filter_block' => 'grid_like_filter', ),
),
),
),
'ConfigMapping' => Array(
'PerPage' => 'Perpage_EmailsL',
),
);
\ No newline at end of file
Property changes on: branches/RC/core/units/logs/email_logs/email_logs_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.5
\ No newline at end of property
+1.1.2.6
\ No newline at end of property
Index: branches/RC/core/units/images/images_config.php
===================================================================
--- branches/RC/core/units/images/images_config.php (revision 11537)
+++ branches/RC/core/units/images/images_config.php (revision 11538)
@@ -1,162 +1,161 @@
<?php
$config = Array(
'Prefix' => 'img',
'Clones' => Array (
'u-img' => Array('ParentPrefix' => 'u'),
'l-img' => Array('ParentPrefix' => 'l'),
'n-img' => Array('ParentPrefix' => 'n'),
'bb-img'=> Array('ParentPrefix' => 'bb'),
'bb-post-img'=> Array('ParentPrefix' => 'bb-post'),
/*'p-img' => Array('ParentPrefix' => 'p'),*/
'c-img' => Array('ParentPrefix' => 'c'),
),
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'ImageEventHandler','file'=>'image_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'ImageTagProcessor','file'=>'image_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'AggregateTags' => Array (
Array (
'AggregateTo' => '#PARENT#',
'AggregatedTagName' => 'Image',
'LocalTagName' => 'ItemImageTag',
'LocalSpecial' => '-item',
),
Array (
'AggregateTo' => '#PARENT#',
'AggregatedTagName' => 'ImageSrc',
'LocalTagName' => 'ItemImageTag',
'LocalSpecial' => '-item',
),
Array (
'AggregateTo' => '#PARENT#',
'AggregatedTagName' => 'ImageSize',
'LocalTagName' => 'ItemImageTag',
'LocalSpecial' => '-item',
),
Array (
'AggregateTo' => '#PARENT#',
'AggregatedTagName' => 'ListImages',
'LocalTagName' => 'PrintList2',
'LocalSpecial' => 'list',
),
Array (
'AggregateTo' => '#PARENT#',
'AggregatedTagName' => 'LargeImageExists',
'LocalTagName' => 'LargeImageExists',
),
),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
),
'IDField' => 'ImageId',
'StatusField' => Array('Enabled', 'DefaultImg'), // field, that is affected by Approve/Decline events
'TitleField' => 'Name', // field, used in bluebar when editing existing item
'TableName' => TABLE_PREFIX.'Images',
'ParentTableKey'=> 'ResourceId', // linked field in master table
'ForeignKey' => 'ResourceId', // linked field in subtable
'ParentPrefix' => 'p',
'AutoDelete' => true,
'AutoClone' => true,
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array('show_active','show_disabled'), 'type' => WHERE_FILTER),
),
'Filters' => Array(
'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Enabled != 1' ),
'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Enabled != 0' ),
)
),
'CalculatedFields' => Array(
'' => Array(
'Preview' => '0',
),
),
'ListSQLs' => Array( ''=>'SELECT * FROM %s',
), // key - special, value - list select sql
'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
),
'ListSortings' => Array(
'' => Array(
'ForcedSorting' => Array('Priority' => 'desc'),
'Sorting' => Array('Name' => 'asc'),
)
),
'Fields' => Array(
'ImageId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'ResourceId' => Array('type'=>'int', 'not_null'=>1, 'default' => 0),
'Url' => Array('type' => 'string', 'max_len'=>255, 'default' => '', 'not_null'=>1),
'Name' => Array('type' => 'string', 'max_len'=>255, 'required'=>1, 'not_null'=>1, 'default' => ''),
'AltName' => Array('type' => 'string', 'max_len'=>255, 'required' => 1, 'not_null' => 1, 'default' => ''),
'ImageIndex' => Array('type'=>'int', 'default' => 0, 'not_null'=>1),
'LocalImage' => Array('type'=>'int', 'default' => 1, 'not_null'=>1),
'LocalPath' => Array('type' => 'string', 'formatter'=>'kPictureFormatter', 'skip_empty'=>1, 'max_len'=>240, 'default' => '', 'not_null' => 1, 'include_path' => 1,
'allowed_types' => Array(
'image/jpeg',
'image/pjpeg',
'image/png',
'image/x-png',
'image/gif',
'image/bmp'
),
'error_msgs' => Array( 'bad_file_format' => '!la_error_InvalidFileFormat!',
'bad_file_size' => '!la_error_FileTooLarge!',
'cant_save_file' => '!la_error_cant_save_file!'
)
),
'Enabled' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array ( 1 => 'la_Enabled', 0 => 'la_Disabled' ), 'default' => 0, 'not_null'=>1),
'DefaultImg' => Array('type'=>'int', 'default' => 0, 'not_null'=>1),
'ThumbUrl' => Array('type' => 'string', 'max_len' => 255, 'default' => null),
'Priority' => Array('type'=>'int', 'default' => 0, 'not_null'=>1),
'ThumbPath' => Array('type' => 'string', 'formatter'=>'kPictureFormatter', 'skip_empty'=>1, 'max_len' => 255, 'default' => null,
'allowed_types' => Array(
'image/jpeg',
'image/pjpeg',
'image/png',
'image/x-png',
'image/gif',
'image/bmp'
),
'error_msgs' => Array( 'bad_file_format' => '!la_error_InvalidFileFormat!',
'bad_file_size' => '!la_error_FileTooLarge!',
'cant_save_file' => '!la_error_cant_save_file!'
)
),
'LocalThumb' => Array('type'=>'int', 'default' => 1, 'not_null'=>1),
'SameImages' => Array('type'=>'int', 'default' => 1, 'not_null'=>1),
),
'VirtualFields' => Array(
'Preview' => Array(),
'ImageUrl' => Array(),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon17_custom.gif','1_0'=>'icon16_image.gif','0_0'=>'icon16_image_disabled.gif','1_1'=>'icon16_image_primary.gif'),
'Fields' => Array(
- 'Name' => Array( 'title'=>'la_col_ImageName' , 'data_block' => 'image_caption_td'),
- 'AltName' => Array( 'title'=>'la_col_AltName' ),
- 'Url' => Array( 'title'=>'la_col_ImageUrl', 'data_block' => 'image_url_td' ),
- 'Enabled' => Array( 'title'=>'la_col_ImageEnabled' ),
- 'Preview' => Array( 'title'=>'la_col_Preview', 'data_block' => 'image_preview_td' ),
+ 'ImageId' => Array( 'title'=>'la_col_Id', 'filter_block' => 'grid_range_filter'),
+ 'Name' => Array( 'title'=>'la_col_ImageName' , 'data_block' => 'image_caption_td', 'filter_block' => 'grid_like_filter'),
+ 'AltName' => Array( 'title'=>'la_col_AltName', 'filter_block' => 'grid_like_filter'),
+ 'Url' => Array( 'title'=>'la_col_ImageUrl', 'data_block' => 'image_url_td', 'filter_block' => 'grid_like_filter'),
+ 'Enabled' => Array( 'title'=>'la_col_ImageEnabled', 'filter_block' => 'grid_options_filter'),
+ 'Preview' => Array( 'title'=>'la_col_Preview', 'data_block' => 'image_preview_td', 'filter_block' => 'grid_like_filter'),
),
),
),
- );
-
-?>
\ No newline at end of file
+ );
\ No newline at end of file
Property changes on: branches/RC/core/units/images/images_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.11.2.2
\ No newline at end of property
+1.11.2.3
\ No newline at end of property
Index: branches/RC/core/units/images/image_tag_processor.php
===================================================================
--- branches/RC/core/units/images/image_tag_processor.php (revision 11537)
+++ branches/RC/core/units/images/image_tag_processor.php (revision 11538)
@@ -1,372 +1,389 @@
<?php
class ImageTagProcessor extends kDBTagProcessor {
/**
* Prepares all image parameters as list block parameters (for easy usage)
*
* @param kDBList $object
* @param Array $block_params
* @author Alex
*/
function PrepareListElementParams(&$object, &$block_params)
{
$image_url = $this->ImageSrc($block_params);
if (!$image_url) {
return ;
}
$parent_prefix = $this->Application->getUnitOption($object->Prefix, 'ParentPrefix');
$parent_item =& $this->Application->recallObject($parent_prefix);
$block_params['img_path'] = $image_url;
$image_dimensions = $this->ImageSize($block_params);
$block_params['img_size'] = $image_dimensions ? $image_dimensions : ' width="'.$block_params['DefaultWidth'].'"';
$block_params['alt'] = $object->GetField('AltName')? $object->GetField('AltName') : htmlspecialchars($this->getItemTitle($parent_item));
$block_params['align'] = array_key_exists('align', $block_params) ? $block_params['align'] : 'left';
}
/**
* Returns value of object's title field
*
* @param kDBItem $object
* @return string
*/
function getItemTitle(&$object)
{
$title_field = $this->Application->getUnitOption($object->Prefix, 'TitleField');
return $object->GetField($title_field);
}
/**
* [AGGREGATED TAGS] works as <inp2:CatalogItemPrefix_Image, ImageSize, ImageSrc ..../>
*
* @param Array $params
* @return string
*/
function ItemImageTag($params)
{
$this->LoadItemImage($params);
return $this->$params['original_tag']($params);
}
function LargeImageExists($params)
{
$object =& $this->getObject($params);
if ($object->GetDBField('SameImages') == null || $object->GetDBField('SameImages') == 1) {
return false;
}
else {
return true;
}
}
function LoadItemImage($params)
{
$parent_item =& $this->Application->recallObject($params['PrefixSpecial']);
/* @var $parent_item kCatDBItem */
$object =& $this->Application->recallObject($this->getPrefixSpecial(), null, Array('skip_autoload' => true));
/* @var $object kDBItem */
$object->Clear();
// if we need primary thumbnail which is preloaded with category item's list
$is_primary = $this->SelectParam($params, 'primary,Primary');
$image_id = $this->Application->GetVar($this->Prefix.'_id');
if (
// is primary, when primary mark set OR name & field not given
($is_primary || !(isset($params['name']) || isset($params['field']))) &&
// primary image is preloaded AND direct id not given
isset($parent_item->Fields['ThumbPath']) && !$image_id
) {
$object->SetDefaultValues();
$object->SetDBField('Url', $parent_item->GetDBField('FullUrl'));
$object->SetDBField('AltName', $this->getItemTitle($parent_item));
$object->SetDBFieldsFromHash($parent_item->GetFieldValues(), Array('SameImages', 'LocalThumb', 'ThumbPath', 'ThumbUrl', 'LocalImage', 'LocalPath'));
$object->Loaded = true;
}
else { // if requested image is not primary thumbnail - load it directly
$id_field = $this->Application->getUnitOption($this->Prefix, 'ForeignKey');
$parent_table_key = $this->Application->getUnitOption($this->Prefix, 'ParentTableKey');
$keys[$id_field] = $parent_item->GetDBField($parent_table_key);
// which image to load?
if ($is_primary) {
// by PrimaryImage mark
$keys['DefaultImg'] = 1;
}
elseif (getArrayValue($params, 'name')) {
// by ImageName
$keys['Name'] = $params['name'];
}
elseif (getArrayValue($params, 'field')) {
// by virtual field name in main object
$field_options = $parent_item->GetFieldOptions($params['field']);
$keys['Name'] = isset($field_options['original_field']) ? $field_options['original_field'] : $params['field'];
}
elseif ($image_id) {
// by ID
$keys['ImageId'] = $image_id;
}
else {
// by PrimaryImage if no other criteria given
$keys['DefaultImg'] = 1;
}
$object->Load($keys);
if (isset($params['field'])) {
$image_src = $parent_item->GetDBField($params['field']);
// when image is uploaded to virtual field in main item, but not saved to db
$object->SetDBField('ThumbPath', $image_src);
if (!$object->isLoaded()) {
// set fields for displaing new image during main item suggestion with errors
$fields_hash = Array (
'Url' => '',
'ThumbUrl' => '',
'LocalPath' => '',
'SameImages' => 1,
'LocalThumb' => 1,
'LocalImage' => 1,
);
$object->SetDBFieldsFromHash($fields_hash);
$object->Loaded = true;
}
}
}
}
function getImageDimension($type, $params)
{
$ret = isset($params['Max'.$type]) ? $params['Max'.$type] : false;
if (!$ret) {
return $ret;
}
$parent_prefix = $this->Application->getUnitOption($this->Prefix, 'ParentPrefix');
if ($ret == 'thumbnail') {
$ret = $this->Application->ConfigValue($parent_prefix.'_ThumbnailImage'.$type);
}
if ($ret == 'fullsize') {
$ret = $this->Application->ConfigValue($parent_prefix.'_FullImage'.$type);
}
return $ret;
}
/**
* Appends "/" to beginning of image path (in case when missing)
*
* @param kDBItem $object
* @todo old in-portal doesn't append first slash, but we do => append first slash for him :)
*/
function makeRelativePaths(&$object)
{
$thumb_path = $object->GetDBField('ThumbPath');
if ($thumb_path && substr($thumb_path, 0, 1) != '/') {
$object->SetDBField('ThumbPath', '/'.$thumb_path);
}
$local_path = $object->GetDBField('LocalPath');
if ($local_path && substr($local_path, 0, 1) != '/') {
$object->SetDBField('LocalPath', '/'.$local_path);
}
}
function ImageSrc($params)
{
$object =& $this->getObject($params);
$this->makeRelativePaths($object);
// show "noimage.gif" when requested image is missing OR was not uploaded
$use_default_image = !(defined('DBG_IMAGE_RECOVERY') && DBG_IMAGE_RECOVERY);
$base_url = rtrim($this->Application->BaseURL(), '/');
if ($object->GetDBField('SameImages') && $object->GetDBField('ThumbPath')) {
// we can auto-resize image, when source image available & we use same image for thumbnail & full image in admin
$max_width = $this->getImageDimension('Width', $params);
$max_height = $this->getImageDimension('Height', $params);
$format = array_key_exists('format', $params) ? $params['format'] : false;
if (!$max_width && $format) {
// user watermarks from format param
$max_width = $format;
}
if ($max_width > 0 || $max_height > 0 || $format) {
$src_image = FULL_PATH.$object->GetDBField('ThumbPath');
if (file_exists($src_image)) {
$image_helper =& $this->Application->recallObject('ImageHelper');
/* @var $image_helper ImageHelper */
return $image_helper->ResizeImage($src_image, $max_width, $max_height);
}
elseif ($use_default_image) {
return $this->_getDefaultImage($params, $max_width, $max_height);
}
return $base_url . $object->GetDBField('ThumbPath');
}
}
// if we need thumbnail, or full image is same as thumbnail
$show_thumbnail = $this->SelectParam($params, 'thumbnail,Thumbnail') || // old style
(isset($params['MaxWidth']) && $params['MaxWidth'] == 'thumbnail') || // new style
(isset($params['MaxHeight']) && $params['MaxHeight'] == 'thumbnail');
if ($show_thumbnail || $object->GetDBField('SameImages')) {
// return local image or url
$ret = $object->GetDBField('LocalThumb') ? $base_url . $object->GetDBField('ThumbPath') : $object->GetDBField('ThumbUrl');
}
else { // if we need full which is not the same as thumb
$ret = $object->GetDBField('LocalImage') ? $base_url . $object->GetDBField('LocalPath') : $object->GetDBField('Url');
}
if ($ret && ($ret != $base_url)) {
// convert full url to full path!
$dst_image = preg_replace('/^' . preg_quote($base_url, '/') . '/', FULL_PATH, $ret, 1);
$image_found = $dst_image != $ret ? file_exists($dst_image) : true;
if ($image_found) {
// image isn't deleted OR is stored on remote location
return $ret;
}
}
// return Default Image or false if NOT specified
return $this->_getDefaultImage($params);
}
/**
* Returns default full url to default images
*
* @param Array $params
* @param int $max_width
* @param int $max_height
* @return string
*/
function _getDefaultImage($params, $max_width = false, $max_height = false)
{
$default_image = $this->SelectParam($params, 'default_image,DefaultImage');
if (!$default_image) {
return '';
}
// show default image, use different base urls for admin and front-end
$base_url = rtrim($this->Application->BaseURL(), '/');
$sub_folder = $this->Application->IsAdmin() ? rtrim(IMAGES_PATH, '/') : THEMES_PATH;
if ($max_width > 0 || $max_height > 0) {
$image_helper =& $this->Application->recallObject('ImageHelper');
/* @var $image_helper ImageHelper */
$src_image = FULL_PATH . $sub_folder . '/' . $default_image;
return $image_helper->ResizeImage($src_image, $max_width, $max_height);
}
return $base_url . $sub_folder . '/' . $default_image;
}
function getFullPath($path)
{
if (!$path) {
return $path;
}
// absolute url
if (preg_match('/^(.*):\/\/(.*)$/U', $path)) {
return preg_replace('/^'.preg_quote($this->Application->BaseURL(), '/').'(.*)/', FULL_PATH.'/\\1', $path);
}
// relative url
return FULL_PATH.'/'.mb_substr(THEMES_PATH, 1).'/'.$path;
}
/**
* Makes size clause for img tag, such as
* ' width="80" height="100"' according to max_width
* and max_heght limits.
*
* @param array $params
* @return string
*/
function ImageSize($params)
{
$img_path = $this->getFullPath($params['img_path']);
$image_helper =& $this->Application->recallObject('ImageHelper');
/* @var $image_helper ImageHelper */
$max_width = $this->getImageDimension('Width', $params);
$max_height = $this->getImageDimension('Height', $params);
$image_dimensions = $image_helper->GetImageDimensions($img_path, $max_width, $max_height);
if (!$image_dimensions) {
return false;
}
return ' width="'.$image_dimensions[0].'" height="'.$image_dimensions[1].'"';
}
/**
* Prepares image parameters & parses block with them (for admin)
*
* @param Array $params
* @return string
*/
function Image($params)
{
$image_url = $this->ImageSrc($params);
if (!$image_url) {
return ;
}
$object =& $this->getObject($params);
$params['img_path'] = $image_url;
$image_dimensions = $this->ImageSize($params);
$params['img_size'] = $image_dimensions ? $image_dimensions : ' width="'.$params['DefaultWidth'].'"';
$params['alt'] = htmlspecialchars($object->GetField('AltName')); // really used ?
$params['name'] = $this->SelectParam($params, 'block,render_as');
$params['align'] = array_key_exists('align', $params) ? $params['align'] : 'left';
$params['no_editing'] = 1;
if (!$object->isLoaded() && !$this->SelectParam($params, 'default_image,DefaultImage')) {
return false;
}
return $this->Application->ParseBlock($params);
}
/**
* Returns url for image in case when image source is url (for admin)
*
* @param Array $params
* @return string
*/
function ImageUrl($params)
{
$object =& $this->getObject($params);
if ($object->GetDBField('SameImages') ? $object->GetDBField('LocalThumb') : $object->GetDBField('LocalImage') ) {
$ret = $this->Application->Phrase(getArrayValue($params,'local_phrase'));
}
else {
$ret = $object->GetDBField('SameImages') ? $object->GetDBField('ThumbUrl') : $object->GetDBField('Url');
}
return $ret;
}
+ /**
+ * If data was modfied & is in TempTables mode, then parse block with name passed;
+ * remove modification mark if not in TempTables mode
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ * @author Alexey
+ */
+ function SaveWarning($params)
+ {
+ if ($this->Prefix == 'c-img') {
+ return $this->Application->ProcessParsedTag('c', 'SaveWarning', $params);
+ }
+
+ return parent::SaveWarning($params);
+ }
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/images/image_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.13.2.11
\ No newline at end of property
+1.13.2.12
\ No newline at end of property
Index: branches/RC/core/units/configuration/configuration_tag_processor.php
===================================================================
--- branches/RC/core/units/configuration/configuration_tag_processor.php (revision 11537)
+++ branches/RC/core/units/configuration/configuration_tag_processor.php (revision 11538)
@@ -1,214 +1,232 @@
<?php
class ConfigurationTagProcessor extends kDBTagProcessor {
function Init($prefix,$special,$event_params=null)
{
parent::Init($prefix, $special, $event_params);
$this->Application->LinkVar('module_key');
}
/**
* Prints list content using block specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintList($params)
{
$list =& $this->GetList($params);
$id_field = $this->Application->getUnitOption($this->Prefix,'IDField');
$list->Query();
$o = '';
$list->GoFirst();
$block_params=$this->prepareTagParams($params);
// $block_params['name'] = $this->SelectParam($params, 'render_as,block');
$block_params['pass_params'] = 'true';
$block_params['IdField'] = $list->IDField;
$prev_heading = '';
$next_block = $params['full_block'];
$this->groupRecords($list->Records, 'heading');
$field_values = $this->Application->GetVar($this->getPrefixSpecial(true));
while (!$list->EOL())
{
$this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET
// using 2 blocks for drawing o row in case if current & next record titles match
$next_item_prompt = $list->CurrentIndex + 1 < $list->RecordsCount ? $list->Records[$list->CurrentIndex + 1]['prompt'] : '';
$this_item_prompt = $list->GetDBField('prompt');
if ($next_item_prompt == $this_item_prompt) {
$curr_block = $params['half_block1'];
$next_block = $params['half_block2'];
} else {
$curr_block = $next_block;
$next_block = $params['full_block'];
}
$block_params['name'] = $curr_block;
$block_params['show_heading'] = ($prev_heading != $list->GetDBField('heading') ) ? 1 : 0;
// set values from submit if any
if ($field_values) {
$list->SetDBField('VariableValue', $field_values[$list->GetDBField('VariableName')]['VariableValue']);
}
$list->SetDBField('DirectOptions', '');
$o.= $this->Application->ParseBlock($block_params, 1);
$prev_heading = $list->GetDBField('heading');
$list->GoNext();
}
$this->Application->RemoveVar('ModuleRootCategory');
$this->Application->SetVar( $this->getPrefixSpecial().'_id', '');
return $o;
}
function getModuleItemName()
{
$module = $this->Application->GetVar('module');
$table = $this->Application->getUnitOption('confs', 'TableName');
$sql = 'SELECT ConfigHeader
FROM '.$table.'
WHERE ModuleName = '.$this->Conn->qstr($module);
return $this->Conn->GetOne($sql);
}
function PrintConfList($params)
{
$list =& $this->GetList($params);
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$list->PerPage = -1;
$list->Query();
$o = '';
$list->GoFirst();
$tmp_row = Array();
while (!$list->EOL()) {
$rec = $list->getCurrentRecord();
$tmp_row[0][$rec['VariableName']] = $rec['VariableValue'];
$tmp_row[0][$rec['VariableName'].'_prompt'] = $rec['prompt'];
$list->GoNext();
}
$list->Records = $tmp_row;
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
$block_params['module_key'] = $this->Application->GetVar('module_key');
$block_params['module_item'] = $this->getModuleItemName();
$list->GoFirst();
return $this->Application->ParseBlock($block_params, 1);
}
function ShowRelevance($params)
{
return $this->Application->GetVar('module_key') != '_';
}
function ConfigValue($params)
{
return $this->Application->ConfigValue($params['name']);
}
function Error($params)
{
$object =& $this->Application->recallObject( $this->getPrefixSpecial() );
$field = $object->GetDBField($params['id_field']);
$errors = $this->Application->GetVar('errormsgs');
$errors = $errors[$this->getPrefixSpecial()];
if (isset($errors[$field])) {
$msg = $this->Application->Phrase($errors[$field]);
}
else {
$msg = '';
}
return $msg;
}
/**
* Allows to show category path of selected module
*
* @param Array $params
* @return string
*/
function CategoryPath($params)
{
if (!isset($params['cat_id'])) {
$params['cat_id'] = $this->ModuleRootCategory( Array() );
}
return $this->Application->ProcessParsedTag('c', 'CategoryPath', $params);
}
/**
* Shows edit warning in case if module root category changed but not saved
*
* @param Array $params
* @return string
*/
function SaveWarning($params)
{
$temp_category_id = $this->Application->RecallVar('ModuleRootCategory');
if ($temp_category_id !== false) {
return $this->Application->ParseBlock($params);
}
return '';
}
function ModuleRootCategory($params)
{
$category_id = $this->Application->RecallVar('ModuleRootCategory');
if ($category_id === false) {
$category_id = $this->Application->findModule('Name', $this->Application->GetVar('module'), 'RootCat');
}
return $category_id;
}
/**
* Returns variable ID by it's name (used on search relevance configuration screen)
*
* @param Array $params
* @return int
*/
function GetVariableID($params)
{
static $cached_ids = Array ();
$var_name = $params['name'];
if (!isset($cached_ids[$var_name])) {
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($this->Prefix, 'TableName');
$sql = 'SELECT '.$id_field.'
FROM '.$table_name.'
WHERE VariableName = '.$this->Conn->qstr($params['name']);
$cached_ids[$var_name] = $this->Conn->GetOne($sql);
}
return $cached_ids[$var_name];
}
-
- function IsWritablePath($params)
+
+ function GetVariableSection($params)
+ {
+ static $cached_sections = Array ();
+
+ $var_name = $params['name'];
+ if (!isset($cached_sections[$var_name])) {
+ $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
+ $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName');
+
+ $sql = 'SELECT Section
+ FROM '.$table_name.'
+ WHERE VariableName = '.$this->Conn->qstr($params['name']);
+ $cached_sections[$var_name] = $this->Conn->GetOne($sql);
+ }
+
+ return $cached_sections[$var_name];
+ }
+
+ function IsWritablePath($params)
{
- return is_writable($this->ConfigValue($params));
+ return is_writable($this->ConfigValue($params));
}
-
+
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/configuration/configuration_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.16.2.1
\ No newline at end of property
+1.16.2.2
\ No newline at end of property
Index: branches/RC/core/units/modules/modules_config.php
===================================================================
--- branches/RC/core/units/modules/modules_config.php (revision 11537)
+++ branches/RC/core/units/modules/modules_config.php (revision 11538)
@@ -1,111 +1,111 @@
<?php
$config = Array(
'Prefix' => 'mod',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'ModulesEventHandler','file'=>'modules_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'ModulesTagProcessor','file'=>'modules_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'Name',
'TitleField' => 'Name', // field, used in bluebar when editing existing item
'StatusField' => Array('Loaded'),
'TitlePresets' => Array(
- 'modules_list' => Array( 'prefixes' => Array('mod_List'), 'format' => "!la_title_Configuration! - !la_title_Module_Status! (#mod_recordcount#)"),
+ 'module_list' => Array( 'prefixes' => Array('mod_List'), 'format' => "!la_title_Module_Status!"),
'tree_modules' => Array('format' => '!la_section_overview!'),
),
'PermSection' => Array('main' => 'in-portal:mod_status'),
'Sections' => Array(
'in-portal:mod_status' => Array(
'parent' => 'in-portal:system',
'icon' => 'modules',
'label' => 'la_title_Module_Status',
'url' => Array('t' => 'modules/modules_list', 'pass' => 'm'),
'permissions' => Array('view', 'edit', 'advanced:approve', 'advanced:decline'),
'priority' => 5,
'type' => stTREE,
),
// "Configuration" -> "Modules and Settings"
/*'in-portal:modules' => Array(
'parent' => 'in-portal:system',
'icon' => 'modules',
'label' => 'la_tab_ModulesManagement',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 5,
'type' => stTREE,
'icon_module' => 'in-portal',
),
'in-portal:tag_library' => Array(
'parent' => 'in-portal:modules',
'icon' => 'modules',
'label' => 'la_tab_TagLibrary',
'url' => Array('index_file' => 'tag_listing.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 3,
'type' => stTREE,
),*/
),
'TableName' => TABLE_PREFIX.'Modules',
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array('enabled', 'disabled'), 'type' => WHERE_FILTER),
),
'Filters' => Array(
'enabled' => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Loaded != 1'),
'disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Loaded != 0'),
)
),
'ListSQLs' => Array( ''=>'SELECT * FROM %s',
), // key - special, value - list select sql
'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('LoadOrder' => 'asc'),
)
),
'Fields' => Array(
'Name' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
'Path' => Array('type' => 'string','not_null' => '1','default' => ''),
'Var' => Array('type' => 'string','not_null' => '1','default' => ''),
'Version' => Array('type' => 'string','not_null' => '1','default' => '0.0.0'),
'Loaded' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Enabled', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
'LoadOrder' => Array('type' => 'int','not_null' => 1, 'default' => 0),
'TemplatePath' => Array('type' => 'string','not_null' => 1, 'default' => ''),
'RootCat' => Array('type' => 'int','not_null' => 1, 'default' => 0),
'BuildDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
),
'VirtualFields' => Array(),
'Grids' => Array (
'Default' => Array (
'Icons' => Array ('default' => 'icon16_custom.gif'),
'Fields' => Array (
'Name' => Array('title' => 'la_col_Name', 'data_block' => 'grid_checkbox_td_no_icon', 'header_block' => 'grid_column_title_no_sorting', 'filter_block' => 'grid_like_filter'),
'Version' => Array('title' => 'la_col_Version', 'header_block' => 'grid_column_title_no_sorting', 'filter_block' => 'grid_like_filter'),
'Loaded' => Array('title' => 'la_col_Status', 'header_block' => 'grid_column_title_no_sorting', 'data_block' => 'grid_module_td', 'filter_block' => 'grid_options_filter'),
),
),
),
);
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/modules/modules_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.11.2.1
\ No newline at end of property
+1.11.2.2
\ No newline at end of property
Index: branches/RC/core/units/category_items/category_items_tag_processor.php
===================================================================
--- branches/RC/core/units/category_items/category_items_tag_processor.php (revision 11537)
+++ branches/RC/core/units/category_items/category_items_tag_processor.php (revision 11538)
@@ -1,27 +1,34 @@
<?php
- class CategoryItemsTagProcessor extends kDBTagProcessor
+ class CategoryItemsTagProcessor extends kDBTagProcessor
{
function CategoryName($params)
{
- $root_phrase = $this->Application->ConfigValue('Root_Name');
- $value = str_replace('&|&', ' > ', $this->Field($params));
- $ret = $this->Application->Phrase($root_phrase).( $value ? ' > ' : '').$value;
- if( $this->Field( Array('field'=> 'PrimaryCat') ) == 1 )
- {
+ $field = $this->SelectParam($params, 'name,field');
+
+ $object =& $this->getObject($params);
+ /* @var $object kDBList */
+
+ $root_phrase = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') );
+ $cached_navbar = preg_replace('/^Content&\|&/i', '', $object->GetDBField($field));
+ $value = str_replace('&|&', ' > ', $cached_navbar);
+
+ $ret = $root_phrase . ($value ? ' > ' : '') . $value;
+ if ($object->GetDBField('PrimaryCat')) {
$label = $params['primary_title'];
- $ret .= ' ('.$this->Application->Phrase($label).')';
+ $ret .= ' (' . $this->Application->Phrase($label) . ')';
}
+
return $ret;
}
-
+
function GetMainID()
{
$object =& $this->Application->recallObject( $this->getPrefixSpecial() );
$table_info = $object->getLinkedInfo();
return $table_info['ParentId'];
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/category_items/category_items_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.6.2.1
\ No newline at end of property
Index: branches/RC/core/units/groups/groups_event_handler.php
===================================================================
--- branches/RC/core/units/groups/groups_event_handler.php (revision 11537)
+++ branches/RC/core/units/groups/groups_event_handler.php (revision 11538)
@@ -1,38 +1,34 @@
<?php
class GroupsEventHandler extends kDBEventHandler {
/**
* Adds grouping by userid
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
- $object =& $event->getObject();
+ $object =& $event->getObject();
/* @var $object kDBList */
-
+
switch ($event->Special) {
- case 'total':
- $object->AddGroupByField('%1$s.GroupId');
- break;
-
case 'user':
$user_id = $this->Application->GetVar('u_id');
if ($user_id !== false) {
// show only groups, that user doesn't belong to
$table_name = $this->Application->GetTempName(TABLE_PREFIX.'UserGroup', 'prefix:u');
$sql = 'SELECT GroupId
FROM '.$table_name.'
WHERE PortalUserId = '.$user_id;
$group_ids = $this->Conn->GetCol($sql);
array_push($group_ids, 14, 15); // Guest & Everyone groups are set dynamically
-
+
$object->addFilter('already_member_filter', '%1$s.GroupId NOT IN ('.implode(',', $group_ids).')');
}
break;
}
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/groups/groups_event_handler.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/groups/group_tp.php
===================================================================
--- branches/RC/core/units/groups/group_tp.php (nonexistent)
+++ branches/RC/core/units/groups/group_tp.php (revision 11538)
@@ -0,0 +1,22 @@
+<?php
+
+ class GroupTagProcessor extends kDBTagProcessor {
+
+ /**
+ * Hides permission tab, when it's not allowed by configuration settings
+ *
+ * @param Array $params
+ */
+ function ModifyUnitConfig($params)
+ {
+ $edit_tab_presets = $this->Application->getUnitOption($this->Prefix, 'EditTabPresets');
+
+ $event = new kEvent($this->getPrefixSpecial() . ':OnItemBuild');
+ $permission = $event->getSection() . '.advanced:manage_permissions';
+ if (!$this->Application->CheckPermission($permission)) {
+ unset($edit_tab_presets['Default']['permissions']);
+ }
+
+ $this->Application->setUnitOption($this->Prefix, 'EditTabPresets', $edit_tab_presets);
+ }
+ }
\ No newline at end of file
Property changes on: branches/RC/core/units/groups/group_tp.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Index: branches/RC/core/units/groups/groups_config.php
===================================================================
--- branches/RC/core/units/groups/groups_config.php (revision 11537)
+++ branches/RC/core/units/groups/groups_config.php (revision 11538)
@@ -1,130 +1,129 @@
<?php
$config = Array (
'Prefix' => 'g',
'ItemClass' => Array ('class' => 'GroupsItem', 'file' => 'groups_item.php', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'GroupsEventHandler', 'file' => 'groups_event_handler.php', 'build_event' => 'OnBuild'),
- 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+ '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' => ''),
),
- 'groups_list' => Array ('prefixes' => Array ('g.total_List'), 'format' => "!la_title_Groups! (#g.total_recordcount#)"),
+ '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_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! (#g.user_recordcount#) - !la_title_SelectGroup!"),
+ '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',
- 'total' => 'SELECT %1$s.* %2$s
- FROM %1$s
- LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON ug.GroupId = %1$s.GroupId',
- ),
-
- 'ItemSQLs' => Array (
- '' => ' SELECT %1$s.* %2$s
- FROM %1$s
- LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON ug.GroupId = %1$s.GroupId'
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('Name' => 'asc'),
),
),
'CalculatedFields' => Array (
'total' => Array (
- 'UserCount' => 'COUNT(ug.PortalUserId)',
+ '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.4
\ No newline at end of property
+1.21.2.5
\ No newline at end of property
Index: branches/RC/core/units/reviews/reviews_config.php
===================================================================
--- branches/RC/core/units/reviews/reviews_config.php (revision 11537)
+++ branches/RC/core/units/reviews/reviews_config.php (revision 11538)
@@ -1,196 +1,197 @@
<?php
$config = Array (
'Prefix' => 'rev',
'Clones' => Array (
'l-rev' => Array(
'ParentPrefix' => 'l',
'ConfigMapping' => Array (
'PerPage' => 'Perpage_LinkReviews',
'ShortListPerPage' => 'Perpage_LinkReviews_Short',
'DefaultSorting1Field' => 'Link_ReviewsSort',
'DefaultSorting2Field' => 'Link_ReviewsSort2',
'DefaultSorting1Dir' => 'Link_ReviewsOrder',
'DefaultSorting2Dir' => 'Link_ReviewsOrder2',
'ReviewDelayInterval' => 'link_ReviewDelay_Interval',
'ReviewDelayValue' => 'link_ReviewDelay_Value',
),
),
'n-rev' => Array (
'ParentPrefix' => 'n',
'ConfigMapping' => Array (
'PerPage' => 'Perpage_NewsReviews',
'ShortListPerPage' => 'Perpage_NewsReviews_Short',
'DefaultSorting1Field' => 'News_SortReviews',
'DefaultSorting2Field' => 'News_SortReviews2',
'DefaultSorting1Dir' => 'News_SortReviewsOrder',
'DefaultSorting2Dir' => 'News_SortReviewsOrder2',
'ReviewDelayInterval' => 'News_ReviewDelay_Interval',
'ReviewDelayValue' => 'News_ReviewDelay_Value',
),
),
'bb-rev' => Array (
'ParentPrefix' => 'bb',
'ConfigMapping' => Array (
'PerPage' => 'Perpage_TopicReviews',
'ReviewDelayInterval' => 'topic_ReviewDelay_Interval',
'ReviewDelayValue' => 'topic_ReviewDelay_Value',
),
),
'p-rev' => Array (
'ParentPrefix' => 'p',
'ConfigMapping' => Array (
'PerPage' => 'Comm_Perpage_Reviews',
'ReviewDelayInterval' => 'product_ReviewDelay_Value',
'ReviewDelayValue' => 'product_ReviewDelay_Interval',
),
),
),
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'ReviewsEventHandler','file'=>'reviews_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'ReviewsTagProcessor','file'=>'reviews_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array (
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'ParentPrefix' => 'p', // replace all usage of rev to "p-rev" and then remove this param from here and Prefix too
'ConfigMapping' => Array (
'PerPage' => 'Comm_Perpage_Reviews',
'ReviewDelayInterval' => 'product_ReviewDelay_Value',
'ReviewDelayValue' => 'product_ReviewDelay_Interval',
),
'IDField' => 'ReviewId',
'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
'TableName' => TABLE_PREFIX.'ItemReview',
'ParentTableKey' => 'ResourceId', // linked field in master table
'ForeignKey' => 'ItemId', // linked field in subtable
'AutoDelete' => true,
'AutoClone' => true,
'TitlePresets' => Array (
'reviews_edit' => Array('format' => "!la_title_Editing_Review!"),
),
'FilterMenu' => Array (
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER),
),
'Filters' => Array(
'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
)
),
'CalculatedFields' => Array (
'' => Array (
'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
),
'products' => Array (
'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
'ItemName' => 'pr.l1_Name',
'ProductId' => 'pr.ProductId',
),
'product' => Array (
'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
'ItemName' => 'pr.l1_Name',
'ProductId' => 'pr.ProductId',
),
),
// key - special, value - list select sql
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
'products' => ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'Products pr ON pr.ResourceId = %1$s.ItemId
LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
'product' => ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'Products pr ON pr.ResourceId = %1$s.ItemId
LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
),
'ItemSQLs' => Array ('' => 'SELECT * FROM %s'),
'ListSortings' => Array (
'' => Array(
'ForcedSorting' => Array('Priority' => 'desc'),
'Sorting' => Array('CreatedOn' => 'desc'),
)
),
'Fields' => Array (
'ReviewId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'CreatedOn' => Array('type' => 'int', 'formatter'=>'kDateFormatter', 'default'=>'#NOW#'),
'ReviewText' => Array('type'=>'string','required'=>1,'not_null'=>1,'default'=>''),
'Rating' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'lu_None', 1 => 'lu_Rating_1', 2 => 'lu_Rating_2', 3 => 'lu_Rating_3', 4 => 'lu_Rating_4', 5 => 'lu_Rating_5'), 'use_phrases' => 1, 'min_value_inc' => 0, 'max_value_inc' => 5, 'default' => 0),
'IPAddress' => Array('type'=>'string','max_value_inc'=>15,'not_null'=>1,'default'=>''),
'ItemId' => Array('type'=>'int','not_null'=>1,'default'=>0),
'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','required'=>1,'not_null'=>1,'default'=>-1),
'ItemType' => Array('type'=>'int','not_null'=>1,'default'=>0),
'Priority' => Array('type'=>'int','not_null'=>1,'default'=>0),
'Status' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options'=>Array(1=>'la_Active',2=>'la_Pending',0=>'la_Disabled'),'not_null'=>1,'default'=>2 ),
'TextFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_text', 1 => 'la_html'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'Module' => Array('type'=>'string','not_null'=>1,'default'=>''),
),
'VirtualFields' => Array (
'ReviewedBy' => Array('type' => 'string', 'default' => ''),
- 'CatalogItemName' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
- 'CatalogItemId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'CatalogItemName' => Array ('type' => 'string', 'default' => ''),
+ 'CatalogItemId' => Array ('type' => 'int', 'default' => 0),
+ 'CatalogItemCategory' => Array ('type' => 'int', 'default' => 0),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array ('default'=>'icon16_custom.gif',1=>'icon16_review.gif',2=>'icon16_review_pending.gif',0=>'icon16_review_disabled.gif'),
'Fields' => Array (
- 'ReviewId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td'),
- 'ReviewText' => Array( 'title'=>'la_col_ReviewText',),
- 'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy' ),
- 'CreatedOn_formatted' => Array( 'title'=>'la_col_CreatedOn', 'sort_field' => 'CreatedOn' ),
- 'Status' => Array( 'title'=>'la_col_Status' ),
- 'Rating' => Array( 'title'=>'la_col_Rating' ),
+ 'ReviewId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
+ 'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'filter_block' => 'grid_like_filter'),
+ 'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy', 'filter_block' => 'grid_like_filter'),
+ 'CreatedOn' => Array( 'title'=>'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter'),
+ 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
+ 'Rating' => Array( 'title'=>'la_col_Rating', 'filter_block' => 'grid_options_filter'),
),
),
'ReviewsSection' => Array (
'Icons' => Array ('default'=>'icon16_custom.gif',1=>'icon16_review.gif',2=>'icon16_review_pending.gif',0=>'icon16_review_disabled.gif'),
'Fields' => Array (
'ReviewId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
- 'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'data_block' => 'grid_reviewtext_td'),
- 'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy' ),
- 'CreatedOn_formatted' => Array( 'title'=>'la_col_CreatedOn', 'sort_field' => 'CreatedOn' ),
- 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter' ),
- 'Rating' => Array( 'title'=>'la_col_Rating', 'filter_block' => 'grid_options_filter' ),
+ 'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'data_block' => 'grid_reviewtext_td', 'filter_block' => 'grid_like_filter'),
+ 'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy', 'filter_block' => 'grid_like_filter'),
+ 'CreatedOn' => Array( 'title'=>'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter'),
+ 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
+ 'Rating' => Array( 'title'=>'la_col_Rating', 'filter_block' => 'grid_options_filter'),
),
),
),
);
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/reviews/reviews_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.14.2.3
\ No newline at end of property
+1.14.2.4
\ No newline at end of property
Index: branches/RC/core/units/reviews/reviews_tag_processor.php
===================================================================
--- branches/RC/core/units/reviews/reviews_tag_processor.php (revision 11537)
+++ branches/RC/core/units/reviews/reviews_tag_processor.php (revision 11538)
@@ -1,139 +1,141 @@
<?php
class ReviewsTagProcessor extends kDBTagProcessor
{
/**
* Returns a link for editing product
*
* @param Array $params
* @return string
*/
function ItemEditLink($params)
{
$object =& $this->getObject();
/* @var $object kDBList */
$item_prefix = $this->Application->findModule('Name', $object->GetDBField('Module'), 'Var');
$edit_template = $this->Application->getUnitOption($item_prefix, 'AdminTemplatePath') . '/' . $this->Application->getUnitOption($item_prefix, 'AdminTemplatePrefix') . 'edit';
$url_params = Array (
'm_opener' => 'd',
$item_prefix.'_mode' => 't',
$item_prefix.'_event' => 'OnEdit',
$item_prefix.'_id' => $object->GetDBField('CatalogItemId'),
- 'pass' => 'all,'.$item_prefix
+ 'm_cat_id' => $object->GetDBField('CatalogItemCategory'),
+ 'pass' => 'all,'.$item_prefix,
+ 'no_pass_through' => 1,
);
return $this->Application->HREF($edit_template,'', $url_params);
}
/**
* Get's reuested field value
*
* @param Array $params
* @return string
* @access public
*/
function Field($params)
{
$field = $this->SelectParam($params, 'name,field');
$object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
if ($field == 'ReviewText') {
if ($object->GetDBField('TextFormat') == 1) {
$params['no_special'] = 'no_special';
}
else {
unset($params['no_special']);
}
}
return parent::Field($params);
}
function AlreadyReviewed($params)
{
$parent_prefix = $this->Application->getUnitOption($this->Prefix, 'ParentPrefix');
$main_object =& $this->Application->recallObject($parent_prefix);
/* @var $main_object kCatDBItem */
$spam_helper =& $this->Application->recallObject('SpamHelper');
/* @var $spam_helper SpamHelper */
$spam_helper->InitHelper($main_object->GetDBField('ResourceId'), 'Review', 0);
return $spam_helper->InSpamControl();
}
function HasError($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
if (method_exists($object, 'GetErrorMsg')) {
return parent::HasError($params);
}
else {
return 0;
}
}
/**
* Preserve main item id in subitem pagination url
*
* @param Array $params
* @return string
*/
function PageLink($params)
{
$object =& $this->getObject($params);
/* @var kDBList */
$parent_info = $object->getLinkedInfo();
if ($parent_info['ParentId'] > 0) {
$params['pass'] = 'm,'.$this->getPrefixSpecial().','.$parent_info['ParentPrefix'];
}
return parent::PageLink($params);
}
function InitCatalogTab($params)
{
$tab_params['mode'] = $this->Application->GetVar('tm'); // single/multi selection possible
$tab_params['special'] = $this->Application->GetVar('ts'); // use special for this tab
$tab_params['dependant'] = $this->Application->GetVar('td'); // is grid dependant on categories grid
// set default params (same as in catalog)
if ($tab_params['mode'] === false) $tab_params['mode'] = 'multi';
if ($tab_params['special'] === false) $tab_params['special'] = '';
if ($tab_params['dependant'] === false) $tab_params['dependant'] = 'yes';
// pass params to block with tab content
$params['name'] = $params['render_as'];
$params['prefix'] = trim($this->Prefix.'.'.($tab_params['special'] ? $tab_params['special'] : $this->Special), '.');
$params['cat_prefix'] = trim('c.'.($tab_params['special'] ? $tab_params['special'] : $this->Special), '.');
$params['tab_mode'] = $tab_params['mode'];
$params['grid_name'] = ($tab_params['mode'] == 'multi') ? $params['default_grid'] : $params['radio_grid'];
$params['tab_dependant'] = $tab_params['dependant'];
$params['show_category'] = $tab_params['special'] == 'showall' ? 1 : 0; // this is advanced view -> show category name
$params['tab_name'] = $this->Application->GetVar('tab_name');
return $this->Application->ParseBlock($params, 1);
}
/**
* Returns reviews count for each item type (in "Reviews" section)
*
* @param Array $params
* @return string
*/
function CatalogItemCount($params)
{
$object =& $this->GetList($params);
if (!$object->Counted) {
$object->CountRecs();
}
return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' / '.$object->NoFilterCount : $object->RecordsCount;
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/reviews/reviews_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.9.2.2
\ No newline at end of property
+1.9.2.3
\ No newline at end of property
Index: branches/RC/core/units/reviews/reviews_event_handler.php
===================================================================
--- branches/RC/core/units/reviews/reviews_event_handler.php (revision 11537)
+++ branches/RC/core/units/reviews/reviews_event_handler.php (revision 11538)
@@ -1,474 +1,489 @@
<?php
class ReviewsEventHandler extends kDBEventHandler
{
/**
* Get's special of main item for linking with subitem
*
* @param kEvent $event
* @return string
*/
function getMainSpecial(&$event)
{
if ($event->Special == 'product' && !$this->Application->IsAdmin()) {
// rev.product should auto-link
return '';
}
return parent::getMainSpecial($event);
}
/**
* Checks REVIEW/REVIEW.PENDING permission by main object primary category (not current category)
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if ($event->Name == 'OnAddReview' || $event->Name == 'OnCreate') {
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
$parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
$main_object =& $this->Application->recallObject($parent_prefix);
/* @var $main_object kCatDBItem */
$perm_name = $this->getPermPrefix($event).'.REVIEW';
$res = $this->Application->CheckPermission($perm_name, 0, $main_object->GetDBField('CategoryId')) ||
$this->Application->CheckPermission($perm_name.'.PENDING', 0, $main_object->GetDBField('CategoryId'));
if (!$res) {
$event->status = erPERM_FAIL;
}
return $res;
}
$check_events = Array (
'OnItemBuild', 'OnUpdate', /*'OnMassApprove', 'OnMassDecline'*/
);
$perm_category = $this->_getReviewCategory($event);
if (in_array($event->Name, $check_events)) {
// check for PRODUCT.VIEW permission
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
$perm_prefix = $this->getPermPrefix($event);
if ($perm_category === false) {
// no item id present -> allow
return true;
}
switch ($event->Name) {
case 'OnItemBuild':
$res = $this->Application->CheckPermission($perm_prefix . '.VIEW', 0, $perm_category);
break;
case 'OnUpdate':
case 'OnMassApprove':
case 'OnMassDecline':
$res = $this->Application->CheckPermission($perm_prefix . '.ADD', 0, $perm_category) ||
$this->Application->CheckPermission($perm_prefix . '.MODIFY', 0, $perm_category);
break;
}
if (!$res) {
$event->status = erPERM_FAIL;
}
return $res;
}
return parent::CheckPermission($event);
}
/**
* Returns primary category of review's main item
*
* @param kEvent $event
* @return int
*/
function _getReviewCategory(&$event)
{
$items_info = $this->Application->GetVar($event->getPrefixSpecial());
- list ($review_id, ) = each($items_info);
+
+ if ($items_info) {
+ // rev:PersetFormFields is used to initialize new review creation
+ list ($review_id, ) = each($items_info);
+ }
+ else {
+ // when adding new review in admin
+ $review_id = false;
+
+ }
if (!$review_id) {
return false;
}
- // 1. get main item resource id
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ // 1. get main item resource id (use object, because of temp tables in admin)
$sql = 'SELECT ItemId
- FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . '
- WHERE ' . $this->Application->getUnitOption($event->Prefix, 'IDField') . ' = ' . $review_id;
+ FROM ' . $object->TableName . '
+ WHERE ' . $object->IDField . ' = ' . $review_id;
$resource_id = $this->Conn->GetOne($sql);
// 2. set main item id (for permission checks)
$parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
$sql = 'SELECT ' . $this->Application->getUnitOption($parent_prefix, 'IDField') .'
FROM ' . $this->Application->getUnitOption($parent_prefix, 'TableName') .'
WHERE ResourceId = ' . $resource_id;
$this->Application->SetVar($parent_prefix . '_id', $this->Conn->GetOne($sql));
// 3. get main item category
$sql = 'SELECT CategoryId
FROM ' . $this->Application->getUnitOption('ci', 'TableName') .'
WHERE ItemResourceId = ' . $resource_id .' AND PrimaryCat = 1';
return $this->Conn->GetOne($sql);
}
/**
* Returns prefix for permissions
*
* @param kEvent $event
*/
function getPermPrefix(&$event)
{
$main_prefix = $this->Application->GetTopmostPrefix($event->Prefix, true);
// this will return LINK for l, ARTICLE for n, TOPIC for bb, PRODUCT for p
$item_prefix = $this->Application->getUnitOption($main_prefix, 'PermItemPrefix');
return $item_prefix;
}
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @access protected
* @see OnListBuild
*/
function SetCustomQuery(&$event)
{
$object =& $event->getObject();
/* @var $object kDBList */
if (!$this->Application->IsAdmin()) {
$object->addFilter('active', '%1$s.Status = '.STATUS_ACTIVE);
}
switch ($event->Special)
{
case 'showall':
$object->clearFilters();
break;
case 'item': // used ?
$object->clearFilters();
$info = $object->getLinkedInfo();
$this->Application->setUnitOption($info['ParentPrefix'], 'AutoLoad', true);
$parent =& $this->Application->recallObject($info['ParentPrefix']);
$object->addFilter('item_reviews', '%1$s.ItemId = '.$parent->GetDBField('ResourceId'));
break;
case 'products': // used in In-Portal (Sturcture & Data -> Reviews section)
$object->removeFilter('parent_filter'); // this is important
$object->addFilter('product_reviews', 'pr.ResourceId IS NOT NULL');
break;
/*case 'product':
$object->addFilter('product_reviews', '%1$s.ItemId = pr.ResourceId'); // for LEFT JOIN
break;*/
}
if (preg_match('/(.*)-rev/', $event->Prefix, $regs)) {
// "Structure & Data" -> "Reviews" (section in K4)
$item_type = $this->Application->getUnitOption($regs[1], 'ItemType');
$object->addFilter('itemtype_filter', '%1$s.ItemType = ' . $item_type);
}
if ($event->getEventParam('type') == 'current_user') {
// $object->removeFilter('active');
$object->addFilter('current_user', '%1$s.CreatedById = '.$this->Application->RecallVar('user_id'));
$object->addFilter('current_ip', '%1$s.IPAddress = "'.$_SERVER['REMOTE_ADDR'].'"');
}
}
/**
* Adds review from front in case if user is logged in
*
* @param kEvent $event
*/
function OnAddReview(&$event)
{
$event->CallSubEvent('OnCreate');
}
/**
* Get new review status on user review permission
*
* @param kEvent $event
* @return int
*/
function getReviewStatus(&$event)
{
$parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
$main_object =& $this->Application->recallObject($parent_prefix);
/* @var $main_object kCatDBItem */
$ret = STATUS_DISABLED;
$perm_name = $this->getPermPrefix($event).'.REVIEW';
if ($this->Application->CheckPermission($perm_name, 0, $main_object->GetDBField('CategoryId'))) {
$ret = STATUS_ACTIVE;
}
else if ($this->Application->CheckPermission($perm_name.'.PENDING', 0, $main_object->GetDBField('CategoryId'))) {
$ret = STATUS_PENDING;
}
return $ret;
}
/**
* Prefills all fields on front-end
*
* @param kEvent $event
*/
function OnBeforeItemCreate(&$event)
{
$object =& $event->getObject();
/* @var $object kDBItem */
$parent_info = $object->getLinkedInfo();
$item_type = $this->Application->getUnitOption($parent_info['ParentPrefix'], 'ItemType');
$object->SetDBField('IPAddress', $_SERVER['REMOTE_ADDR']);
$object->SetDBField('ItemType', $item_type);
$object->SetDBField('Module', $this->Application->findModule('Var', $parent_info['ParentPrefix'], 'Name'));
if ($this->Application->IsAdmin()) {
return ;
}
$spam_helper =& $this->Application->recallObject('SpamHelper');
/* @var $spam_helper SpamHelper */
$spam_helper->InitHelper($parent_info['ParentId'], 'Review', 0);
if ($spam_helper->InSpamControl()) {
$event->status = erFAIL;
$object->SetError('ReviewText', 'too_frequent', 'lu_ferror_review_duplicate');
return ;
}
$rating = $object->GetDBField('Rating');
if ($rating < 1 || $rating > 5) {
$object->SetDBField('Rating', null);
}
$object->SetDBField('ItemId', $parent_info['ParentId']); // ResourceId
$object->SetDBField('CreatedById', $this->Application->RecallVar('user_id'));
$object->SetDBField('Status', $this->getReviewStatus($event));
$object->SetDBField('TextFormat', 0); // set plain text format directly
}
/**
* Sets correct rating value
*
* @param kEvent $event
*/
function OnBeforeItemUpdate(&$event)
{
$object =& $event->getObject();
$rating = $object->GetDBField('Rating');
if (!$rating) {
$object->SetDBField('Rating', null);
}
}
/**
* Updates item review counter
*
* @param kEvent $event
*/
function OnAfterItemCreate(&$event)
{
$this->updateSubitemCounters($event);
if (!$this->Application->IsAdmin()) {
$spam_helper =& $this->Application->recallObject('SpamHelper');
/* @var $spam_helper SpamHelper */
$object =& $event->getObject();
$parent_info = $object->getLinkedInfo();
$config_mapping = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping');
$review_settings = $config_mapping['ReviewDelayValue'].':'.$config_mapping['ReviewDelayInterval'];
$spam_helper->InitHelper($parent_info['ParentId'], 'Review', $review_settings);
$spam_helper->AddToSpamControl();
}
}
/**
* Updates item review counter
*
* @param kEvent $event
*/
function OnAfterItemUpdate(&$event)
{
$this->updateSubitemCounters($event);
}
/**
* Updates total review counter, cached rating, votes count
*
* @param kEvent $event
*/
function updateSubitemCounters(&$event)
{
$parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
$main_object =& $this->Application->recallObject($parent_prefix, null, Array ('raise_warnings' => 0));
/* @var $main_object kCatDBItem */
if (!$main_object->isLoaded()) {
// deleting main item / cloning main item
return ;
}
$object =& $event->getObject(); // for temp tables
/* @var $object kDBItem */
// 1. update review counter
$sql = 'SELECT COUNT(ReviewId)
FROM '.$object->TableName.'
WHERE ItemId = '.$main_object->GetDBField('ResourceId');
$review_count = $this->Conn->GetOne($sql);
$main_object->SetDBField('CachedReviewsQty', $review_count);
// 2. update votes counter + rating
$rating = $object->GetDBField('Rating');
$avg_rating = $main_object->GetDBField('CachedRating');
$votes_count = $main_object->GetDBField('CachedVotesQty');
switch ($event->Name) {
case 'OnAfterItemCreate': // adding new review with rating
$this->changeRating($avg_rating, $votes_count, $rating, '+');
break;
case 'OnAfterItemDelete':
$this->changeRating($avg_rating, $votes_count, $rating, '-');
break;
case 'OnAfterItemUpdate':
$this->changeRating($avg_rating, $votes_count, $object->GetOriginalField('Rating'), '-');
$this->changeRating($avg_rating, $votes_count, $rating, '+');
break;
}
$main_object->SetDBField('CachedRating', $avg_rating);
$main_object->SetDBField('CachedVotesQty', $votes_count);
$main_object->Update();
}
/**
* Changes average rating and votes count based on requested operation
*
* @param float $avg_rating average rating before new vote
* @param int $votes_count votes count before new vote
* @param int $rating new vote (from 1 to 5)
* @param string $operation requested operation (+ / -)
*/
function changeRating(&$avg_rating, &$votes_count, $rating, $operation)
{
if ($rating < 1 || $rating > 5) {
return ;
}
if ($operation == '+') {
$avg_rating = (($avg_rating * $votes_count) + $rating) / ($votes_count + 1);
++$votes_count;
}
else {
$avg_rating = (($avg_rating * $votes_count) - $rating) / ($votes_count - 1);
--$votes_count;
}
}
/**
* Updates main item cached review counter
*
* @param kEvent $event
*/
function OnAfterItemDelete(&$event)
{
$this->updateSubitemCounters($event);
}
/**
* Creates review & redirect to confirmation template
*
* @param kEvent $event
*/
function OnCreate(&$event)
{
parent::OnCreate($event);
if ($event->status != erSUCCESS || $this->Application->IsAdmin()) {
return ;
}
$object =& $event->getObject();
$next_template = $object->GetDBField('Status') == STATUS_ACTIVE ? 'success_template' : 'success_pending_template';
$event->redirect = $this->Application->GetVar($next_template);
$event->SetRedirectParam('opener', 's');
$parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
$event->SetRedirectParam('pass', 'm,'.$parent_prefix);
}
/**
* Makes left join to item's table, when in separate grid
*
* @param kEvent $event
*/
function OnAfterConfigRead(&$event)
{
parent::OnAfterConfigRead($event);
if (preg_match('/(.*)-rev/', $event->Prefix, $regs) && $this->Application->prefixRegistred($regs[1])) {
// "Structure & Data" -> "Reviews" (section in K4)
// 1. add join to items table (for "Structure & Data" -> "Reviews" section)
$item_table = $this->Application->getUnitOption($regs[1], 'TableName');
+ $ci_table = $this->Application->getUnitOption('ci', 'TableName');
$list_sqls = $this->Application->getUnitOption($event->Prefix, 'ListSQLs');
$list_sqls[''] .= ' LEFT JOIN '.$item_table.' item_table ON item_table.ResourceId = %1$s.ItemId';
+ $list_sqls[''] .= ' LEFT JOIN '.$ci_table.' ci ON item_table.ResourceId = ci.ItemResourceId AND ci.PrimaryCat = 1';
$this->Application->setUnitOption($event->Prefix, 'ListSQLs', $list_sqls);
// 2. add calculated field
$calculated_fields = $this->Application->getUnitOption($event->Prefix, 'CalculatedFields');
$calculated_fields['']['CatalogItemName'] = 'item_table.' . $this->getTitleField($regs[1]);
$calculated_fields['']['CatalogItemId'] = 'item_table.' . $this->Application->getUnitOption($regs[1], 'IDField');
+ $calculated_fields['']['CatalogItemCategory'] = 'ci.CategoryId';
$this->Application->setUnitOption($event->Prefix, 'CalculatedFields', $calculated_fields);
}
}
/**
* Convert TitleField field of kMultiLanguage formatter used for it
*
* @param string $prefix
* @return string
*/
function getTitleField($prefix)
{
$lang_prefix = 'l'.$this->Application->GetVar('m_lang').'_';
$title_field = $this->Application->getUnitOption($prefix, 'TitleField');
$field_options = $this->Application->getUnitOption($prefix.'.'.$title_field, 'Fields');
$formatter_class = isset($field_options['formatter']) ? $field_options['formatter'] : '';
if ($formatter_class == 'kMultiLanguage' && !isset($field_options['master_field'])) {
$title_field = $lang_prefix.$title_field;
}
return $title_field;
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/reviews/reviews_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.14.2.4
\ No newline at end of property
+1.14.2.5
\ No newline at end of property
Index: branches/RC/core/units/admin/admin_config.php
===================================================================
--- branches/RC/core/units/admin/admin_config.php (revision 11537)
+++ branches/RC/core/units/admin/admin_config.php (revision 11538)
@@ -1,85 +1,85 @@
<?php
$config = Array (
'Prefix' => 'adm',
'ItemClass' => Array ('class' => 'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'EventHandlerClass' => Array ('class' => 'AdminEventsHandler', 'file' => 'admin_events_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'AdminTagProcessor', 'file' => 'admin_tag_processor.php', 'build_event' => 'OnBuild'),
'QueryString' => Array (
1 => 'event',
),
'TitlePresets' => Array (
'tree_root' => Array ('format' => '!la_section_overview!'),
'tree_reports' => Array ('format' => '!la_section_overview!'),
'tree_system' => Array ('format' => '!la_section_overview!'),
'tree_tools' => Array ('format' => '!la_section_overview!'),
'system_tools' => Array ('format' => '!la_title_SystemTools!'),
- 'backup' => Array ('format' => '!la_performing_backup!'),
- 'import' => Array ('format' => '!la_performing_import!'),
- 'restore' => Array ('format' => '!la_performing_restore!'),
+ 'backup' => Array ('format' => '!la_performing_backup! - !la_Step! <span id="step_number"></span>'),
+ 'import' => Array ('format' => '!la_performing_import! - !la_Step! <span id="step_number"></span>'),
+ 'restore' => Array ('format' => '!la_performing_restore! - !la_Step! <span id="step_number"></span>'),
'server_info' => Array ('format' => '!la_tab_ServerInfo!'),
'sql_query' => Array ('format' => '!la_tab_QueryDB!'),
'no_permissions' => Array ('format' => '!la_title_NoPermissions!'),
'column_picker' => Array ('format' => '!la_title_ColumnPicker!'),
'csv_export' => Array ('format' => '!la_title_CSVExport!'),
'csv_import' => Array ('format' => '!la_title_CSVImport!'),
),
'PermSection' => Array ('main' => 'in-portal:service'),
'Sections' => Array (
'in-portal:root' => Array (
'parent' => null,
'icon' => 'site',
'label' => $this->Application->ConfigValue('Site_Name'),
'url' => Array ('t' => 'sections_list', 'pass' => 'm', 'pass_section' => true, 'no_amp' => 1),
'permissions' => Array ('advanced:admin_login', 'advanced:front_login'),
'priority' => 0,
'type' => stTREE,
'icon_module' => 'in-portal',
),
'in-portal:service' => Array (
'parent' => 'in-portal:tools',
'icon' => 'conf_general',
'label' => 'la_tab_Service',
'url' => Array ('t' => 'tools/system_tools', 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 10,
'show_mode' => smDEBUG,
'type' => stTREE,
),
),
'ListSQLs' => Array (
'' => '', // to prevent warning
),
'Fields' => Array (), // we need empty array because kernel doesn't use virtual fields else
'VirtualFields' => Array (
'ImportFile' => Array (
'type' => 'string',
'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, // in Bytes !
'error_msgs' => Array (
'cant_open_file' => '!la_error_CantOpenFile!',
'no_matching_columns' => '!la_error_NoMatchingColumns!',
),
'file_types' => '*.csv', 'files_description' => '!la_CSVFiles!',
'upload_dir' => '/system/import/', // relative to project's home
'multiple' => false, 'direct_links' => false,
'default' => null,
),
'Content' => Array ('type' => 'string', 'default' => ''),
),
);
Property changes on: branches/RC/core/units/admin/admin_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.23.2.9
\ No newline at end of property
+1.23.2.10
\ No newline at end of property
Index: branches/RC/core/units/admin/admin_tag_processor.php
===================================================================
--- branches/RC/core/units/admin/admin_tag_processor.php (revision 11537)
+++ branches/RC/core/units/admin/admin_tag_processor.php (revision 11538)
@@ -1,1074 +1,1076 @@
<?php
class AdminTagProcessor extends kDBTagProcessor {
function SetConst($params)
{
$name = $this->SelectParam($params, 'name,const');
safeDefine($name, $params['value']);
}
/**
* Allows to execute js script after the page is fully loaded
*
* @param Array $params
* @return string
*/
function AfterScript($params)
{
$after_script = $this->Application->GetVar('after_script');
if ($after_script) {
return '<script type="text/javascript">'.$after_script.'</script>';
}
return '';
}
/**
* Returns section title with #section# keyword replaced with current section
*
* @param Array $params
* @return string
*/
function GetSectionTitle($params)
{
if (array_key_exists('default', $params)) {
return $params['default'];
}
return $this->Application->Phrase( replaceModuleSection($params['phrase']) );
}
/**
* Returns section icon with #section# keyword replaced with current section
*
* @param Array $params
* @return string
*/
function GetSectionIcon($params)
{
return replaceModuleSection($params['icon']);
}
/**
* Allows to detect if current template is one of listed ones
*
* @param Array $params
* @return int
*/
function TemplateMatches($params)
{
$templates = explode(',' ,$params['templates']);
$t = $this->Application->GetVar('t');
return in_array($t, $templates) ? 1 : 0;
}
/**
* Save return script in cases, when old sections are opened from new sections
*
* @param Array $params
*/
function SaveReturnScript($params)
{
// admin/save_redirect.php?do=
$m =& $this->Application->recallObject('m_TagProcessor');
$url = str_replace($this->Application->BaseURL(), '', $m->Link($params) );
$url = explode('?', $url, 2);
$url = 'save_redirect.php?'.$url[1].'&do='.$url[0];
$this->Application->StoreVar('ReturnScript', $url);
}
/**
* Returns version of module by name
*
* @param Array $params
* @return string
*/
function ModuleVersion($params)
{
return $this->Application->findModule('Name', $params['module'], 'Version');
}
/**
* Used in table form section drawing
*
* @param Array $params
* @return string
*/
function DrawTree($params)
{
static $deep_level = 0;
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
$params['deep_level'] = $deep_level++;
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
if (!isset($section_data['children'])) {
return $ret;
}
$debug_mode = $this->Application->isDebugMode();
$super_admin_mode = $this->Application->RecallVar('super_admin');
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $section_name) {
$section_data =& $sections_helper->getSectionData($section_name);
if (isset($section_data['show_mode']) && is_numeric($section_data['show_mode'])) {
$show_mode = $section_data['show_mode'];
// if super admin section -> show in super admin mode & debug mode
$show_section = $show_mode == smNORMAL || ((($show_mode & smSUPER_ADMIN) == smSUPER_ADMIN) && ($super_admin_mode || $debug_mode));
if (!$show_section) {
// if section is in debug mode only && debug mode -> show
$show_section = (($show_mode & smDEBUG) == smDEBUG) && $debug_mode;
}
if (!$show_section) {
continue;
}
}
$params['section_name'] = $section_name;
$ret .= $this->DrawTree($params);
$deep_level--;
}
return $ret;
}
function SectionInfo($params)
{
$section = $params['section'];
if ($section == '#session#') {
$section = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
$section_data =& $sections_helper->getSectionData($section);
if (!$section_data) {
trigger_error('Use of undefined section "<strong>' . $section . '</strong>" in "<strong>' . __METHOD__ . '</strong>"', E_USER_ERROR);
return '';
}
if (isset($params['parent']) && $params['parent']) {
do {
$section_data =& $sections_helper->getSectionData($section_data['parent']);
} while (isset($section_data['use_parent_header']) && $section_data['use_parent_header']);
}
$info = $params['info'];
switch ($info) {
case 'module_path':
if (isset($params['module']) && $params['module']) {
$module = $params['module'];
}
elseif (isset($section_data['icon_module'])) {
$module = $section_data['icon_module'];
}
else {
$module = '#session#';
}
$res = $this->ModulePath(array('module' => $module));
break;
case 'perm_section':
$res = $sections_helper->getPermSection($section);
break;
default:
$res = $section_data[$info];
}
if ($info == 'label' || isset($params['as_label'])) {
$res = $this->Application->Phrase($res);
}
return $res;
}
function PrintSection($params)
{
$section_name = $params['section_name'];
if ($section_name == '#session#') {
$section_name = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
if (isset($params['use_first_child']) && $params['use_first_child']) {
$section_name = $sections_helper->getFirstChild($section_name, true);
}
$section_data =& $sections_helper->getSectionData($section_name);
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
$params['section_name'] = $section_name;
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$ret = $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
return $ret;
}
/**
* Used in XML drawing for tree
*
* @param Array $params
* @return string
*/
function PrintSections($params)
{
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
if ($section_name == '#session#') {
$section_name = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
$section_data =& $sections_helper->getSectionData($section_name);
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
if (!isset($section_data['children'])) {
return '';
}
$debug_mode = $this->Application->isDebugMode();
$super_admin_mode = $this->Application->RecallVar('super_admin');
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $section_name) {
$params['section_name'] = $section_name;
$section_data =& $sections_helper->getSectionData($section_name);
if (isset($section_data['show_mode']) && is_numeric($section_data['show_mode'])) {
$show_mode = $section_data['show_mode'];
// if super admin section -> show in super admin mode & debug mode
$show_section = $show_mode == smNORMAL || ((($show_mode & smSUPER_ADMIN) == smSUPER_ADMIN) && ($super_admin_mode || $debug_mode));
if (!$show_section) {
// if section is in debug mode only && debug mode -> show
$show_section = (($show_mode & smDEBUG) == smDEBUG) && $debug_mode;
}
if (!$show_section) {
continue;
}
}
if (isset($section_data['tabs_only']) && $section_data['tabs_only']) {
$perm_status = false;
$folder_label = $section_data['label'];
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $priority => $section_name) {
// if only tabs in this section & none of them have permission, then skip section too
$section_name = $sections_helper->getPermSection($section_name);
$perm_status = $this->Application->CheckPermission($section_name.'.view', 1);
if ($perm_status) {
break;
}
}
if (!$perm_status) {
// no permission for all tabs -> don't display tree node either
continue;
}
$params['section_name'] = $section_name;
$section_data =& $sections_helper->getSectionData($section_name);
$section_data['label'] = $folder_label; // use folder label in tree
$section_data['is_tab'] = 1;
}
else {
$section_name = $sections_helper->getPermSection($section_name);
if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue;
}
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
// remove template, so it doesn't appear as additional parameter in url
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$late_load = getArrayValue($section_data, 'late_load');
if ($late_load) {
$t = $late_load['t'];
unset($late_load['t']);
$section_data['late_load'] = $this->Application->HREF($t, '', $late_load);
$params['children_count'] = 99;
}
else {
$section_data['late_load'] = '';
}
// restore template
$section_data['url']['t'] = $template;
$ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
$params['section_name'] = $section_name;
}
return preg_replace("/\r\n|\n/", '', $ret);
}
function ListSectionPermissions($params)
{
$section_name = isset($params['section_name']) ? $params['section_name'] : $this->Application->GetVar('section_name');
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$block_params = array_merge_recursive2($section_data, Array('name' => $params['render_as'], 'section_name' => $section_name));
$ret = '';
foreach ($section_data['permissions'] as $perm_name) {
if (preg_match('/^advanced:(.*)/', $perm_name) != $params['type']) continue;
$block_params['perm_name'] = $perm_name;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
function ModuleInclude($params)
{
foreach ($params as $param_name => $param_value) {
$params[$param_name] = replaceModuleSection($param_value);
}
$m =& $this->Application->recallObject('m_TagProcessor');
return $m->ModuleInclude($params);
}
function TodayDate($params)
{
return date($params['format']);
}
function TreeEditWarrning($params)
{
$ret = $this->Application->Phrase($params['label']);
$ret = str_replace(Array('&lt;', '&gt;', 'br/', 'br /', "\n", "\r"), Array('<', '>', 'br', 'br', '', ''), $ret);
if (getArrayValue($params, 'escape')) {
$ret = addslashes($ret);
}
$ret = str_replace('<br>', '\n', $ret);
return $ret;
}
/**
* Draws section tabs using block name passed
*
* @param Array $params
*/
function ListTabs($params)
{
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($params['section_name']);
$ret = '';
$block_params = Array('name' => $params['render_as']);
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $priority => $section_name) {
if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue;
$tab_data =& $sections_helper->getSectionData($section_name);
$block_params['t'] = $tab_data['url']['t'];
$block_params['title'] = $tab_data['label'];
$block_params['main_prefix'] = $section_data['SectionPrefix'];
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
/**
* Returns list of module item tabs that have view permission in current category
*
* @param Array $params
*/
function ListCatalogTabs($params)
{
$ret = '';
$special = isset($params['special']) ? $params['special'] : '';
$replace_main = isset($params['replace_m']) && $params['replace_m'];
$skip_prefixes = isset($params['skip_prefixes']) ? explode(',', $params['skip_prefixes']) : Array();
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
$prefix = $module_info['Var'];
if ($prefix == 'm' && $replace_main) {
$prefix = 'c';
}
if (in_array($prefix, $skip_prefixes) || !$this->Application->prefixRegistred($prefix) || !$this->Application->getUnitOption($prefix, 'CatalogItem')) {
continue;
}
$icon = $this->Application->getUnitOption($prefix, 'CatalogTabIcon');
if (strpos($icon, ':') !== false) {
list ($icon_module, $icon) = explode(':', $icon, 2);
}
else {
$icon_module = 'core';
}
$label = $this->Application->getUnitOption($prefix, $params['title_property']);
$block_params['title'] = $label;
$block_params['prefix'] = $prefix;
$block_params['icon_module'] = $icon_module;
$block_params['icon'] = $icon;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
/**
* Allows to construct link for opening any type of catalog item selector
*
* @param Array $params
* @return string
*/
function SelectorLink($params)
{
$mode = 'catalog';
if (isset($params['mode'])) { // {catalog, advanced_view}
$mode = $params['mode'];
unset($params['mode']);
}
$params['t'] = 'catalog/item_selector/item_selector_'.$mode;
$params['m_cat_id'] = $this->Application->findModule('Name', 'Proj-CMS', 'RootCat');
$default_params = Array('no_amp' => 1, 'pass' => 'all,'.$params['prefix']);
unset($params['prefix']);
$pass_through = Array();
if (isset($params['tabs_dependant'])) { // {yes, no}
$pass_through['td'] = $params['tabs_dependant'];
unset($params['tabs_dependant']);
}
if (isset($params['selection_mode'])) { // {single, multi}
$pass_through['tm'] = $params['selection_mode'];
unset($params['selection_mode']);
}
if (isset($params['tab_prefixes'])) { // {all, none, <comma separated prefix list}
$pass_through['tp'] = $params['tab_prefixes'];
unset($params['tab_prefixes']);
}
if ($pass_through) {
// add pass_through to selector url if any
$params['pass_through'] = implode(',', array_keys($pass_through));
$params = array_merge_recursive2($params, $pass_through);
}
// user can override default parameters (except pass_through of course)
$params = array_merge_recursive2($default_params, $params);
$main_processor =& $this->Application->recallObject('m_TagProcessor');
return $main_processor->T($params);
}
function TimeFrame($params)
{
$w = adodb_date('w');
$m = adodb_date('m');
$y = adodb_date('Y');
//FirstDayOfWeek is 0 for Sunday and 1 for Monday
$fdow = $this->Application->ConfigValue('FirstDayOfWeek');
if ($fdow && $w == 0) $w = 7;
$today_start = adodb_mktime(0,0,0,adodb_date('m'),adodb_date('d'),$y);
$first_day_of_this_week = $today_start - ($w - $fdow)*86400;
$first_day_of_this_month = adodb_mktime(0,0,0,$m,1,$y);
$this_quater = ceil($m/3);
$this_quater_start = adodb_mktime(0,0,0,$this_quater*3-2,1,$y);
switch ($params['type']) {
case 'last_week_start':
$timestamp = $first_day_of_this_week - 86400*7;
break;
case 'last_week_end':
$timestamp = $first_day_of_this_week - 1;
break;
case 'last_month_start':
$timestamp = $m == 1 ? adodb_mktime(0,0,0,12,1,$y-1) : adodb_mktime(0,0,0,$m-1,1,$y);
break;
case 'last_month_end':
$timestamp = $first_day_of_this_month = adodb_mktime(0,0,0,$m,1,$y) - 1;
break;
case 'last_quater_start':
$timestamp = $this_quater == 1 ? adodb_mktime(0,0,0,10,1,$y-1) : adodb_mktime(0,0,0,($this_quater-1)*3-2,1,$y);
break;
case 'last_quater_end':
$timestamp = $this_quater_start - 1;
break;
case 'last_6_months_start':
$timestamp = $m <= 6 ? adodb_mktime(0,0,0,$m+6,1,$y-1) : adodb_mktime(0,0,0,$m-6,1,$y);
break;
case 'last_year_start':
$timestamp = adodb_mktime(0,0,0,1,1,$y-1);
break;
case 'last_year_end':
$timestamp = adodb_mktime(23,59,59,12,31,$y-1);
break;
}
if (isset($params['format'])) {
$format = $params['format'];
if(preg_match("/_regional_(.*)/", $format, $regs))
{
$lang =& $this->Application->recallObject('lang.current');
$format = $lang->GetDBField($regs[1]);
}
return adodb_date($format, $timestamp);
}
return $timestamp;
}
/**
* Redirect to cache rebuild template, when required by installator
*
* @param Array $params
*/
function CheckPermCache($params)
{
$sql = 'SELECT Data
FROM '.TABLE_PREFIX.'Cache
WHERE VarName = "ForcePermCacheUpdate"';
if ($this->Application->isModuleEnabled('In-Portal') && $this->Conn->GetOne($sql)) {
$this->Application->Redirect($params['cache_update_t'], array('continue' => 1));
}
}
/**
* Checks if current protocol is SSL
*
* @param Array $params
* @return int
*/
function IsSSL($params)
{
return (PROTOCOL == 'https://')? 1 : 0;
}
function PrintColumns($params)
{
$picker_helper =& $this->Application->RecallObject('ColumnPickerHelper');
$picker_helper->SetGridName($this->Application->GetLinkedVar('grid_name'));
/* @var $picker_helper kColumnPickerHelper */
$main_prefix = $this->Application->RecallVar('main_prefix');
$cols = $picker_helper->LoadColumns($main_prefix);
$this->Application->Phrases->AddCachedPhrase('__FREEZER__', '-------------');
$o = '';
if (isset($params['hidden']) && $params['hidden']) {
foreach ($cols['hidden_fields'] as $col) {
$title = $this->Application->Phrase($cols['titles'][$col]);
$o .= "<option value='$col'>".$title;
}
}
else {
foreach ($cols['order'] as $col) {
if (in_array($col, $cols['hidden_fields'])) continue;
$title = $this->Application->Phrase($cols['titles'][$col]);
$o .= "<option value='$col'>".$title;
}
}
return $o;
}
/**
* Allows to set popup size (key - current template name)
*
* @param Array $params
*/
function SetPopupSize($params)
{
$width = $params['width'];
$height = $params['height'];
if ($this->Application->GetVar('ajax') == 'yes') {
// during AJAX request just output size
die($width.'x'.$height);
}
if (!$this->UsePopups($params)) {
return ;
}
$t = $this->Application->GetVar('t');
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'PopupSizes
WHERE TemplateName = '.$this->Conn->qstr($t);
$popup_info = $this->Conn->GetRow($sql);
if (!$popup_info) {
// create new popup size record
$fields_hash = Array (
'TemplateName' => $t,
'PopupWidth' => $width,
'PopupHeight' => $height,
);
$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'PopupSizes');
}
elseif ($popup_info['PopupWidth'] != $width || $popup_info['PopupHeight'] != $height) {
// popup found and size in tag differs from one in db -> update in db
$fields_hash = Array (
'PopupWidth' => $width,
'PopupHeight' => $height,
);
$this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'PopupSizes', 'PopupId = '.$popup_info['PopupId']);
}
}
/**
* Returns popup size (by template), if not cached, then parse template to get value
*
* @param Array $params
* @return string
*/
function GetPopupSize($params)
{
$t = $this->Application->GetVar('template_name');
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'PopupSizes
WHERE TemplateName = '.$this->Conn->qstr($t);
$popup_info = $this->Conn->GetRow($sql);
if (!$popup_info) {
$this->Application->InitParser();
$this->Application->ParseBlock(array('name' => $t)); // dies when SetPopupSize tag found & in ajax requrest
return '750x400'; // tag SetPopupSize not found in template -> use default size
}
return $popup_info['PopupWidth'].'x'.$popup_info['PopupHeight'];
}
function UsePopups($params)
{
return (int)$this->Application->ConfigValue('UsePopups') || $this->Application->GetVar('_force_popup');
}
function UseToolbarLabels($params)
{
return (int)$this->Application->ConfigValue('UseToolbarLabels');
}
/**
* Checks if debug mode enabled (optionally) and specified constant is on
*
* @param Array $params
* @return bool
*/
function ConstOn($params)
{
$constant_name = $this->SelectParam($params, 'name,const');
$debug_mode = isset($params['debug_mode']) && $params['debug_mode'] ? $this->Application->isDebugMode() : true;
return $debug_mode && constOn($constant_name);
}
/**
* Builds link to last template in main frame of admin
*
* @param Array $params
* @return string
*/
function MainFrameLink($params)
{
$persistent = isset($params['persistent']) && $params['persistent'];
if ($persistent && $this->Application->ConfigValue('RememberLastAdminTemplate')) {
// check last_template in persistent session
$last_template = $this->Application->RecallPersistentVar('last_template_popup');
}
else {
// check last_template in session
$last_template = $this->Application->RecallVar('last_template_popup'); // because of m_opener=s there
}
if (!$last_template) {
$params['persistent'] = 1;
return $persistent ? false : $this->MainFrameLink($params);
}
list($index_file, $env) = explode('|', $last_template);
$vars = $this->Application->HttpQuery->processQueryString($env, 'pass');
$recursion_templates = Array ('login', 'index', 'no_permission');
if (isset($vars['admin']) && $vars['admin'] == 1) {
// index template doesn't begin recursion on front-end (in admin frame)
$vars['m_theme'] = '';
if (isset($params['m_opener']) && $params['m_opener'] == 'r') {
// front-end link for highlighting purposes
$vars['t'] = 'index';
$vars['m_cat_id'] = $this->Application->findModule('Name', 'Proj-CMS', 'RootCat');
}
unset($recursion_templates[ array_search('index', $recursion_templates)]);
}
if (in_array($vars['t'], $recursion_templates)) {
// prevents redirect recursion OR old in-portal pages
$params['persistent'] = 1;
return $persistent ? false : $this->MainFrameLink($params);
}
$vars = array_merge_recursive2($vars, $params);
$t = $vars['t'];
unset($vars['t'], $vars['persistent']);
return $this->Application->HREF($t, '', $vars, $index_file);
}
/**
* Returns menu frame width or 200 in case, when invalid width specified in config
*
* @param Array $params
* @return string
*/
function MenuFrameWidth($params)
{
$width = (int)$this->Application->ConfigValue('MenuFrameWidth');
return $width > 0 ? $width : 200;
}
function AdminSkin($params)
{
static $style;
if (!isset($style)) {
$style = $this->Conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'Skins WHERE IsPrimary = 1');
}
$css_path = (defined('WRITEABLE') ? WRITEABLE : FULL_PATH.'/kernel') . '/user_files';
$css_url = $this->Application->BaseURL(defined('WRITEBALE_BASE') ? WRITEBALE_BASE : '/kernel') . 'user_files/';
$type = array_key_exists('type', $params) ? $params['type'] : false;
if ($type == 'logo') {
$type = 'Logo';
}
if ($type == 'Logo' || $type == 'LogoBottom') {
return $style[$type] ? $css_url.$style[$type] : '';
}
$last_compiled = $style['LastCompiled'];
$style_name = mb_strtolower( $style['Name'] );
if( file_exists($css_path.'/'.'admin-'.$style_name.'-'.$last_compiled.'.css') )
{
$ret = $css_url.'admin-'.$style_name.'-'.$last_compiled.'.css';
}
else
{
// search for previously compiled stylesheet
$last_compiled = 0;
if( $dh = opendir($css_path) )
{
while( ($file = readdir($dh)) !== false )
{
if( preg_match('/admin-(.*)-([\d]+).css/', $file, $rets) )
{
if( $rets[1] == $style_name && $rets[2] > $last_compiled ) $last_compiled = $rets[2];
}
}
closedir($dh);
}
if ($last_compiled) {
// found
$ret = $css_url.'admin-'.$style_name.'-'.$last_compiled.'.css';
}
else {
// not found (try to compile on the fly)
$object =& $this->Application->recallObject('skin.-item', null, Array ('skip_autoload' => true));
/* @var $object kDBItem */
$skin_eh =& $this->Application->recallObject('skin_EventHandler');
/* @var $skin_eh SkinEventHandler */
$object->Load(1, 'IsPrimary');
$skin_eh->Compile($object);
$ret = $css_url.'admin-'.$style_name.'-'.adodb_mktime().'.css';
}
}
if (isset($params['file_only'])) return $ret;
return '<link rel="stylesheet" rev="stylesheet" href="'.$ret.'" type="text/css" media="screen" />';
}
function PrintCompileErrors($params)
{
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
$errors = $this->Application->RecallVar('compile_errors');
if (!$errors) {
return ;
}
$ret = '';
$errors = unserialize($errors);
foreach ($errors as $an_error) {
$block_params['file'] = str_replace(FULL_PATH, '', $an_error['file']);
$block_params['line'] = $an_error['line'];
$block_params['message'] = $an_error['msg'];
$ret .= $this->Application->ParseBlock($block_params);
}
$this->Application->RemoveVar('compile_errors');
return $ret;
}
function CompileErrorCount($params)
{
$errors = $this->Application->RecallVar('compile_errors');
if (!$errors) {
return 0;
}
return count( unserialize($errors) );
}
function ExportData($params)
{
$export_helper =& $this->Application->recallObject('CSVHelper');
/* @var $export_helper kCSVHelper */
$result = $export_helper->ExportData( $this->SelectParam($params, 'var,name,field') );
return ($result === false) ? '' : $result;
}
function ImportData($params)
{
$import_helper =& $this->Application->recallObject('CSVHelper');
/* @var $import_helper kCSVHelper */
$result = $import_helper->ImportData( $this->SelectParam($params, 'var,name,field') );
return ($result === false) ? '' : $result;
}
function PrintCSVNotImportedLines($params)
{
$import_helper =& $this->Application->recallObject('CSVHelper');
/* @var $import_helper kCSVHelper */
return $import_helper->GetNotImportedLines();
}
/**
* Returns input field name to
* be placed on form (for correct
* event processing)
*
* @param Array $params
* @return string
* @access public
*/
function InputName($params)
{
list($id, $field) = $this->prepareInputName($params);
$ret = $this->getPrefixSpecial().'[0]['.$field.']'; // 0 always, as has no idfield
if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/');
return $ret;
}
/**
* Returns list of all backup file dates formatted
* in passed block
*
* @param Array $params
* @return string
* @access public
*/
function PrintBackupDates($params)
{
$datearray = $this->getDirList($this->Application->ConfigValue('Backup_Path'));
$ret = '';
foreach($datearray as $key => $value)
{
$params['backuptimestamp'] = $value['filedate'];
$params['backuptime'] = date('F j, Y, g:i a', $value['filedate']);
$params['backupsize'] = round($value['filesize']/1024/1024, 2); // MBytes
$ret .= $this->Application->ParseBlock($params);
}
return $ret;
}
function getDirList ($dirName)
{
$fileinfo = array();
$d = dir($dirName);
while($entry = $d->read())
{
if ($entry != "." && $entry != "..")
{
if (!is_dir($dirName."/".$entry) && eregi("dump",$entry))
{
$fileinfo[]= Array('filedate' => $this->chopchop($entry),
'filesize' => filesize($dirName. '/'. $entry)
);
}
}
}
$d->close();
rsort($fileinfo);
return $fileinfo;
}
function chopchop ($filename)
{
$p = pathinfo($filename);
$ext = '.'.$p["extension"];
$filename;
$filename= ereg_replace("dump","",$filename);
$filename= ereg_replace($ext,"",$filename);
return $filename;
}
function PrintPHPinfo($params)
{
+ $php_info = '';
+
ob_start();
phpinfo();
$php_info .= ob_get_contents();
ob_end_clean();
$php_info = str_replace(" width=\"600\"", " width=\"100%\" align=\"center\"", $php_info);
$php_info = str_replace("</body>", "", $php_info);
$php_info = str_replace("<body>", "", $php_info);
$php_info = str_replace("</html>", "", $php_info);
$php_info = str_replace("<html>", "", $php_info);
$php_info = str_replace("</head>", "", $php_info);
$php_info = str_replace("<head>", "", $php_info);
$offset = strpos($php_info, "<table");
$php_info = substr($php_info, $offset);
$php_info = '<style type="text/css">
body {background-color: #ffffff; color: #000000;}
body, td, th, h1, h2 {font-family: sans-serif;}
pre {margin: 0px; font-family: monospace;}
a:link {color: #000099; text-decoration: none; background-color: #ffffff;}
a:hover {text-decoration: underline;}
table {border-collapse: collapse;}
.center {text-align: center;}
.center table { margin-left: auto; margin-right: auto; text-align: left;}
.center th { text-align: center !important; }
td, th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline;}
h1 {font-size: 150%;}
h2 {font-size: 125%;}
.p {text-align: left;}
.e {background-color: #ccccff; font-weight: bold; color: #000000;}
.h {background-color: #9999cc; font-weight: bold; color: #000000;}
.v {background-color: #cccccc; color: #000000;}
i {color: #666666; background-color: #cccccc;}
hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}
</style>'.$php_info;
return $php_info;
}
function PrintSqlCols($params)
{
$a_data = unserialize($this->Application->GetVar('sql_rows'));
$ret = '';
$block = $params['render_as'];
foreach ($a_data AS $a_row)
{
foreach ($a_row AS $col => $value)
{
$ret .= $this->Application->ParseBlock(Array('name'=>$block, 'value'=>$col));
}
break;
}
return $ret;
}
function PrintSqlRows($params)
{
$a_data = unserialize($this->Application->GetVar('sql_rows'));
$ret = '';
$block = $params['render_as'];
foreach ($a_data AS $a_row)
{
$cells = '';
foreach ($a_row AS $col => $value)
{
$cells .= '<td>'.$value.'</td>';
}
$ret .= $this->Application->ParseBlock(Array('name'=>$block, 'cells'=>$cells));
}
return $ret;
}
/**
* Prints available and enabled import sources using given block
*
* @param Array $params
* @return string
*/
function PrintImportSources($params)
{
$sql = 'SELECT *
FROM ' . TABLE_PREFIX . 'ImportScripts
WHERE (Status = ' . STATUS_ACTIVE . ') AND (Type = "CSV")';
$import_sources = $this->Conn->Query($sql);
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
$ret = '';
foreach ($import_sources as $import_source) {
$block_params['script_id'] = $import_source['ImportId'];
$block_params['script_module'] = $import_source['Module'];
$block_params['script_name'] = $import_source['Name'];
$block_params['script_prefix'] = $import_source['Prefix'];
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/admin/admin_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.43.2.28
\ No newline at end of property
+1.43.2.29
\ No newline at end of property
Index: branches/RC/core/units/relationship/relationship_tp.php
===================================================================
--- branches/RC/core/units/relationship/relationship_tp.php (nonexistent)
+++ branches/RC/core/units/relationship/relationship_tp.php (revision 11538)
@@ -0,0 +1,22 @@
+<?php
+
+ class RelationshipTagProcessor extends kDBTagProcessor {
+
+ /**
+ * If data was modfied & is in TempTables mode, then parse block with name passed;
+ * remove modification mark if not in TempTables mode
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ * @author Alexey
+ */
+ function SaveWarning($params)
+ {
+ if ($this->Prefix == 'c-rel') {
+ return $this->Application->ProcessParsedTag('c', 'SaveWarning', $params);
+ }
+
+ return parent::SaveWarning($params);
+ }
+ }
\ No newline at end of file
Property changes on: branches/RC/core/units/relationship/relationship_tp.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Index: branches/RC/core/units/relationship/relationship_config.php
===================================================================
--- branches/RC/core/units/relationship/relationship_config.php (revision 11537)
+++ branches/RC/core/units/relationship/relationship_config.php (revision 11538)
@@ -1,107 +1,106 @@
<?php
-
+
$config = Array(
'Prefix' => 'rel',
-
+
'Clones' => Array(
'c-rel' => Array('ParentPrefix' => 'c'),
'l-rel' => Array('ParentPrefix' => 'l'),
'n-rel' => Array('ParentPrefix' => 'n'),
'bb-rel'=> Array('ParentPrefix' => 'bb'),
/*'p-rel' => Array('ParentPrefix' => 'p'),*/
- 'cms-rel'=> Array('ParentPrefix' => 'cms'),
+ /*'cms-rel'=> Array('ParentPrefix' => 'cms'),*/
),
-
+
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'RelationshipEventHandler','file'=>'relationship_event_handler.php','build_event'=>'OnBuild'),
- 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'RelationshipTagProcessor','file'=>'relationship_tp.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
- 'Hooks' => Array(
+ 'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => '#PARENT#',
'HookToSpecial' => '*',
'HookToEvent' => Array('OnAfterItemDelete'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnDeleteForeignRelations',
),
),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
),
'IDField' => 'RelationshipId',
'StatusField' => Array('Enabled','Type'),
'TableName' => TABLE_PREFIX.'Relationship',
'ParentTableKey'=> 'ResourceId',
'ForeignKey' => 'SourceId',
'ParentPrefix' => 'p',
'AutoDelete' => true,
'AutoClone' => true,
-
+
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array('show_active','show_disabled'), 'type' => WHERE_FILTER),
Array('mode' => 'AND', 'filters' => Array('show_recip','show_oneway'), 'type' => WHERE_FILTER),
),
'Filters' => Array(
'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Enabled != 1' ),
'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Enabled != 0' ),
's1' => Array(),
'show_recip' => Array('label' => 'la_Reciprocal', 'on_sql' => '', 'off_sql' => '%1$s.Type != 1' ),
'show_oneway' => Array('label' => 'la_OneWay', 'on_sql' => '', 'off_sql' => '%1$s.Type != 2' ),
)
),
-
+
'CalculatedFields' => Array(
'' => Array(
'ItemName' => 'TRIM(CONCAT(#ITEM_NAMES#))',
'ItemType' => '#ITEM_TYPES#',
),
),
-
+
'ListSQLs' => Array( ''=> 'SELECT %1$s.RelationshipId, %1$s.Priority, %1$s.Type, %1$s.Enabled %2$s
FROM %1$s #ITEM_JOIN#',
), // key - special, value - list select sql
-
- 'ListSortings' => Array(
+
+ 'ListSortings' => Array(
'' => Array(
'ForcedSorting' => Array('Priority' => 'desc'),
'Sorting' => Array('ItemName' => 'asc', 'ItemType' => 'asc'),
)
- ),
+ ),
'ItemSQLs' => Array( '' => 'SELECT %1$s.* %2$s FROM %1$s #ITEM_JOIN#',),
-
+
'Fields' => Array(
'RelationshipId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'SourceId' => Array('type'=>'int', 'required' => 1, 'default' => NULL),
'TargetId' => Array('type'=>'int', 'required' => 1, 'default' => NULL),
'SourceType' => Array('type'=>'int','not_null'=>1,'default'=>0),
'TargetType' => Array('type'=>'int','not_null'=>1,'default'=>0),
'Type' => Array('type'=>'int','formatter'=>'kOptionsFormatter', 'required' => 1, 'options'=>Array(1=>'la_Reciprocal',0=>'la_OneWay'),'not_null'=>1,'default'=>0,'use_phrases'=>1),
'Enabled' => Array('type'=>'int','formatter'=>'kOptionsFormatter','options'=>Array(0=>'la_Disabled',1=>'la_Enabled'),'not_null'=>1,'default'=>1,'use_phrases'=>1),
'Priority' => Array('type'=>'int','not_null'=>1,'default'=>0),
),
'VirtualFields' => Array( 'ItemName' => Array(),
'ItemType' => Array(),
),
-
+
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_custom.gif','1_0'=>'icon16_relation_one-way.gif','0_0'=>'icon16_relation_one-way_disabled.gif','1_1'=>'icon16_relation_reciprocal.gif','0_1'=>'icon16_relation_reciprocal_disabled.gif'), // icons for each StatusField values, if no matches or no statusfield selected, then "default" icon is used
'Fields' => Array(
- 'ItemName' => Array( 'title'=>'la_col_TargetId', 'data_block' => 'grid_checkbox_td'),
- 'ItemType' => Array( 'title'=>'la_col_TargetType' ),
- 'Type' => Array( 'title'=>'la_col_RelationshipType' ),
- 'Enabled' => Array( 'title'=>'la_col_Status' ),
+ 'RelationshipId' => Array ('title' => 'la_col_Id', 'filter_block' => 'grid_range_filter'),
+ 'ItemName' => Array( 'title'=>'la_col_TargetId', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_like_filter'),
+ 'ItemType' => Array( 'title'=>'la_col_TargetType', 'filter_block' => 'grid_like_filter'),
+ 'Type' => Array( 'title'=>'la_col_RelationshipType', 'filter_block' => 'grid_options_filter'),
+ 'Enabled' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
),
-
+
),
),
- );
-
-?>
\ No newline at end of file
+ );
\ No newline at end of file
Property changes on: branches/RC/core/units/relationship/relationship_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.7
\ No newline at end of property
+1.7.2.1
\ No newline at end of property
Index: branches/RC/core/units/spelling_dictionary/spelling_dictionary_config.php
===================================================================
--- branches/RC/core/units/spelling_dictionary/spelling_dictionary_config.php (revision 11537)
+++ branches/RC/core/units/spelling_dictionary/spelling_dictionary_config.php (revision 11538)
@@ -1,75 +1,75 @@
<?php
$config = Array (
'Prefix' => 'spelling-dictionary',
'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' => 'SpellingDictionaryId',
'TableName' => TABLE_PREFIX.'SpellingDictionary',
'TitleField' => 'MisspelledWord',
'TitlePresets' => Array (
'default' => Array (
'new_status_labels' => Array ('spelling-dictionary' => '!la_title_AddingSpellingDictionary!'),
'edit_status_labels' => Array ('spelling-dictionary' => '!la_title_EditingSpellingDictionary!'),
),
- 'spelling_dictionary_list' => Array ('prefixes' => Array ('spelling-dictionary_List'), 'format' => "!la_title_SpellingDictionary! (#spelling-dictionary_recordcount#)"),
+ 'spelling_dictionary_list' => Array ('prefixes' => Array ('spelling-dictionary_List'), 'format' => "!la_title_SpellingDictionary!"),
'spelling_dictionary_edit' => Array ('prefixes' => Array ('spelling-dictionary'), 'format' => "#spelling-dictionary_status# '#spelling-dictionary_titlefield#'"),
),
'PermSection' => Array('main' => 'in-portal:spelling_dictionary'),
'Sections' => Array (
'in-portal:spelling_dictionary' => Array (
'parent' => 'in-portal:system',
'icon' => 'spelling_dictionary',
'label' => 'la_title_SpellingDictionary',
'url' => Array('t' => 'spelling_dictionary/spelling_dictionary_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 3.2,
'type' => stTREE,
),
),
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s FROM %1$s',
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('MisspelledWord' => 'asc'),
)
),
'Fields' => Array (
'SpellingDictionaryId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'MisspelledWord' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'required' => 1, 'default' => ''),
'SuggestedCorrection' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'required' => 1, 'default' => ''),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array ('default' => 'icon16_spelling_dictionary.gif'),
'Fields' => Array (
'SpellingDictionaryId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ),
'MisspelledWord' => Array ('title' => 'la_col_MisspelledWord', 'filter_block' => 'grid_like_filter',),
'SuggestedCorrection' => Array ('title' => 'la_col_SuggestedCorrection', 'filter_block' => 'grid_like_filter',),
),
),
),
);
\ No newline at end of file
Property changes on: branches/RC/core/units/spelling_dictionary/spelling_dictionary_config.php
___________________________________________________________________
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/units/phrases/phrases_event_handler.php
===================================================================
--- branches/RC/core/units/phrases/phrases_event_handler.php (revision 11537)
+++ branches/RC/core/units/phrases/phrases_event_handler.php (revision 11538)
@@ -1,126 +1,133 @@
<?php
class PhrasesEventHandler extends kDBEventHandler
{
/**
+ * 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)
+ {
+ // don't call parent
+ }
+
+ /**
* Allow to create phrases from front end in debug mode with DBG_PHRASES constant set
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if (!$this->Application->IsAdmin() && $this->Application->isDebugMode() && constOn('DBG_PHRASES')) {
if ($event->Name == 'OnNew' || $event->Name == 'OnCreate' || $event->Name == 'OnPrepareUpdate' || $event->Name == 'OnUpdate') {
return true;
}
}
return parent::CheckPermission($event);
}
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array (
'OnItemBuild' => Array('self' => true, 'subitem' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Forces new label in case if issued from get link
*
* @param kEvent $event
*/
function OnNew(&$event)
{
parent::OnNew($event);
$label = $this->Application->GetVar('phrases_label');
$object =& $event->getObject( $label ? Array('live_table'=>true, 'skip_autoload' => true) : Array('skip_autoload' => true) );
if ($label) {
$object->SetDBField('Phrase',$label);
// phrase is created in language, used to display phrases
$object->SetDBField('LanguageId', $this->Application->Phrases->LanguageId);
$object->SetDBField('PhraseType',1);
$primary_language = $this->Application->GetDefaultLanguageId();
$live_table = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'SELECT Translation FROM %s WHERE Phrase = %s';
$primary_value = $this->Conn->GetOne( sprintf($sql, $live_table, $this->Conn->qstr($label) ) );
$object->SetDBField('PrimaryTranslation', $primary_value);
}
$last_module = $this->Application->GetVar('last_module');
if($last_module) $object->SetDBField('Module', $last_module);
if($event->Special == 'export' || $event->Special == 'import')
{
$object->SetDBField('PhraseType', '|0|1|2|');
$modules = $this->Conn->GetCol('SELECT Name FROM '.TABLE_PREFIX.'Modules');
$object->SetDBField('Module', '|'.implode('|', $modules).'|' );
}
}
function OnPrepareUpdate(&$event)
{
$language_id = $this->Application->GetVar('m_lang');
$label = $this->Application->GetVar('phrases_label');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$label_idfield = $this->Application->getUnitOption($event->Prefix, 'IDField');
$sql = 'SELECT '.$label_idfield.' FROM '.$table_name.' WHERE Phrase = '.$this->Conn->qstr($label).' AND LanguageId = '.$language_id;
$this->Application->SetVar($event->getPrefixSpecial() . '_id', $this->Conn->GetOne($sql));
// $event->redirect = false;
}
- function OnUpdate(&$event)
- {
- parent::OnUpdate($event);
-
-// $event->redirect =
- }
-
/**
* Forces create to use live table
*
* @param kEvent $event
*/
function OnBeforePhraseCreate(&$event)
{
$edit_direct = $this->Application->GetVar($event->Prefix.'_label');
if ($edit_direct) {
$object =& $event->getObject( Array('skip_autoload' => true) );
if ($this->Application->GetVar('m_lang') != $this->Application->GetVar('lang_id')) {
$object->SwitchToLive();
}
}
}
/**
* Save phrase change date & ip translation was made from
*
* @param kEvent $event
*/
function OnSetLastUpdated(&$event)
{
$object =& $event->getObject();
$prev_translation = $this->Conn->GetOne('SELECT Translation FROM '.$object->TableName.' WHERE '.$object->IDField.' = '.(int)$object->GetId() );
if( $prev_translation != $object->GetDBField('Translation') )
{
$ip_address = getenv('HTTP_X_FORWARDED_FOR') ? getenv('HTTP_X_FORWARDED_FOR') : getenv('REMOTE_ADDR');
$object->SetDBField('LastChanged_date', adodb_mktime() );
$object->SetDBField('LastChanged_time', adodb_mktime() );
$object->SetDBField('LastChangeIP', $ip_address);
}
$this->Application->Session->SetCookie('last_module', $object->GetDBField('Module'));
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/phrases/phrases_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.14.2.2
\ No newline at end of property
+1.14.2.3
\ No newline at end of property
Index: branches/RC/core/units/languages/import_xml.php
===================================================================
--- branches/RC/core/units/languages/import_xml.php (revision 11537)
+++ branches/RC/core/units/languages/import_xml.php (revision 11538)
@@ -1,506 +1,518 @@
<?php
define('LANG_OVERWRITE_EXISTING', 1);
define('LANG_SKIP_EXISTING', 2);
class LangXML_Parser extends kBase {
/**
* Path to current node beeing processed
*
* @var Array
*/
var $path = Array();
/**
* Connection to database
*
* @var kDBConnection
*/
var $Conn = null;
/**
* Fields of language currently beeing processed
*
* @var Array
*/
var $current_language = Array();
/**
* Fields of phrase currently beeing processed
*
* @var Array
*/
var $current_phrase = Array();
/**
* Fields of event currently beeing processed
*
* @var Array
*/
var $current_event = Array();
/**
* Event type + name mapping to id (from system)
*
* @var Array
*/
var $events_hash = Array();
/**
* Phrase types allowed for import/export operations
*
* @var Array
*/
var $phrase_types_allowed = Array();
/**
* Modules allowed for export (import in development)
*
* @var Array
*/
var $modules_allowed = Array();
/**
* Current Language in import
*
* @var LanguagesItem
*/
var $lang_object = null;
var $tables = Array();
var $ip_address = '';
var $import_mode = LANG_SKIP_EXISTING;
var $Encoding = 'base64';
/**
* Language IDs, that were imported
*
* @var Array
*/
var $_languages = Array ();
function LangXML_Parser($temp_mode = true)
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
$this->lang_object =& $this->Application->recallObject('lang.import', null, Array ('skip_autoload' => true));
$this->_updateEventsCache();
$this->ip_address = getenv('HTTP_X_FORWARDED_FOR') ? getenv('HTTP_X_FORWARDED_FOR') : getenv('REMOTE_ADDR');
}
function _updateEventsCache()
{
$sql = 'SELECT EventId, CONCAT(Event,"_",Type) AS EventMix
FROM ' . TABLE_PREFIX . 'Events';
$this->events_hash = $this->Conn->GetCol($sql, 'EventMix');
}
function SetEncoding($enc)
{
$this->Encoding = $enc;
}
function _initImportTables($drop_only = false)
{
$this->tables['phrases'] = $this->prepareTempTable('phrases', $drop_only);
$this->tables['emailmessages'] = $this->prepareTempTable('emailmessages', $drop_only);
}
/**
* Create temp table for prefix, if table already exists, then delete it and create again
*
* @param string $prefix
*/
function prepareTempTable($prefix, $drop_only = false)
{
$idfield = $this->Application->getUnitOption($prefix, 'IDField');
$table = $this->Application->getUnitOption($prefix,'TableName');
$temp_table = $this->Application->GetTempName($table);
$sql = 'DROP TABLE IF EXISTS %s';
$this->Conn->Query( sprintf($sql, $temp_table) );
if (!$drop_only) {
$sql = 'CREATE TABLE %s SELECT * FROM %s WHERE 0';
$this->Conn->Query( sprintf($sql, $temp_table, $table) );
$sql = 'ALTER TABLE %1$s CHANGE %2$s %2$s INT(11) NOT NULL';
$this->Conn->Query( sprintf($sql, $temp_table, $idfield) );
}
return $temp_table;
}
function Parse($filename, $phrase_types, $module_ids, $import_mode = LANG_SKIP_EXISTING)
{
// define the XML parsing routines/functions to call based on the handler path
if( !file_exists($filename) || !$phrase_types /*|| !$module_ids*/ ) return false;
if (defined('IS_INSTALL') && IS_INSTALL) {
// new events could be added during module upgrade
$this->_updateEventsCache();
}
$this->_initImportTables();
$phrase_types = explode('|', substr($phrase_types, 1, -1) );
// $module_ids = explode('|', substr($module_ids, 1, -1) );
$this->phrase_types_allowed = array_flip($phrase_types);
$this->import_mode = $import_mode;
$xml_parser = xml_parser_create();
xml_set_element_handler( $xml_parser, Array(&$this, 'startElement'), Array(&$this, 'endElement') );
xml_set_character_data_handler( $xml_parser, Array(&$this, 'characterData') );
$fdata = file_get_contents($filename);
$ret = xml_parse($xml_parser, $fdata);
xml_parser_free($xml_parser); // clean up the parser object
// copy data from temp tables to live
foreach ($this->_languages as $language_id) {
$this->_performUpgrade($language_id, 'phrases', 'Phrase');
$this->_performUpgrade($language_id, 'emailmessages', 'EventId');
}
$this->_initImportTables(true);
return $ret;
}
/**
* Performs upgrade of given language pack part
*
* @param int $language_id
* @param string $prefix
* @param string $unique_field
*/
function _performUpgrade($language_id, $prefix, $unique_field)
{
$live_records = $this->_getTableData($language_id, $prefix, $unique_field, false);
$temp_records = $this->_getTableData($language_id, $prefix, $unique_field, true);
if ($this->import_mode == LANG_OVERWRITE_EXISTING) {
// remove existing records before copy
$common_records = array_intersect($temp_records, $live_records);
if ($common_records) {
$live_records = array_diff($live_records, $common_records); // remove overlaping records
$common_records = array_map(Array(&$this->Conn, 'qstr'), $common_records);
$sql = 'DELETE FROM ' . $this->Application->getUnitOption($prefix, 'TableName') . '
WHERE (LanguageId = ' . $language_id . ') AND (' . $unique_field . ' IN (' . implode(',', $common_records) . '))';
$this->Conn->Query($sql);
}
}
$temp_records = array_diff($temp_records, $live_records);
if (!$temp_records) {
// no new records found in temp table while comparing it to live table
return ;
}
$temp_records = array_map(Array(&$this->Conn, 'qstr'), $temp_records);
$sql = 'INSERT INTO ' . $this->Application->getUnitOption($prefix, 'TableName') . '
SELECT *
FROM ' . $this->tables[$prefix] . '
WHERE (LanguageId = ' . $language_id . ')';
if ($live_records) {
// subsctract live records from temp table during coping
$sql .= ' AND (' . $unique_field . ' IN (' . implode(',', $temp_records) . '))';
}
$this->Conn->Query($sql);
}
function _getTableData($language_id, $prefix, $unique_field, $temp_mode = false)
{
$table_name = $this->Application->getUnitOption($prefix, 'TableName');
if ($temp_mode) {
$table_name = $this->Application->GetTempName($table_name, 'prefix:' . $prefix);
}
$sql = 'SELECT ' . $unique_field . '
FROM ' . $table_name . '
WHERE LanguageId = ' . $language_id;
return $this->Conn->GetCol($sql);
}
function startElement(&$parser, $element, $attributes)
{
array_push($this->path, $element);
$path = implode(' ',$this->path);
//check what path we are in
$this->LastLine = xml_get_current_line_number($parser);
$this->SecondData = false;
switch ($path) {
case 'LANGUAGES LANGUAGE':
$this->current_language = Array (
'PackName' => $attributes['PACKNAME'],
'LocalName' => $attributes['PACKNAME'],
'Encoding' => $attributes['ENCODING'],
);
$sql = 'SELECT ' . $this->lang_object->IDField . '
FROM ' . $this->lang_object->TableName . '
WHERE PackName = ' . $this->Conn->qstr( $this->current_language['PackName'] );
$language_id = $this->Conn->GetOne($sql);
if ($language_id) {
$this->current_language['LanguageId'] = $language_id;
$this->lang_object->Load($language_id);
}
break;
case 'LANGUAGES LANGUAGE PHRASES':
case 'LANGUAGES LANGUAGE EVENTS':
if( !getArrayValue($this->current_language,'Charset') ) $this->current_language['Charset'] = 'iso-8859-1';
$this->lang_object->SetFieldsFromHash($this->current_language);
if ( !getArrayValue($this->current_language, 'LanguageId') ) {
$this->lang_object->SetDBField('Enabled', STATUS_ACTIVE);
if ($this->lang_object->Create()) {
$this->current_language['LanguageId'] = $this->lang_object->GetID();
if (defined('IS_INSTALL') && IS_INSTALL) {
// language created during install becomes admin interface language
$this->lang_object->setPrimary(true, true);
}
}
}
elseif ($this->import_mode == LANG_OVERWRITE_EXISTING) {
// update live language record based on data from xml
$this->lang_object->Update();
}
$language_id = $this->lang_object->GetID();
if (!in_array($language_id, $this->_languages)) {
$this->_languages[] = $language_id;
}
break;
case 'LANGUAGES LANGUAGE PHRASES PHRASE':
$phrase_module = getArrayValue($attributes,'MODULE');
if(!$phrase_module) $phrase_module = 'In-Portal';
$this->current_phrase = Array( 'LanguageId' => $this->current_language['LanguageId'],
'Phrase' => $attributes['LABEL'],
'PhraseType' => $attributes['TYPE'],
'PhraseId' => 0,
'Module' => $phrase_module,
'LastChanged' => adodb_mktime(),
'LastChangeIP' => $this->ip_address,
'Translation' => '');
break;
case 'LANGUAGES LANGUAGE EVENTS EVENT':
$this->current_event = Array( 'EmailMessageId'=> 0,
'LanguageId' => $this->current_language['LanguageId'],
- 'EventId' => $this->events_hash[ $attributes['EVENT'].'_'.$attributes['TYPE'] ],
+ 'EventId' => $this->_getEventId($attributes['EVENT'], $attributes['TYPE']),
'MessageType' => $attributes['MESSAGETYPE'],
'Template' => '');
break;
}
// if($path == 'SHIPMENT PACKAGE')
}
+ function _getEventId($event_name, $event_type)
+ {
+ $cache_key = $event_name . '_' . $event_type;
+
+ return array_key_exists($cache_key, $this->events_hash) ? $this->events_hash[$cache_key] : 0;
+ }
+
function characterData(&$parser, $line)
{
$line = trim($line);
if(!$line) return ;
$path = join (' ',$this->path);
$language_nodes = Array('DATEFORMAT','TIMEFORMAT','INPUTDATEFORMAT','INPUTTIMEFORMAT','DECIMAL','THOUSANDS','CHARSET','UNITSYSTEM');
$node_field_map = Array('LANGUAGES LANGUAGE DATEFORMAT' => 'DateFormat',
'LANGUAGES LANGUAGE TIMEFORMAT' => 'TimeFormat',
'LANGUAGES LANGUAGE INPUTDATEFORMAT'=> 'InputDateFormat',
'LANGUAGES LANGUAGE INPUTTIMEFORMAT'=> 'InputTimeFormat',
'LANGUAGES LANGUAGE DECIMAL' => 'DecimalPoint',
'LANGUAGES LANGUAGE THOUSANDS' => 'ThousandSep',
'LANGUAGES LANGUAGE CHARSET' => 'Charset',
'LANGUAGES LANGUAGE UNITSYSTEM' => 'UnitSystem');
if( in_array( end($this->path), $language_nodes) )
{
$this->current_language[ $node_field_map[$path] ] = $line;
}
else
{
switch($path)
{
case 'LANGUAGES LANGUAGE PHRASES PHRASE':
if( isset($this->phrase_types_allowed[ $this->current_phrase['PhraseType'] ]) )
{
$this->current_phrase['Translation'] .= $line;
}
break;
case 'LANGUAGES LANGUAGE EVENTS EVENT':
$cur_line = xml_get_current_line_number($parser);
if ($cur_line != $this->LastLine) {
$this->current_event['Template'] .= str_repeat("\r\n", ($cur_line - $this->LastLine) );
$this->LastLine = $cur_line;
}
$this->current_event['Template'] .= $line;
$this->SecondData = true;
break;
}
}
}
function endElement(&$parser, $element)
{
$path = implode(' ',$this->path);
switch($path)
{
case 'LANGUAGES LANGUAGE PHRASES PHRASE':
if( isset($this->phrase_types_allowed[ $this->current_phrase['PhraseType'] ]) )
{
if ($this->current_language['Encoding'] == 'plain') {
// nothing to decode!
}
else {
$this->current_phrase['Translation'] = base64_decode($this->current_phrase['Translation']);
}
$this->Conn->doInsert($this->current_phrase, $this->tables['phrases']);
}
break;
case 'LANGUAGES LANGUAGE EVENTS EVENT':
+ if (!$this->current_event['EventId']) {
+ // language pack contains event translation, that's name is not found in Events table
+ continue;
+ }
+
if ($this->current_language['Encoding'] == 'plain') {
$this->current_event['Template'] = rtrim($this->current_event['Template']);
// nothing to decode!
}
else {
$this->current_event['Template'] = base64_decode($this->current_event['Template']);
}
$this->Conn->doInsert($this->current_event, $this->tables['emailmessages']);
break;
}
array_pop($this->path);
}
/**
* Creates XML file with exported language data
*
* @param string $filename filename to export into
* @param Array $phrase_types phrases types to export from modules passed in $module_ids
* @param Array $language_ids IDs of languages to export
* @param Array $module_ids IDs of modules to export phrases from
*/
function Create($filename, $phrase_types, $language_ids, $module_ids)
{
$fp = fopen($filename,'w');
if(!$fp || !$phrase_types || !$module_ids || !$language_ids) return false;
$phrase_types = explode('|', substr($phrase_types, 1, -1) );
$module_ids = explode('|', substr($module_ids, 1, -1) );
$this->events_hash = array_flip($this->events_hash);
$lang_table = $this->Application->getUnitOption('lang','TableName');
$phrases_table = $this->Application->getUnitOption('phrases','TableName');
$emailevents_table = $this->Application->getUnitOption('emailmessages','TableName');
$mainevents_table = $this->Application->getUnitOption('emailevents','TableName');
$phrase_tpl = "\t\t\t".'<PHRASE Label="%s" Module="%s" Type="%s">%s</PHRASE>'."\n";
$event_tpl = "\t\t\t".'<EVENT MessageType="%s" Event="%s" Type="%s">%s</EVENT>'."\n";
$sql = 'SELECT * FROM %s WHERE LanguageId = %s';
$ret = '<LANGUAGES>'."\n";
foreach($language_ids as $language_id)
{
// languages
$row = $this->Conn->GetRow( sprintf($sql, $lang_table, $language_id) );
$ret .= "\t".'<LANGUAGE PackName="'.$row['PackName'].'" Encoding="'.$this->Encoding.'"><DATEFORMAT>'.$row['DateFormat'].'</DATEFORMAT>';
$ret .= '<TIMEFORMAT>'.$row['TimeFormat'].'</TIMEFORMAT><INPUTDATEFORMAT>'.$row['InputDateFormat'].'</INPUTDATEFORMAT>';
$ret .= '<INPUTTIMEFORMAT>'.$row['InputTimeFormat'].'</INPUTTIMEFORMAT><DECIMAL>'.$row['DecimalPoint'].'</DECIMAL>';
$ret .= '<THOUSANDS>'.$row['ThousandSep'].'</THOUSANDS><CHARSET>'.$row['Charset'].'</CHARSET>';
$ret .= '<UNITSYSTEM>'.$row['UnitSystem'].'</UNITSYSTEM>'."\n";
// phrases
$phrases_sql = 'SELECT * FROM '.$phrases_table.' WHERE LanguageId = %s AND PhraseType IN (%s) AND Module IN (%s) ORDER BY Phrase';
if( in_array('In-Portal',$module_ids) ) array_push($module_ids, ''); // for old language packs
$rows = $this->Conn->Query( sprintf($phrases_sql,$language_id, implode(',',$phrase_types), '\''.implode('\',\'',$module_ids).'\'' ) );
if($rows)
{
$ret .= "\t\t".'<PHRASES>'."\n";
foreach($rows as $row)
{
$data = $this->Encoding == 'base64' ? base64_encode($row['Translation']) : '<![CDATA['.$row['Translation'].']]>';
$ret .= sprintf($phrase_tpl, $row['Phrase'], $row['Module'], $row['PhraseType'], $data );
}
$ret .= "\t\t".'</PHRASES>'."\n";
}
// email events
if( in_array('In-Portal',$module_ids) ) unset( $module_ids[array_search('',$module_ids)] ); // for old language packs
$module_sql = preg_replace('/(.*) OR $/', '\\1', preg_replace('/(.*),/U', 'INSTR(Module,\'\\1\') OR ', implode(',', $module_ids).',' ) );
$sql = 'SELECT EventId FROM '.$mainevents_table.' WHERE '.$module_sql;
$event_ids = $this->Conn->GetCol($sql);
if($event_ids)
{
$ret .= "\t\t".'<EVENTS>'."\n";
$event_sql = ' SELECT em.*
FROM '.$emailevents_table.' em
LEFT JOIN '.$mainevents_table.' e ON e.EventId = em.EventId
WHERE em.LanguageId = %s AND em.EventId IN (%s)
ORDER BY e.Event, e.Type';
$rows = $this->Conn->Query( sprintf($event_sql,$language_id, $event_ids ? implode(',',$event_ids) : '' ) );
foreach($rows as $row)
{
list($event_name, $event_type) = explode('_', $this->events_hash[ $row['EventId'] ] );
$data = $this->Encoding == 'base64' ? base64_encode($row['Template']) : '<![CDATA['.$row['Template'].']]>';
$ret .= sprintf($event_tpl, $row['MessageType'], $event_name, $event_type, $data );
}
$ret .= "\t\t".'</EVENTS>'."\n";
}
$ret .= "\t".'</LANGUAGE>'."\n";
}
$ret .= '</LANGUAGES>';
fwrite($fp, $ret);
fclose($fp);
return true;
}
/**
* Creates new instance of LangXML_Parser class
*
* @param int $type
* @return LangXML_Parser
*/
function &makeClass($temp_mode = true)
{
$result = new LangXML_Parser($temp_mode);
return $result;
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/languages/import_xml.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.26.2.3
\ No newline at end of property
+1.26.2.4
\ No newline at end of property
Index: branches/RC/core/units/languages/languages_config.php
===================================================================
--- branches/RC/core/units/languages/languages_config.php (revision 11537)
+++ branches/RC/core/units/languages/languages_config.php (revision 11538)
@@ -1,190 +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_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#)"),
+ '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('phrases.export'), 'format' => "!la_title_ExportLanguagePackResults!"),
+ '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#)"),
'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.7
\ No newline at end of property
+1.27.2.8
\ No newline at end of property
Index: branches/RC/core/units/languages/languages_event_handler.php
===================================================================
--- branches/RC/core/units/languages/languages_event_handler.php (revision 11537)
+++ branches/RC/core/units/languages/languages_event_handler.php (revision 11538)
@@ -1,482 +1,357 @@
<?php
class LanguagesEventHandler extends kDBEventHandler
{
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnChangeLanguage' => Array('self' => true),
'OnSetPrimary' => Array('self' => 'advanced:set_primary|add|edit'),
'OnImportLanguage' => Array('self' => 'advanced:import'),
- 'OnImportProgress' => Array('self' => 'advanced:import'),
'OnExportLanguage' => Array('self' => 'advanced:export'),
'OnExportProgress' => Array('self' => 'advanced:export'),
'OnReflectMultiLingualFields' => Array ('self' => 'view'),
'OnItemBuild' => Array('self' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* [HOOK] Updates table structure on new language adding/removing language
*
* @param kEvent $event
*/
function OnReflectMultiLingualFields(&$event)
{
if ($this->Application->GetVar('ajax') == 'yes') {
$event->status = erSTOP;
}
+ if (is_object($event->MasterEvent) && $event->MasterEvent->status != erSUCCESS) {
+ return ;
+ }
+
$ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
/* @var $ml_helper kMultiLanguageHelper */
$this->Application->UnitConfigReader->ReReadConfigs();
foreach ($this->Application->UnitConfigReader->configData as $prefix => $config_data) {
$ml_helper->createFields($prefix);
}
}
/**
* Allows to set selected language as primary
*
* @param kEvent $event
*/
function OnSetPrimary(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$this->StoreSelectedIDs($event);
$ids = $this->getSelectedIDs($event);
if ($ids) {
$id = array_shift($ids);
$object =& $event->getObject( Array('skip_autoload' => true) );
/* @var $object LanguagesItem */
$object->Load($id);
$object->setPrimary();
}
}
/**
* [HOOK] Reset primary status of other languages if we are saving primary language
*
* @param kEvent $event
*/
function OnUpdatePrimary(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
/* @var $object LanguagesItem */
$object->SwitchToLive();
// set primary for each languages, that have this checkbox checked
$ids = explode(',', $event->MasterEvent->getEventParam('ids'));
foreach ($ids as $id) {
$object->Load($id);
if ($object->GetDBField('PrimaryLang')) {
$object->setPrimary(true, false);
}
if ($object->GetDBField('AdminInterfaceLang')) {
$object->setPrimary(true, true);
}
}
// if no primary language left, then set primary last language (not to load again) from edited list
$sql = 'SELECT '.$object->IDField.'
FROM '.$object->TableName.'
WHERE PrimaryLang = 1';
$primary_language = $this->Conn->GetOne($sql);
if (!$primary_language) {
$object->setPrimary(false, false); // set primary language
}
$sql = 'SELECT '.$object->IDField.'
FROM '.$object->TableName.'
WHERE AdminInterfaceLang = 1';
$primary_language = $this->Conn->GetOne($sql);
if (!$primary_language) {
$object->setPrimary(false, true); // set admin interface language
}
}
/**
* Occurse before updating item
*
* @param kEvent $event
* @access public
*/
function OnBeforeItemUpdate(&$event)
{
$object =& $event->getObject();
$status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') );
if ($object->GetDBField('PrimaryLang') == 1 && $object->GetDBField($status_field) == 0) {
$object->SetDBField($status_field, 1);
}
}
/**
* Shows only enabled languages on front
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
if ($event->Special == 'enabled') {
$object =& $event->getObject();
/* @var $object kDBList */
$object->addFilter('enabled_filter', '%1$s.Enabled = 1');
}
}
/**
* Copy labels from another language
*
* @param kEvent $event
*/
function OnCopyLabels(&$event)
{
$object =& $event->getObject();
$from_lang_id = $object->GetDBField('CopyFromLanguage');
if( ($event->MasterEvent->status == erSUCCESS) && $object->GetDBField('CopyLabels') == 1 && ($from_lang_id > 0) )
{
$lang_id = $object->GetID();
// 1. phrases import
$phrases_live = $this->Application->getUnitOption('phrases','TableName');
$phrases_temp = $this->Application->GetTempName($phrases_live, 'prefix:phrases');
$sql = 'INSERT INTO '.$phrases_temp.'
SELECT Phrase, Translation, PhraseType, 0-PhraseId, '.$lang_id.', '.adodb_mktime().', "", Module
FROM '.$phrases_live.'
WHERE LanguageId='.$from_lang_id;
$this->Conn->Query($sql);
// 2. events import
$em_table_live = $this->Application->getUnitOption('emailmessages','TableName');
$em_table_temp = $this->Application->GetTempName($em_table_live, 'prefix:emailmessages');
$sql = 'SELECT * FROM '.$em_table_live.' WHERE LanguageId = '.$from_lang_id;
$email_messages = $this->Conn->Query($sql);
if($email_messages)
{
$id = $this->Conn->GetOne('SELECT MIN(EmailMessageId) FROM '.$em_table_live);
if($id > 0) $id = 0;
$id--;
$sqls = Array();
foreach($email_messages as $email_message)
{
$sqls[] = $id.','.$this->Conn->qstr($email_message['Template']).','.$this->Conn->qstr($email_message['MessageType']).','.$lang_id.','.$email_message['EventId'];
$id--;
}
$sql = 'INSERT INTO '.$em_table_temp.'(EmailMessageId,Template,MessageType,LanguageId,EventId) VALUES ('.implode('),(',$sqls).')';
$this->Conn->Query($sql);
}
$object->SetDBField('CopyLabels', 0);
}
}
/**
* Prepare temp tables for creating new item
* but does not create it. Actual create is
* done in OnPreSaveCreated
*
* @param kEvent $event
*/
function OnPreCreate(&$event)
{
parent::OnPreCreate($event);
$object =& $event->getObject();
$object->SetDBField('CopyLabels', 1);
$live_table = $this->Application->getUnitOption($event->Prefix, 'TableName');
$primary_lang_id = $this->Conn->GetOne('SELECT '.$object->IDField.' FROM '.$live_table.' WHERE PrimaryLang = 1');
$object->SetDBField('CopyFromLanguage', $primary_lang_id);
}
function OnChangeLanguage(&$event)
{
$this->Application->SetVar('m_lang', $this->Application->GetVar('language'));
//$this->Application->LinkVar('language', 'm_lang');
}
/**
* Parse language XML file into temp tables and redirect to progress bar screen
*
* @param kEvent $event
*/
function OnImportLanguage(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$items_info = $this->Application->GetVar('phrases_import');
if ($items_info) {
list ($id, $field_values) = each($items_info);
$object =& $this->Application->recallObject('phrases.import', 'phrases', Array('skip_autoload' => true) );
$object->SetFieldsFromHash($field_values);
$filename = getArrayValue($field_values, 'LangFile', 'tmp_name');
if ( filesize($filename) ) {
$lang_xml =& $this->Application->recallObject('LangXML');
/* @var $lang_xml LangXML_Parser */
$modules = getArrayValue($field_values, 'Module');
$lang_xml->Parse($filename, $field_values['PhraseType'], $modules, $field_values['ImportOverwrite'] ? LANG_OVERWRITE_EXISTING : LANG_SKIP_EXISTING);
- $event->redirect = $this->Application->GetVar('next_template');
+ $event->SetRedirectParam('opener', 'u');
}
else {
$object =& $this->Application->recallObject('phrases.import');
$object->SetError('LangFile', 'la_empty_file', 'la_EmptyFile');
$event->status = erFAIL;
}
}
}
/**
- * Copies imported from xml file from temp table to live table
- *
- * @param kEvent $event
- */
- function OnImportProgress(&$event)
- {
- define('IMPORT_BY', 300); // import this much records per step
- $template_name = 'regional/languages_import_step2';
-
- $import_mode = (int)$this->Application->GetVar('mode'); // 1 - overwrite existing phrases, 0 - don't overwrite existing phrases
- $import_source = (int)$this->Application->GetVar('source');
- $import_steps = Array(0 => 'lang', 1 => 'phrases', 2 => 'emailmessages', 3 => 'finish');
-
- $key_fields = Array(0 => 'PackName', 1 => 'Phrase', 2 => 'EventId'); // by what field should we search record match
-
- $import_titles = Array(0 => 'la_ImportingLanguages', 1 => 'la_ImportingPhrases', 2 => 'la_ImportingEmailEvents', 3 => 'la_Done');
-
- // --- BEFORE ---
- $import_prefix = $import_steps[$import_source];
- $import_start = (int)$this->Application->GetVar('start');
- $id_field = $this->Application->getUnitOption($import_prefix,'IDField');
- $dst_table = $this->Application->getUnitOption($import_prefix,'TableName');
- $src_table = $this->Application->GetTempName($dst_table);
-
- $import_total = $this->Application->GetVar('total');
- if(!$import_total) $import_total = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$src_table);
- // --- AFTER ---
-
- if($import_start == $import_total)
- {
- $import_source++;
- $import_prefix = $import_steps[$import_source];
- if($import_prefix == 'finish')
- {
- $event->SetRedirectParam('opener','u');
- return true;
- }
-
- $import_start = 0;
- $id_field = $this->Application->getUnitOption($import_prefix,'IDField');
- $dst_table = $this->Application->getUnitOption($import_prefix,'TableName');
- $src_table = $this->Application->GetTempName($dst_table);
- $import_total = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$src_table);
- }
-
- if($import_total > 0)
- {
- $done_percent = ($import_start * 100) / $import_total;
- }
- else
- {
- $done_percent = 100;
- }
-
- $block_params = Array( 'name' => $template_name,
- 'title' => $import_titles[$import_source],
- 'percent_done' => $done_percent,
- 'percent_left' => 100 - $done_percent);
-
- $this->Application->InitParser();
- $this->Application->setUnitOption('phrases','AutoLoad',false);
- echo $this->Application->ParseBlock($block_params);
-
- //break out of buffering
- $buffer_content = Array();
- while (ob_get_level()) {
- $buffer_content[] = ob_get_clean();
- }
- $ret = implode('', array_reverse($buffer_content));
- echo $ret;
- flush();
-
-
- $sql = 'SELECT * FROM %s LIMIT %s,%s';
- $rows = $this->Conn->Query( sprintf($sql,$src_table,$import_start,IMPORT_BY) );
-
- $values_sql = '';
-
- // if found and mode = 1 (overwrite)
- $search_sql = 'SELECT '.$id_field.' FROM '.$dst_table.' WHERE '.$key_fields[$import_source].' = %s AND LanguageId = %s';
- $update_sql = 'UPDATE '.$dst_table.' SET %s WHERE '.$id_field.' = %s';
-
- foreach($rows as $row)
- {
- $tmp_sql = sprintf($search_sql, $this->Conn->qstr($row[ $key_fields[$import_source] ]), $row['LanguageId'] );
- $tmp_id = $this->Conn->GetOne($tmp_sql);
- if($tmp_id > 0 && $import_mode == 1)
- {
- // update
- $update_fields = '';
- foreach($row as $field_name => $field_value)
- {
- if($field_name == $id_field) continue;
- $update_fields .= '`'.$field_name.'` = '.$this->Conn->qstr($field_value).',';
- }
- $update_fields = preg_replace('/(.*),$/', '\\1', $update_fields);
- $this->Conn->Query( sprintf($update_sql, $update_fields, $tmp_id) );
- }
- elseif(!$tmp_id)
- {
- $values_sql .= '(';
- foreach($row as $field_value)
- {
- $values_sql .= $this->Conn->qstr($field_value).',';
- }
- $values_sql = preg_replace('/(.*),$/', '\\1', $values_sql).'),';
- }
- }
-
- if($values_sql)
- {
- $fields_sql = '';
- $fields = array_keys( $this->Application->getUnitOption($import_prefix,'Fields') );
- foreach($fields as $field_name)
- {
- $fields_sql .= '`'.$field_name.'`,';
- }
- $fields_sql = preg_replace('/(.*),$/', '\\1', $fields_sql);
-
- $values_sql = preg_replace('/(.*),$/', '\\1', $values_sql);
- $sql = sprintf('INSERT INTO %s (%s) VALUES %s', $dst_table, $fields_sql, $values_sql);
- $this->Conn->Query($sql);
- }
- $event->setRedirectParams( Array('lang_event' => 'OnImportProgress', 'pass' => 'all,lang', 'start' => $import_start += count($rows), 'total' => $import_total, 'source' => $import_source, 'mode' => $import_mode) );
- }
-
- /**
* Stores ids of selected languages and redirects to export language step 1
*
* @param kEvent $event
*/
function OnExportLanguage(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$this->Application->setUnitOption('phrases','AutoLoad',false);
$this->StoreSelectedIDs($event);
$this->Application->StoreVar('export_language_ids', implode(',', $this->getSelectedIDs($event)) );
- $event->setRedirectParams( Array('m_opener'=>'d','phrases.export_event'=>'OnNew','pass'=>'all,phrases.export') );
- $event->redirect = 'regional/languages_export';
+ $event->setRedirectParams( Array('phrases.export_event' => 'OnNew', 'pass' => 'all,phrases.export') );
}
/**
* Saves selected languages to xml file passed
*
* @param kEvent $event
*/
function OnExportProgress(&$event)
{
$items_info = $this->Application->GetVar('phrases_export');
if($items_info)
{
list($id,$field_values) = each($items_info);
$object =& $this->Application->recallObject('phrases.export', 'phrases', Array('skip_autoload' => true) );
$object->SetFieldsFromHash($field_values);
$lang_ids = explode(',', $this->Application->RecallVar('export_language_ids') );
if( !getArrayValue($field_values,'LangFile') )
{
$object->SetError('LangFile', 'required');
$event->redirect = false;
return false;
}
if( !is_writable(EXPORT_PATH) )
{
$object->SetError('LangFile', 'write_error', 'la_ExportFolderNotWritable');
$event->redirect = false;
return false;
}
if( substr($field_values['LangFile'], -5) != '.lang' ) $field_values['LangFile'] .= '.lang';
$filename = EXPORT_PATH.'/'.$field_values['LangFile'];
$lang_xml =& $this->Application->recallObject('LangXML');
if ($object->GetDBField('DoNotEncode')) {
$lang_xml->SetEncoding('plain');
}
$lang_xml->Create($filename, $field_values['PhraseType'], $lang_ids, $field_values['Module']);
}
$event->redirect = 'regional/languages_export_step2';
$event->SetRedirectParam('export_file', $field_values['LangFile']);
}
/**
* Returns to previous template in opener stack
*
* @param kEvent $event
*/
function OnGoBack(&$event)
{
$event->redirect_params['opener'] = 'u';
}
function OnScheduleTopFrameReload(&$event)
{
$this->Application->StoreVar('RefreshTopFrame',1);
}
/**
* Do now allow deleting current language
*
* @param kEvent $event
*/
function OnBeforeItemDelete(&$event)
{
$del_id = $event->getEventParam('id');
$object =& $event->getObject(array('skip_autload' => true));
$object->Load($del_id);
if ($object->GetDBField('PrimaryLang') || $object->GetDBField('AdminInterfaceLang') || $del_id == $this->Application->GetVar('m_lang')) {
$event->status = erFAIL;
}
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/languages/languages_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.33.2.5
\ No newline at end of property
+1.33.2.6
\ 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 11537)
+++ branches/RC/core/units/ban_rules/ban_rules_config.php (revision 11538)
@@ -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_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' => 0),
+ '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.5
\ No newline at end of property
+1.1.2.6
\ No newline at end of property
Index: branches/RC/core/units/permissions/permissions_tag_processor.php
===================================================================
--- branches/RC/core/units/permissions/permissions_tag_processor.php (revision 11537)
+++ branches/RC/core/units/permissions/permissions_tag_processor.php (revision 11538)
@@ -1,196 +1,198 @@
<?php
class PermissionsTagProcessor extends kDBTagProcessor {
function HasPermission($params)
{
$section_name = $params['section_name'];
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
return array_search($params['perm_name'], $section_data['permissions']) !== false;
}
function HasAdvancedPermissions($params)
{
$section_name = $params['section_name'];
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$ret = false;
foreach ($section_data['permissions'] as $perm_name) {
if (preg_match('/^advanced:(.*)/', $perm_name)) {
$ret = true;
break;
}
}
return $ret;
}
function PermissionValue($params)
{
$section_name = $params['section_name'];
$perm_name = $params['perm_name'];
-
+
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
-
+
if ($section_data && isset($section_data['perm_prefix'])) {
// using permission from other prefix
$section_name = $this->Application->getUnitOption($section_data['perm_prefix'].'.main', 'PermSection');
}
$permissions_helper =& $this->Application->recallObject('PermissionsHelper');
if (!$permissions_helper->isOldPermission($section_name, $perm_name)) {
$perm_name = $section_name.'.'.$perm_name;
}
return $permissions_helper->getPermissionValue($perm_name);
}
function LoadPermissions($params)
{
$permissions_helper =& $this->Application->recallObject('PermissionsHelper');
$prefix_parts = explode('-', $this->Prefix, 2);
/* @var $permissions_helper kPermissionsHelper */
-
+
$permissions_helper->LoadPermissions($this->Application->GetVar('g_id'), 0, 1, 'g');
}
function LevelIndicator($params)
{
return $params['level'] * $params['multiply'];
}
function PrintPermissions($params)
{
$category =& $this->Application->recallObject('c');
$group_id = $this->Application->GetVar('group_id');
$prefix = $this->Application->GetVar('item_prefix');
$module = $this->Application->findModule('Var', $prefix, 'Name');
$perm_live_table = $this->Application->getUnitOption('c-perm', 'TableName');
$perm_temp_table = $this->Application->GetTempName($perm_live_table, 'prefix:'.$this->Prefix);
if ($category->GetID() == 0) {
$categories = Array(0);
}
else {
$categories = explode('|', substr($category->GetDBField('ParentPath'), 1, -1));
}
if (count($categories) == 1 || $category->GetID() == 0) {
// category located in root category ("Home") => then add it to path virtually
array_unshift($categories, 0);
}
$this_cat = array_pop($categories);
// get permission name + category position in parent path that has value set for that permission
$case = 'MAX(CASE c.CategoryId';
foreach ($categories as $pos => $cat_id) {
$case .= ' WHEN '.$cat_id.' THEN '.$pos;
}
$case .= ' END) AS InheritedPosition';
$sql = 'SELECT '.$case.', p.Permission AS Perm
FROM '.TABLE_PREFIX.'Category c
LEFT JOIN '.$perm_live_table.' p ON p.CatId = c.CategoryId
LEFT JOIN '.TABLE_PREFIX.'PermissionConfig pc ON pc.PermissionName = p.Permission
WHERE
CategoryId IN ('.implode(',', $categories).') AND
ModuleId = "'.$module.'" AND
(
(p.GroupId = '.$group_id.' AND p.Type = 0)
)
GROUP BY Perm';
$perm_positions = $this->Conn->GetCol($sql, 'Perm');
$pos_sql = '';
foreach ($perm_positions as $perm_name => $category_pos) {
$pos_sql .= '(#TABLE_PREFIX#.Permission = "'.$perm_name.'" AND #TABLE_PREFIX#.CatId = '.$categories[$category_pos].') OR ';
}
$pos_sql = $pos_sql ? preg_replace('/(.*) OR $/', '\\1', $pos_sql) : '0';
// get all permissions list with iheritence status, inherited category id and permission value
$sql = 'SELECT pc.PermissionName,
pc.Description,
IF (tmp_p.PermissionValue IS NULL AND p.PermissionValue IS NULL,
0,
IF (tmp_p.PermissionValue IS NOT NULL, tmp_p.PermissionValue, p.PermissionValue)
) AS Value,
IF (tmp_p.CatId IS NOT NULL, tmp_p.CatId, IF(p.CatId IS NOT NULL, p.CatId, 0) ) AS InheritedFrom,
IF(tmp_p.CatId = '.$category->GetID().', 0, 1) AS Inherited,
IF(p.PermissionValue IS NOT NULL, p.PermissionValue, 0) AS InheritedValue
FROM '.TABLE_PREFIX.'PermissionConfig pc
LEFT JOIN '.$perm_live_table.' p
ON (p.Permission = pc.PermissionName) AND ('.str_replace('#TABLE_PREFIX#', 'p', $pos_sql).') AND (p.GroupId = '.$group_id.')
LEFT JOIN '.$perm_temp_table.' tmp_p
ON (tmp_p.Permission = pc.PermissionName) AND (tmp_p.CatId = '.$this_cat.') AND (tmp_p.GroupId = '.$group_id.')
WHERE ModuleId = "'.$module.'"';
$permissions = $this->Conn->Query($sql);
$ret = '';
$block_params = array_merge_recursive2( $this->prepareTagParams($params), Array('name' => $params['render_as']));
foreach ($permissions as $perm_record) {
$block_params = array_merge_recursive2($block_params, $perm_record);
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
/**
* Print module tab for each module
*
* @param Array $params
* @return string
*/
function PrintTabs($params)
{
$ret = '';
$block_params = $params;
foreach ($this->Application->ModuleInfo as $module_name => $module_data) {
if (!$this->Application->prefixRegistred($module_data['Var']) || !$this->Application->getUnitOption($module_data['Var'], 'CatalogItem')) continue;
$params['item_prefix'] = $module_data['Var'];
$ret .= $this->Application->ProcessParsedTag('m', 'MyInclude', $params);
}
return $ret;
}
/**
* Returns category name by ID
*
* @param Array $params
*/
function CategoryPath($params)
{
$category_id = $params['cat_id'];
$category_path = $this->Application->getCache('category_paths', $category_id);
if ($category_path === false) {
// not chached
if ($category_id > 0) {
$id_field = $this->Application->getUnitOption('c', 'IDField');
$table_name = $this->Application->getUnitOption('c', 'TableName');
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
+
$sql = 'SELECT '.$ml_formatter->LangFieldName('CachedNavbar').'
FROM '.$table_name.'
WHERE '.$id_field.' = '.$category_id;
- $category_path = trim($this->CategoryPath( Array('cat_id' => 0) ).' > '.str_replace('&|&', ' > ', $this->Conn->GetOne($sql)), ' > ');
+ $cached_navbar = preg_replace('/^Content(&\|&){0,1}/i', '', $this->Conn->GetOne($sql));
+ $category_path = trim($this->CategoryPath( Array('cat_id' => 0) ).' > '.str_replace('&|&', ' > ', $cached_navbar), ' > ');
}
else {
$category_path = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') );
}
$this->Application->setCache('category_paths', $category_id, $category_path);
}
return $category_path;
}
function PermInputName($params)
{
return $this->Prefix.'['.$this->Application->GetVar('group_id').']['.$this->Application->Parser->GetParam('PermissionName').']['.$params['sub_key'].']';
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/permissions/permissions_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.10
\ No newline at end of property
+1.10.2.1
\ No newline at end of property
Index: branches/RC/core/units/email_events/email_events_event_handler.php
===================================================================
--- branches/RC/core/units/email_events/email_events_event_handler.php (revision 11537)
+++ branches/RC/core/units/email_events/email_events_event_handler.php (revision 11538)
@@ -1,457 +1,497 @@
<?php
class EmailEventsEventsHandler extends kDBEventHandler
{
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnFrontOnly' => Array('self' => 'edit'),
'OnSaveSelected' => Array('self' => 'view'),
'OnProcessEmailQueue' => Array('self' => 'add|edit'),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Changes permission section to one from REQUEST, not from config
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
$module = $this->Application->GetVar('module');
$module = explode(':', $module, 2);
if (count($module) == 1) {
$main_prefix = $this->Application->findModule('Name', $module[0], 'Var');
}
else {
$exceptions = Array('Category' => 'c', 'Users' => 'u');
$main_prefix = $exceptions[ $module[1] ];
}
$section = $this->Application->getUnitOption($main_prefix.'.email', 'PermSection');
$event->setEventParam('PermSection', $section);
return parent::CheckPermission($event);
}
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @access protected
* @see OnListBuild
*/
function SetCustomQuery(&$event)
{
if ($event->Special == 'module') {
$object =& $event->getObject();
$module = $this->Application->GetVar('module');
$object->addFilter('module_filter', '%1$s.Module = '.$this->Conn->qstr($module));
}
}
/**
* Sets status Front-End Only to selected email events
*
* @param kEvent $event
*/
function OnFrontOnly(&$event)
{
$ids = implode(',', $this->StoreSelectedIDs($event));
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'UPDATE '.$table_name.'
SET Enabled = 2
WHERE EventId IN ('.$ids.')';
$this->Conn->Query($sql);
}
/**
* Sets selected user to email events selected
*
* @param kEvent $event
*/
function OnSelectUser(&$event)
{
$items_info = $this->Application->GetVar('u');
if ($items_info) {
$user_id = array_shift( array_keys($items_info) );
$selected_ids = $this->getSelectedIDs($event, true);
$ids = $this->Application->RecallVar($event->getPrefixSpecial().'_selected_ids');
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'UPDATE '.$table_name.'
SET '.$this->Application->RecallVar('dst_field').' = '.$user_id.'
WHERE '.$id_field.' IN ('.$ids.')';
$this->Conn->Query($sql);
}
$this->finalizePopup($event);
}
/**
* Saves selected ids to session
*
* @param kEvent $event
*/
function OnSaveSelected(&$event)
{
$this->StoreSelectedIDs($event);
}
/**
* Returns sender & recipients ids plus event_id (as parameter by reference)
*
* @param kEvent $event
* @param int $event_id id of email event used
*
* @return mixed
*/
function GetMessageRecipients(&$event, &$event_id)
{
$email_event =& $event->getObject( Array('skip_autoload' => true) );
/* @var $email_event kDBItem */
// get event parameters by name & type
$load_keys = Array (
'Event' => $event->getEventParam('EmailEventName'),
'Type' => $event->getEventParam('EmailEventType'),
);
$email_event->Load($load_keys);
if (!$email_event->isLoaded()) {
// event record not found
return false;
}
$enabled = $email_event->GetDBField('Enabled');
if ($enabled == EVENT_STATUS_DISABLED) {
return false;
}
if ($enabled == EVENT_STATUS_FRONTEND && $this->Application->IsAdmin()) {
return false;
}
// initial values
$to_user_id = $event->getEventParam('EmailEventToUserId');
$from_user_id = $email_event->GetDBField('FromUserId');
if ($email_event->GetDBField('Type') == EVENT_TYPE_ADMIN) {
// For type "Admin" recipient is a user from field FromUserId which means From/To user in Email events list
$to_user_id = $from_user_id;
$from_user_id = -1;
}
$event_id = $email_event->GetDBField('EventId');
return Array ($from_user_id, $to_user_id);
}
/**
* Returns user name, email by id, or ones, that specified in $direct_params
*
* @param int $user_id
* @param string $user_type type of user = {to,from}
* @param Array $direct_params
* @return Array
*/
function GetRecipientInfo($user_id, $user_type, $direct_params = null)
{
// load user, because it can be addressed from email template tags
$user =& $this->Application->recallObject('u.email-'.$user_type, null, Array('skip_autoload' => true));
/* @var $user UsersItem */
$email = $name = '';
$result = $user_id > 0 ? $user->Load($user_id) : $user->Clear();
if ($user->IsLoaded()) {
$email = $user->GetDBField('Email');
$name = trim($user->GetDBField('FirstName').' '.$user->GetDBField('LastName'));
}
if (is_array($direct_params)) {
if (isset($direct_params[$user_type.'_email'])) {
$email = $direct_params[$user_type.'_email'];
}
if (isset($direct_params[$user_type.'_name'])) {
$name = $direct_params[$user_type.'_name'];
}
}
if (!$email) {
// if email is empty, then use admins email
$email = $this->Application->ConfigValue('Smtp_AdminMailFrom');
}
if (!$name) {
$name = $user_type == 'from' ? strip_tags($this->Application->ConfigValue('Site_Name')) : $email;
}
return Array ($email, $name);
}
/**
* Returns email event message by ID (headers & body in one piece)
*
* @param int $event_id
* @param string $message_type contains message type = {text,html}
+ * @param int $language_id
*/
- function GetMessageBody($event_id, &$message_type)
+ function GetMessageBody($event_id, &$message_type, $language_id = null)
{
- $current_language = $this->Application->GetVar('m_lang');
+ if (!isset($language_id)) {
+ $language_id = $this->Application->GetVar('m_lang');
+ }
+
$message =& $this->Application->recallObject('emailmessages', null, Array('skip_autoload' => true));
/* @var $message kDBItem */
- $message->Load( Array('EventId' => $event_id, 'LanguageId' => $current_language) );
+ $message->Load( Array('EventId' => $event_id, 'LanguageId' => $language_id) );
if (!$message->isLoaded()) {
// event translation on required language not found
return false;
}
$message_type = $message->GetDBField('MessageType');
// 1. get message body
$message_body = $message->GetDBField('Template');
// 2. add footer
$sql = 'SELECT em.Template
FROM '.$message->TableName.' em
LEFT JOIN '.TABLE_PREFIX.'Events e ON e.EventId = em.EventId
- WHERE em.LanguageId = '.$current_language.' AND e.Event = "COMMON.FOOTER"';
+ WHERE em.LanguageId = '.$language_id.' AND e.Event = "COMMON.FOOTER"';
list (, $footer) = explode("\n\n", $this->Conn->GetOne($sql));
if ($message_type == 'text') {
$esender =& $this->Application->recallObject('EmailSender');
/* @var $esender kEmailSendingHelper */
$footer = $esender->ConvertToText($footer);
}
if ($footer) {
$message_body .= "\r\n".$footer;
}
// 3. replace tags if needed
$default_replacement_tags = Array (
'<inp:touser _Field="password"' => '<inp2:u_Field name="Password_plain"',
'<inp:touser _Field="UserName"' => '<inp2:u_Field name="Login"',
'<inp:touser _Field' => '<inp2:u_Field name',
);
$replacement_tags = $message->GetDBField('ReplacementTags');
$replacement_tags = $replacement_tags ? unserialize($replacement_tags) : Array ();
$replacement_tags = array_merge_recursive2($default_replacement_tags, $replacement_tags);
foreach ($replacement_tags as $replace_from => $replace_to) {
$message_body = str_replace($replace_from, $replace_to, $message_body);
}
return $message_body;
}
/**
* Parse message template and return headers (as array) and message body part
*
* @param string $message
* @param Array $direct_params
* @return Array
*/
function ParseMessageBody($message, $direct_params = null)
{
+ $message_language = $this->_getSendLanguage($direct_params);
+ $this->_changeLanguage($message_language);
+
$direct_params['message_text'] = isset($direct_params['message']) ? $direct_params['message'] : ''; // parameter alias
// 1. parse template
$this->Application->InitParser();
$parser_params = $this->Application->Parser->Params; // backup parser params
// ==== for TemplateParser class only: begin ====
- $parser_pattern = $this->Application->Parser->Pattern;
- $parser_values = $this->Application->Parser->Values;
- $this->Application->Parser->Pattern = Array(); // fixes bug in TemplateParser::SortParams
- $this->Application->Parser->Values = Array(); // fixes bug in TemplateParser::SortParams
+// $parser_pattern = $this->Application->Parser->Pattern;
+// $parser_values = $this->Application->Parser->Values;
+// $this->Application->Parser->Pattern = Array(); // fixes bug in TemplateParser::SortParams
+// $this->Application->Parser->Values = Array(); // fixes bug in TemplateParser::SortParams
// ==== for TemplateParser class only: end ====
$this->Application->Parser->SetParams( array_merge_recursive2($parser_params, $direct_params) );
$message = implode('&|&', explode("\n\n", $message, 2)); // preserves double \n in case when tag is located in subject field
$message = $this->Application->Parser->Parse($message, 'email_template', 0);
// ==== for TemplateParser class only: begin ====
- $this->Application->Parser->Pattern = $parser_pattern;
- $this->Application->Parser->Values = $parser_values;
+// $this->Application->Parser->Pattern = $parser_pattern;
+// $this->Application->Parser->Values = $parser_values;
// ==== for TemplateParser class only: end ====
$this->Application->Parser->SetParams($parser_params); // restore parser params
// 2. replace line endings, that are send with data submitted via request
$message = str_replace("\r\n", "\n", $message); // possible case
$message = str_replace("\r", "\n", $message); // impossible case, but just in case replace this too
// 3. separate headers from body
$message_headers = Array ();
list($headers, $message_body) = explode('&|&', $message, 2);
$headers = explode("\n", $headers);
foreach ($headers as $header) {
$header = explode(':', $header, 2);
$message_headers[ trim($header[0]) ] = trim($header[1]);
}
+ $this->_changeLanguage();
return Array ($message_headers, $message_body);
}
/**
* Raised when email message shoul be sent
*
* @param kEvent $event
*/
function OnEmailEvent(&$event)
{
$email_event_name = $event->getEventParam('EmailEventName');
if (strpos($email_event_name, '_') !== false) {
trigger_error('<span class="debug_error">Invalid email event name</span> <b>'.$email_event_name.'</b>. Use only <b>UPPERCASE characters</b> and <b>dots</b> as email event names', E_USER_ERROR);
}
// additional parameters from kApplication->EmailEvent
$send_params = $event->getEventParam('DirectSendParams');
// 1. get information about message sender and recipient
$recipients = $this->GetMessageRecipients($event, $event_id);
if ($recipients === false) {
// if not valid recipients found, then don't send event
return false;
}
list ($from_id, $to_id) = $recipients;
list ($from_email, $from_name) = $this->GetRecipientInfo($from_id, 'from', $send_params);
list ($to_email, $to_name) = $this->GetRecipientInfo($to_id, 'to', $send_params);
// 2. prepare message to be sent
- $message_template = $this->GetMessageBody($event_id, $message_type);
+ $message_language = $this->_getSendLanguage($send_params);
+ $message_template = $this->GetMessageBody($event_id, $message_type, $message_language);
if (!trim($message_template)) {
+ trigger_error('Message template is empty', E_USER_WARNING);
return false;
}
list ($message_headers, $message_body) = $this->ParseMessageBody($message_template, $send_params);
if (!trim($message_body)) {
+ trigger_error('Message template is empty after parsing', E_USER_WARNING);
return false;
}
// 3. set headers & send message
$esender =& $this->Application->recallObject('EmailSender');
/* @var $esender kEmailSendingHelper */
$esender->SetFrom($from_email, $from_name);
$esender->AddTo($to_email, $to_name);
$message_subject = isset($message_headers['Subject']) ? $message_headers['Subject'] : 'Mail message';
$esender->SetSubject($message_subject);
foreach ($message_headers as $header_name => $header_value) {
$esender->SetEncodedHeader($header_name, $header_value);
}
$esender->CreateTextHtmlPart($message_body, $message_type == 'html');
$event->status = $esender->Deliver() ? erSUCCESS : erFAIL;
if ($event->status == erSUCCESS){
// all keys, that are not used in email sending are written to log record
$send_keys = Array ('from_email', 'from_name', 'to_email', 'to_name', 'message');
foreach ($send_keys as $send_key) {
unset($send_params[$send_key]);
}
$fields_hash = Array (
'fromuser' => $from_name.' ('.$from_email.')',
'addressto' => $to_name.' ('.$to_email.')',
'subject' => $message_subject,
'timestamp' => adodb_mktime(),
'event' => $email_event_name,
'EventParams' => serialize($send_params),
);
$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'EmailLog');
}
$this->Application->removeObject('u.email-from');
$this->Application->removeObject('u.email-to');
}
+ function _getSendLanguage($send_params)
+ {
+ if (!is_array($send_params) && $this->Application->isDebugMode()) {
+ $this->Application->Debugger->appendTrace();
+ }
+ return array_key_exists('language_id', $send_params) ? $send_params['language_id'] : $this->Application->GetVar('m_lang');
+ }
+
+ function _changeLanguage($language_id = null)
+ {
+ static $prev_language_id = null;
+
+ if (!isset($language_id)) {
+ // restore language
+ $language_id = $prev_language_id;
+ }
+
+ $this->Application->SetVar('m_lang', $language_id);
+ $language =& $this->Application->recallObject('lang.current');
+ /* @var $lang_object kDBItem */
+
+ $language->Load($language_id);
+
+ $this->Application->Phrases->LanguageId = $language_id;
+ $this->Application->Phrases->Phrases = Array();
+
+ $prev_language_id = $language_id; // for restoring it later
+ }
+
/**
* Process emails from queue
*
* @param kEvent $event
* @todo Move to MailingList
*/
function OnProcessEmailQueue(&$event)
{
$deliver_count = $event->getEventParam('deliver_count');
if ($deliver_count === false) {
$deliver_count = $this->Application->ConfigValue('MailingListSendPerStep');
if ($deliver_count === false) {
$deliver_count = 10; // 10 emails per script run (if not specified directly)
}
}
$processing_type = $this->Application->GetVar('type');
if ($processing_type = 'return_progress') {
$email_queue_progress = $this->Application->RecallVar('email_queue_progress');
if ($email_queue_progress === false) {
$emails_sent = 0;
$sql = 'SELECT COUNT(*)
FROM ' . TABLE_PREFIX . 'EmailQueue
WHERE (SendRetries < 5) AND (LastSendRetry < ' . strtotime('-2 hours') . ')';
$total_emails = $this->Conn->GetOne($sql);
$this->Application->StoreVar('email_queue_progress', $emails_sent.':'.$total_emails);
}
else {
list ($emails_sent, $total_emails) = explode(':', $email_queue_progress);
}
}
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'EmailQueue
WHERE (SendRetries < 5) AND (LastSendRetry < ' . strtotime('-2 hours') . ')
LIMIT 0,' . $deliver_count;
$messages = $this->Conn->Query($sql);
$message_count = count($messages);
if (!$message_count) {
// no messages left to send in queue
if ($processing_type = 'return_progress') {
$this->Application->RemoveVar('email_queue_progress');
$this->Application->Redirect($this->Application->GetVar('finish_template'));
}
return ;
}
$mailing_list_helper =& $this->Application->recallObject('MailingListHelper');
/* @var $mailing_list_helper MailingListHelper */
$mailing_list_helper->processQueue($messages);
if ($processing_type = 'return_progress') {
$emails_sent += $message_count;
if ($emails_sent >= $total_emails) {
$this->Application->RemoveVar('email_queue_progress');
$this->Application->Redirect($this->Application->GetVar('finish_template'));
}
$this->Application->StoreVar('email_queue_progress', $emails_sent.':'.$total_emails);
$event->status = erSTOP;
echo ($emails_sent / $total_emails) * 100;
}
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/email_events/email_events_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.34.2.5
\ No newline at end of property
+1.34.2.6
\ No newline at end of property
Index: branches/RC/core/units/email_events/email_events_config.php
===================================================================
--- branches/RC/core/units/email_events/email_events_config.php (revision 11537)
+++ branches/RC/core/units/email_events/email_events_config.php (revision 11538)
@@ -1,106 +1,101 @@
<?php
$config = Array(
'Prefix' => 'emailevents',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'EmailEventsEventsHandler','file'=>'email_events_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
),
'IDField' => 'EventId',
'StatusField' => Array('Enabled'),
'TitleField' => 'Event',
'TitlePresets' => Array(
- 'email_settings_list' => Array('prefixes' => Array('emailevents.module_List'), 'format' => '!la_title_EmailSettings! (#emailevents.module_recordcount#)'),
+ 'email_settings_list' => Array('prefixes' => Array('emailevents.module_List'), 'format' => '!la_title_EmailSettings!'),
'email_send_form' => Array('prefixes' => Array(), 'format' => '!la_title_SendEmail!'),
'email_prepare' => Array('prefixes' => Array(), 'format' => '!la_title_PreparingEmailsForSending!. !la_title_PleaseWait!'),
'email_send' => Array('prefixes' => Array(), 'format' => '!la_title_SendingPreparedEmails!. !la_title_PleaseWait!'),
'email_send_complete' => Array('prefixes' => Array(), 'format' => '!la_title_SendMailComplete!'),
),
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array('show_enabled','show_disabled','show_frontonly'), 'type' => WHERE_FILTER),
),
'Filters' => Array(
'show_enabled' => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 1' ),
'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 0' ),
'show_frontonly' => Array('label' => 'la_Text_FrontOnly', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 2' ),
)
),
'TableName' => TABLE_PREFIX.'Events',
'CalculatedFields' => Array(
'' => Array (
'FromUser' => 'u.Login',
)
),
'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.FromUserId = u.PortalUserId',
), // key - special, value - list select sql),
'ItemSQLs' => Array( ''=>'SELECT * FROM %s'),
'ListSortings' => Array(
'' => Array('Sorting' => Array('Module' => 'asc', 'Description' => 'asc') ),
'module' => Array('Sorting' => Array('Description' => 'asc') ),
),
'Fields' => Array(
'EventId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'Event' => Array('type' => 'string','not_null' => '1','default' => ''),
'ReplacementTags' => Array ('type' => 'string', 'default' => NULL),
'Enabled' => Array('type'=>'int', 'formatter'=>'kOptionsFormatter', 'options' => Array(1 => 'la_Enabled', 0 => 'la_Disabled', 2 => 'la_Text_FrontOnly'), 'use_phrases' => 1, 'default' => 1, 'not_null' => 1),
'FromUserId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), '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),
'Module' => Array('type' => 'string','not_null' => '1','default' => ''),
'Description' => Array('type' => 'string','not_null' => '1','default' => ''),
'Type' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options' => Array (1 => 'la_Text_Admin', 0 => 'la_Text_User'), 'use_phrases' => 1, 'default' => 0, 'not_null' => 1),
),
'VirtualFields' => Array(
'FromUser' => Array(),
),
'Grids' => Array(
'Default' => Array (
'Icons' => Array('default'=>'icon16_custom.gif'),
'Fields' => Array(
- 'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'label_grid_checkbox_td'),
- 'Event' => Array( 'title'=>'la_col_Event'),
- 'Module' => Array( 'title'=>'la_col_Module'),
+ 'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'label_grid_checkbox_td', 'filter_block' => 'grid_like_filter'),
+ 'Event' => Array( 'title'=>'la_col_Event', 'filter_block' => 'grid_like_filter'),
+ 'Module' => Array( 'title'=>'la_col_Module', 'filter_block' => 'grid_like_filter'),
'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter'),
'Enabled' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
),
),
'EmailSettings' => Array (
'Icons' => Array('default'=>'icon16_custom.gif'),
'Fields' => Array(
+ 'EventId' => Array('title' => 'la_col_Id', 'filter_block' => 'grid_range_filter'),
'Description' => Array('title'=>'la_col_Description', 'data_block' => 'label_grid_checkbox_td' ),
- 'Type' => Array('title'=>'la_col_Type'),
- 'Enabled' => Array('title'=>'la_col_Status'),
- 'FromUser' => Array('title'=>'la_col_FromToUser'),
+ 'Type' => Array('title'=>'la_col_Type', 'filter_block' => 'grid_options_filter'),
+ 'Enabled' => Array('title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
+ 'FromUser' => Array('title'=>'la_col_FromToUser', 'filter_block' => 'grid_like_filter'),
),
),
),
- );
-
- if (defined('DEBUG_MODE') && DEBUG_MODE) {
- $config['Grids']['EmailSettings']['Fields']['EventId'] = Array('title' => 'la_col_Id');
- }
-
-?>
\ No newline at end of file
+ );
\ No newline at end of file
Property changes on: branches/RC/core/units/email_events/email_events_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.12.2.3
\ No newline at end of property
+1.12.2.4
\ No newline at end of property
Index: branches/RC/core/units/stylesheets/stylesheets_config.php
===================================================================
--- branches/RC/core/units/stylesheets/stylesheets_config.php (revision 11537)
+++ branches/RC/core/units/stylesheets/stylesheets_config.php (revision 11538)
@@ -1,116 +1,124 @@
<?php
$config = Array(
'Prefix' => 'css',
'ItemClass' => Array('class'=>'StylesheetsItem','file'=>'stylesheets_item.php','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'StylesheetsEventHandler','file'=>'stylesheets_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
'AutoLoad' => true,
'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'css',
'HookToSpecial' => '',
'HookToEvent' => Array('OnSave'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnCompileStylesheet',
),
),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'StylesheetId',
'StatusField' => Array('Enabled'),
'TitleField' => 'Name',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('css'=>'!la_title_Adding_Stylesheet!'),
'edit_status_labels' => Array('css'=>'!la_title_Editing_Stylesheet!'),
'new_titlefield' => Array('css'=>'!la_title_New_Stylesheet!'),
),
- 'styles_list' => Array('prefixes' => Array('css_List'), 'format' => "!la_title_Stylesheets! (#css_recordcount#)"),
+ 'styles_list' => Array('prefixes' => Array('css_List'), 'format' => "!la_title_Stylesheets!"),
'stylesheets_edit' => Array('prefixes' => Array('css'), 'format' => "#css_status# '#css_titlefield#' - !la_title_General!"),
- 'base_styles' => Array('prefixes' => Array('css','selectors.base_List'), 'format' => "#css_status# '#css_titlefield#' - !la_title_BaseStyles! (#selectors.base_recordcount#)"),
+ 'base_styles' => Array('prefixes' => Array('css','selectors.base_List'), 'format' => "#css_status# '#css_titlefield#' - !la_title_BaseStyles!"),
- 'block_styles' => Array('prefixes' => Array('css','selectors.block_List'), 'format' => "#css_status# '#css_titlefield#' - !la_title_BlockStyles! (#selectors.block_recordcount#)"),
+ 'block_styles' => Array('prefixes' => Array('css','selectors.block_List'), 'format' => "#css_status# '#css_titlefield#' - !la_title_BlockStyles!"),
'base_style_edit' => Array( 'prefixes' => Array('css','selectors'),
'new_status_labels' => Array('selectors'=>'!la_title_Adding_BaseStyle!'),
'edit_status_labels' => Array('selectors'=>'!la_title_Editing_BaseStyle!'),
'new_titlefield' => Array('selectors'=>'!la_title_New_BaseStyle!'),
'format' => "#css_status# '#css_titlefield#' - #selectors_status# '#selectors_titlefield#'"),
'block_style_edit' => Array( 'prefixes' => Array('css','selectors'),
'new_status_labels' => Array('selectors'=>'!la_title_Adding_BlockStyle!'),
'edit_status_labels' => Array('selectors'=>'!la_title_Editing_BlockStyle!'),
'new_titlefield' => Array('selectors'=>'!la_title_New_BlockStyle!'),
'format' => "#css_status# '#css_titlefield#' - #selectors_status# '#selectors_titlefield#'"),
'style_edit' => Array('prefixes' => Array('selectors'), 'format' => "!la_title_EditingStyle! '#selectors_titlefield#'"),
),
+ 'EditTabPresets' => Array (
+ 'Default' => Array (
+ 'general' => Array ('title' => 'la_tab_General', 't' => 'stylesheets/stylesheets_edit', 'priority' => 1),
+ 'block_styles' => Array ('title' => 'la_tab_BlockStyles', 't' => 'stylesheets/stylesheets_edit_block', 'priority' => 2),
+ 'base_styles' => Array ('title' => 'la_tab_BaseStyles', 't' => 'stylesheets/stylesheets_edit_base', 'priority' => 3),
+ ),
+ ),
+
'PermSection' => Array('main' => 'in-portal:configure_styles'),
'TableName' => TABLE_PREFIX.'Stylesheets',
'SubItems' => Array('selectorsbase', 'selectorsblock'),
'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('Name' => 'asc'),
)
),
'Fields' => Array(
'StylesheetId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'Name' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
'Description' => Array('type' => 'string','not_null' => '1','default' => ''),
'AdvancedCSS' => Array('type' => 'string','not_null' => '1','default' => ''),
'LastCompiled' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1, 'default' => 0),
'Enabled' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array(0 => 'la_Disabled', 1 => 'la_Enabled'), 'use_phrases' => 1, 'not_null' => '1','default' => 0),
),
'VirtualFields' => Array(),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_custom.gif',0=>'icon16_style_disabled.gif',1=>'icon16_style.gif'),
'Fields' => Array(
- 'Name' => Array( 'title'=>'la_col_Name', 'data_block' => 'grid_checkbox_td'),
- 'Description' => Array( 'title'=>'la_col_Description', 'first_chars' => 100),
- 'Enabled' => Array( 'title'=>'la_col_Status' ),
- 'LastCompiled' => Array('title' => 'la_col_LastCompiled'),
+ 'Name' => Array( 'title'=>'la_col_Name', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_like_filter'),
+ 'Description' => Array( 'title'=>'la_col_Description', 'first_chars' => 100, 'filter_block' => 'grid_like_filter'),
+ 'Enabled' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
+ 'LastCompiled' => Array('title' => 'la_col_LastCompiled', 'filter_block' => 'grid_date_range_filter'),
),
),
),
);
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/stylesheets/stylesheets_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.12.2.3
\ No newline at end of property
+1.12.2.4
\ No newline at end of property
Index: branches/RC/core/units/general/helpers/search_helper.php
===================================================================
--- branches/RC/core/units/general/helpers/search_helper.php (revision 11537)
+++ branches/RC/core/units/general/helpers/search_helper.php (revision 11538)
@@ -1,680 +1,686 @@
<?php
class kSearchHelper extends kHelper {
/**
* Splits search phrase into keyword using quotes,plus and minus sings and spaces as split criteria
*
* @param string $keyword
* @return string
*/
function splitKeyword($keyword)
{
if ($this->Application->ConfigValue('CheckStopWords')) {
$keyword_after_remove = $this->_removeStopWords($keyword);
if ($keyword_after_remove) {
// allow to search through stop word grid
$keyword = $keyword_after_remove;
}
}
$quotes_re = '/([+\-]?)"(.*?)"/';
$no_quotes_re = '/([+\-]?)([^ ]+)/';
$quoted_kw = preg_match_all($quotes_re, $keyword, $res);
foreach ($res[2] as $index => $kw) $final[$kw] = $res[1][$index];
$keyword = preg_replace($quotes_re, '', $keyword);
$not_quoted_kw = preg_match_all($no_quotes_re, $keyword, $res);
foreach ($res[2] as $index => $kw) $final[$kw] = $res[1][$index];
return $final;
}
function getPositiveKeywords($keyword)
{
$keywords = $this->splitKeyword($keyword);
$ret = Array();
foreach ($keywords as $keyword => $sign) {
if ($sign == '+' || $sign == '') {
$ret[] = $keyword;
}
}
return $ret;
}
function buildWhereClause($keyword, $fields)
{
$keywords = $this->splitKeyword($keyword);
$normal_conditions = Array();
$plus_conditions = Array();
$minus_conditions = Array();
foreach ($keywords as $keyword => $sign) {
switch ($sign) {
case '+':
$plus_conditions[] = implode(' LIKE "%'.$keyword.'%" OR ', $fields).' LIKE "%'.$keyword.'%"';
break;
case '-':
foreach ($fields as $field) {
$condition[] = $field.' NOT LIKE "%'.$keyword.'%" OR '.$field.' IS NULL';
}
$minus_conditions[] = '('.implode(') AND (', $condition).')';
break;
case '':
$keyword = str_replace('"', '\"', $keyword);
$normal_conditions[] = implode(' LIKE "%'.$keyword.'%" OR ', $fields).' LIKE "%'.$keyword.'%"';
break;
}
}
// building where clause
if ($normal_conditions) {
$where_clause = '('.implode(') OR (', $normal_conditions).')';
}
else {
$where_clause = '1';
}
if ($plus_conditions) {
$where_clause = '('.$where_clause.') AND ('.implode(') AND (', $plus_conditions).')';
}
if ($minus_conditions) {
$where_clause = '('.$where_clause.') AND ('.implode(') AND (', $minus_conditions).')';
}
return $where_clause;
}
/**
* Returns additional information about search field
*
* @param kDBList $object
* @param string $field_name
* @return Array
*/
function getFieldInformation(&$object, $field_name)
{
$sql_filter_type = isset($object->VirtualFields[$field_name]) ? 'having' : 'where';
$field_type = isset($object->Fields[$field_name]['type']) ? $object->Fields[$field_name]['type'] : 'string';
if (preg_match('/(.*)\.(.*)/', $field_name, $regs)) {
$table_name = '`'.$regs[1].'`.'; // field from external table
$field_name = $regs[2];
}
elseif ($sql_filter_type == 'where') {
$table_name = '`'.$object->TableName.'`.'; // field from local table
}
$table_name = ($sql_filter_type == 'where') ? $table_name : '';
// replace wid inside table name to WID_MARK constant value
$is_temp_table = preg_match('/(.*)'.TABLE_PREFIX.'ses_'.$this->Application->GetSID().'(_[\d]+){0,1}_edit_(.*)/', $table_name, $regs);
if ($is_temp_table) {
$table_name = $regs[1].TABLE_PREFIX.'ses_'.EDIT_MARK.'_edit_'.$regs[3]; // edit_mark will be replaced with sid[_main_wid] in AddFilters
}
return Array ('field_name' => $field_name, 'field_type' => $field_type, 'table_name' => $table_name, 'sql_filter_type' => $sql_filter_type);
}
/**
* Removes stop words from keyword
*
* @param string $keyword
* @return string
*/
function _removeStopWords($keyword)
{
static $stop_words = Array ();
if (!$stop_words) {
$sql = 'SELECT StopWord
FROM ' . $this->Application->getUnitOption('stop-word', 'TableName') . '
ORDER BY LENGTH(StopWord) DESC, StopWord ASC';
$stop_words = $this->Conn->GetCol($sql);
foreach ($stop_words as $index => $stop_word) {
$stop_words[$index] = '/(^| )' . preg_quote($stop_word, '/') . '( |$)/';
}
}
$keyword = preg_replace($stop_words, ' ', $keyword);
return trim( preg_replace('/[ ]+/', ' ', $keyword) );
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function performSearch(&$event)
{
$object =& $event->getObject();
// process search keyword
$search_keyword = $this->Application->GetVar( $event->getPrefixSpecial(true).'_search_keyword');
$this->Application->StoreVar( $event->getPrefixSpecial().'_search_keyword', $search_keyword);
$search_keyword = str_replace('*', '%', $search_keyword);
$custom_filter = $this->processCustomFilters($event);
if(!$search_keyword && $custom_filter === false) {
$this->resetSearch($event);
return true;
}
if ($search_keyword) {
$this->processAutomaticFilters($event, $search_keyword, $custom_filter);
}
}
function processAutomaticFilters(&$event, $search_keyword, $custom_filter)
{
$grid_name = $this->Application->GetVar('grid_name');
$grids = $this->Application->getUnitOption($event->Prefix, 'Grids');
$search_fields = array_keys($grids[$grid_name]['Fields']);
$search_filter = Array();
$object =& $event->getObject();
foreach ($search_fields as $search_field) {
$custom_search = isset($custom_filter[$search_field]);
$filter_data = $this->getSearchClause($object, $search_field, $search_keyword, $custom_search);
if ($filter_data) {
$search_filter[$search_field] = $filter_data;
}
else {
unset($search_filter[$search_field]);
}
}
$this->Application->StoreVar($event->getPrefixSpecial().'_search_filter', serialize($search_filter) );
}
/**
* Returns search clause for any particular field
*
* @param kDBList $object
* @param string $search_field
* @param string $search_keyword what we are searching (false, when building custom filter clause)
* @param string $custom_search already found using custom filter
* @return Array
*/
function getSearchClause(&$object, $field_name, $search_keyword, $custom_search)
{
+ if (array_key_exists($field_name, $object->VirtualFields) && !array_key_exists($field_name, $object->CalculatedFields)) {
+ // Virtual field, that is shown in grid, but it doesn't have corresponding calculated field.
+ // Happens, when field value is calculated on the fly (during grid display) and it is not searchable.
+ return '';
+ }
+
$search_keywords = $this->splitKeyword($search_keyword);
extract( $this->getFieldInformation($object, $field_name) ); // see getFieldInformation for more details
$filter_value = '';
// get field clause by formatter name and/or parameters
$formatter = getArrayValue($object->Fields[$field_name], 'formatter');
switch ($formatter) {
case 'kOptionsFormatter':
$search_keys = Array();
if ($custom_search === false) {
// if keywords passed through simple search filter (on each grid)
$use_phrases = getArrayValue($object->Fields[$field_name], 'use_phrases');
$field_options = $object->GetFieldOptions($field_name);
foreach ($field_options['options'] as $key => $val) {
foreach ($search_keywords as $keyword => $sign) {
$pattern = '#'.$keyword.'#i';
if (!preg_match($pattern, $use_phrases ? $this->Application->Phrase($val) : $val)) {
if ($sign == '+') {
$filter_value = $table_name.'`'.$field_name.'` = NULL';
break;
}
else {
continue;
}
}
if ($sign == '+' || $sign == '') {
$search_keys[$key] = $this->Conn->qstr($key);
}
elseif($sign == '-') {
// if same value if found as exclusive too, then remove from search result
unset($search_keys[$key]);
}
}
}
}
if ($search_keys) {
$filter_value = $table_name.'`'.$field_name.'` IN ('.implode(',', $search_keys).')';
}
$field_processed = true;
break;
case 'kDateFormatter':
// if date is searched using direct filter, then do nothing here, otherwise search using LIKE clause
$field_processed = ($custom_search !== false) ? true : false;
break;
default:
$field_processed = false;
break;
}
// if not already processed by formatter, then get clause by field type
if (!$field_processed && $search_keywords) {
switch($field_type)
{
case 'int':
case 'integer':
case 'numeric':
$search_keys = Array();
foreach ($search_keywords as $keyword => $sign) {
if (!is_numeric($keyword) || ($sign == '-')) continue;
$search_keys[] = $this->Conn->qstr($keyword);
}
if ($search_keys) {
$filter_value = $table_name.'`'.$field_name.'` IN ('.implode(',', $search_keys).')';
}
break;
case 'double':
case 'float':
case 'real':
$search_keys = Array();
foreach ($search_keywords as $keyword => $sign) {
$keyword = str_replace(',', '.', $keyword);
if (!is_numeric($keyword) || ($sign == '-')) continue;
$search_keys[] = 'ABS('.$table_name.'`'.$field_name.'` - '.$this->Conn->qstr($keyword).') <= 0.0001';
}
if ($search_keys) {
$filter_value = '('.implode(') OR (', $search_keys).')';
}
break;
case 'string':
$filter_value = $this->buildWhereClause($search_keyword, Array($table_name.'`'.$field_name.'`'));
break;
}
}
if ($filter_value) {
return Array('type' => $sql_filter_type, 'value' => $filter_value);
}
return false;
}
/**
* Processes custom filters from submit
*
* @param KEvent $event
* @return bool
*/
function processCustomFilters(&$event)
{
$grid_name = $this->Application->GetVar('grid_name');
// update "custom filter" with values from submit: begin
$view_name = $this->Application->RecallVar($event->getPrefixSpecial().'_current_view');
$custom_filters = $this->Application->RecallPersistentVar($event->getPrefixSpecial().'_custom_filter.'.$view_name, ALLOW_DEFAULT_SETTINGS);
if ($custom_filters) {
$custom_filters = unserialize($custom_filters);
$custom_filter = isset($custom_filters[$grid_name]) ? $custom_filters[$grid_name] : Array ();
}
else {
$custom_filter = Array ();
}
// submit format custom_filters[prefix_special][field]
$submit_filters = $this->Application->GetVar('custom_filters');
if ($submit_filters) {
$submit_filters = getArrayValue($submit_filters, $event->getPrefixSpecial(), $grid_name);
if ($submit_filters) {
foreach ($submit_filters as $field_name => $field_options) {
list ($filter_type, $field_value) = each($field_options);
$is_empty = strlen(is_array($field_value) ? implode('', $field_value) : $field_value) == 0;
if ($is_empty) {
if (isset($custom_filter[$field_name])) {
// use isset, because non-existing key will cause "php notice"!
unset($custom_filter[$field_name][$filter_type]); // remove filter
if (!$custom_filter[$field_name]) {
// if no filters left for field, then delete record at all
unset($custom_filter[$field_name]);
}
}
}
else {
$custom_filter[$field_name][$filter_type]['submit_value'] = $field_value;
}
}
}
}
if ($custom_filter) {
$custom_filters[$grid_name] = $custom_filter;
}
else {
unset($custom_filters[$grid_name]);
}
// update "custom filter" with values from submit: end
if (!$custom_filter) {
// in case when no filters specified, there are nothing to process
$this->Application->StorePersistentVar($event->getPrefixSpecial().'_custom_filter.'.$view_name, serialize($custom_filters) );
return false;
}
$object =& $event->getObject(); // don't recall it each time in getCustomFilterSearchClause
$grid_info = $this->Application->getUnitOption($event->Prefix.'.'.$grid_name, 'Grids');
foreach ($custom_filter as $field_name => $field_options) {
list ($filter_type, $field_options) = each($field_options);
$field_options['grid_options'] = $grid_info['Fields'][$field_name];
$field_options = $this->getCustomFilterSearchClause($object, $field_name, $filter_type, $field_options);
if ($field_options['value']) {
unset($field_options['grid_options']);
$custom_filter[$field_name][$filter_type] = $field_options;
}
}
$custom_filters[$grid_name] = $custom_filter;
$this->Application->StorePersistentVar($event->getPrefixSpecial().'_custom_filter.'.$view_name, serialize($custom_filters) );
return $custom_filter;
}
/**
* Checks, that range filters "To" part is defined for given grid
*
* @param string $prefix_special
* @param string $grid_name
* @return bool
*/
function rangeFiltersUsed($prefix_special, $grid_name)
{
static $cache = Array ();
$cache_key = $prefix_special . $grid_name;
if (array_key_exists($cache_key, $cache)) {
return $cache[$cache_key];
}
$view_name = $this->Application->RecallVar($prefix_special . '_current_view');
$custom_filters = $this->Application->RecallPersistentVar($prefix_special . '_custom_filter.' . $view_name, ALLOW_DEFAULT_SETTINGS);
if (!$custom_filters) {
// filters not defined for given prefix
$cache[$cache_key] = false;
return false;
}
$custom_filters = unserialize($custom_filters);
if (!array_key_exists($grid_name, $custom_filters)) {
// filters not defined for given grid
$cache[$cache_key] = false;
return false;
}
$range_filter_defined = false;
$custom_filter = $custom_filters[$grid_name];
foreach ($custom_filter as $field_name => $field_options) {
list ($filter_type, $field_options) = each($field_options);
if (strpos($filter_type, 'range') === false) {
continue;
}
$to_value = (string)$field_options['submit_value']['to'];
if ($to_value !== '') {
$range_filter_defined = true;
break;
}
}
$cache[$cache_key] = $range_filter_defined;
return $range_filter_defined;
}
/**
* Return numeric range filter value + checking that it's number
*
* @param Array $value array containing range filter value
* @return unknown
*/
function getRangeValue($value)
{
return strlen($value) && is_numeric($value) ? $this->Conn->qstr($value) : false;
}
function getCustomFilterSearchClause(&$object, $field_name, $filter_type, $field_options)
{
// this is usually used for mutlilingual fields and date fields
if (isset($field_options['grid_options']['sort_field'])) {
$field_name = $field_options['grid_options']['sort_field'];
}
extract( $this->getFieldInformation($object, $field_name) ); // see getFieldInformation for more details
$filter_value = '';
switch ($filter_type) {
case 'range':
$from = $this->getRangeValue($field_options['submit_value']['from']);
$to = $this->getRangeValue($field_options['submit_value']['to']);
if ($from !== false && $to !== false) {
// add range filter
$filter_value = $table_name.'`'.$field_name.'` >= '.$from.' AND '.$table_name.'`'.$field_name.'` <= '.$to;
}
elseif ($from !== false) {
// add equals filter on $from
$filter_value = $table_name.'`'.$field_name.'` = '.$from;
}
elseif ($to !== false) {
// add equals filter on $to
$filter_value = $table_name.'`'.$field_name.'` = '.$to;
}
break;
case 'float_range':
// MySQL can't compare values in "float" type columns using "=" operator
$from = $this->getRangeValue($field_options['submit_value']['from']);
$to = $this->getRangeValue($field_options['submit_value']['to']);
if ($from !== false && $to !== false) {
// add range filter
$filter_value = $table_name.'`'.$field_name.'` >= '.$from.' AND '.$table_name.'`'.$field_name.'` <= '.$to;
}
elseif ($from !== false) {
// add equals filter on $from
$filter_value = 'ABS('.$table_name.'`'.$field_name.'` - '.$from.') <= 0.0001';
}
elseif ($to !== false) {
// add equals filter on $to
$filter_value = 'ABS('.$table_name.'`'.$field_name.'` - '.$to.') <= 0.0001';
}
break;
case 'date_range':
$from = $this->processRangeField($object, $field_name, $field_options['submit_value'], 'from');
$to = $this->processRangeField($object, $field_name, $field_options['submit_value'], 'to');
$day_seconds = 23 * 60 * 60 + 59 * 60 + 59;
if ($from !== false && $to === false) {
$from = strtotime(date('Y-m-d', $from) . ' 00:00:00', $from); // reset to morning
$to = $from + $day_seconds;
}
elseif ($from === false && $to !== false) {
$to = strtotime(date('Y-m-d', $to) . ' 23:59:59', $to); // reset to evening
$from = $to - $day_seconds;
}
if ($from !== false && $to !== false) {
$filter_value = $table_name.'`'.$field_name.'` >= '.$from.' AND '.$table_name.'`'.$field_name.'` <= '.$to;
}
break;
case 'equals':
case 'options':
$field_value = strlen($field_options['submit_value']) ? $this->Conn->qstr($field_options['submit_value']) : false;
if ($field_value) {
$filter_value = $table_name.'`'.$field_name.'` = '.$field_value;
}
break;
case 'picker':
$field_value = strlen($field_options['submit_value']) ? $field_options['submit_value'] : false;
if ($field_value) {
$filter_value = $table_name.'`'.$field_name.'` LIKE "%|'.$field_value.'|%"';
}
break;
case 'like':
$filter_value = $this->buildWhereClause($field_options['submit_value'], Array($table_name.'`'.$field_name.'`'));
break;
default:
break;
}
$field_options['sql_filter_type'] = $sql_filter_type;
$field_options['value'] = $filter_value;
return $field_options;
}
/**
* Enter description here...
*
* @param kdbItem $object
* @param string $search_field
* @param string $value
* @param string $type
*/
function processRangeField(&$object, $search_field, $value, $type)
{
if (!strlen($value[$type])) {
return false;
}
$options = $object->GetFieldOptions($search_field);
$dt_separator = array_key_exists('date_time_separator', $options) ? $options['date_time_separator'] : ' ';
$value[$type] = trim($value[$type], $dt_separator); // trim any
$tmp_value = explode($dt_separator, $value[$type], 2);
if (count($tmp_value) == 1) {
$time_format = $this->_getInputTimeFormat($options);
if ($time_format) {
// time is missing, but time format available -> guess time and add to date
$time = ($type == 'from') ? adodb_mktime(0, 0, 0) : adodb_mktime(23, 59, 59);
$time = adodb_date($time_format, $time);
$value[$type] .= $dt_separator . $time;
}
}
$formatter =& $this->Application->recallObject($object->Fields[$search_field]['formatter']);
$value_ts = $formatter->Parse($value[$type], $search_field, $object);
$pseudo = getArrayValue($object->FieldErrors, $search_field, 'pseudo');
if ($pseudo) {
unset($object->FieldErrors[$search_field]); // remove error!
// invalid format -> ignore this date in search
return false;
}
return $value_ts;
}
/**
* Returns InputTimeFormat using given field options
*
* @param Array $field_options
* @return string
*/
function _getInputTimeFormat($field_options)
{
if (array_key_exists('input_time_format', $field_options)) {
return $field_options['input_time_format'];
}
$lang_current =& $this->Application->recallObject('lang.current');
return $lang_current->GetDBField('InputTimeFormat');
}
/**
* Resets current search
*
* @param kEvent $event
*/
function resetSearch(&$event)
{
$this->Application->RemoveVar($event->getPrefixSpecial().'_search_filter');
$this->Application->RemoveVar($event->getPrefixSpecial().'_search_keyword');
$view_name = $this->Application->RecallVar($event->getPrefixSpecial().'_current_view');
$this->Application->RemovePersistentVar($event->getPrefixSpecial().'_custom_filter.'.$view_name);
}
/**
* Creates filters based on "types" & "except" parameters from PrintList
*
* @param kEvent $event
* @param Array $type_clauses
* @param string $types
* @param string $except_types
*/
function SetComplexFilter(&$event, &$type_clauses, $types, $except_types)
{
$includes_or_filter =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_OR);
$excepts_and_filter =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_AND);
$includes_or_filter_h =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_OR);
$excepts_and_filter_h =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_AND);
if ($types) {
$types = explode(',', $types);
foreach ($types as $type) {
$type = trim($type);
if (isset($type_clauses[$type])) {
if ($type_clauses[$type]['having_filter']) {
$includes_or_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['include']);
} else {
$includes_or_filter->addFilter('filter_'.$type, $type_clauses[$type]['include']);
}
}
}
}
if ($except_types) {
$except_types = explode(',', $except_types);
foreach ($except_types as $type) {
$type = trim($type);
if (isset($type_clauses[$type])) {
if ($type_clauses[$type]['having_filter']) {
$excepts_and_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['except']);
} else {
$excepts_and_filter->addFilter('filter_'.$type, $type_clauses[$type]['except']);
}
}
}
}
$object =& $event->getObject();
$object->addFilter('includes_filter', $includes_or_filter);
$object->addFilter('excepts_filter', $excepts_and_filter);
$object->addFilter('includes_filter_h', $includes_or_filter_h, HAVING_FILTER);
$object->addFilter('excepts_filter_h', $excepts_and_filter_h, HAVING_FILTER);
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/general/helpers/search_helper.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.10.2.6
\ No newline at end of property
+1.10.2.7
\ No newline at end of property
Index: branches/RC/core/units/general/helpers/permissions_helper.php
===================================================================
--- branches/RC/core/units/general/helpers/permissions_helper.php (revision 11537)
+++ branches/RC/core/units/general/helpers/permissions_helper.php (revision 11538)
@@ -1,615 +1,619 @@
<?php
class kPermissionsHelper extends kHelper {
/**
* Current set of permissions for group being edited
*
* @var Array
*/
var $Permissions = Array();
function LoadPermissions($group_id, $cat_id, $type = 1, $prefix = '')
{
$perm_table = $this->Application->getUnitOption('perm', 'TableName');
$perm_table = $this->Application->GetTempName($perm_table, 'prefix:'.$prefix);
$sql = 'SELECT *
FROM '.$perm_table.'
WHERE (GroupId = '.$group_id.') AND (CatId = '.$cat_id.') AND (Type = '.$type.')';
$permissions = $this->Conn->Query($sql, 'Permission');
$this->Permissions = Array();
foreach ($permissions as $perm_name => $perm_options) {
$perm_record['value'] = $perm_options['PermissionValue'];
$perm_record['id'] = $perm_options['PermissionId'];
$this->Permissions[$perm_name] = $perm_record;
}
}
function getPermissionValue($perm_name)
{
return isset($this->Permissions[$perm_name]) ? $this->Permissions[$perm_name]['value'] : 0;
}
function getPermissionID($perm_name)
{
return isset($this->Permissions[$perm_name]) ? $this->Permissions[$perm_name]['id'] : 0;
}
/**
* This is old permission like ADMIN or LOGIN
*
* @param string $section_name
* @param string $perm_name
* @return bool
*/
function isOldPermission($section_name, $perm_name)
{
return $section_name == 'in-portal:root' && $perm_name != 'view';
}
/**
* Returns permission names to check based on event name and item prefix (main item or subitem)
*
* @param kEvent $event
* @return Array
*/
function getPermissionByEvent(&$event, $perm_mapping)
{
$top_prefix = $event->getEventParam('top_prefix');
$pefix_type = ($top_prefix == $event->Prefix) ? 'self' : 'subitem';
$perm_mapping = getArrayValue($perm_mapping, $event->Name);
if (!$perm_mapping[$pefix_type]) {
trigger_error('Permission mappings not defined for event <b>'.$top_prefix.' <- '.$event->Prefix.':'.$event->Name.'</b>', E_USER_ERROR);
}
if ($perm_mapping[$pefix_type] === true) {
// event is defined in mapping but is not checked by permissions
return true;
}
return explode('|', $perm_mapping[$pefix_type]);
}
/**
* Common event permission checking method
*
* @param kEvent $event
*/
function CheckEventPermission(&$event, $perm_mapping)
{
$section = $event->getSection();
if (preg_match('/^CATEGORY:(.*)/', $section)) {
return $this->CheckEventCategoryPermission($event, $perm_mapping);
}
$top_prefix = $event->getEventParam('top_prefix');
$check_perms = $this->getPermissionByEvent($event, $perm_mapping);
if ($check_perms === true) {
// event is defined in mapping but is not checked by permissions
return true;
}
$perm_status = false;
foreach ($check_perms as $perm_name) {
// check if at least one of required permissions is set
$perm_name = $section.'.'.$perm_name;
$perm_status = $this->CheckPermission($perm_name, 1);
if (($perm_name == $section.'.add') && $perm_status && ($top_prefix == $event->Prefix)) {
// main item, add permission allowed, but ID is > 0, then deny permission
// how to get id here
}
if ($perm_status) {
return $perm_status;
}
}
if (!$perm_status) {
if ($this->Application->isDebugMode()) {
// for debugging purposes
$event->SetRedirectParam('section', $section);
$event->SetRedirectParam('main_prefix', $top_prefix);
$event->SetRedirectParam('event_name', $event->Name);
$event->SetRedirectParam('next_template', $this->Application->GetVar('t'));
}
$event->status = erPERM_FAIL;
}
return $perm_status;
}
/**
* Returns owner + primary category for each item (used for permission checking)
*
* @param string $prefix
* @param string $ids
* @return Array
* @author Alex
*/
function GetCategoryItemData($prefix, $ids)
{
if (is_array($ids)) {
$ids = implode(',', $ids);
}
$id_field = $this->Application->getUnitOption($prefix, 'IDField');
$table_name = $this->Application->getUnitOption($prefix, 'TableName');
$ci_table = $this->Application->getUnitOption('ci', 'TableName');
$owner_field = $this->Application->getUnitOption($prefix, 'OwnerField');
if (!$owner_field) {
$owner_field = 'CreatedById';
}
$sql = 'SELECT item_table.'.$id_field.', item_table.'.$owner_field.' AS CreatedById, ci.CategoryId
FROM '.$table_name.' item_table
LEFT JOIN '.$ci_table.' ci ON ci.ItemResourceId = item_table.ResourceId
WHERE item_table.'.$id_field.' IN ('.$ids.') AND (ci.PrimaryCat = 1)';
return $this->Conn->Query($sql, $id_field);
}
/**
* Checks non-system permission on event per category basis
*
* @param kEvent $event
*/
function CheckEventCategoryPermission(&$event, $event_perm_mapping)
{
// mapping between specific permissions and common permissions
$perm_mapping = Array('add' => 'ADD', 'add.pending' => 'ADD.PENDING', 'edit' => 'MODIFY', 'edit.pending' => 'MODIFY.PENDING', 'delete' => 'DELETE', 'view' => 'VIEW');
$top_prefix = $event->getEventParam('top_prefix');
$event_handler =& $this->Application->recallObject($event->Prefix.'_EventHandler');
/* @var $event_handler kCatDBEventHandler */
$raise_warnings = $event->getEventParam('raise_warnings');
$event->setEventParam('raise_warnings', 0);
if ($event->Prefix != $top_prefix) {
$top_event = new kEvent($top_prefix.':'.$event->Name);
$id = $event_handler->getPassedID($top_event);
}
else {
$id = $event_handler->getPassedID($event);
}
$event->setEventParam('raise_warnings', $raise_warnings);
$owner_id = -1; // owner is root if not detected
if (!$id) {
// item being created -> check by current (before editing started, saved in OnPreCreate event) category permissions
$category_id = $this->Application->IsAdmin() ? $this->Application->RecallVar('m_cat_id') : $this->Application->GetVar('m_cat_id');
}
elseif ($top_prefix == 'c' || $top_prefix == 'st') {
$category_id = $id;
}
else {
// item being edited -> check by it's primary category permissions
$items_info = $this->GetCategoryItemData($top_prefix, $id);
$category_id = $items_info[$id]['CategoryId'];
$owner_id = $items_info[$id]['CreatedById'];
}
// specific permission check for pending & owner permissions: begin
$uploader_events = Array ('OnUploadFile', 'OnDeleteFile', 'OnViewFile');
if (in_array($event->Name, $uploader_events)) {
// don't recall target object during uploader-related, because OnItemLoad will use incorrect
// $user_id in Firefox (during Flash problems session will be used from Internet Exploere)
$new_item = false;
}
else {
$new_item = $this->Application->IsAdmin() && $event_handler->isNewItemCreate($event) ? true : false;
$check_status = $this->checkCombinedPermissions($event, $owner_id, $category_id, $new_item);
}
if (isset($check_status)) {
return $check_status;
}
// specific permission check for pending & owner permissions: end
$perm_status = false;
$check_perms = $this->getPermissionByEvent($event, $event_perm_mapping);
if ($check_perms === true) {
// event is defined in mapping but is not checked by permissions
return true;
}
$item_prefix = $this->Application->getUnitOption($top_prefix, 'PermItemPrefix');
foreach ($check_perms as $perm_name) {
// check if at least one of required permissions is set
if (!isset($perm_mapping[$perm_name])) {
// not mapped permission (e.g. advanced:approve) -> skip
continue;
}
$perm_name = $item_prefix.'.'.$perm_mapping[$perm_name];
$perm_status = $this->CheckPermission($perm_name, 0, $category_id);
if ($perm_status) {
return $perm_status;
}
}
if (!$perm_status) {
$event->SetRedirectParam('index_file', 'index.php'); // because called from browse.php
if ($this->Application->isDebugMode()) {
// for debugging purposes
$event->SetRedirectParam('section', $event->getSection());
$event->SetRedirectParam('main_prefix', $top_prefix);
$event->SetRedirectParam('event_name', $event->Name);
$event->SetRedirectParam('next_template', $this->Application->GetVar('t'));
}
$event->status = erPERM_FAIL;
}
return $perm_status;
}
/**
* Allows to check combined permissions (*.owner, *.pending) for add/modify/delete operations from admin & front-end
*
* @param kEvent $event
* @param int $owner_id
* @param int $category_id
* @param bool $new_item
* @return mixed
*/
function checkCombinedPermissions(&$event, $owner_id, $category_id, $new_item = false)
{
$ret = null; // true/false when used, null when not used
$top_prefix = $event->getEventParam('top_prefix');
// check admin permission
if (substr($event->Name, 0, 9) == 'OnPreSave') {
if ($new_item) {
$ret = $this->AddCheckPermission($category_id, $top_prefix);
}
else {
// add & modify because $new_item is false, when item is aready created & then saved in temp table (even with 0 id)
$ret = $this->AddCheckPermission($category_id, $top_prefix) ||
$this->ModifyCheckPermission($owner_id, $category_id, $top_prefix);
}
}
// check front-end permissions
switch ($event->Name) {
case 'OnCreate':
$ret = $this->AddCheckPermission($category_id, $top_prefix);
break;
case 'OnUpdate':
$ret = $this->ModifyCheckPermission($owner_id, $category_id, $top_prefix);
break;
case 'OnDelete':
case 'OnMassDelete':
$ret = $this->DeleteCheckPermission($owner_id, $category_id, $top_prefix);
break;
}
if ($ret === 0) {
// permission check failed (user has no permission)
$event->status = erPERM_FAIL;
}
return $ret;
}
function TagPermissionCheck($params, $is_owner = false)
{
$perm_prefix = getArrayValue($params, 'perm_prefix');
$perm_event = getArrayValue($params, 'perm_event');
$permission_groups = getArrayValue($params, 'permissions');
- if ($permission_groups) {
+ if ($permission_groups && !$perm_event) {
// check permissions by permission names in current category
$permission_groups = explode('|', $permission_groups);
$group_has_permission = false;
$perm_category = isset($params['cat_id']) ? $params['cat_id'] : $this->Application->GetVar('m_cat_id');
if ($perm_prefix) {
// use primary category of item with id from {perm_prefix}_id as base for permission checking
$perm_category = $this->getPrimaryCategory($perm_prefix);
}
$is_system = isset($params['system']) && $params['system'] ? 1 : 0;
foreach ($permission_groups as $permission_group) {
$permissions = explode(',', $permission_group);
$has_permission = true;
foreach ($permissions as $permission) {
$owner_checked = (strpos($permission, '.OWNER.') !== false) ? $is_owner : true;
$has_permission = $has_permission && $this->CheckPermission($permission, $is_system, $perm_category) && $owner_checked;
}
$group_has_permission = $group_has_permission || $has_permission;
if ($group_has_permission) {
return true;
}
}
return false;
}
elseif ($perm_event) {
// check permission by event name
- list($prefix, $event) = explode(':', $perm_event);
+ list ($prefix, $event) = explode(':', $perm_event);
$event_handler =& $this->Application->recallObject($prefix.'_EventHandler');
return $event_handler->CheckPermission( new kEvent($perm_event) );
}
return true;
}
/**
* Returns item's primary category (get item_id from request)
*
* @param string $prefix
* @return int
*/
function getPrimaryCategory($prefix)
{
$id_field = $this->Application->getUnitOption($prefix, 'IDField');
$table_name = $this->Application->getUnitOption($prefix, 'TableName');
$id = $this->Application->GetVar($prefix.'_id');
if (!$id) return $this->Application->GetVar('m_cat_id');
$sql = 'SELECT ResourceId
FROM '.$table_name.'
WHERE '.$id_field.' = '.$id;
$resource_id = $this->Conn->GetOne($sql);
$sql = 'SELECT CategoryId
FROM '.$this->Application->getUnitOption('ci', 'TableName').'
WHERE ItemResourceId = '.$resource_id.' AND PrimaryCat = 1';
return $this->Conn->GetOne($sql);
}
/**
* Returns no permission template to redirect to
*
* @param Array $params
* @return Array
*/
function getPermissionTemplate($params)
{
$t = $this->Application->GetVar('t');
if ($next_t = getArrayValue($params, 'next_template')) {
$t = $next_t;
}
$redirect_params = $this->Application->HttpQuery->getRedirectParams();
$redirect_params['lang_mode'] = '';
$redirect_params['m_wid'] = '';
if (array_key_exists('pass_category', $params)) {
$redirect_params['pass_category'] = $params['pass_cateogry'];
}
if (!$this->Application->LoggedIn()) {
$redirect_template = $params['login_template'];
if (!$redirect_template && $this->Application->IsAdmin()) {
$redirect_template = 'login';
}
$redirect_params['next_template'] = $t;
}
else {
if (isset($params['no_permissions_template'])) {
$redirect_template = $params['no_permissions_template'];
}
else {
$redirect_template = $this->Application->IsAdmin() ? 'no_permission' : $this->Application->ConfigValue('NoPermissionTemplate');
}
if ($this->Application->isDebugMode()) {
$redirect_params['from_template'] = 1;
$redirect_params['perms'] = $params[ isset($params['permissions']) ? 'permissions' : 'perm_event' ];
$redirect_params['next_template'] = $t;
}
}
if (isset($params['index_file']) && $params['index_file']) {
$redirect_params['index_file'] = $params['index_file'];
}
return Array($redirect_template, $redirect_params);
}
/**
* Check current user permissions based on it's group permissions in specified category (for non-system permissions) or just checks if system permission is set
*
* @param string $name permission name
* @param int $cat_id category id, current used if not specified
* @param int $type permission type {1 - system, 0 - per category}
* @return int
*/
function CheckPermission($name, $type = 1, $cat_id = null)
{
$user_id = $this->Application->RecallVar('user_id');
return $this->CheckUserPermission($user_id, $name, $type, $cat_id);
}
function CheckUserPermission($user_id, $name, $type = 1, $cat_id = null)
{
if ($user_id == -1) {
// "root" is allowed anywhere
return $name == 'SYSTEM_ACCESS.READONLY' ? 0 : 1;
}
if ($type == 1) {
// "system" permission are always checked per "Home" category (ID = 0)
$cat_id = 0;
}
if (!isset($cat_id)) {
$cat_id = $this->Application->GetVar('m_cat_id');
}
$cache_key = $name.'|'.$type.'|'.$cat_id;
$perm_value = $this->Application->getCache('permissions', $cache_key);
if ($perm_value !== false) {
return $perm_value;
}
// perm cache is build only based on records in db, that's why if permission is not explicitly denied, then
// that (perm cache creator) code thinks that it is allowed & adds corresponding record and code below will
// return incorrect results
if ($user_id == $this->Application->RecallVar('user_id')) {
$groups = explode(',', $this->Application->RecallVar('UserGroups'));
}
else { // checking not current user
$sql = 'SELECT GroupId
FROM '.TABLE_PREFIX.'UserGroup
WHERE (PortalUserId = '.$user_id.') AND ( (MembershipExpires IS NULL) OR ( MembershipExpires >= UNIX_TIMESTAMP() ) )';
$groups = $this->Conn->GetCol($sql);
array_push($groups, $this->Application->ConfigValue('User_LoggedInGroup') );
}
if (preg_match('/(.*)\.VIEW$/', $name) && ($type == 0)) {
// cached view permission of category: begin
if (strpos($cat_id, '|') !== false) {
$category_path = explode('|', substr($cat_id, 1, -1));
$cat_id = end($category_path);
}
$sql = 'SELECT PermissionConfigId
FROM '.TABLE_PREFIX.'PermissionConfig
WHERE PermissionName = '.$this->Conn->qstr($name);
$perm_id = $this->Conn->GetOne($sql);
$sql = 'SELECT PermId
FROM '.TABLE_PREFIX.'PermCache
WHERE (PermId = '.$perm_id.') AND (CategoryId = '.$cat_id.')';
$view_filters = Array();
foreach ($groups as $group) {
$view_filters[] = 'FIND_IN_SET('.$group.', ACL)';
}
$sql .= ' AND ('.implode(' OR ', $view_filters).')';
$perm_value = $this->Conn->GetOne($sql) ? 1 : 0;
$this->Application->setCache('permissions', $cache_key, $perm_value);
return $perm_value;
// cached view permission of category: end
}
if (is_numeric($cat_id) && $cat_id == 0) {
$cat_hierarchy = Array(0);
}
else {
if (strpos($cat_id, '|') !== false) {
$cat_hierarchy = $cat_id;
}
else {
$sql = 'SELECT ParentPath
FROM '.$this->Application->getUnitOption('c', 'TableName').'
WHERE CategoryId = '.$cat_id;
$cat_hierarchy = $this->Conn->GetOne($sql);
+ if ($cat_hierarchy === false) {
+ // category was deleted, but refrence to it stays in other tables -> data integrity is broken
+ $cat_hierarchy = '|' . $this->Application->findModule('Name', 'Proj-CMS', 'RootCat') . '|';
+ }
}
$cat_hierarchy = explode('|', substr($cat_hierarchy, 1, -1));
$cat_hierarchy = array_reverse($cat_hierarchy);
array_push($cat_hierarchy, 0);
}
$perm_value = 0;
$groups = implode(',',$groups);
foreach ($cat_hierarchy as $category_id) {
$sql = 'SELECT SUM(PermissionValue)
FROM '.TABLE_PREFIX.'Permissions
WHERE Permission = "'.$name.'" AND CatId = '.$category_id.' AND GroupId IN ('.$groups.') AND Type = '.$type;
$res = $this->Conn->GetOne($sql);
if ($res !== false && !is_null($res)) {
$perm_value = $res ? 1 : 0;
break;
}
}
$this->Application->setCache('permissions', $cache_key, $perm_value);
return $perm_value;
}
/**
* Allows to check MODIFY & OWNER.MODFY +/- PENDING permission combinations on item
*
* @param int $owner_id user_id, that is owner of the item
* @param int $category_id primary category of item
* @param string $prefix prefix of item
* @return int {0 - no MODIFY permission, 1 - has MODIFY permission, 2 - has MODIFY.PENDING permission}
*/
function ModifyCheckPermission($owner_id, $category_id, $prefix)
{
$perm_prefix = $this->Application->getUnitOption($prefix, 'PermItemPrefix');
$live_modify = $this->CheckPermission($perm_prefix.'.MODIFY', ptCATEGORY, $category_id);
if ($live_modify) {
return 1;
}
else if ($this->CheckPermission($perm_prefix.'.MODIFY.PENDING', ptCATEGORY, $category_id)) {
return 2;
}
if ($owner_id == $this->Application->RecallVar('user_id')) {
// user is item's OWNER -> check this permissions first
$live_modify = $this->CheckPermission($perm_prefix.'.OWNER.MODIFY', ptCATEGORY, $category_id);
if ($live_modify) {
return 1;
}
else if ($this->CheckPermission($perm_prefix.'.OWNER.MODIFY.PENDING', ptCATEGORY, $category_id)) {
return 2;
}
}
return 0;
}
/**
* Allows to check DELETE & OWNER.DELETE permission combinations on item
*
* @param int $owner_id user_id, that is owner of the item
* @param int $category_id primary category of item
* @param string $prefix prefix of item
* @return int {0 - no DELETE permission, 1 - has DELETE/OWNER.DELETE permission}
*/
function DeleteCheckPermission($owner_id, $category_id, $prefix)
{
$perm_prefix = $this->Application->getUnitOption($prefix, 'PermItemPrefix');
$live_delete = $this->CheckPermission($perm_prefix.'.DELETE', ptCATEGORY, $category_id);
if ($live_delete) {
return 1;
}
if ($owner_id == $this->Application->RecallVar('user_id')) {
// user is item's OWNER -> check this permissions first
$live_delete = $this->CheckPermission($perm_prefix.'.OWNER.DELETE', ptCATEGORY, $category_id);
if ($live_delete) {
return 1;
}
}
return 0;
}
/**
* Allows to check ADD +/- PENDING permission combinations on item
*
* @param int $category_id primary category of item
* @param string $prefix prefix of item
* @return int {0 - no ADD permission, 1 - has ADD permission, 2 - has ADD.PENDING permission}
*/
function AddCheckPermission($category_id, $prefix)
{
$perm_prefix = $this->Application->getUnitOption($prefix, 'PermItemPrefix');
$live_add = $this->CheckPermission($perm_prefix.'.ADD', ptCATEGORY, $category_id);
if ($live_add) {
return 1;
}
else if ($this->CheckPermission($perm_prefix.'.ADD.PENDING', ptCATEGORY, $category_id)) {
return 2;
}
return 0;
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/general/helpers/permissions_helper.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.32.2.4
\ No newline at end of property
+1.32.2.5
\ No newline at end of property
Index: branches/RC/core/units/general/helpers/category_helper.php
===================================================================
--- branches/RC/core/units/general/helpers/category_helper.php (revision 11537)
+++ branches/RC/core/units/general/helpers/category_helper.php (revision 11538)
@@ -1,252 +1,253 @@
<?php
class CategoryHelper extends kHelper {
function NavigationBar($params)
{
$main_category_id = isset($params['cat_id']) ? $params['cat_id'] : $this->Application->GetVar('m_cat_id');
$home_element = $this->getHomeCategoryPath($params, $main_category_id);
if (!getArrayValue($params, 'titles') && !getArrayValue($params, 'templates')) {
// no static templates given, show only category path
return $home_element . $this->getCategoryPath($main_category_id, $params);
}
$navigation_parts = $this->getNavigationParts($params['titles'], $params['templates']);
$ret = '';
$block_params = Array (); //$params; // sort of TagProcessor:prepareTagParams
$block_params['no_editing'] = 1;
$block_params['category'] = 0;
$block_params['separator'] = $params['separator'];
$current_template = $this->Application->GetVar('t');
$show_category = getArrayValue($params, 'show_category');
foreach ($navigation_parts as $template => $title) {
$block_params['template'] = $template;
if ($title == '__item__') {
if ($show_category) {
$ret .= $this->getCategoryPath($main_category_id, $params);
$show_category = false;
}
$category_path = $this->getCategoryParentPath($main_category_id);
$module_info = $this->getCategoryModule($params, array_keys($category_path));
if (!$module_info) {
continue;
}
$module_prefix = $module_info['Var'];
$object =& $this->Application->recallObject($module_prefix);
/* @var $object kCatDBItem */
$title_field = $this->Application->getUnitOption($module_prefix, 'TitleField');
$block_params['title'] = $object->GetField($title_field);
$block_params['prefix'] = $module_prefix;
$block_params['current'] = 0;
$block_params['name'] = $this->SelectParam($params, 'module_item_render_as,render_as');
}
else {
$block_params['current'] = ($template == $current_template);
$block_params['title'] = $this->Application->Phrase($title);
$block_params['name'] = $template == $current_template ? $params['current_render_as'] : $params['render_as'];
}
$ret .= $this->Application->ParseBlock($block_params);
}
if ($show_category) {
$params['no_current'] = true;
return $home_element . ($show_category ? $this->getCategoryPath($main_category_id, $params) : '') . $ret;
}
return $home_element . $ret;
}
/**
* Get navigation parts
*
* @param Array $titles
* @param Array $templates
* @return Array
*/
function getNavigationParts($titles, $templates)
{
$titles = explode(',', $titles);
$templates = explode(',', $templates);
$ret = Array ();
foreach ($templates as $template_pos => $template) {
$ret[$template] = $titles[$template_pos];
}
return $ret;
}
function getCategoryPath($main_category_id, $params)
{
$category_path = $this->getCategoryParentPath($main_category_id);
if (!$category_path) {
// in "Home" category
return '';
}
$module_info = $this->getCategoryModule($params, array_keys($category_path));
$module_category_id = $module_info['RootCat'];
$module_item_id = $this->Application->GetVar($module_info['Var'].'_id');
$ret = '';
$block_params['category'] = 1;
$block_params['separator'] = $params['separator'];
$no_current = isset($params['no_current']) && $params['no_current'];
$backup_category_id = $this->Application->GetVar('c_id');
foreach ($category_path as $category_id => $category_name) {
$block_params['cat_id'] = $category_id;
$block_params['cat_name'] = $block_params['title'] = $category_name;
if ($no_current) {
$block_params['current'] = 0;
}
else {
$block_params['current'] = ($main_category_id == $category_id) && !$module_item_id ? 1 : 0;
}
$block_params['is_module_root'] = $category_id == $module_category_id ? 1 : 0;
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
// which block to parse as current ?
if ($block_params['is_module_root']) {
$block_params['name'] = $this->SelectParam($params, 'module_root_render_as,render_as');
$block_params['module_index'] = $module_info['TemplatePath'].'index';
}
if ($block_params['current']) {
$block_params['name'] = $this->SelectParam($params, 'current_render_as,render_as');
}
$this->Application->SetVar('c_id', $category_id);
- $ret .= $this->Application->ParseBlock($block_params, 1);
+ $ret .= $this->Application->ParseBlock($block_params);
}
$this->Application->SetVar('c_id', $backup_category_id);
return $ret;
}
/**
* Returns module information based on given module name or current category (relative to module root categories)
*
* @param Array $params
* @param Array $category_ids category parent path (already as array)
* @return Array
*/
function getCategoryModule($params, $category_ids)
{
if (isset($params['module'])) {
// get module by name specified
$module_info = $this->Application->findModule('Name', $params['module']);
}
elseif ($category_ids) {
// get module by category path
$module_root_categories = $this->getModuleRootCategories();
$module_category_id = array_shift(array_intersect($category_ids, $module_root_categories));
$module_info = $this->Application->findModule('RootCat', $module_category_id);
}
return $module_info;
}
function getHomeCategoryPath($params, $current_category)
{
$block_params['cat_id'] = $this->Application->findModule('Name', 'Proj-CMS', 'RootCat'); // 0;
$block_params['no_editing'] = 1;
$block_params['current'] = $current_category == $block_params['cat_id'] ? 1 : 0;
+ $block_params['separator'] = $params['separator'];
$block_params['cat_name'] = $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params);
$block_params['name'] = $this->SelectParam($params, 'root_cat_render_as,render_as');
return $this->Application->ParseBlock($block_params);
}
function getModuleRootCategories()
{
static $root_categories = null;
if (!isset($root_categories)) {
$root_categories = Array ();
foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
array_push($root_categories, $module_info['RootCat']);
}
$root_categories = array_unique($root_categories);
}
return $root_categories;
}
function getCategoryParentPath($main_category_id)
{
static $cached_path = null;
if ($main_category_id == 0) {
// don't query path for "Home" category
return Array ();
}
if (!isset($cached_path[$main_category_id])) {
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$navbar_field = $ml_formatter->LangFieldName('CachedNavBar');
$id_field = $this->Application->getUnitOption('c', 'IDField');
$table_name = $this->Application->getUnitOption('c', 'TableName');
$sql = 'SELECT '.$navbar_field.', ParentPath
FROM '.$table_name.'
WHERE '.$id_field.' = '.$main_category_id;
$category_data = $this->Conn->GetRow($sql);
$skip_category = $this->Application->findModule('Name', 'Proj-CMS', 'RootCat');
$cached_path[$main_category_id] = Array ();
if ($category_data) {
$category_names = explode('&|&', $category_data[$navbar_field]);
$category_ids = explode('|', substr($category_data['ParentPath'], 1, -1));
foreach ($category_ids as $category_index => $category_id) {
if ($category_id == $skip_category) {
continue;
}
$cached_path[$main_category_id][$category_id] = $category_names[$category_index];
}
}
}
return $cached_path[$main_category_id];
}
/**
* Not tag, method for parameter
* selection from list in this TagProcessor
*
* @param Array $params
* @param string $possible_names
* @return string
* @access public
*/
function SelectParam($params, $possible_names)
{
if (!is_array($params)) return;
if (!is_array($possible_names))
$possible_names = explode(',', $possible_names);
foreach ($possible_names as $name)
{
if( isset($params[$name]) ) return $params[$name];
}
return false;
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/general/helpers/category_helper.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3.2.3
\ No newline at end of property
+1.3.2.4
\ No newline at end of property
Index: branches/RC/core/units/general/cat_tag_processor.php
===================================================================
--- branches/RC/core/units/general/cat_tag_processor.php (revision 11537)
+++ branches/RC/core/units/general/cat_tag_processor.php (revision 11538)
@@ -1,690 +1,691 @@
<?php
class kCatDBTagProcessor extends kDBTagProcessor {
/**
* Permission Helper
*
* @var kPermissionsHelper
*/
var $PermHelper = null;
function kCatDBTagProcessor()
{
parent::kDBTagProcessor();
$this->PermHelper = $this->Application->recallObject('PermissionsHelper');
}
function ItemIcon($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
$grids = $this->Application->getUnitOption($this->Prefix,'Grids');
$icons =& $grids[ $params['grid'] ]['Icons'];
$status_fields = $this->Application->getUnitOption($this->Prefix,'StatusField');
if (!$status_fields) return $icons['default'];
$value = $object->GetDBField($status_fields[0]); // sets base status icon
/* @var $object kDBItem */
if ($value == STATUS_ACTIVE) {
if( $object->HasField('IsPop') && $object->GetDBField('IsPop') ) $value = 'POP';
if( $object->HasField('IsHot') && $object->GetDBField('IsHot') ) $value = 'HOT';
if( $object->HasField('IsNew') && $object->GetDBField('IsNew') ) $value = 'NEW';
if( $object->HasField('EditorsPick') && $object->GetDBField('EditorsPick') ) $value = 'PICK';
}
return isset($icons[$value]) ? $icons[$value] : $icons['default'];
}
/**
* Allows to create valid mod-rewrite compatible link to module item
*
* @param Array $params
* @param string $id_prefix
* @return string
*/
function ItemLink($params, $id_prefix = null)
{
if (!isset($params['pass'])) {
$params['pass'] = 'm,'.$this->Prefix;
}
$item_id = isset($params[$id_prefix.'_id']) && $params[$id_prefix.'_id'];
if (!$item_id) {
$item_id = $this->Application->GetVar($this->getPrefixSpecial().'_id');
if (!$item_id) {
$item_id = $this->Application->GetVar($this->Prefix.'_id');
}
}
$params[$this->Prefix.'_id'] = $item_id;
$object =& $this->getObject($params);
$params['m_cat_id'] = $object->GetDBField('CategoryId');
$params['m_cat_page'] = 1;
$params['pass_category'] = 1;
return $this->Application->ProcessParsedTag('m', 't', $params);
}
function CategoryPath($params)
{
if ($this->Application->IsAdmin()) {
// path for module root category in admin
if (!isset($params['cat_id'])) {
$params['cat_id'] = $this->Application->RecallVar($params['session_var'], 0);
}
}
else {
// path for category item category in front-end
$object =& $this->getObject($params);
$params['cat_id'] = $object->GetDBField('CategoryId');
}
return $this->Application->ProcessParsedTag('c', 'CategoryPath', $params);
}
function BuildListSpecial($params)
{
if ($this->Special != '') return $this->Special;
if ( isset($params['parent_cat_id']) ) {
$parent_cat_id = $params['parent_cat_id'];
}
else {
$parent_cat_id = $this->Application->GetVar('c_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
}
$recursive = isset($params['recursive']);
$list_unique_key = $this->getUniqueListKey($params).$recursive;
if ($list_unique_key == '') {
return parent::BuildListSpecial($params);
}
return crc32($parent_cat_id.$list_unique_key);
}
function CatalogItemCount($params)
{
$object =& $this->GetList($params);
if (!$object->Counted) {
$object->CountRecs();
}
return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' / '.$object->NoFilterCount : $object->RecordsCount;
}
function ListReviews($params)
{
$prefix = $this->Prefix.'-rev';
$review_tag_processor =& $this->Application->recallObject($prefix.'.item_TagProcessor');
return $review_tag_processor->PrintList($params);
}
function ReviewCount($params)
{
$review_tag_processor =& $this->Application->recallObject('rev.item_TagProcessor');
return $review_tag_processor->TotalRecords($params);
}
function InitCatalogTab($params)
{
$tab_params['mode'] = $this->Application->GetVar('tm'); // single/multi selection possible
$tab_params['special'] = $this->Application->GetVar('ts'); // use special for this tab
$tab_params['dependant'] = $this->Application->GetVar('td'); // is grid dependant on categories grid
// set default params (same as in catalog)
if ($tab_params['mode'] === false) $tab_params['mode'] = 'multi';
if ($tab_params['special'] === false) $tab_params['special'] = '';
if ($tab_params['dependant'] === false) $tab_params['dependant'] = 'yes';
// pass params to block with tab content
$params['name'] = $params['render_as'];
$params['prefix'] = trim($this->Prefix.'.'.($tab_params['special'] ? $tab_params['special'] : $this->Special), '.');
$prefix_append = $this->Application->GetVar('prefix_append');
if ($prefix_append) {
$params['prefix'] .= $prefix_append;
}
$default_grid = array_key_exists('default_grid', $params) ? $params['default_grid'] : 'Default';
$radio_grid = array_key_exists('radio_grid', $params) ? $params['radio_grid'] : 'Radio';
$params['cat_prefix'] = trim('c.'.($tab_params['special'] ? $tab_params['special'] : $this->Special), '.');
$params['tab_mode'] = $tab_params['mode'];
$params['grid_name'] = ($tab_params['mode'] == 'multi') ? $default_grid : $radio_grid;
$params['tab_dependant'] = $tab_params['dependant'];
$params['show_category'] = $tab_params['special'] == 'showall' ? 1 : 0; // this is advanced view -> show category name
return $this->Application->ParseBlock($params, 1);
}
/**
* Show CachedNavbar of current item primary category
*
* @param Array $params
* @return string
*/
function CategoryName($params)
{
// show category cachednavbar of
$object =& $this->getObject($params);
$category_id = isset($params['cat_id']) ? $params['cat_id'] : $object->GetDBField('CategoryId');
$category_path = $this->Application->getCache('category_paths', $category_id);
if ($category_path === false) {
// not chached
if ($category_id > 0) {
- $category_path = trim($this->CategoryName( Array('cat_id' => 0) ).' > '.str_replace('&|&', ' > ', $object->GetDBField('CachedNavbar')), ' > ');
+ $cached_navbar = preg_replace('/^Content&\|&/i', '', $object->GetField('CachedNavbar'));
+ $category_path = trim($this->CategoryName( Array('cat_id' => 0) ).' > '.str_replace('&|&', ' > ', $cached_navbar), ' > ');
}
else {
$category_path = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') );
}
$this->Application->setCache('category_paths', $category_id, $category_path);
}
return $category_path;
}
/**
* Allows to determine if original value should be shown
*
* @param Array $params
* @return bool
*/
function DisplayOriginal($params)
{
// original id found & greather then zero + show original
$display_original = isset($params['display_original']) && $params['display_original'];
$owner_field = $this->Application->getUnitOption($this->Prefix, 'OwnerField');
if (!$owner_field) {
$owner_field = 'CreatedById';
}
$object =& $this->getObject($params);
$perm_value = $this->PermHelper->ModifyCheckPermission($object->GetDBField($owner_field), $object->GetDBField('CategoryId'), $this->Prefix);
return $display_original && ($perm_value == 1) && $this->Application->GetVar($this->Prefix.'.original_id');
}
/**
* Checks if user have one of required permissions
*
* @param Array $params
* @return bool
*/
function HasPermission($params)
{
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
$params['raise_warnings'] = 0;
$object =& $this->getObject($params);
/* @var $object kCatDBItem */
// 1. category restriction
$params['cat_id'] = $object->isLoaded() ? $object->GetDBField('ParentPath') : $this->Application->GetVar('m_cat_id');
// 2. owner restriction
$owner_field = $this->Application->getUnitOption($this->Prefix, 'OwnerField');
if (!$owner_field) {
$owner_field = 'CreatedById';
}
$is_owner = $object->GetDBField($owner_field) == $this->Application->RecallVar('user_id');
return $perm_helper->TagPermissionCheck($params, $is_owner);
}
/**
* Creates link to current category or to module root category, when current category is home
*
* @param Array $params
* @return string
*/
function SuggestItemLink($params)
{
if (!isset($params['cat_id'])) {
$params['cat_id'] = $this->Application->GetVar('m_cat_id');
}
if ($params['cat_id'] == 0) {
$params['cat_id'] = $this->Application->findModule('Var', $this->Prefix, 'RootCat');
}
$params['m_cat_page'] = 1;
return $this->Application->ProcessParsedTag('c', 'CategoryLink', $params);
}
/**
* Allows to detect if item has any additional images available
*
* @param Array $params
* @return string
*/
function HasAdditionalImages($params)
{
$object =& $this->getObject($params);
$sql = 'SELECT ImageId
FROM '.$this->Application->getUnitOption('img', 'TableName').'
WHERE ResourceId = '.$object->GetDBField('ResourceId').' AND DefaultImg != 1 AND Enabled = 1';
return $this->Conn->GetOne($sql) ? 1 : 0;
}
/**
* Checks that item is pending
*
* @param Array $params
* @return bool
*/
function IsPending($params)
{
$object =& $this->getObject($params);
$pending_status = Array (STATUS_PENDING, STATUS_PENDING_EDITING);
return in_array($object->GetDBField('Status'), $pending_status);
}
function IsFavorite($params)
{
static $favorite_status = Array ();
$object =& $this->getObject($params);
/* @var $object kDBList */
if (!isset($favorite_status[$this->Special])) {
$resource_ids = $object->GetCol('ResourceId');
$user_id = $this->Application->RecallVar('user_id');
$sql = 'SELECT FavoriteId, ResourceId
FROM '.$this->Application->getUnitOption('fav', 'TableName').'
WHERE (PortalUserId = '.$user_id.') AND (ResourceId IN ('.implode(',', $resource_ids).'))';
$favorite_status[$this->Special] = $this->Conn->GetCol($sql, 'ResourceId');
}
return isset($favorite_status[$this->Special][$object->GetDBField('ResourceId')]);
}
/**
* Returns item's editors pick status (using not formatted value)
*
* @param Array $params
* @return bool
*/
function IsEditorsPick($params)
{
$object =& $this->getObject($params);
return $object->GetDBField('EditorsPick') == 1;
}
function FavoriteToggleLink($params)
{
$fav_prefix = $this->Prefix.'-fav';
$params['pass'] = implode(',', Array('m', $this->Prefix, $fav_prefix));
$params[$fav_prefix.'_event'] = 'OnFavoriteToggle';
return $this->ItemLink($params);
}
/**
* Checks if item is passed in url
*
* @param Array $params
* @return bool
*/
function ItemAvailable($params)
{
return $this->Application->GetVar($this->getPrefixSpecial().'_id') > 0;
}
function SortingSelected($params)
{
$list =& $this->GetList($params);
$user_sorting_start = $this->getUserSortIndex();
$sorting_field = $list->GetOrderField($user_sorting_start);
$sorting = strtolower($sorting_field . '|' . $list->GetOrderDirection($user_sorting_start));
$field_options = $list->GetFieldOptions($sorting_field);
if (array_key_exists('formatter', $field_options) && $field_options['formatter'] == 'kMultiLanguage') {
// remove language prefix
$sorting = preg_replace('/^l[\d]+_(.*)/', '\\1', $sorting);
$params['sorting'] = preg_replace('/^l[\d]+_(.*)/', '\\1', $params['sorting']);
}
return $sorting == strtolower($params['sorting']) ? $params['selected'] : '';
}
function CombinedSortingDropDownName($params)
{
return $this->Prefix.'_CombinedSorting';
}
/**
* Prepares name for field with event in it (used only on front-end)
*
* @param Array $params
* @return string
*/
function SubmitName($params)
{
return 'events['.$this->Prefix.']['.$params['event'].']';
}
/**
* Returns prefix + any word (used for shared between categories per page settings)
*
* @param Array $params
* @return string
*/
function VarName($params)
{
return $this->Prefix.'_'.$params['type'];
}
/**
* Checks if we are viewing module root category
*
* @param Array $params
* @return bool
*/
function IsModuleHome($params)
{
$root_category = $this->Application->findModule('Var', $this->Prefix, 'RootCat');
return $root_category == $this->Application->GetVar('m_cat_id');
}
/**
* Dynamic votes indicator
*
* @param Array $params
*
* @return string
*/
function VotesIndicator($params)
{
$object =& $this->getObject($params);
/* @var $object kDBItem */
$rating_helper =& $this->Application->recallObject('RatingHelper');
/* @var $rating_helper RatingHelper */
$small_style = array_key_exists('small_style', $params) ? $params['small_style'] : false;
return $rating_helper->ratingBar($object, true, '', $small_style);
}
function RelevanceIndicator($params)
{
$object =& $this->getObject($params);
$search_results_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$sql = 'SELECT Relevance
FROM '.$search_results_table.'
WHERE ResourceId = '.$object->GetDBField('ResourceId');
$percents_off = (int)(100 - (100 * $this->Conn->GetOne($sql)));
$percents_off = ($percents_off < 0) ? 0 : $percents_off;
if ($percents_off) {
$params['percent_off'] = $percents_off;
$params['percent_on'] = 100 - $percents_off;
$params['name'] = $this->SelectParam($params, 'relevance_normal_render_as,block_relevance_normal');
}
else {
$params['name'] = $this->SelectParam($params, 'relevance_full_render_as,block_relevance_full');
}
return $this->Application->ParseBlock($params);
}
function SearchResultField($params)
{
$ret = $this->Field($params);
$keywords = unserialize( $this->Application->RecallVar('highlight_keywords') );
$opening = $this->Application->ParseBlock( Array('name' => $this->SelectParam($params, 'highlight_opening_render_as,block_highlight_opening')) );
$closing = $this->Application->ParseBlock( Array('name' => $this->SelectParam($params, 'highlight_closing_render_as,block_highlight_closing')) );
foreach ($keywords as $index => $keyword) {
$keywords[$index] = preg_quote($keyword, '/');
}
return preg_replace('/('.implode('|', $keywords).')/i', $opening.'\\1'.$closing, $ret);
}
/**
* Shows keywords, that user searched
*
* @param Array $params
* @return bool
*/
function SearchKeywords($params)
{
$keywords = $this->Application->GetVar('keywords');
$sub_search = $this->Application->GetVar('search_type') == 'subsearch';
return ($keywords !== false) && !$sub_search ? $keywords : $this->Application->RecallVar('keywords');
}
function AdvancedSearchForm($params)
{
$search_table = $this->Application->getUnitOption('confs', 'TableName');
$module_name = $this->Application->findModule('Var', $this->Prefix, 'Name');
$sql = 'SELECT *
FROM '.$search_table.'
WHERE (ModuleName = '.$this->Conn->qstr($module_name).') AND (AdvancedSearch = 1)
ORDER BY DisplayOrder';
$search_config = $this->Conn->Query($sql);
$ret = '';
foreach ($search_config as $record) {
$params['name'] = $this->SelectParam($params, 'and_or_render_as,and_or_block');
$params['field'] = $record['FieldName'];
$params['andor'] = $this->Application->ParseBlock($params);
$params['name'] = $this->SelectParam($params, $record['FieldType'].'_render_as,'.$record['FieldType'].'_block');
$params['caption'] = $this->Application->Phrase($record['DisplayName']);
$ret .= $this->Application->ParseBlock($params);
}
return $ret;
}
/**
* Returns last modification date of items in category / system
*
* @param Array $params
* @return string
*/
function LastUpdated($params)
{
$category_id = $this->Application->GetVar('m_cat_id');
$table_name = $this->Application->getUnitOption($this->Prefix, 'TableName');
if (isset($params['local']) && $params['local'] && $category_id > 0) {
// scan only current category & it's children
$sql = 'SELECT TreeLeft, TreeRight
FROM '.TABLE_PREFIX.'Category
WHERE CategoryId = '.$category_id;
$tree_info = $this->Conn->GetRow($sql);
$sql = 'SELECT MAX(item_table.Modified) AS ModDate, MAX(item_table.CreatedOn) AS NewDate
FROM '.$table_name.' item_table
LEFT JOIN '.TABLE_PREFIX.'CategoryItems ci ON (item_table.ResourceId = ci.ItemResourceId)
LEFT JOIN '.TABLE_PREFIX.'Category c ON c.CategoryId = ci.CategoryId
WHERE c.TreeLeft BETWEEN '.$tree_info['TreeLeft'].' AND '.$tree_info['TreeRight'];
}
else {
// scan all categories in system
$sql = 'SELECT MAX(Modified) AS ModDate, MAX(CreatedOn) AS NewDate
FROM '.$table_name;
}
$row_data = $this->Conn->GetRow($sql);
if (!$row_data) {
return '';
}
$date = $row_data[ $row_data['NewDate'] > $row_data['ModDate'] ? 'NewDate' : 'ModDate' ];
// format date
$format = isset($params['format']) ? $params['format'] : '_regional_DateTimeFormat';
if (preg_match("/_regional_(.*)/", $format, $regs)) {
$lang =& $this->Application->recallObject('lang.current');
if ($regs[1] == 'DateTimeFormat') {
// combined format
$format = $lang->GetDBField('DateFormat').' '.$lang->GetDBField('TimeFormat');
}
else {
// simple format
$format = $lang->GetDBField($regs[1]);
}
}
return adodb_date($format, $date);
}
/**
* Counts category item count in system (not category-dependent)
*
* @param Array $params
* @return int
*/
function ItemCount($params)
{
$count_helper =& $this->Application->recallObject('CountHelper');
/* @var $count_helper kCountHelper */
$today_only = isset($params['today']) && $params['today'];
return $count_helper->ItemCount($this->Prefix, $today_only);
}
function CategorySelector($params)
{
$category_id = isset($params['category_id']) && is_numeric($params['category_id']) ? $params['category_id'] : false;
if ($category_id === false) {
// if category id not given use module root category
$category_id = $this->Application->findModule('Var', $this->Prefix, 'RootCat');
}
$id_field = $this->Application->getUnitOption('c', 'IDField');
$title_field = $this->Application->getUnitOption('c', 'TitleField');
$table_name = $this->Application->getUnitOption('c', 'TableName');
$count_helper =& $this->Application->recallObject('CountHelper');
/* @var $count_helper kCountHelper */
list ($view_perm, $view_filter) = $count_helper->GetPermissionClause('c', 'perm_cache');
// get category list (permission based)
$sql = 'SELECT c.'.$title_field.', c.'.$id_field.'
FROM '.$table_name.' c
INNER JOIN '.TABLE_PREFIX.'PermCache perm_cache ON c.CategoryId = perm_cache.CategoryId
WHERE (ParentId = '.$category_id.') AND ('.$view_filter.') AND (perm_cache.PermId = '.$view_perm.') AND (c.Status = '.STATUS_ACTIVE.')
ORDER BY c.'.$title_field.' ASC';
$categories = $this->Conn->GetCol($sql, $id_field);
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
$block_params['strip_nl'] = 2;
$ret = '';
foreach ($categories as $category_id => $category_name) {
// print category
$block_params['separator'] = isset($params['category_id']) ? $params['separator'] : ''; // return original separator, remove separator for top level categories
$block_params['category_id'] = $category_id;
$block_params['category_name'] = $category_name;
$ret .= $this->Application->ParseBlock($block_params);
// print it's children
$block_params['separator'] = '&nbsp;&nbsp;&nbsp;'.$params['separator'];
$ret .= $this->CategorySelector($block_params);
}
return $ret;
}
function PrintMoreCategories($params)
{
$object =& $this->getObject();
/* @var $object kDBItem */
$category_ids = $this->Field($params);
if (!$category_ids) {
return '';
}
$category_ids = explode('|', substr($category_ids, 1, -1));
$id_field = $this->Application->getUnitOption('c', 'IDField');
$title_field = $this->Application->getUnitOption('c', 'TitleField');
$table_name = $this->Application->getUnitOption('c', 'TableName');
$sql = 'SELECT '.$title_field.', '.$id_field.'
FROM '.$table_name.'
WHERE '.$id_field.' IN ('.implode(',', $category_ids).')';
$categories = $this->Conn->GetCol($sql, $id_field);
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
$ret = '';
foreach ($categories as $category_id => $category_name) {
$block_params['category_id'] = $category_id;
$block_params['category_name'] = $category_name;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
function DownloadFileLink($params)
{
$params[$this->getPrefixSpecial().'_event'] = 'OnDownloadFile';
return $this->ItemLink($params);
}
function ImageSrc($params)
{
list ($ret, $tag_processed) = $this->processAggregatedTag('ImageSrc', $params, $this->getPrefixSpecial());
return $tag_processed ? $ret : false;
}
/**
* Registers hit for item (one time per session)
*
* @param Array $params
*/
function RegisterHit($params)
{
$object =& $this->getObject();
/* @var $object kCatDBItem */
if ($object->isLoaded()) {
$object->RegisterHit();
}
}
/**
* Returns link to item's author public profile
*
* @param Array $params
* @return string
*/
function ProfileLink($params)
{
$object =& $this->getObject($params);
$owner_field = array_key_exists('owner_field', $params) ? $params['owner_field'] : 'CreatedById';
$params['user_id'] = $object->GetDBField($owner_field);
unset($params['owner_field']);
return $this->Application->ProcessParsedTag('m', 'Link', $params);
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/general/cat_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.38.2.22
\ No newline at end of property
+1.38.2.23
\ No newline at end of property
Index: branches/RC/core/units/general/main_event_handler.php
===================================================================
--- branches/RC/core/units/general/main_event_handler.php (revision 11537)
+++ branches/RC/core/units/general/main_event_handler.php (revision 11538)
@@ -1,144 +1,147 @@
<?php
class MainEventHandler extends kEventHandler {
/**
* Description
*
* @var kDBConnection
* @access public
*/
var $Conn;
/**
* Adds ability to address db connection
*
* @return kDBEventHandler
* @access public
*/
function MainEventHandler()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
/**
* Created url part for this module
*
* @param kEvent $event
*/
function BuildEnv(&$event)
{
$prefix_special = $event->getPrefixSpecial();
$url_params = $event->getEventParam('url_params');
$query_vars = $this->Application->getUnitOption($event->Prefix, 'QueryString');
//if pass events is off and event is not implicity passed
if ( !$event->getEventParam('pass_events') && !isset($url_params[$prefix_special.'_event']) )
{
$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 = '';
$default_language_id = $this->Application->GetDefaultLanguageId();
if( $processed_params['m_lang'] && ($processed_params['m_lang'] != $default_language_id) )
{
$language_name = $this->Application->getCache('language_names', $processed_params['m_lang']);
if ($language_name === false) {
$sql = 'SELECT PackName
FROM '.TABLE_PREFIX.'Language
WHERE LanguageId = '.$processed_params['m_lang'];
$language_name = $this->Conn->GetOne($sql);
$this->Application->setCache('language_names', $processed_params['m_lang'], $language_name);
}
$ret .= $language_name.'/';
}
$default_theme_id = $this->Application->GetDefaultThemeId();
if( $processed_params['m_theme'] && ($processed_params['m_theme'] != $default_theme_id) )
{
$theme_name = $this->Application->getCache('theme_names', $processed_params['m_theme']);
if ($theme_name === false) {
$sql = 'SELECT Name
FROM '.TABLE_PREFIX.'Theme
WHERE ThemeId = '.$processed_params['m_theme'];
$theme_name = $this->Conn->GetOne($sql);
$this->Application->setCache('theme_names', $processed_params['m_theme'], $theme_name);
}
$ret .= $theme_name.'/';
}
if ($processed_params['m_cat_id'] > 0 && isset($url_params['pass_category']) && $url_params['pass_category']) {
$category_filename = $this->Application->getFilename('c', $processed_params['m_cat_id']);
$t = isset($url_params['t']) && $url_params['t'] ? $url_params['t'] : false;
// we could have category path like "Content/<template_path>" in this case remove template (proj-cms trick)
preg_match('/^Content\/(.*)/i', $category_filename, $regs);
- if ($regs && (strtolower($regs[1]) == strtolower($t))) {
- $url_params['t'] = '';
- }
- $ret .= $regs[1] . '/';
+ if ($regs) {
+ if (strtolower($regs[1]) == strtolower($t)) {
+ $url_params['t'] = '';
+ }
+
+ $ret .= $regs[1] . '/';
+ }
$url_params['category_processed'] = true;
}
else {
// $url_params['no_category'] = 1; // for debugging
}
unset($url_params['pass_category']); // unset it just in case
$force_page_adding = false;
if (getArrayValue($url_params, 'reset'))
{
unset($url_params['reset']);
if ($processed_params['m_cat_id'])
{
$processed_params['m_cat_page'] = 1;
$force_page_adding = true;
}
}
if( (array_key_exists('category_processed', $url_params) && $url_params['category_processed'] && ($processed_params['m_cat_page'] > 1)) || $force_page_adding ) {
// category page number found & category name was added before
$ret = preg_replace('/(.*)\//', '\\1', $ret).'_'.$processed_params['m_cat_page'].'/';
}
$template = getArrayValue($url_params, 't');
$category_template = $processed_params['m_cat_id'] ? $this->Application->getCache('category_templates', $processed_params['m_cat_id']) : '';
if ((strtolower($template) == '__default__') && ($processed_params['m_cat_id'] == 0)) {
// for "Home" category set template to index when not set
$template = 'index';
}
// remove template from url if it is category index cached template
if ($template == $category_template || mb_strtolower($template) == '__default__') {
$template = '';
}
if ($template) {
$ret .= $template.'/';
}
unset($url_params['t']);
$event->setEventParam('url_params', $url_params);
$event->setEventParam('env_string', mb_strtolower($ret) );
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/general/main_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.17.2.4
\ No newline at end of property
+1.17.2.5
\ No newline at end of property
Index: branches/RC/core/units/general/cat_event_handler.php
===================================================================
--- branches/RC/core/units/general/cat_event_handler.php (revision 11537)
+++ branches/RC/core/units/general/cat_event_handler.php (revision 11538)
@@ -1,2486 +1,2479 @@
<?php
$application =& kApplication::Instance();
$application->Factory->includeClassFile('kDBEventHandler');
class kCatDBEventHandler extends kDBEventHandler {
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnExport' => Array('self' => 'view|advanced:export'),
'OnExportBegin' => Array('self' => 'view|advanced:export'),
'OnSaveSettings' => Array('self' => 'add|edit|advanced:import'),
'OnBeforeDeleteOriginal' => Array('self' => 'edit|advanced:approve'),
'OnDownloadFile' => Array('self' => 'view'),
'OnCancelAction' => Array('self' => true),
'OnItemBuild' => Array('self' => true),
'OnMakeVote' => Array ('self' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Load item if id is available
*
* @param kEvent $event
*/
function LoadItem(&$event)
{
$object =& $event->getObject();
$id = $this->getPassedID($event);
if ($object->Load($id)) {
$actions =& $this->Application->recallObject('kActions');
$actions->Set($event->Prefix_Special.'_id', $object->GetID() );
$use_pending_editing = $this->Application->getUnitOption($event->Prefix, 'UsePendingEditing');
if ($use_pending_editing && $event->Special != 'original') {
$this->Application->SetVar($event->Prefix.'.original_id', $object->GetDBField('OrgId'));
}
}
else {
$object->setID($id);
}
}
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if (!$this->Application->IsAdmin()) {
if ($event->Name == 'OnSetSortingDirect') {
// allow sorting on front event without view permission
return true;
}
}
if ($event->Name == 'OnExport') {
// save category_id before doing export
$this->Application->LinkVar('m_cat_id');
}
if ($event->Name == 'OnNew' && preg_match('/(.*)\/import$/', $this->Application->GetVar('t'), $rets)) {
// redirect to item import template, where permission (import) category will be chosen)
$root_category = $this->Application->findModule('Path', $rets[1].'/', 'RootCat');
$this->Application->StoreVar('m_cat_id', $root_category);
}
$check_events = Array ('OnEdit', 'OnSave', 'OnMassDelete');
if (in_array($event->Name, $check_events)) {
// check each id from selected individually and only if all are allowed proceed next
if ($event->Name == 'OnSave') {
$selected_ids = implode(',', $this->getSelectedIDs($event, true));
if (!$selected_ids) {
$selected_ids = 0; // when saving newly created item (OnPreCreate -> OnPreSave -> OnSave)
}
}
else {
$selected_ids = implode(',', $this->StoreSelectedIDs($event));
}
$perm_value = true;
if (strlen($selected_ids)) {
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
$items = $perm_helper->GetCategoryItemData($event->Prefix, $selected_ids);
$check_method = ($event->Name == 'OnMassDelete') ? 'DeleteCheckPermission' : 'ModifyCheckPermission';
foreach ($items as $item_id => $item_data) {
if ($perm_helper->$check_method($item_data['CreatedById'], $item_data['CategoryId'], $event->Prefix) == 0) {
// one of items selected has no permission
$perm_value = false;
break;
}
}
if (!$perm_value) {
$event->status = erPERM_FAIL;
}
}
else {
trigger_error('IDs not passed to '.$event->getPrefixSpecial().':CheckPermission', E_USER_WARNING);
}
return $perm_value;
}
return parent::CheckPermission($event);
}
/**
* Add selected items to clipboard with mode = COPY (CLONE)
*
* @param kEvent $event
*/
function OnCopy(&$event)
{
$this->Application->RemoveVar('clipboard');
$clipboard_helper =& $this->Application->recallObject('ClipboardHelper');
$clipboard_helper->setClipboard($event, 'copy', $this->StoreSelectedIDs($event));
}
/**
* Add selected items to clipboard with mode = CUT
*
* @param kEvent $event
*/
function OnCut(&$event)
{
$this->Application->RemoveVar('clipboard');
$clipboard_helper =& $this->Application->recallObject('ClipboardHelper');
$clipboard_helper->setClipboard($event, 'cut', $this->StoreSelectedIDs($event));
}
/**
* Performs category item paste
*
* @param kEvent $event
*/
function OnPaste(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$clipboard_data = $event->getEventParam('clipboard_data');
if (!$clipboard_data['cut'] && !$clipboard_data['copy']) {
return false;
}
if ($clipboard_data['copy']) {
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$this->Application->SetVar('ResetCatBeforeClone', 1);
$temp->CloneItems($event->Prefix, $event->Special, $clipboard_data['copy']);
}
if ($clipboard_data['cut']) {
$object =& $this->Application->recallObject($event->getPrefixSpecial().'.item', $event->Prefix, Array('skip_autoload' => true));
foreach ($clipboard_data['cut'] as $id) {
$object->Load($id);
$object->MoveToCat();
}
}
}
/**
* Deletes all selected items.
* Automatically recurse into sub-items using temp handler, and deletes sub-items
* by calling its Delete method if sub-item has AutoDelete set to true in its config file
*
* @param kEvent $event
*/
function OnMassDelete(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$event->status=erSUCCESS;
$ids = $this->StoreSelectedIDs($event);
$to_delete = array();
if ($recycle_bin = $this->Application->ConfigValue('RecycleBinFolder')) {
$rb =& $this->Application->recallObject('c.recycle', null, array('skip_autoload' => true));
$rb->Load($recycle_bin);
$object =& $this->Application->recallObject($event->Prefix.'.recycleitem', null, Array ('skip_autoload' => true));
foreach ($ids as $id) {
$object->Load($id);
if (preg_match('/^'.preg_quote($rb->GetDBField('ParentPath'),'/').'/', $object->GetDBField('ParentPath'))) {
$to_delete[] = $id;
continue;
}
$object->MoveToCat($recycle_bin);
}
$ids = $to_delete;
}
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$event->setEventParam('ids', $ids);
$this->customProcessing($event, 'before');
$ids = $event->getEventParam('ids');
if($ids)
{
$temp->DeleteItems($event->Prefix, $event->Special, $ids);
}
$this->clearSelectedIDs($event);
}
/**
* Return type clauses for list bulding on front
*
* @param kEvent $event
* @return Array
*/
function getTypeClauses(&$event)
{
$types = $event->getEventParam('types');
$types = $types ? explode(',', $types) : Array ();
$except_types = $event->getEventParam('except');
$except_types = $except_types ? explode(',', $except_types) : Array ();
$type_clauses = Array();
$user_id = $this->Application->RecallVar('user_id');
$owner_field = $this->getOwnerField($event->Prefix);
$type_clauses['my_items']['include'] = '%1$s.'.$owner_field.' = '.$user_id;
$type_clauses['my_items']['except'] = '%1$s.'.$owner_field.' <> '.$user_id;
$type_clauses['my_items']['having_filter'] = false;
$type_clauses['pick']['include'] = '%1$s.EditorsPick = 1 AND '.TABLE_PREFIX.'CategoryItems.PrimaryCat = 1';
$type_clauses['pick']['except'] = '%1$s.EditorsPick! = 1 AND '.TABLE_PREFIX.'CategoryItems.PrimaryCat = 1';
$type_clauses['pick']['having_filter'] = false;
$type_clauses['hot']['include'] = '`IsHot` = 1 AND PrimaryCat = 1';
$type_clauses['hot']['except'] = '`IsHot`! = 1 AND PrimaryCat = 1';
$type_clauses['hot']['having_filter'] = true;
$type_clauses['pop']['include'] = '`IsPop` = 1 AND PrimaryCat = 1';
$type_clauses['pop']['except'] = '`IsPop`! = 1 AND PrimaryCat = 1';
$type_clauses['pop']['having_filter'] = true;
$type_clauses['new']['include'] = '`IsNew` = 1 AND PrimaryCat = 1';
$type_clauses['new']['except'] = '`IsNew`! = 1 AND PrimaryCat = 1';
$type_clauses['new']['having_filter'] = true;
$type_clauses['displayed']['include'] = '';
$displayed = $this->Application->GetVar($event->Prefix.'_displayed_ids');
if ($displayed) {
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$type_clauses['displayed']['except'] = '%1$s.'.$id_field.' NOT IN ('.$displayed.')';
}
else {
$type_clauses['displayed']['except'] = '';
}
$type_clauses['displayed']['having_filter'] = false;
if (in_array('search', $types) || in_array('search', $except_types)) {
$event_mapping = Array(
'simple' => 'OnSimpleSearch',
'subsearch' => 'OnSubSearch',
'advanced' => 'OnAdvancedSearch');
if($this->Application->GetVar('INPORTAL_ON') && $this->Application->GetVar('Action') == 'm_simple_subsearch')
{
$type = 'subsearch';
}
else
{
$type = $this->Application->GetVar('search_type') ? $this->Application->GetVar('search_type') : 'simple';
}
if($keywords = $event->getEventParam('keyword_string')) // processing keyword_string param of ListProducts tag
{
$this->Application->SetVar('keywords', $keywords);
$type = 'simple';
}
$search_event = $event_mapping[$type];
$this->$search_event($event);
$search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$sql = 'SHOW TABLES LIKE "'.$search_table.'"';
if ($this->Conn->Query($sql)) {
$search_res_ids = $this->Conn->GetCol('SELECT ResourceId FROM '.$search_table);
}
if (isset($search_res_ids) && $search_res_ids) {
$type_clauses['search']['include'] = '%1$s.ResourceId IN ('.implode(',', $search_res_ids).') AND PrimaryCat = 1 AND ('.TABLE_PREFIX.'Category.Status = '.STATUS_ACTIVE.')';
$type_clauses['search']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $search_res_ids).') AND PrimaryCat = 1 AND ('.TABLE_PREFIX.'Category.Status = '.STATUS_ACTIVE.')';
}
else {
$type_clauses['search']['include'] = '0';
$type_clauses['search']['except'] = '1';
}
$type_clauses['search']['having_filter'] = false;
}
if (in_array('related', $types) || in_array('related', $except_types)) {
$related_to = $event->getEventParam('related_to');
if (!$related_to) {
$related_prefix = $event->Prefix;
}
else {
$sql = 'SELECT Prefix
FROM '.TABLE_PREFIX.'ItemTypes
WHERE ItemName = '.$this->Conn->qstr($related_to);
$related_prefix = $this->Conn->GetOne($sql);
}
$rel_table = $this->Application->getUnitOption('rel', 'TableName');
$item_type = (int)$this->Application->getUnitOption($event->Prefix, 'ItemType');
if ($item_type == 0) {
trigger_error('<strong>ItemType</strong> not defined for prefix <strong>' . $event->Prefix . '</strong>', E_USER_WARNING);
}
// process case, then this list is called inside another list
$prefix_special = $event->getEventParam('PrefixSpecial');
if (!$prefix_special) {
$prefix_special = $this->Application->Parser->GetParam('PrefixSpecial');
}
$id = false;
if ($prefix_special !== false) {
$processed_prefix = $this->Application->processPrefix($prefix_special);
if ($processed_prefix['prefix'] == $related_prefix) {
// printing related categories within list of items (not on details page)
$list =& $this->Application->recallObject($prefix_special);
/* @var $list kDBList */
$id = $list->GetID();
}
}
if ($id === false) {
// printing related categories for single item (possibly on details page)
if ($related_prefix == 'c') {
$id = $this->Application->GetVar('m_cat_id');
}
else {
$id = $this->Application->GetVar($related_prefix . '_id');
}
}
$p_item =& $this->Application->recallObject($related_prefix.'.current', null, Array('skip_autoload' => true));
$p_item->Load( (int)$id );
$p_resource_id = $p_item->GetDBField('ResourceId');
$sql = 'SELECT SourceId, TargetId FROM '.$rel_table.'
WHERE
(Enabled = 1)
AND (
(Type = 0 AND SourceId = '.$p_resource_id.' AND TargetType = '.$item_type.')
OR
(Type = 1
AND (
(SourceId = '.$p_resource_id.' AND TargetType = '.$item_type.')
OR
(TargetId = '.$p_resource_id.' AND SourceType = '.$item_type.')
)
)
)';
$related_ids_array = $this->Conn->Query($sql);
$related_ids = Array();
foreach ($related_ids_array as $key => $record) {
$related_ids[] = $record[ $record['SourceId'] == $p_resource_id ? 'TargetId' : 'SourceId' ];
}
if (count($related_ids) > 0) {
$type_clauses['related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_ids).') AND PrimaryCat = 1';
$type_clauses['related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_ids).') AND PrimaryCat = 1';
}
else {
$type_clauses['related']['include'] = '0';
$type_clauses['related']['except'] = '1';
}
$type_clauses['related']['having_filter'] = false;
}
if (in_array('favorites', $types) || in_array('favorites', $except_types)) {
$sql = 'SELECT ResourceId
FROM '.$this->Application->getUnitOption('fav', 'TableName').'
WHERE PortalUserId = '.$this->Application->RecallVar('user_id');
$favorite_ids = $this->Conn->GetCol($sql);
if ($favorite_ids) {
$type_clauses['favorites']['include'] = '%1$s.ResourceId IN ('.implode(',', $favorite_ids).') AND PrimaryCat = 1';
$type_clauses['favorites']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $favorite_ids).') AND PrimaryCat = 1';
}
else {
$type_clauses['favorites']['include'] = 0;
$type_clauses['favorites']['except'] = 1;
}
$type_clauses['favorites']['having_filter'] = false;
}
return $type_clauses;
}
/**
* Returns SQL clause, that will help to select only data from specified category & it's children
*
* @param int $category_id
* @return string
*/
function getCategoryLimitClause($category_id)
{
if (!$category_id) {
return false;
}
$tree_indexes = $this->Application->getTreeIndex($category_id);
if (!$tree_indexes) {
// id of non-existing category was given
return 'FALSE';
}
return TABLE_PREFIX.'Category.TreeLeft BETWEEN '.$tree_indexes['TreeLeft'].' AND '.$tree_indexes['TreeRight'];
}
/**
* Apply filters to list
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
parent::SetCustomQuery($event);
$object =& $event->getObject();
/* @var $object kDBList */
// add category filter if needed
if ($event->Special != 'showall' && $event->Special != 'user') {
if ($event->getEventParam('parent_cat_id') !== false) {
$parent_cat_id = $event->getEventParam('parent_cat_id');
}
else {
$parent_cat_id = $this->Application->GetVar('c_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
if (!$parent_cat_id) {
$parent_cat_id = 0;
}
}
if ((string) $parent_cat_id != 'any') {
if ($event->getEventParam('recursive')) {
$filter_clause = $this->getCategoryLimitClause($parent_cat_id);
if ($filter_clause !== false) {
$object->addFilter('category_filter', $filter_clause);
}
$object->addFilter('primary_filter', 'PrimaryCat = 1');
}
else {
$object->addFilter('category_filter', TABLE_PREFIX.'CategoryItems.CategoryId = '.$parent_cat_id );
}
}
}
else {
$object->addFilter('primary_filter', 'PrimaryCat = 1');
// if using recycle bin don't show items from there
$recycle_bin = $this->Application->ConfigValue('RecycleBinFolder');
if ($recycle_bin) {
$object->addFilter('recyclebin_filter', TABLE_PREFIX.'CategoryItems.CategoryId <> '.$recycle_bin);
}
}
if ($event->Special == 'user') {
$editable_user = $this->Application->GetVar('u_id');
$object->addFilter('owner_filter', '%1$s.'.$this->getOwnerField($event->Prefix).' = '.$editable_user);
}
// add permission filter
if ($this->Application->RecallVar('user_id') == -1) {
// for "root" CATEGORY.VIEW permission is checked for items lists too
$view_perm = 1;
}
else {
// for any real user itemlist view permission is checked instead of CATEGORY.VIEW
$count_helper =& $this->Application->recallObject('CountHelper');
/* @var $count_helper kCountHelper */
list ($view_perm, $view_filter) = $count_helper->GetPermissionClause($event->Prefix, 'perm');
$object->addFilter('perm_filter2', $view_filter);
}
$object->addFilter('perm_filter', 'perm.PermId = '.$view_perm);
$types = $event->getEventParam('types');
$this->applyItemStatusFilter($object, $types);
$except_types = $event->getEventParam('except');
$type_clauses = $this->getTypeClauses($event);
// convert prepared type clauses into list filters
$includes_or_filter =& $this->Application->makeClass('kMultipleFilter');
$includes_or_filter->setType(FLT_TYPE_OR);
$excepts_and_filter =& $this->Application->makeClass('kMultipleFilter');
$excepts_and_filter->setType(FLT_TYPE_AND);
$includes_or_filter_h =& $this->Application->makeClass('kMultipleFilter');
$includes_or_filter_h->setType(FLT_TYPE_OR);
$excepts_and_filter_h =& $this->Application->makeClass('kMultipleFilter');
$excepts_and_filter_h->setType(FLT_TYPE_AND);
if ($types) {
$types_array = explode(',', $types);
for ($i = 0; $i < sizeof($types_array); $i++) {
$type = trim($types_array[$i]);
if (isset($type_clauses[$type])) {
if ($type_clauses[$type]['having_filter']) {
$includes_or_filter_h->removeFilter('filter_'.$type);
$includes_or_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['include']);
}else {
$includes_or_filter->removeFilter('filter_'.$type);
$includes_or_filter->addFilter('filter_'.$type, $type_clauses[$type]['include']);
}
}
}
}
if ($except_types) {
$except_types_array = explode(',', $except_types);
for ($i = 0; $i < sizeof($except_types_array); $i++) {
$type = trim($except_types_array[$i]);
if (isset($type_clauses[$type])) {
if ($type_clauses[$type]['having_filter']) {
$excepts_and_filter_h->removeFilter('filter_'.$type);
$excepts_and_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['except']);
}else {
$excepts_and_filter->removeFilter('filter_'.$type);
$excepts_and_filter->addFilter('filter_'.$type, $type_clauses[$type]['except']);
}
}
}
}
/*if ( !$this->Application->IsAdmin() ) {
$object->addFilter('expire_filter', '%1$s.Expire IS NULL OR %1$s.Expire > UNIX_TIMESTAMP()');
}*/
/*$list_type = $event->getEventParam('ListType');
switch($list_type)
{
case 'favorites':
$fav_table = $this->Application->getUnitOption('fav','TableName');
$user_id =& $this->Application->RecallVar('user_id');
$sql = 'SELECT DISTINCT f.ResourceId
FROM '.$fav_table.' f
LEFT JOIN '.$object->TableName.' p ON p.ResourceId = f.ResourceId
WHERE f.PortalUserId = '.$user_id;
$ids = $this->Conn->GetCol($sql);
if(!$ids) $ids = Array(-1);
$object->addFilter('category_filter', TABLE_PREFIX.'CategoryItems.PrimaryCat = 1');
$object->addFilter('favorites_filter', '%1$s.`ResourceId` IN ('.implode(',',$ids).')');
break;
case 'search':
$search_results_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$sql = ' SELECT DISTINCT ResourceId
FROM '.$search_results_table.'
WHERE ItemType=11';
$ids = $this->Conn->GetCol($sql);
if(!$ids) $ids = Array(-1);
$object->addFilter('search_filter', '%1$s.`ResourceId` IN ('.implode(',',$ids).')');
break;
} */
$object->addFilter('includes_filter', $includes_or_filter);
$object->addFilter('excepts_filter', $excepts_and_filter);
$object->addFilter('includes_filter_h', $includes_or_filter_h, HAVING_FILTER);
$object->addFilter('excepts_filter_h', $excepts_and_filter_h, HAVING_FILTER);
}
/**
* Adds filter that filters out items with non-required statuses
*
* @param kDBList $object
* @param string $types
*/
function applyItemStatusFilter(&$object, $types)
{
// Link1 (before modifications) [Status = 1, OrgId = NULL], Link2 (after modifications) [Status = -2, OrgId = Link1_ID]
$pending_editing = $this->Application->getUnitOption($object->Prefix, 'UsePendingEditing');
if ( !$this->Application->IsAdmin() ) {
$types = explode(',', $types);
if (in_array('my_items', $types)) {
$allow_statuses = Array (STATUS_ACTIVE, STATUS_PENDING, STATUS_PENDING_EDITING);
$object->addFilter('status_filter', '%1$s.Status IN ('.implode(',', $allow_statuses).')');
if ($pending_editing) {
$user_id = $this->Application->RecallVar('user_id');
$this->applyPendingEditingFilter($object, $user_id);
}
}
else {
$object->addFilter('status_filter', '(%1$s.Status = ' . STATUS_ACTIVE . ') AND (' . TABLE_PREFIX . 'Category.Status = ' . STATUS_ACTIVE . ')');
if ($pending_editing) {
// if category item uses pending editing abilities, then in no cases show pending copies on front
$object->addFilter('original_filter', '%1$s.OrgId = 0 OR %1$s.OrgId IS NULL');
}
}
}
else {
if ($pending_editing) {
$this->applyPendingEditingFilter($object);
}
}
}
/**
* Adds filter, that removes live items if they have pending editing copies
*
* @param kDBList $object
* @param int $user_id
*/
function applyPendingEditingFilter(&$object, $user_id = null)
{
$sql = 'SELECT OrgId
FROM '.$object->TableName.'
WHERE Status = '.STATUS_PENDING_EDITING.' AND OrgId IS NOT NULL';
if (isset($user_id)) {
$owner_field = $this->getOwnerField($object->Prefix);
$sql .= ' AND '.$owner_field.' = '.$user_id;
}
$pending_ids = $this->Conn->GetCol($sql);
if ($pending_ids) {
$object->addFilter('no_original_filter', '%1$s.'.$object->IDField.' NOT IN ('.implode(',', $pending_ids).')');
}
}
/**
* Adds calculates fields for item statuses
*
* @param kCatDBItem $object
* @param kEvent $event
*/
function prepareObject(&$object, &$event)
{
$this->prepareItemStatuses($event);
$object->addCalculatedField('CachedNavbar', 'l'.$this->Application->GetVar('m_lang').'_CachedNavbar');
if ($event->Special == 'export' || $event->Special == 'import')
{
$export_helper =& $this->Application->recallObject('CatItemExportHelper');
$export_helper->prepareExportColumns($event);
}
}
/**
* Creates calculated fields for all item statuses based on config settings
*
* @param kEvent $event
*/
function prepareItemStatuses(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings');
if (!$property_map) {
return ;
}
// new items
$object->addCalculatedField('IsNew', ' IF(%1$s.NewItem = 2,
IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - '.
$this->Application->ConfigValue($property_map['NewDays']).
'*3600*24), 1, 0),
%1$s.NewItem
)');
// hot items (cache updated every hour)
$sql = 'SELECT Data
FROM '.TABLE_PREFIX.'Cache
WHERE (VarName = "'.$property_map['HotLimit'].'") AND (Cached >'.(adodb_mktime() - 3600).')';
$hot_limit = $this->Conn->GetOne($sql);
if ($hot_limit === false) {
$hot_limit = $this->CalculateHotLimit($event);
}
$object->addCalculatedField('IsHot', ' IF(%1$s.HotItem = 2,
IF(%1$s.'.$property_map['ClickField'].' >= '.$hot_limit.', 1, 0),
%1$s.HotItem
)');
// popular items
$object->addCalculatedField('IsPop', ' IF(%1$s.PopItem = 2,
IF(%1$s.CachedVotesQty >= '.
$this->Application->ConfigValue($property_map['MinPopVotes']).
' AND %1$s.CachedRating >= '.
$this->Application->ConfigValue($property_map['MinPopRating']).
', 1, 0),
%1$s.PopItem)');
}
function CalculateHotLimit(&$event)
{
$property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings');
if (!$property_map) {
return;
}
$click_field = $property_map['ClickField'];
$last_hot = $this->Application->ConfigValue($property_map['MaxHotNumber']) - 1;
$sql = 'SELECT '.$click_field.' FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
ORDER BY '.$click_field.' DESC
LIMIT '.$last_hot.', 1';
$res = $this->Conn->GetCol($sql);
$hot_limit = (double)array_shift($res);
$this->Conn->Query('REPLACE INTO '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("'.$property_map['HotLimit'].'", "'.$hot_limit.'", '.adodb_mktime().')');
return $hot_limit;
return 0;
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnBeforeItemUpdate(&$event)
{
$property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings');
if (!$property_map) {
return;
}
$click_field = $property_map['ClickField'];
$object =& $event->getObject();
if( $this->Application->IsAdmin() && ($this->Application->GetVar($click_field.'_original') !== false) &&
floor($this->Application->GetVar($click_field.'_original')) != $object->GetDBField($click_field) )
{
$sql = 'SELECT MAX('.$click_field.') FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
WHERE FLOOR('.$click_field.') = '.$object->GetDBField($click_field);
$hits = ( $res = $this->Conn->GetOne($sql) ) ? $res + 0.000001 : $object->GetDBField($click_field);
$object->SetDBField($click_field, $hits);
}
}
/**
* Load price from temp table if product mode is temp table
*
* @param kEvent $event
*/
function OnAfterItemLoad(&$event)
{
$special = substr($event->Special, -6);
$object =& $event->getObject();
/* @var $object kCatDBItem */
if ($special == 'import' || $special == 'export') {
$image_data = $object->getPrimaryImageData();
if ($image_data) {
$thumbnail_image = $image_data[$image_data['LocalThumb'] ? 'ThumbPath' : 'ThumbUrl'];
if ($image_data['SameImages']) {
$full_image = '';
}
else {
$full_image = $image_data[$image_data['LocalImage'] ? 'LocalPath' : 'Url'];
}
$object->SetDBField('ThumbnailImage', $thumbnail_image);
$object->SetDBField('FullImage', $full_image);
$object->SetDBField('ImageAlt', $image_data['AltName']);
}
}
// substituiting pending status value for pending editing
if ($object->HasField('OrgId') && $object->GetDBField('OrgId') > 0 && $object->GetDBField('Status') == -2) {
$options = $object->Fields['Status']['options'];
foreach ($options as $key => $val) {
if ($key == 2) $key = -2;
$new_options[$key] = $val;
}
$object->Fields['Status']['options'] = $new_options;
}
// linking existing images for item with virtual fields
if ($event->Prefix != 'cms') {
$image_helper =& $this->Application->recallObject('ImageHelper');
/* @var $image_helper ImageHelper */
$image_helper->LoadItemImages($object);
// linking existing files for item with virtual fields
$file_helper =& $this->Application->recallObject('FileHelper');
/* @var $file_helper FileHelper */
$file_helper->LoadItemFiles($object);
}
// set item's additional categories to virtual field (used in editing)
$item_categories = $this->getItemCategories($object->GetDBField('ResourceId'));
$object->SetDBField('MoreCategories', $item_categories ? '|'.implode('|', $item_categories).'|' : '');
}
function OnAfterItemUpdate(&$event)
{
$this->CalculateHotLimit($event);
if ( substr($event->Special, -6) == 'import') {
$this->setCustomExportColumns($event);
}
if (!$this->Application->IsAdmin()) {
$object =& $event->getObject();
/* @var $object kDBItem */
if ($event->Prefix != 'cms') {
$image_helper =& $this->Application->recallObject('ImageHelper');
/* @var $image_helper ImageHelper */
// process image upload in virtual fields
$image_helper->SaveItemImages($object);
$file_helper =& $this->Application->recallObject('FileHelper');
/* @var $file_helper FileHelper */
// process file upload in virtual fields
$file_helper->SaveItemFiles($object);
}
if ($event->Special != '-item') {
// don't touch categories during cloning
$this->processAdditionalCategories($object, 'update');
}
}
}
/**
* sets values for import process
*
* @param kEvent $event
*/
function OnAfterItemCreate(&$event)
{
if ( substr($event->Special, -6) == 'import') {
$this->setCustomExportColumns($event);
}
if (!$this->Application->IsAdmin()) {
$object =& $event->getObject();
/* @var $object kDBItem */
if ($event->Prefix != 'cms') {
$image_helper =& $this->Application->recallObject('ImageHelper');
/* @var $image_helper ImageHelper */
// process image upload in virtual fields
$image_helper->SaveItemImages($object);
$file_helper =& $this->Application->recallObject('FileHelper');
/* @var $file_helper FileHelper */
// process file upload in virtual fields
$file_helper->SaveItemFiles($object);
}
if ($event->Special != '-item') {
// don't touch categories during cloning
$this->processAdditionalCategories($object, 'create');
}
}
}
/**
* Make record to search log
*
* @param string $keywords
* @param int $search_type 0 - simple search, 1 - advanced search
*/
function saveToSearchLog($keywords, $search_type = 0)
{
// don't save keywords for each module separately, just one time
// static variable can't help here, because each module uses it's own class instance !
if (!$this->Application->GetVar('search_logged')) {
$sql = 'UPDATE '.TABLE_PREFIX.'SearchLog
SET Indices = Indices + 1
WHERE Keyword = '.$this->Conn->qstr($keywords).' AND SearchType = '.$search_type; // 0 - simple search, 1 - advanced search
$this->Conn->Query($sql);
if ($this->Conn->getAffectedRows() == 0) {
$fields_hash = Array('Keyword' => $keywords, 'Indices' => 1, 'SearchType' => $search_type);
$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'SearchLog');
}
$this->Application->SetVar('search_logged', 1);
}
}
/**
* Makes simple search for products
* based on keywords string
*
* @param kEvent $event
* @todo Change all hardcoded Products table & In-Commerce module usage to dynamic usage from item config !!!
*/
function OnSimpleSearch(&$event)
{
if($this->Application->GetVar('INPORTAL_ON') && !($this->Application->GetVar('Action') == 'm_simple_search'))
{
return;
}
$event->redirect = false;
$search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$keywords = unhtmlentities( trim($this->Application->GetVar('keywords')) );
$query_object =& $this->Application->recallObject('HTTPQuery');
$sql = 'SHOW TABLES LIKE "'.$search_table.'"';
if(!isset($query_object->Get['keywords']) &&
!isset($query_object->Post['keywords']) &&
$this->Conn->Query($sql))
{
return; // used when navigating by pages or changing sorting in search results
}
if(!$keywords || strlen($keywords) < $this->Application->ConfigValue('Search_MinKeyword_Length'))
{
$this->Conn->Query('DROP TABLE IF EXISTS '.$search_table);
$this->Application->SetVar('keywords_too_short', 1);
return; // if no or too short keyword entered, doing nothing
}
$this->Application->StoreVar('keywords', $keywords);
if (!$this->Application->GetVar('INPORTAL_ON')) {
// don't save search log, because in-portal already saved it
$this->saveToSearchLog($keywords, 0); // 0 - simple search, 1 - advanced search
}
$keywords = strtr($keywords, Array('%' => '\\%', '_' => '\\_'));
$event->setPseudoClass('_List');
$object =& $event->getObject();
$this->Application->SetVar($event->getPrefixSpecial().'_Page', 1);
$lang = $this->Application->GetVar('m_lang');
$items_table = $this->Application->getUnitOption($event->Prefix, 'TableName');
$module_name = $this->Application->findModule('Var', $event->Prefix, 'Name');
$sql = ' SELECT * FROM '.$this->Application->getUnitOption('confs', 'TableName').'
WHERE ModuleName="'.$module_name.'"
AND SimpleSearch=1';
$search_config = $this->Conn->Query($sql, 'FieldName');
$field_list = array_keys($search_config);
$join_clauses = Array();
// field processing
$weight_sum = 0;
$alias_counter = 0;
$custom_fields = $this->Application->getUnitOption($event->Prefix, 'CustomFields');
if ($custom_fields) {
$custom_table = $this->Application->getUnitOption($event->Prefix.'-cdata', 'TableName');
$join_clauses[] = ' LEFT JOIN '.$custom_table.' custom_data ON '.$items_table.'.ResourceId = custom_data.ResourceId';
}
// what field in search config becomes what field in sql (key - new field, value - old field (from searchconfig table))
$search_config_map = Array();
foreach ($field_list as $key => $field) {
$options = $object->getFieldOptions($field);
$local_table = TABLE_PREFIX.$search_config[$field]['TableName'];
$weight_sum += $search_config[$field]['Priority']; // counting weight sum; used when making relevance clause
// processing multilingual fields
if (getArrayValue($options, 'formatter') == 'kMultiLanguage') {
$field_list[$key.'_primary'] = 'l'.$this->Application->GetDefaultLanguageId().'_'.$field;
$field_list[$key] = 'l'.$lang.'_'.$field;
if(!isset($search_config[$field]['ForeignField']))
{
$field_list[$key.'_primary'] = $local_table.'.'.$field_list[$key.'_primary'];
$search_config_map[ $field_list[$key.'_primary'] ] = $field;
}
}
// processing fields from other tables
if($foreign_field = $search_config[$field]['ForeignField'])
{
$exploded = explode(':', $foreign_field, 2);
if($exploded[0] == 'CALC')
{
unset($field_list[$key]);
continue; // ignoring having type clauses in simple search
/*$user_groups = $this->Application->RecallVar('UserGroups');
$having_list[$key] = str_replace('{PREFIX}', TABLE_PREFIX, $exploded[1]);
$join_clause = str_replace('{PREFIX}', TABLE_PREFIX, $search_config[$field]['JoinClause']);
$join_clause = str_replace('{USER_GROUPS}', $user_groups, $join_clause);
$join_clause = ' LEFT JOIN '.$join_clause;
$join_clauses[] = $join_clause;*/
}
else
{
$multi_lingual = false;
if ($exploded[0] == 'MULTI')
{
$multi_lingual = true;
$foreign_field = $exploded[1];
}
$exploded = explode('.', $foreign_field); // format: table.field_name
$foreign_table = TABLE_PREFIX.$exploded[0];
$alias_counter++;
$alias = 't'.$alias_counter;
if ($multi_lingual) {
$field_list[$key] = $alias.'.'.'l'.$lang.'_'.$exploded[1];
$field_list[$key.'_primary'] = 'l'.$this->Application->GetDefaultLanguageId().'_'.$field;
$search_config_map[ $field_list[$key] ] = $field;
$search_config_map[ $field_list[$key.'_primary'] ] = $field;
}
else {
$field_list[$key] = $alias.'.'.$exploded[1];
$search_config_map[ $field_list[$key] ] = $field;
}
$join_clause = str_replace('{ForeignTable}', $alias, $search_config[$field]['JoinClause']);
$join_clause = str_replace('{LocalTable}', $items_table, $join_clause);
$join_clauses[] = ' LEFT JOIN '.$foreign_table.' '.$alias.'
ON '.$join_clause;
}
}
else {
// processing fields from local table
if ($search_config[$field]['CustomFieldId']) {
$local_table = 'custom_data';
// search by custom field value on current language
$custom_field_id = array_search($field_list[$key], $custom_fields);
$field_list[$key] = 'l'.$lang.'_cust_'.$custom_field_id;
// search by custom field value on primary language
$field_list[$key.'_primary'] = 'l'.$this->Application->GetDefaultLanguageId().'_cust_'.$custom_field_id;
$search_config_map[ $field_list[$key.'_primary'] ] = $field;
}
$field_list[$key] = $local_table.'.'.$field_list[$key];
$search_config_map[ $field_list[$key] ] = $field;
}
}
// keyword string processing
$search_helper =& $this->Application->recallObject('SearchHelper');
$where_clause = $search_helper->buildWhereClause($keywords, $field_list);
$search_scope = $this->Application->GetVar('search_scope');
if ($search_scope == 'category') {
$category_id = $this->Application->GetVar('m_cat_id');
$category_filter = $this->getCategoryLimitClause($category_id);
if ($category_filter !== false) {
$join_clauses[] = ' LEFT JOIN '.TABLE_PREFIX.'CategoryItems ON '.TABLE_PREFIX.'CategoryItems.ItemResourceId = '.$items_table.'.ResourceId';
$join_clauses[] = ' LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'CategoryItems.CategoryId';
$where_clause = '('.$this->getCategoryLimitClause($category_id).') AND '.$where_clause;
}
}
$where_clause = $where_clause.' AND '.$items_table.'.Status=1';
if($this->Application->GetVar('Action') == 'm_simple_subsearch') // subsearch, In-portal
{
if( $event->getEventParam('ResultIds') )
{
$where_clause .= ' AND '.$items_table.'.ResourceId IN ('.implode(',', $event->specificParams['ResultIds']).')';
}
}
if( $event->MasterEvent && $event->MasterEvent->Name == 'OnListBuild' ) // subsearch, k4
{
if( $event->MasterEvent->getEventParam('ResultIds') )
{
$where_clause .= ' AND '.$items_table.'.ResourceId IN ('.implode(',', $event->MasterEvent->getEventParam('ResultIds')).')';
}
}
// making relevance clause
$positive_words = $search_helper->getPositiveKeywords($keywords);
$this->Application->StoreVar('highlight_keywords', serialize($positive_words));
$revelance_parts = Array();
reset($search_config);
foreach ($positive_words as $keyword_index => $positive_word) {
$positive_words[$keyword_index] = mysql_real_escape_string($positive_word);
}
foreach ($field_list as $field) {
if (!array_key_exists($field, $search_config_map)) {
$map_key = $search_config_map[$items_table . '.' . $field];
}
else {
$map_key = $search_config_map[$field];
}
$config_elem = $search_config[ $map_key ];
$weight = $config_elem['Priority'];
$revelance_parts[] = 'IF('.$field.' LIKE "%'.implode(' ', $positive_words).'%", '.$weight_sum.', 0)';
foreach ($positive_words as $keyword) {
$revelance_parts[] = 'IF('.$field.' LIKE "%'.$keyword.'%", '.$weight.', 0)';
}
}
$conf_postfix = $this->Application->getUnitOption($event->Prefix, 'SearchConfigPostfix');
$rel_keywords = $this->Application->ConfigValue('SearchRel_Keyword_'.$conf_postfix) / 100;
$rel_pop = $this->Application->ConfigValue('SearchRel_Pop_'.$conf_postfix) / 100;
$rel_rating = $this->Application->ConfigValue('SearchRel_Rating_'.$conf_postfix) / 100;
$relevance_clause = '('.implode(' + ', $revelance_parts).') / '.$weight_sum.' * '.$rel_keywords;
if ($rel_pop && isset($object->Fields['Hits'])) {
$relevance_clause .= ' + (Hits + 1) / (MAX(Hits) + 1) * '.$rel_pop;
}
if ($rel_rating && isset($object->Fields['CachedRating'])) {
$relevance_clause .= ' + (CachedRating + 1) / (MAX(CachedRating) + 1) * '.$rel_rating;
}
// building final search query
if (!$this->Application->GetVar('do_not_drop_search_table') && !$this->Application->GetVar('INPORTAL_ON')) {
$this->Conn->Query('DROP TABLE IF EXISTS '.$search_table); // erase old search table if clean k4 event
$this->Application->SetVar('do_not_drop_search_table', true);
}
$search_table_exists = $this->Conn->Query('SHOW TABLES LIKE "'.$search_table.'"');
if ($search_table_exists) {
$select_intro = 'INSERT INTO '.$search_table.' (Relevance, ItemId, ResourceId, ItemType, EdPick) ';
}
else {
$select_intro = 'CREATE TABLE '.$search_table.' AS ';
}
$edpick_clause = $this->Application->getUnitOption($event->Prefix.'.EditorsPick', 'Fields') ? $items_table.'.EditorsPick' : '0';
$sql = $select_intro.' SELECT '.$relevance_clause.' AS Relevance,
'.$items_table.'.'.$this->Application->getUnitOption($event->Prefix, 'IDField').' AS ItemId,
'.$items_table.'.ResourceId,
'.$this->Application->getUnitOption($event->Prefix, 'ItemType').' AS ItemType,
'.$edpick_clause.' AS EdPick
FROM '.$object->TableName.'
'.implode(' ', $join_clauses).'
WHERE '.$where_clause.'
GROUP BY '.$items_table.'.'.$this->Application->getUnitOption($event->Prefix, 'IDField');
$res = $this->Conn->Query($sql);
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnSubSearch(&$event)
{
$search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$sql = 'SHOW TABLES LIKE "'.$search_table.'"';
if($this->Conn->Query($sql))
{
$sql = 'SELECT DISTINCT ResourceId FROM '.$search_table;
$ids = $this->Conn->GetCol($sql);
}
$event->setEventParam('ResultIds', $ids);
$event->CallSubEvent('OnSimpleSearch');
}
/**
* Enter description here...
*
* @param kEvent $event
* @todo Change all hardcoded Products table & In-Commerce module usage to dynamic usage from item config !!!
*/
function OnAdvancedSearch(&$event)
{
$query_object =& $this->Application->recallObject('HTTPQuery');
if(!isset($query_object->Post['andor']))
{
return; // used when navigating by pages or changing sorting in search results
}
$this->Application->RemoveVar('keywords');
$this->Application->RemoveVar('Search_Keywords');
$module_name = $this->Application->findModule('Var', $event->Prefix, 'Name');
$sql = 'SELECT *
FROM '.$this->Application->getUnitOption('confs', 'TableName').'
WHERE (ModuleName = '.$this->Conn->qstr($module_name).') AND (AdvancedSearch = 1)';
$search_config = $this->Conn->Query($sql);
$lang = $this->Application->GetVar('m_lang');
$object =& $event->getObject();
$object->SetPage(1);
$items_table = $this->Application->getUnitOption($event->Prefix, 'TableName');
$search_keywords = $this->Application->GetVar('value'); // will not be changed
$keywords = $this->Application->GetVar('value'); // will be changed down there
$verbs = $this->Application->GetVar('verb');
$glues = $this->Application->GetVar('andor');
$and_conditions = Array();
$or_conditions = Array();
$and_having_conditions = Array();
$or_having_conditions = Array();
$join_clauses = Array();
$highlight_keywords = Array();
$relevance_parts = Array();
$alias_counter = 0;
$custom_fields = $this->Application->getUnitOption($event->Prefix, 'CustomFields');
if ($custom_fields) {
$custom_table = $this->Application->getUnitOption($event->Prefix.'-cdata', 'TableName');
$join_clauses[] = ' LEFT JOIN '.$custom_table.' custom_data ON '.$items_table.'.ResourceId = custom_data.ResourceId';
}
$search_log = '';
$weight_sum = 0;
// processing fields and preparing conditions
foreach ($search_config as $record) {
$field = $record['FieldName'];
$join_clause = '';
$condition_mode = 'WHERE';
// field processing
$options = $object->getFieldOptions($field);
$local_table = TABLE_PREFIX.$record['TableName'];
$weight_sum += $record['Priority']; // counting weight sum; used when making relevance clause
// processing multilingual fields
if (getArrayValue($options, 'formatter') == 'kMultiLanguage') {
$field_name = 'l'.$lang.'_'.$field;
}
else {
$field_name = $field;
}
// processing fields from other tables
if ($foreign_field = $record['ForeignField']) {
$exploded = explode(':', $foreign_field, 2);
if($exploded[0] == 'CALC')
{
$user_groups = $this->Application->RecallVar('UserGroups');
$field_name = str_replace('{PREFIX}', TABLE_PREFIX, $exploded[1]);
$join_clause = str_replace('{PREFIX}', TABLE_PREFIX, $record['JoinClause']);
$join_clause = str_replace('{USER_GROUPS}', $user_groups, $join_clause);
$join_clause = ' LEFT JOIN '.$join_clause;
$condition_mode = 'HAVING';
}
else {
$exploded = explode('.', $foreign_field);
$foreign_table = TABLE_PREFIX.$exploded[0];
if($record['CustomFieldId']) {
$exploded[1] = 'l'.$lang.'_'.$exploded[1];
}
$alias_counter++;
$alias = 't'.$alias_counter;
$field_name = $alias.'.'.$exploded[1];
$join_clause = str_replace('{ForeignTable}', $alias, $record['JoinClause']);
$join_clause = str_replace('{LocalTable}', $items_table, $join_clause);
if($record['CustomFieldId'])
{
$join_clause .= ' AND '.$alias.'.CustomFieldId='.$record['CustomFieldId'];
}
$join_clause = ' LEFT JOIN '.$foreign_table.' '.$alias.'
ON '.$join_clause;
}
}
else
{
// processing fields from local table
if ($record['CustomFieldId']) {
$local_table = 'custom_data';
$field_name = 'l'.$lang.'_cust_'.array_search($field_name, $custom_fields);
}
$field_name = $local_table.'.'.$field_name;
}
$condition = $this->getAdvancedSearchCondition($field_name, $record, $keywords, $verbs, $highlight_keywords);
if ($record['CustomFieldId'] && strlen($condition)) {
// search in primary value of custom field + value in current language
$field_name = $local_table.'.'.'l'.$this->Application->GetDefaultLanguageId().'_cust_'.array_search($field, $custom_fields);
$primary_condition = $this->getAdvancedSearchCondition($field_name, $record, $keywords, $verbs, $highlight_keywords);
$condition = '('.$condition.' OR '.$primary_condition.')';
}
if ($condition) {
if ($join_clause) {
$join_clauses[] = $join_clause;
}
$relevance_parts[] = 'IF('.$condition.', '.$record['Priority'].', 0)';
if ($glues[$field] == 1) { // and
if ($condition_mode == 'WHERE') {
$and_conditions[] = $condition;
}
else {
$and_having_conditions[] = $condition;
}
}
else { // or
if ($condition_mode == 'WHERE') {
$or_conditions[] = $condition;
}
else {
$or_having_conditions[] = $condition;
}
}
// create search log record
$search_log_data = Array('search_config' => $record, 'verb' => getArrayValue($verbs, $field), 'value' => ($record['FieldType'] == 'range') ? $search_keywords[$field.'_from'].'|'.$search_keywords[$field.'_to'] : $search_keywords[$field]);
$search_log[] = $this->Application->Phrase('la_Field').' "'.$this->getHuman('Field', $search_log_data).'" '.$this->getHuman('Verb', $search_log_data).' '.$this->Application->Phrase('la_Value').' '.$this->getHuman('Value', $search_log_data).' '.$this->Application->Phrase($glues[$field] == 1 ? 'lu_And' : 'lu_Or');
}
}
if ($search_log) {
$search_log = implode('<br />', $search_log);
$search_log = preg_replace('/(.*) '.preg_quote($this->Application->Phrase('lu_and'), '/').'|'.preg_quote($this->Application->Phrase('lu_or'), '/').'$/is', '\\1', $search_log);
$this->saveToSearchLog($search_log, 1); // advanced search
}
$this->Application->StoreVar('highlight_keywords', serialize($highlight_keywords));
// making relevance clause
if($relevance_parts)
{
$conf_postfix = $this->Application->getUnitOption($event->Prefix, 'SearchConfigPostfix');
$rel_keywords = $this->Application->ConfigValue('SearchRel_Keyword_'.$conf_postfix) / 100;
$rel_pop = $this->Application->ConfigValue('SearchRel_Pop_'.$conf_postfix) / 100;
$rel_rating = $this->Application->ConfigValue('SearchRel_Rating_'.$conf_postfix) / 100;
$relevance_clause = '('.implode(' + ', $relevance_parts).') / '.$weight_sum.' * '.$rel_keywords;
$relevance_clause .= ' + (Hits + 1) / (MAX(Hits) + 1) * '.$rel_pop;
$relevance_clause .= ' + (CachedRating + 1) / (MAX(CachedRating) + 1) * '.$rel_rating;
}
else
{
$relevance_clause = '0';
}
// building having clause
if($or_having_conditions)
{
$and_having_conditions[] = '('.implode(' OR ', $or_having_conditions).')';
}
$having_clause = implode(' AND ', $and_having_conditions);
$having_clause = $having_clause ? ' HAVING '.$having_clause : '';
// building where clause
if($or_conditions)
{
$and_conditions[] = '('.implode(' OR ', $or_conditions).')';
}
// $and_conditions[] = $items_table.'.Status = 1';
$where_clause = implode(' AND ', $and_conditions);
if(!$where_clause)
{
if($having_clause)
{
$where_clause = '1';
}
else
{
$where_clause = '0';
$this->Application->SetVar('adv_search_error', 1);
}
}
$where_clause .= ' AND '.$items_table.'.Status = 1';
// building final search query
$search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$this->Conn->Query('DROP TABLE IF EXISTS '.$search_table);
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
$pick_field = isset($fields['EditorsPick']) ? $items_table.'.EditorsPick' : '0';
$sql = ' CREATE TABLE '.$search_table.'
SELECT '.$relevance_clause.' AS Relevance,
'.$items_table.'.'.$id_field.' AS ItemId,
'.$items_table.'.ResourceId AS ResourceId,
11 AS ItemType,
'.$pick_field.' AS EdPick
FROM '.$items_table.'
'.implode(' ', $join_clauses).'
WHERE '.$where_clause.'
GROUP BY '.$items_table.'.'.$id_field.
$having_clause;
$res = $this->Conn->Query($sql);
}
function getAdvancedSearchCondition($field_name, $record, $keywords, $verbs, &$highlight_keywords)
{
$field = $record['FieldName'];
$condition_patterns = Array (
'any' => '%s LIKE %s',
'contains' => '%s LIKE %s',
'notcontains' => '(NOT (%1$s LIKE %2$s) OR %1$s IS NULL)',
'is' => '%s = %s',
'isnot' => '(%1$s != %2$s OR %1$s IS NULL)'
);
$condition = '';
switch ($record['FieldType']) {
case 'select':
$keywords[$field] = unhtmlentities( $keywords[$field] );
if ($keywords[$field]) {
$condition = sprintf($condition_patterns['is'], $field_name, $this->Conn->qstr( $keywords[$field] ));
}
break;
case 'multiselect':
$keywords[$field] = unhtmlentities( $keywords[$field] );
if ($keywords[$field]) {
$condition = Array ();
$values = explode('|', substr($keywords[$field], 1, -1));
foreach ($values as $selected_value) {
$condition[] = sprintf($condition_patterns['contains'], $field_name, $this->Conn->qstr('%|'.$selected_value.'|%'));
}
$condition = '('.implode(' OR ', $condition).')';
}
break;
case 'text':
$keywords[$field] = unhtmlentities( $keywords[$field] );
if (mb_strlen($keywords[$field]) >= $this->Application->ConfigValue('Search_MinKeyword_Length')) {
$highlight_keywords[] = $keywords[$field];
if (in_array($verbs[$field], Array('any', 'contains', 'notcontains'))) {
$keywords[$field] = '%'.strtr($keywords[$field], Array('%' => '\\%', '_' => '\\_')).'%';
}
$condition = sprintf($condition_patterns[$verbs[$field]], $field_name, $this->Conn->qstr( $keywords[$field] ));
}
break;
case 'boolean':
if ($keywords[$field] != -1) {
$property_mappings = $this->Application->getUnitOption($this->Prefix, 'ItemPropertyMappings');
$items_table = $this->Application->getUnitOption($event->Prefix, 'TableName');
switch ($field) {
case 'HotItem':
$hot_limit_var = getArrayValue($property_mappings, 'HotLimit');
if ($hot_limit_var) {
$sql = 'SELECT Data
FROM '.TABLE_PREFIX.'Cache
WHERE VarName = "'.$hot_limit_var.'"';
$hot_limit = (int)$this->Conn->GetOne($sql);
$condition = 'IF('.$items_table.'.HotItem = 2,
IF('.$items_table.'.Hits >= '.
$hot_limit.
', 1, 0), '.$items_table.'.HotItem) = '.$keywords[$field];
}
break;
case 'PopItem':
$votes2pop_var = getArrayValue($property_mappings, 'VotesToPop');
$rating2pop_var = getArrayValue($property_mappings, 'RatingToPop');
if ($votes2pop_var && $rating2pop_var) {
$condition = 'IF('.$items_table.'.PopItem = 2, IF('.$items_table.'.CachedVotesQty >= '.
$this->Application->ConfigValue($votes2pop_var).
' AND '.$items_table.'.CachedRating >= '.
$this->Application->ConfigValue($rating2pop_var).
', 1, 0), '.$items_table.'.PopItem) = '.$keywords[$field];
}
break;
case 'NewItem':
$new_days_var = getArrayValue($property_mappings, 'NewDays');
if ($new_days_var) {
$condition = 'IF('.$items_table.'.NewItem = 2,
IF('.$items_table.'.CreatedOn >= (UNIX_TIMESTAMP() - '.
$this->Application->ConfigValue($new_days_var).
'*3600*24), 1, 0), '.$items_table.'.NewItem) = '.$keywords[$field];
}
break;
case 'EditorsPick':
$condition = $items_table.'.EditorsPick = '.$keywords[$field];
break;
}
}
break;
case 'range':
$range_conditions = Array();
if ($keywords[$field.'_from'] && !preg_match("/[^0-9]/i", $keywords[$field.'_from'])) {
$range_conditions[] = $field_name.' >= '.$keywords[$field.'_from'];
}
if ($keywords[$field.'_to'] && !preg_match("/[^0-9]/i", $keywords[$field.'_to'])) {
$range_conditions[] = $field_name.' <= '.$keywords[$field.'_to'];
}
if ($range_conditions) {
$condition = implode(' AND ', $range_conditions);
}
break;
case 'date':
if ($keywords[$field]) {
if (in_array($keywords[$field], Array('today', 'yesterday'))) {
$current_time = getdate();
$day_begin = adodb_mktime(0, 0, 0, $current_time['mon'], $current_time['mday'], $current_time['year']);
$time_mapping = Array('today' => $day_begin, 'yesterday' => ($day_begin - 86400));
$min_time = $time_mapping[$keywords[$field]];
}
else {
$time_mapping = Array (
'last_week' => 604800, 'last_month' => 2628000, 'last_3_months' => 7884000,
'last_6_months' => 15768000, 'last_year' => 31536000,
);
$min_time = adodb_mktime() - $time_mapping[$keywords[$field]];
}
$condition = $field_name.' > '.$min_time;
}
break;
}
return $condition;
}
function getHuman($type, $search_data)
{
$type = ucfirst(strtolower($type));
extract($search_data);
switch ($type) {
case 'Field':
return $this->Application->Phrase($search_config['DisplayName']);
break;
case 'Verb':
return $verb ? $this->Application->Phrase('lu_advsearch_'.$verb) : '';
break;
case 'Value':
switch ($search_config['FieldType']) {
case 'date':
$values = Array(0 => 'lu_comm_Any', 'today' => 'lu_comm_Today',
'yesterday' => 'lu_comm_Yesterday', 'last_week' => 'lu_comm_LastWeek',
'last_month' => 'lu_comm_LastMonth', 'last_3_months' => 'lu_comm_Last3Months',
'last_6_months' => 'lu_comm_Last6Months', 'last_year' => 'lu_comm_LastYear');
$ret = $this->Application->Phrase($values[$value]);
break;
case 'range':
$value = explode('|', $value);
return $this->Application->Phrase('lu_comm_From').' "'.$value[0].'" '.$this->Application->Phrase('lu_comm_To').' "'.$value[1].'"';
break;
case 'boolean':
$values = Array(1 => 'lu_comm_Yes', 0 => 'lu_comm_No', -1 => 'lu_comm_Both');
$ret = $this->Application->Phrase($values[$value]);
break;
default:
$ret = $value;
break;
}
return '"'.$ret.'"';
break;
}
}
/**
* 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)
{
if( $this->Application->RewriteURLs() )
{
$page = $this->Application->GetVar($event->Prefix.'_Page');
if (!$page)
{
$page = $this->Application->RecallVar($event->Prefix.'_Page');
}
if($page) $this->Application->StoreVar($event->getPrefixSpecial().'_Page', $page);
}
else
{
$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;
}
}
/*$cur_per_page = $per_page;
$per_page = $event->getEventParam('per_page');
if ($per_page == 'list_next') {
$cur_page = $page;
$object =& $this->Application->recallObject($event->Prefix);
$object->SetPerPage(1);
$cur_item_index = $object->CurrentIndex;
$page = ($cur_page-1) * $cur_per_page + $cur_item_index + 1;
$object->SetPerPage(1);
}*/
$object->SetPage($page);
}
/* === RELATED TO IMPORT/EXPORT: BEGIN === */
/**
* Shows export dialog
*
* @param kEvent $event
*/
function OnExport(&$event)
{
- // use old fasion (in-portal) grid
- $selector_name = $this->Application->getUnitOption($event->Prefix, 'CatalogSelectorName');
- if ($selector_name) {
- $selected_ids = $this->Application->GetVar($selector_name);
- }
- else {
- $selected_ids = $this->StoreSelectedIDs($event);
-
- if (implode(',', $selected_ids) == '') {
- // K4 fix when no ids found bad selected ids array is formed
- $selected_ids = false;
- }
+ $selected_ids = $this->StoreSelectedIDs($event);
+ if (implode(',', $selected_ids) == '') {
+ // K4 fix when no ids found bad selected ids array is formed
+ $selected_ids = false;
}
$selected_cats_ids = $this->Application->GetVar('export_categories');
$this->Application->StoreVar($event->Prefix.'_export_ids', $selected_ids ? implode(',', $selected_ids) : '' );
$this->Application->StoreVar($event->Prefix.'_export_cats_ids', $selected_cats_ids);
$export_helper =& $this->Application->recallObject('CatItemExportHelper');
- $event->redirect = $export_helper->getModuleFolder($event).'/export';
+ /* @var $export_helper kCatDBItemExportHelper */
- $redirect_params = Array( 'm_opener' => 'd',
- $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);
}
/**
* Performs each export step & displays progress percent
*
* @param kEvent $event
*/
function OnExportProgress(&$event)
{
$export_object =& $this->Application->recallObject('CatItemExportHelper');
/* @var $export_object kCatDBItemExportHelper */
$event = new kEvent($event->getPrefixSpecial().':OnDummy');
$action_method = 'perform'.ucfirst($event->Special);
$field_values = $export_object->$action_method($event);
// finish code is done from JS now
if ($field_values['start_from'] == $field_values['total_records']) {
if ($event->Special == 'import') {
$this->Application->StoreVar('PermCache_UpdateRequired', 1);
$this->Application->Redirect('categories/cache_updater', Array('m_opener' => 'r', 'pass' => 'm', 'continue' => 1, 'no_amp' => 1));
}
elseif ($event->Special == 'export') {
$template = $this->Application->getUnitOption($event->Prefix, 'ModuleFolder').'/'.$event->Special.'_finish';
$this->Application->Redirect($template, Array('pass' => 'all'));
}
}
$export_options = $export_object->loadOptions($event);
echo $export_options['start_from'] * 100 / $export_options['total_records'];
$event->status = erSTOP;
}
/**
* Returns specific to each item type columns only
*
* @param kEvent $event
* @return Array
*/
function getCustomExportColumns(&$event)
{
return Array( '__VIRTUAL__ThumbnailImage' => 'ThumbnailImage',
'__VIRTUAL__FullImage' => 'FullImage',
'__VIRTUAL__ImageAlt' => 'ImageAlt');
}
/**
* Sets non standart virtual fields (e.g. to other tables)
*
* @param kEvent $event
*/
function setCustomExportColumns(&$event)
{
$this->restorePrimaryImage($event);
}
/**
* Create/Update primary image record in info found in imported data
*
* @param kEvent $event
*/
function restorePrimaryImage(&$event)
{
$object =& $event->getObject();
$has_image_info = $object->GetDBField('ImageAlt') && ($object->GetDBField('ThumbnailImage') || $object->GetDBField('FullImage'));
if (!$has_image_info) {
return false;
}
$image_data = $object->getPrimaryImageData();
$image =& $this->Application->recallObject('img', null, Array('skip_autoload' => true));
if ($image_data) {
$image->Load($image_data['ImageId']);
}
else {
$image->Clear();
$image->SetDBField('Name', 'main');
$image->SetDBField('DefaultImg', 1);
$image->SetDBField('ResourceId', $object->GetDBField('ResourceId'));
}
$image->SetDBField('AltName', $object->GetDBField('ImageAlt'));
if ($object->GetDBField('ThumbnailImage')) {
$thumbnail_field = $this->isURL( $object->GetDBField('ThumbnailImage') ) ? 'ThumbUrl' : 'ThumbPath';
$image->SetDBField($thumbnail_field, $object->GetDBField('ThumbnailImage') );
$image->SetDBField('LocalThumb', $thumbnail_field == 'ThumbPath' ? 1 : 0);
}
if (!$object->GetDBField('FullImage')) {
$image->SetDBField('SameImages', 1);
}
else {
$image->SetDBField('SameImages', 0);
$full_field = $this->isURL( $object->GetDBField('FullImage') ) ? 'Url' : 'LocalPath';
$image->SetDBField($full_field, $object->GetDBField('FullImage') );
$image->SetDBField('LocalImage', $full_field == 'LocalPath' ? 1 : 0);
}
if ($image->isLoaded()) {
$image->Update();
}
else {
$image->Create();
}
}
function isURL($path)
{
return preg_match('#(http|https)://(.*)#', $path);
}
/**
* Prepares item for import/export operations
*
* @param kEvent $event
*/
function OnNew(&$event)
{
parent::OnNew($event);
if ($event->Special == 'import' || $event->Special == 'export') {
$export_helper =& $this->Application->recallObject('CatItemExportHelper');
$export_helper->setRequiredFields($event);
$this->Application->StoreVar('ImportCategory', 0);
}
}
/**
* Process items selected in item_selector
*
* @param kEvent $event
*/
function OnProcessSelected(&$event)
{
$selected_ids = $this->Application->GetVar('selected_ids');
$dst_field = $this->Application->RecallVar('dst_field');
if ($dst_field == 'ItemCategory') {
// Item Edit -> Categories Tab -> New Categories
$object =& $event->getObject();
$category_ids = explode(',', $selected_ids['c']);
foreach ($category_ids as $category_id) {
$object->assignToCategory($category_id);
}
}
if ($dst_field == 'ImportCategory') {
// Tools -> Import -> Item Import -> Select Import Category
$this->Application->StoreVar('ImportCategory', $selected_ids['c']);
// $this->Application->StoreVar($event->getPrefixSpecial().'_ForceNotValid', 1); // not to loose import/export values on form refresh
$this->Application->SetVar($event->getPrefixSpecial().'_id', 0);
$this->Application->SetVar($event->getPrefixSpecial().'_event', 'OnExportBegin');
$passed = $this->Application->GetVar('passed');
$this->Application->SetVar('passed', $passed.','.$event->getPrefixSpecial());
$event->setEventParam('pass_events', true);
}
$this->finalizePopup($event);
}
/**
* Saves Import/Export settings to session
*
* @param kEvent $event
*/
function OnSaveSettings(&$event)
{
$event->redirect = false;
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info) {
list($id, $field_values) = each($items_info);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->SetFieldsFromHash($field_values);
$field_values['ImportFilename'] = $object->GetDBField('ImportFilename'); //if upload formatter has renamed the file during moving !!!
$field_values['ImportSource'] = 2;
$field_values['ImportLocalFilename'] = $object->GetDBField('ImportFilename');
$items_info[$id] = $field_values;
$this->Application->StoreVar($event->getPrefixSpecial().'_ItemsInfo', serialize($items_info));
}
}
function OnCancelAction(&$event)
{
$event->redirect_params = Array('pass' => 'all,'.$event->GetPrefixSpecial());
$event->redirect = $this->Application->GetVar('cancel_template');
}
/* === RELATED TO IMPORT/EXPORT: END === */
/**
* Stores item's owner login into separate field together with id
*
* @param kEvent $event
* @param string $id_field
* @param string $cached_field
*/
function cacheItemOwner(&$event, $id_field, $cached_field)
{
$object =& $event->getObject();
$user_id = $object->GetDBField($id_field);
$options = $object->GetFieldOptions($id_field);
if (isset($options['options'][$user_id])) {
$object->SetDBField($cached_field, $options['options'][$user_id]);
}
else {
$id_field = $this->Application->getUnitOption('u', 'IDField');
$table_name = $this->Application->getUnitOption('u', 'TableName');
$sql = 'SELECT Login
FROM '.$table_name.'
WHERE '.$id_field.' = '.$user_id;
$object->SetDBField($cached_field, $this->Conn->GetOne($sql));
}
}
/**
* Saves item beeing edited into temp table
*
* @param kEvent $event
*/
function OnPreSave(&$event)
{
parent::OnPreSave($event);
$use_pending_editing = $this->Application->getUnitOption($event->Prefix, 'UsePendingEditing');
if ($event->status == erSUCCESS && $use_pending_editing) {
// decision: clone or not clone
$object =& $event->getObject();
if ($object->GetID() == 0 || $object->GetDBField('OrgId') > 0) {
// new items or cloned items shouldn't be cloned again
return true;
}
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
$owner_field = $this->getOwnerField($event->Prefix);
if ($perm_helper->ModifyCheckPermission($object->GetDBField($owner_field), $object->GetDBField('CategoryId'), $event->Prefix) == 2) {
// 1. clone original item
$temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$cloned_ids = $temp_handler->CloneItems($event->Prefix, $event->Special, Array($object->GetID()), null, null, null, true);
$ci_table = $this->Application->GetTempName(TABLE_PREFIX.'CategoryItems');
// 2. delete record from CategoryItems (about cloned item) that was automatically created during call of Create method of kCatDBItem
$sql = 'SELECT ResourceId
FROM '.$object->TableName.'
WHERE '.$object->IDField.' = '.$cloned_ids[0];
$clone_resource_id = $this->Conn->GetOne($sql);
$sql = 'DELETE FROM '.$ci_table.'
WHERE ItemResourceId = '.$clone_resource_id.' AND PrimaryCat = 1';
$this->Conn->Query($sql);
// 3. copy main item categoryitems to cloned item
$sql = ' INSERT INTO '.$ci_table.' (CategoryId, ItemResourceId, PrimaryCat, ItemPrefix, Filename)
SELECT CategoryId, '.$clone_resource_id.' AS ItemResourceId, PrimaryCat, ItemPrefix, Filename
FROM '.$ci_table.'
WHERE ItemResourceId = '.$object->GetDBField('ResourceId');
$this->Conn->Query($sql);
// 4. put cloned id to OrgId field of item being cloned
$sql = 'UPDATE '.$object->TableName.'
SET OrgId = '.$object->GetID().'
WHERE '.$object->IDField.' = '.$cloned_ids[0];
$this->Conn->Query($sql);
// 5. substitute id of item being cloned with clone id
$this->Application->SetVar($event->getPrefixSpecial().'_id', $cloned_ids[0]);
$selected_ids = $this->getSelectedIDs($event, true);
$selected_ids[ array_search($object->GetID(), $selected_ids) ] = $cloned_ids[0];
$this->StoreSelectedIDs($event, $selected_ids);
// 6. delete original item from temp table
$temp_handler->DeleteItems($event->Prefix, $event->Special, Array($object->GetID()));
}
}
}
/**
* Sets default expiration based on module setting
*
* @param kEvent $event
*/
function OnPreCreate(&$event)
{
parent::OnPreCreate($event);
if ($event->status == erSUCCESS) {
$object =& $event->getObject();
$owner_field = $this->getOwnerField($event->Prefix);
$object->SetDBField($owner_field, $this->Application->RecallVar('user_id'));
}
}
/**
* Occures before original item of item in pending editing got deleted (for hooking only)
*
* @param kEvent $event
*/
function OnBeforeDeleteOriginal(&$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)
{
if ($this->Application->GetVar('ResetCatBeforeClone')) {
$object =& $event->getObject();
$object->SetDBField('CategoryId', null);
}
}
/**
* Set status for new category item based on user permission in category
*
* @param kEvent $event
*/
function OnBeforeItemCreate(&$event)
{
if ($this->Application->IsAdmin()) {
return true;
}
$use_pending_editing = $this->Application->getUnitOption($event->Prefix, 'UsePendingEditing');
if ($use_pending_editing) {
$object =& $event->getObject();
/* @var $object kDBItem */
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
$primary_category = $object->GetDBField('CategoryId') > 0 ? $object->GetDBField('CategoryId') : $this->Application->GetVar('m_cat_id');
$item_status = $perm_helper->AddCheckPermission($primary_category, $event->Prefix);
if ($item_status == STATUS_DISABLED) {
$event->status = erFAIL;
return false;
}
else {
$object->SetDBField('Status', $item_status);
}
}
}
/**
* Creates category item & redirects to confirmation template (front-end only)
*
* @param kEvent $event
*/
function OnCreate(&$event)
{
parent::OnCreate($event);
$this->SetFrontRedirectTemplate($event, 'suggest');
}
/**
* Returns item's categories (allows to exclude primary category)
*
* @param int $resource_id
* @param bool $with_primary
* @return Array
*/
function getItemCategories($resource_id, $with_primary = false)
{
$sql = 'SELECT CategoryId
FROM '.TABLE_PREFIX.'CategoryItems
WHERE (ItemResourceId = '.$resource_id.')';
if (!$with_primary) {
$sql .= ' AND (PrimaryCat = 0)';
}
return $this->Conn->GetCol($sql);
}
/**
* Adds new and removes old additional categories from category item
*
* @param kCatDBItem $object
*/
function processAdditionalCategories(&$object, $mode)
{
$process_categories = $object->GetDBField('MoreCategories');
if ($process_categories === '') {
// field was not in submit & have default value (when no categories submitted, then value is null)
return ;
}
if ($mode == 'create') {
// prevents first additional category to become primary
$object->assignPrimaryCategory();
}
$process_categories = $process_categories ? explode('|', substr($process_categories, 1, -1)) : Array ();
$existing_categories = $this->getItemCategories($object->GetDBField('ResourceId'));
$add_categories = array_diff($process_categories, $existing_categories);
foreach ($add_categories as $category_id) {
$object->assignToCategory($category_id);
}
$remove_categories = array_diff($existing_categories, $process_categories);
foreach ($remove_categories as $category_id) {
$object->removeFromCategory($category_id);
}
}
/**
* Creates category item & redirects to confirmation template (front-end only)
*
* @param kEvent $event
*/
function OnUpdate(&$event)
{
$use_pending = $this->Application->getUnitOption($event->Prefix, 'UsePendingEditing');
if ($this->Application->IsAdmin() || !$use_pending) {
parent::OnUpdate($event);
$this->SetFrontRedirectTemplate($event, 'modify');
return ;
}
$object =& $event->getObject(Array('skip_autoload' => true));
/* @var $object kCatDBItem */
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
if ($items_info) {
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
$temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
/* @var $temp_handler kTempTablesHandler */
$owner_field = $this->getOwnerField($event->Prefix);
$file_helper =& $this->Application->recallObject('FileHelper');
/* @var $file_helper FileHelper */
foreach ($items_info as $id => $field_values) {
$object->Load($id);
$edit_perm = $perm_helper->ModifyCheckPermission($object->GetDBField($owner_field), $object->GetDBField('CategoryId'), $event->Prefix);
if ($use_pending && !$object->GetDBField('OrgId') && ($edit_perm == STATUS_PENDING)) {
// pending editing enabled + not pending copy -> get/create pending copy & save changes to it
$original_id = $object->GetID();
$original_resource_id = $object->GetDBField('ResourceId');
$file_helper->PreserveItemFiles($field_values);
$object->Load($original_id, 'OrgId');
if (!$object->isLoaded()) {
// 1. user has no pending copy of live item -> clone live item
$cloned_ids = $temp_handler->CloneItems($event->Prefix, $event->Special, Array($original_id), null, null, null, true);
$object->Load($cloned_ids[0]);
$object->SetFieldsFromHash($field_values);
// 1a. delete record from CategoryItems (about cloned item) that was automatically created during call of Create method of kCatDBItem
$ci_table = $this->Application->getUnitOption('ci', 'TableName');
$sql = 'DELETE FROM '.$ci_table.'
WHERE ItemResourceId = '.$object->GetDBField('ResourceId').' AND PrimaryCat = 1';
$this->Conn->Query($sql);
// 1b. copy main item categoryitems to cloned item
$sql = 'INSERT INTO '.$ci_table.' (CategoryId, ItemResourceId, PrimaryCat, ItemPrefix, Filename)
SELECT CategoryId, '.$object->GetDBField('ResourceId').' AS ItemResourceId, PrimaryCat, ItemPrefix, Filename
FROM '.$ci_table.'
WHERE ItemResourceId = '.$original_resource_id;
$this->Conn->Query($sql);
// 1c. put cloned id to OrgId field of item being cloned
$object->SetDBField('Status', STATUS_PENDING_EDITING);
$object->SetDBField('OrgId', $original_id);
}
else {
// 2. user has pending copy of live item -> just update field values
$object->SetFieldsFromHash($field_values);
}
// update id in request (used for redirect in mod-rewrite mode)
$this->Application->SetVar($event->getPrefixSpecial().'_id', $object->GetID());
}
else {
// 3. already editing pending copy -> just update field values
$object->SetFieldsFromHash($field_values);
}
if ($object->Update()) {
$event->status = erSUCCESS;
}
else {
$event->status = erFAIL;
$event->redirect = false;
break;
}
}
}
$this->SetFrontRedirectTemplate($event, 'modify');
}
/**
* Sets next template to one required for front-end after adding/modifying item
*
* @param kEvent $event
* @param string $template_key - {suggest,modify}
*/
function SetFrontRedirectTemplate(&$event, $template_key)
{
if ($this->Application->IsAdmin() || $event->status != erSUCCESS) {
return ;
}
// prepare redirect template
$object =& $event->getObject();
$is_active = ($object->GetDBField('Status') == STATUS_ACTIVE);
$next_template = $is_active ? 'confirm_template' : 'pending_confirm_template';
$event->redirect = $this->Application->GetVar($template_key.'_'.$next_template);
$event->SetRedirectParam('opener', 's');
// send email events
$perm_prefix = $this->Application->getUnitOption($event->Prefix, 'PermItemPrefix');
switch ($event->Name) {
case 'OnCreate':
$event_suffix = $is_active ? 'ADD' : 'ADD.PENDING';
$owner_field = $this->getOwnerField($event->Prefix);
$this->Application->EmailEventAdmin($perm_prefix.'.'.$event_suffix); // there are no ADD.PENDING event for admin :(
$this->Application->EmailEventUser($perm_prefix.'.'.$event_suffix, $object->GetDBField($owner_field));
break;
case 'OnUpdate':
$event_suffix = $is_active ? 'MODIFY' : 'MODIFY.PENDING';
$this->Application->EmailEventAdmin($perm_prefix.'.'.$event_suffix); // there are no ADD.PENDING event for admin :(
$this->Application->EmailEventUser($perm_prefix.'.'.$event_suffix, $object->GetDBField('ModifiedById'));
break;
}
}
/**
* Apply same processing to each item beeing selected in grid
*
* @param kEvent $event
* @access private
*/
function iterateItems(&$event)
{
if ($event->Name != 'OnMassApprove' && $event->Name != 'OnMassDecline') {
return parent::iterateItems($event);
}
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$object =& $event->getObject( Array('skip_autoload' => true) );
$ids = $this->StoreSelectedIDs($event);
if ($ids) {
foreach ($ids as $id) {
$object->Load($id);
switch ($event->Name) {
case 'OnMassApprove':
$ret = $object->ApproveChanges();
break;
case 'OnMassDecline':
$ret = $object->DeclineChanges();
break;
}
if (!$ret) {
$event->status = erFAIL;
$event->redirect = false;
break;
}
}
}
$this->clearSelectedIDs($event);
}
/**
* Deletes items & preserves clean env
*
* @param kEvent $event
*/
function OnDelete(&$event)
{
parent::OnDelete($event);
if ($event->status == erSUCCESS && !$this->Application->IsAdmin()) {
$event->SetRedirectParam('pass', 'm');
$event->SetRedirectParam('m_cat_id', 0);
}
}
/**
* Checks, that currently loaded item is allowed for viewing (non permission-based)
*
* @param kEvent $event
* @return bool
*/
function checkItemStatus(&$event)
{
$object =& $event->getObject();
if (!$object->isLoaded()) {
if ($object->Prefix != 'cms') {
$this->_errorNotFound($event);
}
return true;
}
$status = $object->GetDBField('Status');
$user_id = $this->Application->RecallVar('user_id');
$owner_field = $this->getOwnerField($event->Prefix);
if (($status == -2 || $status == STATUS_PENDING) && ($object->GetDBField($owner_field) == $user_id)) {
return true;
}
return $status == STATUS_ACTIVE;
}
/**
* Set's correct sorting for list
* based on data provided with event
*
* @param kEvent $event
* @access private
* @see OnListBuild
*/
function SetSorting(&$event)
{
if (!$this->Application->IsAdmin()) {
$event->setEventParam('same_special', true);
}
parent::SetSorting($event);
}
/**
* Returns current per-page setting for list
*
* @param kEvent $event
* @return int
*/
function getPerPage(&$event)
{
if (!$this->Application->IsAdmin()) {
$event->setEventParam('same_special', true);
}
return parent::getPerPage($event);
}
function getOwnerField($prefix)
{
$owner_field = $this->Application->getUnitOption($prefix, 'OwnerField');
if (!$owner_field) {
$owner_field = 'CreatedById';
}
return $owner_field;
}
/**
* Creates virtual image fields for item
*
* @param kEvent $event
*/
function OnAfterConfigRead(&$event)
{
parent::OnAfterConfigRead($event);
if ($event->Prefix != 'cms') {
$file_helper =& $this->Application->recallObject('FileHelper');
/* @var $file_helper FileHelper */
$file_helper->createItemFiles($event->Prefix, true); // create image fields
$file_helper->createItemFiles($event->Prefix, false); // create file fields
}
// add EditorsPick to ForcedSorting if needed
$config_mapping = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping');
if (array_key_exists('ForceEditorPick', $config_mapping) && $this->Application->ConfigValue($config_mapping['ForceEditorPick'])) {
$list_sortings = $this->Application->getUnitOption($event->Prefix, 'ListSortings');
$new_forced_sorting = Array ('EditorsPick' => 'DESC');
if (array_key_exists('ForcedSorting', $list_sortings[''])) {
foreach ($list_sortings['']['ForcedSorting'] as $sort_field => $sort_order) {
$new_forced_sorting[$sort_field] = $sort_order;
}
}
$list_sortings['']['ForcedSorting'] = $new_forced_sorting;
$this->Application->setUnitOption($event->Prefix, 'ListSortings', $list_sortings);
}
}
/**
* Returns file contents associated with item
*
* @param kEvent $event
*/
function OnDownloadFile(&$event)
{
$object =& $event->getObject();
/* @var $object kDBItem */
$event->status = erSTOP;
$field = $this->Application->GetVar('field');
if (!preg_match('/^File([\d]+)/', $field)) {
return ;
}
$file_helper =& $this->Application->recallObject('FileHelper');
/* @var $file_helper FileHelper */
$filename = $object->GetField($field, 'full_path');
$file_helper->DownloadFile($filename);
}
/**
* Saves user's vote
*
* @param kEvent $event
*/
function OnMakeVote(&$event)
{
$event->status = erSTOP;
if ($this->Application->GetVar('ajax') != 'yes') {
// this is supposed to call from AJAX only
return ;
}
$rating_helper =& $this->Application->recallObject('RatingHelper');
/* @var $rating_helper RatingHelper */
$object =& $event->getObject( Array ('skip_autoload' => true) );
/* @var $object kDBItem */
$object->Load( $this->Application->GetVar('id') );
echo $rating_helper->makeVote($object);
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/general/cat_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.97.2.32
\ No newline at end of property
+1.97.2.33
\ 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 11537)
+++ branches/RC/core/admin_templates/agents/agent_edit.tpl (revision 11538)
@@ -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"/>
+<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">
+ <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>
+ </table>
</div>
<inp2:m_include t="incs/footer"/>
Property changes on: branches/RC/core/admin_templates/agents/agent_edit.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/agents/agent_list.tpl
===================================================================
--- branches/RC/core/admin_templates/agents/agent_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/agents/agent_list.tpl (revision 11538)
@@ -1,79 +1,79 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:agents" prefix="agent" title_preset="agent_list"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:agents" prefix="agent" title_preset="agent_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('agent', 'agents/agent_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_agent', '<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
function() {
std_precreate_item('agent', 'agents/agent_edit');
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('agent')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton(
new ToolBarButton(
'approve',
'<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>',
function() {
submit_event('agent', 'OnMassApprove');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'decline',
'<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>',
function() {
submit_event('agent', 'OnMassDecline');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'cancel',
'<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>',
function() {
submit_event('agent', 'OnMassCancel');
}
)
);
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="agent" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="agent" IdField="AgentId" grid="Default" grid_filters="1"/>
<script type="text/javascript">
Grids['agent'].SetDependantToolbarButtons( new Array('edit','delete', 'approve', 'decline', 'cancel') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/agents/agent_list.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/export/export_progress.tpl
===================================================================
--- branches/RC/core/admin_templates/export/export_progress.tpl (revision 11537)
+++ branches/RC/core/admin_templates/export/export_progress.tpl (revision 11538)
@@ -1,38 +1,35 @@
<inp2:adm_SetPopupSize width="515" height="194"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
-
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:m_include t="incs/header"/>
<inp2:m_Get var="PrefixSpecial" result_to_var="exportprefix" />
<inp2:{$exportprefix}_PermSection section="main" result_to_var="permsection" />
<inp2:m_RenderElement name="combined_header" section="$permsection" prefix="adm" title_preset="csv_export"/>
- <script type="text/javascript" src="js/ajax.js"></script>
<inp2:m_RenderElement name="ajax_progress_bar" cancel_action="cancel_action();"/>
<script type="text/javascript">
function cancel_action() {
redirect('<inp2:m_Link template="export/export_complete"/>');
}
function rand(n)
{
return (Math.floor(Math.random() * n + 1));
}
-
+
var PrefixSpecial = '<inp2:m_Get var="PrefixSpecial" js_escape="1" />';
var grid = '<inp2:m_Get var="grid" js_escape="1" />';
var export_rand = '';
for(var i=0; i<10; i++) {
export_rand += (rand(10) - 1);
}
var action_url = '<inp2:m_t template="index" adm_event="OnExportCSV" type="return_progress" finish_template="export/export_complete" PrefixSpecial="#PrefixSpecial#" grid="#grid#" export_rand="#export_rand#" pass="m,adm" no_amp="1"/>';
action_url = action_url.replace('#PrefixSpecial#', PrefixSpecial);
action_url = action_url.replace('#grid#', grid);
action_url = action_url.replace('#export_rand#', export_rand);
-
+
// window.open(action_url);
-
+
$QueueProcessor = new AjaxProgressBar(action_url);
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/export/export_progress.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.4.1
\ No newline at end of property
+1.1.4.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/export/export_complete.tpl
===================================================================
--- branches/RC/core/admin_templates/export/export_complete.tpl (revision 11537)
+++ branches/RC/core/admin_templates/export/export_complete.tpl (revision 11538)
@@ -1,23 +1,32 @@
-<inp2:m_include t="incs/header" nobody="yes"/>
-
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF" onload="window.location.href='<inp2:m_t template="index" adm_event="OnGetCSV" pass="m,adm" no_amp="1"/>';">
+<inp2:adm_SetPopupSize width="515" height="194"/>
+<inp2:m_include t="incs/header"/>
<inp2:adm_ExportData var="prefix" result_to_var="exportprefix" />
<inp2:{$exportprefix}_PermSection section="main" result_to_var="permsection" />
<inp2:m_RenderElement name="combined_header" section="$permsection" prefix="adm" title_preset="csv_export"/>
+<div id="scroll_container">
<table class="edit-form">
- <inp2:m_RenderElement name="subsection" title="la_prompt_ExportCompleteMessage"/>
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
- <td colspan="3" align="center">
- <a href="<inp2:m_t template="index" adm_event="OnGetCSV" pass="m,adm"/>"><inp2:m_phrase name="la_DownloadCSV"/></a>
- </td>
- </tr>
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
- <td colspan="3" align="center">
- <input type="button" value="<inp2:m_phrase name="la_Close"/>" class="button" onclick="window_close();"/>
- </td>
- </tr>
-</table>
+ <inp2:m_RenderElement name="subsection" title="la_prompt_ExportCompleteMessage"/>
+ <tr class="<inp2:m_odd_even odd='table-color1' even='table-color2'/>">
+ <td colspan="3" align="center">
+ <a href="<inp2:m_t template="index" adm_event="OnGetCSV" pass="m,adm"/>"><inp2:m_phrase name="la_DownloadCSV"/></a>
+ </td>
+ </tr>
+ <tr class="<inp2:m_odd_even odd='table-color1' even='table-color2'/>">
+ <td colspan="3" align="center">
+ <input type="button" value="<inp2:m_phrase name="la_Close"/>" class="button" onclick="window_close();"/>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<script type="text/javascript">
+ $(document).ready(
+ function() {
+ window.location.href = '<inp2:m_t template="index" adm_event="OnGetCSV" pass="m,adm" no_amp="1"/>';
+ }
+ );
+</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/export/export_complete.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.4.2
\ No newline at end of property
+1.1.4.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/no_permission.tpl
===================================================================
--- branches/RC/core/admin_templates/no_permission.tpl (revision 11537)
+++ branches/RC/core/admin_templates/no_permission.tpl (revision 11538)
@@ -1,61 +1,63 @@
<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>
</script>
</td>
</tr>
</tbody>
</table>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered">
- <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="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>
<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.3
\ No newline at end of property
+1.5.2.4
\ No newline at end of property
Index: branches/RC/core/admin_templates/thesaurus/thesaurus_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/thesaurus/thesaurus_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/thesaurus/thesaurus_edit.tpl (revision 11538)
@@ -1,73 +1,73 @@
<inp2:adm_SetPopupSize width="550" height="400"/>
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:thesaurus" prefix="thesaurus" title_preset="spelling_dictionary_edit"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:thesaurus" prefix="thesaurus" title_preset="thesaurus_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('thesaurus', '<inp2:thesaurus_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
cancel_edit('thesaurus', 'OnCancelEdit','<inp2:thesaurus_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('thesaurus', '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('thesaurus', '<inp2:thesaurus_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('thesaurus', '<inp2:thesaurus_NextId/>');
}
) );
a_toolbar.Render();
<inp2:m_if check="thesaurus_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="thesaurus_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="thesaurus_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:thesaurus_SaveWarning name="grid_save_warning"/>
<inp2:thesaurus_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="inp_id_label" prefix="thesaurus" field="ThesaurusId" title="la_fld_Id"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="thesaurus" field="SearchTerm" title="la_fld_SearchTerm"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="thesaurus" field="ThesaurusTerm" title="la_fld_ThesaurusTerm"/>
<!--<inp2:m_RenderElement name="inp_edit_radio" prefix="thesaurus" field="ThesaurusType" title="la_fld_ThesaurusType"/>-->
<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/thesaurus/thesaurus_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/thesaurus/thesaurus_list.tpl
===================================================================
--- branches/RC/core/admin_templates/thesaurus/thesaurus_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/thesaurus/thesaurus_list.tpl (revision 11538)
@@ -1,54 +1,54 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:thesaurus" prefix="thesaurus" title_preset="thesaurus_list" />
+<inp2:m_RenderElement name="combined_header" section="in-portal:thesaurus" prefix="thesaurus" title_preset="thesaurus_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('thesaurus', 'thesaurus/thesaurus_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
function() {
std_precreate_item('thesaurus', 'thesaurus/thesaurus_edit');
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('thesaurus')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('export', '<inp2:m_phrase label="la_ToolTip_Export" escape="1"/>', function() {
std_csv_export('thesaurus', 'Default', 'export/export_progress');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="thesaurus" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="thesaurus" IdField="ThesaurusId" grid="Default" grid_filters="1"/>
<script type="text/javascript">
Grids['thesaurus'].SetDependantToolbarButtons( new Array('edit','delete') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/thesaurus/thesaurus_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/categories/categories_edit_custom.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/categories_edit_custom.tpl (revision 11537)
+++ branches/RC/core/admin_templates/categories/categories_edit_custom.tpl (revision 11538)
@@ -1,74 +1,73 @@
-<inp2:m_RequireLogin permissions="CATEGORY.VIEW"/>
-<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="c" icon="icon46_catalog" module="in-portal" title="la_title_Categories"/>
+<inp2:adm_SetPopupSize width="880" height="680"/>
+<inp2:m_include t="incs/header"/>
<inp2:m_include t="categories/categories_tabs"/>
-<inp2:m_RenderElement name="blue_bar" prefix="c" title_preset="categories_custom" module="in-portal" icon="icon46_catalog"/>
+<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" perm_section="CATEGORY" permission_type="VIEW" system_permission="0" title_preset="categories_custom" 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('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="cf" grid="SeparateTab"/>
</tr>
</tbody>
</table>
-<inp2:c_SaveWarning name="grid_save_warning"/>
-
<inp2:m_include t="incs/custom_blocks"/>
<inp2:m_RenderElement
name="grid"
PrefixSpecial="cf"
SourcePrefix="c"
value_field="Value"
+ IdField="CustomFieldId"
per_page="-1"
grid="SeparateTab"
header_block="grid_column_title_no_sorting"
no_init="no_init"
/>
-<inp2:m_include t="incs/footer"/>
+<input type="hidden" name="cf_type" value="<inp2:c_UnitOption name='ItemType'/>"/>
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/categories/categories_edit_custom.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/categories/categories_edit_permissions.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/categories_edit_permissions.tpl (revision 11537)
+++ branches/RC/core/admin_templates/categories/categories_edit_permissions.tpl (revision 11538)
@@ -1,194 +1,201 @@
-<inp2:m_RequireLogin permissions="CATEGORY.VIEW" ajax="yes"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
-<inp2:m_include template="catalog/catalog_elements"/>
+<inp2:adm_SetPopupSize width="880" height="680"/>
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF" onload="$PermManager.Init();">
-<inp2:m_RenderElement name="section_header" prefix="c" icon="icon46_catalog" module="in-portal" title="la_title_Categories"/>
+<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"/>
-<inp2:m_RenderElement name="blue_bar" prefix="c" title_preset="categories_permissions" module="in-portal" icon="icon46_catalog"/>
-
<!-- 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="catalog_search_box"/>
+ <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>
<!-- 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>
Property changes on: branches/RC/core/admin_templates/categories/categories_edit_permissions.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.13.2.5
\ No newline at end of property
+1.13.2.6
\ No newline at end of property
Index: branches/RC/core/admin_templates/categories/cache_updater.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/cache_updater.tpl (revision 11537)
+++ branches/RC/core/admin_templates/categories/cache_updater.tpl (revision 11538)
@@ -1,52 +1,45 @@
-<inp2:m_RequireLogin permissions="CATEGORY.VIEW"/>
-<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="c" icon="icon46_catalog" module="in-portal" title="!la_title_Categories!"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="c" title_preset="categories_update" module="in-portal" icon="icon46_catalog"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" perm_section="CATEGORY" permission_type="VIEW" system_permission="0" title_preset="categories_update"/>
<inp2:m_if check="c_InitCacheUpdater" destination_template="catalog/catalog">
<table width="100%" border="0" cellspacing="0" cellpadding="2" class="tableborder">
<tr>
<td align="center" colspan="3" bgcolor="#FFFFFF">
<inp2:m_phrase name="la_confirm_maintenance"/>
</td>
</tr>
<tr>
<td align="center" colspan="3" bgcolor="#FFFFFF">
<inp2:m_phrase name="la_prompt_perform_now"/>
</td>
</tr>
<tr>
<td align="right" width="50%">
<input type="button" name="yes_btn" value="<inp2:m_phrase name="lu_yes"/>" onclick="goto_url('<inp2:m_t continue="1"/>');" class="button" />
</td>
<td>
<img src="img/spacer.gif" width="10" />
</td>
<td align="left" width="50%">
- <input type="button" name="yes_btn" value="<inp2:m_phrase name="lu_no"/>" onclick="javascript:goto_url('<inp2:m_t continue="0"/>');" class="button" />
+ <input type="button" name="yes_btn" value="<inp2:m_phrase name="lu_no"/>" onclick="javascript:window_close();" class="button" />
</td>
</tr>
</table>
<inp2:m_else/>
- <script type="text/javascript" src="js/ajax.js"></script>
<inp2:m_RenderElement name="ajax_progress_bar" cancel_action="cancel_action();"/>
<script type="text/javascript">
function cancel_action() {
- redirect('<inp2:m_t t="catalog/catalog" pass="m"/>');
+ window_close();
}
$CacheUpdater = new AjaxProgressBar('<inp2:m_t t="categories/xml/cache_updater" continue="2" no_amp="1"/>');
</script>
</inp2:m_if>
<script type="text/javascript">
function goto_url($url) {
window.location.href = $url;
}
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/categories/cache_updater.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.9.2.2
\ No newline at end of property
+1.9.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/categories/categories_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/categories_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/categories/categories_edit.tpl (revision 11538)
@@ -1,189 +1,180 @@
<inp2:adm_SetPopupSize width="880" height="680"/>
-<inp2:m_RequireLogin permissions="CATEGORY.VIEW"/>
<inp2:m_include t="incs/header"/>
-
-<inp2:m_RenderElement name="section_header" prefix="c" icon="icon46_catalog" module="in-portal" title="!la_title_Categories!"/>
-
<inp2:m_include t="categories/categories_tabs"/>
-<inp2:m_RenderElement name="blue_bar" prefix="c" title_preset="categories_edit" module="in-portal" icon="icon46_catalog"/>
+<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" perm_section="CATEGORY" permission_type="VIEW" system_permission="0" title_preset="categories_edit" 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('c','<inp2:c_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('c','OnCancel');
}
) );
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/>');
}
) );
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="ml_selector" prefix="c"/>
</tr>
</tbody>
</table>
<inp2:c_SaveWarning name="grid_save_warning"/>
<inp2:c_ErrorWarning name="form_error_warning"/>
-<inp2:m_DefineElement name="filename_edit">
-
-
-</inp2:m_DefineElement>
-
<div id="scroll_container">
- <div id="width_status">
+ <!--<div id="width_status">
Status:
- </div>
+ </div>-->
<table class="edit-form">
<inp2:m_RenderElement name="subsection" title="!la_section_Category!"/>
<inp2:m_RenderElement name="inp_id_label" prefix="c" field="CategoryId" title="!la_fld_CategoryId!"/>
<inp2:m_RenderElement name="inp_edit_box_ml" prefix="c" field="Name" title="!la_fld_PageTitle!" size="70"/> <!-- la_fld_Name -->
<inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="c" field="Description" title="!la_fld_Description!" control_options="{min_height: 130}" rows="7" cols="70"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="c" field="AutomaticFilename" title=" la_fld_AutoCreateFileName" onclick="reflectFilename()"/> <!-- la_fld_CategoryAutomaticFilename -->
<inp2:m_RenderElement name="inp_edit_box" prefix="c" field="Filename" title="la_fld_Filename" size="70" /> <!-- la_fld_CategoryFilename -->
<inp2:m_RenderElement name="inp_edit_category" prefix="c" field="SymLinkCategoryId" title="la_fld_SymLinkCategoryId"/>
<inp2:m_RenderElement name="subsection" title="la_section_Page"/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="c" field="OldPriority"/>
<inp2:m_RenderElement name="inp_edit_box_ml" prefix="c" field="Title" title="!la_fld_PageContentTitle!" size="40"/>
<inp2:m_RenderElement name="inp_edit_box_ml" prefix="c" field="MenuTitle" title="!la_fld_PageMentTitle!" size="40"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="c" field="FriendlyURL" title="la_fld_FriendlyURL" size="63"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="c" field="ParentId" title="la_fld_ParentSection"/>
<!-- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="c" field="IsSystem" title="!la_fld_IsSystemTemplate!" onchange="OnSystemClick()"/>-->
<inp2:m_if check="c_Field" name="IsSystem" equals_to="1" db="db">
<inp2:m_if check="m_IsDebugMode">
<inp2:m_RenderElement name="inp_edit_box" prefix="c" field="Template" title="la_fld_TemplateFile" size="40"/>
</inp2:m_if>
<inp2:m_else/>
<inp2:m_RenderElement name="inp_edit_options" prefix="c" field="Template" title="la_fld_TemplateType" has_empty="1" size="40"/>
</inp2:m_if>
<inp2:m_RenderElement name="inp_edit_options" prefix="c" field="FormId" title="!la_fld_Form!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="c" field="FormSubmittedTemplate" title="la_fld_FormSubmittedTemplate" size="60"/>
<inp2:m_if check="m_IsDebugMode">
<inp2:m_RenderElement name="inp_edit_options" prefix="c" field="IsIndex" title="la_fld_IsIndex"/>
</inp2:m_if>
<inp2:m_RenderElement name="inp_edit_radio" prefix="c" field="IsMenu" title="la_fld_MenuStatus"/>
<inp2:m_RenderElement name="subsection" title="!la_section_Properties!"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="c" field="Status" title="!la_fld_Status!"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="c" field="NewItem" title="!la_fld_New!"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="c" field="EditorsPick" title="!la_fld_EditorsPick!"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="c" field="Priority" title="la_fld_Priority"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="c" field="UseMenuIconUrl" title="!la_fld_UseMenuIcon!" onclick="reflectMenuIcon();"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="c" field="MenuIconUrl" title="!la_fld_MenuIcon!" size="60"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="c" field="UseExternalUrl" title="la_fld_UseExternalUrl" onclick="reflectExternalUrl();"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="c" field="ExternalUrl" title="la_fld_ExternalUrl" size="60"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="c" field="CreatedOn" title="!la_fld_CreatedOn!"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="c" field="MetaKeywords" title="!la_fld_MetaKeywords!" allow_html="0" control_options="{min_height: 90}" rows="3" cols="70"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="c" field="MetaDescription" title="!la_fld_MetaDescription!" allow_html="0" control_options="{min_height: 90}" rows="4" cols="70"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="c" field="IndexTools" title="!la_fld_TrackingCode!" control_options="{min_height: 90}" allow_html="0"/>
<!-- custom fields: begin -->
<inp2:m_include t="incs/custom_blocks"/>
<inp2:cf.general_PrintList render_as="cv_row_block" SourcePrefix="c" value_field="Value" per_page="-1" grid="Default" />
<!-- custom fields: end -->
- <inp2:m_RenderElement name="inp_edit_filler" />
+ <inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
<script type="text/javascript">
function getControl ($field, $appendix, $prepend) {
var $field_mask = '<inp2:c_InputName field="#FIELD_NAME#"/>';
$appendix = isset($appendix) ? '_' + $appendix : '';
$prepend = isset($prepend) ? $prepend + '_' : '';
return document.getElementById( $prepend + $field_mask.replace('#FIELD_NAME#', $field) + $appendix );
}
function reflectMenuIcon() {
getControl('MenuIconUrl').parentNode.parentNode.style.display = getControl('UseMenuIconUrl', null, '_cb').checked ? '' : 'none';
}
function reflectExternalUrl() {
getControl('ExternalUrl').parentNode.parentNode.style.display = getControl('UseExternalUrl', null, '_cb').checked ? '' : 'none';
}
function OnSystemClick() {
var cel = getControl('IsSystem', null, '_cb');
var tel = getControl('Template');
if (cel) {
if (cel.checked) {
cel.setAttribute('old_template', tel.value);
tel.value='';
tel.disabled = true;
tel.readonly = true;
}
else {
var old_template = cel.getAttribute('old_template');
tel.disabled = false;
tel.readonly = false;
if (old_template) {
tel.value = old_template;
}
cel.setAttribute('old_template', '');
}
}
}
function reflectFilename() {
var $checked = getControl('AutomaticFilename', null, '_cb').checked;
getControl('Filename').readOnly = $checked;
}
$(document).ready(
function() {
reflectMenuIcon();
reflectExternalUrl();
reflectFilename();
// OnSystemClick();
}
);
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/categories/categories_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5.2.12
\ No newline at end of property
+1.5.2.13
\ No newline at end of property
Index: branches/RC/core/admin_templates/categories/categories_tabs.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/categories_tabs.tpl (revision 11537)
+++ branches/RC/core/admin_templates/categories/categories_tabs.tpl (revision 11538)
@@ -1,28 +1,14 @@
<inp2:m_DefineElement name="grid_save_warning">
-<table id="save_warning" width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_notop" style="display: <inp2:m_if check="m_ParamEquals" name="display" value="1">block<inp2:m_else/>none</inp2:_if>;">
- <tr>
- <td valign="top" class="hint_red">
- <inp2:m_phrase name="la_Warning_Save_Item"/>
- </td>
- </tr>
-</table>
-<script type="text/javascript">
- $edit_mode = <inp2:m_if check="m_ParamEquals" name="display" value="1">true<inp2:m_else />false</inp2:m_if>;
-</script>
-</inp2:m_DefineElement>
-
-<inp2:m_DefineElement name="categories_tabs">
- <inp2:m_if check="c_IsRootCategory">
- <inp2:m_RenderElement name="tab" title="la_tab_Permissions" t="categories/categories_edit_permissions" main_prefix="c"/>
- <inp2:m_else/>
- <inp2:m_RenderElement name="tab" title="la_tab_General" t="categories/categories_edit" main_prefix="c"/>
- <inp2:m_RenderElement name="tab" title="la_tab_Properties" t="categories/categories_edit_properties" main_prefix="c"/>
- <inp2:m_RenderElement name="tab" title="la_tab_Relations" t="categories/categories_edit_relations" main_prefix="c"/>
- <inp2:m_RenderElement name="tab" title="la_tab_Related_Searches" t="categories/categories_edit_related_searches" main_prefix="c"/>
- <inp2:m_RenderElement name="tab" title="la_tab_Images" t="categories/categories_edit_images" main_prefix="c"/>
- <inp2:m_RenderElement name="tab" title="la_tab_Permissions" t="categories/categories_edit_permissions" main_prefix="c"/>
- <inp2:m_RenderElement name="tab" title="la_tab_Custom" t="categories/categories_edit_custom" main_prefix="c"/>
- </inp2:m_if>
-</inp2:m_DefineElement>
-
-<inp2:m_RenderElement name="tabs_container" tabs_render_as="categories_tabs"/>
+ <table id="save_warning" width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_notop"<inp2:m_ifnot check="m_Param" name="display"> style="display: none;"</inp2:_ifnot>>
+ <tr>
+ <td valign="top" class="form-warning">
+ <inp2:m_phrase name="la_Warning_Save_Item"/>
+ </td>
+ </tr>
+ </table>
+ <script type="text/javascript">
+ // used from "categories/permissions_tab" template (via ajax)
+ $edit_mode = <inp2:m_if check="m_ParamEquals" name="display" value="1">true<inp2:m_else />false</inp2:m_if>;
+ if (Form) Form.Changed();
+ </script>
+</inp2:m_DefineElement>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/categories/categories_tabs.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/categories/related_searches_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/related_searches_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/categories/related_searches_edit.tpl (revision 11538)
@@ -1,42 +1,43 @@
-<inp2:m_RequireLogin permissions="CATEGORY.VIEW"/>
-<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="c" icon="icon46_catalog" module="in-portal" title="!la_title_Categories!"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="c" title_preset="related_searches_edit" module="in-portal" icon="icon46_catalog"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" perm_section="CATEGORY" permission_type="VIEW" system_permission="0" title_preset="related_searches_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('c-search','<inp2:c-search_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('c-search','OnCancel');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <inp2:m_RenderElement name="subsection" title="!la_section_Relation!"/>
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="c-search" field="ResourceId"/>
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="c-search" field="ItemType"/>
+<inp2:c-search_SaveWarning name="grid_save_warning"/>
+<inp2:c-search_ErrorWarning name="form_error_warning"/>
- <inp2:m_RenderElement name="inp_id_label" prefix="c-search" field="RelatedSearchId" title="la_fld_Id"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="c-search" field="Keyword" title="!la_fld_RelatedSearchKeyword!" size="50"/>
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="c-search" field="Enabled" title="!la_fld_Enabled!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="c-search" field="Priority" title="!la_fld_Priority!" size="4"/>
-</table>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" title="!la_section_Relation!"/>
+ <inp2:m_RenderElement name="inp_edit_hidden" prefix="c-search" field="ResourceId"/>
+ <inp2:m_RenderElement name="inp_edit_hidden" prefix="c-search" field="ItemType"/>
+
+ <inp2:m_RenderElement name="inp_id_label" prefix="c-search" field="RelatedSearchId" title="la_fld_Id"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="c-search" field="Keyword" title="!la_fld_RelatedSearchKeyword!" size="50"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="c-search" field="Enabled" title="!la_fld_Enabled!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="c-search" field="Priority" title="!la_fld_Priority!" size="4"/>
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
<inp2:m_include t="incs/footer"/>
Property changes on: branches/RC/core/admin_templates/categories/related_searches_edit.tpl
___________________________________________________________________
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/admin_templates/categories/xml/cache_updater.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/xml/cache_updater.tpl (revision 11537)
+++ branches/RC/core/admin_templates/categories/xml/cache_updater.tpl (revision 11538)
@@ -1 +1 @@
-<inp2:c_InitCacheUpdater destination_template="catalog/catalog" progress="1"/>
\ No newline at end of file
+<inp2:c_InitCacheUpdater destination_template="incs/close_popup" progress="1"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/categories/xml/cache_updater.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2.2.1
\ No newline at end of property
+1.2.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/categories/xml/categories_list.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/xml/categories_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/categories/xml/categories_list.tpl (revision 11538)
@@ -1,82 +1,82 @@
<inp2:lang.current_Field name="Charset" result_to_var="charset"/>
<inp2:m_Header data="Content-type: text/plain; charset=$charset"/>
<inp2:m_include t="incs/blocks"/>
<inp2:m_include t="incs/in-portal"/>
<inp2:m_include t="categories/ci_blocks"/>
<inp2:c_InitList grid="Structure" no_special="1"/>
<inp2:m_DefineElement name="page_entercat_td" format="" no_special="">
<a href="javascript:$Catalog.go_to_cat(<inp2:m_get name="c_id"/>, '<inp2:GetModulePrefix/>');">
<inp2:m_Phrase label="lu_ViewSubPages"/>
</a> <span class="cats_stats">(<inp2:SubCatCount/> / <inp2:ItemCount/>)</span>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="page_browse_td" format="" no_special="">
<a href="<inp2:PageBrowseLink/>"><inp2:Field field="$field" grid="$grid" no_special="$no_special" format="$format"/></a>
<!--&nbsp;
<span class="priority">
<inp2:m_if check="FieldEquals" field="Priority" value="0" inverse="inverse">
<sup><inp2:Field field="Priority"/></sup>
</inp2:m_if>
</span>-->
<inp2:m_if check="Field" field="IsSystem">
<span class="field-required">&nbsp;*</span>
</inp2:m_if>
</inp2:m_DefineElement>
var catalog_height = $Catalog.BottomVisible ? 200 : 'auto';
<inp2:m_if check="m_GetEquals" name="tm" value="single">
<inp2:m_RenderElement name="grid_js" PrefixSpecial="c" IdField="CategoryId" grid="Structure" grid_height="catalog_height" no_special="1" grid_status="0" menu_filters="yes" selector="radio"/>
<inp2:m_else/>
<inp2:m_RenderElement name="grid_js" PrefixSpecial="c" IdField="CategoryId" grid="Structure" grid_height="catalog_height" no_special="1" grid_status="0" menu_filters="yes"/>
</inp2:m_if>
Grids['c'].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6'));
// substiture form action, like from was created from here
document.getElementById('categories_form').action = '<inp2:m_t pass="all" js_escape="1"/>';
$Catalog.setItemCount('c', '<inp2:c_TotalRecords no_special="1"/>');
document.getElementById('top_pagination_bar[c]').innerHTML = '<inp2:m_RenderElement name="grid_pagination_elem" PrefixSpecial="c" no_special="1" ajax="1" js_escape="1"/>';
$Catalog.ParentCategoryID = <inp2:c_GetParentCategory/>;
document.getElementById('c_search_warning').style.display = '<inp2:m_if check="m_RecallEquals" var="c_search_keyword" value="" inverse="inverse">block<inp2:m_else/>none</inp2:m_if>';
document.getElementById('c_search_keyword').value = '<inp2:c_SearchKeyword no_special="1" js_escape="1"/>';
set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
<inp2:m_DefineElement name="category_caption">
<span class="nav_current_item">
- <inp2:m_if check="m_ParamEquals" name="cat_id" value="0" inverse="inverse">
+ <inp2:m_ifnot check="c_HomeCategory" equals_to="$cat_id">
<inp2:m_param name="separator"/>
- </inp2:m_if>
+ </inp2:m_ifnot>
<inp2:m_if check="m_ParamEquals" name="current" value="1" inverse="1">
<a class="control_link" href="javascript:$Catalog.go_to_cat(<inp2:m_param name="cat_id"/>);"><inp2:m_param name="cat_name"/></a>
<inp2:m_else/>
<inp2:m_param name="cat_name"/>
</inp2:m_if>
</span>
</inp2:m_DefineElement>
setInnerHTML('category_path', '<inp2:c_CategoryPath separator="&gt;" render_as="category_caption" js_escape="1"/>');
<inp2:m_if check="m_GetEquals" name="m_cat_id" value="0">
a_toolbar.DisableButton('upcat');
a_toolbar.DisableButton('homecat');
<inp2:m_else/>
a_toolbar.EnableButton('upcat');
a_toolbar.EnableButton('homecat');
</inp2:m_if>
<inp2:m_if check="m_GetEquals" name="tm" value="single">
Grids['c'].DblClick = function() {return false};
</inp2:m_if>
$Catalog.reflectPasteButton(<inp2:c_HasClipboard/>);
<inp2:m_if check="m_Recall" name="root_delete_error">
alert('<inp2:m_Phrase name="la_error_RootCategoriesDelete"/>');
<inp2:m_RemoveVar name="root_delete_error"/>
</inp2:m_if>
#separator#
<inp2:c_UpdateLastTemplate template="catalog/catalog"/>
<inp2:m_RenderElement name="grid" ajax="1" PrefixSpecial="c" IdField="CategoryId" grid="Structure" no_special="1" grid_status="0" menu_filters="yes"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/categories/xml/categories_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.21.2.10
\ No newline at end of property
+1.21.2.11
\ No newline at end of property
Index: branches/RC/core/admin_templates/categories/relations_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/relations_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/categories/relations_edit.tpl (revision 11538)
@@ -1,63 +1,65 @@
-<inp2:m_RequireLogin permissions="CATEGORY.VIEW"/>
-<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="c" icon="icon46_catalog" module="in-portal" title="!la_title_Categories!"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="c" title_preset="relations_edit" module="in-portal" icon="icon46_catalog"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" perm_section="CATEGORY" permission_type="VIEW" system_permission="0" title_preset="relations_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('c-rel','<inp2:c-rel_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('c-rel','OnCancel');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.Render();
<inp2:m_if check="c-rel_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
a_toolbar.HideButton('sep2');
<inp2:m_else/>
<inp2:m_if check="c-rel_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="c-rel_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_include t="categories/ci_blocks"/>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <inp2:m_RenderElement name="subsection" title="!la_section_Relation!"/>
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="c-rel" field="SourceId"/>
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="c-rel" field="SourceType"/>
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="c-rel" field="TargetId"/>
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="c-rel" field="TargetType"/>
-
- <inp2:m_RenderElement name="inp_id_label" prefix="c-rel" field="RelationshipId" title="!la_fld_RelationshipId!"/>
- <inp2:m_RenderElement name="inp_edit_relation" prefix="c-rel" field="TargetId" title="!la_fld_TargetId!"/>
- <inp2:m_RenderElement name="inp_edit_radio" prefix="c-rel" field="Type" title="!la_fld_RelationshipType!"/>
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="c-rel" field="Enabled" title="!la_fld_Enabled!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="c-rel" field="Priority" title="!la_fld_Priority!" size="4"/>
-</table>
+<inp2:c-rel_SaveWarning name="grid_save_warning"/>
+<inp2:c-rel_ErrorWarning name="form_error_warning"/>
+
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" title="!la_section_Relation!"/>
+ <inp2:m_RenderElement name="inp_edit_hidden" prefix="c-rel" field="SourceId"/>
+ <inp2:m_RenderElement name="inp_edit_hidden" prefix="c-rel" field="SourceType"/>
+ <inp2:m_RenderElement name="inp_edit_hidden" prefix="c-rel" field="TargetId"/>
+ <inp2:m_RenderElement name="inp_edit_hidden" prefix="c-rel" field="TargetType"/>
+
+ <inp2:m_RenderElement name="inp_id_label" prefix="c-rel" field="RelationshipId" title="!la_fld_RelationshipId!"/>
+ <inp2:m_RenderElement name="inp_edit_relation" prefix="c-rel" field="TargetId" title="!la_fld_TargetId!"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="c-rel" field="Type" title="!la_fld_RelationshipType!"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="c-rel" field="Enabled" title="!la_fld_Enabled!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="c-rel" field="Priority" title="!la_fld_Priority!" size="4"/>
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
<inp2:m_include t="incs/footer"/>
Property changes on: branches/RC/core/admin_templates/categories/relations_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4.2.1
\ No newline at end of property
+1.4.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/categories/categories_edit_properties.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/categories_edit_properties.tpl (revision 11537)
+++ branches/RC/core/admin_templates/categories/categories_edit_properties.tpl (revision 11538)
@@ -1,64 +1,65 @@
-<inp2:m_RequireLogin permissions="CATEGORY.VIEW"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
+<inp2:adm_SetPopupSize width="880" height="680"/>
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
-
-<inp2:m_RenderElement name="section_header" prefix="c" icon="icon46_catalog" module="in-portal" title="!la_title_Categories!"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" perm_section="CATEGORY" permission_type="VIEW" system_permission="0" title_preset="categories_properties" tab_preset="Default"/>
<inp2:m_include t="categories/categories_tabs"/>
-<inp2:m_RenderElement name="blue_bar" prefix="c" title_preset="categories_properties" module="in-portal" icon="icon46_catalog"/>
-
<!-- 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('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/>');
}
) );
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>
</tr>
</tbody>
</table>
<inp2:c_SaveWarning name="grid_save_warning"/>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <inp2:m_ModuleInclude template="category_properties" />
-</table>
+<inp2:c_ErrorWarning name="form_error_warning"/>
+
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_ModuleInclude template="category_properties" />
+ <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/categories/categories_edit_properties.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4.2.1
\ No newline at end of property
+1.4.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/categories/categories_edit_related_searches.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/categories_edit_related_searches.tpl (revision 11537)
+++ branches/RC/core/admin_templates/categories/categories_edit_related_searches.tpl (revision 11538)
@@ -1,126 +1,121 @@
-<inp2:m_RequireLogin permissions="CATEGORY.VIEW"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
+<inp2:adm_SetPopupSize width="880" height="680"/>
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
-<inp2:m_RenderElement name="section_header" prefix="c" icon="icon46_catalog" module="in-portal" title="!la_title_Categories!"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" perm_section="CATEGORY" permission_type="VIEW" system_permission="0" title_preset="categories_related_searches" tab_preset="Default" pagination="1" pagination_prefix="c-search"/>
<inp2:m_include t="categories/categories_tabs"/>
-<inp2:m_RenderElement name="blue_bar" prefix="c" title_preset="categories_related_searches" module="in-portal" icon="icon46_catalog"/>
-
<!-- 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('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/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
//Relations related:
a_toolbar.AddButton( new ToolBarButton('new_related_search', '<inp2:m_phrase label="la_ToolTip_New_Keyword" escape="1"/>',
function() {
std_new_item('c-search', 'categories/related_searches_edit')
} ) );
function edit()
{
std_edit_temp_item('c-search', 'categories/related_searches_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('c-search')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('move_up', '<inp2:m_phrase label="la_ToolTip_MoveUp" escape="1"/>', function() {
submit_event('c-search','OnMassMoveUp');
}
) );
a_toolbar.AddButton( new ToolBarButton('move_down', '<inp2:m_phrase label="la_ToolTip_MoveDown" escape="1"/>', function() {
submit_event('c-search','OnMassMoveDown');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
submit_event('c-search','OnMassApprove');
}
) );
a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
submit_event('c-search','OnMassDecline');
}
) );
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="c_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
//a_toolbar.HideButton('sep2');
<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="c-search" grid="Default"/>
</tr>
</tbody>
</table>
-<inp2:m_DefineElement name="grid_keyword_td" >
- <td valign="top" class="text">
- <input type="checkbox" name="<inp2:{$PrefixSpecial}_InputName field="$IdField" IdField="$IdField"/>" id="<inp2:{$PrefixSpecial}_InputName field="$IdField" IdField="$IdField"/>">
- <img src="<inp2:ModulePath module="In-Portal"/>img/itemicons/<inp2:{$PrefixSpecial}_ItemIcon grid="$grid"/>">
- <inp2:Field field="$field" grid="$grid"/><span class="priority"><inp2:m_if check="{$PrefixSpecial}_fieldequals" field="Priority" value="0"><inp2:m_else/><sup><inp2:{$PrefixSpecial}_field field="Priority" /></sup></inp2:m_if></span>
- </td>
+<inp2:m_DefineElement name="grid_keyword_td">
+ <inp2:Field field="$field" grid="$grid"/><span class="priority"><inp2:m_ifnot check="Field" field="Priority" equals_to="0"><sup><inp2:Field field="Priority" /></sup></inp2:m_ifnot></span>
</inp2:m_DefineElement>
<inp2:m_RenderElement name="grid" PrefixSpecial="c-search" IdField="RelatedSearchId" grid="Default" menu_filters="yes"/>
<script type="text/javascript">
- Grids['c-search'].SetDependantToolbarButtons( new Array('edit','delete','approve','decline') );
+ Grids['c-search'].SetDependantToolbarButtons( new Array('edit','delete','move_up','move_down','approve','decline') );
</script>
-<input type="hidden" name="RelatedSearchId" id="RelatedSearchId" value="<inp2:m_get name="RelatedSearchId"/>">
+<input type="hidden" name="RelatedSearchId" id="RelatedSearchId" value="<inp2:m_get name='RelatedSearchId'/>">
<inp2:m_include t="incs/footer"/>
<script type="text/javascript">
var $env = document.getElementById('sid').value+'-:m<inp2:m_get name="m_cat_id"/>-1-1-1-s';
</script>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/categories/categories_edit_related_searches.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.5
\ No newline at end of property
+1.1.2.6
\ No newline at end of property
Index: branches/RC/core/admin_templates/categories/categories_edit_relations.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/categories_edit_relations.tpl (revision 11537)
+++ branches/RC/core/admin_templates/categories/categories_edit_relations.tpl (revision 11538)
@@ -1,108 +1,107 @@
-<inp2:m_RequireLogin permissions="CATEGORY.VIEW"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
+<inp2:adm_SetPopupSize width="880" height="680"/>
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
-<inp2:m_RenderElement name="section_header" prefix="c" icon="icon46_catalog" module="in-portal" title="!la_title_Categories!"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" perm_section="CATEGORY" permission_type="VIEW" system_permission="0" title_preset="categories_relations" tab_preset="Default" pagination="1" pagination_prefix="c-rel"/>
<inp2:m_include t="categories/categories_tabs"/>
-<inp2:m_RenderElement name="blue_bar" prefix="c" title_preset="categories_relations" module="in-portal" icon="icon46_catalog"/>
-
<!-- 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('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/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
//Relations related:
a_toolbar.AddButton( new ToolBarButton('new_relation', '<inp2:m_phrase label="la_ToolTip_New_Relation" escape="1"/>',
function() {
openSelector('c-rel', '<inp2:adm_SelectorLink prefix="c-rel" selection_mode="single" tab_prefixes="all"/>', 'TargetId', '950x600');
} ) );
function edit()
{
std_edit_temp_item('c-rel', 'categories/relations_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('c-rel')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
submit_event('c-rel','OnMassApprove');
}
) );
a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
submit_event('c-rel','OnMassDecline');
}
) );
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="c_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
//a_toolbar.HideButton('sep2');
<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="c-rel" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="c-rel" IdField="RelationshipId" grid="Default" menu_filters="yes"/>
<script type="text/javascript">
Grids['c-rel'].SetDependantToolbarButtons( new Array('edit','delete','approve','decline') );
</script>
<input type="hidden" name="TargetId" id="TargetId" value="<inp2:m_get name="TargetId"/>">
<input type="hidden" name="TargetType" id="TargetType" value="<inp2:m_get name="TargetType"/>">
<inp2:m_include t="incs/footer"/>
<script type="text/javascript">
var $env = document.getElementById('sid').value+'-:m<inp2:m_get name="m_cat_id"/>-1-1-1-s';
</script>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/categories/categories_edit_relations.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4.2.1
\ No newline at end of property
+1.4.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/categories/images_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/images_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/categories/images_edit.tpl (revision 11538)
@@ -1,60 +1,59 @@
-<inp2:m_RequireLogin permissions="CATEGORY.VIEW"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
+<inp2:m_include t="incs/header"/>
<inp2:m_include t="incs/image_blocks"/>
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
-<inp2:m_RenderElement name="section_header" prefix="c" icon="icon46_catalog" title="!la_Text_Categories!"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="c" title_preset="images_edit" module="in-portal" icon="icon46_catalog"/>
+<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" perm_section="CATEGORY" permission_type="VIEW" system_permission="0" title_preset="images_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('c-img','<inp2:c-img_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('c-img','OnCancel');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
+<inp2:c-img_SaveWarning name="grid_save_warning"/>
+<inp2:c-img_ErrorWarning name="form_error_warning"/>
+
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="subsection" title="!la_section_Image!"/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="c-img" field="ResourceId"/>
- <inp2:m_RenderElement name="inp_label" prefix="c-img" field="ImageId" title="!la_fld_ImageId!"/>
+ <inp2:m_RenderElement name="inp_id_label" prefix="c-img" field="ImageId" title="!la_fld_ImageId!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="c-img" field="Name" title="!la_fld_Name!" size="40"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="c-img" field="AltName" title="!la_fld_AltValue!" size="40"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="c-img" field="Enabled" title="!la_fld_Enabled!" onchange="check_primary()" />
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="c-img" field="DefaultImg" title="!la_fld_Primary!" onchange="check_status()" />
<inp2:m_RenderElement name="inp_edit_box" prefix="c-img" field="Priority" title="!la_fld_Priority!" size="5"/>
<inp2:m_RenderElement name="subsection" title="!la_section_ThumbnailImage!"/>
<inp2:m_RenderElement name="thumbnail_section" prefix="c-img"/>
<inp2:m_RenderElement name="subsection" title="!la_section_FullSizeImage!"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="c-img" field="SameImages" title="!la_fld_SameAsThumb!" onchange="toggle_fullsize()"/>
<inp2:m_RenderElement name="fullsize_section" prefix="c-img"/>
</table>
</div>
<script type="text/javascript">
<inp2:m_RenderElement name="images_edit_js" prefix="c-img"/>
toggle_fullsize();
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/categories/images_edit.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/categories/categories_edit_images.tpl
===================================================================
--- branches/RC/core/admin_templates/categories/categories_edit_images.tpl (revision 11537)
+++ branches/RC/core/admin_templates/categories/categories_edit_images.tpl (revision 11538)
@@ -1,110 +1,109 @@
-<inp2:m_RequireLogin permissions="CATEGORY.VIEW"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
+<inp2:adm_SetPopupSize width="880" height="680"/>
-<inp2:m_include t="incs/image_blocks"/>
-
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
-<inp2:m_RenderElement name="section_header" prefix="c" icon="icon46_catalog" title="!la_title_Categories!"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_include t="incs/image_blocks"/>
<inp2:m_include t="categories/categories_tabs"/>
-<inp2:m_RenderElement name="blue_bar" prefix="c" title_preset="categories_images" module="in-portal" icon="icon46_catalog"/>
+<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" perm_section="CATEGORY" permission_type="VIEW" system_permission="0" title_preset="categories_images" tab_preset="Default" pagination="1" pagination_prefix="c-img"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
function edit()
{
std_edit_temp_item('c-img', 'categories/images_edit');
}
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/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('new_image', '<inp2:m_phrase label="la_ToolTip_New_Images" escape="1"/>',
function() {
std_new_item('c-img', 'categories/images_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('c-img')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('move_up', '<inp2:m_phrase label="la_ToolTip_MoveUp" escape="1"/>', function() {
submit_event('c-img','OnMassMoveUp');
}
) );
a_toolbar.AddButton( new ToolBarButton('move_down', '<inp2:m_phrase label="la_ToolTip_MoveDown" escape="1"/>', function() {
submit_event('c-img','OnMassMoveDown');
}
) );
a_toolbar.AddButton( new ToolBarButton('primary_image', '<inp2:m_phrase label="la_ToolTip_SetPrimary" escape="1"/>', function() {
submit_event('c-img','OnSetPrimary');
}
) );
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="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="c-img" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="c-img" IdField="ImageId" grid="Default" menu_filters="yes"/>
<script type="text/javascript">
Grids['c-img'].SetDependantToolbarButtons( new Array('edit','delete','move_up','move_down','primary_image') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/categories/categories_edit_images.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/themes/themes_edit_tabs.tpl
===================================================================
--- branches/RC/core/admin_templates/themes/themes_edit_tabs.tpl (revision 11537)
+++ branches/RC/core/admin_templates/themes/themes_edit_tabs.tpl (nonexistent)
@@ -1,12 +0,0 @@
-<table style="padding: 2px 0px 0px 0px; margin: 0px; border: none; border-collapse: collapse" width="100%">
-<tr>
- <td align="right" width="100%">
- <table cellpadding="0" cellspacing="0" border="0" height="23">
- <tr>
- <inp2:m_RenderElement name="tab" title="la_tab_General" t="themes/themes_edit" main_prefix="theme"/>
- <inp2:m_RenderElement name="tab" title="la_tab_Files" t="themes/themes_edit_files" main_prefix="theme"/>
- </tr>
- </table>
- </td>
-</tr>
-</table>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/themes/themes_edit_tabs.tpl
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: branches/RC/core/admin_templates/themes/themes_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/themes/themes_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/themes/themes_edit.tpl (revision 11538)
@@ -1,71 +1,73 @@
<inp2:adm_SetPopupSize width="850" height="600"/>
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:configure_themes" prefix="theme" title_preset="themes_edit_general" tabs="themes/themes_edit_tabs"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:configure_themes" prefix="theme" title_preset="themes_edit_general" 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('theme', '<inp2:theme_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('theme', '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('theme', '<inp2:theme_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('theme', '<inp2:theme_NextId/>');
}
) );
a_toolbar.Render();
<inp2:m_if check="theme_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="theme_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="theme_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:theme_SaveWarning name="grid_save_warning"/>
<inp2:theme_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_id_label" prefix="theme" field="ThemeId" title="la_fld_Id"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="theme" field="Name" title="la_fld_Name"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="theme" field="Description" title="la_fld_Description" cols="25" rows="5"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="theme" field="Enabled" title="la_fld_Enabled"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="theme" field="CacheTimeout" title="la_prompt_lang_cache_timeout"/>
<inp2:m_if check="m_ModuleEnabled" module="In-Portal">
<inp2:m_RenderElement name="inp_edit_options" prefix="theme" field="StylesheetId" title="la_prompt_Stylesheet" has_empty="1"/>
</inp2:m_if>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="theme" field="PrimaryTheme" title="la_fld_Primary"/>
+ <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/themes/themes_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3.2.2
\ No newline at end of property
+1.3.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/themes/themes_edit_files.tpl
===================================================================
--- branches/RC/core/admin_templates/themes/themes_edit_files.tpl (revision 11537)
+++ branches/RC/core/admin_templates/themes/themes_edit_files.tpl (revision 11538)
@@ -1,77 +1,79 @@
-<inp2:m_include t="incs/header"/>
+<inp2:adm_SetPopupSize width="850" height="600"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:configure_themes" prefix="theme" title_preset="themes_edit_files" tabs="themes/themes_edit_tabs"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:configure_themes" prefix="theme" title_preset="themes_edit_files" tab_preset="Default" pagination="1" pagination_prefix="theme-file"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
function edit()
{
-
+
}
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('theme','<inp2:theme_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('theme','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('theme', '<inp2:theme_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('theme', '<inp2:theme_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('theme-file')
} ) );
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();
<inp2:m_if check="theme_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="theme_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="theme_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
+
<inp2:m_RenderElement name="search_main_toolbar" prefix="theme-file" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="theme-file" IdField="FileId" grid="Default"/>
<script type="text/javascript">
// Grids['theme-file'].SetDependantToolbarButtons( new Array('edit','delete') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/themes/themes_edit_files.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.2.2.1
\ No newline at end of property
Index: branches/RC/core/admin_templates/themes/themes_list.tpl
===================================================================
--- branches/RC/core/admin_templates/themes/themes_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/themes/themes_list.tpl (revision 11538)
@@ -1,63 +1,62 @@
<inp2:m_include t="incs/header"/>
-
<inp2:m_RenderElement name="combined_header" section="in-portal:configure_themes" prefix="theme" title_preset="themes_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('theme', 'themes/themes_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_theme', '<inp2:m_phrase label="la_ToolTip_NewTheme" escape="1"/>::<inp2:m_phrase label="la_Add" escape="1"/>',
function() {
std_precreate_item('theme', 'themes/themes_edit')
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('theme')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('primary_theme', '<inp2:m_phrase label="la_ToolTip_SetPrimary" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_SetPrimary" escape="1"/>', function() {
submit_event('theme','OnSetPrimary');
}
) );
a_toolbar.AddButton( new ToolBarButton('rescan_themes', '<inp2:m_phrase label="la_ToolTip_RescanThemes" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_RescanThemes" escape="1"/>', function() {
submit_event('adm', 'OnRebuildThemes');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
-
+
<inp2:m_RenderElement name="search_main_toolbar" prefix="theme" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="theme" IdField="ThemeId" grid="Default" menu_filters="yes"/>
<script type="text/javascript">
Grids['theme'].SetDependantToolbarButtons( new Array('edit','delete','primary_theme') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/themes/themes_list.tpl
___________________________________________________________________
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/admin_templates/skins/skin_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/skins/skin_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/skins/skin_edit.tpl (revision 11538)
@@ -1,286 +1,280 @@
<inp2:adm_SetPopupSize width="750" height="570"/>
-<inp2:m_include t="incs/header" body_properties="" />
-<inp2:m_RenderElement name="combined_header" section="in-portal:skins" prefix="skin" title_preset="skin_edit" pagination="0"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:skins" prefix="skin" title_preset="skin_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('skin','<inp2:skin_SaveEvent/>');
}
));
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
cancel_edit('skin','OnCancelEdit','<inp2:skin_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('skin', '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('skin', '<inp2:skin_PrevId/>');
}
));
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('skin', '<inp2:skin_NextId/>');
}
));
a_toolbar.Render();
<inp2:m_if check="skin_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="skin_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="skin_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
<script src="js/swfobject.js" type="text/javascript"></script>
<script type="text/javascript" src="js/uploader.js"></script>
</td>
-
- <!--<inp2:m_RenderElement name="ml_selector" prefix="skin"/>-->
</tr>
</tbody>
</table>
<inp2:m_DefineElement name="replacement_item" subfield="" class="" is_last="" maxlength="" onblur="" size="" onkeyup="" style="width: 100%">
<tr class="<inp2:m_odd_even odd="edit-form-odd" even="edit-form-even"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" subfield="$subfield" title="$Description" is_last="$is_last"/>
<td class="control-cell">
<input style="<inp2:m_Param name="style"/>" type="text"
name="<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>[<inp2:m_Param name="key"/>][Value]" id="<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>[<inp2:m_Param name="key"/>]" value="<inp2:m_Param name="Value"/>">
</td>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_serialized" subfield="" class="" is_last="" maxlength="" onblur="" size="" onkeyup="" style="width: 100%">
<inp2:PrintSerializedFields pass_params="1" field="$field" render_as="$item_render_as"/>
</inp2:m_DefineElement>
-
-
<inp2:skin_SaveWarning name="grid_save_warning"/>
<inp2:skin_ErrorWarning name="form_error_warning"/>
-<div id="scroll_container">
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder" style="border-collapse: separate;">
+<div id="scroll_container">
+ <table class="edit-form">
<inp2:m_RenderElement name="inp_id_label" prefix="skin" field="SkinId" title="!la_fld_Id!"/>
<inp2:m_RenderElement name="inp_edit_box_ml" prefix="skin" field="Name" title="!la_fld_SkinName!" style="width: 100px"/>
<inp2:m_RenderElement name="inp_edit_swf_upload" prefix="skin" field="Logo" title="!la_fld_Logo!"/>
<inp2:m_RenderElement name="inp_edit_swf_upload" prefix="skin" field="LogoBottom" title="la_fld_LogoBottom"/>
<style type="text/css">
.skin-table td {width: 90px};
</style>
<tr class="<inp2:m_odd_even odd="edit-form-odd" even="edit-form-even"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="skin" field="Options" title="la_HeadFrame"/>
<td class="control-cell">
<table class="skin-table">
<tr>
<td>Font Color (HeadColor)</td>
<td>Background (HeadBgColor)</td>
<td>Bar Text Color (HeadBarColor)</td>
<td>Bar Background (HeadBarBgColor)</td>
</tr>
<tr>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[HeadColor][Value]"
value="<inp2:skin_Field name="Options" format="HeadColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[HeadBgColor][Value]"
value="<inp2:skin_Field name="Options" format="HeadBgColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[HeadBarColor][Value]"
value="<inp2:skin_Field name="Options" format="HeadBarColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[HeadBarBgColor][Value]"
value="<inp2:skin_Field name="Options" format="HeadBarBgColor.Value"/>">
</td>
</tr>
</table>
</td>
</tr>
</tr>
<tr class="<inp2:m_odd_even odd="edit-form-odd" even="edit-form-even"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="skin" field="Options" title="la_GeneralSections"/>
<td class="control-cell">
<table class="skin-table">
<tr>
<td>Section Title Color (SectionColor)</td>
<td>Section Background (SectionBgColor)</td>
<td>Titlebar Font Color (TitleBarColor)</td>
<td>Titlebar Background (TitleBarBgColor)</td>
</tr>
<tr>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[SectionColor][Value]"
value="<inp2:skin_Field name="Options" format="SectionColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[SectionBgColor][Value]"
value="<inp2:skin_Field name="Options" format="SectionBgColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[TitleBarColor][Value]"
value="<inp2:skin_Field name="Options" format="TitleBarColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[TitleBarBgColor][Value]"
value="<inp2:skin_Field name="Options" format="TitleBarBgColor.Value"/>">
</td>
</tr>
</table>
</td>
</tr>
</tr>
<tr class="<inp2:m_odd_even odd="edit-form-odd" even="edit-form-even"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="skin" field="Options" title="la_DataGrid1"/>
<td class="control-cell">
<table class="skin-table">
<tr>
<td>Toolbar Backgroun (ToolbarBgColor)</td>
<td>Filter Row Background (FiltersBgColor)</td>
<td>Column Titles Color (ColumnTitlesColor)</td>
<td>Column Titles Background (ColumnTitlesBgColor)</td>
</tr>
<tr>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[ToolbarBgColor][Value]"
value="<inp2:skin_Field name="Options" format="ToolbarBgColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[FiltersBgColor][Value]"
value="<inp2:skin_Field name="Options" format="FiltersBgColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[ColumnTitlesColor][Value]"
value="<inp2:skin_Field name="Options" format="ColumnTitlesColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[ColumnTitlesBgColor][Value]"
value="<inp2:skin_Field name="Options" format="ColumnTitlesBgColor.Value"/>">
</td>
</tr>
</table>
</td>
</tr>
</tr>
<tr class="<inp2:m_odd_even odd="edit-form-odd" even="edit-form-even"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="skin" field="Options" title="la_DataGrid2"/>
<td class="control-cell">
<table class="skin-table">
<tr>
<td>Grid Odd Row Color (OddColor)</td>
<td>Grid Odd Row Background Color (OddBgColor)</td>
<td>Grid Even Row Color (EvenColor)</td>
<td>Grid Even Row Background Color (EvenBgColor)</td>
</tr>
<tr>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[OddColor][Value]"
value="<inp2:skin_Field name="Options" format="OddColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[OddBgColor][Value]"
value="<inp2:skin_Field name="Options" format="OddBgColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[EvenColor][Value]"
value="<inp2:skin_Field name="Options" format="EvenColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[EvenBgColor][Value]"
value="<inp2:skin_Field name="Options" format="EvenBgColor.Value"/>">
</td>
</tr>
</table>
</td>
</tr>
</tr>
<tr class="<inp2:m_odd_even odd="edit-form-odd" even="edit-form-even"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="skin" field="Options" title="la_Trees"/>
<td class="control-cell">
<table class="skin-table">
<tr>
<td>Tree Color (TreeColor)</td>
<td>Tree Background Color (TreeBgColor)</td>
<td>Tree Highlighted Color (TreeHighColor)</td>
<td>Tree Highlighted Background Color (TreeHighBgColor)</td>
</tr>
<tr>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[TreeColor][Value]"
value="<inp2:skin_Field name="Options" format="TreeColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[TreeBgColor][Value]"
value="<inp2:skin_Field name="Options" format="TreeBgColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[TreeHighColor][Value]"
value="<inp2:skin_Field name="Options" format="TreeHighColor.Value"/>">
</td>
<td>
<input style="width: 80px" type="text"
name="<inp2:skin_InputName field="Options"/>[TreeHighBgColor][Value]"
value="<inp2:skin_Field name="Options" format="TreeHighBgColor.Value"/>">
</td>
</tr>
</table>
</td>
</tr>
</tr>
<!-- <inp2:m_RenderElement name="inp_edit_serialized" prefix="skin" field="Options" title="!la_fld_Options!" style="width: 100px" item_render_as="replacement_item"/>-->
<inp2:m_RenderElement name="inp_edit_textarea" prefix="skin" field="CSS" title="!la_fld_CSS!" control_options="{min_height: 300}"/>
-</table>
+ </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/skins/skin_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4.2.1
\ No newline at end of property
+1.4.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/skins/skin_list.tpl
===================================================================
--- branches/RC/core/admin_templates/skins/skin_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/skins/skin_list.tpl (revision 11538)
@@ -1,73 +1,72 @@
-<inp2:m_include t="incs/header" />
-
-<inp2:m_RenderElement name="combined_header" section="in-portal:skins" prefix="skin" title_preset="" pagination="1"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:skins" prefix="skin" title_preset="skin_list" pagination="1"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_NewSkin" escape="1"/>::<inp2:m_phrase label="la_Add" escape="1"/>',
function() {
std_precreate_item('skin', 'skins/skin_edit')
}
)
);
function edit()
{
std_edit_item('skin', 'skins/skin_edit');
}
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('skin');
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('primary_theme', '<inp2:m_phrase label="la_ToolTip_SetPrimary" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_SetPrimary" escape="1"/>', function() {
submit_event('skin','OnSetPrimary');
}
) );
a_toolbar.AddButton( new ToolBarButton('clone', '<inp2:m_phrase label="la_ToolTip_Clone" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Clone" escape="1"/>', function() {
submit_event('skin','OnMassClone');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function(id) {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="skin" grid="Default"/>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="skin" IdField="SkinId" grid="Default" grid_filters="1"/>
<script type="text/javascript">
Grids['skin'].SetDependantToolbarButtons( new Array('edit', 'delete', 'primary_theme', 'clone') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/skins/skin_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3.2.1
\ No newline at end of property
+1.3.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/mailing_lists/mailing_list_tabs.tpl
===================================================================
--- branches/RC/core/admin_templates/mailing_lists/mailing_list_tabs.tpl (revision 11537)
+++ branches/RC/core/admin_templates/mailing_lists/mailing_list_tabs.tpl (revision 11538)
@@ -1,11 +1,5 @@
-<table cellpadding="0" cellspacing="0" border="0" width="100%">
- <tr>
- <td align="right" width="100%">
- <table cellpadding="0" cellspacing="0" border="0" height="23">
- <tr>
- <inp2:adm_ListTabs render_as="tab_direct" section_name="in-portal:mailing_folder"/>
- </tr>
- </table>
- </td>
- </tr>
-</table>
\ No newline at end of file
+<inp2:m_DefineElement name="maling_list_tabs">
+ <inp2:adm_ListTabs render_as="tab_direct" section_name="in-portal:mailing_folder"/>
+</inp2:m_DefineElement>
+
+<inp2:m_RenderElement name="tabs_container" tabs_render_as="maling_list_tabs"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/mailing_lists/mailing_list_tabs.tpl
___________________________________________________________________
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/admin_templates/mailing_lists/mailing_list_list.tpl
===================================================================
--- branches/RC/core/admin_templates/mailing_lists/mailing_list_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/mailing_lists/mailing_list_list.tpl (revision 11538)
@@ -1,78 +1,79 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:mailing_lists" prefix="mailing-list" title_preset="mailing_list_list" tabs="mailing_lists/mailing_list_tabs" />
+<inp2:m_RenderElement name="combined_header" section="in-portal:mailing_lists" prefix="mailing-list" title_preset="mailing_list_list" tabs="mailing_lists/mailing_list_tabs" 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('mailing-list', 'mailing_lists/mailing_list_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton(
new ToolBarButton(
'new_item',
'<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
function() {
std_precreate_item('mailing-list', 'mailing_lists/mailing_list_edit');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'view_item',
'<inp2:m_phrase label="la_ToolTip_View" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_View" escape="1"/>',
edit
)
);
a_toolbar.AddButton(
new ToolBarButton(
'delete',
'<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('mailing-list')
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'cancel',
'<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>',
function() {
submit_event('mailing-list', 'OnCancelMailing');
}
)
);
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="mailing-list" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="mailing-list" IdField="MailingId" grid="Default" grid_filters="1"/>
<script type="text/javascript">
Grids['mailing-list'].SetDependantToolbarButtons( new Array('view_item', 'delete', 'cancel') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/mailing_lists/mailing_list_list.tpl
___________________________________________________________________
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/admin_templates/mailing_lists/mailing_list_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/mailing_lists/mailing_list_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/mailing_lists/mailing_list_edit.tpl (revision 11538)
@@ -1,143 +1,143 @@
<inp2:adm_SetPopupSize width="865" height="640"/>
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:mailing_lists" prefix="mailing-list" title_preset="mailing_list_edit"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:mailing_lists" prefix="mailing-list" title_preset="mailing_list_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();
<inp2:m_if check="mailing-list_IsNewItem">
a_toolbar.AddButton(
new ToolBarButton(
'select',
'<inp2:m_phrase label="la_ToolTip_Send" escape="1"/>',
function() {
submit_event('mailing-list', '<inp2:mailing-list_SaveEvent/>');
}
)
);
</inp2:m_if>
a_toolbar.AddButton(
new ToolBarButton(
'cancel',
'<inp2:m_phrase label="la_ToolTip_Close" escape="1"/>',
function() {
submit_event('mailing-list', 'OnGoBack');
}
)
);
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('mailing-list', '<inp2:mailing-list_PrevId/>');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'next',
'<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>',
function() {
go_to_id('mailing-list', '<inp2:mailing-list_NextId/>');
}
)
);
a_toolbar.Render();
<inp2:m_if check="mailing-list_IsSingle">
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="mailing-list_IsLast">
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="mailing-list_IsFirst">
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript" src="js/uploader.js"></script>
</td>
</tr>
</tbody>
</table>
<inp2:mailing-list_SaveWarning name="grid_save_warning"/>
<inp2:mailing-list_ErrorWarning name="form_error_warning"/>
<inp2:m_DefineElement name="recipient_element">
&lt;<inp2:m_Param name="recipient_name"/>&gt;
<inp2:m_if check="m_Param" name="not_last">; </inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_recipient_box" class="" format="" is_last="" maxlength="" onblur="" onchange="" size="" onkeyup="" style="width: 100%">
<tr class="<inp2:m_odd_even odd="edit-form-odd" even="edit-form-even"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td class="control-cell">
<inp2:m_if check="{$prefix}_IsManualRecipient">
<input style="<inp2:m_Param name="style"/>" type="text" name="<inp2:{$prefix}_InputName field="$field"/>" id="<inp2:{$prefix}_InputName field="$field"/>" value="<inp2:{$prefix}_Field field="$field" format="$format"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>">
<inp2:m_else/>
<inp2:$prefix_PrintRecipients render_as="recipient_element" strip_nl="2"/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="$prefix" field="$field"/>
</inp2:m_if>
<inp2:m_if check="{$prefix}_HasParam" name="hint_label"><span class="small"><inp2:m_phrase label="$hint_label"/></span></inp2:m_if>
</td>
<inp2:m_RenderElement name="inp_edit_error" pass_params="1"/>
</tr>
</inp2:m_DefineElement>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="subsection" title="la_section_General"/>
<inp2:m_RenderElement name="inp_id_label" prefix="mailing-list" field="MailingId" title="la_fld_Id"/>
<inp2:m_RenderElement name="inp_recipient_box" prefix="mailing-list" field="To" title="la_fld_To" size="60"/>
<inp2:m_if check="mailing-list_IsNewItem">
<inp2:m_RenderElement name="inp_edit_box" prefix="mailing-list" field="Subject" title="la_fld_Subject" size="60"/>
<inp2:m_RenderElement name="inp_edit_swf_upload" prefix="mailing-list" field="Attachments" title="la_fld_Attachment"/>
<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="Status" title="la_fld_Status"/>
<inp2:m_else/>
<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="Subject" title="la_fld_Subject"/>
<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="Attachments" title="la_fld_Attachment"/>
<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="Status" title="la_fld_Status"/>
<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="EmailsQueued" title="la_fld_EmailsQueued"/>
<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="EmailsSent" title="la_fld_EmailsSent"/>
<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="EmailsTotal" title="la_fld_EmailsTotal"/>
</inp2:m_if>
<inp2:m_RenderElement name="subsection" title="la_section_Message"/>
<inp2:m_if check="mailing-list_IsNewItem">
<inp2:m_RenderElement name="inp_edit_textarea" prefix="mailing-list" field="MessageHtml" title="la_fld_HtmlVersion" control_options="{min_height: 140}" rows="10" cols="75"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="mailing-list" field="MessageText" allow_html="0" title="la_fld_TextVersion" control_options="{min_height: 140}" rows="10" cols="75"/>
<inp2:m_else/>
<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="MessageHtml" title="la_fld_HtmlVersion"/>
<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="MessageText" title="la_fld_TextVersion" nl2br="1"/>
</inp2:m_if>
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
<input type="hidden" name="mailing_recipient_type" value="<inp2:m_Get name='mailing_recipient_type'/>"/>
</div>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/mailing_lists/mailing_list_edit.tpl
___________________________________________________________________
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/admin_templates/custom_fields/custom_fields_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/custom_fields/custom_fields_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/custom_fields/custom_fields_edit.tpl (revision 11538)
@@ -1,153 +1,155 @@
<inp2:adm_SetPopupSize width="750" height="400"/>
-<inp2:m_RequireLogin perm_event="cf:OnLoad" system="1"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
+<inp2:m_include t="incs/header"/>
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
-<inp2:m_RenderElement name="section_header" prefix="cf" module="in-portal" icon="icon46_settings_custom" title="!la_title_CustomFields!"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="cf" title_preset="custom_fields_edit" icon="icon46_settings_custom"/>
+<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_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('cf','<inp2:cf_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('cf','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('cf', '<inp2:cf_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('cf', '<inp2:cf_NextId/>');
}
) );
a_toolbar.Render();
<inp2:m_if check="cf_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="cf_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="cf_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="cf" field="Type" db="db"/>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered">
- <inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
- <inp2:m_RenderElement name="inp_id_label" prefix="cf" field="CustomFieldId" title="!la_prompt_FieldId!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="FieldName" title="!la_prompt_FieldName!" size="40"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="FieldLabel" title="!la_prompt_FieldLabel!" size="40"/>
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="cf" field="MultiLingual" title="!la_fld_MultiLingual!"/>
-
- <inp2:m_RenderElement name="subsection" title="!la_tab_AdminUI!"/>
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="cf" field="OnGeneralTab" title="!la_prompt_showgeneraltab!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="Heading" title="!la_prompt_heading!" size="40"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="Prompt" title="!la_prompt_FieldPrompt!" size="40"/>
- <inp2:m_RenderElement name="inp_edit_options" prefix="cf" field="ElementType" title="!la_prompt_InputType!" size="20" onchange="update_layout();"/>
-
- <inp2:m_if check="cf_Field" name="ElementType" equals_to="select|multiselect|radio" db="db" inverse="inverse">
- <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="ValueList" title="!la_prompt_valuelist!" size="40"/>
- </inp2:m_if>
-
- <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="DefaultValue" title="la_prompt_Default"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="DisplayOrder" title="!la_field_displayorder!" size="10"/>
+<inp2:cf_SaveWarning name="grid_save_warning"/>
+<inp2:cf_ErrorWarning name="form_error_warning"/>
- <inp2:m_if check="m_IsDebugMode">
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="cf" field="IsSystem" title="!la_fld_IsSystem!"/>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
+ <inp2:m_RenderElement name="inp_id_label" prefix="cf" field="CustomFieldId" title="!la_prompt_FieldId!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="FieldName" title="!la_prompt_FieldName!" size="40"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="FieldLabel" title="!la_prompt_FieldLabel!" size="40"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="cf" field="MultiLingual" title="!la_fld_MultiLingual!"/>
+
+ <inp2:m_RenderElement name="subsection" title="!la_tab_AdminUI!"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="cf" field="OnGeneralTab" title="!la_prompt_showgeneraltab!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="Heading" title="!la_prompt_heading!" size="40"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="Prompt" title="!la_prompt_FieldPrompt!" size="40"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="cf" field="ElementType" title="!la_prompt_InputType!" size="20" onchange="update_layout();"/>
+
+ <inp2:m_if check="cf_Field" name="ElementType" equals_to="select|multiselect|radio" db="db" inverse="inverse">
+ <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="ValueList" title="!la_prompt_valuelist!" size="40"/>
+ </inp2:m_if>
+
+ <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="DefaultValue" title="la_prompt_Default"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="DisplayOrder" title="!la_field_displayorder!" size="10"/>
+
+ <inp2:m_if check="m_IsDebugMode">
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="cf" field="IsSystem" title="!la_fld_IsSystem!"/>
+ </inp2:m_if>
+
+ <inp2:m_if check="cf_Field" name="ElementType" equals_to="select|multiselect|radio" db="db">
+ <inp2:m_RenderElement name="subsection" title="la_section_Values"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="cf" field="SortValues" title="la_fld_SortValues"/>
+
+ <inp2:m_RenderElement name="inp_edit_hidden" prefix="cf" field="OptionKey"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="OptionTitle" title="la_fld_OptionTitle" size="60"/>
+ <inp2:m_RenderElement name="inp_edit_minput" prefix="cf" field="Options" title="la_fld_Options" format="#OptionTitle# (#OptionKey#)" style="width: 600px; height: 500px;"/>
</inp2:m_if>
-
- <inp2:m_if check="cf_Field" name="ElementType" equals_to="select|multiselect|radio" db="db">
- <inp2:m_RenderElement name="subsection" title="la_section_Values"/>
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="cf" field="SortValues" title="la_fld_SortValues"/>
-
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="cf" field="OptionKey"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="cf" field="OptionTitle" title="la_fld_OptionTitle" size="60"/>
- <inp2:m_RenderElement name="inp_edit_minput" prefix="cf" field="Options" title="la_fld_Options" format="#OptionTitle# (#OptionKey#)" style="width: 600px; height: 500px;"/>
- </inp2:m_if>
-</table>
+ </table>
+</div>
<inp2:m_if check="cf_Field" name="ElementType" equals_to="select|multiselect|radio" db="db">
<script type="text/javascript">
Options.registerControl('OptionKey', 'text', false);
Options.registerControl('OptionTitle', 'text', true);
Options.LoadValues();
Options.getControlValue = function ($field) {
var $value = this.getControl($field).value;
if ($field == 'OptionKey' && !$value) {
$options = this.getControl(this.FieldName, 'minput').options;
if ($options.length) {
var $i = 0;
var $max_option_key = 0;
while ($i < $options.length) {
if (parseInt(this.Records[ $options[$i].value ]['OptionKey']) > $max_option_key) {
$max_option_key = parseInt(this.Records[ $options[$i].value ]['OptionKey']);
}
$i++;
}
return $max_option_key + 1;
}
// when no this will be 1st record in list use 1
return 1;
}
return $value;
}
Options.compareRecords = function($record_a, $record_b) {
// compare by option title only, it's id doesn't matter
return $record_a['OptionTitle'].toLowerCase() == $record_b['OptionTitle'].toLowerCase();
}
</script>
</inp2:m_if>
<script type="text/javascript">
function update_layout() {
var $last_element_type = '<inp2:cf_Field name="ElementType" db="db" js_escape="1"/>';
var $element_type = document.getElementById('<inp2:cf_InputName name="ElementType" js_escape="1"/>').value;
// value is changed from ml supported to normal or otherwise
if (canHaveMultipleValues($last_element_type) != canHaveMultipleValues($element_type)) {
submit_event('cf', 'OnPreSave');
}
}
function canHaveMultipleValues($element_type) {
var $element_types = ['select', 'multiselect', 'radio'];
return $element_types.indexOf($element_type) != -1;
}
</script>
<inp2:m_include t="incs/footer"/>
Property changes on: branches/RC/core/admin_templates/custom_fields/custom_fields_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5.2.5
\ No newline at end of property
+1.5.2.6
\ 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 11537)
+++ branches/RC/core/admin_templates/custom_fields/custom_fields_list.tpl (revision 11538)
@@ -1,79 +1,76 @@
-<inp2:m_RequireLogin perm_event="cf:OnLoad" system="1"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
+<inp2:m_include t="incs/header"/>
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
-<inp2:m_RenderElement name="section_header" prefix="cf" module="in-portal" icon="icon46_settings_custom" title="!la_tab_ConfigCustom!"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="cf" title_preset="custom_fields_list" icon="icon46_settings_custom"/>
+<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"/>
<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.2
\ No newline at end of property
+1.5.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/tools/server_info.tpl
===================================================================
--- branches/RC/core/admin_templates/tools/server_info.tpl (revision 11537)
+++ branches/RC/core/admin_templates/tools/server_info.tpl (revision 11538)
@@ -1,32 +1,30 @@
-<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="section_header" icon="icon46_server_info" title="!la_tab_ServerInfo!"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="adm" title_preset="server_info" module="in-portal" icon="icon46_modules"/>
+<inp2:m_RenderElement name="combined_header" prefix="adm" section="in-portal:service" title_preset="server_info"/>
<!-- 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('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
- location.href = '<inp2:m_Link t="sections_list" pass="m" section="in-portal:tools" module="In-Portal" no_amp="1"/>';
+ location.href = '<inp2:m_Link t="sections_list" pass="m" section="in-portal:tools" module="In-Portal" no_amp="1"/>';
}
) );
+
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<!--<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr><td class="table-color1">
--> <inp2:adm_PrintPHPinfo/>
<!--</td>
</tr>
</table>
-->
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/tools/server_info.tpl
___________________________________________________________________
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/admin_templates/tools/restore1.tpl
===================================================================
--- branches/RC/core/admin_templates/tools/restore1.tpl (revision 11537)
+++ branches/RC/core/admin_templates/tools/restore1.tpl (revision 11538)
@@ -1,83 +1,58 @@
-<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
<inp2:m_include t="incs/header"/>
-
-<inp2:m_DefineElement name="blue_bar_step" module="" icon="" pagination="0">
- <table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
- <tr>
- <td class="header_left_bg" nowrap width="80%" valign="middle">
- <span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/> - <inp2:m_Phrase label="la_Step"/> <inp2:m_Param name="step"/></span>
- </td>
- <td align="right" class="tablenav" width="20%" valign="middle">
- <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
- <script>
- var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
- $help_url = $help_url.replace(/#/g, '%23');
- set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
- </script>
- <a href="javascript: OpenHelp($help_url);">
- <img src="img/blue_bar_help.gif" border="0">
- </a>
- </inp2:m_if>
- <inp2:m_if check="m_Param" name="pagination">
- <inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
- </inp2:m_if>
- </td>
- </tr>
- </table>
-</inp2:m_DefineElement>
-
-
-<inp2:m_RenderElement name="section_header" icon="icon46_tool_restore" title="!la_title_Restore!"/>
-
-<inp2:m_RenderElement name="blue_bar_step" prefix="adm" title_preset="restore" module="in-portal" icon="icon46_tool_restore" step="1"/>
-
+<inp2:m_RenderElement name="combined_header" prefix="adm" section="in-portal:service" title_preset="restore"/>
<!-- 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_Prev" escape="1"/>', function() {
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
location.href = '<inp2:m_Link t="tools/restore2"/>';
}
) );
a_toolbar.Render();
a_toolbar.DisableButton('prev');
a_toolbar.DisableButton('next');
+
+ $(document).ready(
+ function() {
+ $('#step_number').text(1);
+ }
+ );
</script>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered" id="config_table">
<inp2:m_RenderElement name="subsection" title="la_Prompt_Warning"/>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td colspan="3" class="text">
<inp2:m_Phrase label="la_Text_Restore_Heading"/>
</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="text" colspan="3">
<span class="hint"><img src="img/smicon7.gif" align="absmiddle" height="14" width="14">
<inp2:m_Phrase label="la_text_disclaimer_part1"/>
<inp2:m_Phrase label="la_text_disclaimer_part2"/>
</span>
</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="text" colspan="3">
<input id="agree" value="0" name="agree" onclick="if (this.checked == true) a_toolbar.EnableButton('next'); else a_toolbar.DisableButton('next');" type="checkbox"><label for="agree"><inp2:m_Phrase label="la_Text_IAgree"/></label> </td>
</tr>
</table>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/tools/restore1.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/tools/sql_query.tpl
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/RC/core/admin_templates/tools/sql_query.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.7
\ No newline at end of property
+1.1.2.8
\ No newline at end of property
Index: branches/RC/core/admin_templates/tools/restore2.tpl
===================================================================
--- branches/RC/core/admin_templates/tools/restore2.tpl (revision 11537)
+++ branches/RC/core/admin_templates/tools/restore2.tpl (revision 11538)
@@ -1,83 +1,58 @@
-<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
<inp2:m_include t="incs/header"/>
-
-<inp2:m_DefineElement name="blue_bar_step" module="" icon="" pagination="0">
- <table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
- <tr>
- <td class="header_left_bg" nowrap width="80%" valign="middle">
- <span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/> - <inp2:m_Phrase label="la_Step"/> <inp2:m_Param name="step"/></span>
- </td>
- <td align="right" class="tablenav" width="20%" valign="middle">
- <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
- <script>
- var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
- $help_url = $help_url.replace(/#/g, '%23');
- set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
- </script>
- <a href="javascript: OpenHelp($help_url);">
- <img src="img/blue_bar_help.gif" border="0">
- </a>
- </inp2:m_if>
- <inp2:m_if check="m_Param" name="pagination">
- <inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
- </inp2:m_if>
- </td>
- </tr>
- </table>
-</inp2:m_DefineElement>
-
-
-<inp2:m_RenderElement name="section_header" icon="icon46_tool_restore" title="!la_title_Restore!"/>
-
-<inp2:m_RenderElement name="blue_bar_step" prefix="adm" title_preset="restore" module="in-portal" icon="icon46_tool_restore" step="2"/>
-
+<inp2:m_RenderElement name="combined_header" prefix="adm" section="in-portal:service" title_preset="restore"/>
<!-- 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_Prev" escape="1"/>', function() {
location.href = '<inp2:m_Link t="tools/restore1"/>';
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
submit_event('adm.restore','OnRestore');
}
) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>', function() {
submit_event('adm.restore','OnDeleteBackup');
}
) );
a_toolbar.Render();
a_toolbar.DisableButton('next');
a_toolbar.DisableButton('delete');
+
+ $(document).ready(
+ function() {
+ $('#step_number').text(2);
+ }
+ );
</script>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered" id="config_table">
<inp2:m_RenderElement name="subsection" title="la_Prompt_Restore_Filechoose"/>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="text">
<img src="img/arrow.gif" align="absmiddle" border="0" height="15" width="15">
<span class="NAV_CURRENT_ITEM"><inp2:m_Phrase label="la_Prompt_Backup_Date"/></span>
</td>
</tr>
<inp2:m_DefineElement name="backup_date">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="text">
<input type=radio name="backupdate" onclick="a_toolbar.EnableButton('next');a_toolbar.EnableButton('delete')" value="<inp2:m_Param name='backuptimestamp'/>" /><inp2:m_Param name='backuptime'/> (<inp2:m_Param name='backupsize'/> M<inp2:m_Phrase label="la_text_Bytes"/>)
</td>
</tr>
</inp2:m_DefineElement>
<inp2:adm_PrintBackupDates name="backup_date"/>
</table>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/tools/restore2.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/tools/backup1.tpl
===================================================================
--- branches/RC/core/admin_templates/tools/backup1.tpl (revision 11537)
+++ branches/RC/core/admin_templates/tools/backup1.tpl (revision 11538)
@@ -1,85 +1,59 @@
-<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
<inp2:m_include t="incs/header"/>
-
-<inp2:m_DefineElement name="blue_bar_step" module="" icon="" pagination="0">
- <table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
- <tr>
- <td class="header_left_bg" nowrap width="80%" valign="middle">
- <span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/> - <inp2:m_Phrase label="la_Step"/> <inp2:m_Param name="step"/></span>
- </td>
- <td align="right" class="tablenav" width="20%" valign="middle">
- <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
- <script>
- var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
- $help_url = $help_url.replace(/#/g, '%23');
- set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
- </script>
- <a href="javascript: OpenHelp($help_url);">
- <img src="img/blue_bar_help.gif" border="0">
- </a>
- </inp2:m_if>
- <inp2:m_if check="m_Param" name="pagination">
- <inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
- </inp2:m_if>
- </td>
- </tr>
- </table>
-</inp2:m_DefineElement>
-
-
-<inp2:m_RenderElement name="section_header" icon="icon46_tool_backup" title="!la_title_Backup!"/>
-
-<inp2:m_RenderElement name="blue_bar_step" prefix="adm" title_preset="backup" module="in-portal" icon="icon46_tool_backup" step="1"/>
-
+<inp2:m_RenderElement name="combined_header" prefix="adm" section="in-portal:service" title_preset="backup"/>
<!-- 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_Prev" escape="1"/>', function() {
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
submit_event('adm.backup','OnBackup');
}
) );
a_toolbar.Render();
a_toolbar.DisableButton('prev');
-
+ $(document).ready(
+ function() {
+ $('#step_number').text(1);
+ }
+ );
</script>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered" id="config_table">
<inp2:m_RenderElement name="subsection" title="la_Prompt_Step_One"/>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td colspan="3" class="text">
<inp2:m_Phrase label="la_Text_Backup_Info"/>
</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="text" style="width: 300px;">
- <inp2:m_Phrase label="la_prompt_Backup_Path"/>
+ <inp2:m_Phrase label="la_prompt_Backup_Path"/>
<inp2:m_if check="conf_IsWritablePath" name="Backup_Path" inverse="1">
<br /><span class="error"><inp2:m_Phrase label="la_Text_backup_access"/></span>
<script type="text/javascript">
a_toolbar.DisableButton('next');
</script>
</inp2:m_if>
</td>
<td valign="top" colspan="2">
<input type="hidden" name="section" value="in-portal:configure_general"/>
- <INPUT type="text" name="conf[<inp2:conf_GetVariableID name="Backup_Path"/>][VariableValue]" class="text" size="50" value='<inp2:conf_ConfigValue name="Backup_Path"/>'> <input class="button" type="button" onclick="submit_event('conf', 'OnUpdate');" value="Update">
+ <INPUT type="text" name="conf[<inp2:conf_GetVariableID name="Backup_Path"/>][VariableValue]" class="text" size="50" value='<inp2:conf_ConfigValue name="Backup_Path"/>'> <input class="button" type="button" onclick="submit_event('conf', 'OnUpdate');" value="Update">
</td>
</tr>
</table>
+<input type="hidden" name="section" value="<inp2:conf_GetVariableSection name='Backup_Path'/>"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/tools/backup1.tpl
___________________________________________________________________
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/admin_templates/tools/restore3.tpl
===================================================================
--- branches/RC/core/admin_templates/tools/restore3.tpl (revision 11537)
+++ branches/RC/core/admin_templates/tools/restore3.tpl (revision 11538)
@@ -1,46 +1,20 @@
-<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
<inp2:m_include t="incs/header"/>
-
-<inp2:m_DefineElement name="blue_bar_step" module="" icon="" pagination="0">
- <table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
- <tr>
- <td class="header_left_bg" nowrap width="80%" valign="middle">
- <span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/> - <inp2:m_Phrase label="la_Step"/> <inp2:m_Param name="step"/></span>
- </td>
- <td align="right" class="tablenav" width="20%" valign="middle">
- <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
- <script>
- var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
- $help_url = $help_url.replace(/#/g, '%23');
- set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
- </script>
- <a href="javascript: OpenHelp($help_url);">
- <img src="img/blue_bar_help.gif" border="0">
- </a>
- </inp2:m_if>
- <inp2:m_if check="m_Param" name="pagination">
- <inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
- </inp2:m_if>
- </td>
- </tr>
- </table>
-</inp2:m_DefineElement>
-
-
-<inp2:m_RenderElement name="section_header" icon="icon46_tool_restore" title="!la_title_Restore!"/>
-
-<inp2:m_RenderElement name="blue_bar_step" prefix="adm" title_preset="restore" module="in-portal" icon="icon46_tool_backup" step="3"/>
-
+<inp2:m_RenderElement name="combined_header" prefix="adm" section="in-portal:service" title_preset="restore"/>
<inp2:m_RenderElement name="ajax_progress_bar" cancel_action="cancel_action();"/>
<script type="text/javascript">
function cancel_action() {
submit_event('adm.backup', 'OnRestoreCancel');
}
+ $(document).ready(
+ function() {
+ $('#step_number').text(3);
+ }
+ );
+
$Restore = new AjaxProgressBar('<inp2:m_t t="dummy" adm.restore_event="OnRestoreProgress" pass="m,adm.restore" js_escape="1"/>');
</script>
-<!--<a href="<inp2:m_t t="dummy" adm.restore_event="OnRestoreProgress" pass="m,adm.restore"/>"><inp2:m_t t="dummy" adm.restore_event="OnRestoreProgress" pass="m,adm.restore"/></a>
---><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/tools/restore3.tpl
___________________________________________________________________
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/admin_templates/tools/backup2.tpl
===================================================================
--- branches/RC/core/admin_templates/tools/backup2.tpl (revision 11537)
+++ branches/RC/core/admin_templates/tools/backup2.tpl (revision 11538)
@@ -1,46 +1,20 @@
-<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
<inp2:m_include t="incs/header"/>
-
-<inp2:m_DefineElement name="blue_bar_step" module="" icon="" pagination="0">
- <table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
- <tr>
- <td class="header_left_bg" nowrap width="80%" valign="middle">
- <span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/> - <inp2:m_Phrase label="la_Step"/> <inp2:m_Param name="step"/></span>
- </td>
- <td align="right" class="tablenav" width="20%" valign="middle">
- <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
- <script>
- var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
- $help_url = $help_url.replace(/#/g, '%23');
- set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
- </script>
- <a href="javascript: OpenHelp($help_url);">
- <img src="img/blue_bar_help.gif" border="0">
- </a>
- </inp2:m_if>
- <inp2:m_if check="m_Param" name="pagination">
- <inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
- </inp2:m_if>
- </td>
- </tr>
- </table>
-</inp2:m_DefineElement>
-
-
-<inp2:m_RenderElement name="section_header" icon="icon46_tool_backup" title="!la_title_Backup!"/>
-
-<inp2:m_RenderElement name="blue_bar_step" prefix="adm" title_preset="backup" module="in-portal" icon="icon46_tool_backup" step="2"/>
-
+<inp2:m_RenderElement name="combined_header" prefix="adm" section="in-portal:service" title_preset="backup"/>
<inp2:m_RenderElement name="ajax_progress_bar" cancel_action="cancel_action();"/>
<script type="text/javascript">
function cancel_action() {
submit_event('adm.backup', 'OnBackupCancel');
}
+ $(document).ready(
+ function() {
+ $('#step_number').text(2);
+ }
+ );
+
$Backup = new AjaxProgressBar('<inp2:m_t t="dummy" adm.backup_event="OnBackupProgress" pass="m,adm.backup" js_escape="1"/>');
</script>
-<!--<inp2:m_t t="dummy" adm.backup_event="OnBackupProgress" pass="m,conf.backup"/>
---><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/tools/backup2.tpl
___________________________________________________________________
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/admin_templates/tools/restore4.tpl
===================================================================
--- branches/RC/core/admin_templates/tools/restore4.tpl (revision 11537)
+++ branches/RC/core/admin_templates/tools/restore4.tpl (revision 11538)
@@ -1,73 +1,46 @@
-<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
<inp2:m_include t="incs/header"/>
-
-<inp2:m_DefineElement name="blue_bar_step" module="" icon="" pagination="0">
- <table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
- <tr>
- <td class="header_left_bg" nowrap width="80%" valign="middle">
- <span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/> - <inp2:m_Phrase label="la_Step"/> <inp2:m_Param name="step"/></span>
- </td>
- <td align="right" class="tablenav" width="20%" valign="middle">
- <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
- <script>
- var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
- $help_url = $help_url.replace(/#/g, '%23');
- set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
- </script>
- <a href="javascript: OpenHelp($help_url);">
- <img src="img/blue_bar_help.gif" border="0">
- </a>
- </inp2:m_if>
- <inp2:m_if check="m_Param" name="pagination">
- <inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
- </inp2:m_if>
- </td>
- </tr>
- </table>
-</inp2:m_DefineElement>
-
-
-<inp2:m_RenderElement name="section_header" icon="icon46_tool_restore" title="!la_title_Restore!"/>
-
-<inp2:m_RenderElement name="blue_bar_step" prefix="adm" title_preset="restore" module="in-portal" icon="icon46_tool_restore" step="4"/>
-
+<inp2:m_RenderElement name="combined_header" prefix="adm" section="in-portal:service" title_preset="restore"/>
<!-- 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_Prev" escape="1"/>', function() {
location.href = '<inp2:m_Link t="tools/restore1"/>';;
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
}
) );
a_toolbar.Render();
a_toolbar.DisableButton('next');
-
+ $(document).ready(
+ function() {
+ $('#step_number').text(4);
+ }
+ );
</script>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered" id="config_table">
<inp2:m_RenderElement name="subsection" title="la_Prompt_Restore_Status"/>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td colspan="3" class="text">
<inp2:m_if check="m_Recall" var="adm.restore_success">
<inp2:m_Phrase label="la_Prompt_Restore_Success"/>
<inp2:m_else/>
<inp2:m_Phrase label="la_Prompt_Restore_Failed"/> <inp2:m_Recall var="adm.restore_error"/>
</inp2:m_if>
</td>
</tr>
</table>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/tools/restore4.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/tools/backup3.tpl
===================================================================
--- branches/RC/core/admin_templates/tools/backup3.tpl (revision 11537)
+++ branches/RC/core/admin_templates/tools/backup3.tpl (revision 11538)
@@ -1,71 +1,44 @@
-<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
<inp2:m_include t="incs/header"/>
-
-<inp2:m_DefineElement name="blue_bar_step" module="" icon="" pagination="0">
- <table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
- <tr>
- <td class="header_left_bg" nowrap width="80%" valign="middle">
- <span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/> - <inp2:m_Phrase label="la_Step"/> <inp2:m_Param name="step"/></span>
- </td>
- <td align="right" class="tablenav" width="20%" valign="middle">
- <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
- <script>
- var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
- $help_url = $help_url.replace(/#/g, '%23');
- set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
- </script>
- <a href="javascript: OpenHelp($help_url);">
- <img src="img/blue_bar_help.gif" border="0">
- </a>
- </inp2:m_if>
- <inp2:m_if check="m_Param" name="pagination">
- <inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
- </inp2:m_if>
- </td>
- </tr>
- </table>
-</inp2:m_DefineElement>
-
-
-<inp2:m_RenderElement name="section_header" icon="icon46_tool_backup" title="!la_title_Backup!"/>
-
-<inp2:m_RenderElement name="blue_bar_step" prefix="adm" title_preset="backup" module="in-portal" icon="icon46_tool_backup" step="3"/>
-
+<inp2:m_RenderElement name="combined_header" prefix="adm" section="in-portal:service" title_preset="backup"/>
<!-- 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_Prev" escape="1"/>', function() {
location.href = '<inp2:m_Link t="tools/backup1"/>';;
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
}
) );
a_toolbar.Render();
a_toolbar.DisableButton('next');
-
+ $(document).ready(
+ function() {
+ $('#step_number').text(3);
+ }
+ );
</script>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered" id="config_table">
<inp2:m_RenderElement name="subsection" title="la_Prompt_Backup_Status"/>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td colspan="3" class="text">
<inp2:m_Phrase label="la_Text_BackupComplete"/><br />
<inp2:m_Recall var="adm.backupcomplete_filename"/>
<inp2:m_Recall var="adm.backupcomplete_filesize"/> M<inp2:m_Phrase label="la_text_Bytes"/>
</td>
</tr>
</table>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/tools/backup3.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/tools/import1.tpl
===================================================================
--- branches/RC/core/admin_templates/tools/import1.tpl (revision 11537)
+++ branches/RC/core/admin_templates/tools/import1.tpl (revision 11538)
@@ -1,83 +1,58 @@
-<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
<inp2:m_include t="incs/header"/>
-
-<inp2:m_DefineElement name="blue_bar_step" module="" icon="" pagination="0">
- <table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
- <tr>
- <td class="header_left_bg" nowrap width="80%" valign="middle">
- <span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/> - <inp2:m_Phrase label="la_Step"/> <inp2:m_Param name="step"/></span>
- </td>
- <td align="right" class="tablenav" width="20%" valign="middle">
- <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
- <script>
- var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
- $help_url = $help_url.replace(/#/g, '%23');
- set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
- </script>
- <a href="javascript: OpenHelp($help_url);">
- <img src="img/blue_bar_help.gif" border="0">
- </a>
- </inp2:m_if>
- <inp2:m_if check="m_Param" name="pagination">
- <inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
- </inp2:m_if>
- </td>
- </tr>
- </table>
-</inp2:m_DefineElement>
-
-
-<inp2:m_RenderElement name="section_header" icon="icon46_tool_import" title="!la_tab_ImportData!"/>
-
-<inp2:m_RenderElement name="blue_bar_step" prefix="adm" title_preset="import" module="in-portal" icon="icon46_tool_import" step="1"/>
-
+<inp2:m_RenderElement name="combined_header" prefix="adm" section="in-portal:service" title_preset="import"/>
<!-- 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_Prev" escape="1"/>', function() {
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
location.href = '<inp2:m_Link t="tools/import2"/>';
}
) );
a_toolbar.Render();
a_toolbar.DisableButton('prev');
a_toolbar.DisableButton('next');
+
+ $(document).ready(
+ function() {
+ $('#step_number').text(1);
+ }
+ );
</script>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered" id="config_table">
<inp2:m_RenderElement name="subsection" title="la_Prompt_Warning"/>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td colspan="3" class="text">
This utility allows you to import data from other databases and applications, including third party products and earlier versions of this software.
</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="text" colspan="3">
<span class="hint"><img src="img/smicon7.gif" align="absmiddle" height="14" width="14">
<inp2:m_Phrase label="la_text_disclaimer_part1"/>
<inp2:m_Phrase label="la_text_disclaimer_part2"/>
</span>
</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="text" colspan="3">
<input id="agree" value="0" name="agree" onclick="if (this.checked == true) a_toolbar.EnableButton('next'); else a_toolbar.DisableButton('next');" type="checkbox"><label for="agree"><inp2:m_Phrase label="la_Text_IAgree"/></label> </td>
</tr>
</table>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/tools/import1.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/tools/import2.tpl
===================================================================
--- branches/RC/core/admin_templates/tools/import2.tpl (revision 11537)
+++ branches/RC/core/admin_templates/tools/import2.tpl (revision 11538)
@@ -1,107 +1,83 @@
-<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
<inp2:m_include t="incs/header"/>
-
-<inp2:m_DefineElement name="blue_bar_step" module="" icon="" pagination="0">
- <table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
- <tr>
- <td class="header_left_bg" nowrap width="80%" valign="middle">
- <span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/> - <inp2:m_Phrase label="la_Step"/> <inp2:m_Param name="step"/></span>
- </td>
- <td align="right" class="tablenav" width="20%" valign="middle">
- <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
- <script>
- var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
- $help_url = $help_url.replace(/#/g, '%23');
- set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
- </script>
- <a href="javascript: OpenHelp($help_url);">
- <img src="img/blue_bar_help.gif" border="0">
- </a>
- </inp2:m_if>
- <inp2:m_if check="m_Param" name="pagination">
- <inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
- </inp2:m_if>
- </td>
- </tr>
- </table>
-</inp2:m_DefineElement>
-
-
-<inp2:m_RenderElement name="section_header" icon="icon46_tool_import" title="!la_tab_ImportData!"/>
-
-<inp2:m_RenderElement name="blue_bar_step" prefix="adm" title_preset="import" module="in-portal" icon="icon46_tool_import" step="2"/>
-
+<inp2:m_RenderElement name="combined_header" prefix="adm" section="in-portal:service" title_preset="import"/>
<!-- 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_Prev" escape="1"/>', function() {
location.href = '<inp2:m_Link t="tools/import1"/>';
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
ImportRedirect(ChoiseMade('kernel_form','choose'));
}
) );
a_toolbar.Render();
a_toolbar.DisableButton('next');
function ImportRedirect(import_id)
{
<inp2:m_DefineElement name="import_js_script">
if (import_id == <inp2:m_Param name="script_id"/>) {
redirect('<inp2:m_Link template="{$script_module}/import" pass="{$script_prefix}.import" {$script_prefix}.import_event="OnNew"/>');
return ;
}
</inp2:m_DefineElement>
<inp2:adm_PrintImportSources render_as="import_js_script"/>
}
function ChoiseMade(form, radio_name)
{
// checks if user has selected enabled radio button
var frm = document.getElementById(form);
if(frm)
{
var i = 0;
var element_count = frm.elements.length;
for(i = 0; i < element_count; i++)
if(frm[i].type == 'radio' && frm[i].name == radio_name)
if(frm[i].checked == true)
return frm[i].value;
return false;
}
}
+
+ $(document).ready(
+ function() {
+ $('#step_number').text(2);
+ }
+ );
</script>
</td>
</tr>
</tbody>
</table>
<input type="hidden" name="import_id" id="import_id" value="">
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered" id="config_table">
<inp2:m_RenderElement name="subsection" title="la_prompt_Import_Source"/>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td>
<span class="text">Select the program you are importing the data from:</span>
</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td>
<inp2:m_DefineElement name="import_script">
<input name="choose" id="ch<inp2:m_param name="script_id"/>" value="<inp2:m_param name="script_id"/>" onclick="a_toolbar.EnableButton('next')" type="radio"><span class="text"><label for="ch<inp2:m_param name="script_id"/>"><inp2:m_param name="script_name"/></label></span><br>
</inp2:m_DefineElement>
<inp2:adm_PrintImportSources render_as="import_script"/>
</td>
</tr>
</table>
+
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/tools/import2.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/users/user_edit_items.tpl
===================================================================
--- branches/RC/core/admin_templates/users/user_edit_items.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/user_edit_items.tpl (revision 11538)
@@ -1,170 +1,174 @@
-<inp2:m_include t="incs/header"/>
-<inp2:m_include template="catalog/catalog_elements"/>
+<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>
<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_ModuleInclude template="user_item_tab" tab_init="2" title_property="ViewMenuPhrase" skip_prefixes="m,adm,cms"/>
</tr>
</table>
<!-- 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.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/users/image_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/users/image_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/image_edit.tpl (revision 11538)
@@ -1,55 +1,61 @@
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" prefix="u" title_preset="user_image_edit"/>
<inp2:m_include t="incs/image_blocks"/>
<!-- 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('u-img','<inp2:u-img_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('u-img','OnCancel');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <inp2:m_RenderElement name="subsection" title="!la_section_Image!"/>
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="u-img" field="ResourceId"/>
- <inp2:m_RenderElement name="inp_label" prefix="u-img" field="ImageId" title="!la_fld_ImageId!"/>
-
- <inp2:m_RenderElement name="inp_edit_box" prefix="u-img" field="Name" title="!la_fld_Name!" size="40"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="u-img" field="AltName" title="!la_fld_AltValue!" size="40"/>
-
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="u-img" field="Enabled" title="!la_fld_Enabled!" onchange="check_primary()" />
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="u-img" field="DefaultImg" title="!la_fld_Primary!" onchange="check_status()" />
- <inp2:m_RenderElement name="inp_edit_box" prefix="u-img" field="Priority" title="!la_fld_Priority!" size="5"/>
-
- <inp2:m_RenderElement name="subsection" title="!la_section_ThumbnailImage!"/>
- <inp2:m_RenderElement name="thumbnail_section" prefix="u-img"/>
-
- <inp2:m_RenderElement name="subsection" title="!la_section_FullSizeImage!"/>
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="u-img" field="SameImages" title="!la_fld_SameAsThumb!" onchange="toggle_fullsize()"/>
- <inp2:m_RenderElement name="fullsize_section" prefix="u-img"/>
+<inp2:u-img_SaveWarning name="grid_save_warning"/>
+<inp2:u-img_ErrorWarning name="form_error_warning"/>
-</table>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" title="!la_section_Image!"/>
+ <inp2:m_RenderElement name="inp_edit_hidden" prefix="u-img" field="ResourceId"/>
+ <inp2:m_RenderElement name="inp_label" prefix="u-img" field="ImageId" title="!la_fld_ImageId!"/>
+
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u-img" field="Name" title="!la_fld_Name!" size="40"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u-img" field="AltName" title="!la_fld_AltValue!" size="40"/>
+
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="u-img" field="Enabled" title="!la_fld_Enabled!" onchange="check_primary()" />
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="u-img" field="DefaultImg" title="!la_fld_Primary!" onchange="check_status()" />
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u-img" field="Priority" title="!la_fld_Priority!" size="5"/>
+
+ <inp2:m_RenderElement name="subsection" title="!la_section_ThumbnailImage!"/>
+ <inp2:m_RenderElement name="thumbnail_section" prefix="u-img"/>
+
+ <inp2:m_RenderElement name="subsection" title="!la_section_FullSizeImage!"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="u-img" field="SameImages" title="!la_fld_SameAsThumb!" onchange="toggle_fullsize()"/>
+ <inp2:m_RenderElement name="fullsize_section" prefix="u-img"/>
+
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
<script type="text/javascript">
<inp2:m_RenderElement name="images_edit_js" prefix="u-img"/>
toggle_fullsize();
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/users/image_edit.tpl
___________________________________________________________________
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/admin_templates/users/users_list.tpl
===================================================================
--- branches/RC/core/admin_templates/users/users_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/users_list.tpl (revision 11538)
@@ -1,107 +1,108 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" grid="RegularUsers" pagination="1" prefix="u"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" grid="RegularUsers" title_preset="users_list" pagination="1" prefix="u"/>
<!-- 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()
{
set_hidden_field('remove_specials[u.regular]', 1);
std_edit_item('u.regular', 'users/users_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_user', '<inp2:m_phrase label="la_ToolTip_NewUser" escape="1"/>::<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
function() {
set_hidden_field('remove_specials[u.regular]', 1);
std_precreate_item('u.regular', 'users/users_edit')
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
set_hidden_field('remove_specials[u.regular]', 1);
std_delete_items('u.regular')
} ) );
/*a_toolbar.AddButton (
new ToolBarButton(
'primary_user_group',
'<inp2:m_phrase label="la_ToolTip_PrimaryGroup" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_SetPrimary" escape="1"/>',
function() {
openSelector('u.regular', '<inp2:m_Link t="users/group_selector" pass="m,u"/>', 'PrimaryGroupId', '800x600', 'OnSaveSelected');
}
)
);*/
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
set_hidden_field('remove_specials[u.regular]', 1);
submit_event('u.regular', 'OnMassApprove');
}
) );
a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
set_hidden_field('remove_specials[u.regular]', 1);
submit_event('u.regular', 'OnMassDecline');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
/*<inp2:m_if check="m_ModuleEnabled" module="In-Portal">
<inp2:m_if check="m_Recall" name="user_id" equals_to="-1">
a_toolbar.AddButton( new ToolBarButton('e-mail', '<inp2:m_phrase label="la_ToolTip_SendMail" escape="1"/>', function() {
set_hidden_field('remove_specials[u.regular]', 1);
openSelector('emailmessages', '<inp2:m_Link template="emails/mass_mail"/>', 'UserEmail', null, 'OnPrepareMassRecipients');
}
) );
</inp2:m_if>
</inp2:m_if>*/
<inp2:m_if check="m_ModuleEnabled" module="In-Portal">
a_toolbar.AddButton(
new ToolBarButton(
'e-mail',
'<inp2:m_phrase label="la_ToolTip_SendMail" escape="1"/>',
function() {
Application.SetVar('remove_specials[u.regular]', 1);
Application.SetVar('mailing_recipient_type', 'u');
openSelector('mailing-list', '<inp2:m_Link template="mailing_lists/mailing_list_edit"/>', 'UserEmail', null, 'OnNew');
}
)
);
</inp2:m_if>
a_toolbar.AddButton( new ToolBarButton('export', '<inp2:m_phrase label="la_ToolTip_Export" escape="1"/>', function() {
set_hidden_field('remove_specials[u.regular]', 1);
std_csv_export('u.regular', 'RegularUsers', 'export/export_progress');
}
) );
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="u.regular" grid="RegularUsers"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="u.regular" IdField="PortalUserId" grid="RegularUsers" menu_filters="yes" grid_filters="1"/>
<script type="text/javascript">
Grids['u.regular'].SetDependantToolbarButtons( new Array('edit','delete', 'e-mail') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/users/users_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3.2.7
\ No newline at end of property
+1.3.2.8
\ No newline at end of property
Index: branches/RC/core/admin_templates/users/group_selector.tpl
===================================================================
--- branches/RC/core/admin_templates/users/group_selector.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/group_selector.tpl (revision 11538)
@@ -1,46 +1,46 @@
<inp2:adm_SetPopupSize width="582" height="504"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
-
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
-
-<inp2:m_RenderElement name="blue_bar" prefix="g" title_preset="select_group" icon="icon46_usergroups"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="g.user" section="in-portal:user_groups" pagination="1" title_preset="select_group"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
window_close();
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
function edit()
{
set_hidden_field('remove_specials[g.user]', 1);
submit_event('<inp2:m_recall name="main_prefix"/>', 'OnProcessSelected');
}
</script>
</td>
+
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="g.user" grid="GroupSelector"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="g.user" IdField="GroupId" grid="GroupSelector" limited_heights="1"/>
<script type="text/javascript">
Grids['g.user'].SetDependantToolbarButtons( new Array('select') );
</script>
+
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/users/group_selector.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3.2.2
\ No newline at end of property
+1.3.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/users/user_edit_group.tpl
===================================================================
--- branches/RC/core/admin_templates/users/user_edit_group.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/user_edit_group.tpl (revision 11538)
@@ -1,42 +1,39 @@
-<inp2:m_RequireLogin permissions="in-portal:user_list.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="u" icon="icon46_users" module="in-portal" title="la_title_Users"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="u" title_preset="user_edit_group" module="in-portal" icon="icon46_users"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" prefix="u" title_preset="user_edit_group"/>
<!-- 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('u-ug', '<inp2:u-ug_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('u-ug', 'OnCancel');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
-<inp2:u_SaveWarning name="grid_save_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_label" prefix="u-ug" field="GroupName" title="la_fld_GroupName"/>
- <inp2:m_RenderElement name="inp_label" prefix="u-ug" field="PrimaryGroup" title="la_prompt_PrimaryGroup"/> <!-- OLD PHRASE, la_fld_PrimaryGroup -->
- <inp2:m_RenderElement name="inp_edit_date_time" prefix="u-ug" field="MembershipExpires" title="la_prompt_MembershipExpires"/> <!-- OLD PHRASE, la_fld_MembershipExpires -->
-
-</table>
+<inp2:u-ug_SaveWarning name="grid_save_warning"/>
+<inp2:u-ug_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_label" prefix="u-ug" field="GroupName" title="la_fld_GroupName"/>
+ <inp2:m_RenderElement name="inp_label" prefix="u-ug" field="PrimaryGroup" title="la_prompt_PrimaryGroup"/> <!-- OLD PHRASE, la_fld_PrimaryGroup -->
+ <inp2:m_RenderElement name="inp_edit_date_time" prefix="u-ug" field="MembershipExpires" title="la_prompt_MembershipExpires"/> <!-- OLD PHRASE, la_fld_MembershipExpires -->
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
<inp2:m_include t="incs/footer"/>
Property changes on: branches/RC/core/admin_templates/users/user_edit_group.tpl
___________________________________________________________________
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/admin_templates/users/users_edit_custom.tpl
===================================================================
--- branches/RC/core/admin_templates/users/users_edit_custom.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/users_edit_custom.tpl (revision 11538)
@@ -1,62 +1,71 @@
-<inp2:m_include t="incs/header"/>
+<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_custom" 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('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/>');
}
) );
function edit(){ }
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_if check="u_DisplayOriginal" display_original="1">
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTabOriginal"/>
+ <inp2:m_else/>
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTab"/>
+ </inp2:m_if>
</tr>
</tbody>
</table>
<inp2:m_include t="incs/custom_blocks"/>
+
<inp2:m_if check="u_DisplayOriginal" display_original="1">
<inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="u" value_field="Value" per_page="-1" grid="SeparateTabOriginal" header_block="grid_column_title_no_sorting" no_init="no_init" original_title="la_section_OriginalValues" display_original="1"/>
<inp2:m_else/>
<inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="u" value_field="Value" per_page="-1" grid="SeparateTab" header_block="grid_column_title_no_sorting" no_init="no_init"/>
</inp2:m_if>
+<input type="hidden" name="cf_type" value="<inp2:u_UnitOption name='ItemType'/>"/>
-<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/users/users_edit_custom.tpl
___________________________________________________________________
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/admin_templates/users/user_edit_password.tpl
===================================================================
--- branches/RC/core/admin_templates/users/user_edit_password.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/user_edit_password.tpl (revision 11538)
@@ -1,40 +1,44 @@
<inp2:adm_SetPopupSize width="564" height="377"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" perm_section="ADMIN" permission_type="" pagination="0" prefix="u" title_preset="admins_edit"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" perm_section="ADMIN" permission_type="" prefix="u" title_preset="admins_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('u','OnUpdatePassword');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
cancel_edit('u','OnCancelEdit','<inp2:u_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:u_SaveWarning name="grid_save_warning"/>
<inp2:u_ErrorWarning name="form_error_warning"/>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="table-collapsed">
+
+<div id="scroll_container">
+ <table class="edit-form">
<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_password" prefix="u" field="Password" title="la_fld_Password"/>
<inp2:m_RenderElement name="inp_edit_password" prefix="u" field="VerifyPassword" title="la_fld_VerifyPassword"/>
<inp2:m_RenderElement name="inp_label" prefix="u" field="FirstName" title="la_fld_FirstName"/>
<inp2:m_RenderElement name="inp_label" prefix="u" field="LastName" title="la_fld_LastName"/>
<inp2:m_RenderElement name="inp_label" prefix="u" field="Email" title="la_fld_Email"/>
-</table>
+ <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/users/user_edit_password.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/users_edit_groups.tpl
===================================================================
--- branches/RC/core/admin_templates/users/users_edit_groups.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/users_edit_groups.tpl (revision 11538)
@@ -1,111 +1,104 @@
-<inp2:m_include t="incs/header"/>
+<inp2:adm_SetPopupSize width="720" height="500"/>
-<inp2:m_if check="m_ModuleEnabled" module="In-Portal">
- <inp2:m_RenderElement name="combined_header" section="in-portal:user_list" prefix="u" title_preset="user_edit_groups" tab_preset="Default"/>
-<inp2:m_else/>
- <inp2:m_RenderElement name="combined_header" section="in-portal:user_list" prefix="u" title_preset="user_edit_groups" tab_preset="RegularUsers"/>
-</inp2:m_if>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" prefix="u" title_preset="user_edit_groups" tab_preset="Default" pagination="1" pagination_prefix="u-ug"/>
<!-- 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_temp_item('u-ug', 'users/user_edit_group');
}
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() {
cancel_edit('u','OnCancelEdit','<inp2:u_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" 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('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('usertogroup', '<inp2:m_phrase label="la_ToolTip_AddToGroup" escape="1"/>::<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
function() {
openSelector('u-ug', '<inp2:m_Link t="users/group_selector" pass="m,u"/>', 'GroupId', '800x600');
} ) );
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('u-ug');
} ) );
a_toolbar.AddButton( new ToolBarButton('primary_group', '<inp2:m_phrase label="la_ToolTip_SetPrimary" escape="1"/>',
function() {
submit_event('u-ug','OnSetPrimary');
} ) );
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();
<inp2:m_if check="u_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep2');
<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="search_main_toolbar" prefix="u-ug" grid="Default"/>
</tr>
</tbody>
</table>
-<inp2:m_DefineElement name="grid_membership_platform_td">
+<inp2:m_DefineElement name="grid_membership_td">
<inp2:m_if check="Field" name="$field" db="db">
<inp2:Field field="$field" first_chars="$first_chars" nl2br="$nl2br" grid="$grid" no_special="$no_special" format="$format"/>
<inp2:m_else/>
<inp2:m_phrase name="la_NeverExpires"/>
</inp2:m_if>
</inp2:m_DefineElement>
-<inp2:m_DefineElement name="grid_membership_td" td_style="">
- <td valign="top" class="text" style="<inp2:m_param name="td_style"/>">
- <inp2:m_RenderElement name="grid_membership_platform_td" pass_params="1"/>
- </td>
-</inp2:m_DefineElement>
-
<inp2:m_RenderElement name="grid" PrefixSpecial="u-ug" IdField="GroupId" grid="Default" limited_heights="1"/>
<script type="text/javascript">
Grids['u-ug'].SetDependantToolbarButtons( new Array('delete', 'edit', 'primary_group') );
</script>
<input type="hidden" name="u_mode" value="t<inp2:m_Get var="m_wid" />" />
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/users/users_edit_groups.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/users/admins_list.tpl
===================================================================
--- branches/RC/core/admin_templates/users/admins_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/admins_list.tpl (revision 11538)
@@ -1,68 +1,68 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:admins" pagination="1" prefix="u.admins" title_preset="" grid="Admins" />
+<inp2:m_RenderElement name="combined_header" section="in-portal:admins" pagination="1" prefix="u.admins" title_preset="admin_list" grid="Admins"/>
<!-- 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()
{
set_hidden_field('remove_specials[u.admins]', 1);
std_edit_item('u.admins', 'users/admins_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_user', '<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
function() {
set_hidden_field('remove_specials[u.admins]', 1);
std_precreate_item('u.admins', 'users/admins_edit')
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
set_hidden_field('remove_specials[u.admins]', 1);
std_delete_items('u.admins')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('clone', '<inp2:m_phrase label="la_ToolTip_CloneUser" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_CloneUser" escape="1"/>',
function() {
set_hidden_field('remove_specials[u.admins]', 1);
submit_event('u.admins', 'OnMassCloneUsers');
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('refresh', '<inp2:m_phrase label="la_ToolTip_ResetSettings" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_ResetSettings" escape="1"/>',
function() {
set_hidden_field('remove_specials[u.admins]', 1);
submit_event('u.admins', 'OnMassResetSettings');
} ) );
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="u.admins" grid="Admins"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="u.admins" IdField="PortalUserId" grid="Admins" menu_filters="yes" grid_filters="1"/>
<script type="text/javascript">
Grids['u.admins'].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/users/admins_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3.2.6
\ No newline at end of property
+1.3.2.7
\ No newline at end of property
Index: branches/RC/core/admin_templates/users/users_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/users/users_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/users_edit.tpl (revision 11538)
@@ -1,109 +1,107 @@
-<inp2:adm_SetPopupSize width="550" height="425"/>
+<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="users_edit" tab_preset="Default"/>
+
- <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
- <inp2:m_RenderElement name="combined_header" section="in-portal:user_list" prefix="u" title_preset="users_edit" tab_preset="Default"/>
- <inp2:m_else/>
- <inp2:m_RenderElement name="combined_header" section="in-portal:user_list" prefix="u" title_preset="users_edit" tab_preset="RegularUsers"/>
- </inp2:m_if>
<!-- 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('u','<inp2:u_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
cancel_edit('u','OnCancelEdit','<inp2:u_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('u', '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('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.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>
addLoadEvent(
function() {
// fixes Firefox 2.0+ bug will password autocomplete
document.getElementById('<inp2:u_InputName field="Password"/>').value = '';
}
);
</script>
</td>
- <inp2:m_RenderElement name="ml_selector" prefix="u"/>
</tr>
</tbody>
</table>
<inp2:u_SaveWarning name="grid_save_warning"/>
<inp2:u_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_id_label" prefix="u" field="PortalUserId" title="!la_fld_Id!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Login" title="la_fld_Username"/>
- <inp2:m_RenderElement name="inp_edit_password" prefix="u" field="Password" title="la_fld_Password"/>
- <inp2:m_RenderElement name="inp_edit_password" prefix="u" field="VerifyPassword" title="la_fld_VerifyPassword"/>
-
- <inp2:m_RenderElement name="subsection" title="la_prompt_PersonalInfo"/> <!-- OLD PHRASE, la_section_PersonalInformation -->
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="FirstName" title="la_fld_FirstName"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="LastName" title="la_fld_LastName"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Company" title="la_fld_Company"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Email" title="la_fld_Email"/>
- <inp2:m_RenderElement name="inp_edit_date" prefix="u" field="dob" title="la_prompt_birthday"/> <!-- OLD PHRASE, la_fld_BirthDate -->
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Phone" title="la_fld_Phone"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Fax" title="la_fld_Fax"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Street" title="la_fld_AddressLine1"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Street2" title="la_fld_AddressLine2"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="City" title="la_fld_City"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="State" title="la_fld_State"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Zip" title="la_fld_Zip"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Country" title="la_fld_Country" has_empty="1"/>
-
- <inp2:m_RenderElement name="subsection" title="la_section_Properties"/>
- <inp2:m_RenderElement name="inp_edit_radio" prefix="u" field="Status" title="la_fld_Status"/>
- <inp2:m_RenderElement name="inp_edit_date_time" prefix="u" field="CreatedOn" title="la_fld_CreatedOn"/>
-
- <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
- <!-- custom fields: begin -->
- <inp2:m_include t="incs/custom_blocks"/>
- <inp2:cf.general_PrintList render_as="cv_row_block" SourcePrefix="u" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues" display_original="1"/>
- <!-- custom fields: end -->
- </inp2:m_if>
+ <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_edit_box" prefix="u" field="Login" title="la_fld_Username"/>
+ <inp2:m_RenderElement name="inp_edit_password" prefix="u" field="Password" title="la_fld_Password"/>
+ <inp2:m_RenderElement name="inp_edit_password" prefix="u" field="VerifyPassword" title="la_fld_VerifyPassword"/>
+
+ <inp2:m_RenderElement name="subsection" title="la_prompt_PersonalInfo"/> <!-- OLD PHRASE, la_section_PersonalInformation -->
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="FirstName" title="la_fld_FirstName"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="LastName" title="la_fld_LastName"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Company" title="la_fld_Company"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Email" title="la_fld_Email"/>
+ <inp2:m_RenderElement name="inp_edit_date" prefix="u" field="dob" title="la_prompt_birthday"/> <!-- OLD PHRASE, la_fld_BirthDate -->
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Phone" title="la_fld_Phone"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Fax" title="la_fld_Fax"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Street" title="la_fld_AddressLine1"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Street2" title="la_fld_AddressLine2"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="City" title="la_fld_City"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="State" title="la_fld_State"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Zip" title="la_fld_Zip"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Country" title="la_fld_Country" has_empty="1"/>
+
+ <inp2:m_RenderElement name="subsection" title="la_section_Properties"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="u" field="Status" title="la_fld_Status"/>
+ <inp2:m_RenderElement name="inp_edit_date_time" prefix="u" field="CreatedOn" title="la_fld_CreatedOn"/>
+
+ <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
+ <!-- custom fields: begin -->
+ <inp2:m_include t="incs/custom_blocks"/>
+ <inp2:cf.general_PrintList render_as="cv_row_block" SourcePrefix="u" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues" display_original="1"/>
+ <!-- custom fields: end -->
+ </inp2:m_if>
- <inp2:m_RenderElement name="inp_edit_filler"/>
-</table>
+ <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/users/users_edit.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_images.tpl
===================================================================
--- branches/RC/core/admin_templates/users/user_edit_images.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/user_edit_images.tpl (revision 11538)
@@ -1,103 +1,106 @@
-<inp2:m_include t="incs/header"/>
+<inp2:adm_SetPopupSize width="720" height="500"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" prefix="u" title_preset="user_edit_images" tab_preset="Default"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" prefix="u" title_preset="user_edit_images" tab_preset="Default" pagination="1" pagination_prefix="u-img"/>
<inp2:m_include t="incs/image_blocks"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
function edit()
{
std_edit_temp_item('u-img', 'users/image_edit');
}
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('new_image', '<inp2:m_phrase label="la_ToolTip_New_Images" escape="1"/>',
function() {
std_new_item('u-img', 'users/image_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('u-img')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('move_up', '<inp2:m_phrase label="la_ToolTip_MoveUp" escape="1"/>', function() {
submit_event('u-img','OnMassMoveUp');
}
) );
a_toolbar.AddButton( new ToolBarButton('move_down', '<inp2:m_phrase label="la_ToolTip_MoveDown" escape="1"/>', function() {
submit_event('u-img','OnMassMoveDown');
}
) );
a_toolbar.AddButton( new ToolBarButton('primary_image', '<inp2:m_phrase label="la_ToolTip_SetPrimary" escape="1"/>', function() {
submit_event('u-img','OnSetPrimary');
}
) );
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="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="search_main_toolbar" prefix="u-img" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="u-img" IdField="ImageId" grid="Default" menu_filters="yes"/>
<script type="text/javascript">
Grids['u-img'].SetDependantToolbarButtons( new Array('edit','delete','move_up','move_down','primary_image') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/users/user_edit_images.tpl
___________________________________________________________________
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/admin_templates/users/admin_edit_group.tpl
===================================================================
--- branches/RC/core/admin_templates/users/admin_edit_group.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/admin_edit_group.tpl (revision 11538)
@@ -1,37 +1,41 @@
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:admins" prefix="u" title_preset="user_edit_group"/>
<!-- 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('u-ug', '<inp2:u-ug_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('u-ug', 'OnCancel');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
-<inp2:u_SaveWarning name="grid_save_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_label" prefix="u-ug" field="GroupName" title="la_fld_GroupName"/>
- <inp2:m_RenderElement name="inp_label" prefix="u-ug" field="PrimaryGroup" title="la_prompt_PrimaryGroup"/> <!-- OLD PHRASE, la_fld_PrimaryGroup -->
- <inp2:m_RenderElement name="inp_edit_date_time" prefix="u-ug" field="MembershipExpires" title="la_prompt_MembershipExpires"/> <!-- OLD PHRASE, la_fld_MembershipExpires -->
+<inp2:u-ug_SaveWarning name="grid_save_warning"/>
+<inp2:u-ug_ErrorWarning name="form_error_warning"/>
-</table>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" title="la_section_General"/>
+ <inp2:m_RenderElement name="inp_label" prefix="u-ug" field="GroupName" title="la_fld_GroupName"/>
+ <inp2:m_RenderElement name="inp_label" prefix="u-ug" field="PrimaryGroup" title="la_prompt_PrimaryGroup"/> <!-- OLD PHRASE, la_fld_PrimaryGroup -->
+ <inp2:m_RenderElement name="inp_edit_date_time" prefix="u-ug" field="MembershipExpires" title="la_prompt_MembershipExpires"/> <!-- OLD PHRASE, la_fld_MembershipExpires -->
+ <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/users/admin_edit_group.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/users/root_edit_password.tpl
===================================================================
--- branches/RC/core/admin_templates/users/root_edit_password.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/root_edit_password.tpl (revision 11538)
@@ -1,36 +1,40 @@
<inp2:adm_SetPopupSize width="564" height="377"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_set u_id="-1"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:admins" pagination="0" prefix="u" title_preset="root_edit"/>
+
+<inp2:m_RenderElement name="combined_header" section="in-portal:admins" prefix="u" title_preset="root_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('u','OnUpdateRootPassword');
}
) );
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>
<inp2:u_SaveWarning name="grid_save_warning"/>
<inp2:u_ErrorWarning name="form_error_warning"/>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="table-collapsed">
+
+<div id="scroll_container">
+ <table class="edit-form">
<inp2:m_RenderElement name="inp_edit_password" prefix="u" field="RootPassword" title="la_fld_Password"/>
<inp2:m_RenderElement name="inp_edit_password" prefix="u" field="VerifyRootPassword" title="la_fld_VerifyPassword"/>
-</table>
+ <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/users/root_edit_password.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_selector.tpl
===================================================================
--- branches/RC/core/admin_templates/users/user_selector.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/user_selector.tpl (revision 11538)
@@ -1,46 +1,45 @@
-<inp2:m_include t="incs/header" nobody="yes"/>
-
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
-
-<inp2:m_RenderElement name="blue_bar" prefix="u" title_preset="users_select" module="in-portal" icon="icon46_users"/>
+<inp2:adm_SetPopupSize width="582" height="504"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="u.group" section="in-portal:user_list" grid="UserSelector" title_preset="group_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()
{
set_hidden_field('remove_specials[u.group]', 1);
submit_event('<inp2:m_recall name="main_prefix"/>', 'OnProcessSelected');
}
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="u.group" IdField="PortalUserId" grid="UserSelector" menu_filters="yes"/>
<script type="text/javascript">
Grids['u.group'].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/users/user_selector.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/users/admins_edit_groups.tpl
===================================================================
--- branches/RC/core/admin_templates/users/admins_edit_groups.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/admins_edit_groups.tpl (revision 11538)
@@ -1,107 +1,103 @@
-<inp2:m_include t="incs/header"/>
+<inp2:adm_SetPopupSize width="700" height="440"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:admins" pagination="0" prefix="u" title_preset="user_edit_groups" tab_preset="Admins"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:admins" prefix="u" title_preset="user_edit_groups" tab_preset="Admins"/>
<!-- 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_temp_item('u-ug', 'users/admin_edit_group');
}
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() {
cancel_edit('u','OnCancelEdit','<inp2:u_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" 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('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('usertogroup', '<inp2:m_phrase label="la_ToolTip_AddToGroup" escape="1"/>::<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
function() {
openSelector('u-ug', '<inp2:m_Link t="users/group_selector" pass="m,u"/>', 'GroupId', '800x600');
} ) );
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('u-ug');
} ) );
a_toolbar.AddButton( new ToolBarButton('primary_group', '<inp2:m_phrase label="la_ToolTip_SetPrimary" escape="1"/>',
function() {
submit_event('u-ug','OnSetPrimary');
} ) );
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();
<inp2:m_if check="u_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep2');
<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="search_main_toolbar" prefix="u-ug" grid="Default"/>
</tr>
</tbody>
</table>
-<inp2:m_DefineElement name="grid_membership_platform_td">
+<inp2:m_DefineElement name="grid_membership_td">
<inp2:m_if check="Field" name="$field" db="db">
<inp2:Field field="$field" first_chars="$first_chars" nl2br="$nl2br" grid="$grid" no_special="$no_special" format="$format"/>
<inp2:m_else/>
<inp2:m_phrase name="la_NeverExpires"/>
</inp2:m_if>
</inp2:m_DefineElement>
-<inp2:m_DefineElement name="grid_membership_td" td_style="">
- <td valign="top" class="text" style="<inp2:m_param name="td_style"/>">
- <inp2:m_RenderElement name="grid_membership_platform_td" pass_params="1"/>
- </td>
-</inp2:m_DefineElement>
-
<inp2:m_RenderElement name="grid" PrefixSpecial="u-ug" IdField="GroupId" grid="Default" limited_heights="1"/>
<script type="text/javascript">
Grids['u-ug'].SetDependantToolbarButtons( new Array('delete', 'edit', 'primary_group') );
</script>
<input type="hidden" name="u_mode" value="t<inp2:m_Get var="m_wid" />" />
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/users/admins_edit_groups.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.8
\ No newline at end of property
+1.1.2.9
\ No newline at end of property
Index: branches/RC/core/admin_templates/users/admins_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/users/admins_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/users/admins_edit.tpl (revision 11538)
@@ -1,84 +1,84 @@
-<inp2:adm_SetPopupSize width="550" height="400"/>
-<inp2:m_include t="incs/header"/>
+<inp2:adm_SetPopupSize width="700" height="440"/>
+<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:admins" prefix="u" title_preset="admins_edit" tab_preset="Admins"/>
<!-- 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('u','<inp2:u_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
cancel_edit('u','OnCancelEdit','<inp2:u_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('u', '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('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.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>
addLoadEvent(
function() {
// fixes Firefox 2.0+ bug will password autocomplete
document.getElementById('<inp2:u_InputName field="Password"/>').value = '';
}
);
</script>
</td>
- <inp2:m_RenderElement name="ml_selector" prefix="u"/>
</tr>
</tbody>
</table>
<inp2:u_SaveWarning name="grid_save_warning"/>
<inp2:u_ErrorWarning name="form_error_warning"/>
+
<input type="hidden" name="user_group" value="11"/>
<div id="scroll_container">
-<table class="edit-form">
+ <table class="edit-form">
<inp2:m_RenderElement name="inp_id_label" prefix="u" field="PortalUserId" title="!la_fld_Id!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Login" title="la_fld_Username"/>
<inp2:m_RenderElement name="inp_edit_password" prefix="u" field="Password" title="la_fld_Password"/>
<inp2:m_RenderElement name="inp_edit_password" prefix="u" field="VerifyPassword" title="la_fld_VerifyPassword"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="u" field="FirstName" title="la_fld_FirstName"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="u" field="LastName" title="la_fld_LastName"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Email" title="la_fld_Email"/>
<inp2:m_RenderElement name="inp_edit_filler"/>
-</table>
+ </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/users/admins_edit.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/stop_words/stop_word_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/stop_words/stop_word_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/stop_words/stop_word_edit.tpl (revision 11538)
@@ -1,71 +1,71 @@
<inp2:adm_SetPopupSize width="550" height="400"/>
-<inp2:m_include t="incs/header"/>
+<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:stop_words" prefix="stop-word" title_preset="stop_word_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('stop-word', '<inp2:stop-word_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
cancel_edit('stop-word', 'OnCancelEdit','<inp2:stop-word_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('stop-word', '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('stop-word', '<inp2:stop-word_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('stop-word', '<inp2:stop-word_NextId/>');
}
) );
a_toolbar.Render();
<inp2:m_if check="stop-word_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="stop-word_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="stop-word_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:stop-word_SaveWarning name="grid_save_warning"/>
<inp2:stop-word_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
-<table class="edit-form">
+ <table class="edit-form">
<inp2:m_RenderElement name="inp_id_label" prefix="stop-word" field="StopWordId" title="la_fld_Id"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="stop-word" field="StopWord" title="la_fld_StopWord"/>
<inp2:m_RenderElement name="inp_edit_filler"/>
-</table>
+ </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/stop_words/stop_word_edit.tpl
___________________________________________________________________
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/admin_templates/stop_words/stop_word_list.tpl
===================================================================
--- branches/RC/core/admin_templates/stop_words/stop_word_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/stop_words/stop_word_list.tpl (revision 11538)
@@ -1,48 +1,48 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:stop_words" prefix="stop-word" title_preset="stop_word_list" />
+<inp2:m_RenderElement name="combined_header" section="in-portal:stop_words" prefix="stop-word" title_preset="stop_word_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('stop-word', 'stop_words/stop_word_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
function() {
std_precreate_item('stop-word', 'stop_words/stop_word_edit');
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('stop-word')
} ) );
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="stop-word" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="stop-word" IdField="StopWordId" grid="Default" grid_filters="1"/>
<script type="text/javascript">
Grids['stop-word'].SetDependantToolbarButtons( new Array('edit','delete') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/stop_words/stop_word_list.tpl
___________________________________________________________________
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/admin_templates/logs/visits/visits_list.tpl
===================================================================
--- branches/RC/core/admin_templates/logs/visits/visits_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/logs/visits/visits_list.tpl (revision 11538)
@@ -1,85 +1,68 @@
<inp2:m_include t="incs/header"/>
-
-<inp2:m_RenderElement name="combined_header" prefix="visits" section="in-portal:visits" title_preset="visits_list" />
+<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('search', '<inp2:m_phrase label="la_ToolTip_Search" escape="1"/>',
- function() {
- set_hidden_field('grid_name', 'Default');
- submit_event('visits','OnSearch');
- } ) );
-
- a_toolbar.AddButton( new ToolBarButton('search_reset', '<inp2:m_phrase label="la_ToolTip_SearchReset" escape="1"/>',
- function() {
- set_hidden_field('grid_name', 'Default');
- submit_event('visits','OnSearchReset');
- } ) );
-
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" >
- <td valign="top" class="text">
- <inp2:m_if check="UserFound" user_field="$user_field">
- <a href="<inp2:{$PrefixSpecial}_UserLink user_field="$user_field"/>" title="<inp2:m_phrase name="la_Edit_User"/>"><inp2:{$PrefixSpecial}_field field="$field" grid="$grid"/></a>
- <inp2:m_else/>
- <inp2:{$PrefixSpecial}_field field="$field" grid="$grid"/>
- </inp2:m_if>
- </td>
+<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>
+ <inp2:m_else/>
+ <inp2:Field field="$field" grid="$grid"/>
+ </inp2:m_if>
</inp2:m_DefineElement>
-<inp2:m_DefineElement name="grid_referer_td" >
- <td valign="top" class="text">
- <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>
- </td>
+<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"/>
<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.1
\ No newline at end of property
+1.16.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/logs/session_logs/session_log_list.tpl
===================================================================
--- branches/RC/core/admin_templates/logs/session_logs/session_log_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/logs/session_logs/session_log_list.tpl (revision 11538)
@@ -1,74 +1,73 @@
<inp2:m_include t="incs/header" />
-
-<inp2:m_RenderElement name="combined_header" section="in-portal:session_logs" prefix="session-log" title_preset="" pagination="1"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:session_logs" prefix="session-log" title_preset="session_log_list" pagination="1"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td >
<script type="text/javascript">
a_toolbar = new ToolBar();
function edit()
{
}
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function(id) {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="session-log" grid="Default"/>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<style type="text/css">
tr.row-active td {
background-color: #EAFFDC;
}
tr.row-expired td {
color: #555;
}
</style>
<inp2:m_DefineElement name="row_class">
<inp2:m_if check="FieldEquals" field="Status" value="0">
row-active
<inp2:m_else/>
<inp2:m_if check="FieldEquals" field="Status" value="2">
row-expired
</inp2:m_if>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="affected_td">
<inp2:m_if check="m_ModuleEnabled" module="Proj-Base">
<inp2:Field name="SessionLogId" result_to_var="sessionlog_id"/>
<a href="<inp2:m_t t="logs/change_logs/change_log_list" pass="m,change-log" grid_name="Default" custom_filters[change-log][Default][SessionLogId][like]="$sessionlog_id" change-log_event="OnSearch"/>"><inp2:Field name="AffectedItems"/></a>
<inp2:_else/>
<td valign="top" class="text" style="<inp2:m_param name="td_style"/>">
<inp2:Field name="SessionLogId" result_to_var="sessionlog_id"/>
<a href="<inp2:m_t t="logs/change_logs/change_log_list" pass="m,change-log" grid_name="Default" custom_filters[change-log][Default][SessionLogId][like]="$sessionlog_id" change-log_event="OnSearch"/>"><inp2:Field name="AffectedItems"/></a>
</td>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_RenderElement name="grid" PrefixSpecial="session-log" IdField="SessionLogId" grid="Default" grid_filters="1" limited_heights="1" row_class_render_as="row_class"/>
<script type="text/javascript">
Grids['session-log'].SetDependantToolbarButtons( new Array() );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/logs/session_logs/session_log_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/logs/change_logs/change_log_list.tpl
===================================================================
--- branches/RC/core/admin_templates/logs/change_logs/change_log_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/logs/change_logs/change_log_list.tpl (revision 11538)
@@ -1,86 +1,79 @@
<inp2:m_include t="incs/header" />
-
-<inp2:m_RenderElement name="combined_header" section="in-portal:change_logs" prefix="change-log" title_preset="" pagination="1"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:change_logs" prefix="change-log" title_preset="change_log_list" pagination="1"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
- <td >
+ <td>
<script type="text/javascript">
a_toolbar = new ToolBar();
function edit()
{
std_edit_item('change-log', 'logs/change_logs/change_log_edit');
}
a_toolbar.AddButton( new ToolBarButton('view_item', '<inp2:m_phrase label="la_ToolTip_ViewItem" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_View" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function(id) {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="change-log" grid="Default"/>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<style type="text/css">
tr.row-create td {
background-color: #F0FFE6;
}
tr.row-update td {
background-color: #FFFFE6;
}
tr.row-delete td {
background-color: #FFE6E6;
}
</style>
<inp2:m_DefineElement name="row_class">
<inp2:m_if check="FieldEquals" field="Action" value="1">
row-create
<inp2:m_else/>
<inp2:m_if check="FieldEquals" field="Action" value="2">
row-update
<inp2:m_else/>
row-delete
</inp2:m_if>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_changes_td" format="" no_special="" nl2br="" first_chars="" td_style="">
- <inp2:m_if check="m_ModuleEnabled" module="Proj-Base">
- <inp2:Field field="$field" first_chars="$first_chars" nl2br="$nl2br" grid="$grid" no_special="1" format="$format"/>
- <inp2:_else/>
- <td valign="top" class="text" style="<inp2:m_param name="td_style"/>">
- <inp2:Field field="$field" first_chars="$first_chars" nl2br="$nl2br" grid="$grid" no_special="1" format="$format"/>
- </td>
- </inp2:m_if>
+ <inp2:Field field="$field" first_chars="$first_chars" nl2br="$nl2br" grid="$grid" no_special="1" format="$format"/>
</inp2:m_DefineElement>
<inp2:m_RenderElement name="grid" PrefixSpecial="change-log" IdField="ChangeLogId" grid="Default" grid_filters="1" limited_heights="1" row_class_render_as="row_class"/>
<script type="text/javascript">
Grids['change-log'].SetDependantToolbarButtons( new Array('view_item') );
</script>
-<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/logs/change_logs/change_log_list.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/change_logs/change_log_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/logs/change_logs/change_log_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/logs/change_logs/change_log_edit.tpl (revision 11538)
@@ -1,88 +1,87 @@
<inp2:adm_SetPopupSize width="750" height="570"/>
-<inp2:m_include t="incs/header" body_properties="" />
+<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:change_logs" prefix="change-log" title_preset="changelog_edit" pagination="0"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:change_logs" prefix="change-log" title_preset="changelog_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('change-log','<inp2:change-log_SaveEvent/>');
}
));
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
cancel_edit('change-log','OnCancelEdit','<inp2:change-log_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('change-log', '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('change-log', '<inp2:change-log_PrevId/>');
}
));
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('change-log', '<inp2:change-log_NextId/>');
}
));
a_toolbar.Render();
<inp2:m_if check="change-log_IsSingle">
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="change-log_IsLast">
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="change-log_IsFirst">
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
-
<script src="js/swfobject.js" type="text/javascript"></script>
<script type="text/javascript" src="js/uploader.js"></script>
</td>
</tr>
</tbody>
</table>
<inp2:change-log_SaveWarning name="grid_save_warning"/>
<inp2:change-log_ErrorWarning name="form_error_warning"/>
+
<div id="scroll_container">
-<table class="edit-form">
- <inp2:m_RenderElement name="subsection" title="!la_section_Page!"/>
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" title="!la_section_Page!"/>
- <inp2:m_RenderElement name="inp_id_label" prefix="change-log" field="ChangeLogId" title="!la_fld_Id!"/>
- <inp2:m_RenderElement name="inp_label" prefix="change-log" field="UserLogin" title="!la_fld_Login!" style="width: 100px"/>
- <inp2:m_RenderElement name="inp_label" prefix="change-log" field="UserFirstName" title="!la_fld_FirstName!" style="width: 100px"/>
- <inp2:m_RenderElement name="inp_label" prefix="change-log" field="UserLastName" title="!la_fld_LastName!" style="width: 100px"/>
- <inp2:m_RenderElement name="inp_label" prefix="change-log" field="SessionLogId" title="!la_fld_SessionLogId!" style="width: 100px"/>
- <inp2:m_RenderElement name="inp_label" prefix="change-log" field="Action" title="!la_fld_Action!" style="width: 100px"/>
- <inp2:m_RenderElement name="inp_label" prefix="change-log" field="OccuredOn" title="!la_fld_OccuredOn!" style="width: 100px"/>
- <inp2:m_RenderElement name="inp_label" prefix="change-log" field="MasterPrefix" title="!la_fld_MasterPrefix!" style="width: 100px"/>
- <inp2:m_RenderElement name="inp_label" prefix="change-log" field="MasterId" title="!la_fld_MasterId!" style="width: 100px"/>
- <inp2:m_RenderElement name="inp_label" prefix="change-log" field="Prefix" title="!la_fld_Prefix!" style="width: 100px"/>
- <inp2:m_RenderElement name="inp_label" prefix="change-log" field="ItemId" title="!la_fld_ItemId!" style="width: 100px"/>
- <inp2:m_RenderElement name="inp_label" prefix="change-log" field="Changes" no_special="1" title="!la_fld_Changes!" style="width: 100px"/>
+ <inp2:m_RenderElement name="inp_id_label" prefix="change-log" field="ChangeLogId" title="!la_fld_Id!"/>
+ <inp2:m_RenderElement name="inp_label" prefix="change-log" field="UserLogin" title="!la_fld_Login!" style="width: 100px"/>
+ <inp2:m_RenderElement name="inp_label" prefix="change-log" field="UserFirstName" title="!la_fld_FirstName!" style="width: 100px"/>
+ <inp2:m_RenderElement name="inp_label" prefix="change-log" field="UserLastName" title="!la_fld_LastName!" style="width: 100px"/>
+ <inp2:m_RenderElement name="inp_label" prefix="change-log" field="SessionLogId" title="!la_fld_SessionLogId!" style="width: 100px"/>
+ <inp2:m_RenderElement name="inp_label" prefix="change-log" field="Action" title="!la_fld_Action!" style="width: 100px"/>
+ <inp2:m_RenderElement name="inp_label" prefix="change-log" field="OccuredOn" title="!la_fld_OccuredOn!" style="width: 100px"/>
+ <inp2:m_RenderElement name="inp_label" prefix="change-log" field="MasterPrefix" title="!la_fld_MasterPrefix!" style="width: 100px"/>
+ <inp2:m_RenderElement name="inp_label" prefix="change-log" field="MasterId" title="!la_fld_MasterId!" style="width: 100px"/>
+ <inp2:m_RenderElement name="inp_label" prefix="change-log" field="Prefix" title="!la_fld_Prefix!" style="width: 100px"/>
+ <inp2:m_RenderElement name="inp_label" prefix="change-log" field="ItemId" title="!la_fld_ItemId!" style="width: 100px"/>
+ <inp2:m_RenderElement name="inp_label" prefix="change-log" field="Changes" no_special="1" title="!la_fld_Changes!" style="width: 100px"/>
- <inp2:m_RenderElement name="inp_edit_filler"/>
+ <inp2:m_RenderElement name="inp_edit_filler"/>
-</table>
+ </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/logs/change_logs/change_log_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/logs/search_logs/search_log_list.tpl
===================================================================
--- branches/RC/core/admin_templates/logs/search_logs/search_log_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/logs/search_logs/search_log_list.tpl (revision 11538)
@@ -1,86 +1,85 @@
<inp2:m_include t="incs/header" />
-
<inp2:m_RenderElement name="combined_header" section="in-portal:searchlog" prefix="search-log" title_preset="search_log_list" pagination="1"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<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(
'clear_selected',
'<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('search-log');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'reset',
'<inp2:m_phrase label="la_ToolTip_DeleteAll" escape="1"/>',
function() {
if (inpConfirm('<inp2:m_Phrase name="la_Delete_Confirm" escape="1"/>')) {
submit_event('search-log', 'OnDeleteAll');
}
}
)
);
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton(
new ToolBarButton('export', '<inp2:m_phrase label="la_ToolTip_Export" escape="1"/>', function() {
std_csv_export('search-log', 'Default', 'export/export_progress');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function(id) {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="search-log" grid="Default"/>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="search-log" IdField="SearchLogId" grid="Default"/>
<script type="text/javascript">
Grids['search-log'].SetDependantToolbarButtons( new Array('clear_selected') );
</script>
<inp2:m_include t="incs/footer"/>
Property changes on: branches/RC/core/admin_templates/logs/search_logs/search_log_list.tpl
___________________________________________________________________
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/admin_templates/logs/email_logs/email_log_list.tpl
===================================================================
--- branches/RC/core/admin_templates/logs/email_logs/email_log_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/logs/email_logs/email_log_list.tpl (revision 11538)
@@ -1,66 +1,64 @@
<inp2:m_include t="incs/header" />
-
<inp2:m_RenderElement name="combined_header" section="in-portal:emaillog" prefix="email-log" title_preset="email_log_list" pagination="1"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<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_DeleteAll" escape="1"/>',
function() {
if (inpConfirm('<inp2:m_Phrase name="la_Delete_Confirm" escape="1"/>')) {
submit_event('email-log', 'OnDeleteAll');
}
}
)
);
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function(id) {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="email-log" grid="Default"/>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="email-log" IdField="EmailLogId" grid="Default"/>
<inp2:m_include t="incs/footer"/>
Property changes on: branches/RC/core/admin_templates/logs/email_logs/email_log_list.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/logs/email_logs/email_queue_list.tpl
===================================================================
--- branches/RC/core/admin_templates/logs/email_logs/email_queue_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/logs/email_logs/email_queue_list.tpl (revision 11538)
@@ -1,99 +1,96 @@
<inp2:m_include t="incs/header" />
-
<inp2:m_RenderElement name="combined_header" section="in-portal:email_queue" prefix="email-queue" title_preset="email_queue_list" tabs="mailing_lists/mailing_list_tabs" pagination="1"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<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(
'delete',
'<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('email-queue');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'reset',
'<inp2:m_phrase label="la_ToolTip_DeleteAll" escape="1"/>',
function() {
if (inpConfirm('<inp2:m_Phrase name="la_Delete_Confirm" escape="1"/>')) {
submit_event('email-queue', 'OnDeleteAll');
}
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'e-mail',
'<inp2:m_phrase label="la_ToolTip_ProcessQueue" escape="1"/>',
function() {
open_popup('emailmessages', null, 'emails/send_queue');
}
)
);
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function(id) {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="email-queue" grid="Default"/>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<inp2:m_DefineElement name="header_element">
<strong><inp2:m_Param name="key"/></strong>: <inp2:m_Param name="value"/><br />
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_headers_td">
- <td valign="top" class="text" style="<inp2:m_param name="td_style"/>">
- <inp2:PrintSerializedFields field="$field" render_as="header_element"/>
- </td>
+ <inp2:PrintSerializedFields field="$field" render_as="header_element"/>
</inp2:m_DefineElement>
<inp2:m_RenderElement name="grid" PrefixSpecial="email-queue" IdField="EmailQueueId" grid="Default"/>
<script type="text/javascript">
Grids['email-queue'].SetDependantToolbarButtons( new Array('delete') );
</script>
<inp2:m_include t="incs/footer"/>
Property changes on: branches/RC/core/admin_templates/logs/email_logs/email_queue_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.5
\ No newline at end of property
+1.1.2.6
\ No newline at end of property
Index: branches/RC/core/admin_templates/modules/modules_list.tpl
===================================================================
--- branches/RC/core/admin_templates/modules/modules_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/modules/modules_list.tpl (revision 11538)
@@ -1,84 +1,79 @@
<inp2:adm_CheckPermCache cache_update_t="categories/cache_updater"/>
<inp2:m_include t="incs/header" />
-<inp2:m_RenderElement name="combined_header" section="in-portal:mod_status" prefix="mod" pagination="1"/>
+<inp2:m_RenderElement name="combined_header" prefix="mod" section="in-portal:mod_status" title_preset="module_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()
{
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Enable" escape="1"/>', function() {
submit_event('mod','OnMassApprove');
}
) );
a_toolbar.AddButton( new ToolBarButton('deny', '<inp2:m_phrase label="la_ToolTip_Disable" escape="1"/>', function() {
submit_event('mod','OnMassDecline');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="mod" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_DefineElement name="error_element">
<inp2:m_Param name="error"/><br />
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_module_td" format="" no_special="" nl2br="" first_chars="" td_style="" currency="">
- <td valign="top" class="text" style="<inp2:m_param name="td_style"/>">
- <inp2:m_RenderElement name="grid_module_platform_td" pass_params="1"/>
- </td>
-</inp2:m_DefineElement>
-
-<inp2:m_DefineElement name="grid_module_platform_td" format="" no_special="" nl2br="" first_chars="" td_style="" currency="">
<inp2:m_if check="ModuleLicensed">
<inp2:m_if check="PrerequisitesMet">
<inp2:m_if check="AlreadyInstalled">
<inp2:Field name="$field"/>
<inp2:m_else/>
<a href="<inp2:InstallLink/>"><inp2:m_Phrase name="la_text_ready_to_install"/></a>
</inp2:m_if>
<inp2:m_else/>
<div style="color: red;">
<inp2:ListPrerequisites render_as="error_element"/>
</div>
</inp2:m_if>
<inp2:m_else/>
<a href="<inp2:m_Link template='dummy' prefix='_FRONT_END_' index_file='core/install.php' preset='already_installed' next_preset='update_license'/>" style="color: red;" target="_blank"><inp2:m_Phrase name="la_module_not_licensed"/></a>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_RenderElement name="grid" PrefixSpecial="mod" IdField="Name" per_page="-1" grid="Default" menu_filters="yes"/>
+
<script type="text/javascript">
Grids['mod'].SetDependantToolbarButtons( new Array('approve','deny') );
<inp2:m_if check="m_GetEquals" name="RefreshTree" value="1">
var $tree_frame = getFrame('menu');
$tree_frame.location.href = $tree_frame.location.href;
window.location.href = '<inp2:m_Link/>';
</inp2:m_if>
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/modules/modules_list.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/js/script.js
===================================================================
--- branches/RC/core/admin_templates/js/script.js (revision 11537)
+++ branches/RC/core/admin_templates/js/script.js (revision 11538)
@@ -1,1674 +1,1673 @@
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) {
+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);
+ 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)
{
- // if url has additional params - store it and make hidden fields from it (later, below)
- var $additional = [];
- if ($url.match('(.*?)&(.*)')) {
- $url = RegExp.$1;
- var tmp = RegExp.$2;
- var pairs = tmp.split('&');
-
- for (var i in pairs) {
- var data = pairs[i].split('=');
- $additional[data[0]] = data[1];
- }
- }
-
// get template name from url
var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)');
$regex = $regex.exec($url);
var $t = $regex[3];
- if ($regex[4].match(/^m([\d]+)-/)) {
- // remember category from url
- $additional['m_cat_id'] = RegExp.$1;
- }
// 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 = '';
+ 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);
- for (var i in $additional)
- {
- set_hidden_field(i, $additional[i]);
- }
-
- open_popup($prefix, $event, $t, $window_size);
-
- // restore form action back
- $kf.action = $prev_action;
+ 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)
+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);
+ 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) {
if ($i == 10) {
break;
}
$main_window = $main_window.opener;
$i++;
}
}
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 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;
}
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');
}
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.24
\ No newline at end of property
+1.11.2.25
\ No newline at end of property
Index: branches/RC/core/admin_templates/js/catalog.js
===================================================================
--- branches/RC/core/admin_templates/js/catalog.js (revision 11537)
+++ branches/RC/core/admin_templates/js/catalog.js (revision 11538)
@@ -1,395 +1,406 @@
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;
document.getElementById(this.PreviousPrefix + '_tab').className = 'catalog-tab-unselected';
document.getElementById(this.queryTabRegistry('prefix', this.PreviousPrefix, 'tab_id') + '_div').style.display = 'none';
this.HideDependentButtons(this.PreviousPrefix);
}
// show destination tab
this.ActivePrefix = $prefix;
document.getElementById(this.ActivePrefix + '_tab').className = 'catalog-tab-selected';
var $div_id = this.queryTabRegistry('prefix', this.ActivePrefix, 'tab_id') + '_div'; // destination tab
document.getElementById($div_id).style.display = 'block';
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) {
- set_hidden_field($category_variable, Grids['c'].GetSelected().join(','));
+ 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.8
\ No newline at end of property
+1.32.2.9
\ No newline at end of property
Index: branches/RC/core/admin_templates/js/ajax_dropdown.js
===================================================================
--- branches/RC/core/admin_templates/js/ajax_dropdown.js (revision 11537)
+++ branches/RC/core/admin_templates/js/ajax_dropdown.js (revision 11538)
@@ -1,278 +1,278 @@
/*
(c) Intechnic Europe 2007 http://www.intechnic.lv
Author: Konstantin Tjuterev
The class adds a dynamic drop-down to the edit-box
Usage:
<input type="text" id="combo_input" style="width: 200px"><br/>
<input type="text" id="combo_input1" style="width: 200px"><br/>
<script type="text/javascript">
new AJAXDropDown('combo_input', function(cur_value) {return 'items.xml?'}, function(item) {
var val = item.getAttribute('a');
return val ? val : item.innerHTML;
});
- new AJAXDropDown('combo_input1', function(cur_value) {return 'items1.xml?cur='+escape(cur_value)});
+ new AJAXDropDown('combo_input1', function(cur_value) {return 'items1.xml?cur='+encodeURIComponent(cur_value)});
new AJAXDropDown('curr_search_keyword', function(cur_value) {
var $url = '<inp2:m_Link template="dummy" pass="m,curr" curr_event="OnSuggestValues" field="Name" cur_value="#CUR_VALUE#" no_amp="1"/>';
- return $url.replace('#CUR_VALUE#', escape(cur_value));
+ return $url.replace('#CUR_VALUE#', encodeURIComponent(cur_value));
}
);
</script>
The AJAXDropDown constructor takes the following arguments:
input_id - id of textbox to attach to
suggest_url_callback - function which should return URL which returns XML of suggested values,
function takes one argument - it is current value of the text_box
[get_value_callback] - optional argument - function which returns the value to be set in the textbox,
based on currently selected item (out of suggested). If the argument is skipped - the node value of
<item> element will be used as the value
<item> element in the suggestions XML may have unlimited number of attribuets, all the attributes will be set
to the corresponding DIV element and this DIV element will be passed as argument to the get_value_callback,
so one may use the argument to alter the value set into textbox as in the example above
Response XML structure:
The script will look for ALL elements with tagname = 'item', so basically the structure should look like this:
<suggestions>
<item>Suggestion 1</item>
<item>Suggestion 2</item>
<item>Suggestion 3</item>
</suggestions>
Design & CSS
The script will automatically display a div which width will match the width of the text-box
You may control the div look by changing .suggest-box CSS selector
The items inside the box will have .suggest-item and .suggest-item-over
The default styles which may be used is:
<style type="text/css">
.suggest-box {
border: 1px solid #999;
background-color: #fff;
}
.suggest-item, .suggest-item-over {
padding: 1px 2px 0px 2px;
font-family: arial,verdana;
font-size: 12px;
}
.suggest-item-over {
background-color: #3366CC;
color: #fff;
}
</style>
*/
function AJAXDropDown(input_id, suggest_url_callback, get_value_callback)
{
this.Input = document.getElementById(input_id);
this.KeyUpWaiting = false;
this.KeyUpTimer = false;
this.Box = '';
this.SuggestURLCallback = suggest_url_callback;
if (!get_value_callback) get_value_callback = this.GetValue;
this.GetValueCallback = get_value_callback;
this.BoxOpen = false;
this.SelectedItem = false;
var obj = this;
addLoadEvent(function() {obj.Init()});
}
AJAXDropDown.prototype.Init = function()
{
// draw box
this.Box = document.createElement('DIV');
document.body.appendChild(this.Box);
// this.Box = addElement(this.Input.parentNode, 'div');
this.Box.style.display = 'none';
this.Box.style.zIndex = 99;
this.Box.style.position = 'absolute';
this.Box.style.overflow = 'auto';
this.Box.className = 'suggest-box'
this.Input.setAttribute('autocomplete', 'off');
// add onkeyup
var obj = this;
addEvent(this.Input, 'keyup', function(ev) {obj.KeyUp(ev)})
addEvent(this.Input, 'blur', function(ev) {obj.Blur(ev)})
addEvent(this.Box, 'scroll', function(ev) {if (obj.BlurWaiting) {window.clearTimeout(obj.BlurTimer);}});
addEvent(this.Box, 'mouseup', function(ev) {obj.BlurWaiting = false});
}
AJAXDropDown.prototype.Blur = function(ev)
{
if (this.BlurWaiting) return;
this.BlurWaiting = true;
var obj = this;
this.BlurTimer = window.setTimeout(function() {
obj.CloseBox();
this.BlurWaiting = false;
}, 300)
}
AJAXDropDown.prototype.KeyUp = function(ev)
{
var e = !is.ie ? ev : window.event;
switch (e.keyCode) {
case 38: //arrow up
if (!this.BoxOpen) break;
this.SelectPrev();
break;
case 40: //arrow down
if (!this.BoxOpen) break;
this.SelectNext();
break;
case 27: //Enter
this.Input.value = this.OriginalValue;
this.CloseBox();
break;
case 13: //Escape
this.CloseBox();
break;
default:
if (this.Input.value == '') return;
var obj = this;
if (this.KeyUpWaiting && this.KeyUpTimer) {
window.clearTimeout(this.KeyUpTimer);
this.KeyUpTimer = false;
}
this.KeyUpWaiting = true;
this.KeyUpTimer = window.setTimeout(function() {
obj.RequestSuggestions();
}, 300)
}
}
AJAXDropDown.prototype.RequestSuggestions = function()
{
Request.makeRequest(this.SuggestURLCallback(this.Input.value), false, '', this.successCallback, this.errorCallback, 'reload', this);
}
AJAXDropDown.prototype.successCallback = function (request, params, object) {
object.OriginalValue = object.Input.value;
object.OpenBox();
object.KeyUpWaiting = false;
var items = request.responseXML.getElementsByTagName('item');
object.ClearItems();
for (var i=0; i<items.length; i++)
{
object.AddItem(items[i].firstChild.nodeValue, items[i].attributes);
}
}
AJAXDropDown.prototype.errorCallback = function (request, params, object) {
this.KeyUpWaiting = false;
}
AJAXDropDown.prototype.ClearItems = function()
{
this.Box.scrollTop = 0;
this.UnselectItem();
for (var i=this.Box.childNodes.length-1; i>=0; i--)
{
this.Box.removeChild(this.Box.childNodes[i]);
}
}
AJAXDropDown.prototype.OpenBox = function()
{
var pos = findPos(this.Input);
var dim = getDimensions(this.Input);
this.Box.style.left = pos[0] + 'px';
this.Box.style.top = (pos[1] + dim.innerHeight + dim.borders[0] + dim.borders[2]) + 'px';
this.Box.style.width = (dim.innerWidth + dim.borders[1] + (is.ie ? dim.borders[3] : 0 ) ) + 'px';
this.Box.style.display = 'block';
// alert('box opened at '+this.Box.style.left+','+this.Box.style.top+' pos x:'+pos[0])
this.BoxOpen = true;
}
AJAXDropDown.prototype.CloseBox = function()
{
if (!this.BoxOpen) return;
this.Box.style.display = 'none';
this.BoxOpen = false;
}
AJAXDropDown.prototype.AddItem = function(value, attributes)
{
var item = addElement(this.Box, 'div');
for (var i=0; i<attributes.length; i++) {
item.setAttribute(attributes[i].nodeName, attributes[i].nodeValue)
}
item.className = 'suggest-item';
item.innerHTML = value;
var obj = this;
addEvent(item, 'mousemove', function() {obj.SelectItem(item)});
addEvent(item, 'mousedown', function() {obj.ClickItem(item)});
}
AJAXDropDown.prototype.ClickItem = function(item)
{
this.Input.value = this.GetValueCallback(item);
this.CloseBox();
}
AJAXDropDown.prototype.SelectNext = function()
{
if (!this.SelectedItem) {
this.SelectItem(this.Box.firstChild, true);
return;
}
if (isset(this.SelectedItem.nextSibling)) {
this.SelectItem(this.SelectedItem.nextSibling, true)
}
else { // down from last
this.UnselectItem();
this.Input.value = this.OriginalValue;
}
}
AJAXDropDown.prototype.SelectPrev = function()
{
if (!this.SelectedItem) {
this.SelectItem(this.Box.lastChild, true);
return;
}
if (isset(this.SelectedItem.previousSibling)) {
this.SelectItem(this.SelectedItem.previousSibling, true)
}
else { // up from first
this.UnselectItem();
this.Input.value = this.OriginalValue;
}
}
AJAXDropDown.prototype.UnselectItem = function(item)
{
if (!item) item = this.SelectedItem;
if (!item) return;
item.className = 'suggest-item';
this.SelectedItem = false;
}
AJAXDropDown.prototype.SelectItem = function(item, setvalue)
{
if (this.SelectedItem) {
this.UnselectItem(this.SelectedItem);
}
item.className = 'suggest-item-over';
this.SelectedItem = item;
item.scrollIntoView(false);
if (setvalue) {
this.Input.value = this.GetValueCallback(item);
}
}
AJAXDropDown.prototype.GetValue = function(item)
{
return item.innerHTML;
}
Property changes on: branches/RC/core/admin_templates/js/ajax_dropdown.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.5
\ No newline at end of property
+1.1.2.6
\ No newline at end of property
Index: branches/RC/core/admin_templates/groups/groups_edit_tabs.tpl
===================================================================
--- branches/RC/core/admin_templates/groups/groups_edit_tabs.tpl (revision 11537)
+++ branches/RC/core/admin_templates/groups/groups_edit_tabs.tpl (nonexistent)
@@ -1,16 +0,0 @@
-<table cellpadding="0" cellspacing="0" border="0" width="100%">
-<tr>
- <td align="right" width="100%">
- <table cellpadding="0" cellspacing="0" border="0" height="23">
- <tr>
- <inp2:m_RenderElement name="tab" title="la_tab_General" t="groups/groups_edit" main_prefix="g"/>
- <inp2:m_RenderElement name="tab" title="la_tab_Users" t="groups/groups_edit_users" main_prefix="g"/>
-
- <inp2:m_if check="m_CheckPermission" permissions="in-portal:user_groups.advanced:manage_permissions" system="1">
- <inp2:m_RenderElement name="tab" title="la_tab_Permissions" t="groups/groups_edit_permissions" main_prefix="g"/>
- </inp2:m_if>
- </tr>
- </table>
- </td>
-</tr>
-</table>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/groups/groups_edit_tabs.tpl
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.4.2.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: branches/RC/core/admin_templates/groups/groups_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/groups/groups_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/groups/groups_edit.tpl (revision 11538)
@@ -1,68 +1,72 @@
<inp2:adm_SetPopupSize width="750" height="761"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:user_groups" prefix="g" title_preset="groups_edit" tabs="groups/groups_edit_tabs"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:user_groups" prefix="g" title_preset="groups_edit" 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('g','<inp2:g_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('g','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('g', '<inp2:g_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('g', '<inp2:g_NextId/>');
}
) );
a_toolbar.Render();
<inp2:m_if check="g_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="g_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="g_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:g_SaveWarning name="grid_save_warning"/>
+<inp2:g_ErrorWarning name="form_error_warning"/>
+
<div id="scroll_container">
- <table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <table class="edit-form">
<inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
<inp2:m_RenderElement name="inp_id_label" prefix="g" field="GroupId" title="!la_fld_GroupId!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="g" field="Name" title="!la_fld_GroupName!"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="g" field="FrontRegistration" title="la_fld_FrontRegistration"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="g" field="Description" title="!la_fld_Comments!" rows="5" cols="30"/>
-
+ <inp2:m_RenderElement name="inp_edit_textarea" prefix="g" field="Description" title="!la_fld_Comments!" control_options="{max_height: 200}" rows="5" cols="30"/>
+
<inp2:m_if check="m_IsDebugMode">
<inp2:m_RenderElement name="inp_edit_radio" prefix="g" field="Enabled" title="!la_fld_Enabled!"/>
</inp2:m_if>
+
+ <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/groups/groups_edit.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/groups/groups_edit_users.tpl
===================================================================
--- branches/RC/core/admin_templates/groups/groups_edit_users.tpl (revision 11537)
+++ branches/RC/core/admin_templates/groups/groups_edit_users.tpl (revision 11538)
@@ -1,97 +1,94 @@
+<inp2:adm_SetPopupSize width="750" height="761"/>
+
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:user_groups" prefix="g" grid="GroupUsers" title_preset="groups_edit_users" tabs="groups/groups_edit_tabs"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:user_groups" prefix="g" grid="GroupUsers" title_preset="groups_edit_users" tab_preset="Default" pagination="1" pagination_prefix="g-ug"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
function edit()
{
}
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('g','<inp2:g_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
cancel_edit('g','OnCancelEdit','<inp2:g_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" 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('g', '<inp2:g_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('g', '<inp2:g_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('usertogroup', '<inp2:m_phrase label="la_ToolTip_AddUserToGroup" escape="1"/>',
function() {
openSelector('g-ug', '<inp2:m_Link t="users/user_selector" pass="m,g"/>', 'GroupId', '800x600');
} ) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>', function() {
std_delete_items('g-ug');
}
) );
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();
<inp2:m_if check="g_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="g_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="g_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="g-ug" grid="GroupUsers"/>
</tr>
</tbody>
</table>
-<inp2:m_DefineElement name="grid_membership_platform_td">
+<inp2:m_DefineElement name="grid_membership_td">
<inp2:m_if check="Field" name="$field" db="db">
<inp2:Field field="$field" first_chars="$first_chars" nl2br="$nl2br" grid="$grid" no_special="$no_special" format="$format"/>
<inp2:m_else/>
<inp2:m_phrase name="la_NeverExpires"/>
</inp2:m_if>
</inp2:m_DefineElement>
-<inp2:m_DefineElement name="grid_membership_td" td_style="">
- <td valign="top" class="text" style="<inp2:m_param name="td_style"/>">
- <inp2:m_RenderElement name="grid_membership_platform_td" pass_params="1"/>
- </td>
-</inp2:m_DefineElement>
-
-<inp2:m_RenderElement name="grid" PrefixSpecial="g-ug" IdField="PortalUserId" grid="GroupUsers" menu_filters="yes" limited_heights="1"/>
+<inp2:m_RenderElement name="grid" PrefixSpecial="g-ug" IdField="PortalUserId" grid="GroupUsers" limited_heights="1"/>
<script type="text/javascript">
Grids['g-ug'].SetDependantToolbarButtons( new Array('delete') );
Grids['g-ug'].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/groups/groups_edit_users.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.7.2.3
\ No newline at end of property
+1.7.2.4
\ No newline at end of property
Index: branches/RC/core/admin_templates/groups/groups_list.tpl
===================================================================
--- branches/RC/core/admin_templates/groups/groups_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/groups/groups_list.tpl (revision 11538)
@@ -1,75 +1,75 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:user_groups" pagination="1" prefix="g.total"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:user_groups" pagination="1" title_preset="group_list" prefix="g.total"/>
<!-- 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()
{
set_hidden_field('remove_specials[g.total]', 1);
std_edit_item('g.total', 'groups/groups_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_group', '<inp2:m_phrase label="la_ToolTip_NewGroup" escape="1"/>',
function() {
set_hidden_field('remove_specials[g.total]', 1);
std_precreate_item('g.total', 'groups/groups_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() {
set_hidden_field('remove_specials[g.total]', 1);
std_delete_items('g.total');
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
/*<inp2:m_if check="m_ModuleEnabled" module="In-Portal">
<inp2:m_if check="m_Recall" name="user_id" equals_to="-1">
a_toolbar.AddButton( new ToolBarButton('e-mail', '<inp2:m_phrase label="la_ToolTip_SendMail" escape="1"/>', function() {
openSelector('emailmessages', '<inp2:m_Link template="emails/mass_mail"/>', 'UserEmail', null, 'OnPrepareMassRecipients');
}
) );
</inp2:m_if>
</inp2:m_if>*/
<inp2:m_if check="m_ModuleEnabled" module="In-Portal">
a_toolbar.AddButton(
new ToolBarButton(
'e-mail',
'<inp2:m_phrase label="la_ToolTip_SendMail" escape="1"/>',
function() {
Application.SetVar('remove_specials[g.total]', 1);
Application.SetVar('mailing_recipient_type', 'g');
openSelector('mailing-list', '<inp2:m_Link template="mailing_lists/mailing_list_edit"/>', 'UserEmail', null, 'OnNew');
}
)
);
</inp2:m_if>
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="g.total" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="g.total" IdField="GroupId" grid="Default" limited_heights="1"/>
<script type="text/javascript">
Grids['g.total'].SetDependantToolbarButtons( new Array('edit', 'delete', 'e-mail') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/groups/groups_list.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/groups/permissions_selector.tpl
===================================================================
--- branches/RC/core/admin_templates/groups/permissions_selector.tpl (revision 11537)
+++ branches/RC/core/admin_templates/groups/permissions_selector.tpl (revision 11538)
@@ -1,77 +1,77 @@
<inp2:adm_SetPopupSize width="750" height="400"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:user_groups" permission_type="advanced:manage_permissions" prefix="g" title_preset="groups_edit_additional_permissions"/>
<!-- 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('advanced_save', 1);
submit_event('g-perm','OnGroupSavePermissions');
}
) );
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>
<inp2:g_SaveWarning name="grid_save_warning"/>
<inp2:m_DefineElement name="permission_element" prefix="g-perm">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td>
<inp2:m_param name="section_name"/>.<inp2:m_param name="perm_name"/>
</td>
<td>
<input type="hidden" id="<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" name="<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" value="<inp2:{$prefix}_PermissionValue section_name="$section_name" perm_name="$perm_name"/>">
<input type="checkbox" align="absmiddle" id="_cb_<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" name="_cb_<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" <inp2:m_if check="{$prefix}_PermissionValue" section_name="$section_name" perm_name="$perm_name" value="1">checked</inp2:m_if> onchange="update_checkbox(this, document.getElementById('<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]'));">
</td>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="old_permission_element" prefix="g-perm">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td>
<inp2:m_phrase name="$label"/>
</td>
<td>
<input type="hidden" id="<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" name="<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" value="<inp2:{$prefix}_PermissionValue section_name="$section_name" perm_name="$perm_name"/>">
<input type="checkbox" align="absmiddle" id="_cb_<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" name="_cb_<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" <inp2:m_if check="{$prefix}_PermissionValue" section_name="$section_name" perm_name="$perm_name" value="1">checked</inp2:m_if> onchange="update_checkbox(this, document.getElementById('<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]'));">
</td>
</tr>
</inp2:m_DefineElement>
<inp2:g-perm_LoadPermissions/>
<div id="scroll_container">
- <table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <inp2:m_set {$PrefixSpecial}_sequence="1" odd_even="table-color1"/>
+ <table class="edit-form">
+ <inp2:m_set g-perm_sequence="1" odd_even="table-color1"/>
<tr class="subsectiontitle">
<td><inp2:m_phrase label="la_col_PermissionName"/></td>
<td><inp2:m_phrase label="la_col_PermissionValue"/></td>
</tr>
<inp2:m_if check="m_GetEquals" name="section_name" value="in-portal:root">
<inp2:m_RenderElement name="old_permission_element" section_name="in-portal:root" perm_name="LOGIN" label="lu_PermName_Login_desc"/>
<inp2:m_RenderElement name="old_permission_element" section_name="in-portal:root" perm_name="ADMIN" label="lu_PermName_Admin_desc"/>
<inp2:m_RenderElement name="old_permission_element" section_name="in-portal:root" perm_name="SYSTEM_ACCESS.READONLY" label="la_PermName_SystemAccess.ReadOnly_desc"/>
<inp2:m_else/>
<inp2:adm_ListSectionPermissions render_as="permission_element" type="1"/>
</inp2:m_if>
</table>
</div>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/groups/permissions_selector.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.11.2.5
\ No newline at end of property
+1.11.2.6
\ No newline at end of property
Index: branches/RC/core/admin_templates/groups/groups_edit_permissions.tpl
===================================================================
--- branches/RC/core/admin_templates/groups/groups_edit_permissions.tpl (revision 11537)
+++ branches/RC/core/admin_templates/groups/groups_edit_permissions.tpl (revision 11538)
@@ -1,140 +1,140 @@
<inp2:adm_SetPopupSize width="750" height="761"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:user_groups" permission_type="advanced:manage_permissions" prefix="g" title_preset="groups_edit_permissions" tabs="groups/groups_edit_tabs"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:user_groups" permission_type="advanced:manage_permissions" prefix="g" title_preset="groups_edit_permissions" 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('g','<inp2:g_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('g','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('g', '<inp2:g_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('g', '<inp2:g_NextId/>');
}
) );
a_toolbar.Render();
<inp2:m_if check="g_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="g_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="g_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:g_SaveWarning name="grid_save_warning"/>
<inp2:m_DefineElement name="permission_element" prefix="g-perm" onclick="">
<td>
<inp2:m_if check="{$prefix}_HasPermission" perm_name="$perm_name" section_name="$section_name">
<input type="hidden" id="<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" name="<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" value="<inp2:{$prefix}_PermissionValue section_name="$section_name" perm_name="$perm_name"/>">
<input type="checkbox" align="absmiddle" id="_cb_<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" name="_cb_<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]" <inp2:m_if check="{$prefix}_PermissionValue" section_name="$section_name" perm_name="$perm_name" value="1">checked</inp2:m_if> onchange="update_checkbox(this, document.getElementById('<inp2:m_param name="prefix"/>[<inp2:m_param name="section_name"/>][<inp2:m_param name="perm_name"/>]'));" onclick="<inp2:m_param name="onclick"/>">
<inp2:m_else/>
&nbsp;
</inp2:m_if>
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="tree_element">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td>
<img src="img/spacer.gif" height="1" width="<inp2:g-perm_LevelIndicator level="$deep_level" multiply="20"/>" alt="" border="0"/>
<img src="<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.gif" border="0" alt="" title="" align="absmiddle"/>
<inp2:m_if check="m_ParamEquals" name="children_count" value="0">
<inp2:m_phrase name="$label"/>
<inp2:m_else/>
<inp2:m_if check="m_ParamEquals" name="section_name" value="in-portal:root">
<b><inp2:m_param name="label"/></b>
<inp2:m_else/>
<b><inp2:m_phrase name="$label"/></b>
</inp2:m_if>
</inp2:m_if>
<inp2:m_if check="m_IsDebugMode">
<br />
<img src="img/spacer.gif" height="1" width="<inp2:g-perm_LevelIndicator level="$deep_level" multiply="20"/>" alt="" border="0"/>
<span class="small">[<inp2:m_param name="section_name"/>, <b><inp2:m_param name="SectionPrefix"/></b>]</span>
</inp2:m_if>
</td>
<inp2:m_RenderElement name="permission_element" section_name="$section_name" perm_name="view" onclick="update_perm_checkboxes(this);"/>
<inp2:m_RenderElement name="permission_element" section_name="$section_name" perm_name="add"/>
<inp2:m_RenderElement name="permission_element" section_name="$section_name" perm_name="edit"/>
<inp2:m_RenderElement name="permission_element" section_name="$section_name" perm_name="delete"/>
<td>
<inp2:m_if check="g-perm_HasAdvancedPermissions" section_name="$section_name">
<a href="javascript:openSelector('g-perm', '<inp2:m_t t="groups/permissions_selector" pass="all,g-perm" section_name="$section_name" escape="1"/>', 'PermList', null, 'OnGroupSavePermissions');"><inp2:m_phrase name="la_btn_Change"/></a>
<inp2:m_else/>
&nbsp;
</inp2:m_if>
</td>
</tr>
</inp2:m_DefineElement>
<inp2:g-perm_LoadPermissions/>
<div id="scroll_container">
- <table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <inp2:m_set {$PrefixSpecial}_sequence="1" odd_even="table-color1"/>
+ <table class="edit-form">
+ <inp2:m_set g-perm_sequence="1" odd_even="table-color1"/>
<tr class="subsectiontitle">
<td><inp2:m_phrase label="la_col_PermissionName"/></td>
<td><inp2:m_phrase label="la_col_PermView"/></td>
<td><inp2:m_phrase label="la_col_PermAdd"/></td>
<td><inp2:m_phrase label="la_col_PermEdit"/></td>
<td><inp2:m_phrase label="la_col_PermDelete"/></td>
<td><inp2:m_phrase label="la_col_AdditionalPermissions"/></td>
</tr>
<inp2:adm_DrawTree render_as="tree_element" section_name="in-portal:root"/>
</table>
</div>
<script type="text/javascript">
function update_perm_checkboxes($source_perm)
{
var $permissions = ['add', 'edit', 'delete'];
var $rets = $source_perm.id.match(/_cb_g-perm\[(.*)\]\[(.*)\]/);
var $test_perm = '';
var $i = 0;
while($i < $permissions.length) {
$test_perm = '_cb_g-perm[' + $rets[1] + '][' + $permissions[$i] + ']';
$test_perm = document.getElementById($test_perm);
if ($test_perm) {
$test_perm.checked = $source_perm.checked;
update_checkbox($test_perm, document.getElementById('g-perm[' + $rets[1] + '][' + $permissions[$i] + ']'));
}
$i++;
}
}
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/groups/groups_edit_permissions.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.13.2.5
\ No newline at end of property
+1.13.2.6
\ No newline at end of property
Index: branches/RC/core/admin_templates/reviews/reviews.tpl
===================================================================
--- branches/RC/core/admin_templates/reviews/reviews.tpl (revision 11537)
+++ branches/RC/core/admin_templates/reviews/reviews.tpl (revision 11538)
@@ -1,117 +1,117 @@
<inp2:m_include t="incs/header" noform="yes"/>
<inp2:m_include template="catalog/catalog_elements"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:reviews" prefix="c" module="in-portal" title_preset="reviews" tabs="catalog/catalog_tabs" special="-rev" skip_prefixes="m,adm,cms"/>
<!-- 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"/>"/>
- <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>
+ <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();
}
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('#ITEM_PREFIX#', $prefix).replace('#TAB_NAME#', this.queryTabRegistry('prefix', $prefix, 'tab_id'));
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="reviews/reviews_tab" item_prefix="#ITEM_PREFIX#" tab_name="#TAB_NAME#" pass_through="td,item_prefix,tab_name" td="no" m_cat_id="-1" no_amp="1"/>', 'reviews_', 0);
var a_toolbar = new ToolBar();
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() {
$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';
std_delete_items($Catalog.ActivePrefix, null, 1);
} ) );
<inp2:m_ModuleInclude template="catalog_buttons" main_template="reviews" skip_prefixes="m,adm,cms"/>
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';
$Catalog.submit_event($Catalog.ActivePrefix, 'OnMassApprove');
}
) );
a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';
$Catalog.submit_event($Catalog.ActivePrefix, 'OnMassDecline');
}
) );
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()
{
$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" pass_through="item_prefix" item_prefix="#PREFIX#" no_amp="1"/>' . replace('#PREFIX#', $Catalog.ActivePrefix);
std_edit_temp_item($Catalog.ActivePrefix, 'reviews/review_direct_edit');
$kf.action = $prev_action;
}
</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_set prefix_append="-rev" td="no"/>
<inp2:m_ModuleInclude template="catalog_tab" tab_init="2" skip_prefixes="m,adm,cms"/>
<inp2:m_if check="m_get" var="SetTab">
<script type="text/javascript">
$Catalog.switchTab('<inp2:m_get var="SetTab"/>-rev');
</script>
</inp2:m_if>
<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/reviews/reviews.tpl
___________________________________________________________________
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/admin_templates/reviews/reviews_tab.tpl
===================================================================
--- branches/RC/core/admin_templates/reviews/reviews_tab.tpl (revision 11537)
+++ branches/RC/core/admin_templates/reviews/reviews_tab.tpl (revision 11538)
@@ -1,43 +1,43 @@
<inp2:m_DefineElement name="catalog_tab">
<inp2:m_if check="m_ParamEquals" name="tab_init" value="">
<inp2:lang.current_Field name="Charset" result_to_var="charset"/>
<inp2:m_Header data="Content-type: text/plain; charset=$charset"/>
<inp2:m_include t="incs/blocks"/>
<inp2:m_include t="incs/in-portal"/>
<inp2:$prefix_InitList grid="$grid_name"/>
$Catalog.setItemCount('<inp2:m_param name="prefix"/>', '<inp2:{$prefix}_CatalogItemCount/>');
$Catalog.setCurrentCategory('<inp2:m_param name="prefix"/>', 0);
$Catalog.saveSearch('<inp2:m_Param name="prefix"/>', '<inp2:$prefix_SearchKeyword js_escape="1"/>', '<inp2:m_Param name="grid_name"/>');
<inp2:m_DefineElement name="grid_reviewtext_td">
<inp2:Field field="$field" cut_first="100"/>
<br />
<span class="cats_stats">
- <a href="<inp2:ItemEditLink/>"><inp2:Field field="CatalogItemName"/></a>
+ <a href="<inp2:ItemEditLink/>" onclick="return direct_edit('<inp2:m_param name="prefix"/>', this.href);"><inp2:Field field="CatalogItemName"/></a>
</span>
</inp2:m_DefineElement>
<inp2:m_RenderElement name="grid_js" PrefixSpecial="$prefix" IdField="ReviewId" grid="$grid_name" menu_filters="yes"/>
<inp2:m_if check="m_ParamEquals" name="tab_dependant" value="yes">
Grids['<inp2:m_param name="prefix"/>'].AddAlternativeGrid('<inp2:m_param name="cat_prefix"/>', true);
</inp2:m_if>
Grids['<inp2:m_param name="prefix"/>'].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6'));
$Catalog.reflectPasteButton(<inp2:c_HasClipboard/>);
$Catalog.setViewMenu('<inp2:m_param name="prefix"/>');
<inp2:m_if check="m_ParamEquals" name="tab_mode" value="single">
Grids['<inp2:m_param name="prefix"/>'].DblClick = function() {return false};
</inp2:m_if>
#separator#
<!-- products tab: begin -->
<inp2:m_RenderElement name="kernel_form" form_name="{$tab_name}_form"/>
<inp2:m_RenderElement name="grid" ajax="1" PrefixSpecial="$prefix" IdField="ReviewId" grid="$grid_name" menu_filters="yes"/>
<inp2:m_RenderElement name="kernel_form_end"/>
<!-- products tab: end -->
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_Get name="item_prefix" result_to_var="prefix"/>
<inp2:{$prefix}_InitCatalogTab render_as="catalog_tab" default_grid="ReviewsSection" radio_grid="Radio"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/reviews/reviews_tab.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/reviews/review_direct_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/reviews/review_direct_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/reviews/review_direct_edit.tpl (revision 11538)
@@ -1,44 +1,51 @@
<inp2:adm_SetPopupSize width="750" height="400"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
-<inp2:m_Get name="item_prefix" result_to_var="prefix"/>
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:reviews" prefix="c" module="in-portal" title_preset="review_edit"/>
+<inp2:m_Get name="item_prefix" result_to_var="prefix"/>
+<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:reviews" title_preset="review_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('<inp2:m_Param name="prefix"/>','<inp2:{$prefix}_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('<inp2:m_Param name="prefix"/>','OnCancel');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <inp2:m_RenderElement name="subsection" title="!la_Text_Review!"/>
- <inp2:m_RenderElement name="inp_edit_hidden" prefix="$prefix" field="ItemId"/>
- <inp2:m_RenderElement name="inp_edit_checkbox_allow_html" prefix="$prefix" field="TextFormat"/>
- <inp2:m_RenderElement name="inp_label" prefix="$prefix" field="ReviewId" title="!la_fld_ReviewId!"/>
- <inp2:m_RenderElement name="inp_edit_user" prefix="$prefix" field="CreatedById" title="!la_fld_CreatedById!" class="text"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="$prefix" field="ReviewText" title="!la_fld_ReviewText!" cols="70" rows="8"/>
- <inp2:m_RenderElement name="subsection" title="!la_Text_General!"/>
- <inp2:m_RenderElement name="inp_edit_radio" prefix="$prefix" field="Status" title="!la_fld_Status!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="$prefix" field="Priority" title="!la_fld_Priority!" size="3" class="text"/>
- <inp2:m_RenderElement name="inp_edit_date_time" prefix="$prefix" field="CreatedOn" title="!la_fld_CreatedOn!" size="20" class="text"/>
-</table>
-<inp2:m_include t="incs/footer"/>
+<inp2:$prefix_SaveWarning name="grid_save_warning"/>
+<inp2:$prefix_ErrorWarning name="form_error_warning"/>
+
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" title="!la_Text_Review!"/>
+ <inp2:m_RenderElement name="inp_edit_hidden" prefix="$prefix" field="ItemId"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox_allow_html" prefix="$prefix" field="TextFormat"/>
+ <inp2:m_RenderElement name="inp_label" prefix="$prefix" field="ReviewId" title="!la_fld_ReviewId!"/>
+ <inp2:m_RenderElement name="inp_edit_user" prefix="$prefix" field="CreatedById" title="!la_fld_CreatedById!" class="text"/>
+ <inp2:m_RenderElement name="inp_edit_textarea" prefix="$prefix" field="ReviewText" title="!la_fld_ReviewText!" control_options="{min_height: 100}" cols="70" rows="8"/>
+ <inp2:m_RenderElement name="subsection" title="!la_Text_General!"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="$prefix" field="Status" title="!la_fld_Status!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="$prefix" field="Priority" title="!la_fld_Priority!" size="3" class="text"/>
+ <inp2:m_RenderElement name="inp_edit_date_time" prefix="$prefix" field="CreatedOn" title="!la_fld_CreatedOn!" size="20" class="text"/>
+
+ <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/reviews/review_direct_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/popups/translator.tpl
===================================================================
--- branches/RC/core/admin_templates/popups/translator.tpl (revision 11537)
+++ branches/RC/core/admin_templates/popups/translator.tpl (revision 11538)
@@ -1,50 +1,52 @@
<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" module="in-commerce"/>
+<inp2:m_RenderElement name="blue_bar" prefix="trans" 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"/>">
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered">
- <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>
-</table>
+<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>
+ </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.4
\ No newline at end of property
+1.4.2.5
\ 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 11537)
+++ branches/RC/core/admin_templates/popups/column_picker.tpl (revision 11538)
@@ -1,96 +1,90 @@
<inp2:adm_SetPopupSize width="600" height="500"/>
-<inp2:m_RequireLogin/>
+<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"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
set_hidden_field('picked_str',select_to_string('picked_columns'))
set_hidden_field('hidden_str',select_to_string('available_columns'))
submit_event('adm','OnSaveColumns');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('adm','OnClosePopup');
-// window_close();
}
) );
- /* a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
- reset_form('adm', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
- }
- ) );*/
-
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('move_up', '<inp2:m_phrase label="la_ToolTip_MoveUp" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_MoveUp" escape="1"/>', function() {
move_options_up('picked_columns', 1)
}
) );
a_toolbar.AddButton( new ToolBarButton('move_down', '<inp2:m_phrase label="la_ToolTip_MoveDown" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_MoveDown" escape="1"/>', function() {
move_options_down('picked_columns', 1)
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
-
+<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>
+</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"/>"/>
-</form>
<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.1
\ No newline at end of property
+1.4.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/incs/close_popup.tpl
===================================================================
--- branches/RC/core/admin_templates/incs/close_popup.tpl (revision 11537)
+++ branches/RC/core/admin_templates/incs/close_popup.tpl (revision 11538)
@@ -1,106 +1,105 @@
<inp2:m_NoDebug/>
<inp2:m_Set skip_last_template="1"/>
<html>
<head>
<title></title>
<script type="text/javascript">
var $is_debug = <inp2:m_if check="m_ConstOn" name="DBG_REDIRECT">true<inp2:m_else/>false</inp2:m_if>;
var $use_popups = <inp2:m_if check="adm_UsePopups">true<inp2:m_else/>false</inp2:m_if>;
var $redirect_url = '<inp2:m_t t="dummy" opener="u" m_opener="u" escape="escape"/>';
if ($is_debug) {
document.write('<a href="#" onclick="proceed_redirect()">' + $redirect_url.replace('%5C', '\\') + '</a>');
}
else {
proceed_redirect();
}
function isset(variable)
{
if(variable == null) return false;
return (typeof(variable) == 'undefined') ? false : true;
}
function proceed_redirect() {
var $opener = getFrame('main').getWindowOpener(window);
if ($opener) {
// using popups & close_popup called (from anywhere)
try {
window_close( function() { onAfterWindowClose($opener); } );
}
catch (err) {
// another website is opened in parent window
alert('Error while trying to process redirect in window opener, you should probably close this window.' + "\n" + 'Error message: [' + err.message + ']');
}
}
else if (!$use_popups) {
// not using popups (for editing), but close_popup called (e.g. from selector)
window.location.href = $redirect_url.replace('%5C', '\\');
}
}
function onAfterWindowClose($opener) {
- /*<inp2:m_if check="m_Get" name="skip_refresh">
+ <inp2:m_if check="m_Get" name="skip_refresh">
var $skip_refresh = true;
<inp2:m_else/>
var $skip_refresh = isset($opener.$skip_refresh) && $opener.$skip_refresh ? true : false;
- </inp2:m_if>*/
+ </inp2:m_if>
$opener.focus();
-// if (!$skip_refresh) {
-
+ if (!$skip_refresh) {
$opener.location.href = $redirect_url.replace('%5C', '\\');
-// }
+ }
}
// copied from "js/script.js" because it's not included here due performance reasons
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) {
if ($i == 10) {
break;
}
$main_window = $main_window.opener;
$i++;
}
}
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 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();
}
</script>
</head>
<body>
</body>
</html>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/incs/close_popup.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2.2.6
\ No newline at end of property
+1.2.2.7
\ No newline at end of property
Index: branches/RC/core/admin_templates/incs/form_blocks.tpl
===================================================================
--- branches/RC/core/admin_templates/incs/form_blocks.tpl (revision 11537)
+++ branches/RC/core/admin_templates/incs/form_blocks.tpl (revision 11538)
@@ -1,878 +1,878 @@
<inp2:m_DefineElement name="combined_header" permission_type="view" perm_section="" system_permission="1" title_preset="" tab_preset="" grid="Default" module="" icon="">
<inp2:m_if check="m_Param" name="perm_section" inverse="1">
<inp2:adm_SectionInfo section="$section" info="perm_section" result_to_var="perm_section"/>
</inp2:m_if>
<inp2:m_if check="m_Param" name="permission_type">
<inp2:m_RequireLogin permissions="{$perm_section}.{$permission_type}" system="$system_permission"/>
<inp2:m_else/>
<inp2:m_RequireLogin permissions="{$perm_section}" system="$system_permission"/>
</inp2:m_if>
<inp2:m_if check="m_Param" name="prefix" inverse="1"><inp2:adm_SectionInfo section="$section" info="SectionPrefix" result_to_var="prefix"/></inp2:m_if>
<inp2:m_if check="m_get" var="m_wid" inverse="1">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr<inp2:m_ifnot check="m_ModuleEnabled" module="Proj-Base"> style="background: url(<inp2:adm_SectionInfo section="$section" info="module_path" module="$module"/>img/logo_bg.gif) no-repeat top right; height: 55px;"</inp2:m_ifnot>>
<td valign="top" class="admintitle" align="left" style="padding-top: 10px; padding-bottom: 10px;">
<img width="46" height="46" src="<inp2:adm_SectionInfo section="$section" info="module_path" module="$module"/>img/icons/icon46_<inp2:adm_SectionInfo section="$section" info="icon"/>.gif" align="absmiddle" title="<inp2:adm_SectionInfo section="$section" info="label"/>">&nbsp;<inp2:adm_SectionInfo section="$section" info="label"/>
</td>
</tr>
</table>
</inp2:m_if>
<inp2:m_if check="m_Param" name="tabs">
<inp2:m_include t="$tabs"/>
</inp2:m_if>
<inp2:m_if check="m_Param" name="tab_preset">
<inp2:m_RenderElement name="edit_tabs" prefix="$prefix" preset_name="$tab_preset"/>
</inp2:m_if>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td class="tablenav">
<table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
<tr>
<td class="header_left_bg" nowrap valign="middle">
<inp2:adm_SectionInfo section="$section" info="label" result_to_var="default_title"/>
<span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="$default_title" cut_first="100" {$prefix}[grid]="{$grid}" pass_params="true"/></span>
</td>
<td align="right" valign="middle">
<script type="text/javascript">
set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') + ' - <inp2:m_Phrase label="la_AdministrativeConsole"/>');
</script>
<inp2:m_if check="m_ModuleEnabled" module="In-Portal">
<script>
var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
$help_url = $help_url.replace(/#/g, '%23');
</script>
<a href="javascript: OpenHelp($help_url);">
<img src="img/blue_bar_help.gif" border="0">
</a>
</inp2:m_if>
<inp2:m_if check="m_Param" name="pagination">
<inp2:m_RenderElement name="grid_pagination_elem" PrefixSpecial="$prefix" pass_params="1"/>
</inp2:m_if>
</td>
</tr>
</table>
</td>
</tr>
</table>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="section_header">
<inp2:m_if check="m_ParamEquals" name="prefix" value="" inverse="inverse">
<inp2:m_RenderElement name="section_header_new" pass_params="true"/>
<inp2:m_else />
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr class="section_header_bg">
<td valign="top" class="admintitle" align="left" style="padding-top: 2px; padding-bottom: 2px;">
<img width="46" height="46" src="img/icons/<inp2:adm_GetSectionIcon icon="$icon"/>.gif" align="absmiddle" title="<inp2:adm_GetSectionTitle phrase="$title"/>">&nbsp;<inp2:adm_GetSectionTitle phrase="$title"/>
</td>
</tr>
</table>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="section_header_new" module="#session#">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr style="background: url(<inp2:ModulePath module="$module"/>img/logo_bg.gif) no-repeat top right; height: 55px;">
<td valign="top" class="admintitle" align="left" style="padding-top: 10px; padding-bottom: 10px;">
<img width="46" height="46" src="<inp2:ModulePath module="$module"/>img/icons/<inp2:adm_GetSectionIcon icon="$icon"/>.gif" align="absmiddle" title="<inp2:adm_GetSectionTitle phrase="$title"/>">&nbsp;<inp2:adm_GetSectionTitle phrase="$title"/>
</td>
</tr>
</table>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="blue_bar" module="" icon="" pagination="0">
<table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
<tr>
<td class="header_left_bg" nowrap width="80%" valign="middle">
<span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/></span>
</td>
<td align="right" class="tablenav" width="20%" valign="middle">
<inp2:m_if check="m_ModuleEnabled" module="In-Portal">
<script>
var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
$help_url = $help_url.replace(/#/g, '%23');
set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
</script>
<a href="javascript: OpenHelp($help_url);">
<img src="img/blue_bar_help.gif" border="0">
</a>
</inp2:m_if>
<inp2:m_if check="m_Param" name="pagination">
<inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
</inp2:m_if>
</td>
</tr>
</table>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_original_label">
<td><inp2:$prefix.original_Field field="$field" nl2br="1"/></td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="subsection" prefix="">
<tr class="subsectiontitle">
<td colspan="3"><inp2:m_phrase label="$title"/></td>
<inp2:m_if check="m_ParamEquals" name="prefix" value="" inverse="inverse">
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<td><inp2:m_phrase name="$original_title"/></td>
</inp2:m_if>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_field_caption" title="" subfield="" NamePrefix="">
<inp2:m_inc param="tab_index" by="1"/>
<td class="text" nowrap>
<inp2:m_if check="m_Param" name="title">
<label for="<inp2:m_param name="NamePrefix"/><inp2:InputName field="$field" subfield="$subfield"/>">
<span class="<inp2:m_if check="HasError" field="$field" >error</inp2:m_if>">
<inp2:m_phrase label="$title"/></span><inp2:m_if check="{$prefix}_IsRequired" field="$field" ><span class="error">&nbsp;*</span></inp2:m_if>:
</label>
<inp2:m_else/>
&nbsp;
</inp2:m_if>
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_label" is_last="" as_label="" currency="" nl2br="0" is_last="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td valign="top" class="text">
<inp2:{$prefix}_Field field="$field" as_label="$as_label" currency="$currency" nl2br="$nl2br"/>
<inp2:m_if check="{$prefix}_HasParam" name="hint_label"><span class="small"><inp2:m_phrase label="$hint_label"/></span></inp2:m_if>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_id_label" db="">
<inp2:m_if check="{$prefix}_FieldEquals" field="$field" value="" inverse="inverse">
<inp2:m_RenderElement name="inp_label" pass_params="true"/>
</inp2:m_if>
<input type="hidden" name="<inp2:{$prefix}_InputName field="$field"/>" id="<inp2:{$prefix}_InputName field="$field"/>" value="<inp2:{$prefix}_Field field="$field" db="$db"/>">
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_error">
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_box" subfield="" class="" is_last="" maxlength="" onblur="" size="" onkeyup="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" subfield="$subfield" title="$title" is_last="$is_last"/>
<td>
<input type="text" name="<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>" id="<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>" value="<inp2:{$prefix}_Field field="$field" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>" onkeyup="<inp2:m_Param name="onkeyup"/>">
<inp2:m_if check="{$prefix}_HasParam" name="hint_label"><span class="small"><inp2:m_phrase label="$hint_label"/></span></inp2:m_if>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_password" class="" size="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title"/>
<td>
<input type="password" name="<inp2:{$prefix}_InputName field="$field"/>" id="<inp2:{$prefix}_InputName field="$field"/>" value="" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>" />
<inp2:m_if check="{$prefix}_HasParam" name="hint_label"><span class="small"><inp2:m_phrase label="$hint_label"/></span></inp2:m_if>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_upload" class="" size="" thumbnail="" is_last="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<inp2:m_if check="m_Param" name="thumbnail">
<inp2:m_if check="{$prefix}_FieldEquals" name="$field" value="" inverse="inverse">
<img src="<inp2:{$prefix}_Field field="$field" format="resize:{$thumbnail}"/>" alt=""/><br />
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<input type="hidden" id="<inp2:{$prefix}_InputName field="Delete{$field}"/>" name="<inp2:{$prefix}_InputName field="Delete{$field}"/>" value="0" />
<input type="checkbox" id="_cb_<inp2:{$prefix}_InputName field="Delete{$field}"/>" onchange="update_checkbox(this, document.getElementById('<inp2:{$prefix}_InputName field="Delete{$field}"/>'));">
</td>
<td>
<label for="_cb_<inp2:{$prefix}_InputName field="Delete{$field}"/>"><inp2:m_phrase name="la_btn_DeleteImage"/></label>
</td>
</tr>
</table>
</inp2:m_if>
<input type="file" name="<inp2:{$prefix}_InputName field="$field"/>" id="<inp2:{$prefix}_InputName field="$field"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>">
<inp2:m_else/>
<input type="file" name="<inp2:{$prefix}_InputName field="$field"/>" id="<inp2:{$prefix}_InputName field="$field"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>">
<inp2:m_if check="{$prefix}_FieldEquals" name="$field" value="" inverse="inverse">
(<inp2:{$prefix}_Field field="$field"/>)
</inp2:m_if>
</inp2:m_if>
<input type="hidden" name="<inp2:{$prefix}_InputName field="$field"/>[upload]" id="<inp2:{$prefix}_InputName field="$field"/>[upload]" value="<inp2:{$prefix}_Field field="$field"/>">
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_swf_upload" class="" is_last="" style="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td class="uploader-text">
<div class="uploader-main" id="<inp2:{$prefix}_InputName field="$field"/>_progress">
<div class="uploader-percent" id="<inp2:{$prefix}_InputName field="$field"/>_percent">0%</div>
<div class="uploader-left">
<div class="uploader-done" id="<inp2:{$prefix}_InputName field="$field"/>_done"></div>
</div>
<table style="border-collapse: collapse; width: 100%;">
<tr>
<td style="width: 120px">Uploading:</td><td id="<inp2:{$prefix}_InputName field="$field"/>_progress_filename"></td>
</tr>
<tr>
<td>Progress:</td><td id="<inp2:{$prefix}_InputName field="$field"/>_progress_progress"></td>
</tr>
<tr>
<td>Time elapsed:</td><td id="<inp2:{$prefix}_InputName field="$field"/>_progress_elapsed"></td>
</tr>
<tr>
<td>Time remaining:</td><td id="<inp2:{$prefix}_InputName field="$field"/>_progress_remaining"></td>
</tr>
<tr>
<td colspan="2" style="text-align: center"><a href="javascript:UploadsManager.CancelUpload('<inp2:{$prefix}_InputName field="$field"/>')">Cancel</a></td>
</tr>
</table>
</div>
<table cellpadding="0" cellspacing="3">
<tr>
<td style="width: 63px; height: 21px;" id="<inp2:{$prefix}_InputName field='$field'/>_place_holder">
&nbsp;
</td>
<td>
<input class="button" type="button" onclick="UploadsManager.StartUpload('<inp2:{$prefix}_InputName field="$field"/>')" value="Upload"/>
</td>
</tr>
</table>
<div id="<inp2:{$prefix}_InputName field="$field"/>_queueinfo"></div>
<div id="<inp2:{$prefix}_InputName field="$field"/>_holder"></div>
<input type="hidden" name="<inp2:{$prefix}_InputName field="$field"/>[upload]" id="<inp2:{$prefix}_InputName field="$field"/>[upload]" value="<inp2:{$prefix}_Field field="$field"/>"><br/>
<input type="hidden" name="<inp2:{$prefix}_InputName field="$field"/>[tmp_ids]" id="<inp2:{$prefix}_InputName field="$field"/>[tmp_ids]" value="">
<input type="hidden" name="<inp2:{$prefix}_InputName field="$field"/>[tmp_names]" id="<inp2:{$prefix}_InputName field="$field"/>[tmp_names]" value="">
<input type="hidden" name="<inp2:{$prefix}_InputName field="$field"/>[tmp_deleted]" id="<inp2:{$prefix}_InputName field="$field"/>[tmp_deleted]" value="">
<script type="text/javascript">
UploadsManager.AddUploader('<inp2:{$prefix}_InputName field="$field"/>',
{
baseUrl: '<inp2:m_TemplatesBase />',
allowedFiletypesDescription : '<inp2:{$prefix}_FieldOption field="$field" option="files_description" js_escape="1"/>',
allowedFiletypes : '<inp2:{$prefix}_FieldOption field="$field" option="file_types"/>',
allowedFilesize : '<inp2:{$prefix}_FieldOption field="$field" option="max_size"/>',
multiple : '<inp2:{$prefix}_FieldOption field="$field" option="multiple"/>',
prefix : '<inp2:m_Param name="prefix"/>',
field : '<inp2:m_Param name="field"/>',
urls : '<inp2:{$prefix}_Field field="$field" format="file_urls" js_escape="1"/>',
names : '<inp2:{$prefix}_Field field="$field" format="file_names" js_escape="1"/>',
sizes : '<inp2:{$prefix}_Field field="$field" format="file_sizes" js_escape="1"/>',
flashsid : '<inp2:m_SID/>',
uploadURL : '<inp2:m_t pass="m,$prefix" {$prefix}_event="OnUploadFile" js_escape="1" no_amp="1" />',
deleteURL : '<inp2:m_t pass="m,$prefix" {$prefix}_event="OnDeleteFile" field="#FIELD#" file="#FILE#" js_escape="1" no_amp="1"/>',
tmp_url : '<inp2:m_t pass="m,$prefix" {$prefix}_event="OnViewFile" tmp="1" field="#FIELD#" file="#FILE#" id="#ID#" js_escape="1" no_amp="1" />',
// Button settings
buttonImageURL: 'img/upload.png', // Relative to the Flash file
buttonWidth: 63,
buttonHeight: 21,
buttonText: '<span class="theFont">Browse</span>',
buttonTextStyle: ".theFont { font-size: 12; font-family: arial, sans}",
buttonTextTopPadding: 2,
buttonTextLeftPadding: 9,
buttonPlaceholderId: '<inp2:{$prefix}_InputName field="$field"/>_place_holder'
}
)
UploadsManager.formContainerId = 'scroll_container';
</script>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_box_ml" class="" size="" onblur="" maxlength="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td class="text" valign="top">
<span class="<inp2:m_if check="{$prefix}_HasError" field="$field" >error</inp2:m_if>">
<inp2:m_phrase label="$title"/><inp2:m_if check="{$prefix}_IsRequired" field="$field" ><span class="error"> *</span></inp2:m_if>:</span><br>
<a href="javascript:PreSaveAndOpenTranslator('<inp2:m_param name="prefix"/>', '<inp2:m_param name="field"/>', 'popups/translator');" title="<inp2:m_Phrase label="la_Translate"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand" border="0"></a>
</td>
<td>
<input type="text" name="<inp2:{$prefix}_InputName field="$field"/>" id="<inp2:{$prefix}_InputName field="$field"/>" value="<inp2:{$prefix}_Field field="$field" format="no_default"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_hidden" db="">
<input type="hidden" name="<inp2:{$prefix}_InputName field="$field"/>" id="<inp2:{$prefix}_InputName field="$field"/>" value="<inp2:{$prefix}_Field field="$field" db="$db"/>">
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_date" class="" is_last="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<input type="text" name="<inp2:{$prefix}_InputName field="{$field}_date"/>" id="<inp2:{$prefix}_InputName field="{$field}_date"/>" value="<inp2:{$prefix}_Field field="{$field}_date" format="_regional_InputDateFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:{$prefix}_Format field="{$field}_date" input_format="1" edit_size="edit_size"/>" class="<inp2:m_param name="class"/>" datepickerIcon="<inp2:m_ProjectBase/>core/admin_templates/img/calendar_icon.gif">&nbsp;<span class="small">(<inp2:{$prefix}_Format field="{$field}_date" input_format="1" human="true"/>)</span>
<script type="text/javascript">
initCalendar("<inp2:{$prefix}_InputName field="{$field}_date"/>", "<inp2:{$prefix}_Format field="{$field}_date" input_format="1"/>");
</script>
<input type="hidden" name="<inp2:{$prefix}_InputName field="{$field}_time"/>" id="<inp2:{$prefix}_InputName field="{$field}_time" input_format="1"/>" value="">
</td>
<td class="error"><inp2:{$prefix}_Error field="{$field}_date"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_time" class="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td class="control-cell">
<input type="text" name="<inp2:{$prefix}_InputName field="{$field}_time"/>" id="<inp2:{$prefix}_InputName field="{$field}_time"/>" value="<inp2:{$prefix}_Field field="{$field}_time" format="_regional_InputTimeFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:{$prefix}_Format field="{$field}_time" input_format="1" edit_size="edit_size"/>" class="<inp2:m_param name="class"/>">&nbsp;
<span class="small">(<inp2:{$prefix}_Format field="{$field}_time" input_format="1" human="true"/>)</span>
<input type="hidden" name="<inp2:{$prefix}_InputName field="{$field}_date"/>" id="<inp2:{$prefix}_InputName field="{$field}_date" input_format="1"/>" value="">
</td>
<td class="error"><inp2:{$prefix}_Error field="{$field}_time"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_date_time" class="" is_last="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<!-- <input type="hidden" id="<inp2:{$prefix}_InputName field="$field"/>" name="<inp2:{$prefix}_InputName field="$field"/>" value="<inp2:{$prefix}_Field field="$field" db="db"/>"> -->
<input type="text" name="<inp2:{$prefix}_InputName field="{$field}_date"/>" id="<inp2:{$prefix}_InputName field="{$field}_date"/>" value="<inp2:{$prefix}_Field field="{$field}_date" format="_regional_InputDateFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:{$prefix}_Format field="{$field}_date" input_format="1" edit_size="edit_size"/>" class="<inp2:m_param name="class"/>" datepickerIcon="<inp2:m_ProjectBase/>core/admin_templates/img/calendar_icon.gif">
<span class="small">(<inp2:{$prefix}_Format field="{$field}_date" input_format="1" human="true"/>)</span>
<script type="text/javascript">
initCalendar("<inp2:{$prefix}_InputName field="{$field}_date"/>", "<inp2:{$prefix}_Format field="{$field}_date" input_format="1"/>");
</script>
&nbsp;<input type="text" name="<inp2:{$prefix}_InputName field="{$field}_time"/>" id="<inp2:{$prefix}_InputName field="{$field}_time"/>" value="<inp2:{$prefix}_Field field="{$field}_time" format="_regional_InputTimeFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:{$prefix}_Format field="{$field}_time" input_format="1" edit_size="edit_size"/>" class="<inp2:m_param name="class"/>"><span class="small"> (<inp2:{$prefix}_Format field="{$field}_time" input_format="1" human="true"/>)</span>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_textarea" class="" allow_html="allow_html">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td class="text" valign="top">
<span class="<inp2:m_if check="{$prefix}_HasError" field="$field" >error</inp2:m_if>">
<inp2:m_phrase label="$title"/><inp2:m_if check="{$prefix}_IsRequired" field="$field" ><span class="error"> *</span></inp2:m_if>:</span><br>
<inp2:m_if check="m_ParamEquals" name="allow_html" value="allow_html">
<a href="javascript:OpenEditor('&section=in-link:editlink_general','kernel_form','<inp2:{$prefix}_InputName field="$field"/>');"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
</inp2:m_if>
</td>
<td>
<textarea tabindex="<inp2:m_get param="tab_index"/>" id="<inp2:{$prefix}_InputName field="$field"/>" name="<inp2:{$prefix}_InputName field="$field"/>" cols="<inp2:m_param name="cols"/>" rows="<inp2:m_param name="rows"/>" class="<inp2:m_param name="class"/>"><inp2:{$prefix}_Field field="$field"/></textarea>
<inp2:m_if check="{$prefix}_HasParam" name="hint_label">
<br /><span class="small"><inp2:m_phrase label="$hint_label"/></span>
</inp2:m_if>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_textarea_ml" class="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td class="text" valign="top">
<span class="<inp2:m_if check="{$prefix}_HasError" field="$field" >error</inp2:m_if>">
<inp2:m_phrase label="$title"/><inp2:m_if check="{$prefix}_IsRequired" field="$field" ><span class="error"> *</span></inp2:m_if>:</span><br>
<a href="javascript:OpenEditor('&section=in-link:editlink_general','kernel_form','<inp2:{$prefix}_InputName field="$field"/>');"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
<a href="javascript:PreSaveAndOpenTranslator('<inp2:m_param name="prefix"/>', '<inp2:m_param name="field"/>', 'popups/translator', 1);" title="<inp2:m_Phrase label="la_Translate"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand" border="0"></a>
</td>
<td>
<textarea tabindex="<inp2:m_get param="tab_index"/>" id="<inp2:{$prefix}_InputName field="$field"/>" name="<inp2:{$prefix}_InputName field="$field"/>" cols="<inp2:m_param name="cols"/>" rows="<inp2:m_param name="rows"/>" class="<inp2:m_param name="class"/>"><inp2:{$prefix}_Field field="$field"/></textarea>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_user" class="" size="" is_last="" old_style="0" onkeyup="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<input type="text" name="<inp2:{$prefix}_InputName field="$field"/>" id="<inp2:{$prefix}_InputName field="$field"/>" value="<inp2:{$prefix}_Field field="$field"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>" onkeyup="<inp2:m_Param name="onkeyup"/>">
<inp2:m_if check="m_ParamEquals" name="old_style" value="1">
<a href="#" onclick="return OpenUserSelector('','kernel_form','<inp2:{$prefix}_InputName field="$field"/>');">
<inp2:m_else/>
<a href="javascript:openSelector('<inp2:m_param name="prefix"/>', '<inp2:m_t t="user_selector" pass="all,$prefix" escape="1"/>', '<inp2:m_param name="field"/>');">
</inp2:m_if>
<img src="img/icons/icon24_link_user.gif" style="cursor:hand;" border="0">
</a>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_category" class="" size="" is_last="" old_style="0" onkeyup="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td id="<inp2:{$prefix}_InputName field="$field"/>_path">
<inp2:m_DefineElement name="category_caption">
- <inp2:m_if check="m_ParamEquals" name="cat_id" value="0" inverse="inverse">
- <inp2:m_param name="separator"/>
- </inp2:m_if>
+ <inp2:m_ifnot check="c_HomeCategory" equals_to="$cat_id">
+ <inp2:m_param name="separator"/>
+ </inp2:m_ifnot>
<inp2:m_param name="cat_name"/>
</inp2:m_DefineElement>
<inp2:{$prefix}_FieldCategoryPath field="$field" separator=" &gt; " render_as="category_caption"/>
<inp2:m_RenderElement name="inp_edit_hidden" pass_params="1"/>
</td>
<td valign="middle">
<img src="img/spacer.gif" width="3" height="1" alt=""/>
<a href="javascript:openSelector('<inp2:m_param name="prefix"/>', '<inp2:adm_SelectorLink prefix="$prefix" selection_mode="single" tab_prefixes="none"/>', '<inp2:m_param name="field"/>');">
<img src="img/icons/icon24_cat.gif" border="0"/>
</a>
<a href="#" onclick="disable_category('<inp2:m_Param name="field"/>'); return false;"><inp2:m_Phrase name="la_Text_Disable"/></a>
<script type="text/javascript">
function disable_category($field) {
var $field = '<inp2:{$prefix}_InputName field="#FIELD_NAME#"/>'.replace('#FIELD_NAME#', $field);
set_hidden_field($field, '');
document.getElementById($field + '_path').style.display = 'none';
}
</script>
</td>
</tr>
</table>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_option_item">
<option value="<inp2:m_param name="key"/>"<inp2:m_param name="selected"/>><inp2:m_param name="option"/></option>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_option_phrase">
<option value="<inp2:m_param name="key"/>"<inp2:m_param name="selected"/>><inp2:m_phrase label="$option"/></option>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_options" is_last="" has_empty="0" empty_value="" onchange="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<select tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:{$prefix}_InputName field="$field"/>" id="<inp2:{$prefix}_InputName field="$field"/>" onchange="<inp2:m_Param name="onchange"/>">
<inp2:m_if check="{$prefix}_FieldOption" field="$field" option="use_phrases">
<inp2:{$prefix}_PredefinedOptions field="$field" block="inp_option_phrase" selected="selected" has_empty="$has_empty" empty_value="$empty_value"/>
<inp2:m_else/>
<inp2:{$prefix}_PredefinedOptions field="$field" block="inp_option_item" selected="selected" has_empty="$has_empty" empty_value="$empty_value"/>
</inp2:m_if>
</select>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_multioptions" is_last="" has_empty="0" empty_value="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<select multiple tabindex="<inp2:m_get param="tab_index"/>" id="<inp2:{$prefix}_InputName field="$field"/>_select" onchange="update_multiple_options('<inp2:{$prefix}_InputName field="$field"/>');">
<inp2:m_if check="{$prefix}_FieldOption" field="$field" option="use_phrases">
<inp2:{$prefix}_PredefinedOptions field="$field" block="inp_option_phrase" selected="selected" has_empty="$has_empty" empty_value="$empty_value"/>
<inp2:m_else/>
<inp2:{$prefix}_PredefinedOptions field="$field" block="inp_option_item" selected="selected" has_empty="$has_empty" empty_value="$empty_value"/>
</inp2:m_if>
</select>
<input type="hidden" id="<inp2:{$prefix}_InputName field="$field"/>" name="<inp2:{$prefix}_InputName field="$field"/>" value="<inp2:{$prefix}_Field field="$field" db="db"/>"/>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_radio_item" onclick="" onchange="">
<input type="radio" <inp2:m_param name="checked"/> name="<inp2:{$prefix}_InputName field="$field"/>" id="<inp2:{$prefix}_InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>" onclick="<inp2:m_param name="onclick"/>" onchange="<inp2:m_param name="onchange"/>"><label for="<inp2:{$prefix}_InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_param name="option"/></label>&nbsp;
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_radio_phrase" onclick="" onchange="">
<input type="radio" <inp2:m_param name="checked"/> name="<inp2:{$prefix}_InputName field="$field"/>" id="<inp2:{$prefix}_InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>" onclick="<inp2:m_param name="onclick"/>" onchange="<inp2:m_param name="onchange"/>"><label for="<inp2:{$prefix}_InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_phrase label="$option"/></label>&nbsp;
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_radio" is_last="" pass_tabindex="" onclick="" onchange="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<inp2:m_if check="{$prefix}_FieldOption" field="$field" option="use_phrases">
<inp2:{$prefix}_PredefinedOptions field="$field" tabindex="$pass_tabindex" block="inp_radio_phrase" selected="checked" onclick="$onclick" onchange="$onchange" />
<inp2:m_else />
<inp2:{$prefix}_PredefinedOptions field="$field" tabindex="$pass_tabindex" block="inp_radio_item" selected="checked" onclick="$onclick" onchange="$onchange" />
</inp2:m_if>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_checkbox" is_last="" field_class="" onchange="" onclick="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last" NamePrefix="_cb_"/>
<td>
<input type="hidden" id="<inp2:{$prefix}_InputName field="$field"/>" name="<inp2:{$prefix}_InputName field="$field"/>" value="<inp2:{$prefix}_Field field="$field" db="db"/>">
<!--<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:{$prefix}_InputName field="$field"/>" name="_cb_<inp2:{$prefix}_InputName field="$field"/>" <inp2:{$prefix}_Field field="$field" checked="checked" db="db"/> class="<inp2:m_param name="field_class"/>" onclick="update_checkbox(this, document.getElementById('<inp2:{$prefix}_InputName field="$field"/>'));" onchange="<inp2:m_param name="onchange"/>">-->
<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:{$prefix}_InputName field="$field"/>" name="_cb_<inp2:{$prefix}_InputName field="$field"/>" <inp2:{$prefix}_Field field="$field" checked="checked" db="db"/> class="<inp2:m_param name="field_class"/>" onchange="update_checkbox(this, document.getElementById('<inp2:{$prefix}_InputName field="$field"/>'));<inp2:m_param name="onchange"/>" onclick="<inp2:m_param name="onclick"/>">
<inp2:m_if check="{$prefix}_HasParam" name="hint_label"><inp2:m_phrase label="$hint_label"/></inp2:m_if>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_checkbox_item">
<input type="checkbox" <inp2:m_param name="checked"/> id="<inp2:{$prefix}_InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>" onclick="update_checkbox_options(/^<inp2:{$prefix}_InputName field="$field" as_preg="1"/>_([0-9A-Za-z-]+)/, '<inp2:{$prefix}_InputName field="$field"/>');"><label for="<inp2:{$prefix}_InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_param name="option"/></label>&nbsp;
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_checkbox_phrase">
<input type="checkbox" <inp2:m_param name="checked"/> id="<inp2:{$prefix}_InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>" onclick="update_checkbox_options(/^<inp2:{$prefix}_InputName field="$field" as_preg="1"/>_([0-9A-Za-z-]+)/, '<inp2:{$prefix}_InputName field="$field"/>');"><label for="<inp2:{$prefix}_InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_phrase label="$option"/></label>&nbsp;
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_checkboxes" no_empty="" is_last="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<inp2:m_if check="{$prefix}_FieldOption" field="$field" option="use_phrases">
<inp2:{$prefix}_PredefinedOptions field="$field" no_empty="$no_empty" tabindex="$pass_tabindex" block="inp_checkbox_phrase" selected="checked"/>
<inp2:m_else/>
<inp2:{$prefix}_PredefinedOptions field="$field" no_empty="$no_empty" tabindex="$pass_tabindex" block="inp_checkbox_item" selected="checked"/>
</inp2:m_if>
<inp2:m_RenderElement prefix="$prefix" name="inp_edit_hidden" field="$field" db="db"/>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_checkbox_allow_html" field_class="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td colspan="2">
<label for="_cb_<inp2:m_param name="field"/>"><inp2:m_phrase label="la_enable_html"/></label>
<input type="hidden" id="<inp2:{$prefix}_InputName field="$field"/>" name="<inp2:{$prefix}_InputName field="$field"/>" value="<inp2:{$prefix}_Field field="$field" db="db"/>">
<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:m_param name="field"/>" name="_cb_<inp2:m_param name="field"/>" <inp2:{$prefix}_Field field="$field" checked="checked"/> class="<inp2:m_param name="field_class"/>" onclick="update_checkbox(this, document.getElementById('<inp2:{$prefix}_InputName field="$field"/>'))">
<br>
<span class="hint"><img src="img/smicon7.gif" width="14" height="14" align="absmiddle"><inp2:m_phrase label="la_Warning_Enable_HTML"/></span>
</td>
<td>&nbsp;</td>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_weight" subfield="" class="" is_last="" maxlength="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" subfield="$subfield" title="$title" is_last="$is_last"/>
<td>
<inp2:m_if check="lang.current_FieldEquals" field="UnitSystem" value="1">
<input type="text" name="<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>" id="<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>" value="<inp2:{$prefix}_Field field="$field" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
<inp2:m_phrase label="la_kg" />
</inp2:m_if>
<inp2:m_if check="lang.current_FieldEquals" field="UnitSystem" value="2">
<input type="text" name="<inp2:{$prefix}_InputName field="{$field}_a" subfield="$subfield"/>" id="<inp2:{$prefix}_InputName field="{$field}_a" subfield="$subfield"/>" value="<inp2:{$prefix}_Field field="{$field}_a" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
<inp2:m_phrase label="la_lbs" />
<input type="text" name="<inp2:{$prefix}_InputName field="{$field}_b" subfield="$subfield"/>" id="<inp2:{$prefix}_InputName field="{$field}_b" subfield="$subfield"/>" value="<inp2:{$prefix}_Field field="{$field}_b" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
<inp2:m_phrase label="la_oz" />
</inp2:m_if>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_filler" control_options="false">
</inp2:m_DefineElement>
<inp2:m_DefineElement name="ajax_progress_bar">
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered">
<tr class="table-color1">
<td colspan="2">
<img src="img/spacer.gif" height="10" width="1" alt="" /><br />
<!-- progress bar paddings: begin -->
<table width="90%" cellpadding="2" cellspacing="0" border="0" align="center">
<tr>
<td class="progress-text">0%</td>
<td width="100%">
<!-- progress bar: begin -->
<table cellspacing="0" cellpadding="0" width="100%" border="0" align="center" style="background-color: #FFFFFF; border: 1px solid #E6E6E6;">
<tr>
<td colspan="3"><img src="img/spacer.gif" height="2" width="1" alt="" /></td>
</tr>
<tr>
<td width="2"><img src="img/spacer.gif" height="13" width="3" alt="" /></td>
<td align="center" width="100%">
<table cellspacing="0" cellpadding="0" width="100%" border="0" style="background: url(img/progress_left.gif) repeat-x;">
<tr>
<td id="progress_bar[done]" style="background: url(img/progress_done.gif);" align="left"></td>
<td id="progress_bar[left]" align="right"><img src="img/spacer.gif" height="9" width="1" alt="" /></td>
</tr>
</table>
</td>
<td width="1"><img src="img/spacer.gif" height="13" width="3" alt="" /></td>
</tr>
<tr>
<td colspan="3"><img src="img/spacer.gif" height="2" width="1" alt="" /></td>
</tr>
</table>
<!-- progress bar: end -->
</td>
<td class="progress-text">100%</td>
</tr>
</table>
<!-- progress bar paddings: end -->
<img src="img/spacer.gif" height="10" width="1" alt="" /><br />
</td>
</tr>
<tr class="table-color2">
<td width="50%" align="right"><inp2:m_phrase name="la_fld_PercentsCompleted"/>:</td>
<td id="progress_display[percents_completed]">0%</td>
</tr>
<tr class="table-color1">
<td align="right"><inp2:m_phrase name="la_fld_ElapsedTime"/>:</td>
<td id="progress_display[elapsed_time]">00:00</td>
</tr>
<tr class="table-color2">
<td align="right"><inp2:m_phrase name="la_fld_EstimatedTime"/>:</td>
<td id="progress_display[Estimated_time]">00:00</td>
</tr>
<tr class="table-color1">
<td align="center" colspan="2">
<input type="button" class="button" onclick="<inp2:m_param name="cancel_action"/>" value="<inp2:m_phrase name="la_Cancel"/>" />
</td>
</tr>
</table>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="edit_navigation" toolbar="a_toolbar">
<inp2:m_if check="{$prefix}_IsTopmostPrefix">
<inp2:m_if check="{$prefix}_IsSingle">
<inp2:m_param name="toolbar"/>.HideButton('prev');
<inp2:m_param name="toolbar"/>.HideButton('next');
<inp2:m_else/>
<inp2:m_if check="{$prefix}_IsLast">
<inp2:m_param name="toolbar"/>.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="{$prefix}_IsFirst">
<inp2:m_param name="toolbar"/>.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="tabs_container" tabs_render_as="">
<table cellpadding="0" style="width: 100%;" cellspacing="0" cellpadding="0">
<tr>
<td style="width: 20px;">
<img src="<inp2:m_TemplatesBase/>/img/spacer.gif" width="20" height="0" alt=""/><br/>
<a href="#" class="scroll-left disabled"></a>
</td>
<td height="23" align="right">
<div id="tab-measure" style="display: none; width: 100%; height: 23px;">&nbsp;</div>
<div style="overflow: hidden; height: 23px;" class="tab-viewport">
<table class="tabs" cellpadding="0" cellspacing="0" height="23">
<tr>
<inp2:m_RenderElement name="$tabs_render_as" />
</tr>
</table>
</div>
</td>
<td style="width: 20px;">
<img src="<inp2:m_TemplatesBase/>/img/spacer.gif" width="20" height="0" alt=""/><br/>
<a href="#" class="scroll-right disabled"></a>
</td>
</tr>
</table>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="edit_tabs_element">
<inp2:m_DefineElement name="edit_tab">
<inp2:m_RenderElement name="tab" title="$title" t="$template" main_prefix="$PrefixSpecial"/>
</inp2:m_DefineElement>
<inp2:{$prefix}_PrintEditTabs render_as="edit_tab" preset_name="$preset_name"/>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="edit_tabs" preset_name="Default">
<inp2:m_if check="{$prefix}_HasEditTabs" preset_name="$preset_name">
<inp2:m_RenderElement name="tabs_container" tabs_render_as="edit_tabs_element" pass_params="1"/>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="ml_selector" prefix="">
</inp2:m_DefineElement>
<inp2:m_DefineElement name="form_error_warning">
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_minput" style="" format="" allow_add="1" allow_edit="1" allow_delete="1" allow_move="1" title="">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title"/>
<td>
<table>
<tr>
<td colspan="2">
<input type="button" class="button" style="width: 70px;" value="<inp2:m_Phrase name="la_btn_Add"/>" id="<inp2:{$prefix}_InputName field="$field"/>_add_button"/>
<input type="button" class="button" style="width: 70px;" value="<inp2:m_Phrase name="la_btn_Cancel"/>" id="<inp2:{$prefix}_InputName field="$field"/>_cancel_button"/>
</td>
</tr>
<tr>
<td valign="top">
<select multiple tabindex="<inp2:m_get param="tab_index"/>" id="<inp2:{$prefix}_InputName field="$field"/>_minput" style="<inp2:m_Param name="style"/>">
</select>
</td>
<td valign="top">
<inp2:m_if check="m_Param" name="allow_edit">
<input type="button" class="button" style="width: 100px;" value="<inp2:m_Phrase name="la_btn_Edit"/>" id="<inp2:{$prefix}_InputName field="$field"/>_edit_button"/><br />
<img src="img/spacer.gif" height="4" width="1" alt=""/><br />
</inp2:m_if>
<inp2:m_if check="m_Param" name="allow_delete">
<input type="button" class="button" style="width: 100px;" value="<inp2:m_Phrase name="la_btn_Delete"/>" id="<inp2:{$prefix}_InputName field="$field"/>_delete_button"/><br />
</inp2:m_if>
<inp2:m_if check="m_Param" name="allow_move">
<br /><br />
<input type="button" class="button" style="width: 100px;" value="<inp2:m_Phrase name="la_btn_MoveUp"/>" id="<inp2:{$prefix}_InputName field="$field"/>_moveup_button"/><br />
<img src="img/spacer.gif" height="4" width="1" alt=""/><br />
<input type="button" class="button" style="width: 100px;" value="<inp2:m_Phrase name="la_btn_MoveDown"/>" id="<inp2:{$prefix}_InputName field="$field"/>_movedown_button"/><br />
</inp2:m_if>
</td>
</tr>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="$prefix" field="$field" db="db"/>
<script type="text/javascript">
var <inp2:m_Param name="field"/> = new MultiInputControl('<inp2:m_Param name="field"/>', '<inp2:{$prefix}_InputName field="#FIELD_NAME#"/>', fields['<inp2:m_Param name="prefix"/>'], '<inp2:m_Param name="format"/>');
<inp2:m_Param name="field"/>.ValidateURL = '<inp2:m_Link template="dummy" pass="m,$prefix" {$prefix}_event="OnValidateMInputFields" js_escape="1"/>';
<inp2:m_if check="m_Param" name="allow_add">
<inp2:m_Param name="field"/>.SetPermission('add', true);
</inp2:m_if>
<inp2:m_if check="m_Param" name="allow_edit">
<inp2:m_Param name="field"/>.SetPermission('edit', true);
</inp2:m_if>
<inp2:m_if check="m_Param" name="allow_delete">
<inp2:m_Param name="field"/>.SetPermission('delete', true);
</inp2:m_if>
<inp2:m_if check="m_Param" name="allow_move">
<inp2:m_Param name="field"/>.SetPermission('move', true);
</inp2:m_if>
<inp2:m_Param name="field"/>.InitEvents();
<inp2:m_Param name="field"/>.SetMessage('required_error', '<inp2:m_Phrase name="la_error_required" escape="1"/>');
<inp2:m_Param name="field"/>.SetMessage('unique_error', '<inp2:m_Phrase name="la_error_unique" escape="1"/>');
<inp2:m_Param name="field"/>.SetMessage('delete_confirm', '<inp2:m_Phrase label="la_Delete_Confirm" escape="1"/>');
<inp2:m_Param name="field"/>.SetMessage('add_button', '<inp2:m_Phrase name="la_btn_Add" escape="1"/>');
<inp2:m_Param name="field"/>.SetMessage('save_button', '<inp2:m_Phrase name="la_btn_Save" escape="1"/>');
</script>
</table>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_picker" is_last="" has_empty="0" empty_value="" style="width: 225px;" size="15">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td><strong><inp2:m_Phrase label="la_SelectedItems" /></strong></td>
<td>&nbsp;</td>
<td><strong><inp2:m_Phrase label="la_AvailableItems" /></strong></td>
</tr>
<tr>
<td>
<inp2:m_DefineElement name="picker_option_block">
<option value="<inp2:Field name="$key_field" />"><inp2:Field name="$value_field" /></option>
</inp2:m_DefineElement>
<select multiple id="<inp2:$prefix_InputName name="$field" />_selected" style="<inp2:m_param name="style"/>" size="<inp2:m_param name="size"/>">
<inp2:$optprefix.selected_PrintList render_as="picker_option_block" key_field="$option_key_field" value_field="$option_value_field" per_page="-1" requery="1" link_to_prefix="$prefix" link_to_field="$field"/>
</select>
</td>
<td align="center">
<img src="img/icons/icon_left.gif" id="<inp2:{$prefix}_InputName name="$field" />_move_left_button"/><br />
<img src="img/icons/icon_right.gif" id="<inp2:{$prefix}_InputName name="$field" />_move_right_button"/>
</td>
<td>
<select multiple id="<inp2:$prefix_InputName name="$field" />_available" style="<inp2:m_param name="style"/>" size="<inp2:m_param name="size"/>">
<inp2:$optprefix.available_PrintList render_as="picker_option_block" key_field="$option_key_field" value_field="$option_value_field" requery="1" per_page="-1" link_to_prefix="$prefix" link_to_field="$field"/>
</select>
</td>
</tr>
</table>
<input type="hidden" name="<inp2:{$prefix}_InputName name="$field" />" id="<inp2:{$prefix}_InputName name="$field" />" value="<inp2:{$prefix}_Field field="$field" db="db"/>">
<input type="hidden" name="unselected_<inp2:{$prefix}_InputName name="$field" />" id="<inp2:{$prefix}_InputName name="$field" />_available_field" value="">
<script type="text/javascript">
<inp2:m_Param name="field"/> = new EditPickerControl('<inp2:m_Param name="field"/>', '<inp2:{$prefix}_InputName name="$field" />');
<inp2:m_Param name="field"/>.SetMessage('nothing_selected', '<inp2:m_Phrase label="la_SelectItemToMove" escape="1"/>');
</script>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
</tr>
</inp2:m_DefineElement>
Property changes on: branches/RC/core/admin_templates/incs/form_blocks.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.20.2.32
\ No newline at end of property
+1.20.2.33
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/languages_edit_tabs.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/languages_edit_tabs.tpl (revision 11537)
+++ branches/RC/core/admin_templates/regional/languages_edit_tabs.tpl (nonexistent)
@@ -1,7 +0,0 @@
-<inp2:m_DefineElement name="language_tabs">
- <inp2:m_RenderElement name="tab" title="la_tab_General" t="regional/languages_edit" main_prefix="lang"/>
- <inp2:m_RenderElement name="tab" title="la_tab_Labels" t="regional/languages_edit_phrases" main_prefix="lang"/>
- <inp2:m_RenderElement name="tab" title="la_tab_EmailEvents" t="regional/languages_edit_email_events" main_prefix="lang"/>
-</inp2:m_DefineElement>
-
-<inp2:m_RenderElement name="tabs_container" tabs_render_as="language_tabs"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/regional/languages_edit_tabs.tpl
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3.2.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/languages_import_step2.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/languages_import_step2.tpl (revision 11537)
+++ branches/RC/core/admin_templates/regional/languages_import_step2.tpl (nonexistent)
@@ -1,26 +0,0 @@
-<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="section_header" icon="icon46_conf_regional" title="!la_title_ImportLanguagePack!"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="lang" title_preset="import_language_step2" module="in-portal" icon="icon46_conf_regional"/>
-
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered">
- <inp2:m_RenderElement name="subsection" title="$title"/>
-
- <tr>
- <td align="middle">
- <br />
- <table class="bordered-no-bottom" width="75%">
- <tr border="1">
- <td width="<inp2:m_param name="percent_done"/>%" class="progress_bar">&nbsp;</td>
- <td bgcolor=#FFFFFF width="<inp2:m_param name="percent_left"/>%"></td>
- </tr>
- </table>
- <br />
- <input type="submit" class="button" value="<inp2:m_phrase label="la_Cancel"/>" name="events[lang][OnImportCancel]" />
- </TD>
- </TR>
-
-</table>
-
-<inp2:m_include t="incs/footer"/>
Property changes on: branches/RC/core/admin_templates/regional/languages_import_step2.tpl
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.4
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/languages_list.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/languages_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/regional/languages_list.tpl (revision 11538)
@@ -1,69 +1,69 @@
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:configure_lang" prefix="lang" module="core" title_preset="languages_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('lang', 'regional/languages_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_language', '<inp2:m_phrase label="la_ToolTip_NewLanguage" escape="1"/>::<inp2:m_phrase label="la_Add" escape="1"/>',
function() {
std_precreate_item('lang', 'regional/languages_edit')
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('lang')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('primary_language', '<inp2:m_phrase label="la_ToolTip_SetPrimaryLanguage" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_SetPrimary" escape="1"/>', function() {
submit_event('lang','OnSetPrimary');
}
) );
a_toolbar.AddButton( new ToolBarButton('import_language', '<inp2:m_phrase label="la_ToolTip_ImportLanguage" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Import" escape="1"/>', function() {
- redirect('<inp2:m_t t="regional/languages_import" phrases.import_event="OnNew" m_opener="d" pass="all,m,phrases.import" />');
+ openSelector('lang', '<inp2:m_t t="regional/languages_import" phrases.import_event="OnNew" pass="all,m,phrases.import" get_param="test" other_param="xxx" no_amp="1" js_escape="1"/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('export_language', '<inp2:m_phrase label="la_ToolTip_ExportLanguage" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Export" escape="1"/>', function() {
- submit_event('lang','OnExportLanguage');
+ open_popup('lang', 'OnExportLanguage', 'regional/languages_export');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="lang" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="lang" IdField="LanguageId" grid="Default" menu_filters="yes"/>
<script type="text/javascript">
Grids['lang'].SetDependantToolbarButtons( new Array('edit','delete','primary_language','export_language') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/regional/languages_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.8.2.1
\ No newline at end of property
+1.8.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/email_messages_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/email_messages_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/regional/email_messages_edit.tpl (revision 11538)
@@ -1,49 +1,48 @@
<inp2:adm_SetPopupSize width="827" height="400"/>
-<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="section_header" icon="icon46_conf_regional" title="!la_title_Regional!"/>
-<inp2:m_RenderElement name="blue_bar" prefix="lang" title_preset="email_messages_edit" module="in-portal" icon="icon46_conf_regional"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="lang" section="in-portal:configure_lang" title_preset="email_messages_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('emailmessages','<inp2:m_if check="emailmessages_PropertyEquals" property="ID" value="0" >OnCreate<inp2:m_else/>OnUpdate</inp2:m_if>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('emailmessages','OnCancel');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
-<inp2:lang_SaveWarning name="grid_save_warning"/>
+<inp2:emailmessages_SaveWarning name="grid_save_warning"/>
+<inp2:emailmessages_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="emailmessages" field="LanguageId"/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="emailmessages" field="EventId"/>
<!-- <inp2:m_RenderElement name="inp_label" prefix="emailmessages" field="Type" title="!la_fld_EventType!"/> -->
<inp2:m_RenderElement name="inp_edit_box" prefix="emailmessages" field="Subject" title="!la_fld_Subject!" size="60"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="emailmessages" field="MessageType" title="!la_fld_MessageType!"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="emailmessages" field="Headers" title="!la_fld_ExtraHeaders!" control_options="{min_height: 100}" rows="5" cols="60"/>
<inp2:m_RenderElement name="subsection" title="!la_section_Message!"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="emailmessages" field="Body" title="!la_fld_MessageBody!" control_options="{min_height: 200}" rows="20" cols="85"/>
</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/regional/email_messages_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4.2.1
\ No newline at end of property
+1.4.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/languages_export_step2.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/languages_export_step2.tpl (revision 11537)
+++ branches/RC/core/admin_templates/regional/languages_export_step2.tpl (revision 11538)
@@ -1,31 +1,43 @@
-<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="section_header" icon="icon46_conf_regional" title="!la_title_ExportLanguagePack!"/>
+<inp2:adm_SetPopupSize width="850" height="600"/>
-<inp2:m_RenderElement name="blue_bar" prefix="lang" title_preset="export_language_results" module="in-portal" icon="icon46_conf_regional"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="lang" section="in-portal:configure_lang" title_preset="export_language_results"/>
<!-- 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('cancel', '<inp2:m_phrase label="la_ToolTip_Close" escape="1"/>', function() {
+ submit_event('lang', 'OnGoBack');
+ }
+ ) );
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered">
- <inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
-
-
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
- <td>
- <inp2:m_phrase label="la_DownloadLanguageExport"/>
- <td>
- <a href="<inp2:lang_ExportPath as_url="1"/><inp2:m_get name="export_file"/>"><inp2:lang_ExportPath/><inp2:m_get name="export_file"/></a>
- </td>
- <td class="error">&nbsp;</td>
- </tr>
-
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
- <td colspan="3" align="left">
- <a href="javascript:submit_event('lang','OnGoBack');"><inp2:m_phrase label="la_Continue"/></a>
+ a_toolbar.Render();
+ </script>
</td>
</tr>
-
-
+</tbody>
</table>
-<inp2:m_include t="incs/footer"/>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
+
+ <tr class="<inp2:m_odd_even odd="edit-form-odd" even="edit-form-even"/>">
+ <td class="label-cell">
+ <inp2:m_phrase label="la_DownloadLanguageExport"/>:
+ </td>
+ <td class="control-mid">&nbsp;</td>
+ <td class="control-cell">
+ <a href="<inp2:lang_ExportPath as_url="1"/><inp2:m_get name="export_file"/>"><inp2:lang_ExportPath/><inp2:m_get name="export_file"/></a>
+ </td>
+ </tr>
+
+ <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/regional/languages_export_step2.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.4.2.1
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/languages_edit_email_events.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/languages_edit_email_events.tpl (revision 11537)
+++ branches/RC/core/admin_templates/regional/languages_edit_email_events.tpl (revision 11538)
@@ -1,79 +1,76 @@
<inp2:adm_SetPopupSize width="850" height="600"/>
-<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="section_header" icon="icon46_conf_regional" title="!la_title_RegionalSettings!"/>
-
-<inp2:m_include t="regional/languages_edit_tabs"/>
-<inp2:m_RenderElement name="blue_bar" prefix="lang" title_preset="events_list" emailevents[grid]="Default" module="in-portal" icon="icon46_conf_regional"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="lang" section="in-portal:configure_lang" title_preset="events_list" tab_preset="Default" pagination="1" pagination_prefix="emailevents"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
function edit()
{
- std_edit_temp_item('phrases', 'regional/email_messages_edit');
+ std_edit_temp_item('emailevents', 'regional/email_messages_edit');
}
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('lang','<inp2:lang_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('lang','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('lang', '<inp2:lang_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('lang', '<inp2:lang_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new 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();
<inp2:m_if check="lang_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="lang_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="lang_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
+
<inp2:m_RenderElement name="search_main_toolbar" prefix="emailevents" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="emailevents" IdField="EventId" grid="Default" menu_filters="yes" main_prefix="lang"/>
<script type="text/javascript">
Grids['emailevents'].SetDependantToolbarButtons( new Array('edit') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/regional/languages_edit_email_events.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3.2.2
\ No newline at end of property
+1.3.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/languages_export.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/languages_export.tpl (revision 11537)
+++ branches/RC/core/admin_templates/regional/languages_export.tpl (revision 11538)
@@ -1,47 +1,51 @@
-<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="section_header" icon="icon46_conf_regional" title="!la_title_ExportLanguagePack!"/>
+<inp2:adm_SetPopupSize width="850" height="600"/>
-<inp2:m_RenderElement name="blue_bar" prefix="lang" title_preset="export_language" module="in-portal" icon="icon46_conf_regional"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="lang" section="in-portal:configure_lang" title_preset="export_language"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('lang','OnExportProgress');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('lang', 'OnGoBack');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered">
- <inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
+<inp2:phrases.export_SaveWarning name="grid_save_warning"/>
+<inp2:phrases.export_ErrorWarning name="form_error_warning"/>
-
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
- <inp2:m_RenderElement name="inp_edit_field_caption" prefix="phrases.export" field="LangFile" title="la_fld_ExportFileName"/>
- <td class="control-cell">
- <inp2:lang_ExportPath/> <input type="text" name="<inp2:phrases.export_InputName field="LangFile"/>" id="<inp2:phrases.export_InputName field="LangFile"/>" value="<inp2:phrases.export_Field field="LangFile"/>" />
- </td>
- <td class="error-cell"><inp2:phrases.export_Error field="LangFile"/>&nbsp;</td>
- </tr>
-
- <inp2:m_RenderElement name="inp_edit_checkboxes" prefix="phrases.export" field="PhraseType" title="!la_fld_ExportPhraseTypes!"/>
- <inp2:m_RenderElement name="inp_edit_checkboxes" no_empty="no_empty" prefix="phrases.export" field="Module" title="!la_fld_ExportModules!"/>
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="phrases.export" field="DoNotEncode" title="!la_fld_DoNotEncode!"/>
-</table>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
+
+ <tr class="<inp2:m_odd_even odd="edit-form-odd" even="edit-form-even"/>">
+ <inp2:m_RenderElement name="inp_edit_field_caption" prefix="phrases.export" field="LangFile" title="la_fld_ExportFileName"/>
+ <td class="control-cell">
+ <inp2:lang_ExportPath/> <input type="text" name="<inp2:phrases.export_InputName field="LangFile"/>" id="<inp2:phrases.export_InputName field="LangFile"/>" value="<inp2:phrases.export_Field field="LangFile"/>" />
+ </td>
+ <inp2:m_RenderElement name="inp_edit_error" prefix="phrases.export" field="LangFile"/>
+ </tr>
+
+ <inp2:m_RenderElement name="inp_edit_checkboxes" prefix="phrases.export" field="PhraseType" title="!la_fld_ExportPhraseTypes!"/>
+ <inp2:m_RenderElement name="inp_edit_checkboxes" no_empty="no_empty" prefix="phrases.export" field="Module" title="!la_fld_ExportModules!"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="phrases.export" field="DoNotEncode" title="!la_fld_DoNotEncode!"/>
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
<inp2:m_include t="incs/footer"/>
Property changes on: branches/RC/core/admin_templates/regional/languages_export.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4.2.1
\ No newline at end of property
+1.4.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/phrases_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/phrases_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/regional/phrases_edit.tpl (revision 11538)
@@ -1,84 +1,84 @@
<inp2:adm_SetPopupSize width="888" height="415"/>
-<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="section_header" icon="icon46_conf_regional" title="!la_title_RegionalSettings!"/>
-<inp2:m_RenderElement name="blue_bar" prefix="phrases" title_preset="phrase_edit" module="in-portal" icon="icon46_conf_regional"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="lang" section="in-portal:configure_lang" title_preset="phrase_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('phrases','<inp2:phrases_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('phrases','OnCancel');
}
) );
a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
reset_form('phrases', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
}
) );
<inp2:m_if check="phrases_IsTopmostPrefix">
<inp2:m_if check="phrases_IsSingle" inverse="inverse">
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
</inp2:m_if>
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('phrases', '<inp2:phrases_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('phrases', '<inp2:phrases_NextId/>');
}
) );
</inp2:m_if>
a_toolbar.Render();
<inp2:m_RenderElement name="edit_navigation" prefix="phrases"/>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:phrases_SaveWarning name="grid_save_warning"/>
+<inp2:phrases_ErrorWarning name="form_error_warning"/>
+
<div id="scroll_container">
-<table class="edit-form">
+ <table class="edit-form">
<input type="hidden" id="phrases_label" name="phrases_label" value="<inp2:m_get name="phrases_label"/>">
<inp2:m_DefineElement name="phrase_element">
<tr class="subsectiontitle">
<td colspan="3"><inp2:phrases_Field name="Phrase"/></td>
</tr>
<inp2:m_if check="m_Get" name="phrases_label">
<inp2:m_RenderElement name="inp_edit_options" prefix="phrases" field="LanguageId" title="la_fld_LanguageId" has_empty="1"/>
<inp2:m_else/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="phrases" field="LanguageId"/>
</inp2:m_if>
<inp2:m_RenderElement name="inp_label" prefix="phrases" field="PrimaryTranslation" title="!la_fld_PrimaryTranslation!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="phrases" field="Phrase" title="!la_fld_Phrase!" size="60"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="phrases" field="Translation" title="!la_fld_Translation!" rows="7" cols="50" allow_html="0"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="phrases" field="PhraseType" title="!la_fld_PhraseType!"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="phrases" field="Module" title="!la_fld_Module!"/>
</inp2:m_DefineElement>
<inp2:m_if check="m_GetEquals" name="phrases_label" value="ALEX, FIX IT!">
<inp2:phrases_MultipleEditing render_as="phrase_element"/>
<inp2:m_else/>
<inp2:m_RenderElement name="phrase_element"/>
</inp2:m_if>
-</table>
+ </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/regional/phrases_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.7.2.1
\ No newline at end of property
+1.7.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/languages_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/languages_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/regional/languages_edit.tpl (revision 11538)
@@ -1,106 +1,105 @@
<inp2:adm_SetPopupSize width="850" height="600"/>
-<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="section_header" icon="icon46_conf_regional" title="!la_title_LanguagePacks!"/>
-
-<inp2:m_include t="regional/languages_edit_tabs"/>
-<inp2:m_RenderElement name="blue_bar" prefix="lang" title_preset="languages_edit_general" module="in-portal" icon="icon46_conf_regional"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="lang" section="in-portal:configure_lang" title_preset="languages_edit_general" 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('lang','<inp2:lang_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('lang','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('lang', '<inp2:lang_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('lang', '<inp2:lang_NextId/>');
}
) );
a_toolbar.Render();
<inp2:m_if check="lang_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="lang_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="lang_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:lang_SaveWarning name="grid_save_warning"/>
+<inp2:lang_ErrorWarning name="form_error_warning"/>
+
<div id="scroll_container">
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered">
- <inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
- <inp2:m_RenderElement name="inp_id_label" prefix="lang" field="LanguageId" title="!la_fld_LanguageId!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="PackName" title="!la_fld_PackName!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="LocalName" title="!la_fld_LocalName!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="Charset" title="!la_fld_Charset!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="IconURL" title="!la_fld_IconURL!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="DateFormat" title="!la_fld_DateFormat!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="TimeFormat" title="!la_fld_TimeFormat!"/>
-
- <inp2:m_RenderElement name="inp_edit_options" prefix="lang" field="InputDateFormat" title="!la_fld_InputDateFormat!"/>
- <inp2:m_RenderElement name="inp_edit_options" prefix="lang" field="InputTimeFormat" title="!la_fld_InputTimeFormat!"/>
-
- <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="DecimalPoint" title="!la_fld_DecimalPoint!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="ThousandSep" title="!la_fld_ThousandSep!"/>
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="lang" field="PrimaryLang" title="!la_fld_PrimaryLang!"/>
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="lang" field="AdminInterfaceLang" title="la_fld_AdminInterfaceLang"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="Priority" title="la_fld_Priority"/>
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="lang" field="Enabled" title="!la_fld_Enabled!"/>
- <inp2:m_RenderElement name="inp_edit_options" prefix="lang" field="UnitSystem" title="!la_fld_UnitSystem!"/>
- <inp2:m_RenderElement name="inp_edit_options" prefix="lang" field="Locale" title="!la_fld_Locale!"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="lang" field="FilenameReplacements" title="la_fld_FilenameReplacements" control_options="{min_height: 200}" cols="50" rows="10"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="UserDocsUrl" title="la_fld_UserDocsUrl"/>
-
- <inp2:m_if check="lang_IsNewMode">
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
- <inp2:m_inc param="tab_index" by="1"/>
- <td class="text">
- <inp2:m_phrase name="la_fld_CopyLabels"/>:
- </td>
- <td>
- <input type="hidden" id="<inp2:lang_InputName field="CopyLabels"/>" name="<inp2:lang_InputName field="CopyLabels"/>" value="<inp2:lang_Field field="CopyLabels" db="db"/>">
- <input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_CopyLabels" name="_cb_CopyLabels" <inp2:lang_Field field="CopyLabels" checked="checked" db="db"/> class="<inp2:m_param name="field_class"/>" onclick="update_checkbox(this, document.getElementById('<inp2:lang_InputName field="CopyLabels"/>'))">
-
- <inp2:m_inc param="tab_index" by="1"/>
- <select tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:lang_InputName field="CopyFromLanguage"/>" id="<inp2:lang_InputName field="CopyFromLanguage"/>">
- <option value="0">--<inp2:m_phrase name="la_prompt_Select_Source"/></option>
- <inp2:lang_PredefinedOptions field="CopyFromLanguage" block="inp_option_item" selected="selected"/>
- </select>
- </td>
- <td class="error">&nbsp;</td>
- </tr>
- </inp2:m_if>
-</table>
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
+ <inp2:m_RenderElement name="inp_id_label" prefix="lang" field="LanguageId" title="!la_fld_LanguageId!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="PackName" title="!la_fld_PackName!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="LocalName" title="!la_fld_LocalName!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="Charset" title="!la_fld_Charset!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="IconURL" title="!la_fld_IconURL!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="DateFormat" title="!la_fld_DateFormat!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="TimeFormat" title="!la_fld_TimeFormat!"/>
+
+ <inp2:m_RenderElement name="inp_edit_options" prefix="lang" field="InputDateFormat" title="!la_fld_InputDateFormat!"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="lang" field="InputTimeFormat" title="!la_fld_InputTimeFormat!"/>
+
+ <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="DecimalPoint" title="!la_fld_DecimalPoint!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="ThousandSep" title="!la_fld_ThousandSep!"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="lang" field="PrimaryLang" title="!la_fld_PrimaryLang!"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="lang" field="AdminInterfaceLang" title="la_fld_AdminInterfaceLang"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="Priority" title="la_fld_Priority"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="lang" field="Enabled" title="!la_fld_Enabled!"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="lang" field="UnitSystem" title="!la_fld_UnitSystem!"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="lang" field="Locale" title="!la_fld_Locale!"/>
+ <inp2:m_RenderElement name="inp_edit_textarea" prefix="lang" field="FilenameReplacements" title="la_fld_FilenameReplacements" control_options="{min_height: 200}" cols="50" rows="10"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="lang" field="UserDocsUrl" title="la_fld_UserDocsUrl"/>
+
+ <inp2:m_if check="lang_IsNewMode">
+ <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_CopyLabels"/>:
+ </td>
+ <td class="control-mid">&nbsp;</td>
+ <td class="control-cell">
+ <input type="hidden" id="<inp2:lang_InputName field="CopyLabels"/>" name="<inp2:lang_InputName field="CopyLabels"/>" value="<inp2:lang_Field field="CopyLabels" db="db"/>">
+ <input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_CopyLabels" name="_cb_CopyLabels" <inp2:lang_Field field="CopyLabels" checked="checked" db="db"/> onclick="update_checkbox(this, document.getElementById('<inp2:lang_InputName field="CopyLabels"/>'))">
+
+ <inp2:m_inc param="tab_index" by="1"/>
+ <select tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:lang_InputName field="CopyFromLanguage"/>" id="<inp2:lang_InputName field="CopyFromLanguage"/>">
+ <option value="0">--<inp2:m_phrase name="la_prompt_Select_Source"/></option>
+ <inp2:lang_PredefinedOptions field="CopyFromLanguage" block="inp_option_item" selected="selected"/>
+ </select>
+ </td>
+ </tr>
+ </inp2:m_if>
+ </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/regional/languages_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5.2.6
\ No newline at end of property
+1.5.2.7
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/languages_edit_phrases.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/languages_edit_phrases.tpl (revision 11537)
+++ branches/RC/core/admin_templates/regional/languages_edit_phrases.tpl (revision 11538)
@@ -1,88 +1,85 @@
<inp2:adm_SetPopupSize width="850" height="600"/>
-<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="section_header" icon="icon46_conf_regional" title="!la_title_RegionalSettings!"/>
-
-<inp2:m_include t="regional/languages_edit_tabs"/>
-<inp2:m_RenderElement name="blue_bar" prefix="lang" phrases[grid]="Default" pagination="0" title_preset="phrases_list" module="in-portal" icon="icon46_conf_regional"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="lang" section="in-portal:configure_lang" title_preset="phrases_list" tab_preset="Default" pagination="1" pagination_prefix="phrases"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
function edit()
{
std_edit_temp_item('phrases', 'regional/phrases_edit');
}
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('lang','<inp2:lang_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('lang','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('lang', '<inp2:lang_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('lang', '<inp2:lang_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('new_language_var', '<inp2:m_phrase label="la_ToolTip_NewLabel" escape="1"/>::<inp2:m_phrase label="la_Add" escape="1"/>',
function() {
std_new_item('phrases', 'regional/phrases_edit')
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('phrases')
} ) );
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();
<inp2:m_if check="lang_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="lang_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="lang_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
+
<inp2:m_RenderElement name="search_main_toolbar" prefix="phrases" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="phrases" IdField="PhraseId" grid="Default" menu_filters="yes"/>
<script type="text/javascript">
Grids['phrases'].SetDependantToolbarButtons( new Array('edit','delete') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/regional/languages_edit_phrases.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3.2.1
\ No newline at end of property
+1.3.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/languages_import.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/languages_import.tpl (revision 11537)
+++ branches/RC/core/admin_templates/regional/languages_import.tpl (revision 11538)
@@ -1,46 +1,46 @@
-<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="section_header" icon="icon46_conf_regional" title="!la_title_ImportLanguagePack!"/>
+<inp2:adm_SetPopupSize width="660" height="300"/>
-<inp2:m_RenderElement name="blue_bar" prefix="lang" title_preset="import_language" module="in-portal" icon="icon46_conf_regional"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" prefix="lang" section="in-portal:configure_lang" title_preset="import_language"/>
<!-- 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() {
- Application.SetVar('next_template', 'regional/languages_list')
submit_event('lang','OnImportLanguage');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('lang', 'OnGoBack');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:phrases.import_SaveWarning name="grid_save_warning"/>
<inp2:phrases.import_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_upload" prefix="phrases.import" field="LangFile" title="!la_fld_LanguageFile!"/>
<inp2:m_RenderElement name="inp_edit_checkboxes" prefix="phrases.import" field="PhraseType" title="!la_fld_InstallPhraseTypes!"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="phrases.import" field="ImportOverwrite" hint_label="la_importlang_phrasewarning" title="la_prompt_overwritephrases"/>
<!-- <inp2:m_RenderElement name="inp_edit_checkboxes" no_empty="no_empty" prefix="phrases.export" field="Module" title="!la_fld_InstallModules!" /> -->
+ <inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
<inp2:m_include t="incs/footer"/>
Property changes on: branches/RC/core/admin_templates/regional/languages_import.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/spelling_dictionary/spelling_dictionary_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/spelling_dictionary/spelling_dictionary_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/spelling_dictionary/spelling_dictionary_edit.tpl (revision 11538)
@@ -1,72 +1,72 @@
<inp2:adm_SetPopupSize width="550" height="400"/>
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:spelling_dictionary" prefix="spelling-dictionary" title_preset="spelling_dictionary_edit"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:spelling_dictionary" prefix="spelling-dictionary" title_preset="spelling_dictionary_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('spelling-dictionary', '<inp2:spelling-dictionary_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
cancel_edit('spelling-dictionary', 'OnCancelEdit','<inp2:spelling-dictionary_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('spelling-dictionary', '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('spelling-dictionary', '<inp2:spelling-dictionary_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('spelling-dictionary', '<inp2:spelling-dictionary_NextId/>');
}
) );
a_toolbar.Render();
<inp2:m_if check="spelling-dictionary_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="spelling-dictionary_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="spelling-dictionary_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:spelling-dictionary_SaveWarning name="grid_save_warning"/>
<inp2:spelling-dictionary_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
-<table class="edit-form">
+ <table class="edit-form">
<inp2:m_RenderElement name="inp_id_label" prefix="spelling-dictionary" field="SpellingDictionaryId" title="la_fld_Id"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="spelling-dictionary" field="MisspelledWord" title="la_fld_MisspelledWord"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="spelling-dictionary" field="SuggestedCorrection" title="la_fld_SuggestedCorrection"/>
<inp2:m_RenderElement name="inp_edit_filler"/>
-</table>
+ </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/spelling_dictionary/spelling_dictionary_edit.tpl
___________________________________________________________________
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/admin_templates/spelling_dictionary/spelling_dictionary_list.tpl
===================================================================
--- branches/RC/core/admin_templates/spelling_dictionary/spelling_dictionary_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/spelling_dictionary/spelling_dictionary_list.tpl (revision 11538)
@@ -1,54 +1,55 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:spelling_dictionary" prefix="spelling-dictionary" title_preset="spelling_dictionary_list" />
+<inp2:m_RenderElement name="combined_header" section="in-portal:spelling_dictionary" prefix="spelling-dictionary" title_preset="spelling_dictionary_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('spelling-dictionary', 'spelling_dictionary/spelling_dictionary_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_spelling_dictionary', '<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
function() {
std_precreate_item('spelling-dictionary', 'spelling_dictionary/spelling_dictionary_edit');
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('spelling-dictionary')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('export', '<inp2:m_phrase label="la_ToolTip_Export" escape="1"/>', function() {
std_csv_export('spelling-dictionary', 'Default', 'export/export_progress');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
+
<inp2:m_RenderElement name="search_main_toolbar" prefix="spelling-dictionary" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="spelling-dictionary" IdField="SpellingDictionaryId" grid="Default"/>
<script type="text/javascript">
Grids['spelling-dictionary'].SetDependantToolbarButtons( new Array('edit','delete') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/spelling_dictionary/spelling_dictionary_list.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/config/config_general.tpl
===================================================================
--- branches/RC/core/admin_templates/config/config_general.tpl (revision 11537)
+++ branches/RC/core/admin_templates/config/config_general.tpl (revision 11538)
@@ -1,125 +1,120 @@
-<inp2:m_RequireLogin perm_event="conf:OnLoad" system="1"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
-
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
-
-<inp2:m_RenderElement name="section_header" module="in-portal" prefix="conf" icon="icon46_settings_general" title="!la_tab_ConfigGeneral!"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="conf" title_preset="config_list_general" icon="icon46_settings_general"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_Get name="section" result_to_var="section"/>
+<inp2:m_RenderElement name="combined_header" prefix="conf" section="$section" perm_event="conf:OnLoad" title_preset="config_list_general"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
function ValidatePassFld(fieldId){
var passFld=document.getElementById(fieldId);
var passVerifyFld=document.getElementById('verify_'+fieldId);
if (passFld && passVerifyFld && passFld.value == passVerifyFld.value) {
return true;
}
else {
var passErrorCell=document.getElementById('error_'+fieldId);
if (passErrorCell){
passErrorCell.innerHTML='<inp2:m_phrase name="la_error_PasswordMatch" />';
}
return false;
}
}
function ValidatePassFields(){
var el=false;
var validated=true;
for (var i=0; i<document.forms.kernel_form.elements.length; i++){
el=document.forms.kernel_form.elements[i];
if (el.getAttribute('primarytype')=='password'){
if (!ValidatePassFld(el.id)){
validated=false;
}
}
}
return validated;
}
function toggle_section($label) {
var $table = document.getElementById('config_table');
var $row = null;
var $is_visible = false;
for (var $i = 0; $i < $table.rows.length; $i++) {
$row = $table.rows[$i];
if ($row.getAttribute('header_label') != $label) {
continue;
}
if (!$row.style.display) {
$row.style.display = document.all ? 'block' : 'table-row';
}
$is_visible = !($row.style.display == 'none');
$row.style.display = $is_visible ? 'none' : (document.all ? 'block' : 'table-row');
document.getElementById('toggle_mark['+$label+']').innerHTML = '[' + ($is_visible ? '+' : '-') + ']';
}
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
if (ValidatePassFields()){
submit_event('conf','<inp2:conf_SaveEvent/>');
}
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('conf','OnCancel');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_include t="incs/config_blocks"/>
<inp2:conf_SaveWarning name="grid_save_warning"/>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered" id="config_table">
<!-- module root category selector: begin -->
<tr class="subsectiontitle">
<td colspan="2">
<inp2:m_phrase name="la_Text_RootCategory" />
</td>
<td align="right">
<a class="config-header" href="javascript:toggle_section('la_Text_RootCategory');" id="toggle_mark[la_Text_RootCategory]" title="Collapse/Expand Section">[-]</a>
</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>" header_label="la_Text_RootCategory">
<td>
<span class="text"><inp2:m_phrase name="la_prompt_RootCategory" /></span>
</td>
<td>
<inp2:m_DefineElement name="category_caption">
- <inp2:m_if check="m_ParamEquals" name="cat_id" value="0" inverse="inverse">
- <inp2:m_param name="separator"/>
- </inp2:m_if>
+ <inp2:m_ifnot check="c_HomeCategory" equals_to="$cat_id">
+ <inp2:m_param name="separator"/>
+ </inp2:m_ifnot>
<inp2:m_param name="cat_name"/>
</inp2:m_DefineElement>
<b><inp2:conf_CategoryPath separator=" &gt; " render_as="category_caption" /></b>
<input type="hidden" name="conf[ModuleRootCategory][VariableValue]" value="<inp2:conf_ModuleRootCategory/>"/>
<a href="javascript:openSelector('conf', '<inp2:adm_SelectorLink prefix="conf" selection_mode="single" tab_prefixes="none"/>', 'ModuleRootCategory', '950x600');"><img src="img/icons/icon24_cat.gif" border="0" align="absmiddle" /></a>
</td>
<td class="error">&nbsp;</td>
</tr>
<!-- module root category selector: end -->
<inp2:conf_PrintList block="config_block" per_page="-1" full_block="config_block" half_block1="config_block1" half_block2="config_block2"/>
</table>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/config/config_general.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5
\ No newline at end of property
+1.5.2.1
\ No newline at end of property
Index: branches/RC/core/admin_templates/config/config_search.tpl
===================================================================
--- branches/RC/core/admin_templates/config/config_search.tpl (revision 11537)
+++ branches/RC/core/admin_templates/config/config_search.tpl (revision 11538)
@@ -1,133 +1,130 @@
-<inp2:m_RequireLogin perm_event="confs:OnLoad" system="1"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
+<inp2:m_include t="incs/header"/>
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
-<inp2:m_RenderElement name="section_header" module="in-portal" prefix="confs" icon="icon46_settings_search" title="!la_tab_ConfigSearch!"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="confs" title_preset="config_list_search" icon="icon46_settings_output"/>
+<inp2:m_Get name="section" result_to_var="section"/>
+<inp2:m_RenderElement name="combined_header" prefix="confs" section="$section" perm_event="confs:OnLoad" title_preset="config_list_search"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
var a_toolbar = new ToolBar();
<inp2:m_if check="m_IsDebugMode">
a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_NewSearchConfig" escape="1"/>', function() {
std_new_item('confs', 'config/config_search_edit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
</inp2:m_if>
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('confs','<inp2:confs_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('confs','OnCancel');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_DefineElement name="confs_checkbox_td">
<td valign="top" class="text">
<inp2:m_if check="m_ParamEquals" name="nolabel" value="true">
<inp2:m_else />
<label for="_cb_<inp2:InputName field="$Field"/>"><inp2:m_Phrase label="$Label" /></label>
</inp2:m_if>
<input type="checkbox" name="_cb_<inp2:InputName field="$Field"/>" <inp2:Field field="$Field" checked="checked" db="db"/> id="_cb_<inp2:InputName field="$Field"/>" onclick="update_checkbox(this, document.getElementById('<inp2:InputName field="$Field"/>'))" >
<input type="hidden" id="<inp2:InputName field="$Field"/>" name="<inp2:InputName field="$Field"/>" value="<inp2:Field field="$Field" db="db"/>">
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="confs_edit_text">
<td valign="top" class="text">
<label for="<inp2:InputName field="$Field"/>"><inp2:m_Phrase label="$Label" /></label>
<input type="text" name="<inp2:InputName field="$Field"/>" value="<inp2:Field field="$Field"/>" size="3" />
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="confs_detail_row">
<inp2:m_if check="m_ParamEquals" name="show_heading" value="1">
<tr class="subsectiontitle">
<td colspan="4">
<inp2:Field name="ConfigHeader" as_label="1"/>
</td>
</tr>
</inp2:m_if>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td class="text">
<inp2:Field field="DisplayName" as_label="true" />
<inp2:m_if check="m_IsDebugMode">
<br /><small>[ID: <b><inp2:Field name="SearchConfigId"/></b>; DisplayOrder: <b><inp2:Field name="DisplayOrder"/></b>; Field: <b><inp2:Field name="FieldName"/></b>]</small>
</inp2:m_if>
</td>
<inp2:m_RenderElement name="confs_checkbox_td" pass_params="true" IdField="SearchConfigId" Label="la_prompt_SimpleSearch" Field="SimpleSearch" />
<inp2:m_RenderElement name="confs_edit_text" pass_params="true" IdField="SearchConfigId" Label="la_prompt_weight" Field="Priority" />
<inp2:m_RenderElement name="confs_checkbox_td" pass_params="true" IdField="SearchConfigId" Label="la_prompt_AdvancedSearch" Field="AdvancedSearch" />
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="config_values">
<tr class="subsectiontitle">
<td colspan="4">
<inp2:m_phrase name="$module_item" /> <inp2:m_phrase name="la_prompt_relevence_settings" />
</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td colspan="4">
<inp2:m_phrase name="la_prompt_required_field_increase"/>
<input type="text" size="3" name="conf[<inp2:conf_GetVariableID name="SearchRel_Increase_{$module_key}"/>][VariableValue]" VALUE="<inp2:Field field="SearchRel_Increase_{$module_key}" />">%
</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td colspan="4">
<inp2:m_phrase name="la_prompt_relevence_percent"/>
<input type="text" size="3" name="conf[<inp2:conf_GetVariableID name="SearchRel_Keyword_{$module_key}"/>][VariableValue]" value="<inp2:Field field="SearchRel_Keyword_{$module_key}" />">% <inp2:Field field="SearchRel_Keyword_{$module_key}_prompt" as_label="1" /> &nbsp;&nbsp;&nbsp;
<input type="text" size="3" name="conf[<inp2:conf_GetVariableID name="SearchRel_Pop_{$module_key}"/>][VariableValue]" value="<inp2:Field field="SearchRel_Pop_{$module_key}" />">% <inp2:Field field="SearchRel_Pop_{$module_key}_prompt" as_label="1" />&nbsp;&nbsp;&nbsp;
<input type="text" size="3" name="conf[<inp2:conf_GetVariableID name="SearchRel_Rating_{$module_key}"/>][VariableValue]" value="<inp2:Field field="SearchRel_Rating_{$module_key}" />">% <inp2:Field field="SearchRel_Rating_{$module_key}_prompt" as_label="1" />
</td>
</tr>
<inp2:m_if check="m_GetEquals" name="module" value="In-Portal" inverse="inverse">
<tr class="subsectiontitle">
<td colspan="4">
<inp2:m_phrase name="$module_item" /> <inp2:m_phrase name="la_prompt_multipleshow" />
</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td class="text" width="120"><inp2:Field field="Search_ShowMultiple_{$module_key}_prompt" as_label="1"/></td>
<td class="text" colspan="3">
<input type="checkbox" name="_cb_conf[<inp2:conf_GetVariableID name="Search_ShowMultiple_{$module_key}"/>][VariableValue]" <inp2:Field field="Search_ShowMultiple_{$module_key}" checked="checked" db="db"/> id="_cb_conf[<inp2:conf_GetVariableID name="Search_ShowMultiple_{$module_key}"/>][VariableValue]" onclick="update_checkbox(this, document.getElementById('conf[<inp2:conf_GetVariableID name="Search_ShowMultiple_{$module_key}"/>][VariableValue]'))" >
<input type="hidden" id="conf[<inp2:conf_GetVariableID name="Search_ShowMultiple_{$module_key}"/>][VariableValue]" name="conf[<inp2:conf_GetVariableID name="Search_ShowMultiple_{$module_key}"/>][VariableValue]" value="<inp2:Field field="Search_ShowMultiple_{$module_key}" db="db"/>">
</td>
</tr>
</inp2:m_if>
</inp2:m_DefineElement>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered"<inp2:m_if check="conf_ShowRelevance"> style="border-bottom-width: 0px;"</inp2:m_if>>
<inp2:confs_PrintList render_as="confs_detail_row" />
</table>
<inp2:m_if check="conf_ShowRelevance">
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered">
<inp2:conf_PrintConfList block="config_values" />
</table>
</inp2:m_if>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/config/config_search.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.6.2.1
\ No newline at end of property
Index: branches/RC/core/admin_templates/config/config_email.tpl
===================================================================
--- branches/RC/core/admin_templates/config/config_email.tpl (revision 11537)
+++ branches/RC/core/admin_templates/config/config_email.tpl (revision 11538)
@@ -1,63 +1,63 @@
-<inp2:m_RequireLogin perm_event="emailevents:OnLoad" system="1"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="section_header" prefix="emailevents.module" module="in-portal" icon="icon46_settings_email" title="!la_title_emailevents!"/>
-<inp2:m_RenderElement name="blue_bar" prefix="emailevents.module" emailevents.module[grid]="Default" title_preset="email_settings_list" icon="icon46_settings_email"/>
+<inp2:m_Get name="section" result_to_var="section"/>
+<inp2:m_RenderElement name="combined_header" prefix="emailevents.module" section="$section" perm_event="emailevents:OnLoad" grid="EmailSettings" title_preset="email_settings_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()
{
openSelector('emailevents.module', '<inp2:m_t t="user_selector" pass="all,emailevents.module" escape="1"/>', 'FromUserId', null, 'OnSaveSelected');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('usertogroup', '<inp2:m_phrase label="la_ToolTip_SelectUser" escape="1"/>', edit
) );
- //a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Enable" escape="1"/>', function() {
submit_event('emailevents.module','OnMassApprove');
}
) );
a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Disable" escape="1"/>', function() {
submit_event('emailevents.module','OnMassDecline');
}
) );
a_toolbar.AddButton( new ToolBarButton('frontend_mail', '<inp2:m_phrase label="la_ToolTip_Email_FrontOnly" escape="1"/>', function() {
submit_event('emailevents.module','OnFrontOnly');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="emailevents.module" grid="EmailSettings"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="emailevents.module" IdField="EventId" grid="EmailSettings" menu_filters="yes"/>
<script type="text/javascript">
Grids['emailevents.module'].SetDependantToolbarButtons( new Array('frontend_mail','usertogroup','approve','decline') );
</script>
<input type="hidden" name="emailevents.module_PopupSelectedUser" value="">
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/config/config_email.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/config/config_universal.tpl
===================================================================
--- branches/RC/core/admin_templates/config/config_universal.tpl (revision 11537)
+++ branches/RC/core/admin_templates/config/config_universal.tpl (revision 11538)
@@ -1,98 +1,97 @@
-<inp2:m_RequireLogin perm_event="conf:OnLoad" system="1"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_Get var="section" result_to_var="section"/> <!-- was #section# before, don't know were it was replaced -->
-<inp2:conf_InitList name="default" per_page="-1" />
-<inp2:m_RenderElement name="combined_header" section="$section" module="in-portal" prefix="conf" title_preset=""/>
+<inp2:conf_InitList name="Default" per_page="-1"/>
+<inp2:m_Get name="section" result_to_var="section"/>
+<inp2:m_RenderElement name="combined_header" prefix="conf" section="$section" perm_event="conf:OnLoad"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
function ValidatePassFld(fieldId){
var passFld=document.getElementById(fieldId);
var passVerifyFld=document.getElementById('verify_'+fieldId);
if (passFld && passVerifyFld && passFld.value == passVerifyFld.value) {
return true;
}
else {
var passErrorCell=document.getElementById('error_'+fieldId);
if (passErrorCell){
passErrorCell.innerHTML='<inp2:m_phrase name="la_error_PasswordMatch" />';
}
return false;
}
}
function ValidatePassFields(){
var el=false;
var validated=true;
for (var i=0; i<document.forms.kernel_form.elements.length; i++){
el=document.forms.kernel_form.elements[i];
if (el.getAttribute('primarytype')=='password'){
if (!ValidatePassFld(el.id)){
validated=false;
}
}
}
return validated;
}
function toggle_section($label) {
var $table = document.getElementById('config_table');
var $row = null;
var $is_visible = false;
for (var $i = 0; $i < $table.rows.length; $i++) {
$row = $table.rows[$i];
if ($row.getAttribute('header_label') != $label) {
continue;
}
if (!$row.style.display) {
$row.style.display = document.all ? 'block' : 'table-row';
}
$is_visible = !($row.style.display == 'none');
$row.style.display = $is_visible ? 'none' : (document.all ? 'block' : 'table-row');
document.getElementById('toggle_mark['+$label+']').innerHTML = '[' + ($is_visible ? '+' : '-') + ']';
}
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
if (ValidatePassFields()){
submit_event('conf','<inp2:conf_SaveEvent/>');
}
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('conf','OnCancel');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_include t="incs/config_blocks"/>
<inp2:conf_SaveWarning name="grid_save_warning"/>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered" id="config_table">
<inp2:conf_PrintList list_name="default" block="config_block" full_block="config_block" half_block1="config_block1" half_block2="config_block2"/>
</table>
<script type="text/javascript">
<inp2:m_if check="m_Get" name="refresh_tree">
getFrame('menu').location.reload();
</inp2:m_if>
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/config/config_universal.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5.2.2
\ No newline at end of property
+1.5.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/config/config_search_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/config/config_search_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/config/config_search_edit.tpl (revision 11538)
@@ -1,74 +1,74 @@
-<inp2:m_RequireLogin perm_event="confs:OnLoad" system="1"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
+<inp2:m_include t="incs/header"/>
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
-<inp2:m_RenderElement name="section_header" module="in-portal" icon="icon46_settings_search" title="la_tab_ConfigSearch"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="confs" title_preset="configsearch_edit" module="in-portal" icon="icon46_settings_search"/>
+<inp2:m_Get name="section" result_to_var="section"/>
+<inp2:m_RenderElement name="combined_header" prefix="confs" section="$section" perm_event="confs:OnLoad" title_preset="configsearch_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('confs','<inp2:confs_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('confs','OnGoBack');
}
) );
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('confs', '<inp2:confs_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('confs', '<inp2:confs_NextId/>');
}
) );
a_toolbar.Render();
<inp2:m_if check="confs_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="confs_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="confs_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:confs_SaveWarning name="grid_save_warning"/>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered">
- <inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
-
- <inp2:m_RenderElement name="inp_id_label" prefix="confs" field="SearchConfigId" title="la_fld_SearchConfigId"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="confs" field="TableName" title="la_fld_TableName"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="confs" field="FieldName" title="la_fld_FieldName"/>
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="confs" field="SimpleSearch" title="la_fld_SimpleSearch"/>
- <inp2:m_RenderElement name="inp_edit_checkbox" prefix="confs" field="AdvancedSearch" title="la_fld_AdvancedSearch"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="confs" field="Description" title="la_fld_Description"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="confs" field="DisplayName" title="la_fld_DisplayName"/>
- <inp2:m_RenderElement name="inp_edit_options" prefix="confs" field="ModuleName" title="la_fld_ModuleName"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="confs" field="ConfigHeader" title="la_fld_ConfigHeader"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="confs" field="DisplayOrder" title="la_fld_DisplayOrder"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="confs" field="Priority" title="la_fld_Priority"/>
- <inp2:m_RenderElement name="inp_edit_options" prefix="confs" field="FieldType" title="la_fld_FieldType"/>
-</table>
+<inp2:confs_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_id_label" prefix="confs" field="SearchConfigId" title="la_fld_SearchConfigId"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="confs" field="TableName" title="la_fld_TableName"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="confs" field="FieldName" title="la_fld_FieldName"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="confs" field="SimpleSearch" title="la_fld_SimpleSearch"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="confs" field="AdvancedSearch" title="la_fld_AdvancedSearch"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="confs" field="Description" title="la_fld_Description"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="confs" field="DisplayName" title="la_fld_DisplayName"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="confs" field="ModuleName" title="la_fld_ModuleName"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="confs" field="ConfigHeader" title="la_fld_ConfigHeader"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="confs" field="DisplayOrder" title="la_fld_DisplayOrder"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="confs" field="Priority" title="la_fld_Priority"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="confs" field="FieldType" title="la_fld_FieldType"/>
+ </table>
+</div>
<inp2:m_include t="incs/footer"/>
Property changes on: branches/RC/core/admin_templates/config/config_search_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5
\ No newline at end of property
+1.5.2.1
\ No newline at end of property
Index: branches/RC/core/admin_templates/import/import_complete.tpl
===================================================================
--- branches/RC/core/admin_templates/import/import_complete.tpl (revision 11537)
+++ branches/RC/core/admin_templates/import/import_complete.tpl (revision 11538)
@@ -1,37 +1,38 @@
-<inp2:m_include t="incs/header" nobody="yes"/>
-
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:adm_SetPopupSize width="515" height="194"/>
+<inp2:m_include t="incs/header"/>
<inp2:adm_ImportData var="prefix" result_to_var="importprefix" />
<inp2:{$importprefix}_PermSection section="main" result_to_var="permsection" />
<inp2:m_RenderElement name="combined_header" section="$permsection" prefix="adm" title_preset="csv_import"/>
+<div id="scroll_container">
<table class="edit-form">
- <inp2:m_RenderElement name="subsection" title="la_prompt_ImportCompleteMessage"/>
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
- <td colspan="3" align="center">
- <inp2:m_Phrase label="la_ImportComplete" />:
- <inp2:adm_ImportData var="updated" /> <inp2:m_Phrase label="la_RecordsUpdated" />,
- <inp2:adm_ImportData var="added" /> <inp2:m_Phrase label="la_RecordsAdded" />
- </td>
- </tr>
- <inp2:m_if check="adm_ImportData" var="not_imported_lines">
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
+ <inp2:m_RenderElement name="subsection" title="la_prompt_ImportCompleteMessage"/>
+ <tr class="<inp2:m_odd_even odd='table-color1' even='table-color2'/>">
<td colspan="3" align="center">
- <inp2:m_Phrase label="la_FollowingLinesWereNotImported" />:
+ <inp2:m_Phrase label="la_ImportComplete" />:
+ <inp2:adm_ImportData var="updated" /> <inp2:m_Phrase label="la_RecordsUpdated" />,
+ <inp2:adm_ImportData var="added" /> <inp2:m_Phrase label="la_RecordsAdded" />
</td>
</tr>
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
+ <inp2:m_if check="adm_ImportData" var="not_imported_lines">
+ <tr class="<inp2:m_odd_even odd='table-color1' even='table-color2'/>">
+ <td colspan="3" align="center">
+ <inp2:m_Phrase label="la_FollowingLinesWereNotImported" />:
+ </td>
+ </tr>
+ <tr class="<inp2:m_odd_even odd='table-color1' even='table-color2'/>">
+ <td colspan="3" align="center">
+ <textarea readonly cols="80" rows="13" wrap="off"><inp2:adm_PrintCSVNotImportedLines /></textarea>
+ </td>
+ </tr>
+ </inp2:m_if>
+ <tr class="<inp2:m_odd_even odd='table-color1' even='table-color2'/>">
<td colspan="3" align="center">
- <textarea readonly cols="80" rows="13" wrap="off"><inp2:adm_PrintCSVNotImportedLines /></textarea>
+ <input type="button" value="<inp2:m_phrase name="la_Close"/>" class="button" onclick="window.location.href='<inp2:m_Link template="incs/close_popup" no_amp="1" />';"/>
</td>
</tr>
- </inp2:m_if>
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
- <td colspan="3" align="center">
- <input type="button" value="<inp2:m_phrase name="la_Close"/>" class="button" onclick="window.location.href='<inp2:m_Link template="incs/close_popup" no_amp="1" />';"/>
- </td>
- </tr>
-</table>
+ </table>
+</div>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/import/import_complete.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.4.1
\ No newline at end of property
+1.1.4.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/import/import_start.tpl
===================================================================
--- branches/RC/core/admin_templates/import/import_start.tpl (revision 11537)
+++ branches/RC/core/admin_templates/import/import_start.tpl (revision 11538)
@@ -1,55 +1,53 @@
<inp2:adm_SetPopupSize width="500" height="270"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="section_header" icon="icon46_conf_regional" title="!la_title_Import!"/>
<inp2:m_set adm_id="0" />
<inp2:m_Get var="PrefixSpecial" result_to_var="importprefix" />
<inp2:{$importprefix}_PermSection section="main" result_to_var="permsection" />
<inp2:m_RenderElement name="combined_header" section="$permsection" prefix="adm" title_preset="csv_import"/>
-<!--<inp2:m_RenderElement name="combined_header" section="in-portal:root" prefix="adm" title_preset="csv_import"/>-->
-
<!-- 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_Import" escape="1"/>', function() {
submit_event('adm','OnCSVImportBegin');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
window_close();
}
) );
a_toolbar.Render();
</script>
<script src="js/swfobject.js" type="text/javascript"></script>
<script type="text/javascript" src="js/uploader.js"></script>
</td>
</tr>
</tbody>
</table>
+<inp2:adm_SaveWarning name="grid_save_warning"/>
<inp2:adm_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered">
- <inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
- <inp2:m_RenderElement name="inp_edit_swf_upload" prefix="adm" field="ImportFile" title="!la_fld_ImportFile!"/>
- <inp2:m_RenderElement name="inp_edit_filler"/>
- <!--<inp2:m_RenderElement name="inp_edit_checkbox" prefix="phrases.import" field="ImportOverwrite" hint_label="la_importlang_phrasewarning" title="la_prompt_overwritephrases"/>-->
-</table>
+ <inp2:m_RenderElement name="inp_edit_swf_upload" prefix="adm" field="ImportFile" title="!la_fld_ImportFile!"/>
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ <!--<inp2:m_RenderElement name="inp_edit_checkbox" prefix="phrases.import" field="ImportOverwrite" hint_label="la_importlang_phrasewarning" title="la_prompt_overwritephrases"/>-->
+ </table>
</div>
<input type="hidden" name="next_template" value="import/import_progress" />
<input type="hidden" name="PrefixSpecial" value="<inp2:m_Get var="PrefixSpecial" />" />
<input type="hidden" name="grid" value="<inp2:m_Get var="grid" />" />
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/import/import_start.tpl
___________________________________________________________________
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/import/import_progress.tpl
===================================================================
--- branches/RC/core/admin_templates/import/import_progress.tpl (revision 11537)
+++ branches/RC/core/admin_templates/import/import_progress.tpl (revision 11538)
@@ -1,27 +1,25 @@
<inp2:adm_SetPopupSize width="515" height="194"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
-
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:m_include t="incs/header"/>
<inp2:adm_ImportData var="prefix" result_to_var="importprefix" />
<inp2:{$importprefix}_PermSection section="main" result_to_var="permsection" />
<inp2:m_RenderElement name="combined_header" section="$permsection" prefix="adm" title_preset="csv_import"/>
<script type="text/javascript" src="js/ajax.js"></script>
<inp2:m_RenderElement name="ajax_progress_bar" cancel_action="cancel_action();"/>
<script type="text/javascript">
function cancel_action() {
redirect('<inp2:m_Link template="import/import_complete"/>');
}
-
+
var PrefixSpecial = '<inp2:m_Get var="PrefixSpecial" js_escape="1" />';
var grid = '<inp2:m_Get var="grid" js_escape="1" />';
var action_url = '<inp2:m_t template="index" adm_event="OnCSVImportStep" type="return_progress" finish_template="import/import_complete" PrefixSpecial="#PrefixSpecial#" grid="#grid#" pass="m,adm" no_amp="1"/>';
action_url = action_url.replace('#PrefixSpecial#', PrefixSpecial);
action_url = action_url.replace('#grid#', grid);
// window.open(action_url);
-
+
$QueueProcessor = new AjaxProgressBar(action_url);
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/import/import_progress.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.4.1
\ No newline at end of property
+1.1.4.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/ban_rules/ban_rule_list.tpl
===================================================================
--- branches/RC/core/admin_templates/ban_rules/ban_rule_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/ban_rules/ban_rule_list.tpl (revision 11538)
@@ -1,48 +1,48 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:user_banlist" prefix="ban-rule" title_preset="ban_rule_list" />
+<inp2:m_RenderElement name="combined_header" section="in-portal:user_banlist" prefix="ban-rule" title_preset="ban_rule_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('ban-rule', 'ban_rules/ban_rule_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
function() {
std_precreate_item('ban-rule', 'ban_rules/ban_rule_edit');
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('ban-rule')
} ) );
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="ban-rule" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="ban-rule" IdField="RuleId" grid="Default" grid_filters="1"/>
<script type="text/javascript">
Grids['ban-rule'].SetDependantToolbarButtons( new Array('edit','delete') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/ban_rules/ban_rule_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/ban_rules/ban_rule_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/ban_rules/ban_rule_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/ban_rules/ban_rule_edit.tpl (revision 11538)
@@ -1,78 +1,79 @@
<inp2:adm_SetPopupSize width="550" height="400"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:user_banlist" prefix="ban-rule" title_preset="ban_rule_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('ban-rule', '<inp2:ban-rule_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
cancel_edit('ban-rule', 'OnCancelEdit','<inp2:ban-rule_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('ban-rule', '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('ban-rule', '<inp2:ban-rule_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('ban-rule', '<inp2:ban-rule_NextId/>');
}
) );
a_toolbar.Render();
<inp2:m_if check="ban-rule_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="ban-rule_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="ban-rule_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:ban-rule_SaveWarning name="grid_save_warning"/>
<inp2:ban-rule_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
-<table class="edit-form">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="inp_edit_hidden" prefix="ban-rule" field="ItemType"/>
+
<inp2:m_RenderElement name="inp_id_label" prefix="ban-rule" field="RuleId" title="la_fld_Id"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="ban-rule" field="RuleType" title="la_fld_RuleType"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="ban-rule" field="ItemField" title="la_fld_ItemField"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="ban-rule" field="ItemVerb" title="la_fld_FieldComparision"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="ban-rule" field="ItemValue" title="la_fld_FieldValue"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="ban-rule" field="ErrorTag" title="la_fld_ErrorTag"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="ban-rule" field="Priority" title="la_fld_Priority"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="ban-rule" field="Status" title="la_fld_Status"/>
- <input type="hidden" name="<inp2:ban-rule_InputName field="ItemType"/>" id="<inp2:ban-rule_InputName field="ItemType"/>" value="6">
<inp2:m_RenderElement name="inp_edit_filler"/>
-</table>
+ </table>
</div>
<inp2:m_include t="incs/footer"/>
Property changes on: branches/RC/core/admin_templates/ban_rules/ban_rule_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/catalog/catalog.tpl
===================================================================
--- branches/RC/core/admin_templates/catalog/catalog.tpl (revision 11537)
+++ branches/RC/core/admin_templates/catalog/catalog.tpl (revision 11538)
@@ -1,276 +1,278 @@
<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/catalog_tabs" 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"/>"/>
<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/catalog.js"></script>
<script type="text/javascript">
var menuMgr = new NlsMenuManager("mgr");
menuMgr.timeout = 500;
menuMgr.flowOverFormElement = true;
Request.progressText = '<inp2:m_phrase name="la_title_Loading" escape="1"/>';
var $is_catalog = true;
var $Catalog = new Catalog('<inp2:m_Link template="#TEMPLATE_NAME#" m_cat_id="#CATEGORY_ID#" no_amp="1"/>', 'catalog_');
$Catalog.TabByCategory = <inp2:m_if check="m_GetConfig" name="Catalog_PreselectModuleTab">true<inp2:m_else/>false</inp2:m_if>;
var a_toolbar = new ToolBar();
a_toolbar.AddButton(
new ToolBarButton(
'upcat',
'<inp2:m_phrase label="la_ToolTip_Up" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_GoUp" escape="1"/>',
function() {
$Catalog.go_to_cat($Catalog.ParentCategoryID);
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'homecat',
'<inp2:m_phrase label="la_ToolTip_Home" escape="1"/>',
function() {
- $Catalog.go_to_cat(<inp2:m_ModuleInfo key="Name" value="Proj-CMS" return="RootCat"/>);
+ $Catalog.go_to_cat(<inp2:c_HomeCategory/>);
}
)
);
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
<inp2:m_ModuleInclude template="catalog_tab" tab_init="1" replace_m="yes"/>
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.getCurrentPrefix(), 'view_template');
std_delete_items($Catalog.getCurrentPrefix(), $template, 1);
}
)
);
<inp2:m_ModuleInclude template="catalog_buttons" main_template="catalog"/>
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton(
new ToolBarButton(
'approve',
'<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>',
function() {
askCategoryPropagate();
$Catalog.submit_event(null, 'OnMassApprove');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'decline',
'<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>',
function() {
askCategoryPropagate();
$Catalog.submit_event(null, 'OnMassDecline');
}
)
);
function askCategoryPropagate() {
- if (Grids['c'].GetSelected().length) {
+ if ($Catalog.getCurrentPrefix() == 'c') {
var $propagate_status = confirm('<inp2:m_Phrase name="la_msg_PropagateCategoryStatus" escape="1"/>');
$form_name = $Catalog.queryTabRegistry('prefix', 'c', 'tab_id') + '_form';
Application.SetVar('propagate_category_status', $propagate_status ? 1 : 0);
}
}
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton(
new ToolBarButton(
'cut',
'<inp2:m_phrase label="la_ToolTip_Cut" escape="1"/>',
function() {
$Catalog.submit_event(null, 'OnCut');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'copy',
'<inp2:m_phrase label="la_ToolTip_Copy" escape="1"/>',
function() {
$Catalog.submit_event(null, 'OnCopy');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'paste',
'<inp2:m_phrase label="la_ToolTip_Paste" escape="1"/>',
function() {
submit_event('c', 'OnPasteClipboard', 'catalog/catalog');
/*$Catalog.submit_event(
'c', 'OnPasteClipboard', null,
function($object) {
$object.resetTabs(true);
$object.switchTab();
}
);*/
}
)
);
/*a_toolbar.AddButton( new ToolBarButton('clear_clipboard', '<inp2:m_phrase label="la_ToolTip_ClearClipboard" escape="1"/>', function() {
if (confirm('<inp2:m_phrase name="la_text_ClearClipboardWarning" js_escape="1"/>')) {
$Catalog.submit_event('c', 'OnClearClipboard', null, function($object) {
$GridManager.CheckDependencies($object.ActivePrefix);
} );
}
}
) );*/
a_toolbar.AddButton( new ToolBarSeparator('sep5') );
a_toolbar.AddButton(
new ToolBarButton(
'move_up',
'<inp2:m_phrase label="la_ToolTip_Move_Up" escape="1"/>::<inp2:m_phrase label="la_ToolTipShort_Move_Up" escape="1"/>',
function() {
$Catalog.submit_event(null, 'OnMassMoveUp');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'move_down',
'<inp2:m_phrase label="la_ToolTip_Move_Down" escape="1"/>::<inp2:m_phrase label="la_ToolTipShort_Move_Down" escape="1"/>',
function() {
$Catalog.submit_event(null, 'OnMassMoveDown');
}
)
);
a_toolbar.AddButton( new ToolBarSeparator('sep6') );
a_toolbar.AddButton(
new ToolBarButton(
'rebuild_cache',
'<inp2:m_Phrase label="la_ToolTip_Tools" escape="1"/>',
function() {
var $menu = menuMgr.createMenu(rs('tools_menu'));
$menu.applyBorder(false, false, false, false);
$menu.dropShadow('none');
$menu.showIcon = true;
$menu.addItem(rs('editcat'), '<inp2:m_Phrase name="la_ToolTip_Edit_Current_Category" js_escape="1"/>', 'javascript:executeButton("editcat");');
$menu.addItem(rs('export'), '<inp2:m_Phrase name="la_ToolTip_Export" js_escape="1"/>', 'javascript:executeButton("export");');
$menu.addItem(rs('rebuild_cache'), '<inp2:m_Phrase name="la_ToolTip_RebuildCategoryCache" js_escape="1"/>', 'javascript:executeButton("rebuild_cache");');
renderMenus();
nls_showMenu(rs('tools_menu'), a_toolbar.GetButtonImage('rebuild_cache'));
}
)
);
function executeButton($button_name) {
switch ($button_name) {
case 'editcat':
var $edit_url = '<inp2:m_t t="#TEMPLATE#" m_opener="d" c_mode="t" c_event="OnEdit" c_id="#CATEGORY_ID#" pass="all,c" no_amp="1"/>';
var $category_id = get_hidden_field('m_cat_id');
var $redirect_url = $edit_url.replace('#CATEGORY_ID#', $category_id);
$redirect_url = $redirect_url.replace('#TEMPLATE#', $category_id > 0 ? 'categories/categories_edit' : 'categories/categories_edit_permissions');
- redirect($redirect_url);
+ direct_edit('c', $redirect_url);
break;
case 'export':
- var $export_prefixes = new Array('l', 'p', 'n');
- if (in_array($Catalog.ActivePrefix, $export_prefixes)) {
+ var $export_templates = <inp2:c_PrintCatalogExportTemplates prefixes="l,n,p"/>;
+
+ if ($export_templates[$Catalog.ActivePrefix] != undefined) {
$Catalog.storeIDs('export_categories');
- submit_event($Catalog.ActivePrefix, 'OnExport');
+
+ open_popup($Catalog.ActivePrefix, 'OnExport', $export_templates[$Catalog.ActivePrefix]);
}
else {
alert('<inp2:m_phrase name="la_Text_InDevelopment" escape="1"/>');
}
break;
case 'rebuild_cache':
- redirect('<inp2:m_t t="categories/cache_updater" pass="m"/>');
+ openSelector('c', '<inp2:m_t t="categories/cache_updater" pass="m"/>');
break;
}
}
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() {
var $current_prefix = $Catalog.getCurrentPrefix();
$form_name = $Catalog.queryTabRegistry('prefix', $current_prefix, 'tab_id') + '_form';
std_edit_item($current_prefix, $Catalog.queryTabRegistry('prefix', $current_prefix, 'edit_template'));
}
</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_ModuleInclude template="catalog_tab" tab_init="2"/>
<script type="text/javascript">
var $menu_frame = getFrame('menu');
if (typeof $menu_frame.ShowStructure != 'undefined') {
<inp2:m_DefineElement name="structure_node"><inp2:m_param name="section_url"/></inp2:m_DefineElement>
$menu_frame.ShowStructure('<inp2:adm_PrintSection escape="1" render_as="structure_node" section_name="in-portal:browse"/>', true);
}
Application.setHook(
'm:OnAfterWindowLoad',
function() {
$Catalog.Init();
getFrame('head').$('#extra_toolbar').html('<inp2:m_RenderElement name="extra_toolbar" js_escape="1"/>');
}
);
</script>
<inp2:m_include t="incs/footer" noform="yes"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/catalog/catalog.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.31.2.20
\ No newline at end of property
+1.31.2.21
\ No newline at end of property
Index: branches/RC/core/admin_templates/catalog/catalog_counters.tpl
===================================================================
--- branches/RC/core/admin_templates/catalog/catalog_counters.tpl (revision 11537)
+++ branches/RC/core/admin_templates/catalog/catalog_counters.tpl (revision 11538)
@@ -1,29 +1,29 @@
// counters
<inp2:m_ModuleInclude template="catalog_tab" tab_init="3"/>
// category related statistics
$Catalog.ParentCategoryID = <inp2:c_GetParentCategory/>;
set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
<inp2:m_DefineElement name="category_caption">
- <inp2:m_if check="m_ParamEquals" name="cat_id" value="0" inverse="inverse">
+ <inp2:m_ifnot check="c_HomeCategory" equals_to="$cat_id">
<inp2:m_param name="separator"/>
- </inp2:m_if>
+ </inp2:m_ifnot>
<inp2:m_if check="m_ParamEquals" name="current" value="1" inverse="1">
<a class="control_link" href="javascript:$Catalog.go_to_cat(<inp2:m_param name="cat_id"/>);"><inp2:m_param name="cat_name"/></a>
<inp2:m_else/>
<inp2:m_param name="cat_name"/>
</inp2:m_if>
</inp2:m_DefineElement>
setInnerHTML('category_path', '<inp2:c_CategoryPath separator=" / " render_as="category_caption" js_escape="1"/>');
<inp2:c_UpdateLastTemplate template="catalog/catalog"/>
var $menu_frame = getFrame('menu');
<inp2:m_if check="m_Recall" var="RefreshStructureTree">
<inp2:m_DefineElement name="structure_node"><inp2:m_param name="section_url"/></inp2:m_DefineElement>
$menu_frame.ReloadFolder('<inp2:adm_PrintSection escape="1" render_as="structure_node" section_name="in-portal:browse"/>', true);
<inp2:m_RemoveVar var="RefreshStructureTree"/>
</inp2:m_if>
$menu_frame.SyncActive('<inp2:m_t pass="m" m_opener="r"/>');
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/catalog/catalog_counters.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/catalog/advanced_view.tpl
===================================================================
--- branches/RC/core/admin_templates/catalog/advanced_view.tpl (revision 11537)
+++ branches/RC/core/admin_templates/catalog/advanced_view.tpl (revision 11538)
@@ -1,115 +1,119 @@
<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/catalog_tabs" special=".showall" 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"/>"/>
<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/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();
}
var $Catalog = new Catalog('<inp2:m_Link template="#TEMPLATE_NAME#" pass_through="ts,td" ts="showall" td="no" m_cat_id="#CATEGORY_ID#" no_amp="1"/>', 'advanced_view_', 0);
var a_toolbar = new ToolBar();
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 + '.showall]', 1);
std_delete_items($Catalog.ActivePrefix, $template, 1);
} ) );
<inp2:m_ModuleInclude template="catalog_buttons" main_template="advanced_view"/>
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';
set_hidden_field('remove_specials[' + $Catalog.ActivePrefix + '.showall]', 1);
$Catalog.submit_event($Catalog.ActivePrefix, 'OnMassApprove');
}
) );
a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';
set_hidden_field('remove_specials[' + $Catalog.ActivePrefix + '.showall]', 1);
$Catalog.submit_event($Catalog.ActivePrefix, 'OnMassDecline');
}
) );
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()
{
$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;
+ std_edit_item(
+ $Catalog.ActivePrefix, $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'edit_template'),
+ function() {
+ $kf.action = $prev_action;
+ }
+ );
}
</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_set ts="showall" td="no"/>
<inp2:m_ModuleInclude template="catalog_tab" tab_init="2"/>
<script type="text/javascript">
var $menu_frame = getFrame('menu');
if (typeof $menu_frame.ShowStructure != 'undefined') {
<inp2:m_DefineElement name="structure_node"><inp2:m_param name="section_url"/></inp2:m_DefineElement>
$menu_frame.ShowStructure('<inp2:adm_PrintSection escape="1" render_as="structure_node" section_name="in-portal:browse"/>', false);
}
Application.setHook(
'm:OnAfterWindowLoad',
function() {
$Catalog.Init();
<inp2:m_if check="m_get" var="SetTab">
$Catalog.switchTab('<inp2:m_get var="SetTab"/>.showall');
</inp2:m_if>
getFrame('head').$('#extra_toolbar').html('<inp2:m_RenderElement name="extra_toolbar" js_escape="1"/>');
}
);
</script>
<inp2:m_include t="incs/footer" noform="yes"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/catalog/advanced_view.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6.2.5
\ No newline at end of property
+1.6.2.6
\ No newline at end of property
Index: branches/RC/core/admin_templates/catalog/item_selector/item_selector_toolbar.tpl
===================================================================
--- branches/RC/core/admin_templates/catalog/item_selector/item_selector_toolbar.tpl (revision 11537)
+++ branches/RC/core/admin_templates/catalog/item_selector/item_selector_toolbar.tpl (revision 11538)
@@ -1,68 +1,68 @@
<script type="text/javascript" src="js/ajax.js"></script>
<link rel="stylesheet" rev="stylesheet" href="incs/nlsmenu.css" type="text/css" />
<script type="text/javascript" src="js/nlsmenu.js"></script>
<script type="text/javascript" src="js/nlsmenueffect_1_2_1.js"></script>
<script type="text/javascript" src="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"/>';
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
<inp2:m_if check="m_ParamEquals" name="is_catalog" value="1">
active_selected = '';
if (Grids[$Catalog.ActivePrefix]) {
active_selected = Grids[$Catalog.ActivePrefix].GetSelected();
set_hidden_field('selected_ids[' + $Catalog.ActivePrefix + ']', active_selected);
}
if (active_selected.length == 0) {
var $category_ids = Grids['c'].GetSelected();
if ($category_ids.length == 0) {
// no categories selected, then use current category
$category_ids = get_hidden_field('m_cat_id');
}
set_hidden_field('selected_ids[c]', $category_ids);
}
<inp2:m_else/>
var $prefix = $Catalog.ActivePrefix.replace('.<inp2:m_get name="ts"/>', '');
set_hidden_field('selected_ids[' + $prefix + ']', Grids[$Catalog.ActivePrefix].GetSelected());
</inp2:m_if>
submit_event('<inp2:m_Recall name="main_prefix"/>', 'OnProcessSelected');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
window_close();
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
<inp2:m_if check="m_ParamEquals" name="is_catalog" value="1">
a_toolbar.AddButton( new ToolBarButton('upcat', '<inp2:m_phrase label="la_ToolTip_Up" escape="1"/>', function() {
$Catalog.go_to_cat($Catalog.ParentCategoryID);
}
) );
a_toolbar.AddButton( new ToolBarButton('homecat', '<inp2:m_phrase label="la_ToolTip_Home" escape="1"/>', function() {
- $Catalog.go_to_cat(<inp2:m_ModuleInfo key="Name" value="Proj-CMS" return="RootCat"/>);
+ $Catalog.go_to_cat(<inp2:c_HomeCategory/>);
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
</inp2:m_if>
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar, 'view');
}
) );
a_toolbar.Render();
function edit()
{
}
</script>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/catalog/item_selector/item_selector_toolbar.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/emails/send_complete.tpl
===================================================================
--- branches/RC/core/admin_templates/emails/send_complete.tpl (revision 11537)
+++ branches/RC/core/admin_templates/emails/send_complete.tpl (revision 11538)
@@ -1,27 +1,28 @@
-<inp2:m_include t="incs/header" nobody="yes"/>
-
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:adm_SetPopupSize width="900" height="600"/>
+<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" permission_type="advanced:send_email" prefix="emailevents" title_preset="email_send_complete"/>
<script type="text/javascript">
function close_window() {
var $opener = getWindowOpener(window);
if ($opener) {
$opener.location.reload();
}
window_close();
}
</script>
-<table class="edit-form">
- <inp2:m_RenderElement name="subsection" title="la_prompt_EmailCompleteMessage"/>
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
- <td colspan="3" align="center">
- <input type="button" value="<inp2:m_phrase name="la_Close"/>" class="button" onclick="close_window();"/>
- </td>
- </tr>
-</table>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" title="la_prompt_EmailCompleteMessage"/>
+ <tr class="<inp2:m_odd_even odd="edit-form-odd" even="edit-form-even"/>">
+ <td colspan="3" align="center">
+ <input type="button" value="<inp2:m_phrase name="la_Close"/>" class="button" onclick="close_window();"/>
+ </td>
+ </tr>
+ </table>
+</div>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/emails/send_complete.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3.2.2
\ No newline at end of property
+1.3.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/emails/prepare_queue.tpl
===================================================================
--- branches/RC/core/admin_templates/emails/prepare_queue.tpl (revision 11537)
+++ branches/RC/core/admin_templates/emails/prepare_queue.tpl (revision 11538)
@@ -1,17 +1,15 @@
-<inp2:m_include t="incs/header" nobody="yes"/>
-
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:adm_SetPopupSize width="900" height="600"/>
+<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" permission_type="advanced:send_email" prefix="emailevents" title_preset="email_prepare"/>
- <script type="text/javascript" src="js/ajax.js"></script>
<inp2:m_RenderElement name="ajax_progress_bar" cancel_action="cancel_action();"/>
<script type="text/javascript">
function cancel_action() {
redirect('<inp2:m_Link template="emails/send_complete"/>');
}
$QueueProcessor = new AjaxProgressBar('<inp2:m_t template="index" emailmessages_event="OnPrepareEmailQueue" finish_template="emails/send_queue" pass="m,emailmessages" no_amp="1"/>');
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/emails/prepare_queue.tpl
___________________________________________________________________
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/admin_templates/emails/mass_mail.tpl
===================================================================
--- branches/RC/core/admin_templates/emails/mass_mail.tpl (revision 11537)
+++ branches/RC/core/admin_templates/emails/mass_mail.tpl (revision 11538)
@@ -1,61 +1,64 @@
<inp2:adm_SetPopupSize width="900" height="600"/>
-<inp2:m_include t="incs/header" nobody="yes"/>
-
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" permission_type="advanced:send_email" prefix="emailevents" title_preset="email_send_form"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_SendEmail" escape="1"/>', function() {
submit_event('emailmessages', 'OnMassMail');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('emailmessages', 'OnGoBack');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:emailmessages_SaveWarning name="grid_save_warning"/>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <inp2:m_RenderElement name="subsection" title="la_section_General"/>
+<inp2:emailmessages_ErrorWarning name="form_error_warning"/>
- <!-- recipients list -->
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
- <inp2:m_inc param="tab_index" by="1"/>
- <td class="text">
- <inp2:m_phrase label="la_fld_To"/>:
- </td>
- <td valign="top" colspan="2">
- <inp2:m_DefineElement name="recipient_element">
- &lt;<inp2:m_Param name="recipient_name"/>&gt;
- <inp2:m_if check="m_Param" name="not_last">
- ;
- </inp2:m_if>
- </inp2:m_DefineElement>
-
- <inp2:emailmessages_PrintRecipients render_as="recipient_element" strip_nl="2"/>
- </td>
- </tr>
- <!-- // recipients list -->
-
- <inp2:m_RenderElement name="inp_edit_box" prefix="emailmessages" field="MassSubject" title="la_fld_Subject" size="60"/>
- <inp2:m_RenderElement name="inp_edit_upload" prefix="emailmessages" field="MassAttachment" title="la_fld_Attachment" size="60"/>
- <inp2:m_RenderElement name="subsection" title="la_section_Message"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="emailmessages" field="MassHtmlMessage" title="la_fld_HtmlVersion" rows="10" cols="100"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="emailmessages" field="MassTextMessage" allow_html="0" title="la_fld_TextVersion" rows="10" cols="100"/>
-</table>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" title="la_section_General"/>
+
+ <!-- recipients list -->
+ <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 label="la_fld_To"/>:
+ </td>
+ <td class="control-mid">&nbsp;</td>
+ <td class="control-cell">
+ <inp2:m_DefineElement name="recipient_element">
+ &lt;<inp2:m_Param name="recipient_name"/>&gt;
+ <inp2:m_if check="m_Param" name="not_last">
+ ;
+ </inp2:m_if>
+ </inp2:m_DefineElement>
+
+ <inp2:emailmessages_PrintRecipients render_as="recipient_element" strip_nl="2"/>
+ </td>
+ </tr>
+ <!-- // recipients list -->
+
+ <inp2:m_RenderElement name="inp_edit_box" prefix="emailmessages" field="MassSubject" title="la_fld_Subject" size="60"/>
+ <inp2:m_RenderElement name="inp_edit_upload" prefix="emailmessages" field="MassAttachment" title="la_fld_Attachment" size="60"/>
+ <inp2:m_RenderElement name="subsection" title="la_section_Message"/>
+ <inp2:m_RenderElement name="inp_edit_textarea" prefix="emailmessages" field="MassHtmlMessage" title="la_fld_HtmlVersion" rows="10" cols="100"/>
+ <inp2:m_RenderElement name="inp_edit_textarea" prefix="emailmessages" field="MassTextMessage" allow_html="0" title="la_fld_TextVersion" rows="10" cols="100"/>
+ </table>
+</div>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/emails/mass_mail.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/emails/send_queue.tpl
===================================================================
--- branches/RC/core/admin_templates/emails/send_queue.tpl (revision 11537)
+++ branches/RC/core/admin_templates/emails/send_queue.tpl (revision 11538)
@@ -1,17 +1,15 @@
-<inp2:m_include t="incs/header" nobody="yes"/>
-
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:adm_SetPopupSize width="900" height="600"/>
+<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" permission_type="advanced:send_email" prefix="emailevents" title_preset="email_send"/>
- <script type="text/javascript" src="js/ajax.js"></script>
- <inp2:m_RenderElement name="ajax_progress_bar" cancel_action="cancel_action();"/>
- <script type="text/javascript">
- function cancel_action() {
- redirect('<inp2:m_Link template="emails/send_complete"/>');
- }
+<inp2:m_RenderElement name="ajax_progress_bar" cancel_action="cancel_action();"/>
+<script type="text/javascript">
+ function cancel_action() {
+ redirect('<inp2:m_Link template="emails/send_complete"/>');
+ }
- $QueueProcessor = new AjaxProgressBar('<inp2:m_t template="index" emailevents_event="OnProcessEmailQueue" type="return_progress" finish_template="emails/send_complete" pass="m,emailevents" no_amp="1"/>');
- </script>
+ $QueueProcessor = new AjaxProgressBar('<inp2:m_t template="index" emailevents_event="OnProcessEmailQueue" type="return_progress" finish_template="emails/send_complete" pass="m,emailevents" no_amp="1"/>');
+</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/emails/send_queue.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.2.8.1
\ No newline at end of property
Index: branches/RC/core/admin_templates/stylesheets/stylesheets_tabs.tpl
===================================================================
--- branches/RC/core/admin_templates/stylesheets/stylesheets_tabs.tpl (revision 11537)
+++ branches/RC/core/admin_templates/stylesheets/stylesheets_tabs.tpl (nonexistent)
@@ -1,13 +0,0 @@
-<table cellpadding="0" cellspacing="0" border="0" width="100%">
-<tr>
- <td align="right" width="100%">
- <table cellpadding="0" cellspacing="0" border="0" height="23">
- <tr>
- <inp2:m_RenderElement name="tab" title="la_tab_General" t="stylesheets/stylesheets_edit" main_prefix="css"/>
- <inp2:m_RenderElement name="tab" title="la_tab_BlockStyles" t="stylesheets/stylesheets_edit_block" main_prefix="css"/>
- <inp2:m_RenderElement name="tab" title="la_tab_BaseStyles" t="stylesheets/stylesheets_edit_base" main_prefix="css"/>
- </tr>
- </table>
- </td>
-</tr>
-</table>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/stylesheets/stylesheets_tabs.tpl
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5.2.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: branches/RC/core/admin_templates/stylesheets/stylesheets_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/stylesheets/stylesheets_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/stylesheets/stylesheets_edit.tpl (revision 11538)
@@ -1,72 +1,69 @@
<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_include t="stylesheets/stylesheets_tabs"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="css" title_preset="stylesheets_edit" module="in-portal" icon="icon46_style"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:configure_styles" prefix="css" title_preset="stylesheets_edit" 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.Render();
<inp2:m_if check="css_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<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>
</tr>
</tbody>
</table>
<inp2:css_SaveWarning name="grid_save_warning"/>
+<inp2:css_ErrorWarning name="form_error_warning"/>
+
<div id="scroll_container">
- <table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <table class="edit-form">
<inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
<inp2:m_RenderElement name="inp_id_label" prefix="css" field="StylesheetId" title="!la_fld_StylesheetId!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="css" field="Name" title="!la_fld_Name!" size="40"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="css" field="Description" title="!la_fld_Description!" rows="10" cols="40"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="css" field="AdvancedCSS" title="!la_fld_AdvancedCSS!" rows="10" cols="40"/>
+ <inp2:m_RenderElement name="inp_edit_textarea" prefix="css" field="Description" title="!la_fld_Description!" control_options="{min_height: 100}" rows="10" cols="40"/>
+ <inp2:m_RenderElement name="inp_edit_textarea" prefix="css" field="AdvancedCSS" title="!la_fld_AdvancedCSS!" control_options="{min_height: 100}" rows="10" cols="40"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="css" field="Enabled" title="!la_fld_Enabled!"/>
+ <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/stylesheets/stylesheets_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.8.2.3
\ No newline at end of property
+1.8.2.4
\ No newline at end of property
Index: branches/RC/core/admin_templates/stylesheets/style_editor.tpl
===================================================================
--- branches/RC/core/admin_templates/stylesheets/style_editor.tpl (revision 11537)
+++ branches/RC/core/admin_templates/stylesheets/style_editor.tpl (revision 11538)
@@ -1,147 +1,152 @@
<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="blue_bar" prefix="css" title_preset="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="style_edit"/>
<script src="js/colorselector.js" type="text/javascript"></script>
<style type="text/css">
.ColorBox
{
font-size: 1px;
border: #808080 1px solid;
width: 10px;
position: static;
height: 10px;
}
</style>
<!-- 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','OnSaveStyle');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
window_close();
}
) );
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();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_DefineElement name="inp_edit_color">
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
+ <tr class="<inp2:m_odd_even odd="edit-form-odd" even="edit-form-even"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title_phrase="$title_phrase" title="$title" is_last="$is_last"/>
- <td>
+ <td class="control-cell">
<input type="text"
name="<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>"
id="<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>"
value="<inp2:{$prefix}_Field field="$field" subfield="$subfield"/>"
tabindex="<inp2:m_get param="tab_index"/>"
size="<inp2:m_param name="size"/>"
maxlength="<inp2:m_param name="maxlength"/>"
class="<inp2:m_param name="class"/>"
onkeyup="updateColor(event,'<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>')"
onblur="<inp2:m_Param name="onblur"/>">
<div id="color_<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>" style="display: inline; border: 1px solid #000000;" onclick="openColorSelector(event,'<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
<script language="javascript">
updateColor(null,'<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>');
</script>
</td>
- <td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
+ <inp2:m_RenderElement name="inp_edit_error" pass_params="1"/>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_options_style">
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
+ <tr class="<inp2:m_odd_even odd="edit-form-odd" even="edit-form-even"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title_phrase="$title_phrase" title="$title" is_last="$is_last"/>
- <td>
+ <td class="control-cell">
<select tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>" id="<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>" onchange="<inp2:m_Param name="onchange"/>">
<inp2:{$prefix}_PredefinedOptions field="$field" value_field="$value_field" subfield="$subfield" block="inp_option_item" selected="selected"/>
</select>
</td>
- <td class="error"><inp2:{$prefix}_Error field="$field"/>&nbsp;</td>
+ <inp2:m_RenderElement name="inp_edit_error" pass_params="1"/>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="subsection_collapse">
- <tr class="subsectiontitle">
- <td colspan="5"><inp2:m_phrase label="$title"/></td>
- </tr>
+ <tr class="subsectiontitle">
+ <td colspan="5"><inp2:m_phrase label="$title"/></td>
+ </tr>
</inp2:m_DefineElement>
<inp2:selectors_SaveWarning name="grid_save_warning"/>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <inp2:m_RenderElement name="subsection_collapse" title="!la_Font!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="font" title="!la_fld_Font!" size="50"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="font-family" title="!la_fld_FontFamily!" size="40"/>
- <inp2:m_RenderElement name="inp_edit_color" prefix="selectors" field="SelectorData" subfield="color" title="!la_fld_FontColor!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="font-size" title="!la_fld_FontSize!"/>
- <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="font-style" value_field="FontStyle" title="!la_fld_FontStyle!"/>
- <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="font-weight" value_field="FontWeight" title="!la_fld_FontWeight!"/>
- <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="text-align" value_field="TextAlign" title="!la_fld_TextAlign!"/>
- <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="text-decoration" value_field="TextDecoration" title="!la_fld_TextDecoration!"/>
- <inp2:m_RenderElement name="subsection_collapse" title="!la_Background!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background" title="!la_fld_Background!" size="50"/>
- <inp2:m_RenderElement name="inp_edit_color" prefix="selectors" field="SelectorData" subfield="background-color" title="!la_fld_BackgroundColor!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background-image" title="!la_fld_BackgroundImage!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background-repeat" title="!la_fld_BackgroundRepeat!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background-attachment" title="!la_fld_BackgroundAttachment!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background-position" title="!la_fld_BackgroundPosition!"/>
- <inp2:m_RenderElement name="subsection_collapse" title="!la_Borders!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border" title="!la_fld_Borders!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border-top" title="!la_fld_BorderTop!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border-right" title="!la_fld_BorderRight!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border-bottom" title="!la_fld_BorderBottom!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border-left" title="!la_fld_BorderLeft!"/>
- <inp2:m_RenderElement name="subsection_collapse" title="!la_Paddings!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding" title="!la_fld_Paddings!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding-top" title="!la_fld_PaddingTop!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding-right" title="!la_fld_PaddingRight!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding-bottom" title="!la_fld_PaddingBottom!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding-left" title="!la_fld_PaddingLeft!"/>
- <inp2:m_RenderElement name="subsection_collapse" title="!la_Margins!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin" title="!la_fld_Margins!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-top" title="!la_fld_MarginTop!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-right" title="!la_fld_MarginRight!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-bottom" title="!la_fld_MarginBottom!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-left" title="!la_fld_MarginLeft!"/>
- <inp2:m_RenderElement name="subsection_collapse" title="!la_PositionAndVisibility!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="width" title="!la_fld_Width!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="height" title="!la_fld_Height!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="left" title="!la_fld_Left!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="top" title="!la_fld_Top!"/>
- <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="position" value_field="StylePosition" title="!la_fld_Position!"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="z-index" title="!la_fld_Z-Index!"/>
- <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="display" value_field="StyleDisplay" title="!la_fld_Display!"/>
- <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="visibility" value_field="StyleVisibility" title="!la_fld_Visibility!"/>
- <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="cursor" value_field="StyleCursor" title="!la_fld_Cursor!"/>
-</table>
-
+<inp2:selectors_ErrorWarning name="form_error_warning"/>
-<script language="javascript" type="text/javascript">
- InitColorSelector();
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection_collapse" title="!la_Font!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="font" title="!la_fld_Font!" size="50"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="font-family" title="!la_fld_FontFamily!" size="40"/>
+ <inp2:m_RenderElement name="inp_edit_color" prefix="selectors" field="SelectorData" subfield="color" title="!la_fld_FontColor!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="font-size" title="!la_fld_FontSize!"/>
+ <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="font-style" value_field="FontStyle" title="!la_fld_FontStyle!"/>
+ <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="font-weight" value_field="FontWeight" title="!la_fld_FontWeight!"/>
+ <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="text-align" value_field="TextAlign" title="!la_fld_TextAlign!"/>
+ <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="text-decoration" value_field="TextDecoration" title="!la_fld_TextDecoration!"/>
+ <inp2:m_RenderElement name="subsection_collapse" title="!la_Background!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background" title="!la_fld_Background!" size="50"/>
+ <inp2:m_RenderElement name="inp_edit_color" prefix="selectors" field="SelectorData" subfield="background-color" title="!la_fld_BackgroundColor!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background-image" title="!la_fld_BackgroundImage!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background-repeat" title="!la_fld_BackgroundRepeat!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background-attachment" title="!la_fld_BackgroundAttachment!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background-position" title="!la_fld_BackgroundPosition!"/>
+ <inp2:m_RenderElement name="subsection_collapse" title="!la_Borders!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border" title="!la_fld_Borders!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border-top" title="!la_fld_BorderTop!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border-right" title="!la_fld_BorderRight!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border-bottom" title="!la_fld_BorderBottom!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border-left" title="!la_fld_BorderLeft!"/>
+ <inp2:m_RenderElement name="subsection_collapse" title="!la_Paddings!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding" title="!la_fld_Paddings!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding-top" title="!la_fld_PaddingTop!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding-right" title="!la_fld_PaddingRight!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding-bottom" title="!la_fld_PaddingBottom!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding-left" title="!la_fld_PaddingLeft!"/>
+ <inp2:m_RenderElement name="subsection_collapse" title="!la_Margins!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin" title="!la_fld_Margins!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-top" title="!la_fld_MarginTop!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-right" title="!la_fld_MarginRight!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-bottom" title="!la_fld_MarginBottom!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-left" title="!la_fld_MarginLeft!"/>
+ <inp2:m_RenderElement name="subsection_collapse" title="!la_PositionAndVisibility!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="width" title="!la_fld_Width!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="height" title="!la_fld_Height!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="left" title="!la_fld_Left!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="top" title="!la_fld_Top!"/>
+ <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="position" value_field="StylePosition" title="!la_fld_Position!"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="z-index" title="!la_fld_Z-Index!"/>
+ <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="display" value_field="StyleDisplay" title="!la_fld_Display!"/>
+ <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="visibility" value_field="StyleVisibility" title="!la_fld_Visibility!"/>
+ <inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="cursor" value_field="StyleCursor" title="!la_fld_Cursor!"/>
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
+<script type="text/javascript">
+ $(document).ready(
+ function() {
+ InitColorSelector();
+ }
+ );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/stylesheets/style_editor.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.12.2.3
\ No newline at end of property
+1.12.2.4
\ No newline at end of property
Index: branches/RC/core/admin_templates/stylesheets/stylesheets_list.tpl
===================================================================
--- branches/RC/core/admin_templates/stylesheets/stylesheets_list.tpl (revision 11537)
+++ branches/RC/core/admin_templates/stylesheets/stylesheets_list.tpl (revision 11538)
@@ -1,66 +1,68 @@
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:configure_styles" prefix="css" module="core" title_preset="styles_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('css', 'stylesheets/stylesheets_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_style', '<inp2:m_phrase label="la_ToolTip_NewStylesheet" escape="1"/>',
function() {
std_precreate_item('css', 'stylesheets/stylesheets_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('css')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
submit_event('css','OnMassApprove');
}
) );
a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
submit_event('css','OnMassDecline');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('clone', '<inp2:m_phrase label="la_ToolTip_Clone" escape="1"/>', function() {
submit_event('css','OnMassClone');
}
) );
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="css" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="css" IdField="StylesheetId" grid="Default" menu_filters="yes"/>
<script type="text/javascript">
Grids['css'].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','clone') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/stylesheets/stylesheets_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.11.2.3
\ No newline at end of property
+1.11.2.4
\ 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 11537)
+++ branches/RC/core/admin_templates/stylesheets/stylesheets_edit_base.tpl (revision 11538)
@@ -1,104 +1,100 @@
<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_include t="stylesheets/stylesheets_tabs"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="css" title_preset="base_styles" module="in-portal" icon="icon46_style"/>
+<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: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"/>
<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.2
\ No newline at end of property
+1.9.2.3
\ 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 11537)
+++ branches/RC/core/admin_templates/stylesheets/stylesheets_edit_block.tpl (revision 11538)
@@ -1,112 +1,108 @@
<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_include t="stylesheets/stylesheets_tabs"/>
-
-<inp2:m_RenderElement name="blue_bar" prefix="css" title_preset="block_styles" module="in-portal" icon="icon46_style"/>
+<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: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"/>
<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.3
\ No newline at end of property
+1.10.2.4
\ No newline at end of property
Index: branches/RC/core/admin_templates/stylesheets/base_style_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/stylesheets/base_style_edit.tpl (revision 11537)
+++ branches/RC/core/admin_templates/stylesheets/base_style_edit.tpl (revision 11538)
@@ -1,106 +1,103 @@
<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="base_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="base_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.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"/>
-<div id="scroll_container">
-<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_edit_hidden" prefix="selectors" field="StylesheetId"/>
- <input type="hidden" name="<inp2:selectors_InputName field="Type"/>" value="1">
-
- <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_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="table-color1" even="table-color2"/>">
- <inp2:m_inc param="tab_index" by="1"/>
- <td class="text" valign="top">
- <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>
- <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>
- <td class="error">&nbsp;</td>
- </tr>
+<inp2:selectors_ErrorWarning name="form_error_warning"/>
-</table>
+<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="1">
+
+ <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_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/base_style_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.11.2.3
\ No newline at end of property
+1.11.2.4
\ 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 11537)
+++ branches/RC/core/admin_templates/stylesheets/block_style_edit.tpl (revision 11538)
@@ -1,116 +1,119 @@
<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"/>
<!-- 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"/>
-<div id="scroll_container">
-<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_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="table-color1" even="table-color2"/>">
- <inp2:m_inc param="tab_index" by="1"/>
- <td class="text" valign="top">
- <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>
- <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>
- <td class="error">&nbsp;</td>
- </tr>
+<inp2:selectors_ErrorWarning name="form_error_warning"/>
-</table>
+<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.3
\ No newline at end of property
+1.11.2.4
\ No newline at end of property
Index: branches/RC/core/admin_templates/user_selector.tpl
===================================================================
--- branches/RC/core/admin_templates/user_selector.tpl (revision 11537)
+++ branches/RC/core/admin_templates/user_selector.tpl (revision 11538)
@@ -1,45 +1,45 @@
-<inp2:m_include t="incs/header" nobody="yes"/>
-
-<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
-
-<inp2:m_RenderElement name="blue_bar" prefix="u" title_preset="users_select" module="in-portal" icon="icon46_users"/>
+<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');
}
</script>
-
</td>
+
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="u" grid="UserSelector"/>
</tr>
</tbody>
</table>
<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.2
\ No newline at end of property
+1.2.2.3
\ No newline at end of property

Event Timeline