Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1044272
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jun 25, 8:12 AM
Size
302 KB
Mime Type
text/x-diff
Expires
Fri, Jun 27, 8:12 AM (5 h, 33 m)
Engine
blob
Format
Raw Data
Handle
675432
Attached To
rINP In-Portal
in-portal
View Options
This file is larger than 256 KB, so syntax highlighting was skipped.
Index: trunk/core/kernel/constants.php
===================================================================
--- trunk/core/kernel/constants.php (revision 6655)
+++ trunk/core/kernel/constants.php (revision 6656)
@@ -1,38 +1,38 @@
<?php
// kDBList filtering
define('HAVING_FILTER', 1);
define('WHERE_FILTER', 2);
define('AGGREGATE_FILTER', 3);
-
+
define('FLT_TYPE_AND', 'AND');
define('FLT_TYPE_OR', 'OR');
// item statuses
safeDefine('STATUS_DISABLED', 0);
safeDefine('STATUS_ACTIVE', 1);
safeDefine('STATUS_PENDING', 2);
-
+
// sections
define('stTREE', 1);
define('stTAB', 2);
-
+
// event statuses
define('erSUCCESS', 0); // event finished working succsessfully
define('erFAIL', -1); // event finished working, but result is unsuccsessfull
define('erFATAL', -2); // event experienced FATAL error - no hooks should continue!
define('erPERM_FAIL', -3); // event failed on internal permission checking (user has not permission)
-
+
// permission types
define('ptCATEGORY', 0);
define('ptSYSTEM', 1);
-
+
$application =& kApplication::Instance();
- $spacer_url = $application->BaseURL().'kernel/admin_templates/img/spacer.gif';
+ $spacer_url = $application->BaseURL().'core/admin_templates/img/spacer.gif';
define('SPACER_URL', $spacer_url);
-
+
if (!$application->IsAdmin()) {
// don't show debugger buttons on front (if not overrided in "debug.php")
safeDefine('DBG_TOOLBAR_BUTTONS', 0);
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/constants.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/core/kernel/processors/main_processor.php
===================================================================
--- trunk/core/kernel/processors/main_processor.php (revision 6655)
+++ trunk/core/kernel/processors/main_processor.php (revision 6656)
@@ -1,930 +1,930 @@
<?php
class kMainTagProcessor extends TagProcessor {
function Init($prefix, $special, $event_params = null)
{
parent::Init($prefix, $special, $event_params);
$actions =& $this->Application->recallObject('kActions');
$actions->Set('t', $this->Application->GetVar('t'));
$actions->Set('sid', $this->Application->GetSID());
$actions->Set('m_opener', $this->Application->GetVar('m_opener') );
}
/**
* Used to handle calls where tag name
* match with existing php function name
*
* @param Tag $tag
* @return string
*/
function ProcessTag(&$tag)
{
if ($tag->Tag=='include') $tag->Tag='MyInclude';
return parent::ProcessTag($tag);
}
/**
* Base folder for all template includes
*
* @param Array $params
* @return string
*/
function TemplatesBase($params)
{
if ($this->Application->IsAdmin()) {
- $module = isset($params['module']) ? $params['module'] : 'kernel';
+ $module = isset($params['module']) ? $params['module'] : 'core';
$path = preg_replace('/\/(.*?)\/(.*)/', $module.'/\\2', THEMES_PATH); // remove leading slash + substitute module
}
else {
$path = substr(THEMES_PATH, 1);
}
return $this->Application->BaseURL().$path;
}
/**
* Creates <base href ..> HTML tag for all templates
* affects future css, js files and href params of links
*
* @return string
* @access public
*/
function Base_Ref($params)
{
return '<base href="'.$this->TemplatesBase($params).'/" />';
}
/**
* Returns base url for web-site
*
* @return string
* @access public
*/
function BaseURL()
{
return $this->Application->BaseURL();
}
function ProjectBase($params)
{
return $this->Application->BaseURL();
}
/*function Base($params)
{
return $this->Application->BaseURL().$params['add'];
}*/
/**
* Used to create link to any template.
* use "pass" paramter if "t" tag to specify
* prefix & special of object to be represented
* in resulting url
*
* @param Array $params
* @return string
* @access public
*/
function T($params)
{
//by default link to current template
$t = $this->SelectParam($params, 't,template');
unset($params['t']);
unset($params['template']);
$prefix=isset($params['prefix']) ? $params['prefix'] : ''; unset($params['prefix']);
$index_file = isset($params['index_file']) ? $params['index_file'] : null; unset($params['index_file']);
return $this->Application->HREF($t, $prefix, $params, $index_file);
}
function Link($params)
{
if (isset($params['template'])) {
$params['t'] = $params['template'];
unset($params['template']);
}
if (!isset($params['pass']) && !isset($params['no_pass'])) $params['pass'] = 'm';
if (isset($params['no_pass'])) unset($params['no_pass']);
if( $this->Application->GetVar('admin') ) $params['admin'] = 1;
return $this->T($params);
}
function Env($params)
{
$t = $params['template'];
unset($params['template']);
return $this->Application->BuildEnv($t, $params, 'm', null, false);
}
function FormAction($params)
{
return $this->Application->ProcessParsedTag('m', 't', array_merge($params, Array('pass'=>'all,m', 'pass_category' => 1 )) );
}
/*// NEEDS TEST
function Config($params)
{
return $this->Application->ConfigOption($params['var']);
}
function Object($params)
{
$name = $params['name'];
$method = $params['method'];
$tmp =& $this->Application->recallObject($name);
if ($tmp != null) {
if (method_exists($tmp, $method))
return $tmp->$method($params);
else
echo "Method $method does not exist in object ".get_class($tmp)." named $name<br>";
}
else
echo "Object $name does not exist in the appliaction<br>";
}*/
/**
* Tag, that always returns true.
* For parser testing purposes
*
* @param Array $params
* @return bool
* @access public
*/
function True($params)
{
return true;
}
/**
* Tag, that always returns false.
* For parser testing purposes
*
* @param Array $params
* @return bool
* @access public
*/
function False($params)
{
return false;
}
/**
* Returns block parameter by name
*
* @param Array $params
* @return stirng
* @access public
*/
function Param($params)
{
//$parser =& $this->Application->recallObject('TemplateParser');
$res = $this->Application->Parser->GetParam($params['name']);
if ($res === false) $res = '';
if (isset($params['plus']))
$res += $params['plus'];
return $res;
}
function DefaultParam($params)
{
foreach ($params as $key => $val) {
if ($this->Application->Parser->GetParam($key) === false) {
$this->Application->Parser->SetParam($key, $val);
}
}
}
/**
* Gets value of specified field from specified prefix_special and set it as parser param
*
* @param Array $params
*/
/*function SetParam($params)
{
// <inp2:m_SetParam param="custom_name" src="cf:FieldName"/>
list($prefix_special, $field_name) = explode(':', $params['src']);
$object =& $this->Application->recallObject($prefix_special);
$name = $this->SelectParam($params, 'param,name,var');
$this->Application->Parser->SetParam($name, $object->GetField($field_name) );
}*/
/**
* Compares block parameter with value specified
*
* @param Array $params
* @return bool
* @access public
*/
function ParamEquals($params)
{
//$parser =& $this->Application->recallObject('TemplateParser');
$name = $this->SelectParam($params, 'name,var,param');
$value = $params['value'];
return ($this->Application->Parser->GetParam($name) == $value);
}
/*function PHP_Self($params)
{
return $HTTP_SERVER_VARS['PHP_SELF'];
}
*/
/**
* Returns session variable value by name
*
* @param Array $params
* @return string
* @access public
*/
function Recall($params)
{
$ret = $this->Application->RecallVar( $this->SelectParam($params,'name,var,param') );
$ret = ($ret === false && isset($params['no_null'])) ? '' : $ret;
if( getArrayValue($params,'special') || getArrayValue($params,'htmlchars')) $ret = htmlspecialchars($ret);
if ( getArrayValue($params, 'urlencode') ) $ret = urlencode($ret);
return $ret;
}
// bad style to store something from template to session !!! (by Alex)
// Used here only to test how session works, nothing more
function Store($params)
{
//echo"Store $params[name]<br>";
$name = $params['name'];
$value = $params['value'];
$this->Application->StoreVar($name,$value);
}
/**
* Sets application variable value(-s)
*
* @param Array $params
* @access public
*/
function Set($params)
{
foreach ($params as $param => $value) {
$this->Application->SetVar($param, $value);
}
}
/**
* Increment application variable
* specified by number specified
*
* @param Array $params
* @access public
*/
function Inc($params)
{
$this->Application->SetVar($params['param'], $this->Application->GetVar($params['param']) + $params['by']);
}
/**
* Retrieves application variable
* value by name
*
* @param Array $params
* @return string
* @access public
*/
function Get($params)
{
$ret = $this->Application->GetVar($this->SelectParam($params, 'name,var,param'), '');
return getArrayValue($params, 'htmlchars') ? htmlspecialchars($ret) : $ret;
}
/**
* Retrieves application constant
* value by name
*
* @param Array $params
* @return string
* @access public
*/
function GetConst($params)
{
return defined($this->SelectParam($params, 'name,const')) ? constant($this->SelectParam($params, 'name,const,param')) : '';
}
/**
* Retrieves configuration variable value by name
*
* @param Array $params
* @return string
* @access public
*/
function GetConfig($params)
{
$config_name = $this->SelectParam($params, 'name,var');
$ret = $this->Application->ConfigValue($config_name);
if( getArrayValue($params, 'escape') ) $ret = addslashes($ret);
return $ret;
}
function ConfigEquals($params)
{
$option = $this->SelectParam($params, 'name,option,var');
return $this->Application->ConfigValue($option) == getArrayValue($params, 'value');
}
/**
* Creates all hidden fields
* needed for kernel_form
*
* @param Array $params
* @return string
* @access public
*/
function DumpSystemInfo($params)
{
$actions =& $this->Application->recallObject('kActions');
$actions->Set('t', $this->Application->GetVar('t') );
$params = $actions->GetParams();
$o='';
foreach ($params AS $name => $val)
{
$o .= "<input type='hidden' name='$name' id='$name' value='$val'>\n";
}
return $o;
}
function GetFormHiddens($params)
{
$sid = $this->Application->GetSID();
$t = $this->SelectParam($params, 'template,t');
unset($params['template']);
$env = $this->Application->BuildEnv($t, $params, 'm', null, false);
$o = '';
if ( $this->Application->RewriteURLs() )
{
$session =& $this->Application->recallObject('Session');
if ($session->NeedQueryString()) {
$o .= "<input type='hidden' name='sid' id='sid' value='$sid'>\n";
}
}
else {
$o .= "<input type='hidden' name='env' id='env' value='$env'>\n";
}
if ($this->Application->GetVar('admin') == 1) {
$o .= "<input type='hidden' name='admin' id='admin' value='1'>\n";
}
return $o;
}
function Odd_Even($params)
{
$odd = $params['odd'];
$even = $params['even'];
if (!isset($params['var'])) {
$var = 'odd_even';
}
else {
$var = $params['var'];
}
if ($this->Application->GetVar($var) == 'even') {
if (!isset($params['readonly']) || !$params['readonly']) {
$this->Application->SetVar($var, 'odd');
}
return $even;
}
else {
if (!isset($params['readonly']) || !$params['readonly']) {
$this->Application->SetVar($var, 'even');
}
return $odd;
}
}
/**
* Returns phrase translation by name
*
* @param Array $params
* @return string
* @access public
*/
function Phrase($params)
{
// m:phrase name="phrase_name" default="Tr-alala" updated="2004-01-29 12:49"
if (array_key_exists('default', $params)) return $params['default']; //backward compatibility
$translation = $this->Application->Phrase($this->SelectParam($params, 'label,name,title'));
if (getArrayValue($params, 'escape')) {
$translation = htmlspecialchars($translation);
$translation = str_replace('\'', ''', $translation);
$translation = addslashes($translation);
}
return $translation;
}
// for tabs
function is_active($params)
{
$test_templ = $this->SelectParam($params, 'templ,template,t');
if ( !getArrayValue($params,'allow_empty') )
{
$if_true=getArrayValue($params,'true') ? $params['true'] : 1;
$if_false=getArrayValue($params,'false') ? $params['false'] : 0;
}
else
{
$if_true=$params['true'];
$if_false=$params['false'];
}
if ( preg_match("/^".str_replace('/', '\/', $test_templ)."/", $this->Application->GetVar('t'))) {
return $if_true;
}
else {
return $if_false;
}
}
function IsNotActive($params)
{
return !$this->is_active($params);
}
function IsActive($params)
{
return $this->is_active($params);
}
function is_t_active($params)
{
return $this->is_active($params);
}
function CurrentTemplate($params)
{
return $this->is_active($params);
}
/**
* Checks if session variable
* specified by name value match
* value passed as parameter
*
* @param Array $params
* @return string
* @access public
*/
function RecallEquals($params)
{
$name = $this->SelectParam($params, 'name,var');
$value = $params['value'];
return ($this->Application->RecallVar($name) == $value);
}
/**
* Checks if application variable
* specified by name value match
* value passed as parameter
*
* @param Array $params
* @return bool
* @access public
*/
function GetEquals($params)
{
$name = $this->SelectParam($params, 'var,name,param');
$value = $params['value'];
if ($this->Application->GetVar($name) == $value) {
return 1;
}
}
/**
* Includes template
* and returns it's
* parsed version
*
* @param Array $params
* @return string
* @access public
*/
function MyInclude($params)
{
$BlockParser =& $this->Application->makeClass('TemplateParser');
// $BlockParser->SetParams($params);
$parser =& $this->Application->Parser;
$this->Application->Parser =& $BlockParser;
$t = $this->SelectParam($params, 't,template,block,name');
$t = eregi_replace("\.tpl$", '', $t);
if (!$t) {
trigger_error('Template name not specified in <b><inp2:m_include .../></b> tag', E_USER_ERROR);
}
$res = $BlockParser->ParseTemplate( $t, 1, $params, isset($params['is_silent']) ? 1 : 0 );
if ( !$BlockParser->DataExists && (isset($params['data_exists']) || isset($params['block_no_data'])) ) {
if ($block_no_data = getArrayValue($params, 'block_no_data')) {
$res = $BlockParser->Parse(
$this->Application->TemplatesCache->GetTemplateBody($block_no_data, getArrayValue($params, 'is_silent') ),
$t
);
}
else {
$res = '';
}
}
$this->Application->Parser =& $parser;
$this->Application->Parser->DataExists = $this->Application->Parser->DataExists || $BlockParser->DataExists;
return $res;
}
function ModuleInclude($params)
{
$ret = '';
$block_params = array_merge($params, Array('is_silent' => 2)); // don't make fatal errors in case if template is missing
$current_template = $this->Application->GetVar('t');
$skip_prefixes = isset($params['skip_prefixes']) ? explode(',', $params['skip_prefixes']) : Array();
foreach ($this->Application->ModuleInfo as $module_name => $module_data) {
$module_key = strtolower($module_name);
if ($module_name == 'In-Portal') {
$module_prefix = '';
}
else {
$module_prefix = $this->Application->IsAdmin() ? $module_key.'/' : $module_data['TemplatePath'].'/';
}
$block_params['t'] = $module_prefix.$this->SelectParam($params, $module_key.'_template,'.$module_key.'_t,template,t');
if ($block_params['t'] == $current_template || in_array($module_data['Var'], $skip_prefixes)) continue;
$no_data = $this->SelectParam($params, $module_key.'_block_no_data,block_no_data');
if ($no_data) {
$block_params['block_no_data'] = $module_prefix.'/'.$no_data;
}
$ret .= $this->MyInclude($block_params);
}
return $ret;
}
function ModuleEnabled($params)
{
return $this->Application->isModuleEnabled( $params['module'] );
}
/*function Kernel_Scripts($params)
{
return '<script type="text/javascript" src="'.PROTOCOL.SERVER_NAME.BASE_PATH.'/kernel3/js/grid.js"></script>';
}*/
/*function GetUserPermission($params)
{
// echo"GetUserPermission $params[name]";
if ($this->Application->RecallVar('user_type') == 1)
return 1;
else {
$perm_name = $params[name];
$aPermissions = unserialize($this->Application->RecallVar('user_permissions'));
if ($aPermissions)
return $aPermissions[$perm_name];
}
}*/
/**
* Set's parser block param value
*
* @param Array $params
* @access public
*/
function AddParam($params)
{
$parser =& $this->Application->Parser; // recallObject('TemplateParser');
foreach ($params as $param => $value) {
$this->Application->SetVar($param, $value);
$parser->SetParam($param, $value);
$parser->AddParam('/\$'.$param.'/', $value);
}
}
/*function ParseToVar($params)
{
$var = $params['var'];
$tagdata = $params['tag'];
$parser =& $this->Application->Parser; //recallObject('TemplateParser');
$res = $this->Application->ProcessTag($tagdata);
$parser->SetParam($var, $res);
$parser->AddParam('/\$'.$var.'/', $res);
return '';
}*/
/*function TagNotEmpty($params)
{
$tagdata = $params['tag'];
$res = $this->Application->ProcessTag($tagdata);
return $res != '';
}*/
/*function TagEmpty($params)
{
return !$this->TagNotEmpty($params);
}*/
/**
* Parses block and returns result
*
* @param Array $params
* @return string
* @access public
*/
function ParseBlock($params)
{
$parser =& $this->Application->Parser; // recallObject('TemplateParser');
return $parser->ParseBlock($params);
}
function RenderElement($params)
{
return $this->ParseBlock($params);
}
function RenderElements($params)
{
if (!isset($params['elements']) || !$params['elements']) return;
$elements = explode(',',$params['elements']);
if (isset($params['skip']) && $params['skip']) {
$tmp_skip = explode(',',$params['skip']);
foreach ($tmp_skip as $elem) {
$skip[] = trim($elem);
}
}
else {
$skip = array();
}
unset($params['elements']);
$o = '';
foreach ($elements as $an_element)
{
$cur = trim($an_element);
if (in_array($cur,$skip)) continue;
$pass_params = $params;
$pass_params['name'] = $cur;
$o .= $this->ParseBlock($pass_params);
}
return $o;
}
/**
* Checks if debug mode is on
*
* @return bool
* @access public
*/
function IsDebugMode()
{
return $this->Application->isDebugMode();
}
function MassParse($params)
{
$qty = $params['qty'];
$block = $params['block'];
$mode = $params['mode'];
$o = '';
if ($mode == 'func') {
$func = create_function('$params', '
$o = \'<tr>\';
$o.= \'<td>a\'.$params[\'param1\'].\'</td>\';
$o.= \'<td>a\'.$params[\'param2\'].\'</td>\';
$o.= \'<td>a\'.$params[\'param3\'].\'</td>\';
$o.= \'<td>a\'.$params[\'param4\'].\'</td>\';
$o.= \'</tr>\';
return $o;
');
for ($i=1; $i<$qty; $i++) {
$block_params['param1'] = rand(1, 10000);
$block_params['param2'] = rand(1, 10000);
$block_params['param3'] = rand(1, 10000);
$block_params['param4'] = rand(1, 10000);
$o .= $func($block_params);
}
return $o;
}
$block_params['name'] = $block;
for ($i=0; $i<$qty; $i++) {
$block_params['param1'] = rand(1, 10000);
$block_params['param2'] = rand(1, 10000);
$block_params['param3'] = rand(1, 10000);
$block_params['param4'] = rand(1, 10000);
$block_params['passed'] = $params['passed'];
$block_params['prefix'] = 'm';
$o.= $this->Application->ParseBlock($block_params, 1);
}
return $o;
}
function LoggedIn($params)
{
return $this->Application->LoggedIn();
}
/**
* Allows to check if permission exists directly in template and perform additional actions if required
*
* @param Array $params
* @return bool
*/
function CheckPermission($params)
{
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
return $perm_helper->TagPermissionCheck($params, 'm_CheckPermission');
}
/**
* Checks if user is logged in and if not redirects it to template passed
*
* @param Array $params
*/
function RequireLogin($params)
{
$t = $this->Application->GetVar('t');
if ($next_t = getArrayValue($params, 'next_template')) {
$t = $next_t;
}
// check by permissions: begin
if ((isset($params['perm_event']) && $params['perm_event']) ||
(isset($params['perm_prefix']) && $params['perm_prefix']) ||
(isset($params['permissions']) && $params['permissions'])) {
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
$perm_status = $perm_helper->TagPermissionCheck($params, 'm_RequireLogin');
if (!$perm_status) {
list($redirect_template, $redirect_params) = $perm_helper->getPermissionTemplate($params);
$this->Application->Redirect($redirect_template, $redirect_params);
}
else {
return ;
}
}
// check by permissions: end
// check by configuration value: begin
$condition = getArrayValue($params, 'condition');
if (!$condition) {
$condition = true;
}
else {
if (substr($condition, 0, 1) == '!') {
$condition = !$this->Application->ConfigValue(substr($condition, 1));
}
else {
$condition = $this->Application->ConfigValue($condition);
}
}
// check by configuration value: end
// check by belonging to group: begin
$group = $this->SelectParam($params, 'group');
$group_access = true;
if ($group) {
$conn =& $this->Application->GetADODBConnection();
$group_id = $conn->GetOne('SELECT GroupId FROM '.TABLE_PREFIX.'PortalGroup WHERE Name = '.$conn->qstr($group));
if ($group_id) {
$groups = explode(',', $this->Application->RecallVar('UserGroups'));
$group_access = in_array($group_id, $groups);
}
}
// check by belonging to group: end
if ((!$this->Application->LoggedIn() || !$group_access) && $condition) {
if ( $this->Application->LoggedIn() && !$group_access) {
$this->Application->Redirect( $params['no_group_perm_template'], Array('next_template'=>$t) );
}
$redirect_params = Array('next_template' => $t);
$session_expired = $this->Application->GetVar('expired');
if ($session_expired) {
$redirect_params['expired'] = $session_expired;
}
$this->Application->Redirect($params['login_template'], $redirect_params);
}
}
function IsMember($params)
{
$group = getArrayValue($params, 'group');
$conn =& $this->Application->DB;
$group_id = $conn->GetOne('SELECT GroupId FROM '.TABLE_PREFIX.'PortalGroup WHERE Name = '.$conn->qstr($group));
if ($group_id) {
$groups = explode(',', $this->Application->RecallVar('UserGroups'));
$group_access = in_array($group_id, $groups);
}
return $group_access;
}
/**
* Checks if SSL is on and redirects to SSL URL if needed
* If SSL_URL is not defined in config - the tag does not do anything
* If for_logged_in_only="1" exits if user is not logged in.
* If called without params forces https right away. If called with by_config="1" checks the
* Require SSL setting from General Config and if it is ON forces https
*
* @param unknown_type $params
*/
function CheckSSL($params)
{
$ssl = $this->Application->ConfigValue('SSL_URL');
if (!$ssl) return; //SSL URL is not set - no way to require SSL
$require = false;
if (isset($params['mode']) && $params['mode'] == 'required') {
$require = true;
if (isset($params['for_logged_in_only']) && $params['for_logged_in_only'] && !$this->Application->LoggedIn()) {
$require = false;
}
if (isset($params['condition'])) {
if (!$this->Application->ConfigValue($params['condition'])) {
$require = false;
}
}
}
$http_query =& $this->Application->recallObject('HTTPQuery');
$pass = $http_query->getRedirectParams();
if ($require) {
if (PROTOCOL == 'https://') {
$this->Application->SetVar('__KEEP_SSL__', 1);
return;
}
$this->Application->Redirect('', array_merge_recursive2($pass, Array('__SSL__' => 1)));
}
else {
if (PROTOCOL == 'https://' && $this->Application->ConfigValue('Force_HTTP_When_SSL_Not_Required')) {
if ($this->Application->GetVar('__KEEP_SSL__')) return;
$pass = array('pass'=>'m', 'm_cat_id'=>0);
$this->Application->Redirect('', array_merge_recursive2($pass, Array('__SSL__' => 0)));
}
}
}
function ConstOn($params)
{
$name = $this->SelectParam($params,'name,const');
return constOn($name);
}
function SetDefaultCategory($params)
{
$module_name = $params['module'];
$module =& $this->Application->recallObject('mod.'.$module_name);
$this->Application->SetVar('m_cat_id', $module->GetDBField('RootCat') );
}
function XMLTemplate($params)
{
safeDefine('DBG_SKIP_REPORTING', 1);
$lang =& $this->Application->recallObject('lang.current');
header('Content-type: text/xml; charset='.$lang->GetDBField('Charset'));
}
function Header($params)
{
header($params['data']);
}
function NoDebug($params)
{
define('DBG_SKIP_REPORTING', 1);
}
function RootCategoryName($params)
{
$root_phrase = $this->Application->ConfigValue('Root_Name');
return $this->Application->Phrase($root_phrase);
}
function AttachFile($params)
{
$email_object =& $this->Application->recallObject('kEmailMessage');
$path = FULL_PATH.'/'.$params['path'];
if (file_exists($path)) {
$email_object->attachFile($path);
}
}
}
Property changes on: trunk/core/kernel/processors/main_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.63
\ No newline at end of property
+1.64
\ No newline at end of property
Index: trunk/core/kernel/application.php
===================================================================
--- trunk/core/kernel/application.php (revision 6655)
+++ trunk/core/kernel/application.php (revision 6656)
@@ -1,2252 +1,2252 @@
<?php
/**
* Basic class for Kernel3-based Application
*
* This class is a Facade for any other class which needs to deal with Kernel3 framework.<br>
* The class incapsulates the main run-cycle of the script, provide access to all other objects in the framework.<br>
* <br>
* The class is a singleton, which means that there could be only one instance of KernelApplication in the script.<br>
* This could be guranteed by NOT calling the class constuctor directly, but rather calling KernelApplication::Instance() method,
* which returns an instance of the application. The method gurantees that it will return exactly the same instance for any call.<br>
* See singleton pattern by GOF.
* @package kernel4
*/
class kApplication {
/**
* Is true, when Init method was called already, prevents double initialization
*
* @var bool
*/
var $InitDone = false;
/**
* Holds internal TemplateParser object
* @access private
* @var TemplateParser
*/
var $Parser;
/**
* Holds parser output buffer
* @access private
* @var string
*/
var $HTML;
/**
* Prevents request from beeing proceeded twice in case if application init is called mere then one time
*
* @var bool
* @todo This is not good anyway (by Alex)
*/
var $RequestProcessed = false;
/**
* The main Factory used to create
* almost any class of kernel and
* modules
*
* @access private
* @var kFactory
*/
var $Factory;
/**
* All ConfigurationValues table content (hash) here
*
* @var Array
* @access private
*/
var $ConfigHash = Array();
/**
* Ids of config variables used in current run (for caching)
*
* @var Array
* @access private
*/
var $ConfigCacheIds = array();
/**
* Template names, that will be used instead of regular templates
*
* @var Array
*/
var $ReplacementTemplates = Array ();
/**
* Reference to debugger
*
* @var Debugger
*/
var $Debugger = null;
/**
* Holds all phrases used
* in code and template
*
* @var PhrasesCache
*/
var $Phrases;
/**
* Modules table content, key - module name
*
* @var Array
*/
var $ModuleInfo = Array();
/**
* Holds DBConnection
*
* @var kDBConnection
*/
var $Conn = null;
/**
* Maintains list of user-defined error handlers
*
* @var Array
*/
var $errorHandlers = Array();
// performance needs:
/**
* Holds a refererence to httpquery
*
* @var kHttpQuery
*/
var $HttpQuery = null;
/**
* Holds a reference to UnitConfigReader
*
* @var kUnitConfigReader
*/
var $UnitConfigReader = null;
/**
* Holds a reference to Session
*
* @var Session
*/
var $Session = null;
/**
* Holds a ref to kEventManager
*
* @var kEventManager
*/
var $EventManager = null;
/**
* Ref to itself, needed because everybody used to write $this->Application, even inside kApplication
*
* @var kApplication
*/
var $Application = null;
/**
* Ref for TemplatesChache
*
* @var TemplatesCache
*/
var $TemplatesCache = null;
var $CompilationCache = array(); //used when compiling templates
var $CachedProcessors = array(); //used when running compiled templates
/**
* Returns kApplication instance anywhere in the script.
*
* This method should be used to get single kApplication object instance anywhere in the
* Kernel-based application. The method is guranteed to return the SAME instance of kApplication.
* Anywhere in the script you could write:
* <code>
* $application =& kApplication::Instance();
* </code>
* or in an object:
* <code>
* $this->Application =& kApplication::Instance();
* </code>
* to get the instance of kApplication. Note that we call the Instance method as STATIC - directly from the class.
* To use descendand of standard kApplication class in your project you would need to define APPLICATION_CLASS constant
* BEFORE calling kApplication::Instance() for the first time. If APPLICATION_CLASS is not defined the method would
* create and return default KernelApplication instance.
* @static
* @access public
* @return kApplication
*/
function &Instance()
{
static $instance = false;
if(!$instance)
{
safeDefine('APPLICATION_CLASS', 'kApplication');
$class = APPLICATION_CLASS;
$instance = new $class();
$instance->Application =& $instance;
}
return $instance;
}
/**
* Initializes the Application
*
* @access public
* @see kHTTPQuery
* @see Session
* @see TemplatesCache
* @return bool Was Init actually made now or before
*/
function Init()
{
if($this->InitDone) return false;
if (!constOn('SKIP_OUT_COMPRESSION')) {
ob_start(); // collect any output from method (other then tags) into buffer
}
if(defined('DEBUG_MODE') && $this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Init:');
}
if (!$this->isDebugMode() && !constOn('DBG_ZEND_PRESENT')) {
error_reporting(0);
ini_set('display_errors', 0);
}
if (!constOn('DBG_ZEND_PRESENT')) {
$error_handler = set_error_handler( Array(&$this,'handleError') );
if ($error_handler) $this->errorHandlers[] = $error_handler;
}
$this->Conn = new kDBConnection(SQL_TYPE, Array(&$this, 'handleSQLError') );
$this->Conn->Connect(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB);
$this->Conn->debugMode = $this->isDebugMode();
$this->Factory = new kFactory();
$this->registerDefaultClasses();
$this->Phrases = new PhrasesCache();
$this->EventManager =& $this->Factory->makeClass('EventManager');
$this->Factory->Storage['EventManager'] =& $this->EventManager;
$this->RegisterDefaultBuildEvents();
$this->SetDefaultConstants();
$this->UnitConfigReader =& $this->recallObject('kUnitConfigReader');
$this->UnitConfigReader->scanModules(MODULES_PATH);
$this->registerModuleConstants();
$rewrite_on = $this->ConfigValue('UseModRewrite');
// admin=1 - when front is browsed using admin session
$admin_on = getArrayValue($_REQUEST, 'admin') || $this->IsAdmin();
define('MOD_REWRITE', $rewrite_on && !$admin_on ? 1 : 0);
$this->HttpQuery =& $this->recallObject('HTTPQuery');
$this->Session =& $this->recallObject('Session');
$this->HttpQuery->AfterInit();
$this->LoadCache();
$this->InitConfig();
$this->Phrases->Init('phrases');
$this->UnitConfigReader->AfterConfigRead();
/*// Module items are recalled during url parsing & PhrasesCache is needed already there,
// because it's used in their build events. That's why phrases cache initialization is
// called from kHTTPQuery in case when mod_rewrite is used
if (!$this->RewriteURLs()) {
$this->Phrases = new PhrasesCache();
}*/
if(!$this->RecallVar('UserGroups')) {
$session =& $this->recallObject('Session');
$user_groups = trim($session->GetField('GroupList'), ',');
if (!$user_groups) $user_groups = $this->ConfigValue('User_GuestGroup');
$this->StoreVar('UserGroups', $user_groups);
}
if ($this->GetVar('m_cat_id') === false) $this->SetVar('m_cat_id', 0);
if( !$this->RecallVar('curr_iso') ) $this->StoreVar('curr_iso', $this->GetPrimaryCurrency() );
$this->SetVar('visits_id', $this->RecallVar('visit_id') );
$language =& $this->recallObject( 'lang.current', null, Array('live_table' => true) );
$this->ValidateLogin();
if($this->isDebugMode()) {
$this->Debugger->profileFinish('kernel4_startup');
}
$this->InitDone = true;
$this->HandleEvent( new kEvent('adm:OnStartup') );
return true;
}
/**
* Returns module information. Searches module by requested field
*
* @param string $field
* @param mixed $value
* @param string field value to returns, if not specified, then return all fields
* @param string field to return
* @return Array
*/
function findModule($field, $value, $return_field = null)
{
$found = false;
foreach ($this->ModuleInfo as $module_name => $module_info) {
if (strtolower($module_info[$field]) == strtolower($value)) {
$found = true;
break;
}
}
if ($found) {
return isset($return_field) ? $module_info[$return_field] : $module_info;
}
return false;
}
function refreshModuleInfo()
{
$modules_helper =& $this->recallObject('ModulesHelper');
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'Modules
WHERE '.$modules_helper->getWhereClause().'
ORDER BY LoadOrder';
$this->ModuleInfo = $this->Conn->Query($sql, 'Name');
$this->registerModuleConstants();
}
/**
* Checks if passed language id if valid and sets it to primary otherwise
*
*/
function VerifyLanguageId()
{
$language_id = $this->GetVar('m_lang');
if (!$language_id) {
$language_id = 'default';
}
$this->SetVar('lang.current_id', $language_id );
$this->SetVar('m_lang', $language_id );
$lang_mode = $this->GetVar('lang_mode');
$this->SetVar('lang_mode', '');
$lang =& $this->recallObject('lang.current');
if ( !$lang->IsLoaded() || (!$this->Application->IsAdmin() && !$lang->GetDBField('Enabled')) ) {
if (!defined('IS_INSTALL')) $this->ApplicationDie('Unknown or disabled language');
}
$this->SetVar('lang_mode',$lang_mode);
}
/**
* Checks if passed theme id if valid and sets it to primary otherwise
*
*/
function VerifyThemeId()
{
if ($this->Application->IsAdmin()) {
- safeDefine('THEMES_PATH', '/kernel/admin_templates');
+ safeDefine('THEMES_PATH', '/core/admin_templates');
return;
}
$theme_id = $this->GetVar('m_theme');
if (!$theme_id) {
$theme_id = $this->GetDefaultThemeId();
if (!$theme_id) {
$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 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()
{
static $theme_id = 0;
if($theme_id > 0) return $theme_id;
if (constOn('DBG_FORCE_THEME')) {
$theme_id = DBG_FORCE_THEME;
}
elseif ($this->IsAdmin()) {
$theme_id = 999;
}
else {
$table = $this->getUnitOption('theme','TableName');
$id_field = $this->getUnitOption('theme','IDField');
$sql = 'SELECT '.$id_field.'
FROM '.$table.'
WHERE (PrimaryTheme = 1) AND (Enabled = 1)';
$theme_id = $this->Conn->GetOne($sql);
}
return $theme_id;
}
function GetPrimaryCurrency()
{
if ($this->isModuleEnabled('In-Commerce')) {
$table = $this->getUnitOption('curr', 'TableName');
return $this->Conn->GetOne('SELECT ISO FROM '.$table.' WHERE IsPrimary = 1');
}
else {
return 'USD';
}
}
/**
* Registers default classes such as ItemController, GridController and LoginController
*
* Called automatically while initializing Application
* @access private
* @return void
*/
function RegisterDefaultClasses()
{
$this->registerClass('kTempTablesHandler', KERNEL_PATH.'/utility/temp_handler.php');
$this->registerClass('kEventManager', KERNEL_PATH.'/event_manager.php', 'EventManager');
$this->registerClass('kUnitConfigReader', KERNEL_PATH.'/utility/unit_config_reader.php');
$this->registerClass('kArray', KERNEL_PATH.'/utility/params.php');
$this->registerClass('Params', KERNEL_PATH.'/utility/params.php');
$this->registerClass('kHelper', KERNEL_PATH.'/kbase.php');
$this->registerClass('kCache', KERNEL_PATH.'/utility/cache.php', 'Cache', Array('Params'));
$this->registerClass('kHTTPQuery', KERNEL_PATH.'/utility/http_query.php', 'HTTPQuery', Array('Params') );
$this->registerClass('Session', KERNEL_PATH.'/session/session.php');
$this->registerClass('SessionStorage', KERNEL_PATH.'/session/session.php');
$this->registerClass('Params', KERNEL_PATH.'/utility/params.php', 'kActions');
$this->registerClass('kMultipleFilter', KERNEL_PATH.'/utility/filters.php');
$this->registerClass('kDBList', KERNEL_PATH.'/db/dblist.php');
$this->registerClass('kDBItem', KERNEL_PATH.'/db/dbitem.php');
$this->registerClass('kDBEventHandler', KERNEL_PATH.'/db/db_event_handler.php');
$this->registerClass('kTagProcessor', KERNEL_PATH.'/processors/tag_processor.php');
$this->registerClass('kMainTagProcessor', KERNEL_PATH.'/processors/main_processor.php','m_TagProcessor', 'kTagProcessor');
$this->registerClass('kDBTagProcessor', KERNEL_PATH.'/db/db_tag_processor.php', null, 'kTagProcessor');
$this->registerClass('TemplatesCache', KERNEL_PATH.'/parser/template.php');
$this->registerClass('Template', KERNEL_PATH.'/parser/template.php');
$this->registerClass('TemplateParser', KERNEL_PATH.'/parser/template_parser.php',null, 'kDBTagProcessor');
$this->registerClass('kEmailMessage', KERNEL_PATH.'/utility/email.php');
$this->registerClass('kSmtpClient', KERNEL_PATH.'/utility/smtp_client.php');
if (file_exists(MODULES_PATH.'/in-commerce/units/currencies/currency_rates.php')) {
$this->registerClass('kCurrencyRates', MODULES_PATH.'/in-commerce/units/currencies/currency_rates.php');
}
$this->registerClass('FCKeditor', FULL_PATH.'/admin/editor/cmseditor/fckeditor.php'); // need this?
/* Moved from MyApplication */
$this->registerClass('Inp1Parser',KERNEL_PATH.'/../units/general/inp1_parser.php','Inp1Parser');
$this->registerClass('InpSession',KERNEL_PATH.'/../units/general/inp_ses_storage.php','Session');
$this->registerClass('InpSessionStorage',KERNEL_PATH.'/../units/general/inp_ses_storage.php','SessionStorage');
$this->registerClass('kCatDBItem',KERNEL_PATH.'/../units/general/cat_dbitem.php');
$this->registerClass('kCatDBItemExportHelper',KERNEL_PATH.'/../units/general/cat_dbitem_export.php', 'CatItemExportHelper');
$this->registerClass('kCatDBList',KERNEL_PATH.'/../units/general/cat_dblist.php');
$this->registerClass('kCatDBEventHandler',KERNEL_PATH.'/../units/general/cat_event_handler.php');
$this->registerClass('kCatDBTagProcessor',KERNEL_PATH.'/../units/general/cat_tag_processor.php');
// Do not move to config - this helper is used before configs are read
$this->registerClass('kModulesHelper', KERNEL_PATH.'/../units/general/helpers/modules.php', 'ModulesHelper');
/* End moved */
}
function RegisterDefaultBuildEvents()
{
$event_manager =& $this->recallObject('EventManager');
$event_manager->registerBuildEvent('kTempTablesHandler', 'OnTempHandlerBuild');
}
/**
* Returns item's filename that corresponds id passed. If possible, then get it from cache
*
* @param string $prefix
* @param int $id
* @return string
*/
function getFilename($prefix, $id, $category_id=null)
{
$filename = $this->getCache('filenames', $prefix.'_'.$id);
if ($filename === false) {
$table = $this->getUnitOption($prefix, 'TableName');
$id_field = $this->getUnitOption($prefix, 'IDField');
if ($prefix == 'c') {
if(!$id) {
$this->setCache('filenames', $prefix.'_'.$id, '');
return '';
}
// this allows to save 2 sql queries for each category
$sql = 'SELECT NamedParentPath, CachedCategoryTemplate
FROM '.$table.'
WHERE '.$id_field.' = '.$this->Conn->qstr($id);
$category_data = $this->Conn->GetRow($sql);
$filename = $category_data['NamedParentPath'];
$this->setCache('category_templates', $id, $category_data['CachedCategoryTemplate']);
// $this->setCache('item_templates', $id, $category_data['CachedItemTemplate']);
}
else {
$resource_id = $this->Conn->GetOne('SELECT ResourceId FROM '.$table.' WHERE '.$id_field.' = '.$this->Conn->qstr($id));
if (is_null($category_id)) $category_id = $this->GetVar('m_cat_id');
$sql = 'SELECT Filename FROM '.TABLE_PREFIX.'CategoryItems WHERE ItemResourceId = '.$resource_id.' AND CategoryId = '.$category_id;
$filename = $this->Conn->GetOne($sql);
/*if (!$filename) {
$sql = 'SELECT Filename FROM '.TABLE_PREFIX.'CategoryItems WHERE ItemResourceId = '.$resource_id.' AND PrimaryCat = 1';
$filename = $this->Conn->GetOne($sql);
}*/
/*$sql = 'SELECT Filename
FROM '.$table.'
WHERE '.$id_field.' = '.$this->Conn->qstr($id);
$filename = $this->Conn->GetOne($sql);*/
}
$this->setCache('filenames', $prefix.'_'.$id, $filename);
}
return $filename;
}
/**
* Adds new value to cache $cache_name and identified by key $key
*
* @param string $cache_name cache name
* @param int $key key name to add to cache
* @param mixed $value value of chached record
*/
function setCache($cache_name, $key, $value)
{
$cache =& $this->recallObject('Cache');
$cache->setCache($cache_name, $key, $value);
}
/**
* Returns cached $key value from cache named $cache_name
*
* @param string $cache_name cache name
* @param int $key key name from cache
* @return mixed
*/
function getCache($cache_name, $key)
{
$cache =& $this->recallObject('Cache');
return $cache->getCache($cache_name, $key);
}
/**
* Defines default constants if it's not defined before - in config.php
*
* @access private
*/
function SetDefaultConstants()
{
safeDefine('SERVER_NAME', $_SERVER['HTTP_HOST']);
}
/**
* Registers each module specific constants if any found
*
*/
function registerModuleConstants()
{
if (!$this->ModuleInfo) return false;
if (file_exists(KERNEL_PATH.'/constants.php')) {
k4_include_once(KERNEL_PATH.'/constants.php');
}
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');
if($this->isDebugMode() && constOn('DBG_SHOW_HTTPQUERY')) {
$this->Debugger->appendHTML('HTTPQuery:');
$this->Debugger->dumpVars($this->HttpQuery->_Params);
}
$event_manager->ProcessRequest();
$event_manager->RunRegularEvents(reBEFORE);
$this->RequestProcessed = true;
}
/**
* Actually runs the parser against current template and stores parsing result
*
* This method gets t variable passed to the script, loads the template given in t variable and
* parses it. The result is store in {@link $this->HTML} property.
* @access public
* @return void
*/
function Run()
{
if($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Run:');
}
if ($this->IsAdmin()) {
// for permission checking in events & templates
$this->LinkVar('module'); // for common configuration templates
$this->LinkVar('section'); // for common configuration templates
if ($this->GetVar('m_opener') == 'p') {
$this->LinkVar('main_prefix'); // window prefix, that opened selector
$this->LinkVar('dst_field'); // field to set value choosed in selector
$this->LinkVar('return_template'); // template to go, when something was coosen from popup (from finalizePopup)
$this->LinkVar('return_m'); // main env part to restore after popup will be closed (from finalizePopup)
}
if ($this->GetVar('ajax') == 'yes') {
// hide debug output from ajax requests automatically
define('DBG_SKIP_REPORTING', 1);
}
}
if (!$this->RequestProcessed) $this->ProcessRequest();
$this->InitParser();
$t = $this->GetVar('t');
if ($this->isModuleEnabled('In-Edit')) {
$cms_handler =& $this->recallObject('cms_EventHandler');
if (!$this->TemplatesCache->TemplateExists($t) && !$this->IsAdmin()) {
$t = $cms_handler->GetDesignTemplate();
}
/*else {
$cms_handler->SetCatByTemplate();
}*/
}
if($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Parsing:');
}
$this->HTML = $this->Parser->ParseTemplate( $t );
if ($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application after Parsing:');
}
}
function InitParser()
{
if( !is_object($this->Parser) ) {
$this->Parser =& $this->recallObject('TemplateParser');
$this->TemplatesCache =& $this->recallObject('TemplatesCache');
}
}
/**
* Send the parser results to browser
*
* Actually send everything stored in {@link $this->HTML}, to the browser by echoing it.
* @access public
* @return void
*/
function Done()
{
if ($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Done:');
}
if ($this->GetVar('admin')) {
$reg = '/('.preg_quote(BASE_PATH, '/').'.*\.html)(#.*){0,1}(")/sU';
$this->HTML = preg_replace($reg, "$1?admin=1$2$3", $this->HTML);
}
//eval("?".">".$this->HTML);
if ($this->isDebugMode()) {
$this->EventManager->RunRegularEvents(reAFTER);
$this->Session->SaveData();
$this->HTML = ob_get_clean() . $this->HTML . $this->Debugger->printReport(true);
}
else {
$this->HTML = ob_get_clean().$this->HTML;
}
if ($this->UseOutputCompression()) {
header('Content-Encoding: gzip');
$compression_level = $this->ConfigValue('OutputCompressionLevel');
if ($compression_level < 0 || $compression_level > 9) $compression_level = 7;
echo gzencode($this->HTML, $compression_level);
}
else {
echo $this->HTML;
}
$this->UpdateCache();
flush();
if ($this->isDebugMode() && constOn('DBG_CACHE')) {
$cache =& $this->recallObject('Cache');
$cache->printStatistics();
}
$this->EventManager->RunRegularEvents(reAFTER);
$this->Session->SaveData();
}
/**
* Checks if output compression options is available
*
* @return string
*/
function UseOutputCompression()
{
if (constOn('IS_INSTALL') || constOn('DBG_ZEND_PRESENT') || constOn('SKIP_OUT_COMPRESSION')) return false;
return $this->ConfigValue('UseOutputCompression') && function_exists('gzencode') && strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
}
// Facade
/**
* Returns current session id (SID)
* @access public
* @return longint
*/
function GetSID()
{
$session =& $this->recallObject('Session');
return $session->GetID();
}
function DestroySession()
{
$session =& $this->recallObject('Session');
$session->Destroy();
}
/**
* Returns variable passed to the script as GET/POST/COOKIE
*
* @access public
* @param string $name Name of variable to retrieve
* @param int $default default value returned in case if varible not present
* @return mixed
*/
function GetVar($name, $default = false)
{
// $http_query =& $this->recallObject('HTTPQuery');
return isset($this->HttpQuery->_Params[$name]) ? $this->HttpQuery->_Params[$name] : $default;
}
/**
* Returns ALL variables passed to the script as GET/POST/COOKIE
*
* @access public
* @return array
*/
function GetVars()
{
return $this->HttpQuery->GetParams();
}
/**
* Set the variable 'as it was passed to the script through GET/POST/COOKIE'
*
* This could be useful to set the variable when you know that
* other objects would relay on variable passed from GET/POST/COOKIE
* or you could use SetVar() / GetVar() pairs to pass the values between different objects.<br>
*
* This method is formerly known as $this->Session->SetProperty.
* @param string $var Variable name to set
* @param mixed $val Variable value
* @access public
* @return void
*/
function SetVar($var,$val)
{
// $http_query =& $this->recallObject('HTTPQuery');
return $this->HttpQuery->Set($var,$val);
}
/**
* Deletes kHTTPQuery variable
*
* @param string $var
* @todo think about method name
*/
function DeleteVar($var)
{
return $this->HttpQuery->Remove($var);
}
/**
* Deletes Session variable
*
* @param string $var
*/
function RemoveVar($var)
{
return $this->Session->RemoveVar($var);
}
/**
* 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);
}
/**
* Stores variable $val in session under name $var
*
* Use this method to store variable in session. Later this variable could be recalled.
* @see RecallVar
* @access public
* @param string $var Variable name
* @param mixed $val Variable value
*/
function StoreVar($var, $val)
{
$session =& $this->recallObject('Session');
$this->Session->StoreVar($var, $val);
}
function StoreVarDefault($var, $val)
{
$session =& $this->recallObject('Session');
$this->Session->StoreVarDefault($var, $val);
}
/**
* Links HTTP Query variable with session variable
*
* If variable $var is passed in HTTP Query it is stored in session for later use. If it's not passed it's recalled from session.
* This method could be used for making sure that GetVar will return query or session value for given
* variable, when query variable should overwrite session (and be stored there for later use).<br>
* This could be used for passing item's ID into popup with multiple tab -
* in popup script you just need to call LinkVar('id', 'current_id') before first use of GetVar('id').
* After that you can be sure that GetVar('id') will return passed id or id passed earlier and stored in session
* @access public
* @param string $var HTTP Query (GPC) variable name
* @param mixed $ses_var Session variable name
* @param mixed $default Default variable value
*/
function LinkVar($var, $ses_var = null, $default = '')
{
if (!isset($ses_var)) $ses_var = $var;
if ($this->GetVar($var) !== false) {
$this->StoreVar($ses_var, $this->GetVar($var));
}
else {
$this->SetVar($var, $this->RecallVar($ses_var, $default));
}
}
/**
* Returns variable from HTTP Query, or from session if not passed in HTTP Query
*
* The same as LinkVar, but also returns the variable value taken from HTTP Query if passed, or from session if not passed.
* Returns the default value if variable does not exist in session and was not passed in HTTP Query
*
* @see LinkVar
* @access public
* @param string $var HTTP Query (GPC) variable name
* @param mixed $ses_var Session variable name
* @param mixed $default Default variable value
* @return mixed
*/
function GetLinkedVar($var, $ses_var = null, $default = '')
{
$this->LinkVar($var, $ses_var, $default);
return $this->GetVar($var);
}
function AddBlock($name, $tpl)
{
$this->cache[$name] = $tpl;
}
/* Seems to be not used anywhere... /Kostja
function SetTemplateBody($title,$body)
{
$templates_cache =& $this->recallObject('TemplatesCache');
$templates_cache->SetTemplateBody($title,$body);
}*/
function ProcessTag($tag_data)
{
$a_tag = new Tag($tag_data,$this->Parser);
return $a_tag->DoProcessTag();
}
function ProcessParsedTag($prefix, $tag, $params)
{
$a_tag = new Tag('',$this->Parser);
$a_tag->Tag = $tag;
$tmp=$this->Application->processPrefix($prefix);
$a_tag->Processor = $tmp['prefix'];
$a_tag->Special = $tmp['special'];
$a_tag->NamedParams = $params;
return $a_tag->DoProcessTag();
}
/**
* Return ADODB Connection object
*
* Returns ADODB Connection object already connected to the project database, configurable in config.php
* @access public
* @return kDBConnection
*/
function &GetADODBConnection()
{
return $this->Conn;
}
function ParseBlock($params,$pass_params=0,$as_template=false)
{
if (substr($params['name'], 0, 5) == 'html:') return substr($params['name'], 6);
return $this->Parser->ParseBlock($params, $pass_params, $as_template);
}
/**
* Returns index file, that could be passed as parameter to method, as parameter to tag and as constant or not passed at all
*
* @param string $prefix
* @param string $index_file
* @param Array $params
* @return string
*/
function getIndexFile($prefix, $index_file, &$params)
{
if (isset($params['index_file'])) {
$index_file = $params['index_file'];
unset($params['index_file']);
return $index_file;
}
if (isset($index_file)) {
return $index_file;
}
if (defined('INDEX_FILE')) {
return INDEX_FILE;
}
$cut_prefix = trim(BASE_PATH, '/').'/'.trim($prefix, '/');
return trim(preg_replace('/'.preg_quote($cut_prefix, '/').'(.*)/', '\\1', $_SERVER['PHP_SELF']), '/');
}
/**
* Return href for template
*
* @access public
* @param string $t Template path
* @var string $prefix index.php prefix - could be blank, 'admin'
*/
function HREF($t, $prefix='', $params=null, $index_file=null)
{
if(!$t) $t = $this->GetVar('t'); // moved from kMainTagProcessor->T()
if ($this->GetVar('skip_last_template')) {
$params['opener'] = 'p';
$this->SetVar('m_opener', 'p');
}
if ($t == 'incs/close_popup') {
// because this template closes the popup and we don't need popup mark here anymore
$params['m_opener'] = 's';
}
if( substr($t, -4) == '.tpl' ) $t = substr($t, 0, strlen($t) - 4 );
if ( $this->IsAdmin() && $prefix == '') $prefix = '/admin';
if ( $this->IsAdmin() && $prefix == '_FRONT_END_') $prefix = '';
$index_file = $this->getIndexFile($prefix, $index_file, $params);
if (isset($params['_auto_prefix_'])) {
unset($params['_auto_prefix_']); // this is parser-related param, do not need to pass it here
}
$ssl = isset($params['__SSL__']) ? $params['__SSL__'] : null;
if ($ssl !== null) {
$session =& $this->recallObject('Session');
$cookie_url = trim($session->CookieDomain.$session->CookiePath, '/.');
if ($ssl) {
$target_url = $this->ConfigValue('SSL_URL');
}
else {
$target_url = 'http://'.DOMAIN.$this->ConfigValue('Site_Path');
}
if (!preg_match('#'.preg_quote($cookie_url).'#', $target_url)) {
$session->SetMode(smGET_ONLY);
}
}
if (getArrayValue($params, 'opener') == 'u') {
$opener_stack=$this->RecallVar('opener_stack');
if($opener_stack) {
$opener_stack=unserialize($opener_stack);
if (count($opener_stack) > 0) {
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);
return $ret;
}
else {
//define('DBG_REDIRECT', 1);
$t = $this->GetVar('t');
}
}
else {
//define('DBG_REDIRECT', 1);
$t = $this->GetVar('t');
}
}
$pass = isset($params['pass']) ? $params['pass'] : '';
$pass_events = isset($params['pass_events']) ? $params['pass_events'] : false; // pass events with url
$map_link = '';
if( isset($params['anchor']) )
{
$map_link = '#'.$params['anchor'];
unset($params['anchor']);
}
if ( isset($params['no_amp']) )
{
$params['__URLENCODE__'] = $params['no_amp'];
unset($params['no_amp']);
}
$no_rewrite = false;
if( isset($params['__NO_REWRITE__']) )
{
$no_rewrite = true;
unset($params['__NO_REWRITE__']);
}
$force_rewrite = false;
if( isset($params['__MOD_REWRITE__']) )
{
$force_rewrite = true;
unset($params['__MOD_REWRITE__']);
}
$force_no_sid = false;
if( isset($params['__NO_SID__']) )
{
$force_no_sid = true;
unset($params['__NO_SID__']);
}
// append pass through variables to each link to be build
$params = array_merge_recursive2($this->getPassThroughVariables($params), $params);
if ($force_rewrite || ($this->RewriteURLs($ssl) && !$no_rewrite))
{
$session =& $this->recallObject('Session');
if( $session->NeedQueryString() && !$force_no_sid ) $params['sid'] = $this->GetSID();
$url = $this->BuildEnv_NEW($t, $params, $pass, $pass_events);
$ret = $this->BaseURL($prefix, $ssl).$url.$map_link;
}
else
{
unset($params['pass_category']); // we don't need to pass it when mod_rewrite is off
$env = $this->BuildEnv($t, $params, $pass, $pass_events);
$ret = $this->BaseURL($prefix, $ssl).$index_file.'?'.$env.$map_link;
}
return $ret;
}
/**
* Returns variables with values that should be passed throught with this link + variable list
*
* @param Array $params
* @return Array
*/
function getPassThroughVariables(&$params)
{
static $cached_pass_through = null;
if (isset($params['no_pass_through']) && $params['no_pass_through']) {
unset($params['no_pass_through']);
return Array();
}
// because pass through is not changed during script run, then we can cache it
if (is_null($cached_pass_through)) {
$cached_pass_through = Array();
$pass_through = $this->Application->GetVar('pass_through');
if ($pass_through) {
// names of variables to pass to each link
$cached_pass_through['pass_through'] = $pass_through;
$pass_through = explode(',', $pass_through);
foreach ($pass_through as $pass_through_var) {
$cached_pass_through[$pass_through_var] = $this->Application->GetVar($pass_through_var);
}
}
}
return $cached_pass_through;
}
/**
* Returns sorted array of passed prefixes (to build url from)
*
* @param string $pass
* @return Array
*/
function getPassInfo($pass = 'all')
{
$pass = trim(preg_replace('/(?<=,|\\A)all(?=,|\\z)/', trim($this->GetVar('passed'), ','), trim($pass, ',')), ',');
if (!$pass) {
return Array();
}
$pass_info = array_unique( explode(',', $pass) ); // array( prefix[.special], prefix[.special] ...
sort($pass_info, SORT_STRING); // to be prefix1,prefix1.special1,prefix1.special2,prefix3.specialX
// ensure that "m" prefix is at the beginning
$main_index = array_search('m', $pass_info);
if ($main_index !== false) {
unset($pass_info[$main_index]);
array_unshift($pass_info, 'm');
}
return $pass_info;
}
function BuildEnv_NEW($t, $params, $pass = 'all', $pass_events = false)
{
// $session =& $this->recallObject('Session');
$force_admin = getArrayValue($params,'admin') || $this->GetVar('admin');
// if($force_admin) $sid = $this->GetSID();
$ret = '';
$env = '';
$encode = false;
if (isset($params['__URLENCODE__']))
{
$encode = $params['__URLENCODE__'];
unset($params['__URLENCODE__']);
}
if (isset($params['__SSL__'])) {
unset($params['__SSL__']);
}
$m_only = true;
$pass_info = $this->getPassInfo($pass);
if ($pass_info) {
if ($pass_info[0] == 'm') array_shift($pass_info);
$params['t'] = $t;
foreach($pass_info as $pass_index => $pass_element)
{
list($prefix) = explode('.', $pass_element);
$require_rewrite = $this->findModule('Var', $prefix) && $this->getUnitOption($prefix, 'CatalogItem');
if ($require_rewrite) {
// if next prefix is same as current, but with special => exclude current prefix from url
$next_prefix = getArrayValue($pass_info, $pass_index + 1);
if ($next_prefix) {
$next_prefix = substr($next_prefix, 0, strlen($prefix) + 1);
if ($prefix.'.' == $next_prefix) continue;
}
$a = $this->BuildModuleEnv_NEW($pass_element, $params, $pass_events);
if ($a) {
$ret .= '/'.$a;
$m_only = false;
}
}
else
{
$env .= ':'.$this->BuildModuleEnv($pass_element, $params, $pass_events);
}
}
if (!$m_only) $params['pass_category'] = 1;
$ret = $this->BuildModuleEnv_NEW('m', $params, $pass_events).$ret;
$cat_processed = isset($params['category_processed']) && $params['category_processed'];
if ($cat_processed) {
unset($params['category_processed']);
}
if (!$m_only || !$cat_processed || !defined('EXP_DIR_URLS')) {
$ret = trim($ret, '/').'.html';
}
else {
$ret .= '/';
}
// $ret = trim($ret, '/').'/';
if($env) $params[ENV_VAR_NAME] = ltrim($env, ':');
}
unset($params['pass'], $params['opener'], $params['m_event']);
if ($force_admin) $params['admin'] = 1;
if( getArrayValue($params,'escape') )
{
$ret = addslashes($ret);
unset($params['escape']);
}
$ret = str_replace('%2F', '/', urlencode($ret));
$params_str = '';
$join_string = $encode ? '&' : '&';
foreach ($params as $param => $value)
{
$params_str .= $join_string.$param.'='.$value;
}
$ret .= preg_replace('/^'.$join_string.'(.*)/', '?\\1', $params_str);
if ($encode) {
$ret = str_replace('\\', '%5C', $ret);
}
return $ret;
}
function BuildModuleEnv_NEW($prefix_special, &$params, $pass_events = false)
{
$event_params = Array('pass_events' => $pass_events, 'url_params' => $params);
$event = new kEvent($prefix_special.':BuildEnv', $event_params);
$this->HandleEvent($event);
$params = $event->getEventParam('url_params'); // save back unprocessed parameters
$ret = '';
if ($event->getEventParam('env_string')) {
$ret = trim( $event->getEventParam('env_string'), '/');
}
return $ret;
}
/**
* Builds env part that corresponds prefix passed
*
* @param string $prefix_special item's prefix & [special]
* @param Array $params url params
* @param bool $pass_events
*/
function BuildModuleEnv($prefix_special, &$params, $pass_events = false)
{
list($prefix) = explode('.', $prefix_special);
$query_vars = $this->getUnitOption($prefix, 'QueryString');
//if pass events is off and event is not implicity passed
if( !$pass_events && !isset($params[$prefix_special.'_event']) ) {
$params[$prefix_special.'_event'] = ''; // remove event from url if requested
//otherwise it will use value from get_var
}
if(!$query_vars) return '';
$tmp_string = Array(0 => $prefix_special);
foreach($query_vars as $index => $var_name)
{
//if value passed in params use it, otherwise use current from application
$var_name = $prefix_special.'_'.$var_name;
$tmp_string[$index] = isset( $params[$var_name] ) ? $params[$var_name] : $this->GetVar($var_name);
if ( isset($params[$var_name]) ) unset( $params[$var_name] );
}
$escaped = array();
foreach ($tmp_string as $tmp_val) {
$escaped[] = str_replace(Array('-',':'), Array('\-','\:'), $tmp_val);
}
$ret = implode('-', $escaped);
if ($this->getUnitOption($prefix, 'PortalStyleEnv') == true)
{
$ret = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/','\\1\\2-\\3', $ret);
}
return $ret;
}
function BuildEnv($t, $params, $pass='all', $pass_events = false, $env_var = true)
{
$session =& $this->recallObject('Session');
$ssl = isset($params['__SSL__']) ? $params['__SSL__'] : 0;
$sid = $session->NeedQueryString() && !$this->RewriteURLs($ssl) ? $this->GetSID() : '';
// if (getArrayValue($params,'admin') == 1) $sid = $this->GetSID();
$ret = '';
if ($env_var) {
$ret = ENV_VAR_NAME.'=';
}
$ret .= $sid.(constOn('INPORTAL_ENV') ? '-' : ':');
$encode = false;
if (isset($params['__URLENCODE__'])) {
$encode = $params['__URLENCODE__'];
unset($params['__URLENCODE__']);
}
if (isset($params['__SSL__'])) {
unset($params['__SSL__']);
}
$env_string = '';
$category_id = isset($params['m_cat_id']) ? $params['m_cat_id'] : $this->GetVar('m_cat_id');
$item_id = 0;
$pass_info = $this->getPassInfo($pass);
if ($pass_info) {
if ($pass_info[0] == 'm') array_shift($pass_info);
foreach ($pass_info as $pass_element) {
list($prefix) = explode('.', $pass_element);
$require_rewrite = $this->findModule('Var', $prefix);
if ($require_rewrite) {
$item_id = isset($params[$pass_element.'_id']) ? $params[$pass_element.'_id'] : $this->GetVar($pass_element.'_id');
}
$env_string .= ':'.$this->BuildModuleEnv($pass_element, $params, $pass_events);
}
}
if (strtolower($t) == '__default__') {
// to put category & item templates into cache
$filename = $this->getFilename('c', $category_id);
if ($item_id) {
$mod_rw_helper =& $this->Application->recallObject('ModRewriteHelper');
$t = $mod_rw_helper->GetItemTemplate($category_id, $pass_element); // $pass_element should be the last processed element
// $t = $this->getCache('item_templates', $category_id);
}
elseif ($category_id) {
$t = $this->getCache('category_templates', $category_id);
}
else {
$t = 'index';
}
}
$ret .= $t.':'.$this->BuildModuleEnv('m', $params, $pass_events).$env_string;
unset($params['pass']);
unset($params['opener']);
unset($params['m_event']);
if ($this->GetVar('admin') && !isset($params['admin'])) {
$params['admin'] = 1;
}
if( getArrayValue($params,'escape') )
{
$ret = addslashes($ret);
unset($params['escape']);
}
$join_string = $encode ? '&' : '&';
$params_str = '';
foreach ($params as $param => $value)
{
$params_str .= $join_string.$param.'='.$value;
}
$ret .= $params_str;
if ($encode) {
$ret = str_replace('\\', '%5C', $ret);
}
return $ret;
}
function BaseURL($prefix='', $ssl=null)
{
if ($ssl === null) {
return PROTOCOL.SERVER_NAME.(defined('PORT')?':'.PORT : '').rtrim(BASE_PATH, '/').$prefix.'/';
}
else {
if ($ssl) {
return rtrim( $this->ConfigValue('SSL_URL'), '/').$prefix.'/';
}
else {
return 'http://'.DOMAIN.(defined('PORT')?':'.PORT : '').rtrim( $this->ConfigValue('Site_Path'), '/').$prefix.'/';
}
}
}
function Redirect($t='', $params=null, $prefix='', $index_file=null)
{
$js_redirect = getArrayValue($params, 'js_redirect');
if (preg_match("/external:(.*)/", $t, $rets)) {
$location = $rets[1];
}
else {
if ($t == '' || $t === true) $t = $this->GetVar('t');
// pass prefixes and special from previous url
if( isset($params['js_redirect']) ) unset($params['js_redirect']);
if (!isset($params['pass'])) $params['pass'] = 'all';
if ($this->GetVar('ajax') == 'yes' && $t == $this->GetVar('t')) {
// redirects to the same template as current
$params['ajax'] = 'yes';
}
$params['__URLENCODE__'] = 1;
$location = $this->HREF($t, $prefix, $params, $index_file);
//echo " location : $location <br>";
}
$a_location = $location;
$location = "Location: $location";
if ($this->isDebugMode() && constOn('DBG_REDIRECT')) {
$this->Debugger->appendTrace();
echo "<b>Debug output above!!!</b> Proceed to redirect: <a href=\"$a_location\">$a_location</a><br>";
}
else {
if ($js_redirect) {
$this->SetVar('t', 'redirect');
$this->SetVar('redirect_to_js', addslashes($a_location) );
$this->SetVar('redirect_to', $a_location);
return true;
}
else {
if ($this->GetVar('ajax') == 'yes' && $t != $this->GetVar('t')) {
// redirection to other then current template during ajax request
echo '#redirect#'.$a_location;
}
elseif (headers_sent() != '') {
// some output occured -> redirect using javascript
echo '<script type="text/javascript">window.location.href = \''.$a_location.'\';</script>';
}
else {
// no output before -> redirect using HTTP header
// header('HTTP/1.1 302 Found');
header("$location");
}
}
}
ob_end_flush();
// session expiration is called from session initialization,
// that's why $this->Session may be not defined here
if (is_object($this->Session)) {
$this->Session->SaveData();
}
exit;
}
function Phrase($label)
{
return $this->Phrases->GetPhrase($label);
}
/**
* Replace language tags in exclamation marks found in text
*
* @param string $text
* @param bool $force_escape force escaping, not escaping of resulting string
* @return string
* @access public
*/
function ReplaceLanguageTags($text, $force_escape=null)
{
// !!!!!!!!
// if( !is_object($this->Phrases) ) $this->Debugger->appendTrace();
return $this->Phrases->ReplaceLanguageTags($text,$force_escape);
}
/**
* Checks if user is logged in, and creates
* user object if so. User object can be recalled
* later using "u" prefix. Also you may
* get user id by getting "u_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_id', $user_id);
$this->StoreVar('user_id', $user_id);
if ($this->GetVar('expired') == 1) {
$user =& $this->recallObject('u');
$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);
}
}
function LoadCache() {
$cache_key = $this->GetVar('t').$this->GetVar('m_theme').$this->GetVar('m_lang').$this->IsAdmin();
$query = sprintf("SELECT PhraseList, ConfigVariables FROM %s WHERE Template = %s",
TABLE_PREFIX.'PhraseCache',
$this->Conn->Qstr(md5($cache_key)));
$res = $this->Conn->GetRow($query);
if ($res) {
$this->Caches['PhraseList'] = $res['PhraseList'] ? explode(',', $res['PhraseList']) : array();
$config_ids = $res['ConfigVariables'] ? explode(',', $res['ConfigVariables']) : array();
$config_ids = array_diff($config_ids, $this->Caches['ConfigVariables']);
}
else {
$config_ids = array();
}
$this->Caches['ConfigVariables'] = $config_ids;
$this->ConfigCacheIds = $config_ids;
}
function UpdateCache()
{
$update = false;
//something changed
$update = $update || $this->Phrases->NeedsCacheUpdate();
$update = $update || (count($this->ConfigCacheIds) && $this->ConfigCacheIds != $this->Caches['ConfigVariables']);
if ($update) {
$cache_key = $this->GetVar('t').$this->GetVar('m_theme').$this->GetVar('m_lang').$this->IsAdmin();
$query = sprintf("REPLACE %s (PhraseList, CacheDate, Template, ConfigVariables)
VALUES (%s, %s, %s, %s)",
TABLE_PREFIX.'PhraseCache',
$this->Conn->Qstr(join(',', $this->Phrases->Ids)),
adodb_mktime(),
$this->Conn->Qstr(md5($cache_key)),
$this->Conn->qstr(implode(',', array_unique($this->ConfigCacheIds))));
$this->Conn->Query($query);
}
}
function InitConfig()
{
if (isset($this->Caches['ConfigVariables']) && count($this->Caches['ConfigVariables']) > 0) {
$this->ConfigHash = array_merge($this->ConfigHash, $this->Conn->GetCol(
'SELECT VariableValue, VariableName FROM '.TABLE_PREFIX.'ConfigurationValues
WHERE VariableId IN ('.implode(',', $this->Caches['ConfigVariables']).')', 'VariableName'));
}
}
/**
* Returns configuration option value by name
*
* @param string $name
* @return string
*/
function ConfigValue($name)
{
$res = isset($this->ConfigHash[$name]) ? $this->ConfigHash[$name] : false;
if ($res !== false) return $res;
$res = $this->Conn->GetRow('SELECT VariableId, VariableValue FROM '.TABLE_PREFIX.'ConfigurationValues WHERE VariableName = '.$this->Conn->qstr($name));
if ($res) {
$this->ConfigHash[$name] = $res['VariableValue'];
$this->ConfigCacheIds[] = $res['VariableId'];
return $res['VariableValue'];
}
return false;
}
function UpdateConfigCache()
{
if ($this->ConfigCacheIds) {
}
}
/**
* Allows to process any type of event
*
* @param kEvent $event
* @access public
* @author Alex
*/
function HandleEvent(&$event, $params=null, $specificParams=null)
{
if ( isset($params) ) {
$event = new kEvent( $params, $specificParams );
}
if (!isset($this->EventManager)) {
$this->EventManager =& $this->recallObject('EventManager');
}
$this->EventManager->HandleEvent($event);
}
/**
* Registers new class in the factory
*
* @param string $real_class Real name of class as in class declaration
* @param string $file Filename in what $real_class is declared
* @param string $pseudo_class Name under this class object will be accessed using getObject method
* @param Array $dependecies List of classes required for this class functioning
* @access public
* @author Alex
*/
function registerClass($real_class, $file, $pseudo_class = null, $dependecies = Array() )
{
$this->Factory->registerClass($real_class, $file, $pseudo_class, $dependecies);
}
/**
* Add $class_name to required classes list for $depended_class class.
* All required class files are included before $depended_class file is included
*
* @param string $depended_class
* @param string $class_name
* @author Alex
*/
function registerDependency($depended_class, $class_name)
{
$this->Factory->registerDependency($depended_class, $class_name);
}
/**
* Registers Hook from subprefix event to master prefix event
*
* @param string $hookto_prefix
* @param string $hookto_special
* @param string $hookto_event
* @param string $mode
* @param string $do_prefix
* @param string $do_special
* @param string $do_event
* @param string $conditional
* @access public
* @todo take care of a lot parameters passed
* @author Kostja
*/
function registerHook($hookto_prefix, $hookto_special, $hookto_event, $mode, $do_prefix, $do_special, $do_event, $conditional)
{
$event_manager =& $this->recallObject('EventManager');
$event_manager->registerHook($hookto_prefix, $hookto_special, $hookto_event, $mode, $do_prefix, $do_special, $do_event, $conditional);
}
/**
* Allows one TagProcessor tag act as other TagProcessor tag
*
* @param Array $tag_info
* @author Kostja
*/
function registerAggregateTag($tag_info)
{
$aggregator =& $this->recallObject('TagsAggregator', 'kArray');
$aggregator->SetArrayValue($tag_info['AggregateTo'], $tag_info['AggregatedTagName'], Array($tag_info['LocalPrefix'], $tag_info['LocalTagName'], getArrayValue($tag_info, 'LocalSpecial')));
}
/**
* Returns object using params specified,
* creates it if is required
*
* @param string $name
* @param string $pseudo_class
* @param Array $event_params
* @return Object
* @author Alex
*/
function &recallObject($name,$pseudo_class=null,$event_params=Array())
{
$result =& $this->Factory->getObject($name, $pseudo_class, $event_params);
return $result;
}
/**
* Returns object using Variable number of params,
* all params starting with 4th are passed to object consturctor
*
* @param string $name
* @param string $pseudo_class
* @param Array $event_params
* @return Object
* @author Alex
*/
function &recallObjectP($name,$pseudo_class=null,$event_params=Array())
{
$func_args = func_get_args();
$result =& ref_call_user_func_array( Array(&$this->Factory, 'getObjectP'), $func_args );
return $result;
}
/**
* Returns tag processor for prefix specified
*
* @param string $prefix
* @return kDBTagProcessor
*/
function &recallTagProcessor($prefix)
{
$result =& $this->recallObject($prefix.'_TagProcessor');
return $result;
}
/**
* Checks if object with prefix passes was already created in factory
*
* @param string $name object presudo_class, prefix
* @return bool
* @author Kostja
*/
function hasObject($name)
{
return isset($this->Factory->Storage[$name]);
}
/**
* Removes object from storage by given name
*
* @param string $name Object's name in the Storage
* @author Kostja
*/
function removeObject($name)
{
$this->Factory->DestroyObject($name);
}
/**
* Get's real class name for pseudo class,
* includes class file and creates class
* instance
*
* @param string $pseudo_class
* @return Object
* @access public
* @author Alex
*/
function &makeClass($pseudo_class)
{
$func_args = func_get_args();
$result =& ref_call_user_func_array( Array(&$this->Factory, 'makeClass'), $func_args);
return $result;
}
/**
* Checks if application is in debug mode
*
* @param bool $check_debugger check if kApplication debugger is initialized too, not only for defined DEBUG_MODE constant
* @return bool
* @author Alex
* @access public
*/
function isDebugMode($check_debugger = true)
{
$debug_mode = defined('DEBUG_MODE') && DEBUG_MODE;
if($check_debugger)
{
$debug_mode = $debug_mode && is_object($this->Debugger);
}
return $debug_mode;
}
/**
* Checks if it is admin
*
* @return bool
* @author Alex
*/
function IsAdmin()
{
return constOn('ADMIN');
}
/**
* Apply url rewriting used by mod_rewrite or not
*
* @param bool $ssl Force ssl link to be build
* @return bool
*/
function RewriteURLs($ssl = false)
{
// case #1,#4:
// we want to create https link from http mode
// we want to create https link from https mode
// conditions: ($ssl || PROTOCOL == 'https://') && $this->ConfigValue('UseModRewriteWithSSL')
// case #2,#3:
// we want to create http link from https mode
// we want to create http link from http mode
// conditions: !$ssl && (PROTOCOL == 'https://' || PROTOCOL == 'http://')
$allow_rewriting =
(!$ssl && (PROTOCOL == 'https://' || PROTOCOL == 'http://')) // always allow mod_rewrite for http
|| // or allow rewriting for redirect TO httpS or when already in httpS
(($ssl || PROTOCOL == 'https://') && $this->ConfigValue('UseModRewriteWithSSL')); // but only if it's allowed in config!
return constOn('MOD_REWRITE') && $allow_rewriting;
}
/**
* Reads unit (specified by $prefix)
* option specified by $option
*
* @param string $prefix
* @param string $option
* @param mixed $default
* @return string
* @access public
* @author Alex
*/
function getUnitOption($prefix, $option, $default = false)
{
/*if (!isset($this->UnitConfigReader)) {
$this->UnitConfigReader =& $this->recallObject('kUnitConfigReader');
}*/
return $this->UnitConfigReader->getUnitOption($prefix, $option, $default);
}
/**
* Set's new unit option value
*
* @param string $prefix
* @param string $name
* @param string $value
* @author Alex
* @access public
*/
function setUnitOption($prefix, $option, $value)
{
// $unit_config_reader =& $this->recallObject('kUnitConfigReader');
return $this->UnitConfigReader->setUnitOption($prefix,$option,$value);
}
/**
* Read all unit with $prefix options
*
* @param string $prefix
* @return Array
* @access public
* @author Alex
*/
function getUnitOptions($prefix)
{
// $unit_config_reader =& $this->recallObject('kUnitConfigReader');
return $this->UnitConfigReader->getUnitOptions($prefix);
}
/**
* Returns true if config exists and is allowed for reading
*
* @param string $prefix
* @return bool
*/
function prefixRegistred($prefix)
{
/*if (!isset($this->UnitConfigReader)) {
$this->UnitConfigReader =& $this->recallObject('kUnitConfigReader');
}*/
return $this->UnitConfigReader->prefixRegistred($prefix);
}
/**
* Splits any mixing of prefix and
* special into correct ones
*
* @param string $prefix_special
* @return Array
* @access public
* @author Alex
*/
function processPrefix($prefix_special)
{
return $this->Factory->processPrefix($prefix_special);
}
/**
* Set's new event for $prefix_special
* passed
*
* @param string $prefix_special
* @param string $event_name
* @access public
*/
function setEvent($prefix_special,$event_name)
{
$event_manager =& $this->recallObject('EventManager');
$event_manager->setEvent($prefix_special,$event_name);
}
/**
* SQL Error Handler
*
* @param int $code
* @param string $msg
* @param string $sql
* @return bool
* @access private
* @author Alex
*/
function handleSQLError($code, $msg, $sql)
{
if ( isset($this->Debugger) )
{
$errorLevel = constOn('DBG_SQL_FAILURE') && !defined('IS_INSTALL') ? E_USER_ERROR : E_USER_WARNING;
$this->Debugger->dumpVars($_REQUEST);
$this->Debugger->appendTrace();
$error_msg = '<span class="debug_error">'.$msg.' ('.$code.')</span><br><a href="javascript:$Debugger.SetClipboard(\''.htmlspecialchars($sql).'\');"><b>SQL</b></a>: '.$this->Debugger->formatSQL($sql);
$long_id = $this->Debugger->mapLongError($error_msg);
trigger_error( substr($msg.' ('.$code.') ['.$sql.']',0,1000).' #'.$long_id, $errorLevel);
return true;
}
else
{
//$errorLevel = constOn('IS_INSTALL') ? E_USER_WARNING : E_USER_ERROR;
$errorLevel = E_USER_WARNING;
trigger_error('<b>SQL Error</b> in sql: '.$sql.', code <b>'.$code.'</b> ('.$msg.')', $errorLevel);
/*echo '<b>xProcessing SQL</b>: '.$sql.'<br>';
echo '<b>Error ('.$code.'):</b> '.$msg.'<br>';*/
return $errorLevel == E_USER_ERROR ? false : true;
}
}
/**
* Default error handler
*
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
* @param Array $errcontext
*/
function handleError($errno, $errstr, $errfile = '', $errline = '', $errcontext = '')
{
if( constOn('SILENT_LOG') )
{
$fp = fopen(FULL_PATH.'/silent_log.txt','a');
$time = adodb_date('d/m/Y H:i:s');
fwrite($fp, '['.$time.'] #'.$errno.': '.strip_tags($errstr).' in ['.$errfile.'] on line '.$errline."\n");
fclose($fp);
}
if( !$this->errorHandlers ) return true;
$i = 0; // while (not foreach) because it is array of references in some cases
$eh_count = count($this->errorHandlers);
while($i < $eh_count)
{
if( is_array($this->errorHandlers[$i]) )
{
$object =& $this->errorHandlers[$i][0];
$method = $this->errorHandlers[$i][1];
$object->$method($errno, $errstr, $errfile, $errline, $errcontext);
}
else
{
$function = $this->errorHandlers[$i];
$function($errno, $errstr, $errfile, $errline, $errcontext);
}
$i++;
}
}
/**
* Returns & blocks next ResourceId available in system
*
* @return int
* @access public
* @author Alex
*/
function NextResourceId()
{
$table_name = TABLE_PREFIX.'IdGenerator';
$this->Conn->Query('LOCK TABLES '.$table_name.' WRITE');
$this->Conn->Query('UPDATE '.$table_name.' SET lastid = lastid + 1');
$id = $this->Conn->GetOne('SELECT lastid FROM '.$table_name);
if($id === false)
{
$this->Conn->Query('INSERT INTO '.$table_name.' (lastid) VALUES (2)');
$id = 2;
}
$this->Conn->Query('UNLOCK TABLES');
return $id - 1;
}
/**
* Returns main prefix for subtable prefix passes
*
* @param string $current_prefix
* @return string
* @access public
* @author Kostja
*/
function GetTopmostPrefix($current_prefix)
{
while ( $parent_prefix = $this->getUnitOption($current_prefix, 'ParentPrefix') )
{
$current_prefix = $parent_prefix;
}
return $current_prefix;
}
function &EmailEventAdmin($email_event_name, $to_user_id = -1, $send_params = false)
{
return $this->EmailEvent($email_event_name, 1, $to_user_id, $send_params);
}
function &EmailEventUser($email_event_name, $to_user_id = -1, $send_params = false)
{
return $this->EmailEvent($email_event_name, 0, $to_user_id, $send_params);
}
function &EmailEvent($email_event_name, $email_event_type, $to_user_id = -1, $send_params = false)
{
$event = new kEvent('emailevents:OnEmailEvent');
$event->setEventParam('EmailEventName', $email_event_name);
$event->setEventParam('EmailEventToUserId', $to_user_id);
$event->setEventParam('EmailEventType', $email_event_type);
if ($send_params){
$event->setEventParam('DirectSendParams', $send_params);
}
$this->HandleEvent($event);
return $event;
}
function LoggedIn()
{
$user_id = $this->Application->RecallVar('user_id');
// $user =& $this->recallObject('u');
// $user_id = $user->GetID();
$ret = $user_id > 0;
if ($this->IsAdmin() && ($user_id == -1)) {
$ret = true;
}
return $ret;
}
/**
* Check current user permissions based on it's group permissions in specified category
*
* @param string $name permission name
* @param int $cat_id category id, current used if not specified
* @param int $type permission type {1 - system, 0 - per category}
* @return int
*/
function CheckPermission($name, $type = 1, $cat_id = null)
{
$perm_helper =& $this->recallObject('PermissionsHelper');
return $perm_helper->CheckPermission($name, $type, $cat_id);
}
/**
* Set's any field of current visit
*
* @param string $field
* @param mixed $value
*/
function setVisitField($field, $value)
{
$visit =& $this->recallObject('visits');
$visit->SetDBField($field, $value);
$visit->Update();
}
/**
* Allows to check if in-portal is installed
*
* @return bool
*/
function isInstalled()
{
return $this->InitDone && (count($this->ModuleInfo) > 0);
}
/**
* Allows to determine if module is installed & enabled
*
* @param string $module_name
* @return bool
*/
function isModuleEnabled($module_name)
{
return $this->findModule('Name', $module_name) !== false;
}
function reportError($class, $method)
{
$this->Debugger->appendTrace();
trigger_error('depricated method <b>'.$class.'->'.$method.'(...)</b>', E_USER_ERROR);
}
/**
* Get temp table name
*
* @param string $table
* @return string
*/
function GetTempName($table)
{
return TABLE_PREFIX.'ses_'.$this->GetSID().'_edit_'.$table;
}
function GetTempTablePrefix()
{
return TABLE_PREFIX.'ses_'.$this->GetSID().'_edit_';
}
function IsTempTable($table)
{
return strpos($table, TABLE_PREFIX.'ses_'.$this->GetSID().'_edit_') !== false;
}
/**
* 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().'_edit_(.*)/',$temp_table,$rets) )
{
return $rets[1];
}
else
{
return $temp_table;
}
}
function CheckProcessors($processors)
{
foreach ($processors as $a_processor)
{
if (!isset($this->CachedProcessors[$a_processor])) {
$this->CachedProcessors[$a_processor] =& $this->recallObject($a_processor.'_TagProcessor');
}
}
}
function TimeZoneAdjustment($time_zone=null)
{
$target_zone = isset($time_zone) ? $time_zone : $this->ConfigValue('Config_Site_Time');
return 3600 * ($target_zone - $this->ConfigValue('Config_Server_Time'));
}
function ApplicationDie($message = '')
{
$message = ob_get_clean().$message;
if ($this->isDebugMode()) {
$message .= $this->Debugger->printReport(true);
}
echo $this->UseOutputCompression() ? gzencode($message, DBG_COMPRESSION_LEVEL) : $message;
exit;
}
/* moved from MyApplication */
function getUserGroups($user_id)
{
switch($user_id)
{
case -1:
$user_groups = $this->ConfigValue('User_LoggedInGroup');
break;
case -2:
$user_groups = $this->ConfigValue('User_LoggedInGroup');
$user_groups .= ','.$this->ConfigValue('User_GuestGroup');
break;
default:
$sql = 'SELECT GroupId FROM '.TABLE_PREFIX.'UserGroup WHERE PortalUserId = '.$user_id;
$res = $this->Conn->GetCol($sql);
$user_groups = Array( $this->ConfigValue('User_LoggedInGroup') );
if(is_array($res))
{
$user_groups = array_merge($user_groups, $res);
}
$user_groups = implode(',', $user_groups);
}
return $user_groups;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/application.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.164
\ No newline at end of property
+1.165
\ No newline at end of property
Index: trunk/core/admin_templates/incs/grid_blocks.tpl
===================================================================
--- trunk/core/admin_templates/incs/grid_blocks.tpl (nonexistent)
+++ trunk/core/admin_templates/incs/grid_blocks.tpl (revision 6656)
@@ -0,0 +1,392 @@
+<inp2:m_block name="current_page"/>
+ <span class="current_page"><inp2:m_param name="page"/></span>
+<inp2:m_blockend/>
+
+<inp2:m_block name="page"/>
+ <a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url"><inp2:m_param name="page"/></a>
+<inp2:m_blockend/>
+
+<inp2:m_block name="next_page"/>
+ <a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url">></a>
+<inp2:m_blockend/>
+
+<inp2:m_block name="prev_page"/>
+ <a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url"><</a>
+<inp2:m_blockend/>
+
+<inp2:m_block name="next_page_split"/>
+ <a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url">>></a>
+<inp2:m_blockend/>
+
+<inp2:m_block name="prev_page_split"/>
+ <a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url"><<</a>
+<inp2:m_blockend/>
+
+
+<inp2:m_block name="grid_pagination" SearchPrefixSpecial=""/>
+<table cellspacing="0" cellpadding="2" width="100%" bgcolor="#E0E0DA" border="0" class="<inp2:m_if prefix="m" function="ParamEquals" name="no_toolbar" value="no_toolbar"/>tableborder_full_kernel<inp2:m_else/>pagination_bar<inp2:m_endif/>">
+ <tbody>
+ <tr id="MY_ID">
+ <td width="100%">
+ <img height="15" src="img/arrow.gif" width="15" align="absmiddle" border="0">
+ <b class=text><inp2:m_phrase name="la_Page"/></b>
+ <inp2:$PrefixSpecial_PrintPages active_block="current_page" split="10" inactive_block="page" prev_page_block="prev_page" next_page_block="next_page" prev_page_split_block="prev_page_split" next_page_split_block="next_page_split" main_special="$main_special" ajax="$ajax"/>
+ </td>
+ <inp2:m_if check="m_ParamEquals" param="search" value="on">
+ <inp2:m_if check="m_ParamEquals" name="SearchPrefixSpecial" value="">
+ <inp2:m_RenderElement name="grid_search" grid="$grid" PrefixSpecial="$PrefixSpecial" ajax="$ajax"/>
+ <inp2:m_else />
+ <inp2:m_RenderElement name="grid_search" grid="$grid" PrefixSpecial="$SearchPrefixSpecial" ajax="$ajax"/>
+ </inp2:m_if>
+ </inp2:m_if>
+ <td>
+ </tr>
+ </tbody>
+</table>
+<inp2:m_blockend/>
+
+<inp2:m_DefineElement name="grid_search" ajax="0">
+ <td align="right" style="padding-right: 0px;">
+ <table width="100%" cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td><inp2:m_phrase name="la_Search"/>: </td>
+ <td>
+ <input type="text"
+ id="<inp2:m_param name="PrefixSpecial"/>_search_keyword"
+ name="<inp2:m_param name="PrefixSpecial"/>_search_keyword"
+ value="<inp2:m_recall var="{$PrefixSpecial}_search_keyword" no_null="no_null" special="1"/>"
+ PrefixSpecial="<inp2:m_param name="PrefixSpecial"/>"
+ Grid="<inp2:m_param name="grid"/>"
+ ajax="<inp2:m_param name="ajax"/>"
+ style="border: 1px solid grey;">
+ <input type="text" style="display: none"; />
+ </td>
+ <td id="search_buttons[<inp2:m_param name="PrefixSpecial"/>]">
+ <script type="text/javascript">
+ <inp2:m_RenderElement name="grid_search_buttons" pass_params="true"/>
+ </script>
+ </td>
+ </tr>
+ </table>
+ </td>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="grid_search_buttons" PrefixSpecial="" grid="" ajax="1">
+ document.getElementById('<inp2:m_param name="PrefixSpecial"/>_search_keyword').onkeydown = search_keydown;
+ Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'] = new ToolBar('icon16_');
+ Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].AddButton(
+ new ToolBarButton(
+ 'search',
+ '<inp2:m_phrase name="la_ToolTip_Search" escape="1"/>',
+ function() { search('<inp2:m_param name="PrefixSpecial"/>','<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>) },
+ null,
+ '<inp2:m_param name="PrefixSpecial"/>') );
+ Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].AddButton(
+ new ToolBarButton(
+ 'search_reset',
+ '<inp2:m_phrase name="la_ToolTip_SearchReset" escape="1"/>',
+ function() { search_reset('<inp2:m_param name="PrefixSpecial"/>','<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>) },
+ null,
+ '<inp2:m_param name="PrefixSpecial"/>') );
+ Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].Render(document.getElementById('search_buttons[<inp2:m_param name="PrefixSpecial"/>]'));
+</inp2:m_DefineElement>
+
+<inp2:m_block name="grid_column_title" use_phrases="1"/>
+ <td nowrap="nowrap">
+ <a href="javascript:resort_grid('<inp2:m_param name="PrefixSpecial"/>','<inp2:m_param name="sort_field"/>', <inp2:m_param name="ajax"/>);" class="columntitle_small"><IMG alt="" src="img/list_arrow_<inp2:$PrefixSpecial_order field="$sort_field"/>.gif" border="0" align="absmiddle"><inp2:m_if check="m_ParamEquals" name="use_phrases" value="1"><inp2:m_phrase name="$title"/><inp2:m_else/><inp2:m_param name="title"/></inp2:m_if></a>
+ </td>
+<inp2:m_blockend/>
+
+<inp2:m_block name="grid_column_title_no_sorting" use_phrases="1"/>
+ <td nowrap="nowrap">
+ <inp2:m_if check="m_ParamEquals" name="use_phrases" value="1"><inp2:m_phrase name="$title"/><inp2:m_else/><inp2:m_param name="title"/></inp2:m_if>
+ </td>
+<inp2:m_blockend/>
+
+<inp2:m_block name="grid_checkbox_td" format="" />
+ <td valign="top" class="text">
+ <table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
+ <tr>
+ <td><input type="checkbox" name="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>"></td>
+ <td><img src="<inp2:ModulePath />img/itemicons/<inp2:$PrefixSpecial_ItemIcon grid="$grid"/>"></td>
+ <td><inp2:Field field="$field" no_special="no_special" format="$format"/></td>
+ </tr>
+ </table>
+ </td>
+<inp2:m_blockend />
+
+<inp2:m_block name="grid_checkbox_td_no_icon" format="" />
+ <td valign="top" class="text">
+ <table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
+ <tr>
+ <td><input type="checkbox" name="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>"></td>
+ <td><inp2:$PrefixSpecial_field field="$field" no_special="no_special" format="$format"/></td>
+ </tr>
+ </table>
+ </td>
+<inp2:m_blockend />
+
+<inp2:m_block name="label_grid_checkbox_td" format="" />
+ <td valign="top" class="text">
+ <table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
+ <tr>
+ <td><input type="checkbox" name="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>"></td>
+ <td><img src="<inp2:ModulePath />img/itemicons/<inp2:$PrefixSpecial_ItemIcon grid="$grid"/>"></td>
+ <td><inp2:$PrefixSpecial_field field="$field" no_special="no_special" as_label="as_label" format="$format"/></td>
+ </tr>
+ </table>
+ </td>
+<inp2:m_blockend />
+
+<inp2:m_block name="grid_icon_td" format="" />
+ <td valign="top" class="text">
+ <table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
+ <tr>
+ <td><img src="<inp2:ModulePath />img/itemicons/<inp2:$PrefixSpecial_ItemIcon grid="$grid"/>"></td>
+ <td><inp2:$PrefixSpecial_field field="$field" no_special="no_special" format="$format"/></td>
+ </tr>
+ </table>
+ </td>
+<inp2:m_blockend />
+
+<inp2:m_block name="grid_radio_td" format="" />
+ <td valign="top" class="text">
+ <table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
+ <tr>
+ <td><input type="radio" name="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>"></td>
+ <td><img src="<inp2:ModulePath />img/itemicons/<inp2:$PrefixSpecial_ItemIcon grid="$grid"/>"></td>
+ <td><inp2:Field field="$field" no_special="no_special" format="$format"/></td>
+ </tr>
+ </table>
+ </td>
+<inp2:m_blockend />
+
+<inp2:m_block name="grid_data_td" format="" no_special="" nl2br="" first_chars=""/>
+ <td valign="top" class="text"><inp2:$PrefixSpecial_field field="$field" first_chars="$first_chars" nl2br="$nl2br" grid="$grid" no_special="$no_special" format="$format"/></td>
+<inp2:m_blockend />
+
+<inp2:m_block name="grid_edit_td" format="" />
+ <td valign="top" class="text"><input type="text" id="<inp2:$PrefixSpecial_InputName field="$field"/>" name="<inp2:$PrefixSpecial_InputName field="$field"/>" value="<inp2:$PrefixSpecial_field field="$field" grid="$grid" format="$format"/>"></td>
+<inp2:m_blockend />
+
+<inp2:m_block name="grid_data_label_td" />
+ <td valign="top" class="text"><inp2:$PrefixSpecial_field field="$field" grid="$grid" plus_or_as_label="1" no_special="no_special" format="$format"/></td>
+<inp2:m_blockend />
+
+<inp2:m_block name="grid_data_label_ml_td" format="" />
+ <td valign="top" class="text">
+ <span class="<inp2:m_if check="{$SourcePrefix}_HasError" field="$virtual_field">error</inp2:m_if>">
+ <inp2:$PrefixSpecial_Field field="$field" grid="$grid" as_label="1" no_special="no_special" format="$format"/>
+ </span><inp2:m_if check="{$SourcePrefix}_IsRequired" field="$virtual_field"/><span class="error"> *</span></inp2:m_if>:<br />
+ <inp2:m_if check="FieldEquals" field="$ElementTypeField" value="textarea">
+ <a href="javascript:PreSaveAndOpenTranslatorCV('<inp2:m_param name="SourcePrefix"/>,<inp2:m_param name="SourcePrefix"/>-cdata', '<inp2:m_param name="SourcePrefix"/>-cdata:cust_<inp2:Field name="CustomFieldId"/>', 'popups/translator', <inp2:$SourcePrefix_Field field="ResourceId"/>, 1);" title="<inp2:m_Phrase label="la_Translate" escape="1"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand;" border="0"></a>
+ <inp2:m_else/>
+ <a href="javascript:PreSaveAndOpenTranslatorCV('<inp2:m_param name="SourcePrefix"/>,<inp2:m_param name="SourcePrefix"/>-cdata', '<inp2:m_param name="SourcePrefix"/>-cdata:cust_<inp2:Field name="CustomFieldId"/>', 'popups/translator', <inp2:$SourcePrefix_Field field="ResourceId"/>);" title="<inp2:m_Phrase label="la_Translate" escape="1"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand;" border="0"></a>
+ </inp2:m_if>
+ </td>
+<inp2:m_blockend />
+
+<inp2:m_DefineElement name="grid_column_filter">
+ <td> </td>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="grid_options_filter">
+ <td>
+ <select name="<inp2:SearchInputName field="$field"/>">
+ <inp2:PredefinedSearchOptions field="$field" block="inp_option_item" selected="selected" has_empty="1" empty_value=""/>
+ </select>
+ </td>
+</inp2:m_DefineElement>
+
+<inp2:m_block name="viewmenu_sort_block"/>
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuItem('<inp2:m_phrase name="$title" escape="1"/>','direct_sort_grid("<inp2:m_param name="PrefixSpecial"/>","<inp2:m_param name="sort_field"/>","<inp2:$PrefixSpecial_OrderInfo type="direction" pos="1"/>", null, <inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="IsOrder" field="$sort_field" pos="1"/>2<inp2:m_endif/>');
+<inp2:m_blockend/>
+
+<inp2:m_block name="viewmenu_filter_block"/>
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuItem('<inp2:m_param name="label"/>','<inp2:m_param name="filter_action"/>','<inp2:m_param name="filter_status"/>');
+<inp2:m_blockend/>
+
+<inp2:m_block name="viewmenu_filter_separator"/>
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuSeparator();
+<inp2:m_blockend/>
+
+<inp2:m_block name="viewmenu_declaration" menu_filters="no" menu_sorting="yes" menu_perpage="yes" menu_select="yes" ajax="0"/>
+ // define ViewMenu
+ $fw_menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'] = function()
+ {
+ <inp2:m_if check="m_ParamEquals" name="menu_filters" value="yes">
+ // filtring menu
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'] = new Menu('<inp2:m_phrase name="la_Text_View" escape="1"/>');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuItem('All','filters_remove_all("<inp2:m_param name="PrefixSpecial"/>", <inp2:m_param name="ajax"/>);');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuItem('None','filters_apply_all("<inp2:m_param name="PrefixSpecial"/>", <inp2:m_param name="ajax"/>);');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuSeparator();
+ <inp2:$PrefixSpecial_DrawFilterMenu item_block="viewmenu_filter_block" spearator_block="viewmenu_filter_separator" ajax="$ajax"/>
+ </inp2:m_if>
+
+ <inp2:m_if check="m_ParamEquals" name="menu_sorting" value="yes">
+ // sorting menu
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'] = new Menu('<inp2:m_phrase name="la_Text_Sort" escape="1"/>');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuItem('<inp2:m_phrase name="la_common_ascending" escape="1"/>','direct_sort_grid("<inp2:m_param name="PrefixSpecial"/>","<inp2:$PrefixSpecial_OrderInfo type="field" pos="1"/>","asc",null,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="IsOrder" direction="asc" pos="1"/>2<inp2:m_endif/>');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuItem('<inp2:m_phrase name="la_common_descending" escape="1"/>','direct_sort_grid("<inp2:m_param name="PrefixSpecial"/>","<inp2:$PrefixSpecial_OrderInfo type="field" pos="1"/>","desc",null,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="IsOrder" direction="desc" pos="1"/>2<inp2:m_endif/>');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuSeparator();
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuItem('<inp2:m_phrase name="la_Text_Default" escape="1"/>','reset_sorting("<inp2:m_param name="PrefixSpecial"/>");');
+ <inp2:$PrefixSpecial_IterateGridFields grid="$grid" mode="header" block="viewmenu_sort_block" ajax="$ajax"/>
+ </inp2:m_if>
+
+ <inp2:m_if check="m_ParamEquals" name="menu_perpage" value="yes">
+ // per page menu
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'] = new Menu('<inp2:m_phrase name="la_prompt_PerPage" escape="1"/>');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('10','set_per_page("<inp2:m_param name="PrefixSpecial"/>",10,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="10"/>2<inp2:m_endif/>');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('20','set_per_page("<inp2:m_param name="PrefixSpecial"/>",20,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="20"/>2<inp2:m_endif/>');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('50','set_per_page("<inp2:m_param name="PrefixSpecial"/>",50,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="50"/>2<inp2:m_endif/>');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('100','set_per_page("<inp2:m_param name="PrefixSpecial"/>",100,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="100"/>2<inp2:m_endif/>');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('500','set_per_page("<inp2:m_param name="PrefixSpecial"/>",500,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="500"/>2<inp2:m_endif/>');
+ </inp2:m_if>
+
+ <inp2:m_if check="m_ParamEquals" name="menu_select" value="yes">
+ // select menu
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'] = new Menu('<inp2:m_phrase name="la_Text_Select" escape="1"/>');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].addMenuItem('<inp2:m_phrase name="la_Text_All" escape="1"/>','Grids["<inp2:m_param name="PrefixSpecial"/>"].SelectAll();');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].addMenuItem('<inp2:m_phrase name="la_Text_Unselect" escape="1"/>','Grids["<inp2:m_param name="PrefixSpecial"/>"].ClearSelection();');
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].addMenuItem('<inp2:m_phrase name="la_Text_Invert" escape="1"/>','Grids["<inp2:m_param name="PrefixSpecial"/>"].InvertSelection();');
+ </inp2:m_if>
+
+ processHooks('ViewMenu', hBEFORE, '<inp2:m_param name="PrefixSpecial"/>');
+
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'] = new Menu('<inp2:$PrefixSpecial_GetItemName/>');
+ <inp2:m_if check="m_ParamEquals" name="menu_filters" value="yes">
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addMenuItem( $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'] );
+ </inp2:m_if>
+ <inp2:m_if check="m_ParamEquals" name="menu_sorting" value="yes">
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addMenuItem( $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'] );
+ </inp2:m_if>
+ <inp2:m_if check="m_ParamEquals" name="menu_perpage" value="yes">
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addMenuItem( $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'] );
+ </inp2:m_if>
+ <inp2:m_if check="m_ParamEquals" name="menu_select" value="yes">
+ $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addMenuItem( $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'] );
+ </inp2:m_if>
+
+ processHooks('ViewMenu', hAFTER, '<inp2:m_param name="PrefixSpecial"/>');
+ }
+<inp2:m_blockend/>
+
+<inp2:m_block name="grid_save_warning" />
+ <table width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_<inp2:m_if prefix="m" function="ParamEquals" name="no_toolbar" value="no_toolbar"/>nobottom<inp2:m_else/>notop<inp2:m_endif/>">
+ <tr>
+ <td valign="top" class="hint_red">
+ <inp2:m_phrase name="la_Warning_Save_Item"/>
+ </td>
+ </tr>
+ </table>
+ <script type="text/javascript">
+ $edit_mode = <inp2:m_if check="m_ParamEquals" name="edit_mode" value="1">true<inp2:m_else />false</inp2:m_if>;
+// window.parent.document.title += ' - MODE: ' + ($edit_mode ? 'EDIT' : 'LIVE');
+ </script>
+<inp2:m_blockend/>
+
+<inp2:m_DefineElement name="grid" main_prefix="" per_page="" main_special="" no_toolbar="" grid_filters="" search="on" header_block="grid_column_title" filter_block="grid_column_filter" data_block="grid_data_td" row_block="_row" ajax="0">
+<!--
+ grid_filters - show individual filters for each column
+ has_filters - draw filter section in "View" menu in toolbar
+-->
+ <inp2:$PrefixSpecial_SaveWarning name="grid_save_warning" main_prefix="$main_prefix" no_toolbar="$no_toolbar"/>
+ <inp2:m_if check="m_RecallEquals" var="{$PrefixSpecial}_search_keyword" value="" inverse="inverse">
+ <table width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_<inp2:m_if prefix="m" function="ParamEquals" name="no_toolbar" value="no_toolbar"/>nobottom<inp2:m_else/>notop<inp2:m_endif/>">
+ <tr>
+ <td valign="top" class="hint_red">
+ <inp2:m_phrase name="la_Warning_Filter"/>
+ </td>
+ </tr>
+ </table>
+ </inp2:m_if>
+
+ <inp2:m_if check="m_ParamEquals" name="per_page" value="-1" inverse="1">
+ <inp2:m_ParseBlock name="grid_pagination" grid="$grid" PrefixSpecial="$PrefixSpecial" main_special="$main_special" search="$search" no_toolbar="$no_toolbar" ajax="$ajax"/>
+ </inp2:m_if>
+ <table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+
+ <inp2:m_if check="m_ParamEquals" name="grid_filters" value="1">
+ <tr class="pagination_bar">
+ <inp2:$PrefixSpecial_IterateGridFields grid="$grid" mode="filter" block="$filter_block" ajax="$ajax"/>
+ </tr>
+ </inp2:m_if>
+
+ <tr class="subsectiontitle">
+ <inp2:$PrefixSpecial_IterateGridFields grid="$grid" mode="header" block="$header_block" ajax="$ajax"/>
+ </tr>
+
+ <inp2:m_DefineElement name="_row">
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>" id="<inp2:m_param name="PrefixSpecial"/>_<inp2:Field field="$IdField"/>" sequence="<inp2:m_get param="{$PrefixSpecial}_sequence"/>"><inp2:m_inc param="{$PrefixSpecial}_sequence" by="1"/>
+ <inp2:IterateGridFields grid="$grid" mode="data" block="$data_block"/>
+ </tr>
+ </inp2:m_DefineElement>
+ <inp2:m_set {$PrefixSpecial}_sequence="1" odd_even="table_color1"/>
+ <inp2:$PrefixSpecial_PrintList block="$row_block" per_page="$per_page" main_special="$main_special" />
+
+ </table>
+
+ <inp2:m_if check="m_ParamEquals" name="ajax" value="0">
+ <inp2:m_if check="m_GetEquals" name="fw_menu_included" value="">
+ <script type="text/javascript" src="incs/fw_menu.js"></script>
+ <inp2:m_set fw_menu_included="1"/>
+ </inp2:m_if>
+
+ <script type="text/javascript">
+ <inp2:m_RenderElement name="grid_js" selected_class="selected_div" tag_name="tr" pass_params="true"/>
+ </script>
+ </inp2:m_if>
+
+ <input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1" name="<inp2:m_param name="PrefixSpecial"/>_Sort1" value="">
+ <input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" name="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" value="asc">
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="grid_js" ajax="1">
+ <inp2:m_if check="m_ParamEquals" name="no_init" value="no_init" inverse="inverse">
+ Grids['<inp2:m_param name="PrefixSpecial"/>'] = new Grid('<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="selected_class"/>', ':original', edit, a_toolbar);
+ Grids['<inp2:m_param name="PrefixSpecial"/>'].AddItemsByIdMask('<inp2:m_param name="tag_name"/>', /^<inp2:m_param name="PrefixSpecial"/>_([\d\w-]+)/, '<inp2:m_param name="PrefixSpecial"/>[$$ID$$][<inp2:m_param name="IdField"/>]');
+ Grids['<inp2:m_param name="PrefixSpecial"/>'].InitItems();
+ </inp2:m_if>
+ <inp2:m_ParseBlock name="viewmenu_declaration" pass_params="true"/>
+ $ViewMenus = new Array('<inp2:m_param name="PrefixSpecial"/>');
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="white_grid" main_prefix="" per_page="" main_special="" no_toolbar="" search="on" render_as="" columns="2" direction="V" empty_cell_render_as="wg_empty_cell" ajax="0">
+ <inp2:$PrefixSpecial_SaveWarning name="grid_save_warning" main_prefix="$main_prefix" no_toolbar="$no_toolbar"/>
+ <inp2:m_if check="m_RecallEquals" var="{$PrefixSpecial}_search_keyword" value="" inverse="inverse">
+ <table width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_<inp2:m_if prefix="m" function="ParamEquals" name="no_toolbar" value="no_toolbar"/>nobottom<inp2:m_else/>notop<inp2:m_endif/>">
+ <tr>
+ <td valign="top" class="hint_red">
+ <inp2:m_phrase name="la_Warning_Filter"/>
+ </td>
+ </tr>
+ </table>
+ </inp2:m_if>
+ <inp2:m_if check="m_ParamEquals" name="per_page" value="-1" inverse="1">
+ <inp2:m_ParseBlock name="grid_pagination" grid="$grid" PrefixSpecial="$PrefixSpecial" main_special="$main_special" search="$search" no_toolbar="$no_toolbar" ajax="$ajax"/>
+ </inp2:m_if>
+ <br />
+
+ <inp2:m_DefineElement name="wg_empty_cell">
+ <td width="<inp2:m_param name="column_width"/>%"> </td>
+ </inp2:m_DefineElement>
+
+ <table width="100%" border="0" cellspacing="2" cellpadding="4">
+ <inp2:m_set {$PrefixSpecial}_sequence="1" odd_even="table_color1"/>
+ <inp2:$PrefixSpecial_PrintList2 pass_params="true"/>
+ </table>
+
+ <inp2:m_if check="m_ParamEquals" name="ajax" value="0">
+ <inp2:m_if check="m_GetEquals" name="fw_menu_included" value="">
+ <script type="text/javascript" src="incs/fw_menu.js"></script>
+ <inp2:m_set fw_menu_included="1"/>
+ </inp2:m_if>
+
+ <script type="text/javascript">
+ <inp2:m_RenderElement name="grid_js" selected_class="table_white_selected" tag_name="td" pass_params="true"/>
+ </script>
+ </inp2:m_if>
+
+ <input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1" name="<inp2:m_param name="PrefixSpecial"/>_Sort1" value="">
+ <input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" name="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" value="asc">
+</inp2:m_DefineElement>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/incs/grid_blocks.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/incs/tab_blocks.tpl
===================================================================
--- trunk/core/admin_templates/incs/tab_blocks.tpl (nonexistent)
+++ trunk/core/admin_templates/incs/tab_blocks.tpl (revision 6656)
@@ -0,0 +1,58 @@
+<inp2:m_block name="init_tab"/>
+ <inp2:m_if prefix="m" function="is_active" templ="$t$"/>
+ <inp2:m_set main_prefix="$main_prefix"/>
+ <inp2:m_endif/>
+<inp2:m_blockend/>
+
+<inp2:m_block name="prepare_tab"/>
+ <inp2:m_if prefix="m" function="is_active" templ="$t$"/>
+ <inp2:m_set active="active_" bgcolor="#FFA916" class="tab"/>
+ <inp2:m_else/>
+ <inp2:m_set active="" bgcolor="#009FF0" class="tab2"/>
+ <inp2:m_endif/>
+<inp2:m_blockend/>
+
+<inp2:m_block name="tab"/>
+ <inp2:m_ParseBlock name="prepare_tab" t="$t"/>
+ <td>
+ <table style="background: <inp2:m_get param="bgcolor"/> url(img/tab_<inp2:m_get param="active"/>back3.jpg) no-repeat top left;" cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td><img alt="" src="img/tab_<inp2:m_get param="active"/>left.gif" width="15" height="23"></td>
+ <td nowrap align="center" style="border-top: 1px solid #000000;">
+ <a href="javascript:go_to_tab('<inp2:m_param name="main_prefix"/>', '<inp2:m_param name="t"/>')" class="<inp2:m_get param="class"/>" onClick=""><inp2:m_phrase name="$title"/></a><br>
+ </td>
+ <td><img alt="" src="img/tab_<inp2:m_get param="active"/>right.gif" width="15" height="23"></td>
+ </tr>
+ </table>
+ </td>
+<inp2:m_blockend/>
+
+<inp2:m_block name="tab_direct" pass="m"/>
+ <inp2:m_ParseBlock name="prepare_tab" t="$t"/>
+ <td>
+ <table style="background: <inp2:m_get param="bgcolor"/> url(img/tab_<inp2:m_get param="active"/>back3.jpg) no-repeat top left;" cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td><img alt="" src="img/tab_<inp2:m_get param="active"/>left.gif" width="15" height="23"></td>
+ <td nowrap align="center" style="border-top: 1px solid #000000;">
+ <a href="<inp2:m_t t="$t" pass="$pass"/>" class="<inp2:m_get param="class"/>" onClick=""><inp2:m_phrase name="$title"/></a><br>
+ </td>
+ <td><img alt="" src="img/tab_<inp2:m_get param="active"/>right.gif" width="15" height="23"></td>
+ </tr>
+ </table>
+ </td>
+<inp2:m_blockend/>
+
+<inp2:m_block name="tab_list"/>
+ <inp2:m_ParseBlock name="prepare_tab" t="$t"/>
+ <td>
+ <table style="background: <inp2:m_get param="bgcolor"/> url(img/tab_<inp2:m_get param="active"/>back3.jpg) no-repeat top left;" cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td><img alt="" src="img/tab_<inp2:m_get param="active"/>left.gif" width="15" height="23"></td>
+ <td nowrap align="center" <inp2:m_if check="m_getequals" name="active" value="active_">style="border-top: black 1px solid;"</inp2:m_if> background="img/tab_<inp2:m_get param="active"/>back.gif">
+ <a href="javascript:go_to_list('<inp2:m_get param="main_prefix"/>', '<inp2:m_param name="t"/>')" class="<inp2:m_get param="class"/>" onClick=""><inp2:m_phrase name="$title"/></a><br>
+ </td>
+ <td><img alt="" src="img/tab_<inp2:m_get param="active"/>right.gif" width="15" height="23"></td>
+ </tr>
+ </table>
+ </td>
+<inp2:m_blockend/>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/incs/tab_blocks.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/incs/in-portal.tpl
===================================================================
--- trunk/core/admin_templates/incs/in-portal.tpl (nonexistent)
+++ trunk/core/admin_templates/incs/in-portal.tpl (revision 6656)
@@ -0,0 +1,3 @@
+<inp2:m_include t="incs/tab_blocks"/>
+<inp2:m_include t="incs/form_blocks"/>
+<inp2:m_include t="incs/grid_blocks"/>
Property changes on: trunk/core/admin_templates/incs/in-portal.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/incs/header.tpl
===================================================================
--- trunk/core/admin_templates/incs/header.tpl (nonexistent)
+++ trunk/core/admin_templates/incs/header.tpl (revision 6656)
@@ -0,0 +1,46 @@
+<!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">-->
+<html>
+<head>
+<title>In-Portal :: Administration Panel</title>
+
+<meta http-equiv="content-type" content="text/html; charset=<inp2:lang_GetCharset/>">
+<meta name="keywords" content="...">
+<meta name="description" content="...">
+<meta name="robots" content="all">
+<meta name="copyright" content="Copyright ® 2006 Test, Inc">
+<meta name="author" content="Intechnic Inc.">
+
+<inp2:m_base_ref/>
+
+<link rel="icon" href="img/favicon.ico" type="image/x-icon" />
+<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
+<link rel="stylesheet" rev="stylesheet" href="incs/style.css" type="text/css" />
+
+<script language="javascript" src="js/is.js"></script>
+<script language="javascript" src="js/script.js"></script>
+<script language="javascript" src="js/in-portal.js"></script>
+<script language="javascript" src="js/toolbar.js"></script>
+<script language="javascript" src="js/grid.js"></script>
+<script language="javascript">
+var t = '<inp2:m_get param="t"/>';
+var popups = '1';
+var multiple_windows = '1';
+var main_title = '<inp2:m_GetConfig var="Site_Name" escape="1"/>';
+var tpl_changed = 0;
+var base_url = '<inp2:m_BaseURL/>';
+var $base_path = '<inp2:m_GetConst name="BASE_PATH"/>';
+var img_path = '<inp2:m_TemplatesBase module="#MODULE#"/>/img/';
+
+</script>
+</head>
+
+<inp2:m_include t="incs/blocks"/>
+<inp2:m_include t="incs/in-portal"/>
+
+<inp2:m_if check="m_ParamEquals" name="nobody" value="yes" inverse="inverse">
+ <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" <inp2:m_get param="body_properties"/>>
+</inp2:m_if>
+
+<inp2:m_if check="m_ParamEquals" name="noform" value="yes" inverse="inverse">
+ <inp2:m_ParseBlock name="kernel_form"/>
+</inp2:m_if>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/incs/header.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/incs/style.css
===================================================================
--- trunk/core/admin_templates/incs/style.css (nonexistent)
+++ trunk/core/admin_templates/incs/style.css (revision 6656)
@@ -0,0 +1,587 @@
+/* --- In-Portal --- */
+
+
+.head_version {
+ font-family: verdana, arial;
+ font-size: 10px;
+ font-weight: normal;
+ color: white;
+ padding-right: 5px;
+ text-decoration: none;
+}
+
+body {
+ font-family: Verdana, Arial, Helvetica, Sans-serif;
+ font-size: 12px;
+ color: #000000;
+ scrollbar-3dlight-color: #333333;
+ scrollbar-arrow-color: #ffffff;
+ scrollbar-track-color: #88d2f8;
+ scrollbar-darkshadow-color: #333333;
+ scrollbar-highlight-color: #009ffd;
+ scrollbar-shadow-color: #009ffd;
+ scrollbar-face-color: #009ffd;
+ overflow-x: auto; overflow-y: auto;
+}
+
+A {
+ color: #006699;
+ text-decoration: none;
+}
+
+A:hover {
+ color: #009ff0;
+ text-decoration: none;
+}
+
+TD {
+ font-family: verdana,helvetica;
+ font-size: 10pt;
+ text-decoration: none;
+}
+
+form {
+ display: inline;
+}
+
+.text {
+ font-family: verdana, arial;
+ font-size: 12px;
+ font-weight: normal;
+ text-decoration: none;
+}
+
+.tablenav {
+ font-family: verdana, arial;
+ font-size: 14px;
+ font-weight: bold;
+ color: #FFFFFF;
+
+ text-decoration: none;
+ background-color: #73C4F5;
+ background: url(../img/tabnav_back.gif) repeat-x;
+}
+
+.tablenav_link {
+ font-family: verdana, arial;
+ font-size: 14px;
+ font-weight: bold;
+ color: #FFFFFF;
+ text-decoration: none;
+}
+
+.header_left_bg {
+ background: url(../img/tabnav_left.gif) no-repeat;
+}
+
+.tablenav_link:hover {
+ font-family: verdana, arial;
+ font-size: 14px;
+ font-weight: bold;
+ color: #ffcc00;
+ text-decoration: none;
+}
+
+.tableborder {
+ font-family: arial, helvetica, sans-serif;
+ font-size: 10pt;
+ border: 1px solid #000000;
+ border-top-width: 0px;
+ border-collapse: collapse;
+}
+
+.tableborder_full, .tableborder_full_kernel {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ border: 1px solid #000000;
+}
+
+
+.button {
+ font-family: arial, verdana;
+ font-size: 12px;
+ font-weight: normal;
+ color: #000000;
+ background: url(../img/button_back.gif) #f9eeae repeat-x;
+ text-decoration: none;
+}
+
+.button-disabled {
+ font-family: arial, verdana;
+ font-size: 12px;
+ font-weight: normal;
+ color: #676767;
+ background: url(../img/button_back_disabled.gif) #f9eeae repeat-x;
+ text-decoration: none;
+}
+
+.hint_red {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ font-style: normal;
+ color: #FF0000;
+ /* background-color: #F0F1EB; */
+}
+
+.tree_head {
+ font-family: verdana, arial;
+ font-size: 10px;
+ font-weight: bold;
+ color: #FFFFFF;
+ text-decoration: none;
+}
+
+.admintitle {
+ font-family: verdana, arial;
+ font-size: 20px;
+ font-weight: bold;
+ color: #009FF0;
+ text-decoration: none;
+}
+
+.table_border_notop, .table_border_nobottom {
+ background-color: #F0F1EB;
+ border: 1px solid #000000;
+}
+
+.table_border_notop {
+ border-top-width: 0px;
+}
+
+.table_border_nobottom {
+ border-bottom-width: 0px;
+}
+
+.pagination_bar {
+ background-color: #D7D7D7;
+ border: 1px solid #000000;
+ border-top-width: 0px;
+}
+
+/* Categories */
+
+.priority {
+ color: #FF0000;
+ padding-left: 1px;
+ padding-right: 1px;
+ font-size: 11px;
+}
+
+.cat_no, .cat_desc, .cat_new, .cat_pick, .cats_stats {
+ font-family: arial, verdana, sans-serif;
+}
+
+.cat_no {
+ font-size: 10px;
+ color: #707070;
+}
+
+.cat_desc {
+ font-size: 9pt;
+ color: #000000;
+}
+
+.cat_new {
+ font-size: 12px;
+ vertical-align: super;
+ color: blue;
+}
+
+.cat_pick {
+ font-size: 12px;
+ vertical-align: super;
+ color: #009900;
+}
+
+.cats_stats {
+ font-size: 11px;
+ color: #707070;
+}
+
+/* Links */
+
+.link, .link:hover, .link_desc, .link_detail {
+ font-family: arial, helvetica, sans-serif;
+}
+
+.link {
+ font-size: 9pt;
+ color: #1F569A;
+}
+
+.link:hover {
+ font-size: 9pt;
+ color: #009FF0;
+}
+
+.link_desc {
+ font-size: 9pt;
+ color: #000000;
+}
+
+.link_detail {
+ font-size: 11px;
+ color: #707070;
+}
+
+.link_rate, .link_review, .link_modify, .link_div, .link_new, .link_top, .link_pop, .link_pick {
+ font-family: arial, helvetica, sans-serif;
+ font-size: 12px;
+}
+
+.link_rate, .link_review, .link_modify, .link_div {
+ text-decoration: none;
+}
+
+.link_rate { color: #006600; }
+.link_review { color: #A27900; }
+.link_modify { color: #800000; }
+.link_div { color: #000000; }
+
+.link_new, .link_top, .link_pop, .link_pick {
+ vertical-align: super;
+}
+
+.link_new { color: #0000FF; }
+.link_top { color: #FF0000; }
+.link_pop { color: FFA500; }
+.link_pick { color: #009900; }
+
+/* ToolBar */
+
+.divider {
+ BACKGROUND-COLOR: #999999
+}
+
+.toolbar {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ border: 1px solid #000000;
+ border-width: 0 1 1 1;
+ background-color: #F0F1EB;
+}
+
+.current_page {
+ font-family: verdana;
+ font-size: 12px;
+ font-weight: bold;
+ background-color: #C4C4C4;
+ padding-left: 1px;
+ padding-right: 1px;
+}
+
+.nav_url {
+ font-family: verdana;
+ font-size: 12px;
+ font-weight: bold;
+ color: #1F569A;
+}
+
+.nav_arrow {
+ font-family: verdana;
+ font-size: 12px;
+ font-weight: normal;
+ color: #1F569A;
+ padding-left: 3px;
+ padding-right: 3px;
+}
+
+.nav_current_item {
+ font-family: verdana;
+ font-size: 12px;
+ font-weight: bold;
+ color: #666666;
+}
+
+/* Edit forms */
+
+.hint {
+ font-family: arial, helvetica, sans-serif;
+ font-size: 12px;
+ font-style: normal;
+ color: #666666;
+}
+
+.table_color1, .table_color2 {
+ font-family: verdana, arial;
+ font-size: 14px;
+ font-weight: normal;
+ color: #000000;
+ text-decoration: none;
+}
+
+.table_color1 { background-color: #F6F6F6; }
+.table_color2 { background-color: #EBEBEB; }
+
+
+.table_white, .table_white_selected {
+ font-family: verdana, arial;
+ font-weight: normal;
+ font-size: 14px;
+ color: #000000;
+ text-decoration: none;
+ padding-top: 0px;
+ padding-bottom: 0px;
+}
+
+.table_white {
+ background-color: #FFFFFF;
+}
+
+.table_white_selected {
+ background-color: #C6D6EF;
+}
+
+.subsectiontitle {
+ font-family: verdana, arial;
+ font-size: 14px;
+ font-weight: bold;
+ background-color: #999999;
+ text-decoration: none;
+
+ color: #FFFFFF;
+
+}
+
+.subsectiontitle:hover {
+ font-family: verdana, arial;
+ font-size: 14px;
+ font-weight: bold;
+ background-color: #999999;
+ text-decoration: none;
+
+ color: #FFCC00;
+}
+
+.error {
+ font-family: arial, helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 9pt;
+ color: #FF0000;
+}
+
+/* Tabs */
+
+.tab_border {
+ border: 1px solid #000000;
+ border-width: 1 0 0 0;
+}
+
+.tab, .tab:hover {
+ font-family: verdana, arial, helvetica;
+ font-size: 12px;
+ font-weight: bold;
+ color: #000000;
+ text-decoration: none;
+}
+
+.tab2, .tab2:hover {
+ font-family: verdana, arial, helvetica;
+ font-size: 12px;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+.tab2 { color: #FFFFFF; }
+.tab2:hover { color: #000000; }
+
+/* Item DIVS */
+
+.selected_div { background-color: #C6D6EF; }
+.notselected_div { background-color: #FFFFFF; }
+
+/* Item tabs */
+
+
+.itemtab_active {
+ background: url("../img/itemtabs/tab_active.gif") #eee repeat-x;
+}
+
+.itemtab_inactive {
+ background: url("../img/itemtabs/tab_inactive.gif") #F9EEAE repeat-x;
+}
+
+
+/* Grids */
+
+.columntitle, .columntitle:hover {
+ font-family: verdana, arial;
+ font-size: 14px;
+ font-weight: bold;
+ background-color: #999999;
+ text-decoration: none;
+}
+
+.columntitle { color: #FFFFFF; }
+.columntitle:hover { color: #FFCC00; }
+
+.columntitle_small, .columntitle_small:hover {
+ font-family: verdana, arial;
+ font-size: 12px;
+ font-weight: bold;
+ background-color: #999999;
+ text-decoration: none;
+}
+
+.columntitle_small { color: #FFFFFF; }
+.columntitle_small:hover { color: #FFCC00; }
+
+/* ----------------------------- */
+
+.section_header_bg {
+ background: url(../img/logo_bg.gif) no-repeat top right;
+}
+
+.small {
+ font-size: 9px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+}
+
+/* order preview & preview_print styles */
+
+.order_print_defaults TD,
+.order_preview_header,
+.order_preview_header TD,
+.order_print_preview_header TD,
+.order_preview_field_name,
+.order-totals-name,
+.arial2r,
+.orders_print_flat_table TD {
+ font-family: Arial;
+ font-size: 10pt;
+}
+
+.order_preview_header, .order_preview_header TD, .order_print_preview_header TD {
+ background-color: #C9E9FE;
+ font-weight: bold;
+}
+
+.order_print_preview_header TD {
+ background-color: #FFFFFF;
+}
+
+.order_preview_field_name {
+ font-weight: bold;
+ padding: 2px 4px 2px 4px;
+}
+
+.order-totals-name {
+ font-style: normal;
+}
+
+.border1 {
+ border: 1px solid #111111;
+}
+
+.arial2r {
+ color: #602830;
+ font-weight: bold;
+}
+
+.orders_flat_table, .orders_print_flat_table {
+ border-collapse: collapse;
+ margin: 5px;
+}
+
+.orders_flat_table TD {
+ padding: 2px 5px 2px 5px;
+ border: 1px solid #444444;
+}
+
+.orders_print_flat_table TD {
+ border: 1px solid #000000;
+ padding: 2px 5px 2px 5px;
+}
+
+.help_box {
+ padding: 5px 10px 5px 10px;
+}
+
+.progress_bar
+{
+ background: url(../img/progress_bar_segment.gif);
+}
+
+.grid_id_cell TD {
+ padding-right: 2px;
+}
+
+/*.transparent {
+ filter: alpha(opacity=50);
+ -moz-opacity: .5;
+ opacity: .5;
+}*/
+
+.none_transparent {
+
+}
+
+.subitem_icon {
+ vertical-align: top;
+ padding-top: 0px;
+ text-align: center;
+ width: 28px;
+}
+
+.subitem_description {
+ vertical-align: middle;
+}
+
+.dLink, .dLink:hover {
+ display: block;
+ margin-bottom: 5px;
+ font-family: Verdana;
+ font-size: 13px;
+ font-weight: bold;
+ color: #2C73CB;
+}
+
+.dLink {
+ text-decoration: none;
+}
+
+.dLink:hover {
+ text-decoration: underline;
+}
+
+a.config-header, a.config-header:hover {
+ color: #FFFFFF;
+ font-size: 11px;
+}
+
+.catalog-tab-left {
+ background: url(../img/itemtabs/tab_left.gif) top left no-repeat;
+}
+
+.catalog-tab-middle {
+ background: url(../img/itemtabs/tab_middle.gif) top left repeat-x;
+}
+
+.catalog-tab-right {
+ background: url(../img/itemtabs/tab_right.gif) top right no-repeat;
+}
+
+catalog-tab-separator td {
+ background: #FFFFFF;
+}
+
+.catalog-tab-selected td {
+ background-color: #E0E0DA;
+ cursor: default;
+}
+
+.catalog-tab-unselected td, .catalog-tab-unselected td span {
+ background-color: #F0F1EB;
+ cursor: pointer;
+}
+
+.catalog-tab {
+ display: none;
+ width: 100%;
+}
+
+.progress-text {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 9px;
+ color: #414141;
+}
\ No newline at end of file
Property changes on: trunk/core/admin_templates/incs/style.css
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/incs/blocks.tpl
===================================================================
--- trunk/core/admin_templates/incs/blocks.tpl (nonexistent)
+++ trunk/core/admin_templates/incs/blocks.tpl (revision 6656)
@@ -0,0 +1,31 @@
+<inp2:m_DefineElement name="kernel_form">
+ <inp2:m_if check="m_ParamEquals" name="form_name" value="" inverse="inverse">
+ <inp2:m_set form_name="$form_name"/>
+ <inp2:m_else/>
+ <inp2:m_set form_name="kernel_form"/>
+ </inp2:m_if>
+
+ <form id="<inp2:m_get name="form_name"/>" name="<inp2:m_get name="form_name"/>" enctype="multipart/form-data" method="post" action="<inp2:m_t pass="all"/>">
+ <input type="hidden" name="MAX_FILE_SIZE" id="MAX_FILE_SIZE" value="<inp2:m_getconst name="MAX_UPLOAD_SIZE"/>" />
+</inp2:m_DefineElement>
+
+<inp2:m_block name="kernel_form_end"/>
+ <inp2:m_DumpSystemInfo/>
+ </form>
+<inp2:m_blockend/>
+
+
+<inp2:m_block name="field_caption"/>
+ <td><inp2:m_param name="title"/><inp2:m_if prefix="$prefix" function="IsRequired"/>*<inp2:m_endif/>:</td>
+<inp2:m_blockend/>
+
+<inp2:m_block name="edit_box"/>
+ <tr>
+ <inp2:m_ParseBlock name="field_caption" prefix="$prefix" title="$title" field="$field" />
+ <td><input type="text" name="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field"/>"></td>
+ </tr>
+<inp2:m_blockend/>
+
+<inp2:m_block name="column_header"/>
+ <td><a href="javascript:resort_grid('<inp2:m_param name="PrefixSpecial"/>','<inp2:m_param name="field"/>')"><inp2:m_param name="title"/></a></td>
+<inp2:m_blockend/>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/incs/blocks.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/incs/footer.tpl
===================================================================
--- trunk/core/admin_templates/incs/footer.tpl (nonexistent)
+++ trunk/core/admin_templates/incs/footer.tpl (revision 6656)
@@ -0,0 +1,11 @@
+<inp2:m_if check="adm_TemplateMatches" templates="head,tree" inverse="inverse">
+<br /><br />
+</inp2:m_if>
+
+<inp2:adm_AfterScript/>
+
+<inp2:m_if check="m_ParamEquals" name="noform" value="yes" inverse="inverse">
+ <inp2:m_ParseBlock name="kernel_form_end"/>
+</inp2:m_if>
+</body>
+</html>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/incs/footer.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/incs/form_blocks.tpl
===================================================================
--- trunk/core/admin_templates/incs/form_blocks.tpl (nonexistent)
+++ trunk/core/admin_templates/incs/form_blocks.tpl (revision 6656)
@@ -0,0 +1,432 @@
+<inp2:m_block name="section_header"/>
+ <inp2:m_if check="m_ParamEquals" name="prefix" value="" inverse="inverse">
+ <inp2:m_RenderElement name="section_header_new" pass_params="true"/>
+ <inp2:m_else />
+ <table cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tr class="section_header_bg">
+ <td valign="top" class="admintitle" align="left" style="padding-top: 2px; padding-bottom: 2px;">
+ <img width="46" height="46" src="img/icons/<inp2:adm_GetSectionIcon icon="$icon"/>.gif" align="absmiddle" title="<inp2:adm_GetSectionTitle phrase="$title"/>"> <inp2:adm_GetSectionTitle phrase="$title"/>
+ </td>
+ </tr>
+ </table>
+ </inp2:m_if>
+<inp2:m_blockend/>
+
+<inp2:m_DefineElement name="section_header_new" module="#session#">
+ <table cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tr style="background: url(<inp2:ModulePath module="$module"/>img/logo_bg.gif) no-repeat top right;">
+ <td valign="top" class="admintitle" align="left" style="padding-top: 2px; padding-bottom: 2px;">
+ <img width="46" height="46" src="<inp2:ModulePath/>img/icons/<inp2:adm_GetSectionIcon icon="$icon"/>.gif" align="absmiddle" title="<inp2:adm_GetSectionTitle phrase="$title"/>"> <inp2:adm_GetSectionTitle phrase="$title"/>
+ </td>
+ </tr>
+ </table>
+</inp2:m_DefineElement>
+
+<inp2:m_block name="blue_bar" module="" icon=""/>
+ <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
+ <tr>
+ <td class="header_left_bg" nowrap width="80%" valign="middle">
+ <span class="tablenav_link" id="blue_bar"><inp2:$prefix_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100"/></span>
+ </td>
+ <td align="right" class="tablenav" width="20%" valign="middle">
+ <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>
+ </td>
+ </tr>
+ </table>
+<inp2:m_blockend/>
+
+<inp2:m_DefineElement name="inp_original_label">
+ <td><inp2:$prefix.original_Field field="$field"/></td>
+</inp2:m_DefineElement>
+
+<inp2:m_block name="subsection" prefix=""/>
+ <tr class="subsectiontitle">
+ <td colspan="3"><inp2:m_phrase label="$title"/></td>
+ <inp2:m_if check="m_ParamEquals" name="prefix" value="" inverse="inverse">
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <td><inp2:m_phrase name="$original_title"/></td>
+ </inp2:m_if>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_field_caption" subfield="" NamePrefix=""/>
+ <inp2:m_inc param="tab_index" by="1"/>
+ <td class="text">
+ <label for="<inp2:m_param name="NamePrefix"/><inp2:$prefix_InputName field="$field" subfield="$subfield"/>">
+ <span class="<inp2:m_if prefix="$prefix" function="HasError" field="$field"/>error<inp2:m_endif/>">
+ <inp2:m_phrase label="$title"/></span><inp2:m_if prefix="$prefix" function="IsRequired" field="$field"/><span class="error"> *</span><inp2:m_endif/>:
+ </label>
+ </td>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_label" is_last="" as_label="" currency="" is_last=""/>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
+ <td valign="top"><span class="text"><inp2:$prefix_Field field="$field" as_label="$as_label" currency="$currency"/></span></td>
+ <td class="error"><inp2:$prefix_Error field="$field"/> </td>
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_id_label"/>
+ <inp2:m_if check="{$prefix}_FieldEquals" field="$field" value="" inverse="inverse">
+ <inp2:m_ParseBlock name="inp_label" pass_params="true"/>
+ </inp2:m_if>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_box" subfield="" class="" is_last="" maxlength="" onblur="" size="" onkeyup=""/>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" subfield="$subfield" title="$title" is_last="$is_last"/>
+ <td>
+ <input type="text" name="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" id="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" value="<inp2:$prefix_Field field="$field" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>" onkeyup="<inp2:m_Param name="onkeyup"/>">
+ <inp2:m_if check="{$prefix}_HasParam" name="hint_label"><span class="small"><inp2:m_phrase label="$hint_label"/></span></inp2:m_if>
+ </td>
+ <td class="error"><inp2:$prefix_Error field="$field"/> </td>
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_upload" class="" is_last=""/>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
+ <td>
+ <input type="file" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>">
+ <inp2:m_if check="$prefix_FieldEquals" name="$field" value="" inverse="inverse">
+ (<inp2:$prefix_Field field="$field"/>)
+ </inp2:m_if>
+ <input type="hidden" name="<inp2:$prefix_InputName field="$field"/>[upload]" id="<inp2:$prefix_InputName field="$field"/>[upload]" value="<inp2:$prefix_Field field="$field"/>">
+ </td>
+ <td class="error"><inp2:$prefix_Error field="$field"/> </td>
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_box_ml" class="" size="" maxlength=""/>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <td class="text" valign="top">
+ <span class="<inp2:m_if prefix="$prefix" function="HasError" field="$field"/>error<inp2:m_endif/>">
+ <inp2:m_phrase label="$title"/><inp2:m_if prefix="$prefix" function="IsRequired" field="$field"/><span class="error"> *</span></inp2:m_if>:</span><br>
+ <a href="javascript:PreSaveAndOpenTranslator('<inp2:m_param name="prefix"/>', '<inp2:m_param name="field"/>', 'popups/translator');" title="<inp2:m_Phrase label="la_Translate"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand" border="0"></a>
+ </td>
+ <td>
+ <input type="text" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field" format="no_default"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
+ </td>
+ <td class="error"><inp2:$prefix_Error field="$field"/> </td>
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_hidden" db=""/>
+ <input type="hidden" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field" db="$db"/>">
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_date" class="" is_last=""/>
+ <inp2:m_if check="m_GetEquals" name="calendar_included" value="1" inverse="inverse">
+ <script type="text/javascript" src="incs/calendar.js"></script>
+ <inp2:m_set calendar_included="1"/>
+ </inp2:m_if>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
+ <td>
+ <input type="text" name="<inp2:$prefix_InputName field="{$field}_date"/>" id="<inp2:$prefix_InputName field="{$field}_date"/>" value="<inp2:$prefix_Field field="{$field}_date" format="_regional_InputDateFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:$prefix_Format field="{$field}_date" input_format="1" edit_size="edit_size"/>" class="<inp2:m_param name="class"/>" datepickerIcon="<inp2:m_ProjectBase/>admin/images/ddarrow.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>
+ <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"/> </td>
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend/>
+
+
+<inp2:m_block name="inp_edit_date_time" class="" is_last=""/>
+ <inp2:m_if check="m_GetEquals" name="calendar_included" value="1" inverse="inverse">
+ <script type="text/javascript" src="incs/calendar.js"></script>
+ <inp2:m_set calendar_included="1"/>
+ </inp2:m_if>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
+ <td>
+ <!-- <input type="hidden" id="<inp2:$prefix_InputName field="$field"/>" name="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field" db="db"/>"> -->
+ <input type="text" name="<inp2:$prefix_InputName field="{$field}_date"/>" id="<inp2:$prefix_InputName field="{$field}_date"/>" value="<inp2:$prefix_Field field="{$field}_date" format="_regional_InputDateFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:$prefix_Format field="{$field}_date" input_format="1" edit_size="edit_size"/>" class="<inp2:m_param name="class"/>" datepickerIcon="<inp2:m_ProjectBase/>admin/images/ddarrow.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>
+ <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"/> </td>
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_textarea" class="" allow_html="allow_html"/>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <td class="text" valign="top">
+ <span class="<inp2:m_if prefix="$prefix" function="HasError" field="$field"/>error<inp2:m_endif/>">
+ <inp2:m_phrase label="$title"/><inp2:m_if prefix="$prefix" function="IsRequired" field="$field"/><span class="error"> *</span><inp2:m_endif/>:</span><br>
+ <inp2:m_if check="m_ParamEquals" name="allow_html" value="allow_html">
+ <a href="javascript:OpenEditor('§ion=in-link:editlink_general','kernel_form','<inp2:$prefix_InputName field="$field"/>');"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
+ </inp2:m_if>
+ </td>
+ <td>
+ <textarea tabindex="<inp2:m_get param="tab_index"/>" id="<inp2:$prefix_InputName field="$field"/>" name="<inp2:$prefix_InputName field="$field"/>" cols="<inp2:m_param name="cols"/>" rows="<inp2:m_param name="rows"/>" class="<inp2:m_param name="class"/>"><inp2:$prefix_Field field="$field"/></textarea>
+ </td>
+ <td class="error"><inp2:$prefix_Error field="$field"/> </td>
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_textarea_ml" class=""/>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <td class="text" valign="top">
+ <span class="<inp2:m_if prefix="$prefix" function="HasError" field="$field"/>error<inp2:m_endif/>">
+ <inp2:m_phrase label="$title"/><inp2:m_if prefix="$prefix" function="IsRequired" field="$field"/><span class="error"> *</span><inp2:m_endif/>:</span><br>
+ <a href="javascript:OpenEditor('§ion=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"/> </td>
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_user" class="" is_last="" old_style="0" onkeyup=""/>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
+ <td>
+ <input type="text" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>" onkeyup="<inp2:m_Param name="onkeyup"/>">
+ <inp2:m_if check="m_ParamEquals" name="old_style" value="1">
+ <a href="#" onclick="return OpenUserSelector('','kernel_form','<inp2:$prefix_InputName field="$field"/>');">
+ <inp2:m_else/>
+ <a href="javascript:openSelector('<inp2:m_param name="prefix"/>', '<inp2:m_t t="user_selector" pass="all,$prefix" escape="1"/>', '<inp2:m_param name="field"/>');">
+ </inp2:m_if>
+ <img src="img/icons/icon24_link_user.gif" style="cursor:hand;" border="0">
+ </a>
+ </td>
+ <td class="error"><inp2:$prefix_Error field="$field"/> </td>
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend/>
+
+
+<inp2:m_block name="inp_option_item"/>
+ <option value="<inp2:m_param name="key"/>"<inp2:m_param name="selected"/>><inp2:m_param name="option"/></option>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_option_phrase"/>
+ <option value="<inp2:m_param name="key"/>"<inp2:m_param name="selected"/>><inp2:m_phrase label="$option"/></option>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_options" is_last="" has_empty="0" empty_value=""/>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
+ <td>
+ <select tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" onchange="<inp2:m_Param name="onchange"/>">
+ <inp2:m_if prefix="m" function="ParamEquals" name="use_phrases" value="1"/>
+ <inp2:$prefix_PredefinedOptions field="$field" block="inp_option_phrase" selected="selected" has_empty="$has_empty" empty_value="$empty_value"/>
+ <inp2:m_else/>
+ <inp2:$prefix_PredefinedOptions field="$field" block="inp_option_item" selected="selected" has_empty="$has_empty" empty_value="$empty_value"/>
+ <inp2:m_endif/>
+ </select>
+ </td>
+ <td class="error"><inp2:$prefix_Error field="$field"/> </td>
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_radio_item"/>
+ <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>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_radio_phrase"/>
+ <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>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_radio" is_last="" pass_tabindex="" onclick="" onchange="" use_phrases="1"/>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
+ <td>
+ <inp2:m_if check="m_ParamEquals" name="use_phrases" value="1">
+ <inp2:$prefix_PredefinedOptions field="$field" tabindex="$pass_tabindex" block="inp_radio_phrase" selected="checked" onclick="$onclick" onchange="$onchange" />
+ <inp2:m_else />
+ <inp2:$prefix_PredefinedOptions field="$field" tabindex="$pass_tabindex" block="inp_radio_item" selected="checked" onclick="$onclick" onchange="$onchange" />
+ </inp2:m_if>
+ </td>
+ <td class="error"><inp2:$prefix_Error field="$field"/> </td>
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_checkbox" is_last="" field_class="" onchange=""/>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last" NamePrefix="_cb_"/>
+ <td>
+ <input type="hidden" id="<inp2:$prefix_InputName field="$field"/>" name="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field" db="db"/>">
+ <!--<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:$prefix_InputName field="$field"/>" name="_cb_<inp2:$prefix_InputName field="$field"/>" <inp2:$prefix_Field field="$field" checked="checked" db="db"/> class="<inp2:m_param name="field_class"/>" onclick="update_checkbox(this, document.getElementById('<inp2:$prefix_InputName field="$field"/>'));" onchange="<inp2:m_param name="onchange"/>">-->
+ <input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:$prefix_InputName field="$field"/>" name="_cb_<inp2:$prefix_InputName field="$field"/>" <inp2:$prefix_Field field="$field" checked="checked" db="db"/> class="<inp2:m_param name="field_class"/>" onchange="update_checkbox(this, document.getElementById('<inp2:$prefix_InputName field="$field"/>'));<inp2:m_param name="onchange"/>" onclick="<inp2:m_param name="onclick"/>">
+ <inp2:m_if check="{$prefix}_HasParam" name="hint_label"><inp2:m_phrase label="$hint_label"/></inp2:m_if>
+ </td>
+ <td class="error"><inp2:$prefix_Error field="$field"/> </td>
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend/>
+
+
+<inp2:m_block name="inp_checkbox_item"/>
+ <input type="checkbox" <inp2:m_param name="checked"/> id="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>" onclick="update_checkbox_options(/^<inp2:$prefix_InputName field="$field" as_preg="1"/>_([0-9A-Za-z-]+)/, '<inp2:$prefix_InputName field="$field"/>');"><label for="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_param name="option"/></label>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_checkbox_phrase"/>
+ <input type="checkbox" <inp2:m_param name="checked"/> id="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>" onclick="update_checkbox_options(/^<inp2:$prefix_InputName field="$field" as_preg="1"/>_([0-9A-Za-z-]+)/, '<inp2:$prefix_InputName field="$field"/>');"><label for="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_phrase label="$option"/></label>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_checkboxes" is_last=""/>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
+ <td>
+ <inp2:m_if check="m_ParamEquals" name="use_phrases" value="1">
+ <inp2:$prefix_PredefinedOptions field="$field" no_empty="$no_empty" tabindex="$pass_tabindex" hint_label="$hint_label" block="inp_checkbox_phrase" selected="checked"/>
+ <inp2:m_else/>
+ <inp2:$prefix_PredefinedOptions field="$field" no_empty="$no_empty" tabindex="$pass_tabindex" hint_label="$hint_label" block="inp_checkbox_item" selected="checked"/>
+ </inp2:m_if>
+ <inp2:m_ParseBlock prefix="$prefix" name="inp_edit_hidden" field="$field"/>
+ </td>
+ <td class="error"><inp2:$prefix_Error field="$field"/> </td>
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_checkbox_allow_html"/>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <td colspan="2">
+ <label for="_cb_<inp2:m_param name="field"/>"><inp2:m_phrase label="la_enable_html"/></label>
+ <input type="hidden" id="<inp2:$prefix_InputName field="$field"/>" name="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field"/>">
+ <input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:m_param name="field"/>" name="_cb_<inp2:m_param name="field"/>" <inp2:$prefix_Field field="$field" checked="checked"/> class="<inp2:m_param name="field_class"/>" onclick="update_checkbox(this, document.getElementById('<inp2:$prefix_InputName field="$field"/>'))">
+ <br>
+ <span class="hint"><img src="img/smicon7.gif" width="14" height="14" align="absmiddle"><inp2:m_phrase label="la_Warning_Enable_HTML"/></span>
+
+ </td>
+ <td> </td>
+ </tr>
+<inp2:m_blockend/>
+
+<inp2:m_block name="inp_edit_weight" subfield="" class="" is_last="" maxlength=""/>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" subfield="$subfield" title="$title" is_last="$is_last"/>
+ <td>
+ <inp2:m_if check="lang.current_FieldEquals" field="UnitSystem" value="1">
+ <input type="text" name="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" id="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" value="<inp2:$prefix_Field field="$field" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
+ <inp2:m_phrase label="la_kg" />
+ </inp2:m_if>
+ <inp2:m_if check="lang.current_FieldEquals" field="UnitSystem" value="2">
+ <input type="text" name="<inp2:$prefix_InputName field="{$field}_a" subfield="$subfield"/>" id="<inp2:$prefix_InputName field="{$field}_a" subfield="$subfield"/>" value="<inp2:$prefix_Field field="{$field}_a" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
+ <inp2:m_phrase label="la_lbs" />
+ <input type="text" name="<inp2:$prefix_InputName field="{$field}_b" subfield="$subfield"/>" id="<inp2:$prefix_InputName field="{$field}_b" subfield="$subfield"/>" value="<inp2:$prefix_Field field="{$field}_b" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
+ <inp2:m_phrase label="la_oz" />
+ </inp2:m_if>
+ </td>
+ <td class="error"><inp2:$prefix_Error field="$field"/> </td>
+ <inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+<inp2:m_blockend />
+
+
+<inp2:m_DefineElement name="ajax_progress_bar">
+ <table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <tr class="table_color1">
+ <td colspan="2">
+ <img src="img/spacer.gif" height="10" width="1" alt="" /><br />
+ <!-- progress bar paddings: begin -->
+ <table width="90%" cellpadding="2" cellspacing="0" border="0" align="center">
+ <tr>
+ <td class="progress-text">0%</td>
+ <td width="100%">
+ <!-- progress bar: begin -->
+ <table cellspacing="0" cellpadding="0" width="100%" border="0" align="center" style="background-color: #FFFFFF; border: 1px solid #E6E6E6;">
+ <tr>
+ <td colspan="3"><img src="img/spacer.gif" height="2" width="1" alt="" /></td>
+ </tr>
+ <tr>
+ <td width="2"><img src="img/spacer.gif" height="13" width="3" alt="" /></td>
+ <td align="center" width="100%">
+ <table cellspacing="0" cellpadding="0" width="100%" border="0" style="background: url(img/progress_left.gif) repeat-x;">
+ <tr>
+ <td id="progress_bar[done]" style="background: url(img/progress_done.gif);" align="left"></td>
+ <td id="progress_bar[left]" align="right"><img src="img/spacer.gif" height="9" width="1" alt="" /></td>
+ </tr>
+ </table>
+ </td>
+ <td width="1"><img src="img/spacer.gif" height="13" width="3" alt="" /></td>
+ </tr>
+ <tr>
+ <td colspan="3"><img src="img/spacer.gif" height="2" width="1" alt="" /></td>
+ </tr>
+ </table>
+ <!-- progress bar: end -->
+ </td>
+ <td class="progress-text">100%</td>
+ </tr>
+ </table>
+ <!-- progress bar paddings: end -->
+ <img src="img/spacer.gif" height="10" width="1" alt="" /><br />
+ </td>
+ </tr>
+ <tr class="table_color2">
+ <td width="50%" align="right"><inp2:m_phrase name="la_fld_PercentsCompleted"/>:</td>
+ <td id="progress_display[percents_completed]">0%</td>
+ </tr>
+ <tr class="table_color1">
+ <td align="right"><inp2:m_phrase name="la_fld_ElapsedTime"/>:</td>
+ <td id="progress_display[elapsed_time]">00:00</td>
+ </tr>
+ <tr class="table_color2">
+ <td align="right"><inp2:m_phrase name="la_fld_EstimatedTime"/>:</td>
+ <td id="progress_display[Estimated_time]">00:00</td>
+ </tr>
+ <tr class="table_color1">
+ <td align="center" colspan="2">
+ <input type="button" class="button" onclick="<inp2:m_param name="cancel_action"/>" value="<inp2:m_phrase name="la_Cancel"/>" />
+ </td>
+ </tr>
+ </table>
+</inp2:m_DefineElement>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/incs/form_blocks.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/tree.tpl
===================================================================
--- trunk/core/admin_templates/tree.tpl (nonexistent)
+++ trunk/core/admin_templates/tree.tpl (revision 6656)
@@ -0,0 +1,125 @@
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<inp2:adm_SetConst name="DBG_SKIP_REPORTING" value="1"/>
+
+<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#DCEBF6">
+
+<script type="text/javascript">
+ function credits(url)
+ {
+ var width = 200;
+ var height = 200;
+ var screen_x = (screen.availWidth-width)/2;
+ var screen_y = (screen.availHeight-height)/2;
+ window.open(url, 'credits', 'width=280,height=520,left='+screen_x+',top='+screen_y);
+ }
+</script>
+
+<script src="incs/ajax.js"></script>
+<script src="incs/tree.js"></script>
+
+<style type="text/css">
+ .tree_head.td, .tree_head, .tree_head:hover {
+ font-weight: bold;
+ font-size: 10px;
+ color: #FFFFFF;
+ font-family: Verdana, Arial;
+ text-decoration: none;
+ }
+
+ .tree {
+ padding: 0px;
+ border: none;
+ border-collapse: collapse;
+ }
+
+ .tree tr td {
+ padding: 0px;
+ margin: 0px;
+ font-family: helvetica, arial, verdana,;
+ font-size: 11px;
+ white-space: nowrap;
+ }
+
+ .tree tr td a {
+ font-size: 11px;
+ color: #000000;
+ font-family: Helvetica, Arial, Verdana;
+ text-decoration: none;
+ }
+
+ .tree tr td a:hover {
+ color: #009FF0;
+ }
+</style>
+
+<table cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tr style="background: #5291DE url(img/menu_bar.gif) repeat-x left bottom;" class="tree_head">
+ <td align="left" width="80%" height="21">
+ <a class="tree_head" href="javascript:credits('<inp2:m_Link index_file="help/credits.php" destform="popup"/>');">In-Portal v <inp2:adm_ModuleVersion module="In-Portal"/></a>
+ </td>
+ <td align="right" width="20%">
+ <select name="language" style="width: 62px; border: 0px; background-color: #FFFFFF; font-size: 9px; color: black;" onchange="submit_event('lang', 'OnChangeLanguage', 'index');">
+ <inp2:m_DefineElement name="lang_elem">
+ <option value="<inp2:Field name="LanguageId"/>" <inp2:m_if check="SelectedLanguage">selected="selected"</inp2:m_if> ><inp2:Field name="PackName"/></option>
+ </inp2:m_DefineElement>
+ <inp2:lang_ListLanguages render_as="lang_elem" row_start_render_as="html:" row_end_render_as="html:"/>
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" style="padding: 5px;">
+ <inp2:m_DefineElement name="xml_node">
+ <inp2:m_if check="m_ParamEquals" param="children_count" value="0">
+ <item href="<inp2:m_param name="section_url"/>" onclick="<inp2:m_param name="onclick"/>" icon="<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.gif"><inp2:m_phrase name="$label" escape="1"/></item>
+ <inp2:m_else/>
+ <folder href="<inp2:m_param name="section_url"/>" onclick="<inp2:m_param name="onclick"/>" name="<inp2:m_phrase name="$label" escape="1"/>" icon="<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.gif" load_url="<inp2:m_param name="late_load"/>"><inp2:adm_PrintSections render_as="xml_node" section_name="$section_name"/></folder>
+ </inp2:m_if>
+ </inp2:m_DefineElement>
+
+ <table class="tree">
+ <tbody id="tree">
+ </tbody>
+ </table>
+ <script type="text/javascript">
+ var TREE_ICONS_PATH = 'img/tree'
+
+ <inp2:m_DefineElement name="root_node">
+ var the_tree = new TreeFolder('tree', '<inp2:m_param name="label"/>', '<inp2:m_param name="section_url"/>', '<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.gif');
+ </inp2:m_DefineElement>
+ <inp2:adm_PrintSection render_as="root_node" section_name="in-portal:root"/>
+ the_tree.AddFromXML('<tree><inp2:adm_PrintSections render_as="xml_node" section_name="in-portal:root"/></tree>');
+ </script>
+ </td>
+ </tr>
+</table>
+
+<inp2:m_include t="incs/footer"/>
+
+<script type="text/javascript">
+ // when changing language submit is made to frameset, not the current frame
+ var $kf = document.getElementById($form_name);
+ $kf.target = 'main_frame';
+
+
+ function checkCatalog($cat_id) {
+ var $ret = checkEditMode();
+ var $right_frame = window.parent.getFrame('main');
+ if ($ret && $right_frame.$is_catalog) {
+ $right_frame.$Catalog.go_to_cat($cat_id);
+ return 1; // this opens folder, but disables click
+ }
+ return $ret;
+ }
+
+ function checkEditMode()
+ {
+ var $phrase = "<inp2:adm_TreeEditWarrning label="la_EditingInProgress" escape="1"/>";
+ if (window.parent.getFrame('main').$edit_mode) {
+ return confirm($phrase) ? true : false;
+ }
+
+ return true;
+ }
+</script>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/tree.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/head.tpl
===================================================================
--- trunk/core/admin_templates/head.tpl (nonexistent)
+++ trunk/core/admin_templates/head.tpl (revision 6656)
@@ -0,0 +1,43 @@
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<inp2:adm_SetConst name="DBG_SKIP_REPORTING" value="1"/>
+
+<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">
+
+ <table cellpadding="0" cellspacing="0" width="100%" border="0">
+ <tr>
+ <td valign="middle">
+ <a href="<inp2:m_t t="sections_list" section="in-portal:root" module="In-Portal" pass="m"/>" target="main"><img title="In-portal" src="img/globe.gif" width="84" height="82" border="0"></a>
+ </td>
+ <td valign="middle">
+ <a href="<inp2:m_t t="sections_list" section="in-portal:root" module="In-Portal" pass="m"/>" target="main"><img title="In-portal" src="img/logo.gif" width="150" height="82" border="0"></a>
+ </td>
+ <td width="100%">
+ </td>
+ <td width="400" valign="top">
+ <table cellpadding="0" cellspacing="0">
+ <tr>
+ <td height="73" valign="top">
+ <img src="img/blocks.gif" width="400" height="73" title="" alt="" /><br />
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" style="background: url(img/version_bg.gif) top right repeat-y;" class="head_version" valign="absmiddle" height="18">
+ <img title="" src="img/spacer.gif" width="1" height="10" align="absmiddle">
+ <inp2:m_phrase name="la_Logged_in_as"/> <b> <inp2:u_LoginName/> </b>
+ <a href="<inp2:m_t t="index" u_event="OnLogout" pass="m,u"/>" target="_parent"><img src="img/blue_bar_logout.gif" height="16" width="16" align="absmiddle" border="0"></a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td bgcolor="#000000" colspan="4">
+ <img title="" src="img/spacer.gif" width="1" height="1" /><br />
+ </td>
+ </tr>
+ </table>
+
+<inp2:m_include t="incs/footer"/>
Property changes on: trunk/core/admin_templates/head.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/index.tpl
===================================================================
--- trunk/core/admin_templates/index.tpl (nonexistent)
+++ trunk/core/admin_templates/index.tpl (revision 6656)
@@ -0,0 +1,52 @@
+<inp2:m_RequireLogin login_template="login"/>
+<inp2:adm_SetConst name="DBG_SKIP_REPORTING" value="1"/>
+<!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">-->
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=<inp2:lang_GetCharset/>">
+ <title>In-portal Administration</title>
+ <inp2:m_base_ref/>
+
+ <link rel="icon" href="img/favicon.ico" type="image/x-icon" />
+ <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
+ <link rel="stylesheet" rev="stylesheet" href="incs/style.css" type="text/css" />
+
+ <script type="text/javascript">
+ window.name = 'main_frame';
+ lala = navigator.appVersion.substring(0,1);
+
+ if (navigator.appName == "Netscape") {
+ if (lala != "5") {
+ document.write("<frameset rows='96,*' framespacing='0' scrolling='no' frameborder='0'>");
+ } else {
+ document.write("<frameset rows='95,*' framespacing='0' scrolling='no' frameborder='0'>");
+ }
+ } else {
+ document.write("<frameset rows='94,*' framespacing='0' scrolling='no' frameborder='0'>");
+ }
+
+ function getFrame($name)
+ {
+ var $frameset = window.frames;
+ for ($i = 0; $i < window.length; $i++) {
+ if ($frameset[$i].name == $name) {
+ return $frameset[$i];
+ }
+ }
+ return window;
+ }
+ </script>
+ </head>
+
+ <frame src="<inp2:m_t t="head" pass="m" m_cat_id="0" m_opener="s" no_pass_through="1"/>" name="head" scrolling="no" noresize>
+ <frameset cols="200,*" border="0">
+ <frame src="<inp2:m_t t="tree" pass="m" m_cat_id="0" m_opener="s" no_pass_through="1"/>" name="menu" target="main" noresize scrolling="auto" marginwidth="0" marginheight="0">
+ <frame src="<inp2:m_t t="sections_list" section="in-portal:root" module="In-Portal" pass="m" m_cat_id="0" m_opener="s" no_pass_through="1"/>" name="main" marginwidth="0" marginheight="0" frameborder="no" noresize scrolling="auto">
+ </frameset>
+ </frameset>
+ <noframes>
+ <body bgcolor="#FFFFFF">
+ <p></p>
+ </body>
+ </noframes>
+</html>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/index.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/login.tpl
===================================================================
--- trunk/core/admin_templates/login.tpl (nonexistent)
+++ trunk/core/admin_templates/login.tpl (revision 6656)
@@ -0,0 +1,83 @@
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF" text="#000000" onLoad="document.getElementById($form_name).login.focus();">
+ <inp2:m_ParseBlock name="kernel_form"/>
+ <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
+ <tr>
+ <td valign="middle" align="center">
+ <div align="center">
+ <img title="In-portal" src="img/globe.gif" width="84" height="82" border="0">
+ <img title="In-portal" src="img/logo.gif" width="150" height="82" border="0"><br />
+
+
+ <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="222" height="30">
+ <tr>
+ <td align="right" valign="top" class="tablenav" width ="220" nowrap height="30" style="background: url(img/tabnav_left.gif);">
+ <span style="float: left;">
+ <img src="img/icons/icon24_lock_login.gif" width="16" height="22" alt="" border="0" align="absmiddle"> <inp2:m_phrase name="la_Login"/>
+ </span>
+ <a href="help/manual.pdf"><img src="img/blue_bar_help.gif" border="0"></a>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" bgcolor="#F0F0F0">
+ <table cellpadding="4" cellspacing="0" border="0">
+ <tr bgcolor="#F0F0F0">
+ <td class="text"><inp2:m_phrase name="la_Text_Login"/></td>
+ <td><input type="text" name="login" class="text" onkeypress="catchHotKeysA(event);"></td>
+ </tr>
+ <tr bgcolor="#F0F0F0">
+ <td class="text"><inp2:m_phrase name="la_prompt_Password"/></td>
+ <td><input type="password" name="password" class="text" onKeyPress="catchHotKeysA(event);"></td>
+ </tr>
+ <tr bgcolor="#F0F0F0">
+ <td colspan="2">
+ <div align="left">
+ <input type="submit" name="login_button" onclick="doLogin();" value="<inp2:m_phrase name="la_Login"/>" class="button">
+ <input type="reset" name="cancel_button" value="<inp2:m_phrase name="la_Cancel"/>" class="button">
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ <inp2:m_if check="u_HasError" field="any">
+ <p class="error"><inp2:u_Error field="ValidateLogin"/></p>
+ </inp2:m_if>
+ </td>
+ </tr>
+ </table>
+ <input type="hidden" name="next_template" value="<inp2:m_if check="m_GetEquals" name="next_template" value="">index<inp2:m_else/><inp2:m_get var="next_template"/></inp2:m_if>">
+
+ <script type="text/javascript">
+ function doLogin()
+ {
+ submit_event('u', 'OnLogin');
+ }
+
+ function catchHotKeysA(e)
+ {
+ if (!e) return;
+ if (e.keyCode == 13) doLogin();
+ }
+
+ var a_parent = window.parent;
+ function redirect()
+ {
+ window.name = 'redirect';
+ var i = 0;
+ while (i < 10) {
+ if (window.parent.name == 'main_frame') break;
+ a_parent = window.parent;
+ i++;
+ }
+ page = '<inp2:m_t t="index" expired="1" escape="1" no_amp="1"/>'; // a_parent.location.href + '?expired=1';
+ if (i < 10) {
+ setTimeout('a_parent.location.href=page',100);
+ }
+ }
+ redirect();
+ </script>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/login.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/logout.tpl
===================================================================
--- trunk/core/admin_templates/logout.tpl (nonexistent)
+++ trunk/core/admin_templates/logout.tpl (revision 6656)
@@ -0,0 +1 @@
+Logout Template
\ No newline at end of file
Property changes on: trunk/core/admin_templates/logout.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/img/button_back.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/button_back.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/blocks.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/blocks.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/spacer.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/spacer.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/version_bg.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/version_bg.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/logo.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/logo.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/button_back_disabled.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/button_back_disabled.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/blue_bar_help.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/blue_bar_help.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/blue_bar_logout.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/blue_bar_logout.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/tabnav_left.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/tabnav_left.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/icons/icon24_lock_login.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/icons/icon24_lock_login.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/globe.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/globe.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/js/script.js
===================================================================
--- trunk/core/admin_templates/js/script.js (nonexistent)
+++ trunk/core/admin_templates/js/script.js (revision 6656)
@@ -0,0 +1,1035 @@
+if ( !( isset($init_made) && $init_made ) ) {
+ var Grids = new Array();
+ var Toolbars = new Array();
+ var $Menus = new Array();
+ var $ViewMenus = new Array();
+
+ var $form_name = 'kernel_form';
+ if(!$fw_menus) var $fw_menus = new Array();
+
+ var $env = '';
+ var submitted = false;
+ var $edit_mode = false;
+ var $init_made = true; // in case of double inclusion of script.js :)
+
+ // hook processing
+ var hBEFORE = 1; // this is const, but including this twice causes errors
+ var hAFTER = 2; // this is const, but including this twice causes errors
+ var $hooks = new Array();
+}
+
+function getArrayValue()
+{
+ var $value = arguments[0];
+ var $current_key = 0;
+ $i = 1;
+ while ($i < arguments.length) {
+ $current_key = arguments[$i];
+ if (isset($value[$current_key])) {
+ $value = $value[$current_key];
+ }
+ else {
+ return false;
+ }
+ $i++;
+ }
+ return $value;
+}
+
+function setArrayValue()
+{
+ // first argument - array, other arguments - keys (arrays too), last argument - value
+ var $array = arguments[0];
+ var $current_key = 0;
+ $i = 1;
+ while ($i < arguments.length - 1) {
+ $current_key = arguments[$i];
+ if (!isset($array[$current_key])) {
+ $array[$current_key] = new Array();
+ }
+ $array = $array[$current_key];
+ $i++;
+ }
+ $array[$array.length] = arguments[arguments.length - 1];
+}
+
+function processHooks($function_name, $hook_type, $prefix_special)
+{
+ var $i = 0;
+ var $local_hooks = getArrayValue($hooks, $function_name, $hook_type);
+
+ while($i < $local_hooks.length) {
+ $local_hooks[$i]($function_name, $prefix_special);
+ $i++;
+ }
+}
+
+function registerHook($function_name, $hook_type, $hook_body)
+{
+ setArrayValue($hooks, $function_name, $hook_type, $hook_body);
+}
+
+function resort_grid($prefix_special, $field, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field($prefix_special + '_Sort1', $field);
+ submit_event($prefix_special, 'OnSetSorting', null, null, $ajax);
+}
+
+function direct_sort_grid($prefix_special, $field, $direction, $field_pos, $ajax)
+{
+ if(!isset($field_pos)) $field_pos = 1;
+ set_form($prefix_special, $ajax);
+ set_hidden_field($prefix_special+'_Sort'+$field_pos,$field);
+ set_hidden_field($prefix_special+'_Sort'+$field_pos+'_Dir',$direction);
+ set_hidden_field($prefix_special+'_SortPos',$field_pos);
+ submit_event($prefix_special,'OnSetSortingDirect', null, null, $ajax);
+}
+
+function reset_sorting($prefix_special)
+{
+ submit_event($prefix_special,'OnResetSorting');
+}
+
+function set_per_page($prefix_special, $per_page, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field($prefix_special + '_PerPage', $per_page);
+ submit_event($prefix_special, 'OnSetPerPage', null, null, $ajax);
+}
+
+function submit_event(prefix_special, event, t, form_action, $ajax)
+{
+ if ($ajax) {
+ return $Catalog.submit_event(prefix_special, event, t);
+ }
+
+ if (event) {
+ set_hidden_field('events[' + prefix_special + ']', event);
+ }
+ if (t) set_hidden_field('t', t);
+
+ if (form_action) {
+ var old_env = '';
+ if (!form_action.match(/\?/)) {
+ document.getElementById($form_name).action.match(/.*(\?.*)/);
+ old_env = RegExp.$1;
+ }
+ document.getElementById($form_name).action = form_action + old_env;
+ }
+ submit_kernel_form();
+}
+
+function submit_action($url, $action)
+{
+ $form = document.getElementById($form_name);
+ $form.action = $url;
+ set_hidden_field('Action', $action);
+ submit_kernel_form();
+}
+
+function show_form_data()
+{
+ var $kf = document.getElementById($form_name);
+ $ret = '';
+ for(var i in $kf.elements)
+ {
+ $elem = $kf.elements[i];
+ $ret += $elem.id + ' = ' + $elem.value + "\n";
+ }
+ alert($ret);
+}
+
+function submit_kernel_form()
+{
+ if (submitted) {
+ return;
+ }
+ submitted = true;
+
+ var $form = document.getElementById($form_name);
+ processHooks('SubmitKF', hBEFORE);
+ if (typeof $form.onsubmit == "function") {
+ $form.onsubmit();
+ }
+
+ $form.submit();
+ processHooks('SubmitKF', hAFTER);
+ $form.target = '';
+ $form.t.value = 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 openSelector($prefix, $url, $dst_field, $window_size, $event)
+{
+ var $kf = document.getElementById($form_name);
+ var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)');
+ $regex = $regex.exec($url);
+
+ var $t = $regex[3];
+ var $window_name = 'select_'+$t.replace(/(\/|-)/g, '_');
+ set_hidden_field('return_m', $regex[4]);
+
+ if (!isset($window_size)) $window_size = '750x400';
+
+ $window_size = $window_size.split('x');
+
+ if (!isset($event)) $event = '';
+ processHooks('openSelector', hBEFORE);
+
+ var $prev_action = $kf.action;
+ var $prev_opener = get_hidden_field('m_opener');
+
+ set_hidden_field('m_opener', 'p');
+ set_hidden_field('main_prefix', $prefix);
+ set_hidden_field('dst_field', $dst_field);
+ set_hidden_field('return_template', $kf.elements['t'].value); // where should return after popup is done
+
+ openwin('', $window_name, $window_size[0], $window_size[1]);
+ $kf.action = $url;
+ $kf.target = $window_name;
+
+ submit_event($prefix, $event, $t);
+
+ processHooks('openSelector', hAFTER);
+ $kf.action = $prev_action;
+ set_hidden_field('m_opener', $prev_opener);
+}
+
+function InitTranslator(prefix, field, t, multi_line)
+{
+ var $kf = document.getElementById($form_name);
+ var $window_name = 'select_'+t.replace(/(\/|-)/g, '_');
+ var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)');
+
+ $regex = $regex.exec($kf.action);
+ set_hidden_field('return_m', $regex[4]);
+ var $prev_opener = get_hidden_field('m_opener');
+ if (!isset(multi_line)) multi_line = 0;
+ openwin('', $window_name, 750, 400);
+ set_hidden_field('return_template', $kf.elements['t'].value); // where should return after popup is done
+ set_hidden_field('m_opener', 'p');
+
+ set_hidden_field('translator_wnd_name', $window_name);
+ set_hidden_field('translator_field', field);
+ set_hidden_field('translator_t', t);
+ set_hidden_field('translator_prefixes', prefix);
+ set_hidden_field('translator_multi_line', multi_line);
+ $kf.target = $window_name;
+
+ return $prev_opener;
+}
+
+function PreSaveAndOpenTranslator(prefix, field, t, multi_line)
+{
+ var $prev_opener = InitTranslator(prefix, field, t, multi_line);
+
+ var split_prefix = prefix.split(',');
+ submit_event(split_prefix[0], 'OnPreSaveAndOpenTranslator');
+
+ set_hidden_field('m_opener', $prev_opener);
+}
+
+
+function PreSaveAndOpenTranslatorCV(prefix, field, t, resource_id, multi_line)
+{
+ var $prev_opener = InitTranslator(prefix, field, t, multi_line);
+ set_hidden_field('translator_resource_id', resource_id);
+
+ var split_prefix = prefix.split(',');
+ submit_event(split_prefix[0],'OnPreSaveAndOpenTranslator');
+
+ set_hidden_field('m_opener', $prev_opener);
+}
+
+function openTranslator(prefix,field,url,wnd)
+{
+ var $kf = document.getElementById($form_name);
+
+ set_hidden_field('trans_prefix', prefix);
+ set_hidden_field('trans_field', field);
+ set_hidden_field('events[trans]', 'OnLoad');
+
+ var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(.*)');
+ var $t = $regex.exec(url)[3];
+ $kf.target = wnd;
+ submit_event(prefix,'',$t,url);
+}
+
+function openwin($url,$name,$width,$height)
+{
+ var $window_params = 'width='+$width+',height='+$height+',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no';
+ return window.open($url,$name,$window_params);
+}
+
+function opener_action(new_action)
+{
+ set_hidden_field('m_opener', new_action);
+}
+
+function std_precreate_item(prefix_special, edit_template)
+{
+ opener_action('d');
+ set_hidden_field(prefix_special+'_mode', 't');
+ submit_event(prefix_special,'OnPreCreate', edit_template)
+}
+
+function std_new_item(prefix_special, edit_template)
+{
+ opener_action('d');
+ submit_event(prefix_special,'OnNew', edit_template)
+}
+
+function std_edit_item(prefix_special, edit_template)
+ {
+ opener_action('d');
+ set_hidden_field(prefix_special+'_mode', 't');
+ submit_event(prefix_special,'OnEdit',edit_template)
+}
+
+function std_edit_temp_item(prefix_special, edit_template)
+{
+ opener_action('d');
+ submit_event(prefix_special,'',edit_template)
+}
+
+function std_delete_items(prefix_special, t, $ajax)
+{
+ if (inpConfirm('Are you sure you want to delete selected items?')) {
+ submit_event(prefix_special, 'OnMassDelete', t, null, $ajax);
+ }
+}
+
+
+// set current form base on ajax
+function set_form($prefix_special, $ajax)
+{
+ if ($ajax) {
+ $form_name = $Catalog.queryTabRegistry('prefix', $prefix_special, 'tab_id') + '_form';
+ }
+}
+
+// sets hidden field value
+// if the field does not exist - creates it
+function set_hidden_field($field_id, $value)
+{
+ var $kf = document.getElementById($form_name);
+ var $field = $kf.elements[$field_id];
+ if ($field) {
+ $field.value = $value;
+ return true;
+ }
+
+ $field = document.createElement('INPUT');
+ $field.type = 'hidden';
+ $field.name = $field_id;
+ $field.id = $field_id;
+ $field.value = $value;
+
+ $kf.appendChild($field);
+ return false;
+}
+
+// sets hidden field value
+// if the field does not exist - creates it
+function setInnerHTML($field_id, $value)
+{
+ var $element = document.getElementById($field_id);
+ if (!$element) return false;
+ $element.innerHTML = $value;
+}
+
+function get_hidden_field($field)
+{
+ var $kf = document.getElementById($form_name);
+ return $kf.elements[$field] ? $kf.elements[$field].value : false;
+}
+
+function search($prefix_special, $grid_name, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field('grid_name', $grid_name);
+ submit_event($prefix_special, 'OnSearch', null, null, $ajax);
+}
+
+function search_reset($prefix_special, $grid_name, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field('grid_name', $grid_name);
+ submit_event($prefix_special, 'OnSearchReset', null, null, $ajax);
+}
+
+function search_keydown($event)
+{
+ $event = $event ? $event : event;
+ if ($event.keyCode == 13) {
+ var $prefix_special = this.getAttribute('PrefixSpecial');
+ var $grid = this.getAttribute('Grid');
+ search($prefix_special, $grid, parseInt(this.getAttribute('ajax')));
+ }
+}
+
+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($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);
+ }
+}
+
+function set_window_title($title)
+{
+ var $window = window;
+ if($window.parent) $window = $window.parent;
+ $window.document.title = (main_title.length ? main_title + ' - ' : '') + $title;
+}
+
+function set_filter($prefix_special, $filter_id, $filter_value, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field('filter_id', $filter_id);
+ set_hidden_field('filter_value', $filter_value);
+ submit_event($prefix_special, 'OnSetFilter', null, null, $ajax);
+}
+
+function filters_remove_all($prefix_special, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ submit_event($prefix_special,'OnRemoveFilters', null, null, $ajax);
+}
+
+function filters_apply_all($prefix_special, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ submit_event($prefix_special,'OnApplyFilters', null, null, $ajax);
+}
+
+function RemoveTranslationLink($string, $escaped)
+{
+ if (!isset($escaped)) $escaped = true;
+
+ if ($escaped) {
+ return $string.match(/<a href="(.*)">(.*)<\/a>/) ? RegExp.$2 : $string;
+ }
+ else {
+ return $string.match(/<a href="(.*)">(.*)<\/a>/) ? RegExp.$2 : $string;
+ }
+}
+
+function redirect($url)
+{
+ window.location.href = $url;
+}
+
+function update_checkbox_options($cb_mask, $hidden_id)
+{
+ var $kf = document.getElementById($form_name);
+ var $tmp = '';
+ for (var i = 0; i < $kf.elements.length; i++)
+ {
+ if ( $kf.elements[i].id.match($cb_mask) )
+ {
+ if ($kf.elements[i].checked) $tmp += '|'+$kf.elements[i].value;
+ }
+ }
+ if($tmp.length > 0) $tmp += '|';
+ document.getElementById($hidden_id).value = $tmp.replace(/,$/, '');
+}
+
+// related to lists operations (moving)
+
+
+
+ function move_selected($from_list, $to_list)
+ {
+ if (typeof($from_list) != 'object') $from_list = document.getElementById($from_list);
+ if (typeof($to_list) != 'object') $to_list = document.getElementById($to_list);
+
+ if (has_selected_options($from_list))
+ {
+ var $from_array = select_to_array($from_list);
+ var $to_array = select_to_array($to_list);
+ var $new_from = Array();
+ var $cur = null;
+
+ for (var $i = 0; $i < $from_array.length; $i++)
+ {
+ $cur = $from_array[$i];
+ if ($cur[2]) // If selected - add to To array
+ {
+ $to_array[$to_array.length] = $cur;
+ }
+ else //Else - keep in new From
+ {
+ $new_from[$new_from.length] = $cur;
+ }
+ }
+
+ $from_list = array_to_select($new_from, $from_list);
+ $to_list = array_to_select($to_array, $to_list);
+ }
+ else
+ {
+ alert('Please select items to perform moving!');
+ }
+ }
+
+ function select_to_array($aSelect)
+ {
+ var $an_array = new Array();
+ var $cur = null;
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ $cur = $aSelect.options[$i];
+ $an_array[$an_array.length] = new Array($cur.text, $cur.value, $cur.selected);
+ }
+ return $an_array;
+ }
+
+ function array_to_select($anArray, $aSelect)
+ {
+ var $initial_length = $aSelect.length;
+ for (var $i = $initial_length - 1; $i >= 0; $i--)
+ {
+ $aSelect.options[$i] = null;
+ }
+
+ for (var $i = 0; $i < $anArray.length; $i++)
+ {
+ $cur = $anArray[$i];
+ $aSelect.options[$aSelect.length] = new Option($cur[0], $cur[1]);
+ }
+ }
+
+ function select_compare($a, $b)
+ {
+ if ($a[0] < $b[0])
+ return -1;
+ if ($a[0] > $b[0])
+ return 1;
+ return 0;
+ }
+
+ function select_to_string($aSelect)
+ {
+ var $result = '';
+ var $cur = null;
+
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ $result += $aSelect.options[$i].value + '|';
+ }
+
+ return $result.length ? '|' + $result : '';
+ }
+
+ function selected_to_string($aSelect)
+ {
+ var $result = '';
+ var $cur = null;
+
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ $cur = $aSelect.options[$i];
+ if ($cur.selected && $cur.value != '')
+ {
+ $result += $cur.value + '|';
+ }
+ }
+
+ return $result.length ? '|' + $result : '';
+ }
+
+ function string_to_selected($str, $aSelect)
+ {
+ var $cur = null;
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ $cur = $aSelect.options[$i];
+ $aSelect.options[$i].selected = $str.match('\\|' + $cur.value + '\\|') ? true : false;
+ }
+ }
+
+ function set_selected($selected_options, $aSelect)
+ {
+ if (!$selected_options.length) return false;
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ for (var $k = 0; $k < $selected_options.length; $k++)
+ {
+ if ($aSelect.options[$i].value == $selected_options[$k])
+ {
+ $aSelect.options[$i].selected = true;
+ }
+ }
+ }
+ }
+
+ function get_selected_count($theList)
+ {
+ var $count = 0;
+ var $cur = null;
+ for (var $i = 0; $i < $theList.length; $i++)
+ {
+ $cur = $theList.options[$i];
+ if ($cur.selected) $count++;
+ }
+ return $count;
+ }
+
+ function get_selected_index($aSelect, $typeIndex)
+ {
+ var $index = 0;
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ if ($aSelect.options[$i].selected)
+ {
+ $index = $i;
+ if ($typeIndex == 'firstSelected') break;
+ }
+ }
+ return $index;
+ }
+
+ function has_selected_options($theList)
+ {
+ var $ret = false;
+ var $cur = null;
+
+ for (var $i = 0; $i < $theList.length; $i++)
+ {
+ $cur = $theList.options[$i];
+ if ($cur.selected) $ret = true;
+ }
+ return $ret;
+ }
+
+ function select_sort($aSelect)
+ {
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ var $to_array = select_to_array($aSelect);
+ $to_array.sort(select_compare);
+ array_to_select($to_array, $aSelect);
+ }
+
+ function move_options_up($aSelect, $interval)
+ {
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ if (has_selected_options($aSelect))
+ {
+ var $selected_options = Array();
+ var $first_selected = get_selected_index($aSelect, 'firstSelected');
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ if ($aSelect.options[$i].selected && ($first_selected > 0) )
+ {
+ swap_options($aSelect, $i, $i - $interval);
+ $selected_options[$selected_options.length] = $aSelect.options[$i - $interval].value;
+ }
+ else if ($first_selected == 0)
+ {
+ //alert('Begin of list');
+ break;
+ }
+ }
+ set_selected($selected_options, $aSelect);
+ }
+ else
+ {
+ //alert('Check items from moving');
+ }
+ }
+
+ function move_options_down($aSelect, $interval)
+ {
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ if (has_selected_options($aSelect))
+ {
+ var $last_selected = get_selected_index($aSelect, 'lastSelected');
+ var $selected_options = Array();
+
+ for (var $i = $aSelect.length - 1; $i >= 0; $i--)
+ {
+ if ($aSelect.options[$i].selected && ($aSelect.length - ($last_selected + 1) > 0))
+ {
+ swap_options($aSelect, $i, $i + $interval);
+ $selected_options[$selected_options.length] = $aSelect.options[$i + $interval].value;
+ }
+ else if ($last_selected + 1 == $aSelect.length)
+ {
+ //alert('End of list');
+ break;
+ }
+ }
+ set_selected($selected_options, $aSelect);
+ }
+ else
+ {
+ //alert('Check items from moving');
+ }
+ }
+
+ function swap_options($aSelect, $src_num, $dst_num)
+ {
+ var $src_html = $aSelect.options[$src_num].innerHTML;
+ var $dst_html = $aSelect.options[$dst_num].innerHTML;
+ var $src_value = $aSelect.options[$src_num].value;
+ var $dst_value = $aSelect.options[$dst_num].value;
+
+ var $src_option = document.createElement('OPTION');
+ var $dst_option = document.createElement('OPTION');
+
+ $aSelect.remove($src_num);
+ $aSelect.options.add($dst_option, $src_num);
+ $dst_option.innerText = $dst_html;
+ $dst_option.value = $dst_value;
+ $dst_option.innerHTML = $dst_html;
+
+ $aSelect.remove($dst_num);
+ $aSelect.options.add($src_option, $dst_num);
+ $src_option.innerText = $src_html;
+ $src_option.value = $src_value;
+ $src_option.innerHTML = $src_html;
+ }
+
+ function getXMLHTTPObject(content_type)
+ {
+ if (!isset(content_type)) content_type = 'text/plain';
+ var http_request = false;
+ if (window.XMLHttpRequest) { // Mozilla, Safari,...
+ http_request = new XMLHttpRequest();
+ if (http_request.overrideMimeType) {
+ http_request.overrideMimeType(content_type);
+ // See note below about this line
+ }
+ } else if (window.ActiveXObject) { // IE
+ try {
+ http_request = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch (e) {
+ try {
+ http_request = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (e) {}
+ }
+ }
+ return http_request;
+ }
+
+ function str_repeat($symbol, $count)
+ {
+ var $i = 0;
+ var $ret = '';
+ while($i < $count) {
+ $ret += $symbol;
+ $i++;
+ }
+ return $ret;
+ }
+
+ function getDocumentFromXML(xml)
+ {
+ if (window.ActiveXObject) {
+ var doc = new ActiveXObject("Microsoft.XMLDOM");
+ doc.async=false;
+ doc.loadXML(xml);
+ }
+ else {
+ var parser = new DOMParser();
+ var doc = parser.parseFromString(xml,"text/xml");
+ }
+ return doc;
+ }
+
+
+ function addEvent(el, evname, func) {
+ if (is.ie) {
+ el.attachEvent("on" + evname, func);
+ } else {
+ el.addEventListener(evname, func, true);
+ }
+ };
+
+ function set_persistant_var($var_name, $var_value, $t, $form_action)
+ {
+ set_hidden_field('field', $var_name);
+ set_hidden_field('value', $var_value);
+ submit_event('u', 'OnSetPersistantVariable', $t, $form_action);
+ }
+
+ /*functionremoveEvent(el, evname, func) {
+ if (Calendar.is_ie) {
+ el.detachEvent("on" + evname, func);
+ } else {
+ el.removeEventListener(evname, func, true);
+ }
+ };*/
+
+ function setCookie($Name, $Value)
+ {
+ // set cookie
+ if(getCookie($Name) != $Value)
+ {
+ document.cookie = $Name+'='+escape($Value)+'; path=' + $base_path + '/';
+ }
+ }
+
+ function getCookie($Name)
+ {
+ // get cookie
+ var $cookieString = document.cookie;
+ var $index = $cookieString.indexOf($Name+'=');
+ if($index == -1) return null;
+
+ $index = $cookieString.indexOf('=',$index)+1;
+ var $endstr = $cookieString.indexOf(';',$index);
+ if($endstr == -1) $endstr = $cookieString.length;
+ return unescape($cookieString.substring($index, $endstr));
+ }
+
+ function deleteCookie($Name)
+ {
+ // deletes cookie
+ if (getCookie($Name))
+ {
+ document.cookie = $Name+'=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/';
+ }
+ }
+
+ function addElement($dst_element, $tag_name) {
+ var $new_element = document.createElement($tag_name.toUpperCase());
+ $dst_element.appendChild($new_element);
+ return $new_element;
+ }
+
+ Math.sum = function($array) {
+ var $i = 0;
+ var $total = 0;
+ while ($i < $array.length) {
+ $total += $array[$i];
+ $i++;
+ }
+ return $total;
+ }
+
+ Math.average = function($array) {
+ return Math.sum($array) / $array.length;
+ }
Property changes on: trunk/core/admin_templates/js/script.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/js/grid.js
===================================================================
--- trunk/core/admin_templates/js/grid.js (nonexistent)
+++ trunk/core/admin_templates/js/grid.js (revision 6656)
@@ -0,0 +1,389 @@
+var $GridManager = new GridManager();
+
+function GridManager () {
+ this.Grids = Grids; // get all from global variable, in future replace all references to it with $GridManager.Grids
+ this.AlternativeGrids = new Array();
+}
+
+GridManager.prototype.AddAlternativeGrid = function ($source_grid, $destination_grid, $reciprocal)
+{
+ if ($source_grid == $destination_grid) {
+ return false;
+ }
+
+ if (typeof(this.AlternativeGrids[$source_grid]) == 'undefined') {
+ // alternative grids not found, create empty list
+ this.AlternativeGrids[$source_grid] = new Array();
+ }
+
+ if (!in_array($destination_grid, this.AlternativeGrids[$source_grid])) {
+ // alternative grids found, check if not added already
+ this.AlternativeGrids[$source_grid].push($destination_grid);
+ }
+
+ if ($reciprocal) {
+ this.AddAlternativeGrid($destination_grid, $source_grid);
+ }
+}
+
+GridManager.prototype.ClearAlternativeGridsSelection = function ($source_prefix)
+{
+ if (!this.AlternativeGrids[$source_prefix]) return false;
+
+ var $i = 0;
+ var $destination_prefix = '';
+ while ($i < this.AlternativeGrids[$source_prefix].length) {
+ $destination_prefix = this.AlternativeGrids[$source_prefix][$i];
+ if (this.Grids[$destination_prefix]) {
+ // alternative grid set, but not yet loaded by ajax
+ this.Grids[$destination_prefix].ClearSelection();
+ }
+ $i++;
+ }
+}
+
+GridManager.prototype.CheckDependencies = function ($prefix) {
+ if (typeof(this.Grids[$prefix]) != 'undefined') {
+ this.Grids[$prefix].CheckDependencies('GridManager.CheckDependencies');
+ }
+}
+
+function GridItem(grid, an_element, cb, item_id, class_on, class_off)
+{
+ this.Grid = grid;
+ this.selected = false;
+ this.id = an_element.id;
+ this.ItemId = item_id;
+ this.sequence = parseInt(an_element.getAttribute('sequence'));
+ this.class_on = class_on;
+ if (class_off == ':original') {
+ this.class_off = an_element.className;
+ }
+ else
+ this.class_off = class_off;
+ this.HTMLelement = an_element;
+ this.CheckBox = cb;
+
+ this.value = this.ItemId;
+ this.ItemType = 11;
+}
+
+GridItem.prototype.Init = function ()
+{
+ this.HTMLelement.GridItem = this;
+ this.HTMLelement.onclick = function(ev) {
+ this.GridItem.Click(ev);
+ };
+ this.HTMLelement.ondblclick = function(ev) {
+ this.GridItem.DblClick(ev);
+ }
+ if ( isset(this.CheckBox) ) {
+ this.CheckBox.GridItem = this;
+ this.CheckBox.onclick = function(ev) {
+ this.GridItem.cbClick(ev);
+ };
+ this.CheckBox.ondblclick = function(ev) {
+ this.GridItem.DblClick(ev);
+ }
+ }
+}
+
+GridItem.prototype.DisableClicking = function ()
+{
+ this.HTMLelement.onclick = function(ev) {
+ return false;
+ };
+ this.HTMLelement.ondblclick = function(ev) {
+ return false;
+ }
+ if ( isset(this.CheckBox) ) {
+ this.CheckBox.onclick = function(ev) {
+ return false;
+ };
+ }
+}
+
+GridItem.prototype.Select = function ()
+{
+ if (this.selected) return;
+ this.selected = true;
+ this.HTMLelement.className = this.class_on;
+ if ( isset(this.CheckBox) ) {
+ this.CheckBox.checked = true;
+ }
+ this.Grid.LastSelectedId = this.ItemId;
+ this.Grid.SelectedCount++;
+
+ // this is for in-portal only (used in relation select)
+ LastCheckedItem = this;
+ if (typeof (this.Grid.OnSelect) == 'function' ) {
+ this.Grid.OnSelect(this.ItemId);
+ }
+}
+
+GridItem.prototype.UnSelect = function ( force )
+{
+ if ( !this.selected && !force) return;
+ this.selected = false;
+ this.HTMLelement.className = this.class_off;
+ if ( isset(this.CheckBox) ) {
+ this.CheckBox.checked = false;
+ }
+ this.Grid.SelectedCount--;
+ if (typeof (this.Grid.OnUnSelect) == 'function' ) {
+ this.Grid.OnUnSelect(this.ItemId);
+ }
+}
+
+GridItem.prototype.ClearBrowserSelection = function() {
+ 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+
+ window.getSelection().removeAllRanges();
+ }
+ } else if (document.selection && !is.opera) { // IE
+ document.selection.empty();
+ }
+}
+
+GridItem.prototype.Click = function (ev)
+{
+ this.ClearBrowserSelection();
+ this.Grid.ClearAlternativeGridsSelection('GridItem.Click');
+
+ var e = !is.ie ? ev : window.event;
+ if (e.shiftKey && !this.Grid.RadioMode) {
+ this.Grid.SelectRangeUpTo(this.sequence);
+ }
+ else {
+ if (e.ctrlKey && !this.Grid.RadioMode) {
+ this.Toggle()
+ }
+ else {
+ if (!(this.Grid.RadioMode && this.Grid.LastSelectedId == this.ItemId && this.selected)) {
+ // don't clear selection if item same as current is selected
+ this.Grid.ClearSelection(null,'GridItem.Click');
+ this.Toggle();
+ }
+ }
+ }
+ this.Grid.CheckDependencies('GridItem.Click');
+ e.cancelBubble = true;
+}
+
+GridItem.prototype.cbClick = function (ev)
+{
+ var e = is.ie ? window.event : ev;
+ if (this.Grid.RadioMode) this.Grid.ClearSelection(null,'GridItem.cbClick');
+ this.Grid.ClearAlternativeGridsSelection('GridItem.cbClick');
+ this.Toggle();
+ this.Grid.CheckDependencies('GridItem.cbClick');
+ e.cancelBubble = true;
+}
+
+GridItem.prototype.DblClick = function (ev)
+{
+ var e = is.ie ? window.event : ev;
+ this.Grid.Edit();
+}
+
+GridItem.prototype.Toggle = function ()
+{
+ if (this.selected) this.UnSelect()
+ else {
+ this.Grid.LastSelectedSequence = this.sequence;
+ this.Select();
+ }
+}
+
+GridItem.prototype.FallsInRange = function (from, to)
+{
+ return (from <= to) ?
+ (this.sequence >= from && this.sequence <= to) :
+ (this.sequence >= to && this.sequence <= from);
+}
+
+
+function Grid(prefix, class_on, class_off, dbl_click, toolbar)
+{
+ this.prefix = prefix;
+ this.class_on = class_on;
+ this.class_off = class_off;
+ this.Items = new Array();
+ this.LastSelectedSequence = 1;
+ this.LastSelectedId = null;
+ this.DblClick = dbl_click;
+ this.ToolBar = toolbar;
+ this.SelectedCount = 0;
+ this.AlternativeGrids = new Array();
+ this.DependantButtons = new Array();
+ this.RadioMode = false;
+}
+
+Grid.prototype.AddItem = function( an_item ) {
+ this.Items[an_item.id] = an_item;
+}
+
+Grid.prototype.AddItemsByIdMask = function ( tag, mask, cb_mask ) {
+ var $item_id=0;
+ elements = document.getElementsByTagName(tag.toUpperCase());
+ for (var i=0; i < elements.length; i++) {
+ if ( typeof(elements[i].id) == 'undefined') {
+ continue;
+ }
+ if ( !elements[i].id.match(mask)) continue;
+ $item_id=RegExp.$1;
+
+ cb_name = cb_mask.replace('$$ID$$',$item_id);
+
+ cb = document.getElementById(cb_name);
+ if (typeof(cb) == 'undefined') alert ('No Checkbox defined for item '+elements[i].id);
+
+ this.AddItem( new GridItem( this, elements[i], cb, $item_id, this.class_on, this.class_off ) );
+ }
+}
+
+Grid.prototype.InitItems = function() {
+ for (var i in this.Items) {
+ this.Items[i].Init();
+ }
+ this.ClearSelection( true,'Grid.InitItems' );
+}
+
+Grid.prototype.DisableClicking = function() {
+ for (var i in this.Items) {
+ this.Items[i].DisableClicking();
+ }
+ this.ClearSelection( true, 'Grid.DisableClicking' );
+}
+
+Grid.prototype.ClearSelection = function( force, called_from ) {
+// alert('selection clear. force: '+force+'; called_from: '+called_from);
+ if (typeof(force) == 'undefined') force = false;
+ if (this.CountSelected() == 0 && !force) return;
+ for (var i in this.Items) {
+ this.Items[i].UnSelect(force);
+ }
+ this.SelectedCount = 0;
+ this.CheckDependencies('Grid.ClearSelection');
+}
+
+Grid.prototype.GetSelected = function() {
+ var $ret = new Array();
+ for (var i in this.Items) {
+ if (this.Items[i].selected) {
+ $ret[$ret.length] = this.Items[i].ItemId;
+ }
+
+ }
+ return $ret;
+}
+
+Grid.prototype.InvertSelection = function() {
+ for (var i in this.Items)
+ {
+ if( this.Items[i].selected )
+ {
+ this.Items[i].UnSelect();
+ }
+ else
+ {
+ this.Items[i].Select();
+ }
+ }
+ this.CheckDependencies('Grid.InvertSelection');
+}
+
+Grid.prototype.SelectAll = function() {
+ for (var i in this.Items) {
+ this.Items[i].Select();
+ }
+ this.CheckDependencies('Grid.SelectAll');
+ this.ClearAlternativeGridsSelection('Grid.SelectAll');
+}
+
+Grid.prototype.SelectRangeUpTo = function( last_sequence ) {
+ for (var i in this.Items) {
+ if (this.Items[i].FallsInRange(this.LastSelectedSequence, last_sequence)) {
+ this.Items[i].Select();
+ }
+ }
+}
+
+Grid.prototype.CountSelected = function ()
+{
+ return this.SelectedCount;
+}
+
+Grid.prototype.Edit = function() {
+ if ( this.CountSelected() == 0 ) return;
+ this.DblClick();
+}
+
+Grid.prototype.SetDependantToolbarButtons = function($buttons, $direct, $mode) {
+ if (!isset($direct)) $direct = true; // direct (use false for invert mode)
+ if (!isset($mode)) $mode = 1; // enable/disable (use 2 for show/hide mode)
+ for (var i in $buttons) {
+ this.DependantButtons.push(new Array($buttons[i], $direct, $mode));
+ }
+ //this.DependantButtons = buttons;
+ this.CheckDependencies('Grid.SetDependantToolbarButtons');
+}
+
+Grid.prototype.CheckDependencies = function($called_from)
+{
+// alert('prefix: ' + this.prefix + '; ' + $called_from + ' -> Grid.CheckDependencies');
+ var enabling = (this.CountSelected() > 0);
+ for (var i in this.DependantButtons) {
+ if (this.DependantButtons[i][0].match("portal:(.*)")) {
+ button_name = RegExp.$1;
+ if (toolbar) {
+ if (enabling == this.DependantButtons[i][1]) {
+ toolbar.enableButton(button_name, true);
+ }
+ else
+ {
+ toolbar.disableButton(button_name, true);
+ }
+ }
+ }
+ else {
+ if (this.DependantButtons[i][2] == 1) {
+ this.ToolBar.SetEnabled(this.DependantButtons[i][0], enabling == this.DependantButtons[i][1]);
+ }
+ else {
+ this.ToolBar.SetVisible(this.DependantButtons[i][0], enabling == this.DependantButtons[i][1]);
+ }
+ }
+ }
+ //if (enabling) this.ClearAlternativeGridsSelection('Grid.CheckDependencies');
+
+}
+
+Grid.prototype.ClearAlternativeGridsSelection = function (called_from)
+{
+ $GridManager.ClearAlternativeGridsSelection(this.prefix);
+}
+
+Grid.prototype.AddAlternativeGrid = function (alt_grid, reciprocal)
+{
+ var $dst_prefix = typeof('alt_grid') == 'string' ? alt_grid : alt_grid.prefix;
+ $GridManager.AddAlternativeGrid(this.prefix, $dst_prefix, reciprocal);
+}
+
+Grid.prototype.FirstSelected = function ()
+{
+ min_sequence = null;
+ var res = null
+ for (var i in this.Items) {
+ if (!this.Items[i].selected) continue;
+ if (min_sequence == null)
+ min_sequence = this.Items[i].sequence;
+ if (this.Items[i].sequence <= min_sequence) {
+ res = this.Items[i].ItemId;
+ min_sequence = this.Items[i].sequence;
+ }
+ }
+ return res;
+}
\ No newline at end of file
Property changes on: trunk/core/admin_templates/js/grid.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/js/in-portal.js
===================================================================
--- trunk/core/admin_templates/js/in-portal.js (nonexistent)
+++ trunk/core/admin_templates/js/in-portal.js (revision 6656)
@@ -0,0 +1,51 @@
+function select_selected(list, selected_value)
+{
+ var count = list.options.length;
+ for (var current = 0; current < count; current ++)
+ {
+ if (list.options[current].value == selected_value)
+ {
+ list.options[current].selected = "1";
+ break;
+ }
+ }
+}
+
+function update_checkbox(cb, cb_hidden)
+{
+ cb_hidden.value = cb.checked ? 1 : 0;
+}
+
+function nop()
+{
+ //do nothing!
+}
+
+function popup_submit(t, w, h)
+{
+ tmp_t = 'popup_'+Math.round(Math.random(1)*100000);
+
+ norm_width = w || 700;
+ norm_height = w || 450;
+ screen_x = (screen.availWidth-norm_width)/2;
+ screen_y = (screen.availHeight-norm_height)/2;
+ wnd = window.open('', tmp_t, 'width='+norm_width+',height='+norm_height+',resizable=yes,left='+screen_x+',top='+screen_y+',scrollbars=yes');
+ wnd.focus();
+ document.kernel_form.target = tmp_t;
+ submit_kernel_form();
+}
+
+function inpConfirm(msg)
+{
+ return confirm( RemoveTranslationLink(msg) );
+}
+
+function show_props(obj, objName) {
+ var result = "";
+ for (var i in obj) {
+ result += objName + "." + i + " = " + obj[i] + "\n";
+ }
+ return result;
+}
+
+
Property changes on: trunk/core/admin_templates/js/in-portal.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/js/calendar.js
===================================================================
--- trunk/core/admin_templates/js/calendar.js (nonexistent)
+++ trunk/core/admin_templates/js/calendar.js (revision 6656)
@@ -0,0 +1,1318 @@
+var cbPath = "";
+ /*
+preloadImage(cbPath);
+preloadImage(cbPathO);
+preloadImage(cbPathA);
+*/
+
+//addScript("core.js");
+//addScript("lang.js");
+
+//addCss("wnd.css");
+//addCss("calendar.css");
+
+function initCalendar(id, dateFormat)
+{
+ var input = document.getElementById(id);
+ if (!input) return;
+ input.dateFormat = dateFormat;
+ var cbPath = input.getAttribute("datepickerIcon");
+
+ var inputContainer = document.createElement("DIV");
+ inputContainer.className = "dpContainer";
+ inputContainer.noWrap = true;
+ var pNode = input.parentNode;
+ pNode.insertBefore(inputContainer, input.nextSibling);
+// inputContainer.appendChild(pNode.removeChild(input));
+
+ var calendarButton = document.createElement("IMG");
+ calendarButton.setAttribute("width", "24");
+ calendarButton.setAttribute("height", "24");
+ calendarButton.setAttribute("align", "absMiddle");
+ calendarButton.style.width=24
+ calendarButton.style.height=24
+ calendarButton.style.cursor = "hand";
+
+ calendarButton.setAttribute("hspace", 2);
+ calendarButton.src = cbPath;
+ calendarButton.onmouseover = cbMouseOver;
+ calendarButton.onmouseout = cbMouseOut;
+ calendarButton.onmouseup = calendarButton.onmouseout;
+ calendarButton.onmousedown = cbMouseDown;
+ calendarButton.showCalendar = wnd_showCalendar;
+ inputContainer.appendChild(calendarButton);
+ inputContainer.dateInput = input;
+}
+
+var calendar;
+
+function cbMouseOver(e)
+{
+// this.src = cbPathO;
+ var evt = (e) ? e : event; if (evt) evt.cancelBubble = true;
+}
+
+function cbMouseOut(e)
+{
+// this.src = cbPath;
+ var evt = (e) ? e : event; if (evt) evt.cancelBubble = true;
+}
+
+function cbMouseDown(e)
+{
+// this.src = cbPathA;
+ // alert("cbMouseDown");
+ var evt = (e) ? e : event; if (evt) evt.cancelBubble = true;
+ this.showCalendar();
+}
+
+function wnd_showCalendar()
+{
+ var el = this.parentNode.dateInput;
+ if (calendar != null) calendar.hide();
+ else
+ {
+ var calendarObject = new Calendar(false, null, dateSelected, closeHandler);
+ calendar = calendarObject;
+ calendarObject.setRange(1900, 2070);
+ calendarObject.create();
+ }
+ calendar.setDateFormat(el.dateFormat);
+ calendar.parseDate(el.value);
+ calendar.sel = el;
+ calendar.showAtElement(el);
+
+ Calendar.addEvent(document, "mousedown", checkCalendar);
+ return false;
+}
+
+function dateSelected(calendarObject, date)
+{
+ calendarObject.sel.value = date;
+ calendarObject.callCloseHandler();
+}
+
+function closeHandler(calendarObject)
+{
+ calendarObject.hide();
+ Calendar.removeEvent(document, "mousedown", checkCalendar);
+}
+
+function checkCalendar(ev)
+{
+ var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
+
+ for (; el != null; el = el.parentNode)
+ if (el == calendar.element || el.tagName == "A") break;
+
+ if (el == null)
+ {
+ calendar.callCloseHandler();
+ Calendar.stopEvent(ev);
+ }
+}
+
+function preloadImage(path)
+{
+ var img = new Image();
+ img.src = path;
+ preloadImages.push(img);
+}
+
+function addCss(path)
+{
+ path = cssPath + path;
+ document.write("<link rel='stylesheet' href='" + path + "' type='text/css'/>");
+}
+
+/*<CORE>*/
+/* Copyright Mihai Bazon, 2002
+ * http://students.infoiasi.ro/~mishoo
+ *
+ * Version: 0.9.1
+ *
+ * Feel free to use this script under the terms of the GNU General Public
+ * License, as long as you do not remove or alter this notice.
+ */
+
+/** The Calendar object constructor. */
+Calendar = function (mondayFirst, dateStr, onSelected, onClose) {
+ // member variables
+ this.activeDiv = null;
+ this.currentDateEl = null;
+ this.checkDisabled = null;
+ this.timeout = null;
+ this.onSelected = onSelected || null;
+ this.onClose = onClose || null;
+ this.dragging = false;
+ this.minYear = 1970;
+ this.maxYear = 2050;
+ this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"];
+ this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"];
+ this.isPopup = true;
+ this.mondayFirst = mondayFirst;
+ this.dateStr = dateStr;
+ // HTML elements
+ this.table = null;
+ this.element = null;
+ this.tbody = null;
+ this.daynames = null;
+ // Combo boxes
+ this.monthsCombo = null;
+ this.yearsCombo = null;
+ this.hilitedMonth = null;
+ this.activeMonth = null;
+ this.hilitedYear = null;
+ this.activeYear = null;
+
+ // one-time initializations
+ if (!Calendar._DN3) {
+ // table of short day names
+ var ar = new Array();
+ for (var i = 8; i > 0;) {
+ ar[--i] = Calendar._DN[i].substr(0, 3);
+ }
+ Calendar._DN3 = ar;
+ // table of short month names
+ ar = new Array();
+ for (var i = 12; i > 0;) {
+ ar[--i] = Calendar._MN[i].substr(0, 3);
+ }
+ Calendar._MN3 = ar;
+ }
+};
+
+// ** constants
+
+/// "static", needed for event handlers.
+Calendar._C = null;
+
+/// detect a special case of "web browser"
+Calendar.is_ie = ( (navigator.userAgent.toLowerCase().indexOf("msie") != -1) &&
+ (navigator.userAgent.toLowerCase().indexOf("opera") == -1) );
+
+// short day names array (initialized at first constructor call)
+Calendar._DN3 = null;
+
+// short month names array (initialized at first constructor call)
+Calendar._MN3 = null;
+
+// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate
+// library, at some point.
+
+Calendar.getAbsolutePos = function(el) {
+ var r = { x: el.offsetLeft, y: el.offsetTop };
+ if (el.offsetParent) {
+ var tmp = Calendar.getAbsolutePos(el.offsetParent);
+ r.x += tmp.x;
+ r.y += tmp.y;
+ }
+ return r;
+};
+
+Calendar.isRelated = function (el, evt) {
+ var related = evt.relatedTarget;
+ if (!related) {
+ var type = evt.type;
+ if (type == "mouseover") {
+ related = evt.fromElement;
+ } else if (type == "mouseout") {
+ related = evt.toElement;
+ }
+ }
+ while (related) {
+ if (related == el) {
+ return true;
+ }
+ related = related.parentNode;
+ }
+ return false;
+};
+
+Calendar.removeClass = function(el, className) {
+ if (!(el && el.className)) {
+ return;
+ }
+ var cls = el.className.split(" ");
+ var ar = new Array();
+ for (var i = cls.length; i > 0;) {
+ if (cls[--i] != className) {
+ ar[ar.length] = cls[i];
+ }
+ }
+ el.className = ar.join(" ");
+};
+
+Calendar.addClass = function(el, className) {
+ el.className += " " + className;
+};
+
+Calendar.getElement = function(ev) {
+ if (Calendar.is_ie) {
+ return window.event.srcElement;
+ } else {
+ return ev.currentTarget;
+ }
+};
+
+Calendar.getTargetElement = function(ev) {
+ if (Calendar.is_ie) {
+ return window.event.srcElement;
+ } else {
+ return ev.target;
+ }
+};
+
+Calendar.stopEvent = function(ev) {
+ if (Calendar.is_ie) {
+ window.event.cancelBubble = true;
+ window.event.returnValue = false;
+ } else {
+ ev.preventDefault();
+ ev.stopPropagation();
+ }
+};
+
+Calendar.addEvent = function(el, evname, func) {
+ if (Calendar.is_ie) {
+ el.attachEvent("on" + evname, func);
+ } else {
+ el.addEventListener(evname, func, true);
+ }
+};
+
+Calendar.removeEvent = function(el, evname, func) {
+ if (Calendar.is_ie) {
+ el.detachEvent("on" + evname, func);
+ } else {
+ el.removeEventListener(evname, func, true);
+ }
+};
+
+Calendar.createElement = function(type, parent) {
+ var el = null;
+ if (document.createElementNS) {
+ // use the XHTML namespace; IE won't normally get here unless
+ // _they_ "fix" the DOM2 implementation.
+ el = document.createElementNS("http://www.w3.org/1999/xhtml", type);
+ } else {
+ el = document.createElement(type);
+ }
+ if (typeof parent != "undefined") {
+ parent.appendChild(el);
+ }
+ return el;
+};
+
+// END: UTILITY FUNCTIONS
+
+// BEGIN: CALENDAR STATIC FUNCTIONS
+
+/** Internal -- adds a set of events to make some element behave like a button. */
+Calendar._add_evs = function(el) {
+ with (Calendar) {
+ addEvent(el, "mouseover", dayMouseOver);
+ addEvent(el, "mousedown", dayMouseDown);
+ addEvent(el, "mouseout", dayMouseOut);
+ if (is_ie) {
+ addEvent(el, "dblclick", dayMouseDblClick);
+ el.setAttribute("unselectable", true);
+ }
+ }
+};
+
+Calendar.findMonth = function(el) {
+ if (typeof el.month != "undefined") {
+ return el;
+ } else if (typeof el.parentNode.month != "undefined") {
+ return el.parentNode;
+ }
+ return null;
+};
+
+Calendar.findYear = function(el) {
+ if (typeof el.year != "undefined") {
+ return el;
+ } else if (typeof el.parentNode.year != "undefined") {
+ return el.parentNode;
+ }
+ return null;
+};
+
+Calendar.showMonthsCombo = function () {
+ var cal = Calendar._C;
+ if (!cal) {
+ return false;
+ }
+ var cal = cal;
+ var cd = cal.activeDiv;
+ var mc = cal.monthsCombo;
+ if (cal.hilitedMonth) {
+ Calendar.removeClass(cal.hilitedMonth, "hilite");
+ }
+ if (cal.activeMonth) {
+ Calendar.removeClass(cal.activeMonth, "active");
+ }
+ var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];
+ Calendar.addClass(mon, "active");
+ cal.activeMonth = mon;
+ mc.style.left = cd.offsetLeft;
+ mc.style.top = cd.offsetTop + cd.offsetHeight;
+ mc.style.display = "block";
+};
+
+Calendar.showYearsCombo = function (fwd) {
+ var cal = Calendar._C;
+ if (!cal) {
+ return false;
+ }
+ var cal = cal;
+ var cd = cal.activeDiv;
+ var yc = cal.yearsCombo;
+ if (cal.hilitedYear) {
+ Calendar.removeClass(cal.hilitedYear, "hilite");
+ }
+ if (cal.activeYear) {
+ Calendar.removeClass(cal.activeYear, "active");
+ }
+ cal.activeYear = null;
+ var Y = cal.date.getFullYear() + (fwd ? 1 : -1);
+ var yr = yc.firstChild;
+ var show = false;
+ for (var i = 12; i > 0; --i) {
+ if (Y >= cal.minYear && Y <= cal.maxYear) {
+ yr.firstChild.data = Y;
+ yr.year = Y;
+ yr.style.display = "block";
+ show = true;
+ } else {
+ yr.style.display = "none";
+ }
+ yr = yr.nextSibling;
+ Y += fwd ? 2 : -2;
+ }
+ if (show) {
+ yc.style.left = cd.offsetLeft;
+ yc.style.top = cd.offsetTop + cd.offsetHeight;
+ yc.style.display = "block";
+ }
+};
+
+// event handlers
+
+Calendar.tableMouseUp = function(ev) {
+ var cal = Calendar._C;
+ if (!cal) {
+ return false;
+ }
+ if (cal.timeout) {
+ clearTimeout(cal.timeout);
+ }
+ var el = cal.activeDiv;
+ if (!el) {
+ return false;
+ }
+ var target = Calendar.getTargetElement(ev);
+ Calendar.removeClass(el, "active");
+ if (target == el || target.parentNode == el) {
+ Calendar.cellClick(el);
+ }
+ var mon = Calendar.findMonth(target);
+ var date = null;
+ if (mon) {
+ date = new Date(cal.date);
+ if (mon.month != date.getMonth()) {
+ date.setMonth(mon.month);
+ cal.setDate(date);
+ }
+ } else {
+ var year = Calendar.findYear(target);
+ if (year) {
+ date = new Date(cal.date);
+ if (year.year != date.getFullYear()) {
+ date.setFullYear(year.year);
+ cal.setDate(date);
+ }
+ }
+ }
+ with (Calendar) {
+ removeEvent(document, "mouseup", tableMouseUp);
+ removeEvent(document, "mouseover", tableMouseOver);
+ removeEvent(document, "mousemove", tableMouseOver);
+ cal._hideCombos();
+ stopEvent(ev);
+ _C = null;
+ }
+};
+
+Calendar.tableMouseOver = function (ev) {
+ var cal = Calendar._C;
+ if (!cal) {
+ return;
+ }
+ var el = cal.activeDiv;
+ var target = Calendar.getTargetElement(ev);
+ if (target == el || target.parentNode == el) {
+ Calendar.addClass(el, "hilite active");
+ } else {
+ Calendar.removeClass(el, "active");
+ Calendar.removeClass(el, "hilite");
+ }
+ var mon = Calendar.findMonth(target);
+ if (mon) {
+ if (mon.month != cal.date.getMonth()) {
+ if (cal.hilitedMonth) {
+ Calendar.removeClass(cal.hilitedMonth, "hilite");
+ }
+ Calendar.addClass(mon, "hilite");
+ cal.hilitedMonth = mon;
+ } else if (cal.hilitedMonth) {
+ Calendar.removeClass(cal.hilitedMonth, "hilite");
+ }
+ } else {
+ var year = Calendar.findYear(target);
+ if (year) {
+ if (year.year != cal.date.getFullYear()) {
+ if (cal.hilitedYear) {
+ Calendar.removeClass(cal.hilitedYear, "hilite");
+ }
+ Calendar.addClass(year, "hilite");
+ cal.hilitedYear = year;
+ } else if (cal.hilitedYear) {
+ Calendar.removeClass(cal.hilitedYear, "hilite");
+ }
+ }
+ }
+ Calendar.stopEvent(ev);
+};
+
+Calendar.tableMouseDown = function (ev) {
+ if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) {
+ Calendar.stopEvent(ev);
+ }
+};
+
+Calendar.calDragIt = function (ev) {
+ var cal = Calendar._C;
+ if (!(cal && cal.dragging)) {
+ return false;
+ }
+ var posX;
+ var posY;
+ if (Calendar.is_ie) {
+ posY = window.event.clientY + document.body.scrollTop;
+ posX = window.event.clientX + document.body.scrollLeft;
+ } else {
+ posX = ev.pageX;
+ posY = ev.pageY;
+ }
+ cal.hideShowCovered();
+ var st = cal.element.style;
+ st.left = (posX - cal.xOffs) + "px";
+ st.top = (posY - cal.yOffs) + "px";
+ Calendar.stopEvent(ev);
+};
+
+Calendar.calDragEnd = function (ev) {
+ var cal = Calendar._C;
+ if (!cal) {
+ return false;
+ }
+ cal.dragging = false;
+ with (Calendar) {
+ removeEvent(document, "mousemove", calDragIt);
+ removeEvent(document, "mouseover", stopEvent);
+ removeEvent(document, "mouseup", calDragEnd);
+ tableMouseUp(ev);
+ }
+ cal.hideShowCovered();
+};
+
+Calendar.dayMouseDown = function(ev) {
+ var el = Calendar.getElement(ev);
+ if (el.disabled) {
+ return false;
+ }
+ var cal = el.calendar;
+ cal.activeDiv = el;
+ Calendar._C = cal;
+ if (el.navtype != 300) with (Calendar) {
+ addClass(el, "hilite active");
+ addEvent(document, "mouseover", tableMouseOver);
+ addEvent(document, "mousemove", tableMouseOver);
+ addEvent(document, "mouseup", tableMouseUp);
+ } else if (cal.isPopup) {
+ cal._dragStart(ev);
+ }
+ Calendar.stopEvent(ev);
+ if (el.navtype == -1 || el.navtype == 1) {
+ cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250);
+ } else if (el.navtype == -2 || el.navtype == 2) {
+ cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250);
+ } else {
+ cal.timeout = null;
+ }
+};
+
+Calendar.dayMouseDblClick = function(ev) {
+ Calendar.cellClick(Calendar.getElement(ev));
+ if (Calendar.is_ie) {
+ document.selection.empty();
+ }
+};
+
+Calendar.dayMouseOver = function(ev) {
+ var el = Calendar.getElement(ev);
+ if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) {
+ return false;
+ }
+ if (el.ttip) {
+ if (el.ttip.substr(0, 1) == "_") {
+ var date = null;
+ with (el.calendar.date) {
+ date = new Date(getFullYear(), getMonth(), el.caldate);
+ }
+ el.ttip = date.print(el.calendar.ttDateFormat) + el.ttip.substr(1);
+ }
+ el.calendar.tooltips.firstChild.data = el.ttip;
+ }
+ if (el.navtype != 300) {
+ Calendar.addClass(el, "hilite");
+ }
+ Calendar.stopEvent(ev);
+};
+
+Calendar.dayMouseOut = function(ev) {
+ with (Calendar) {
+ var el = getElement(ev);
+ if (isRelated(el, ev) || _C || el.disabled) {
+ return false;
+ }
+ removeClass(el, "hilite");
+ el.calendar.tooltips.firstChild.data = _TT["SEL_DATE"];
+ stopEvent(ev);
+ }
+};
+
+/**
+ * A generic "click" handler :) handles all types of buttons defined in this
+ * calendar.
+ */
+Calendar.cellClick = function(el) {
+ var cal = el.calendar;
+ var closing = false;
+ var newdate = false;
+ var date = null;
+ if (typeof el.navtype == "undefined") {
+ Calendar.removeClass(cal.currentDateEl, "selected");
+ Calendar.addClass(el, "selected");
+ closing = (cal.currentDateEl == el);
+ if (!closing) {
+ cal.currentDateEl = el;
+ }
+ cal.date.setDate(el.caldate);
+ date = cal.date;
+ newdate = true;
+ } else {
+ if (el.navtype == 200) {
+ Calendar.removeClass(el, "hilite");
+ cal.callCloseHandler();
+ return;
+ }
+ date = (el.navtype == 0) ? new Date() : new Date(cal.date);
+ var year = date.getFullYear();
+ var mon = date.getMonth();
+ var setMonth = function (mon) {
+ var day = date.getDate();
+ var max = date.getMonthDays();
+ if (day > max) {
+ date.setDate(max);
+ }
+ date.setMonth(mon);
+ };
+ switch (el.navtype) {
+ case -2:
+ if (year > cal.minYear) {
+ date.setFullYear(year - 1);
+ }
+ break;
+ case -1:
+ if (mon > 0) {
+ setMonth(mon - 1);
+ } else if (year-- > cal.minYear) {
+ date.setFullYear(year);
+ setMonth(11);
+ }
+ break;
+ case 1:
+ if (mon < 11) {
+ setMonth(mon + 1);
+ } else if (year < cal.maxYear) {
+ date.setFullYear(year + 1);
+ setMonth(0);
+ }
+ break;
+ case 2:
+ if (year < cal.maxYear) {
+ date.setFullYear(year + 1);
+ }
+ break;
+ case 100:
+ cal.setMondayFirst(!cal.mondayFirst);
+ return;
+ }
+ if (!date.equalsTo(cal.date)) {
+ cal.setDate(date);
+ newdate = el.navtype == 0;
+ }
+ }
+ if (newdate) {
+ cal.callHandler();
+ }
+ if (closing) {
+ Calendar.removeClass(el, "hilite");
+ cal.callCloseHandler();
+ }
+};
+
+// END: CALENDAR STATIC FUNCTIONS
+
+// BEGIN: CALENDAR OBJECT FUNCTIONS
+
+/**
+ * This function creates the calendar inside the given parent. If _par is
+ * null than it creates a popup calendar inside the BODY element. If _par is
+ * an element, be it BODY, then it creates a non-popup calendar (still
+ * hidden). Some properties need to be set before calling this function.
+ */
+Calendar.prototype.create = function (_par) {
+ var parent = null;
+ if (! _par) {
+ // default parent is the document body, in which case we create
+ // a popup calendar.
+ parent = document.getElementsByTagName("body")[0];
+ this.isPopup = true;
+ } else {
+ parent = _par;
+ this.isPopup = false;
+ }
+ this.date = this.dateStr ? new Date(this.dateStr) : new Date();
+
+ var table = Calendar.createElement("table");
+ this.table = table;
+ table.cellSpacing = 0;
+ table.cellPadding = 0;
+ table.calendar = this;
+ Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown);
+
+ var div = Calendar.createElement("div");
+ this.element = div;
+ div.className = "calendar";
+ if (this.isPopup) {
+ div.style.position = "absolute";
+ div.style.display = "none";
+ }
+ div.appendChild(table);
+
+ var thead = Calendar.createElement("thead", table);
+ var cell = null;
+ var row = null;
+
+ var cal = this;
+ var hh = function (text, cs, navtype) {
+ cell = Calendar.createElement("td", row);
+ cell.colSpan = cs;
+ cell.className = "button";
+ Calendar._add_evs(cell);
+ cell.calendar = cal;
+ cell.navtype = navtype;
+ if (text.substr(0, 1) != "&") {
+ cell.appendChild(document.createTextNode(text));
+ }
+ else {
+ // FIXME: dirty hack for entities
+ cell.innerHTML = text;
+ }
+ return cell;
+ };
+
+ row = Calendar.createElement("tr", thead);
+ row.className = "headrow";
+
+ hh("-", 1, 100).ttip = Calendar._TT["TOGGLE"];
+ this.title = hh("", this.isPopup ? 5 : 6, 300);
+ this.title.className = "title";
+ if (this.isPopup) {
+ this.title.ttip = Calendar._TT["DRAG_TO_MOVE"];
+ this.title.style.cursor = "move";
+ hh("X", 1, 200).ttip = Calendar._TT["CLOSE"];
+ }
+
+ row = Calendar.createElement("tr", thead);
+ row.className = "headrow";
+
+ hh("«", 1, -2).ttip = Calendar._TT["PREV_YEAR"];
+ hh("‹", 1, -1).ttip = Calendar._TT["PREV_MONTH"];
+ hh(Calendar._TT["TODAY"], 3, 0).ttip = Calendar._TT["GO_TODAY"];
+ hh("›", 1, 1).ttip = Calendar._TT["NEXT_MONTH"];
+ hh("»", 1, 2).ttip = Calendar._TT["NEXT_YEAR"];
+
+ // day names
+ row = Calendar.createElement("tr", thead);
+ row.className = "daynames";
+ this.daynames = row;
+ for (var i = 7; i > 0; --i) {
+ cell = Calendar.createElement("td", row);
+ cell.appendChild(document.createTextNode(""));
+ if (!i) {
+ cell.navtype = 100;
+ cell.calendar = this;
+ Calendar._add_evs(cell);
+ }
+ }
+ this._displayWeekdays();
+
+ var tbody = Calendar.createElement("tbody", table);
+ this.tbody = tbody;
+
+ for (i = 6; i > 0; --i) {
+ row = Calendar.createElement("tr", tbody);
+ for (var j = 7; j > 0; --j) {
+ cell = Calendar.createElement("td", row);
+ cell.appendChild(document.createTextNode(""));
+ cell.calendar = this;
+ Calendar._add_evs(cell);
+ }
+ }
+
+ var tfoot = Calendar.createElement("tfoot", table);
+
+ row = Calendar.createElement("tr", tfoot);
+ row.className = "footrow";
+
+ cell = hh(Calendar._TT["SEL_DATE"], 7, 300);
+ cell.className = "ttip";
+ if (this.isPopup) {
+ cell.ttip = Calendar._TT["DRAG_TO_MOVE"];
+ cell.style.cursor = "move";
+ }
+ this.tooltips = cell;
+
+ div = Calendar.createElement("div", this.element);
+ this.monthsCombo = div;
+ div.className = "combo";
+ for (i = 0; i < Calendar._MN.length; ++i) {
+ var mn = Calendar.createElement("div");
+ mn.className = "label";
+ mn.month = i;
+ mn.appendChild(document.createTextNode(Calendar._MN3[i]));
+ div.appendChild(mn);
+ }
+
+ div = Calendar.createElement("div", this.element);
+ this.yearsCombo = div;
+ div.className = "combo";
+ for (i = 12; i > 0; --i) {
+ var yr = Calendar.createElement("div");
+ yr.className = "label";
+ yr.appendChild(document.createTextNode(""));
+ div.appendChild(yr);
+ }
+
+ this._init(this.mondayFirst, this.date);
+ parent.appendChild(this.element);
+};
+
+/**
+ * (RE)Initializes the calendar to the given date and style (if mondayFirst is
+ * true it makes Monday the first day of week, otherwise the weeks start on
+ * Sunday.
+ */
+Calendar.prototype._init = function (mondayFirst, date) {
+ var today = new Date();
+ var year = date.getFullYear();
+ if (year < this.minYear) {
+ year = this.minYear;
+ date.setFullYear(year);
+ } else if (year > this.maxYear) {
+ year = this.maxYear;
+ date.setFullYear(year);
+ }
+ this.mondayFirst = mondayFirst;
+ this.date = new Date(date);
+ var month = date.getMonth();
+ var mday = date.getDate();
+ var no_days = date.getMonthDays();
+ date.setDate(1);
+ var wday = date.getDay();
+ var MON = mondayFirst ? 1 : 0;
+ var SAT = mondayFirst ? 5 : 6;
+ var SUN = mondayFirst ? 6 : 0;
+ if (mondayFirst) {
+ wday = (wday > 0) ? (wday - 1) : 6;
+ }
+ var iday = 1;
+ var row = this.tbody.firstChild;
+ var MN = Calendar._MN3[month];
+ var hasToday = ((today.getFullYear() == year) && (today.getMonth() == month));
+ var todayDate = today.getDate();
+ for (var i = 0; i < 6; ++i) {
+ if (iday > no_days) {
+ row.className = "emptyrow";
+ row = row.nextSibling;
+ continue;
+ }
+ var cell = row.firstChild;
+ row.className = "daysrow";
+ for (var j = 0; j < 7; ++j) {
+ if ((!i && j < wday) || iday > no_days) {
+ cell.className = "emptycell";
+ cell = cell.nextSibling;
+ continue;
+ }
+ cell.firstChild.data = iday;
+ cell.className = "day";
+ cell.disabled = false;
+ if (typeof this.checkDisabled == "function") {
+ date.setDate(iday);
+ if (this.checkDisabled(date)) {
+ cell.className += " disabled";
+ cell.disabled = true;
+ }
+ }
+ if (!cell.disabled) {
+ cell.caldate = iday;
+ cell.ttip = "_";
+ if (iday == mday) {
+ cell.className += " selected";
+ this.currentDateEl = cell;
+ }
+ if (hasToday && (iday == todayDate)) {
+ cell.className += " today";
+ cell.ttip += Calendar._TT["PART_TODAY"];
+ }
+ if (wday == SAT || wday == SUN) {
+ cell.className += " weekend";
+ }
+ }
+ ++iday;
+ ((++wday) ^ 7) || (wday = 0);
+ cell = cell.nextSibling;
+ }
+ row = row.nextSibling;
+ }
+ this.title.firstChild.data = Calendar._MN[month] + ", " + year;
+ // PROFILE
+ // this.tooltips.firstChild.data = "Generated in " + ((new Date()) - today) + " ms";
+};
+
+/**
+ * Calls _init function above for going to a certain date (but only if the
+ * date is different than the currently selected one).
+ */
+Calendar.prototype.setDate = function (date) {
+ if (!date.equalsTo(this.date)) {
+ this._init(this.mondayFirst, date);
+ }
+};
+
+/** Modifies the "mondayFirst" parameter (EU/US style). */
+Calendar.prototype.setMondayFirst = function (mondayFirst) {
+ this._init(mondayFirst, this.date);
+ this._displayWeekdays();
+};
+
+/**
+ * Allows customization of what dates are enabled. The "unaryFunction"
+ * parameter must be a function object that receives the date (as a JS Date
+ * object) and returns a boolean value. If the returned value is true then
+ * the passed date will be marked as disabled.
+ */
+Calendar.prototype.setDisabledHandler = function (unaryFunction) {
+ this.checkDisabled = unaryFunction;
+};
+
+/** Customization of allowed year range for the calendar. */
+Calendar.prototype.setRange = function (a, z) {
+ this.minYear = a;
+ this.maxYear = z;
+};
+
+/** Calls the first user handler (selectedHandler). */
+Calendar.prototype.callHandler = function () {
+ if (this.onSelected) {
+ this.onSelected(this, this.date.print(this.dateFormat));
+ }
+};
+
+/** Calls the second user handler (closeHandler). */
+Calendar.prototype.callCloseHandler = function () {
+ if (this.onClose) {
+ this.onClose(this);
+ }
+ this.hideShowCovered();
+};
+
+/** Removes the calendar object from the DOM tree and destroys it. */
+Calendar.prototype.destroy = function () {
+ var el = this.element.parentNode;
+ el.removeChild(this.element);
+ Calendar._C = null;
+ delete el;
+};
+
+/**
+ * Moves the calendar element to a different section in the DOM tree (changes
+ * its parent).
+ */
+Calendar.prototype.reparent = function (new_parent) {
+ var el = this.element;
+ el.parentNode.removeChild(el);
+ new_parent.appendChild(el);
+};
+
+/** Shows the calendar. */
+Calendar.prototype.show = function () {
+ this.element.style.display = "block";
+ this.hideShowCovered();
+};
+
+/**
+ * Hides the calendar. Also removes any "hilite" from the class of any TD
+ * element.
+ */
+Calendar.prototype.hide = function () {
+ var trs = this.table.getElementsByTagName("td");
+ for (var i = trs.length; i > 0; ) {
+ Calendar.removeClass(trs[--i], "hilite");
+ }
+ this.element.style.display = "none";
+};
+
+/**
+ * Shows the calendar at a given absolute position (beware that, depending on
+ * the calendar element style -- position property -- this might be relative
+ * to the parent's containing rectangle).
+ */
+Calendar.prototype.showAt = function (x, y) {
+ var s = this.element.style;
+ s.left = x + "px";
+ s.top = y + "px";
+ this.show();
+};
+
+/** Shows the calendar near a given element. */
+Calendar.prototype.showAtElement = function (el) {
+ var p = Calendar.getAbsolutePos(el);
+
+ var cw = 190;
+ var ch = -200;
+
+ if (Calendar.is_ie)
+ {
+ var posX = getWndX(el) + el.offsetWidth + 18; if (posX + ch > document.body.scrollLeft + document.body.offsetWidth) posX = document.body.scrollLeft + document.body.offsetWidth - ch
+ var posY = p.y + el.offsetHeight; if (posY + cw > document.body.scrollTop + document.body.offsetHeight) posY = getWndY(el) - cw;
+ //document.body.scrollTop + document.body.offsetHeight - cw - el.offsetHeight
+ this.showAt(posX, posY);
+ }
+ else
+ {
+ // for other browsers types
+ this.showAt(getWndX(el) + el.offsetWidth + 30, p.y + el.offsetHeight-200);
+ }
+};
+
+function getWndC(object, c)
+{
+ pos = 0;
+ while (object != null)
+ {
+ pos += (c == "y") ? object.offsetTop : object.offsetLeft;
+ object = object.offsetParent;
+ }
+ return pos;
+}
+
+function getWndX(object) {return getWndC(object, "x")}
+function getWndY(object) {return getWndC(object, "y")}
+
+
+/** Customizes the date format. */
+Calendar.prototype.setDateFormat = function (str) {
+ this.dateFormat = str;
+};
+
+/** Customizes the tooltip date format. */
+Calendar.prototype.setTtDateFormat = function (str) {
+ this.ttDateFormat = str;
+};
+
+/**
+ * Tries to identify the date represented in a string. If successful it also
+ * calls this.setDate which moves the calendar to the given date.
+ */
+Calendar.prototype.parseDate = function (str, fmt) {
+ var y = 0;
+ var m = -1;
+ var d = 0;
+ var a = str.split(/\W+/);
+ if (!fmt) {
+ fmt = this.dateFormat;
+ }
+ var b = fmt.split(/\W+/);
+ var i = 0, j = 0;
+ for (i = 0; i < a.length; ++i) {
+ if (b[i] == "D" || b[i] == "DD") {
+ continue;
+ }
+ if (b[i] == "j" || b[i] == "d") {
+ d = a[i];
+ }
+ if (b[i] == "n" || b[i] == "m") {
+ m = a[i]-1;
+ }
+// if (b[i] == "y") {
+// y = a[i];
+// }
+ if ((b[i] == "Y")||(b[i] == "y")) {
+// if (b[i] == "yy") {
+ if (a[i].length == 4) {
+ y = a[i];
+ }
+ else {
+ if (parseInt(a[i]) < 70) {
+ y = parseInt(a[i]) + 2000;
+ }
+ else {
+ y = parseInt(a[i]) + 1900;
+ }
+ }
+ }
+ if (b[i] == "M" || b[i] == "MM") {
+ for (j = 0; j < 12; ++j) {
+ if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; }
+ }
+ }
+ }
+ if (y != 0 && m != -1 && d != 0) {
+ this.setDate(new Date(y, m, d));
+ return;
+ }
+ y = 0; m = -1; d = 0;
+ for (i = 0; i < a.length; ++i) {
+ if (a[i].search(/[a-zA-Z]+/) != -1) {
+ var t = -1;
+ for (j = 0; j < 12; ++j) {
+ if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; }
+ }
+ if (t != -1) {
+ if (m != -1) {
+ d = m+1;
+ }
+ m = t;
+ }
+ } else if (parseInt(a[i]) <= 12 && m == -1) {
+ m = a[i]-1;
+ } else if (parseInt(a[i]) > 31 && y == 0) {
+ y = a[i];
+ } else if (d == 0) {
+ d = a[i];
+ }
+ }
+ if (y == 0) {
+ var today = new Date();
+ y = today.getFullYear();
+ }
+ if (m != -1 && d != 0) {
+ this.setDate(new Date(y, m, d));
+ }
+};
+
+Calendar.prototype.hideShowCovered = function () {
+ var tags = new Array("applet", "iframe", "select");
+ var el = this.element;
+
+ var p = Calendar.getAbsolutePos(el);
+ var EX1 = p.x;
+ var EX2 = el.offsetWidth + EX1;
+ var EY1 = p.y;
+ var EY2 = el.offsetHeight + EY1;
+
+ for (var k = tags.length; k > 0; ) {
+ var ar = document.getElementsByTagName(tags[--k]);
+ var cc = null;
+
+ for (var i = ar.length; i > 0;) {
+ cc = ar[--i];
+
+ p = Calendar.getAbsolutePos(cc);
+ var CX1 = p.x;
+ var CX2 = cc.offsetWidth + CX1;
+ var CY1 = p.y;
+ var CY2 = cc.offsetHeight + CY1;
+
+ if ((CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
+ cc.style.visibility = "visible";
+ } else {
+ cc.style.visibility = "hidden";
+ }
+ }
+ }
+};
+
+/** Internal function; it displays the bar with the names of the weekday. */
+Calendar.prototype._displayWeekdays = function () {
+ var MON = this.mondayFirst ? 0 : 1;
+ var SUN = this.mondayFirst ? 6 : 0;
+ var SAT = this.mondayFirst ? 5 : 6;
+ var cell = this.daynames.firstChild;
+ for (var i = 0; i < 7; ++i) {
+ cell.className = "day name";
+ if (!i) {
+ cell.ttip = this.mondayFirst ? Calendar._TT["SUN_FIRST"] : Calendar._TT["MON_FIRST"];
+ cell.navtype = 100;
+ cell.calendar = this;
+ Calendar._add_evs(cell);
+ }
+ if (i == SUN || i == SAT) {
+ Calendar.addClass(cell, "weekend");
+ }
+ cell.firstChild.data = Calendar._DN3[i + 1 - MON];
+ cell = cell.nextSibling;
+ }
+};
+
+/** Internal function. Hides all combo boxes that might be displayed. */
+Calendar.prototype._hideCombos = function () {
+ this.monthsCombo.style.display = "none";
+ this.yearsCombo.style.display = "none";
+};
+
+/** Internal function. Starts dragging the element. */
+Calendar.prototype._dragStart = function (ev) {
+ if (this.dragging) {
+ return;
+ }
+ this.dragging = true;
+ var posX;
+ var posY;
+ if (Calendar.is_ie) {
+ posY = window.event.clientY + document.body.scrollTop;
+ posX = window.event.clientX + document.body.scrollLeft;
+ } else {
+ posY = ev.clientY + window.scrollY;
+ posX = ev.clientX + window.scrollX;
+ }
+ var st = this.element.style;
+ this.xOffs = posX - parseInt(st.left);
+ this.yOffs = posY - parseInt(st.top);
+ with (Calendar) {
+ addEvent(document, "mousemove", calDragIt);
+ addEvent(document, "mouseover", stopEvent);
+ addEvent(document, "mouseup", calDragEnd);
+ }
+};
+
+// BEGIN: DATE OBJECT PATCHES
+
+/** Adds the number of days array to the Date object. */
+Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
+
+/** Returns the number of days in the current month */
+Date.prototype.getMonthDays = function() {
+ var year = this.getFullYear();
+ var month = this.getMonth();
+ if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
+ return 29;
+ } else {
+ return Date._MD[month];
+ }
+};
+
+/** Checks dates equality (ignores time) */
+Date.prototype.equalsTo = function(date) {
+ return ((this.getFullYear() == date.getFullYear()) &&
+ (this.getMonth() == date.getMonth()) &&
+ (this.getDate() == date.getDate()));
+};
+
+/** Prints the date in a string according to the given format. */
+Date.prototype.print = function (frm) {
+ var str = new String(frm);
+ var m = this.getMonth();
+ var d = this.getDate();
+ var y = this.getFullYear();
+ var w = this.getDay();
+ var s = new Array();
+ s["j"] = d;
+ s["d"] = (d < 10) ? ("0" + d) : d;
+ s["n"] = 1+m;
+ s["m"] = (m < 9) ? ("0" + (1+m)) : (1+m);
+ s["Y"] = y;
+ s["y"] = new String(y).substr(2, 2);
+ with (Calendar) {
+ s["D"] = _DN3[w];
+ s["DD"] = _DN[w];
+ s["M"] = _MN3[m];
+ s["MM"] = _MN[m];
+ }
+ var re = /(.*)(\W|^)(j|d|n|m|y|Y|MM|M|DD|D)(\W|$)(.*)/;
+ while (re.exec(str) != null) {
+ str = RegExp.$1 + RegExp.$2 + s[RegExp.$3] + RegExp.$4 + RegExp.$5;
+ }
+ return str;
+};
+
+// END: DATE OBJECT PATCHES
+/*</CORE>*/
+/*<LANG>*/
+Calendar._DN = new Array
+("Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ "Sunday");
+Calendar._MN = new Array
+("January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["TOGGLE"] = "Toggle first day of week";
+Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)";
+Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)";
+Calendar._TT["GO_TODAY"] = "Go Today";
+Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)";
+Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)";
+Calendar._TT["SEL_DATE"] = "Select date";
+Calendar._TT["DRAG_TO_MOVE"] = "Drag to move";
+Calendar._TT["PART_TODAY"] = " (today)";
+Calendar._TT["MON_FIRST"] = "Display Monday first";
+Calendar._TT["SUN_FIRST"] = "Display Sunday first";
+Calendar._TT["CLOSE"] = "Close";
+Calendar._TT["TODAY"] = "Today";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd";
+Calendar._TT["TT_DATE_FORMAT"] = "D, M d";
+/*</LANG>*/
+/*</CSS>*/
+document.write("<style type=\"text/css\">")
+document.write(".calendar { z-Index: 1; position: relative; display: none; border-top: 2px solid #fff; border-right: 2px solid #000; border-bottom: 2px solid #000; border-left: 2px solid #fff; font-size: 11px; color: #000; cursor: default; background: #d4d0c8; font-family: tahoma,verdana,sans-serif;}.calendar table { border-top: 1px solid #000; border-right: 1px solid #fff; border-bottom: 1px solid #fff; border-left: 1px solid #000; font-size: 11px; color: #000; cursor: default; background: #d4d0c8; font-family: tahoma,verdana,sans-serif;}/* Header part -- contains navigation buttons and day names. */.calendar .button { text-align: center; padding: 1px; border-top: 1px solid #fff; border-right: 1px solid #000; border-bottom: 1px solid #000; border-left: 1px solid #fff;}.calendar thead .title { font-weight: bold; padding: 1px; border: 1px solid #000; background: #848078; color: #fff; text-align: center;}.calendar thead .headrow { /* Row <TR> containing navigation buttons */}.calendar thead .daynames { /* Row <TR> containing the day names */}.calendar thead .name { /* Cells <TD> containing the day names */ border-bottom: 1px solid #000; padding: 2px; text-align: center; background: #f4f0e8;}.calendar thead .weekend { /* How a weekend day name shows in header */ color: #f00;}.calendar thead .hilite { /* How do the buttons in header appear when hover */ border-top: 2px solid #fff; border-right: 2px solid #000; border-bottom: 2px solid #000; border-left: 2px solid #fff; padding: 0px; background: #e4e0d8;}.calendar thead .active { /* Active (pressed) buttons in header */ padding: 2px 0px 0px 2px; border-top: 1px solid #000; border-right: 1px solid #fff; border-bottom: 1px solid #fff; border-left: 1px solid #000; background: #c4c0b8;}/* The body part -- contains all the days in month. */.calendar tbody .day { /* Cells <TD> containing month days dates */ width: 2em; text-align: right; padding: 2px 4px 2px 2px;}.calendar tbody .hilite { /* Hovered cells <TD> */ padding: 1px 3px 1px 1px; border-top: 1px solid #fff; border-right: 1px solid #000; border-bottom: 1px solid #000; border-left: 1px solid #fff;}.calendar tbody .active { /* Active (pressed) cells <TD> */ padding: 2px 2px 0px 2px; border-top: 1px solid #000; border-right: 1px solid #fff; border-bottom: 1px solid #fff; border-left: 1px solid #000;}.calendar tbody .selected { /* Cell showing selected date */ font-weight: bold; border-top: 1px solid #000; border-right: 1px solid #fff; border-bottom: 1px solid #fff; border-left: 1px solid #000; padding: 2px 2px 0px 2px; background: #e4e0d8;}.calendar tbody .weekend { /* Cells showing weekend days */ color: #f00;}.calendar tbody .today { /* Cell showing today date */ font-weight: bold; color: #00f;}.calendar tbody .disabled { color: #999; }.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ visibility: hidden;}.calendar tbody .emptyrow { display: none;} .calendar tfoot .footrow { }.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */ background: #f4f0e8; padding: 1px; border: 1px solid #000; background: #848078; color: #fff; text-align: center;}.calendar tfoot .hilite { /* Hover style for buttons in footer */ border-top: 1px solid #fff; border-right: 1px solid #000; border-bottom: 1px solid #000; border-left: 1px solid #fff; padding: 1px; background: #e4e0d8;}.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ padding: 2px 0px 0px 2px; border-top: 1px solid #000; border-right: 1px solid #fff; border-bottom: 1px solid #fff; border-left: 1px solid #000;}/* Combo boxes (menus that display months/years for direct selection) */.combo { position: absolute; display: none; width: 4em; top: 0px; left: 0px; cursor: default; border-top: 1px solid #fff; border-right: 1px solid #000; border-bottom: 1px solid #000; border-left: 1px solid #fff; background: #e4e0d8; font-size: smaller; padding: 1px;}.combo .label { text-align: center; padding: 1px;}.combo .active { background: #c4c0b8; padding: 0px; border-top: 1px solid #000; border-right: 1px solid #fff; border-bottom: 1px solid #fff; border-left: 1px solid #000;}.combo .hilite { background: #048; color: #fea;}");
+document.write(".dpContainer {display: inline;}");
+document.write("</style>")
+/* The main calendar widget. DIV containing a table. */
+
Property changes on: trunk/core/admin_templates/js/calendar.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/js/is.js
===================================================================
--- trunk/core/admin_templates/js/is.js (nonexistent)
+++ trunk/core/admin_templates/js/is.js (revision 6656)
@@ -0,0 +1,210 @@
+// Ultimate client-side JavaScript client sniff. Version 3.03
+// (C) Netscape Communications 1999. Permission granted to reuse and distribute.
+// Revised 17 May 99 to add is.nav5up and is.ie5up (see below).
+// Revised 21 Nov 00 to add is.gecko and is.ie5_5 Also Changed is.nav5 and is.nav5up to is.nav6 and is.nav6up
+// Revised 22 Feb 01 to correct Javascript Detection for IE 5.x, Opera 4,
+// correct Opera 5 detection
+// add support for winME and win2k
+// synch with browser-type-oo.js
+// Revised 26 Mar 01 to correct Opera detection
+// Revised 02 Oct 01 to add IE6 detection
+
+// Everything you always wanted to know about your JavaScript client
+// but were afraid to ask ... "Is" is the constructor function for "is" object,
+// which has properties indicating:
+// (1) browser vendor:
+// is.nav, is.ie, is.opera, is.hotjava, is.webtv, is.TVNavigator, is.AOLTV
+// (2) browser version number:
+// is.major (integer indicating major version number: 2, 3, 4 ...)
+// is.minor (float indicating full version number: 2.02, 3.01, 4.04 ...)
+// (3) browser vendor AND major version number
+// is.nav2, is.nav3, is.nav4, is.nav4up, is.nav6, is.nav6up, is.gecko, is.ie3,
+// is.ie4, is.ie4up, is.ie5, is.ie5up, is.ie5_5, is.ie5_5up, is.ie6, is.ie6up, is.hotjava3, is.hotjava3up
+// (4) JavaScript version number:
+// is.js (float indicating full JavaScript version number: 1, 1.1, 1.2 ...)
+// (5) OS platform and version:
+// is.win, is.win16, is.win32, is.win31, is.win95, is.winnt, is.win98, is.winme, is.win2k
+// is.os2
+// is.mac, is.mac68k, is.macppc
+// is.unix
+// is.sun, is.sun4, is.sun5, is.suni86
+// is.irix, is.irix5, is.irix6
+// is.hpux, is.hpux9, is.hpux10
+// is.aix, is.aix1, is.aix2, is.aix3, is.aix4
+// is.linux, is.sco, is.unixware, is.mpras, is.reliant
+// is.dec, is.sinix, is.freebsd, is.bsd
+// is.vms
+//
+// See http://www.it97.de/JavaScript/JS_tutorial/bstat/navobj.html and
+// http://www.it97.de/JavaScript/JS_tutorial/bstat/Browseraol.html
+// for detailed lists of userAgent strings.
+//
+// Note: you don't want your Nav4 or IE4 code to "turn off" or
+// stop working when Nav5 and IE5 (or later) are released, so
+// in conditional code forks, use is.nav4up ("Nav4 or greater")
+// and is.ie4up ("IE4 or greater") instead of is.nav4 or is.ie4
+// to check version in code which you want to work on future
+// versions.
+
+function Is ()
+{ // convert all characters to lowercase to simplify testing
+ var agt=navigator.userAgent.toLowerCase();
+
+ // *** BROWSER VERSION ***
+ // Note: On IE5, these return 4, so use is.ie5up to detect IE5.
+
+ this.major = parseInt(navigator.appVersion);
+ this.minor = parseFloat(navigator.appVersion);
+
+ // Note: Opera and WebTV spoof Navigator. We do strict client detection.
+ // If you want to allow spoofing, take out the tests for opera and webtv.
+ this.nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
+ && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
+ && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
+ this.nav2 = (this.nav && (this.major == 2));
+ this.nav3 = (this.nav && (this.major == 3));
+ this.nav4 = (this.nav && (this.major == 4));
+ this.nav4up = (this.nav && (this.major >= 4));
+ this.navonly = (this.nav && ((agt.indexOf(";nav") != -1) ||
+ (agt.indexOf("; nav") != -1)) );
+ this.nav6 = (this.nav && (this.major == 5));
+ this.nav6up = (this.nav && (this.major >= 5));
+ this.gecko = (agt.indexOf('gecko') != -1);
+
+ this.ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
+ this.ie3 = (this.ie && (this.major < 4));
+ this.ie4 = (this.ie && (this.major == 4) && (agt.indexOf("msie 4")!=-1) );
+ this.ie4up = (this.ie && (this.major >= 4));
+ this.ie5 = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1) );
+ this.ie5_5 = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.5") !=-1));
+ this.ie5up = (this.ie && !this.ie3 && !this.ie4);
+ this.ie5_5up =(this.ie && !this.ie3 && !this.ie4 && !this.ie5);
+ this.ie6 = (this.ie && (this.major == 4) && (agt.indexOf("msie 6.")!=-1) );
+ this.ie6up = (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5);
+
+ // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
+ // or if this is the first browser window opened. Thus the
+ // variables is.aol, is.aol3, and is.aol4 aren't 100% reliable.
+ this.aol = (agt.indexOf("aol") != -1);
+ this.aol3 = (this.aol && this.ie3);
+ this.aol4 = (this.aol && this.ie4);
+ this.aol5 = (agt.indexOf("aol 5") != -1);
+ this.aol6 = (agt.indexOf("aol 6") != -1);
+
+ this.opera = (agt.indexOf("opera") != -1);
+ this.opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
+ this.opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
+ this.opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
+ this.opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
+ this.opera5up = (this.opera && !this.opera2 && !this.opera3 && !this.opera4);
+
+ this.webtv = (agt.indexOf("webtv") != -1);
+
+ this.TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1));
+ this.AOLTV = this.TVNavigator;
+
+ this.hotjava = (agt.indexOf("hotjava") != -1);
+ this.hotjava3 = (this.hotjava && (this.major == 3));
+ this.hotjava3up = (this.hotjava && (this.major >= 3));
+
+ // *** JAVASCRIPT VERSION CHECK ***
+ if (this.nav2 || this.ie3) this.js = 1.0;
+ else if (this.nav3) this.js = 1.1;
+ else if (this.opera5up) this.js = 1.3;
+ else if (this.opera) this.js = 1.1;
+ else if ((this.nav4 && (this.minor <= 4.05)) || this.ie4) this.js = 1.2;
+ else if ((this.nav4 && (this.minor > 4.05)) || this.ie5) this.js = 1.3;
+ else if (this.hotjava3up) this.js = 1.4;
+ else if (this.nav6 || this.gecko) this.js = 1.5;
+ // NOTE: In the future, update this code when newer versions of JS
+ // are released. For now, we try to provide some upward compatibility
+ // so that future versions of Nav and IE will show they are at
+ // *least* JS 1.x capable. Always check for JS version compatibility
+ // with > or >=.
+ else if (this.nav6up) this.js = 1.5;
+ // note ie5up on mac is 1.4
+ else if (this.ie5up) this.js = 1.3
+
+ // HACK: no idea for other browsers; always check for JS version with > or >=
+ else this.js = 0.0;
+
+ // *** PLATFORM ***
+ this.win = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
+ // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
+ // Win32, so you can't distinguish between Win95 and WinNT.
+ this.win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
+
+ // is this a 16 bit compiled version?
+ this.win16 = ((agt.indexOf("win16")!=-1) ||
+ (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) ||
+ (agt.indexOf("windows 16-bit")!=-1) );
+
+ this.win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
+ (agt.indexOf("windows 16-bit")!=-1));
+
+ // NOTE: Reliable detection of Win98 may not be possible. It appears that:
+ // - On Nav 4.x and before you'll get plain "Windows" in userAgent.
+ // - On Mercury client, the 32-bit version will return "Win98", but
+ // the 16-bit version running on Win98 will still return "Win95".
+ this.win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
+ this.winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
+ this.win32 = (this.win95 || this.winnt || this.win98 ||
+ ((this.major >= 4) && (navigator.platform == "Win32")) ||
+ (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));
+
+ this.winme = ((agt.indexOf("win 9x 4.90")!=-1));
+ this.win2k = ((agt.indexOf("windows nt 5.0")!=-1));
+
+ this.os2 = ((agt.indexOf("os/2")!=-1) ||
+ (navigator.appVersion.indexOf("OS/2")!=-1) ||
+ (agt.indexOf("ibm-webexplorer")!=-1));
+
+ this.mac = (agt.indexOf("mac")!=-1);
+ // hack ie5 js version for mac
+ if (this.mac && this.ie5up) this.js = 1.4;
+ this.mac68k = (this.mac && ((agt.indexOf("68k")!=-1) ||
+ (agt.indexOf("68000")!=-1)));
+ this.macppc = (this.mac && ((agt.indexOf("ppc")!=-1) ||
+ (agt.indexOf("powerpc")!=-1)));
+
+ this.sun = (agt.indexOf("sunos")!=-1);
+ this.sun4 = (agt.indexOf("sunos 4")!=-1);
+ this.sun5 = (agt.indexOf("sunos 5")!=-1);
+ this.suni86= (this.sun && (agt.indexOf("i86")!=-1));
+ this.irix = (agt.indexOf("irix") !=-1); // SGI
+ this.irix5 = (agt.indexOf("irix 5") !=-1);
+ this.irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
+ this.hpux = (agt.indexOf("hp-ux")!=-1);
+ this.hpux9 = (this.hpux && (agt.indexOf("09.")!=-1));
+ this.hpux10= (this.hpux && (agt.indexOf("10.")!=-1));
+ this.aix = (agt.indexOf("aix") !=-1); // IBM
+ this.aix1 = (agt.indexOf("aix 1") !=-1);
+ this.aix2 = (agt.indexOf("aix 2") !=-1);
+ this.aix3 = (agt.indexOf("aix 3") !=-1);
+ this.aix4 = (agt.indexOf("aix 4") !=-1);
+ this.linux = (agt.indexOf("inux")!=-1);
+ this.sco = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
+ this.unixware = (agt.indexOf("unix_system_v")!=-1);
+ this.mpras = (agt.indexOf("ncr")!=-1);
+ this.reliant = (agt.indexOf("reliantunix")!=-1);
+ this.dec = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) ||
+ (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) ||
+ (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1));
+ this.sinix = (agt.indexOf("sinix")!=-1);
+ this.freebsd = (agt.indexOf("freebsd")!=-1);
+ this.bsd = (agt.indexOf("bsd")!=-1);
+ this.unix = ((agt.indexOf("x11")!=-1) || this.sun || this.irix || this.hpux ||
+ this.sco ||this.unixware || this.mpras || this.reliant ||
+ this.dec || this.sinix || this.aix || this.linux || this.bsd || this.freebsd);
+
+ this.vms = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
+}
+
+var is;
+var isIE3Mac = false;
+// this section is designed specifically for IE3 for the Mac
+
+if ((navigator.appVersion.indexOf("Mac")!=-1) && (navigator.userAgent.indexOf("MSIE")!=-1) &&
+(parseInt(navigator.appVersion)==3))
+ isIE3Mac = true;
+else is = new Is();
Property changes on: trunk/core/admin_templates/js/is.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/js/tree.js
===================================================================
--- trunk/core/admin_templates/js/tree.js (nonexistent)
+++ trunk/core/admin_templates/js/tree.js (revision 6656)
@@ -0,0 +1,388 @@
+function TreeItem(title, url, icon, onclick)
+{
+ this.Title = title;
+ this.Url = url;
+ this.Rendered = false;
+ this.Displayed = false;
+ this.Level = 0;
+ this.Icon = icon;
+ this.Onclick = onclick;
+}
+
+TreeItem.prototype.Render = function(before)
+{
+ if (!this.Rendered) {
+ if (!isset(before)) {before = null}
+
+ tr = document.createElement('tr');
+ this.ParentElement.insertBefore(tr, before);
+ if (!this.Displayed) { tr.style.display = 'none' }
+ td = document.createElement('td');
+ td.TreeElement = this;
+ tr.appendChild(td);
+
+ this.appendLevel(td);
+ if (this.ParentFolder != null) this.appendNodeImage(td);
+ this.appendIcon(td);
+ this.appendLink(td);
+
+ this.Tr = tr;
+ this.Rendered = true;
+// alert(this.Tr.innerHTML)
+ }
+}
+
+TreeItem.prototype.appendLevel = function(td)
+{
+ for (var i=0; i < this.Level; i++)
+ {
+ img = document.createElement('img');
+ img.src = TREE_ICONS_PATH+'/ftv2blank.gif';
+ img.style.verticalAlign = 'middle';
+ td.appendChild(img);
+ }
+}
+
+TreeItem.prototype.getNodeImage = function(is_last)
+{
+ return is_last ? TREE_ICONS_PATH+'/ftv2lastnode.gif' : TREE_ICONS_PATH+'/ftv2node.gif';
+}
+
+TreeItem.prototype.appendNodeImage = function(td)
+{
+ img = document.createElement('img');
+ img.src = this.getNodeImage();
+ img.style.verticalAlign = 'middle';
+ td.appendChild(img);
+}
+
+TreeItem.prototype.appendIcon = function (td)
+{
+ img = document.createElement('img');
+ if (this.Icon.indexOf('http://') != -1) {
+ img.src = this.Icon;
+ }
+ else {
+ img.src = this.Icon;
+ }
+ img.style.verticalAlign = 'middle';
+ td.appendChild(img);
+}
+
+TreeItem.prototype.appendLink = function (td)
+{
+ var $node_text = document.createElement('span');
+ $node_text.innerHTML = this.Title;
+
+ link = document.createElement('a');
+ link.nodeValue = this.Title;
+ link.href = this.Url;
+ link.target = 'main';
+ link.appendChild($node_text);
+
+ link.treeItem = this;
+ //addEvent(link, 'click',
+
+ link.onclick =
+ function(ev) {
+ var e = is.ie ? window.event : ev;
+
+ res = true;
+ if (isset(this.treeItem.Onclick)) {
+ res = eval(this.treeItem.Onclick);
+ }
+ if (!res) { // if we need to cancel onclick action
+ if (is.ie) {
+ window.event.cancelBubble = true;
+ window.event.returnValue = false;
+ } else {
+ ev.preventDefault();
+ ev.stopPropagation();
+ }
+ return res;
+ }
+ else {
+ // ensures, that click is made before AJAX request will be sent
+ if (res === true) {
+ // only in case of "true" is returned, used in catalog
+ window.parent.getFrame(link.target).location.href = this.href;
+ }
+
+ if (!this.treeItem.Expanded && typeof(this.treeItem.folderClick) == 'function') {
+ if (this.treeItem.folderClick());
+ }
+ return false;
+ }
+ }
+
+ td.appendChild(link);
+}
+
+TreeItem.prototype.display = function()
+{
+ this.Tr.style.display = is.ie ? 'block' : 'table-row';
+ this.Displayed = true;
+}
+
+TreeItem.prototype.hide = function()
+{
+ this.Tr.style.display = 'none';
+ this.Displayed = false;
+}
+
+TreeItem.prototype.expand = function() { this.display() }
+
+TreeItem.prototype.collapse = function() { this.hide() }
+
+TreeItem.prototype.updateLastNodes = function(is_last, lines_pattern)
+{
+ if (!isset(is_last)) is_last = true;
+ if (!isset(this.Tr)) return;
+ if (!isset(lines_pattern)) { var lines_pattern = new Array() }
+
+ imgs = this.Tr.getElementsByTagName('img');
+ found = false;
+ for (var i=0; i<imgs.length; i++)
+ {
+ the_img = imgs.item(i);
+ if (in_array(i, lines_pattern) && the_img.src.indexOf('ftv2blank.gif') != -1) {
+ the_img.src = TREE_ICONS_PATH+'/ftv2vertline.gif';
+ }
+ if (this.isNodeImage(the_img))
+ {
+ found = true;
+ break;
+ }
+ }
+ if (found) {
+ the_img.src = this.getNodeImage(is_last);
+ }
+ this.isLast = is_last;
+ return lines_pattern;
+}
+
+TreeItem.prototype.isNodeImage = function(img)
+{
+ return (
+ img.src.indexOf('ftv2node.gif') != -1 ||
+ img.src.indexOf('ftv2lastnode.gif') != -1
+ )
+
+}
+
+TreeItem.prototype.locateLastItem = function()
+{
+ return this;
+}
+/* FOLDER */
+
+function TreeFolder(parent_id, title, url, icon, late_load_url, onclick)
+{
+ var render = false;
+ if (isset(parent_id)) {
+ this.ParentElement = document.getElementById(parent_id);
+ render = true;
+ }
+
+ this.Title = title;
+ this.Url = url;
+ this.Rendered = false;
+ this.Displayed = false;
+ this.Expanded = false;
+ this.Level = 0;
+ this.Tr = null;
+ this.Icon = icon;
+ this.LateLoadURL = isset(late_load_url) ? late_load_url : false;
+ this.Loaded = false;
+ this.Onclick = onclick;
+
+ this.Children = new Array();
+ this.ChildIndex = 0;
+ if (render) {
+ this.Expanded = true;
+ this.Displayed = true;
+ this.Render();
+ this.expand();
+ }
+}
+
+TreeFolder.prototype = new TreeItem;
+
+TreeFolder.prototype.locateLastItem = function()
+{
+ if (this.Children.length == 0) return this;
+
+ for (var i=0; i<this.Children.length; i++)
+ {
+ last_item = this.Children[i].locateLastItem()
+ }
+ return last_item;
+}
+
+TreeFolder.prototype.locateTopItem = function()
+{
+ if (this.ParentFolder == null) return this;
+ return this.ParentFolder.locateTopItem();
+}
+
+TreeFolder.prototype.AddItem = function(an_item, render, display) {
+ an_item.ParentElement = this.ParentElement;
+ an_item.Level = this.ParentFolder != null ? this.Level + 1 : 0;
+ an_item.ParentFolder = this;
+
+ last_item = this.locateLastItem();
+ this.Children.push(an_item);
+ an_item.Render(last_item.Tr.nextSibling);
+ if (this.Expanded)
+ {
+ an_item.display();
+ }
+ return an_item;
+}
+
+TreeFolder.prototype.AddFromXML = function(xml, render)
+{
+// start = new Date();
+ if (!isset(render)) render = true;
+ doc = getDocumentFromXML(xml);
+ this.LastFolder = this;
+ this.ProcessXMLNode(doc, render);
+// end = new Date();
+ this.locateTopItem().updateLastNodes();
+// alert('AddFromXML took: '+(end - start))
+}
+
+TreeFolder.prototype.ProcessXMLNode = function(node, render)
+{
+ if (!isset(render)) render = true;
+ if (!isset(this.LastFolder)) this.LastFolder = this;
+ for (var i=0; i<node.childNodes.length; i++)
+ {
+ child = node.childNodes.item(i);
+ if (child.tagName == 'folder') {
+ var backupLastFolder = this.LastFolder;
+ this.LastFolder = this.LastFolder.AddItem(new TreeFolder(null, child.getAttribute('name'), child.getAttribute('href'), child.getAttribute('icon'), child.getAttribute('load_url'), child.getAttribute('onclick')), render);
+ if (child.hasChildNodes) {
+ this.ProcessXMLNode(child);
+ }
+ this.LastFolder = backupLastFolder;
+ }
+ else if (child.tagName == 'item') {
+ this.LastFolder.AddItem(new TreeItem(child.firstChild.nodeValue, child.getAttribute('href'), child.getAttribute('icon'), child.getAttribute('onclick')), render)
+ }
+ else if (child.tagName == 'tree') {
+ this.LastFolder = this;
+ this.ProcessXMLNode(child);
+ }
+ }
+}
+
+TreeFolder.prototype.getNodeImage = function(is_last)
+{
+ if (is_last) {
+ return this.Expanded ? TREE_ICONS_PATH+'/ftv2mlastnode.gif' : TREE_ICONS_PATH+'/ftv2plastnode.gif';
+ }
+ else {
+ return this.Expanded ? TREE_ICONS_PATH+'/ftv2mnode.gif' : TREE_ICONS_PATH+'/ftv2pnode.gif';
+ }
+}
+
+TreeFolder.prototype.appendNodeImage = function(td, is_last)
+{
+ img = document.createElement('img');
+ img.src = this.getNodeImage(is_last);
+ img.style.cursor = 'hand';
+ img.style.cursor = 'pointer';
+ img.style.verticalAlign = 'middle';
+ img.onclick = function() { this.parentNode.TreeElement.folderClick(this) }
+ this.Img = img;
+ td.appendChild(img);
+}
+
+TreeFolder.prototype.updateLastNodes = function(is_last, lines_pattern)
+{
+ if (!isset(is_last)) is_last = true;
+ if (!isset(lines_pattern)) { var lines_pattern = new Array() }
+ if (!is_last && !in_array(this.Level, lines_pattern)) { lines_pattern.push(this.Level) }
+
+ lines_pattern = TreeItem.prototype.updateLastNodes.apply(this, new Array(is_last, lines_pattern))
+
+ for (var i=0; i<this.Children.length; i++)
+ {
+ lines_pattern = this.Children[i].updateLastNodes((i+1) == this.Children.length, lines_pattern)
+ }
+ lines_pattern[array_search(this.Level, lines_pattern)] = -1;
+ return lines_pattern;
+}
+
+TreeFolder.prototype.isNodeImage = function(img)
+{
+ return (
+ img.src.indexOf('ftv2mlastnode.gif') != -1 ||
+ img.src.indexOf('ftv2plastnode.gif') != -1 ||
+ img.src.indexOf('ftv2mnode.gif') != -1 ||
+ img.src.indexOf('ftv2pnode.gif') != -1
+ )
+
+}
+
+TreeFolder.prototype.folderClick = function(img)
+{
+ if (this.LateLoadURL && !this.Loaded) {
+ Request.headers['Content-type'] = 'text/xml';
+ Request.makeRequest(this.LateLoadURL, false, '', this.successCallback, this.errorCallback, '', this);
+ }
+
+ if (this.Expanded) {
+ this.collapse();
+ }
+ else {
+ this.expand();
+ }
+}
+
+TreeFolder.prototype.successCallback = function ($request, $params, $object) {
+ $object.ProcessXMLNode($request.responseXML);
+ $object.Loaded = true;
+ $object.Render();
+ $object.locateTopItem().updateLastNodes();
+ $object.expand();
+}
+
+TreeFolder.prototype.errorCallback = function($request, $params, $object) {
+ alert('AJAX ERROR: ' + Request.getErrorHtml($request));
+}
+
+TreeFolder.prototype.expand = function(mode)
+{
+ if (!isset(mode)) mode = 0;
+ this.display();
+ if (mode == 0 || this.Expanded ) {
+ for (var i=0; i<this.Children.length; i++)
+ {
+ this.Children[i].expand(mode+1);
+ }
+ }
+ if (mode == 0) {
+ this.Expanded = true;
+ if (isset(this.Img)) {
+ this.Img.src = this.getNodeImage(this.isLast);
+ }
+ }
+}
+
+TreeFolder.prototype.collapse = function(mode)
+{
+ if (!isset(mode)) mode = 0;
+ for (var i=0; i<this.Children.length; i++)
+ {
+ this.Children[i].collapse(mode+1);
+ this.Children[i].hide();
+ }
+ if (mode == 0) {
+ this.Expanded = false;
+ if (isset(this.Img)) {
+ this.Img.src = this.getNodeImage(this.isLast);
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/core/admin_templates/js/tree.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/js/toolbar.js
===================================================================
--- trunk/core/admin_templates/js/toolbar.js (nonexistent)
+++ trunk/core/admin_templates/js/toolbar.js (revision 6656)
@@ -0,0 +1,231 @@
+function ToolBarButton(title, alt, onclick, $hidden, prefix)
+{
+ this.Title = title || '';
+ this.CheckTitleModule();
+ this.Alt = RemoveTranslationLink(alt || '');
+
+ if (typeof(onclick) == 'function') {
+ this.onClick = onclick;
+ }
+ else {
+ this.onClick = function() {
+ if (eval('typeof('+this.Title+')') == 'function')
+ eval(this.Title + '()');
+ }
+
+ }
+
+ this.imgObject = null;
+ this.Enabled = true;
+ this.Hidden = $hidden ? true : false;
+ this.ToolBar = null;
+ this.Prefix = prefix ? prefix : '';
+}
+
+ToolBarButton.prototype.CheckTitleModule = function()
+{
+ if (this.Title.match(/([^:]+):(.*)$/)) {
+ // has module set directly
+ this.Title = RegExp.$2;
+ this.Module = RegExp.$1;
+ }
+ else {
+ // use default module
+ this.Module = 'kernel';
+ }
+}
+
+ToolBarButton.prototype.IconsPath = function()
+{
+ if (typeof(img_path) == 'undefined') {
+ //alert('error: toolbar image path not set');
+ }
+ return img_path.replace('#MODULE#', this.Module) + 'toolbar/';
+}
+
+ToolBarButton.prototype.GetHTML = function() {
+ return '<img id="' + this.GetToolID() + '" src="' + this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '.gif" title="' + this.Alt + '">';
+}
+
+ToolBarButton.prototype.GetToolID = function() {
+ return this.Prefix == '' ? 'tool_' + this.Title : 'tool_['+this.Prefix+'][' + this.Title+']'
+}
+
+ToolBarButton.prototype.Init = function() {
+
+ img = document.getElementById(this.GetToolID());
+ this.imgObject = img;
+ img.btn = this;
+ this.SetOnMouseOver();
+ this.SetOnMouseOut();
+ this.SetOnClick();
+ if (this.Hidden) this.Hide();
+}
+
+ToolBarButton.prototype.SetOnMouseOver = function() {
+ this.imgObject.onmouseover = function() {
+ this.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '_f2.gif';
+ };
+}
+
+ToolBarButton.prototype.SetOnMouseOut = function() {
+ this.imgObject.onmouseout = function() {
+ this.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '.gif';
+ };
+}
+
+ToolBarButton.prototype.SetOnClick = function() {
+ this.imgObject.onmouseout = function() {
+ this.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '.gif';
+ };
+ this.imgObject.inClick = false;
+ if (typeof(this.onClick) != 'function') {
+ this.imgObject.onclick = function() {
+ if (this.inClick) return;
+ this.inClick = true;
+ if (eval('typeof('+this.btn.Title+')') == 'function')
+ eval(this.btn.Title + '()');
+ this.inClick = false;
+ }
+ }
+ else {
+ this.imgObject.onclick = function() {
+ if (this.inClick) return;
+ this.inClick = true;
+ this.btn.onClick();
+ this.inClick = false;
+ }
+ }
+
+ // the following lines are correct, as long as mozilla understands 'pointer', but IE 'hand',
+ // do not change the order of these lines!
+ if (is.ie6up || is.gecko) {
+ this.imgObject.style.cursor = 'pointer';
+ }
+ else {
+ // somehow set cursor hand for IE 5/ 5.5
+// this.imgObject.style = 'cursor: hand';
+ }
+}
+
+ToolBarButton.prototype.Disable = function() {
+ if ( !this.Enabled ) return;
+ this.imgObject.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '_f3.gif';
+ this.imgObject.onmouseover = null;
+ this.imgObject.onmouseout = null;
+ this.imgObject.onclick = null;
+ this.imgObject.style.cursor = 'default';
+ this.Enabled = false;
+}
+
+ToolBarButton.prototype.Enable = function() {
+ if (this.Enabled) return;
+ this.imgObject.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '.gif';
+ this.SetOnMouseOver();
+ this.SetOnMouseOut();
+ this.SetOnClick();
+ this.Enabled = true;
+}
+
+ToolBarButton.prototype.Hide = function() {
+ this.imgObject.style.display = 'none';
+ this.Hidden = true;
+}
+
+ToolBarButton.prototype.Show = function() {
+ this.imgObject.style.display = '';
+ this.Hidden = false;
+}
+
+/* ----------- */
+
+function ToolBarSeparator(title) //extends ToolBarButton
+{
+ this.Title = title;
+}
+ToolBarSeparator.prototype = new ToolBarButton;
+
+ToolBarSeparator.prototype.GetHTML = function() {
+ return '<img id="' + this.GetToolID() + '" src="' + this.IconsPath() + 'tool_divider.gif">';
+}
+
+ToolBarSeparator.prototype.Init = function() {
+ img = document.getElementById(this.ToolBar.IconPrefix + this.Title);
+ this.imgObject = img;
+ img.btn = this;
+}
+
+ToolBarSeparator.prototype.Enable = function() { }
+ToolBarSeparator.prototype.Disable = function() { }
+
+/* ----------- */
+
+
+function ToolBar(icon_prefix, $module)
+{
+ this.Module = $module ? $module : 'kernel';
+ this.IconPrefix = icon_prefix ? icon_prefix : 'tool_';
+ this.Buttons = new Array();
+}
+
+ToolBar.prototype.AddButton = function(a_button)
+{
+ a_button.ToolBar = this;
+ this.Buttons[a_button.Title] = a_button;
+}
+
+ToolBar.prototype.Render = function($container)
+{
+ if ($container) {
+ $container.innerHTML = ''; // container will contain only buttons
+ for (var i in this.Buttons) {
+ btn = this.Buttons[i];
+ $container.innerHTML += btn.GetHTML();
+ }
+
+ // init all buttons after because objects are not yet created directly after assigning to innerHTML
+ for (var i in this.Buttons) {
+ btn = this.Buttons[i];
+ btn.Init();
+ }
+ }
+ else {
+ for (var i in this.Buttons) {
+ btn = this.Buttons[i];
+ document.write( btn.GetHTML() );
+ btn.Init();
+ }
+ }
+}
+
+ToolBar.prototype.EnableButton = function(button_id) {
+ if(this.ButtonExists(button_id)) this.Buttons[button_id].Enable();
+}
+
+ToolBar.prototype.DisableButton = function(button_id) {
+ if(this.ButtonExists(button_id)) this.Buttons[button_id].Disable();
+}
+
+ToolBar.prototype.HideButton = function(button_id) {
+ if(this.ButtonExists(button_id)) this.Buttons[button_id].Hide();
+}
+
+ToolBar.prototype.ShowButton = function(button_id) {
+ if(this.ButtonExists(button_id)) this.Buttons[button_id].Show();
+}
+
+ToolBar.prototype.SetEnabled = function(button_id, $enabled) {
+ var $ret = $enabled ? this.EnableButton(button_id) : this.DisableButton(button_id);
+}
+
+ToolBar.prototype.SetVisible = function(button_id, $visible) {
+ var $ret = $visible ? this.ShowButton(button_id) : this.HideButton(button_id);
+}
+
+ToolBar.prototype.GetButtonImage = function(button_id) {
+ if( this.ButtonExists(button_id) ) return this.Buttons[button_id].imgObject;
+}
+
+ToolBar.prototype.ButtonExists = function(button_id) {
+ return typeof(this.Buttons[button_id]) == 'object';
+}
Property changes on: trunk/core/admin_templates/js/toolbar.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/js/ajax.js
===================================================================
--- trunk/core/admin_templates/js/ajax.js (nonexistent)
+++ trunk/core/admin_templates/js/ajax.js (revision 6656)
@@ -0,0 +1,257 @@
+// Main AJAX classs
+function Request() {}
+
+Request.timeout = 5000; //5 seconds
+Request.method = 'GET';
+Request.headers = new Array();
+Request.params = null;
+
+Request.makeRequest = function(p_url, p_busyReq, p_progId, p_successCallBack, p_errorCallBack, p_pass, p_object) {
+ //p_url: the web service url
+ //p_busyReq: is a request for this object currently in progress?
+ //p_progId: element id where progress HTML should be shown
+ //p_successCallBack: callback function for successful response
+ //p_errorCallBack: callback function for erroneous response
+ //p_pass: string of params to pass to callback functions
+ //p_object: object of params to pass to callback functions
+
+ if (p_busyReq) return;
+ var req = Request.getRequest();
+ if (req != null) {
+ p_busyReq = true;
+ Request.showProgress(p_progId);
+ req.onreadystatechange = function() {
+ if (req.readyState == 4) {
+ p_busyReq = false;
+ window.clearTimeout(toId);
+ if (req.status == 200) {
+ p_successCallBack(req, p_pass, p_object);
+ } else {
+ p_errorCallBack(req, p_pass, p_object);
+ }
+ Request.hideProgress(p_progId);
+ }
+ }
+ var $ajax_mark = (p_url.indexOf('?') ? '&' : '?') + 'ajax=yes';
+ req.open(Request.method, p_url + $ajax_mark, true);
+
+ if (Request.method == 'POST') {
+ Request.headers['Content-type'] = 'application/x-www-form-urlencoded';
+ Request.headers['referer'] = p_url;
+ }
+ else {
+ Request.headers['If-Modified-Since'] = 'Sat, 1 Jan 2000 00:00:00 GMT';
+ }
+
+ Request.sendHeaders(req);
+ if (Request.method == 'POST') {
+ req.send(Request.params);
+ Request.method = 'GET'; // restore method back to GET
+ }
+ else {
+ req.send(null);
+ }
+
+ var toId = window.setTimeout( function() {if (p_busyReq) req.abort();}, Request.timeout );
+ }
+}
+
+Request.sendHeaders = function($request) {
+ for (var $header_name in Request.headers) {
+ $request.setRequestHeader($header_name, Request.headers[$header_name]);
+ }
+ Request.headers = new Array(); // reset header afterwards
+}
+
+Request.getRequest = function() {
+ var xmlHttp;
+ try { xmlHttp = new ActiveXObject('MSXML2.XMLHTTP'); return xmlHttp; } catch (e) {}
+ try { xmlHttp = new ActiveXObject('Microsoft.XMLHTTP'); return xmlHttp; } catch (e) {}
+ try { xmlHttp = new XMLHttpRequest(); return xmlHttp; } catch(e) {}
+ return null;
+}
+
+Request.showProgress = function(p_id) {
+ if (p_id != '') {
+ Request.setOpacity(20, p_id);
+
+ if (!document.getElementById(p_id + '_progress')) {
+ document.body.appendChild(Request.getProgressObject(p_id));
+ }
+ else {
+ var $progress_div = document.getElementById(p_id + '_progress');
+ $progress_div.style.top = getRealTop(p_id) + 'px';
+ $progress_div.style.height = document.getElementById(p_id).clientHeight;
+ $progress_div.style.display = 'block';
+ }
+// document.getElementById(p_id).innerHTML = Request.getProgressHtml();
+ }
+}
+
+Request.hideProgress = function(p_id) {
+ if (p_id != '') {
+ document.getElementById(p_id + '_progress').style.display = 'none';
+ Request.setOpacity(100, p_id);
+ }
+}
+
+Request.setOpacity = function (opacity, id) {
+ var object = document.getElementById(id).style;
+ object.opacity = (opacity / 100);
+ object.MozOpacity = (opacity / 100);
+ object.KhtmlOpacity = (opacity / 100);
+ object.filter = "alpha(opacity=" + opacity + ")";
+}
+
+Request.getProgressHtml = function() {
+ return "<p class='progress'>" + Request.progressText + "<br /><img src='img/ajax_progress.gif' align='absmiddle' width='100' height='7' alt='" + Request.progressText + "'/></p>";
+}
+
+Request.getProgressObject = function($id) {
+ var $div = document.createElement('DIV');
+ var $parent_div = document.getElementById($id);
+
+ $div.id = $id + '_progress';
+
+ $div.style.width = $parent_div.clientWidth + 'px';
+ $div.style.height = '150px'; // default height if div is empty (first ajax request for div)
+ $div.style.left = getRealLeft($parent_div) + 'px';
+ $div.style.top = getRealTop($parent_div) + 'px';
+ $div.style.position = 'absolute';
+
+ /*$div.style.border = '1px solid green';
+ $div.style.backgroundColor = '#FF0000';*/
+
+ $div.innerHTML = '<table style="width: 100%; height: 100%;"><tr><td style="text-align: center;">'+Request.progressText+'<br /><img src="img/ajax_progress.gif" align="absmiddle" width="100" height="7" alt="'+escape(Request.progressText)+'" /></td></tr></table>';
+ return $div;
+}
+
+Request.getErrorHtml = function(p_req) {
+ //TODO: implement accepted way to handle request error
+ return '[status: ' + p_req.status + '; status_text: ' + p_req.statusText + '; responce_text: ' + p_req.responseText + ']';
+}
+
+Request.serializeForm = function(theform) {
+ if (typeof(theform) == 'string') {
+ theform = document.getElementById(theform);
+ }
+
+ var els = theform.elements;
+ var len = els.length;
+ var queryString = '';
+
+ Request.addField = function(name, value) {
+ if (queryString.length > 0) queryString += '&';
+ queryString += encodeURIComponent(name) + '=' + encodeURIComponent(value);
+ };
+
+ for (var i = 0; i<len; i++) {
+ var el = els[i];
+ if (el.disabled) continue;
+
+ switch(el.type) {
+ case 'text':
+ case 'password':
+ case 'hidden':
+ case 'textarea':
+ Request.addField(el.name, el.value);
+ break;
+
+ case 'select-one':
+ if (el.selectedIndex >= 0) {
+ Request.addField(el.name, el.options[el.selectedIndex].value);
+ }
+ break;
+
+ case 'select-multiple':
+ for (var j = 0; j < el.options.length; j++) {
+ if (!el.options[j].selected) continue;
+ Request.addField(el.name, el.options[j].value);
+ }
+ break;
+
+ case 'checkbox':
+ case 'radio':
+ if (!el.checked) continue;
+ Request.addField(el.name,el.value);
+ break;
+ }
+ }
+ return queryString;
+};
+
+// AJAX ProgressBar classs
+function AjaxProgressBar($url) {
+ this.WindowTitle = this.GetWindow().document.title;
+ this.URL = $url;
+ this.BusyRequest = false;
+ this.LastResponceTime = this.GetMicroTime();
+ this.ProgressPercent = 0; // progress percent
+ this.ProgressTime = new Array();
+ this.Query();
+}
+
+AjaxProgressBar.prototype.GetWindow = function() {
+ return window.parent ? window.parent : window;
+}
+
+AjaxProgressBar.prototype.GetMicroTime = function() {
+ var $now = new Date();
+ return Math.round($now.getTime() / 1000); // because miliseconds are returned too
+}
+
+AjaxProgressBar.prototype.Query = function() {
+ Request.makeRequest(this.URL, this.BusyRequest, '', this.successCallback, this.errorCallback, '', this);
+}
+
+// return time needed for progress to finish
+AjaxProgressBar.prototype.GetEstimatedTime = function() {
+ return Math.ceil((100 - this.ProgressPercent) * Math.sum(this.ProgressTime) / this.ProgressPercent);
+}
+
+AjaxProgressBar.prototype.successCallback = function($request, $params, $object) {
+ var $responce = $request.responseText;
+ var $match_redirect = new RegExp('^#redirect#(.*)').exec($responce);
+ if ($match_redirect != null) {
+ $object.showProgress(100);
+ // redirect to external template requested
+ window.location.href = $match_redirect[1];
+ return false;
+ }
+
+ if ($object.showProgress($responce)) {
+ $object.Query();
+ }
+}
+
+AjaxProgressBar.prototype.errorCallback = function($request, $params, $object) {
+ alert('AJAX Error; class: AjaxProgressBar; ' + Request.getErrorHtml($request));
+}
+
+AjaxProgressBar.prototype.FormatTime = function ($seconds) {
+ $seconds = parseInt($seconds);
+
+ var $minutes = Math.floor($seconds / 60);
+ if ($minutes < 10) $minutes = '0' + $minutes;
+ $seconds = $seconds % 60;
+ if ($seconds < 10) $seconds = '0' + $seconds;
+
+ return $minutes + ':' + $seconds;
+}
+
+AjaxProgressBar.prototype.showProgress = function ($percent) {
+ this.ProgressPercent = $percent;
+ var $now = this.GetMicroTime();
+ this.ProgressTime[this.ProgressTime.length] = $now - this.LastResponceTime;
+ this.LastResponceTime = $now;
+
+ var $display_progress = parseInt(this.ProgressPercent);
+ this.GetWindow().document.title = $display_progress + '% - ' + this.WindowTitle;
+ document.getElementById('progress_display[percents_completed]').innerHTML = $display_progress + '%';
+ document.getElementById('progress_display[elapsed_time]').innerHTML = this.FormatTime( Math.sum(this.ProgressTime) );
+ document.getElementById('progress_display[Estimated_time]').innerHTML = this.FormatTime( this.GetEstimatedTime() );
+
+ document.getElementById('progress_bar[done]').style.width = $display_progress + '%';
+ document.getElementById('progress_bar[left]').style.width = (100 - $display_progress) + '%';
+ return $percent < 100 ? true : false;
+}
\ No newline at end of file
Property changes on: trunk/core/admin_templates/js/ajax.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Event Timeline
Log In to Comment