Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sat, Feb 22, 12:06 AM

in-portal

Index: branches/5.3.x/LICENSE
===================================================================
--- branches/5.3.x/LICENSE (revision 15906)
+++ branches/5.3.x/LICENSE (revision 15907)
Property changes on: branches/5.3.x/LICENSE
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
Merged /in-portal/branches/5.2.x/LICENSE:r15902-15906
Index: branches/5.3.x/robots.txt
===================================================================
--- branches/5.3.x/robots.txt (revision 15906)
+++ branches/5.3.x/robots.txt (revision 15907)
Property changes on: branches/5.3.x/robots.txt
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
Merged /in-portal/branches/5.2.x/robots.txt:r15902-15906
Index: branches/5.3.x/core/kernel/processors/main_processor.php
===================================================================
--- branches/5.3.x/core/kernel/processors/main_processor.php (revision 15906)
+++ branches/5.3.x/core/kernel/processors/main_processor.php (revision 15907)
@@ -1,1285 +1,1286 @@
<?php
/**
* @version $Id$
* @package In-Portal
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
class kMainTagProcessor extends kTagProcessor {
public function __construct()
{
parent::__construct();
$actions = $this->Application->recallObject('kActions');
/* @var $actions Params */
$actions->Set('t', $this->Application->GetVar('t'));
$actions->Set('sid', $this->Application->GetSID());
$actions->Set('m_opener', $this->Application->GetVar('m_opener') );
}
/**
* Base folder for all template includes
*
* @param Array $params
* @return string
*/
function TemplatesBase($params)
{
static $cached = Array ();
$cache_key = crc32( serialize($params) );
if (!array_key_exists($cache_key, $cached)) {
$module = array_key_exists('module', $params) ? $params['module'] : 'core';
if ($this->Application->isAdmin) {
if ($module == 'in-portal') {
$module = 'kernel';
}
// remove leading slash + substitute module
$module_path = $this->Application->findModule('Name', $module, 'Path');
if ($module_path !== false) {
$path = $module_path . 'admin_templates';
}
else {
// remove leading slash + substitute module
$path = preg_replace('/\/(.*?)\/(.*)/', $module . '/\\2', THEMES_PATH);
}
}
else {
$path = mb_substr(THEMES_PATH, 1);
if (mb_strtolower($module) == 'in-portal') {
$module_folder = 'platform';
}
else {
$module_folder = $this->Application->findModule('Name', $module, 'TemplatePath');
}
$path .= rtrim('/' . trim($module_folder, '/'), '/') . '/';
}
$cached[$cache_key] = $this->Application->BaseURL() . $path;
}
return $cached[$cache_key];
}
/**
* Creates <base href ..> HTML tag for all templates
* affects future css, js files and href params of links
*
* @param Array $params
* @return string
* @access protected
* @see kMainTagProcessor::TemplatesBase
*/
protected function Base_Ref($params)
{
// tag TemplatesBase adds trailing "/" but only on Front-End
$base_href = rtrim($this->TemplatesBase($params), '/');
return '<base href="' . $base_href . '/" />';
}
/**
* Returns base url for web-site
*
* @return string
* @access public
*/
function BaseURL()
{
return $this->Application->BaseURL();
}
//for compatability with K3 tags
function Base($params)
{
return $this->TemplatesBase($params).'/';
}
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
$template = $this->SelectParam($params, 't,template');
$prefix = array_key_exists('prefix', $params) ? $params['prefix'] : '';
unset($params['t'], $params['template'], $params['prefix']);
return $this->Application->HREF($template, $prefix, $params);
}
function Link($params)
{
// pass "m" prefix, instead of "all", that is by default on Front-End
if (!array_key_exists('pass', $params)) {
$params['pass'] = 'm';
}
return $this->T($params);
}
/**
* Performs redirect to provided template/url
*
* @param Array $params
* @return string
*/
function Redirect($params)
{
$this->Application->Redirect('external:' . $this->Link($params));
return '';
}
/*function Env($params)
{
$t = $params['template'];
unset($params['template']);
return $this->Application->BuildEnv($t, $params, 'm', false, false);
}*/
function FormAction($params)
{
if (!array_key_exists('pass', $params)) {
$params['pass'] = 'all,m';
}
$params['pass_category'] = 1;
return $this->Application->HREF('', '', $params);
}
/*// 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 (used only as "check" parameter value for "m_if" tag!)
*
* @param Array $params
* @return stirng
* @access public
*/
function Param($params)
{
$name = $params['name'];
if (array_key_exists($name, $this->Application->Parser->Captures)) {
$capture_params = $params;
$capture_params['name'] = '__capture_' . $name;
$this->Application->Parser->SetParam($name, $this->Application->ParseBlock($capture_params));
}
$res = $this->Application->Parser->GetParam($name);
if ($res === false) {
$res = '';
}
if (array_key_exists('plus', $params)) {
$res += $params['plus'];
}
return $res;
}
/**
* Compares block parameter with value specified
*
* @param Array $params
* @return bool
* @access public
*/
function ParamEquals($params)
{
$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)
{
$var_name = $this->SelectParam($params,'name,var,param');
if (isset($params['persistent']) && $params['persistent']) {
$ret = $this->Application->RecallPersistentVar($var_name);
}
else {
$ret = $this->Application->RecallVar($var_name);
}
$ret = ($ret === false && isset($params['no_null'])) ? '' : $ret;
if (getArrayValue($params, 'special') || getArrayValue($params, 'htmlchars')) {
$ret = kUtil::escape($ret, kUtil::ESCAPE_HTML);
}
if (getArrayValue($params, 'urlencode')) {
$ret = kUtil::escape($ret, kUtil::ESCAPE_URL);
}
return $ret;
}
function RemoveVar($params)
{
$this->Application->RemoveVar( $this->SelectParam($params,'name,var,param') );
}
// 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);
}
/**
* Links variable from request with variable from session
*
* @param Array $params
* @return string
* @access protected
*/
protected function LinkVar($params)
{
$var_name = $params['name'];
$session_var_name = isset($params['session_name']) ? $params['session_name'] : $var_name;
$default_value = isset($params['default']) ? $params['default'] : '';
$this->Application->LinkVar($var_name, $session_var_name, $default_value);
return '';
}
/**
* Links variable from request with variable from session and returns it's value
*
* @param Array $params
* @return string
* @access protected
*/
protected function GetLinkedVar($params)
{
$this->LinkVar($params);
return $this->Application->GetVar( $params['name'] );
}
/**
* 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)
{
$name = $this->SelectParam($params, 'name,var,param');
if ( strpos($name, '[') !== false ) {
preg_match('/([^\[\]]+)\[(.*)\]/', $name, $regs);
$function_params = explode('][', $regs[2]);
$ret = $this->Application->GetVar($regs[1], Array ());
array_unshift_ref($function_params, $ret);
return call_user_func_array('getArrayValue', $function_params);
}
else {
$ret = $this->Application->GetVar($name, '');
}
if (array_key_exists('no_html_escape', $params) && $params['no_html_escape']) {
return htmlspecialchars_decode($ret);
}
return $ret;
}
/**
* Retrieves application constant
* value by name
*
* @param Array $params
* @return string
* @access public
*/
function GetConst($params)
{
$constant_name = $this->SelectParam($params, 'name,const');
return defined($constant_name) ? constant($constant_name) : '';
}
/**
* 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 ( isset($params['formatted']) && $params['formatted'] ) {
$sql = 'SELECT ValueList
FROM ' . TABLE_PREFIX . 'SystemSettings
WHERE VariableName = ' . $this->Conn->qstr($config_name) . ' AND ElementType IN ("select", "radio")';
$value_list = $this->Conn->GetOne($sql);
if ( $value_list ) {
$helper = $this->Application->recallObject('InpCustomFieldsHelper');
/* @var $helper InpCustomFieldsHelper */
$options = $helper->GetValuesHash($value_list);
$ret = isset($options[$ret]) ? $options[$ret] : $ret;
}
}
if ( isset($params['as_label']) && $params['as_label'] ) {
$ret = $this->Application->Phrase($ret);
}
return $ret;
}
/**
* Compares configuration variable to a given value
*
* @param Array $params
* @return bool
* @deprecated
* @access protected
*/
protected function ConfigEquals($params)
{
$option = $this->SelectParam($params, 'name,option,var');
return $this->Application->ConfigValue($option) == $params['value'];
}
/**
* Creates all hidden fields
* needed for kernel_form
*
* @param Array $params
* @return string
* @access protected
*/
protected function DumpSystemInfo($params)
{
$actions = $this->Application->recallObject('kActions');
/* @var $actions Params */
$actions->Set('t', $this->Application->GetVar('t'));
$o = '';
$params = $actions->GetParams();
foreach ($params AS $name => $val) {
$o .= "<input type='hidden' name='$name' id='$name' value='$val'>\n";
}
return $o;
}
/**
* Used for search sidebox on front-end only
*
* @param Array $params
* @return string
* @access protected
*/
protected function GetFormHiddens($params)
{
$t = $this->SelectParam($params, 'template,t');
unset($params['template']);
$form_fields = Array ();
if ( $this->Application->RewriteURLs() ) {
$session = $this->Application->recallObject('Session');
/* @var $session Session */
if ( $session->NeedQueryString() ) {
$form_fields['sid'] = $this->Application->GetSID();
}
}
else {
$form_fields['env'] = $this->Application->BuildEnv($t, $params, 'm', false, false);
}
if ( $this->Application->GetVar('admin') == 1 ) {
$form_fields['admin'] = 1;
}
$ret = '';
$field_tpl = '<input type="hidden" name="%1$s" id="%1$s" value="%2$s"/>' . "\n";
foreach ($form_fields as $form_field => $field_value) {
$ret .= sprintf($field_tpl, $form_field, $field_value);
}
return $ret;
}
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)
{
$phrase_name = $this->SelectParam($params, 'label,name,title');
$default_translation = $this->SelectParam($params, 'default');
$no_editing = isset($params['no_editing']) && $params['no_editing'];
$translation = $this->Application->Phrase($phrase_name, !$no_editing);
$phrase_key = mb_strtoupper($phrase_name);
if ( $default_translation && strpos($translation, '!' . $phrase_key . '!') !== false ) {
$phrase = $this->Application->recallObject('phrases.autocreate', null, Array ('skip_autoload' => true));
/* @var $phrase kDBItem */
if ( !$phrase->Load($phrase_key, 'PhraseKey') ) {
$phrase->SetDBField('Phrase', $phrase_name);
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper');
/* @var $ml_helper kMultiLanguageHelper */
$languages = $ml_helper->getLanguages();
foreach ($languages AS $language_id) {
$phrase->SetDBField('l' . $language_id . '_Translation', $default_translation);
}
if ( $phrase->Create() ) {
$translation = $default_translation;
}
}
}
if ( isset($params['escape']) && $params['escape'] ) {
- $translation = kUtil::escape($translation, kUtil::ESCAPE_HTML . '+' . kUtil::ESCAPE_JS);
+ // html escaping here is redundant
+ $translation = kUtil::escape($translation, kUtil::ESCAPE_JS);
}
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'];
}
$physical_template = $this->Application->getPhysicalTemplate($this->Application->GetVar('t'));
return preg_match('/^' . str_replace('/', '\/', $test_templ) . '/i', $physical_template) ? $if_true : $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'];
if (isset($params['persistent']) && $params['persistent']) {
return $this->Application->RecallPersistentVar($name) == $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 protected
* @deprecated
*/
protected function GetEquals($params)
{
$name = $this->SelectParam($params, 'var,name,param');
return $this->Application->GetVar($name) == $params['value'];
}
function ModuleInclude($params)
{
$ret = '';
$included = Array ();
$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');
$replace_main = isset($params['replace_m']) && $params['replace_m'];
$skip_prefixes = isset($params['skip_prefixes']) ? explode(',', $params['skip_prefixes']) : Array ();
$cms_mode = $this->Application->GetVar('admin');
foreach ($this->Application->ModuleInfo as $module_name => $module_data) {
$module_key = mb_strtolower($module_name);
if ( $module_name == 'In-Portal' ) {
if ( !$cms_mode && $this->Application->isAdmin ) {
// don't process In-Portal templates in admin
continue;
}
// Front-End still relies on In-Portal module
$module_prefix = $module_data['TemplatePath'];
}
elseif ( $this->Application->isAdmin && $module_data['Path'] != 'core/' ) {
$module_prefix = $module_key . '/'; // was $module_data['Path'];
}
else {
$module_prefix = $module_data['TemplatePath']; // always have trailing "/"
}
if ( in_array($module_prefix, $included) ) {
// template by this path was already included by other module (e.g. in-portal used core's template)
continue;
}
$block_params['t'] = $module_prefix . $this->SelectParam($params, $module_key . '_template,' . $module_key . '_t,template,t');
$check_prefix = $module_data['Var'];
if ( $check_prefix == 'adm' && $replace_main ) {
$check_prefix = 'c';
}
if ( $block_params['t'] == $current_template || in_array($check_prefix, $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->Application->IncludeTemplate($block_params);
$included[] = $module_prefix;
}
return $ret;
}
function ModuleEnabled($params)
{
return $this->Application->isModuleEnabled( $params['module'] );
}
/**
* Checks if debug mode is on
*
* @param Array $params
* @return bool
* @access public
*/
function IsDebugMode($params)
{
return defined('DEBUG_MODE') && $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);
}
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');
/* @var $perm_helper kPermissionsHelper */
return $perm_helper->TagPermissionCheck($params);
}
/**
* 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');
$next_t = getArrayValue($params, 'next_template');
if ( $next_t ) {
$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');
/* @var $perm_helper kPermissionsHelper */
$perm_status = $perm_helper->TagPermissionCheck($params);
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) {
$sql = 'SELECT GroupId
FROM '.TABLE_PREFIX.'UserGroups
WHERE Name = '.$this->Conn->qstr($group);
$group_id = $this->Conn->GetOne($sql);
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) {
$redirect_params = $this->Application->HttpQuery->getRedirectParams(true);
if (MOD_REWRITE) {
// TODO: $next_t variable is ignored !!! (is anyone using m_RequireLogin tag with "next_template" parameter?)
$redirect_params = Array (
'm_cat_id' => 0,
'next_template' => kUtil::escape('external:' . $_SERVER['REQUEST_URI'], kUtil::ESCAPE_URL),
);
}
else {
$redirect_params['next_template'] = $t;
}
if (array_key_exists('pass_category', $params)) {
$redirect_params['pass_category'] = $params['pass_category'];
}
if (array_key_exists('use_section', $params)) {
$redirect_params['use_section'] = $params['use_section'];
}
if ( $this->Application->LoggedIn() && !$group_access) {
$this->Application->Redirect($params['no_group_perm_template'], $redirect_params);
}
$this->Application->Redirect($params['login_template'], $redirect_params);
}
}
/**
* Checks, that user belongs to a group with a given name
*
* @param Array $params
* @return bool
*/
protected function IsMember($params)
{
$sql = 'SELECT GroupId
FROM ' . TABLE_PREFIX . 'UserGroups
WHERE Name = ' . $this->Conn->qstr($params['group']);
$group_id = $this->Conn->GetOne($sql);
if ( $group_id ) {
$groups = explode(',', $this->Application->RecallVar('UserGroups'));
return in_array($group_id, $groups);
}
return false;
}
/**
* 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 Array $params
*/
protected function CheckSSL($params)
{
$ssl = $this->Application->isAdmin ? $this->Application->ConfigValue('AdminSSL_URL') : false;
if ( !$ssl ) {
// not in admin or admin ssl url is empty
$ssl_url = $this->Application->siteDomainField('SSLUrl');
$ssl = $ssl_url !== false ? $ssl_url : $this->Application->ConfigValue('SSL_URL');
}
if ( !$ssl || ($this->Application->TemplatesCache->forceThemeName !== false) ) {
// SSL URL is not set - no way to require SSL
// internal parsing (e.g. "TemplateParser::_parseTemplate") -> don't redirect
return;
}
$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;
}
}
}
if ( EDITING_MODE ) {
// match SSL mode on front-end to one in administrative console, when browse modes are used
$require = $this->Application->ConfigValue('Require_AdminSSL');
}
$http_query = $this->Application->recallObject('HTTPQuery');
/* @var $http_query kHTTPQuery */
$pass = $http_query->getRedirectParams();
$pass['pass_events'] = 1; // to make sure all events are passed when redirect happens
if ( $require ) {
if ( PROTOCOL == 'https://' ) {
$this->Application->SetVar('__KEEP_SSL__', 1);
return;
}
$pass['__SSL__'] = 1;
$this->Application->Redirect('', $pass);
}
else {
if ( PROTOCOL == 'https://' && $this->Application->ConfigValue('Force_HTTP_When_SSL_Not_Required') ) {
if ( $this->Application->GetVar('__KEEP_SSL__') ) {
return;
}
// $pass_more = Array ('pass' => 'm', 'm_cat_id' => 0, '__SSL__' => 0);
$pass['__SSL__'] = 0;
$this->Application->Redirect('', $pass); // $pass_more
}
}
}
function ConstOn($params)
{
$name = $this->SelectParam($params,'name,const');
return kUtil::constOn($name);
}
function SetDefaultCategory($params)
{
$category_id = $this->Application->findModule('Name', $params['module'], 'RootCat');
$this->Application->SetVar('m_cat_id', $category_id);
}
function XMLTemplate($params)
{
$this->NoDebug($params);
if ( isset($params['cache']) && $params['cache'] ) {
$nextyear = intval(date('Y') + 1);
$format = "D, d M Y H:i:s";
$expiration = gmdate($format, time() + $params['cache']) . ' GMT';
$last_modified = time();
header('Cache-Control: public, cache, max-age=' . $params['cache']);
header("Expires: $expiration");
header('Pragma: public');
// Getting headers sent by the client.
$headers = $this->_requestHeaders();
// Checking if the client is validating his cache and if it is current.
if ( isset($headers['If-Modified-Since']) && (strtotime($headers['If-Modified-Since']) > $last_modified - $params['cache']) ) {
// Client's cache IS current, so we just respond '304 Not Modified'.
header('Last-Modified: ' . date($format, strtotime($headers['If-Modified-Since'])) . ' GMT', true, 304);
exit;
}
else {
// Image not cached or cache outdated, we respond '200 OK' and output the image.
header('Last-Modified: ' . gmdate($format, $last_modified) . ' GMT', true, 200);
}
}
// xml documents are usually long
kUtil::setResourceLimit();
if ( !$this->Application->GetVar('debug') ) {
return $this->Application->XMLHeader(getArrayValue($params, 'xml_version'));
}
return '';
}
protected function _requestHeaders()
{
if ( function_exists('apache_request_headers') ) {
// If apache_request_headers() exists...
$headers = apache_request_headers();
if ($headers) {
return $headers; // And works... Use it
}
}
$headers = Array ();
foreach (array_keys($_SERVER) as $skey) {
if (substr($skey, 0, 5) == 'HTTP_') {
$headername = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($skey, 0, 5)))));
$headers[$headername] = $_SERVER[$skey];
}
}
return $headers;
}
function Header($params)
{
header($params['data']);
}
function NoDebug($params)
{
if ( !$this->Application->GetVar('debug') ) {
kUtil::safeDefine('DBG_SKIP_REPORTING', 1);
}
}
/**
* Returns Home category name
*
* @param Array $params
* @return string
* @deprecated
*/
function RootCategoryName($params)
{
$no_editing = array_key_exists('no_editing', $params) && $params['no_editing'];
return $this->Application->Phrase('la_rootcategory_name', !$no_editing);
}
/**
* Allows to attach file directly from email event template
*
* @param Array $params
*/
function AttachFile($params)
{
$path = FULL_PATH . '/' . $params['path'];
$pseudo = isset($params['special']) ? 'EmailSender.' . $params['special'] : 'EmailSender';
$esender = $this->Application->recallObject($pseudo);
/* @var $esender kEmailSendingHelper */
if ( file_exists($path) ) {
$esender->AddAttachment($path);
}
}
function CaptchaImage($params)
{
$this->NoDebug($params);
$this->Application->SetVar('skip_last_template', 1);
$captcha_helper = $this->Application->recallObject('CaptchaHelper');
/* @var $captcha_helper kCaptchaHelper */
// generate captcha code
$code = $captcha_helper->prepareCode( $this->Application->GetVar('var') );
$captcha_helper->GenerateCaptchaImage($code, $this->Application->GetVar('w'), $this->Application->GetVar('h'), true);
}
function SID($params)
{
return $this->Application->GetSID();
}
function ModuleInfo($params)
{
return $this->Application->findModule($params['key'], $params['value'], $params['return']);
}
function Random($params)
{
return rand(1, 100000000);
}
/**
* Prints parser params, available at current deep level
*
* @param Array $params
* @return string
*/
function PrintCurrentParams($params)
{
$current_params = $this->Application->Parser->Params;
foreach ($current_params as $param_name => $param_value) {
$current_params[$param_name] = $param_name . ' = "' . $param_value . '"';
}
return '<pre>' . implode("\n", $current_params) . '</pre>';
}
/**
* Gets previously defined counter result
*
* @param Array $params
* @return int
*/
function GetCounter($params)
{
return $this->Application->getCounter($params['name'], $params);
}
/**
* Increments PageHit counter
*
* @param Array $params
* @return int
*/
function RegisterPageHit($params)
{
if ($this->Application->ConfigValue('UsePageHitCounter')) {
// get current counte
$sql = 'SELECT VariableValue
FROM '.TABLE_PREFIX.'SystemSettings
WHERE VariableName = "PageHitCounter"';
$page_counter = (int)$this->Conn->GetOne($sql);
$sql = 'UPDATE LOW_PRIORITY '.TABLE_PREFIX.'SystemSettings
SET VariableValue = '.($page_counter + 1).'
WHERE VariableName = "PageHitCounter"';
$this->Conn->Query($sql);
}
}
function Timestamp($params)
{
$format = isset($params['format']) ? $params['format'] : 'd.m.Y H:i:s';
return adodb_date($format);
}
function GetUrlHiddenFileds($params)
{
$vars = Array ('page', 'per_page', 'sort_by');
$ret = '<input type="hidden" name="main_list" value="1"/>';
if (array_key_exists('skip', $params)) {
$vars = array_diff($vars, $params['skip']);
}
foreach ($vars as $var_name) {
$var_value = $this->Application->GetVar($var_name);
if ($var_value) {
$ret .= '<input type="hidden" name="' . $var_name . '" value="' . $var_value . '"/>';
}
}
return $ret;
}
/**
* Returns current Page URL (without re-assembling it).
* "skip_query" param is optional and will remove the ?QUERY part from the result.
*
* @param Array $params
* @return string
* @access protected
*/
protected function CurrentPageLink($params)
{
if ( isset($params['skip_query']) && $params['skip_query'] ) {
return preg_replace('/\?' . preg_quote($_SERVER['QUERY_STRING'], '/') . '$/', '', $_SERVER['REQUEST_URI']);
}
return $_SERVER['REQUEST_URI'];
}
/**
* Returns current maintenance mode state
*
* @param Array $params
* @return int
* @access protected
*/
protected function MaintenanceMode($params)
{
$check_ips = isset($params['check_ips']) ? $params['check_ips'] : true;
return $this->Application->getMaintenanceMode($check_ips);
}
/**
* Checks if element with given name is defined
*
* @param Array $params
* @return int
* @access protected
*/
protected function ElementDefined($params)
{
return $this->Application->Parser->blockFound($params['name']);
}
}
Index: branches/5.3.x/core/kernel/languages/phrases_cache.php
===================================================================
--- branches/5.3.x/core/kernel/languages/phrases_cache.php (revision 15906)
+++ branches/5.3.x/core/kernel/languages/phrases_cache.php (revision 15907)
@@ -1,414 +1,415 @@
<?php
/**
* @version $Id$
* @package In-Portal
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
class PhrasesCache extends kBase {
var $Phrases = Array();
var $Ids = Array();
var $OriginalIds = Array(); //for comparing cache
var $LanguageId = null;
/**
* Administrator's language, when visiting site (from frame)
*
* @var int
*/
var $AdminLanguageId = null;
var $fromTag = false;
/**
* Allows to edit existing phrases
*
* @var bool
*/
var $_editExisting = false;
/**
* Allows to edit missing phrases
*
* @var bool
*/
var $_editMissing = false;
/**
* Template, used for phrase adding/editing
*
* @var string
*/
var $_phraseEditTemplate = 'languages/phrase_edit';
/**
* Use simplified form for phrase editing
*
* @var bool
*/
var $_simpleEditingMode = false;
/**
* HTML tag used to translate phrases
*
* @var string
*/
var $_translateHtmlTag = 'a';
/**
* Phrases, that are in cache, but are not in database
*
* @var Array
*/
var $_missingPhrases = Array ();
/**
* Mask for editing link
*
* @var string
*/
var $_editLinkMask = '';
/**
* Escape phrase name, before placing it in javascript translation link
*
* @var string
*/
var $_phraseEscapeStrategy = kUtil::ESCAPE_JS;
/**
* Sets phrase editing mode, that corresponds current editing mode
*
*/
function setPhraseEditing()
{
if (!$this->Application->isAdmin && (EDITING_MODE == EDITING_MODE_CONTENT)) {
// front-end viewed in content mode
$this->_editExisting = $this->_editMissing = true;
$this->_simpleEditingMode = !$this->Application->isDebugMode();
$this->_translateHtmlTag = 'span';
}
$this->_editLinkMask = $this->getRawEditLink('#LABEL#');
if (defined('DEBUG_MODE') && DEBUG_MODE && !$this->Application->GetVar('admin')) {
// admin and front-end while not viewed using content mode (via admin)
$this->_editMissing = defined('DBG_PHRASES') && DBG_PHRASES;
if (!$this->Application->isAdmin) {
$this->_phraseEditTemplate = 'phrases_edit';
$url_params = Array (
'm_opener' => 'd',
'phrases_label' => '#LABEL#',
'phrases_event' => 'OnPreparePhrase',
'next_template' => kUtil::escape('external:' . $_SERVER['REQUEST_URI'], kUtil::ESCAPE_URL),
+ '__URLENCODE__' => 1,
'pass' => 'm,phrases'
);
$this->_phraseEscapeStrategy = kUtil::ESCAPE_URL;
$this->_editLinkMask = $this->Application->HREF($this->_phraseEditTemplate, '', $url_params);
}
}
}
/**
* Returns raw link for given phrase editing.
*
* @param string $label Phrase label.
*
* @return string
*/
protected function getRawEditLink($label)
{
$function_params = array(
$label,
$this->_phraseEditTemplate,
array('event' => 'OnPreparePhrase', 'simple_mode' => $this->_simpleEditingMode),
);
return 'javascript:translate_phrase(' . implode(',', array_map('json_encode', $function_params)) . ');';
}
/**
* Returns final link (using mask) for given phrase editing.
*
* @param string $label Phrase label.
*
* @return string
*/
protected function getEditLink($label)
{
$escaped_label = kUtil::escape($label, $this->_phraseEscapeStrategy);
return str_replace('#LABEL#', $escaped_label, $this->_editLinkMask);
}
/**
* Returns HTML code for label editing.
*
* @param string $url Phrase editing url.
* @param string $text Link text to show (usually label in upper case).
* @param string $alt Text to display when hovered over the link.
*
* @return string
*/
protected function getEditHtmlCode($url, $text, $alt)
{
$url = kUtil::escape($url, kUtil::ESCAPE_HTML);
$ret = '<' . $this->_translateHtmlTag . ' href="' . $url . '" name="cms-translate-phrase" title="' . $alt . '">' . $text . '</' . $this->_translateHtmlTag . '>';
return $this->fromTag ? $this->escapeTagReserved($ret) : $ret;
}
/**
* Loads phrases from current language
* Method is called manually (not from kFactory class) too
*
* @param string $prefix
* @param string $special
* @param int $language_id
* @param Array $phrase_ids
*/
public function Init($prefix, $special = '', $language_id = null, $phrase_ids = null)
{
parent::Init($prefix, $special);
if (kUtil::constOn('IS_INSTALL')) {
$this->LanguageId = 1;
}
else {
if ( !isset($language_id) ) {
if ($this->Application->isAdmin) {
$language_id = $this->Application->Session->GetField('Language');
$this->AdminLanguageId = $language_id; // same languages, when used from Admin Console
}
else {
$language_id = $this->Application->GetVar('m_lang');
}
}
$this->LanguageId = $language_id;
if (!$this->Application->isAdmin && $this->Application->GetVar('admin')) {
$admin_session = $this->Application->recallObject('Session.admin');
/* @var $admin_session Session */
$this->AdminLanguageId = $admin_session->GetField('Language');
}
}
$this->LoadPhrases($phrase_ids);
}
function LoadPhrases($ids)
{
if ( !is_array($ids) || !implode('', $ids) ) {
return ;
}
$sql = 'SELECT l' . $this->LanguageId . '_Translation AS Translation, l' . $this->LanguageId . '_HintTranslation AS HintTranslation, l' . $this->LanguageId . '_ColumnTranslation AS ColumnTranslation, PhraseKey
FROM ' . TABLE_PREFIX . 'LanguageLabels
WHERE PhraseId IN (' . implode(',', $ids) . ') AND l' . $this->LanguageId . '_Translation IS NOT NULL';
$this->Phrases = $this->Conn->Query($sql, 'PhraseKey');
$this->Ids = $this->OriginalIds = $ids;
}
function AddCachedPhrase($label, $value, $allow_editing = true)
{
// uppercase phrase name for cases, when this method is called outside this class
$cache_key = ($allow_editing ? '' : 'NE:') . mb_strtoupper($label);
$this->Phrases[$cache_key] = Array ('Translation' => $value, 'HintTranslation' => $value, 'ColumnTranslation' => $value);
}
function NeedsCacheUpdate()
{
return is_array($this->Ids) && count($this->Ids) > 0 && $this->Ids != $this->OriginalIds;
}
/**
* Returns translation of given label
*
* @param string $label
* @param bool $allow_editing return translation link, when translation is missing on current language
* @param bool $use_admin use current Admin Console language to translate phrase
* @return string
* @access public
*/
public function GetPhrase($label, $allow_editing = true, $use_admin = false)
{
if ( !isset($this->LanguageId) ) {
//actually possible when custom field contains references to language labels and its being rebuilt in OnAfterConfigRead
//which is triggered by Sections rebuild, which in turn read all the configs and all of that happens BEFORE seeting the language...
return 'impossible case';
}
// cut exclamation marks - deprecated form of passing phrase name from templates
$label = preg_replace('/^!(.*)!$/', '\\1', $label);
if ( strlen($label) == 0 ) {
return '';
}
$original_label = $label;
list ($field_prefix, $label) = $this->parseLabel($label);
$translation_field = mb_convert_case($field_prefix, MB_CASE_TITLE) . 'Translation';
$uppercase_label = mb_strtoupper($label);
$cache_key = ($allow_editing ? '' : 'NE:') . $uppercase_label;
if ( isset($this->Phrases[$cache_key]) ) {
$translated_label = $this->Phrases[$cache_key][$translation_field];
if ($this->_editExisting && $allow_editing && !array_key_exists($uppercase_label, $this->_missingPhrases)) {
// option to change translation for Labels
$edit_link = $this->getRawEditLink($label);
$translated_label = $this->getEditHtmlCode($edit_link, $translated_label, 'Edit translation');
}
return $translated_label;
}
$this->LoadPhraseByLabel($uppercase_label, $original_label, $allow_editing, $use_admin);
return $this->GetPhrase($original_label, $allow_editing);
}
function LoadPhraseByLabel($uppercase_label, $original_label, $allow_editing = true, $use_admin = false)
{
if ( !$allow_editing && !$use_admin && !isset($this->_missingPhrases[$uppercase_label]) && isset($this->Phrases[$uppercase_label]) ) {
// label is already translated, but it's version without on the fly translation code is requested
$this->Phrases['NE:' . $uppercase_label] = $this->Phrases[$uppercase_label];
return true;
}
$language_id = $use_admin ? $this->AdminLanguageId : $this->LanguageId;
$sql = 'SELECT PhraseId, l' . $language_id . '_Translation AS Translation, l' . $language_id . '_HintTranslation AS HintTranslation, l' . $language_id . '_ColumnTranslation AS ColumnTranslation
FROM ' . TABLE_PREFIX . 'LanguageLabels
WHERE (PhraseKey = ' . $this->Conn->qstr($uppercase_label) . ') AND (l' . $language_id . '_Translation IS NOT NULL)';
$res = $this->Conn->GetRow($sql);
if ($res === false || count($res) == 0) {
$translation = '!' . $uppercase_label . '!';
if ($this->_editMissing && $allow_editing) {
list (, $original_label) = $this->parseLabel($original_label);
$edit_url = $this->getEditLink($original_label);
$translation = $this->getEditHtmlCode($edit_url, $translation, 'Translate');
$this->_missingPhrases[$uppercase_label] = true; // add as key for faster accessing
}
// add it as already cached, as long as we don't need to cache not found phrase
$this->AddCachedPhrase($uppercase_label, $translation, $allow_editing);
return false;
}
$cache_key = ($allow_editing ? '' : 'NE:') . $uppercase_label;
$this->Phrases[$cache_key] = $res;
array_push($this->Ids, $res['PhraseId']);
$this->Ids = array_unique($this->Ids); // just to make sure
return true;
}
/**
* Parse label into translation field prefix and actual label.
*
* @param string $label Phrase label.
*
* @return array
*/
protected function parseLabel($label)
{
if ( strpos($label, ':') === false || preg_match('/^(HINT|COLUMN):(.*)$/i', $label, $regs) == 0 ) {
return array('', $label);
}
return array($regs[1], $regs[2]);
}
/**
* Sort params by name and then by length
*
* @param string $a
* @param string $b
* @return int
* @access private
*/
function CmpParams($a, $b)
{
$a_len = mb_strlen($a);
$b_len = mb_strlen($b);
if ($a_len == $b_len) return 0;
return $a_len > $b_len ? -1 : 1;
}
/**
* Replace language tags in exclamation marks found in text
*
* @param string $text
* @param bool|null $force_escaping force escaping, not escaping of resulting string
* @return mixed
* @access public
*/
public function ReplaceLanguageTags($text, $force_escaping = null)
{
$this->fromTag = true;
if( isset($force_escaping) ) {
$this->fromTag = $force_escaping;
}
preg_match_all("(!(la|lu|lc)[^!]+!)", $text, $res, PREG_PATTERN_ORDER);
$language_tags = $res[0];
uasort($language_tags, Array(&$this, 'CmpParams'));
$i = 0;
$values = Array();
foreach ($language_tags as $label) {
array_push($values, $this->GetPhrase($label) );
//array_push($values, $this->Application->Phrase($label) );
$language_tags[$i] = '/' . $language_tags[$i] . '/';
$i++;
}
$this->fromTag = false;
return preg_replace($language_tags, $values, $text);
}
/**
* Escape chars in phrase translation, that could harm parser to process tag
*
* @param string $text
* @return string
* @access private
*/
function escapeTagReserved($text)
{
$reserved = Array('"', "'"); // =
$replacement = Array('\"', "\'"); // \=
return str_replace($reserved, $replacement, $text);
}
}
\ No newline at end of file
Index: branches/5.3.x/core/units/admin/admin_tag_processor.php
===================================================================
--- branches/5.3.x/core/units/admin/admin_tag_processor.php (revision 15906)
+++ branches/5.3.x/core/units/admin/admin_tag_processor.php (revision 15907)
@@ -1,1192 +1,1196 @@
<?php
/**
* @version $Id$
* @package In-Portal
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
class AdminTagProcessor extends kDBTagProcessor {
/**
* Allows to execute js script after the page is fully loaded
*
* @param Array $params
* @return string
*/
function AfterScript($params)
{
$after_script = $this->Application->GetVar('after_script');
if ($after_script) {
return '<script type="text/javascript">'.$after_script.'</script>';
}
return '';
}
/**
* Returns section title with #section# keyword replaced with current section
*
* @param Array $params
* @return string
*/
function GetSectionTitle($params)
{
if (array_key_exists('default', $params)) {
return $params['default'];
}
return $this->Application->Phrase( kUtil::replaceModuleSection($params['phrase']) );
}
/**
* Returns section icon with #section# keyword replaced with current section
*
* @param Array $params
* @return string
*/
function GetSectionIcon($params)
{
return kUtil::replaceModuleSection($params['icon']);
}
/**
* Returns version of module by name
*
* @param Array $params
* @return string
*/
function ModuleVersion($params)
{
return $this->Application->findModule('Name', $params['module'], 'Version');
}
/**
* Used in table form section drawing
*
* @param Array $params
* @return string
*/
function DrawTree($params)
{
static $deep_level = 0;
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
$sections_helper = $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
$section_data =& $sections_helper->getSectionData($section_name);
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
$params['deep_level'] = $deep_level++;
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
+ $section_data['url']['__URLENCODE__'] = 1;
+
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$ret .= $this->Application->ParseBlock( array_merge($params, $section_data) );
if (!isset($section_data['children'])) {
return $ret;
}
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $section_name) {
if (!$sections_helper->sectionVisible($section_name)) {
continue;
}
$params['section_name'] = $section_name;
$ret .= $this->DrawTree($params);
$deep_level--;
}
return $ret;
}
function SectionInfo($params)
{
$section = $params['section'];
if ($section == '#session#') {
$section = $this->Application->RecallVar('section');
}
$sections_helper = $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
$section_data =& $sections_helper->getSectionData($section);
if (!$section_data) {
throw new Exception('Use of undefined section "<strong>' . $section . '</strong>" in "<strong>' . __METHOD__ . '</strong>"');
return '';
}
if (array_key_exists('parent', $params) && $params['parent']) {
do {
$section = $section_data['parent'];
$section_data =& $sections_helper->getSectionData($section);
} while (array_key_exists('use_parent_header', $section_data) && $section_data['use_parent_header']);
}
$info = $params['info'];
switch ($info) {
case 'module_path':
if (isset($params['module']) && $params['module']) {
$module = $params['module'];
}
elseif (isset($section_data['icon_module'])) {
$module = $section_data['icon_module'];
}
else {
$module = '#session#';
}
$res = $this->ModulePath(array('module' => $module));
break;
case 'perm_section':
$res = $sections_helper->getPermSection($section);
break;
case 'label':
$res = '';
if ( $section ) {
if ( $section == 'in-portal:root' ) {
// don't translate label for top section, because it's already translated
$res = $section_data['label'];
}
else {
$no_editing = array_key_exists('no_editing', $params) ? $params['no_editing'] : false;
$res = $this->Application->Phrase($section_data['label'], !$no_editing);
}
}
break;
default:
$res = $section_data[$info];
break;
}
if (array_key_exists('as_label', $params) && $params['as_label']) {
$res = $this->Application->Phrase($res);
}
return $res;
}
function PrintSection($params)
{
$section_name = $params['section_name'];
if ($section_name == '#session#') {
$section_name = $this->Application->RecallVar('section');
}
$sections_helper = $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
if (isset($params['use_first_child']) && $params['use_first_child']) {
$section_name = $sections_helper->getFirstChild($section_name, true);
}
$section_data =& $sections_helper->getSectionData($section_name);
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
$params['section_name'] = $section_name;
$url_params = $section_data['url'];
unset($url_params['t']);
+ $url_params['__URLENCODE__'] = 1;
$section_data['section_url'] = $this->Application->HREF($section_data['url']['t'], '', $url_params);
$ret = $this->Application->ParseBlock( array_merge($params, $section_data) );
return $ret;
}
/**
* Used in XML drawing for tree
*
* @param Array $params
* @return string
*/
function PrintSections($params)
{
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
if ($section_name == '#session#') {
$section_name = $this->Application->RecallVar('section');
}
$sections_helper = $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
$section_data =& $sections_helper->getSectionData($section_name);
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
if (!isset($section_data['children'])) {
return '';
}
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $section_name) {
$params['section_name'] = $section_name;
$section_data =& $sections_helper->getSectionData($section_name);
if (!$sections_helper->sectionVisible($section_name)) {
continue;
}
else {
$show_mode = isset($section_data['show_mode']) ? $section_data['show_mode'] : smNORMAL;
$section_data['debug_only'] = ($show_mode == smDEBUG) || ($show_mode == smSUPER_ADMIN) ? 1 : 0;
}
if (isset($section_data['tabs_only']) && $section_data['tabs_only']) {
$perm_status = false;
$folder_label = $section_data['label'];
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $priority => $section_name) {
// if only tabs in this section & none of them have permission, then skip section too
$section_name = $sections_helper->getPermSection($section_name);
$perm_status = $this->Application->CheckPermission($section_name.'.view', 1);
if ($perm_status) {
break;
}
}
if (!$perm_status) {
// no permission for all tabs -> don't display tree node either
continue;
}
$params['section_name'] = $section_name;
$section_data =& $sections_helper->getSectionData($section_name);
$section_data['label'] = $folder_label; // use folder label in tree
$section_data['is_tab'] = 1;
}
else {
$section_name = $sections_helper->getPermSection($section_name);
if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue;
}
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
// remove template, so it doesn't appear as additional parameter in url
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
+ $section_data['url']['__URLENCODE__'] = 1;
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$late_load = getArrayValue($section_data, 'late_load');
if ($late_load) {
$t = $late_load['t'];
unset($late_load['t']);
$section_data['late_load'] = $this->Application->HREF($t, '', $late_load);
$params['children_count'] = 99;
}
else {
$section_data['late_load'] = '';
}
// restore template
$section_data['url']['t'] = $template;
$ret .= $this->Application->ParseBlock( array_merge($params, $section_data) );
$params['section_name'] = $section_name;
}
return preg_replace("/\r\n|\n/", '', $ret);
}
function ListSectionPermissions($params)
{
$section_name = isset($params['section_name']) ? $params['section_name'] : $this->Application->GetVar('section_name');
$sections_helper = $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
$section_data =& $sections_helper->getSectionData($section_name);
$block_params = array_merge($section_data, Array('name' => $params['render_as'], 'section_name' => $section_name));
$ret = '';
foreach ($section_data['permissions'] as $perm_name) {
if (preg_match('/^advanced:(.*)/', $perm_name) != $params['type']) continue;
$block_params['perm_name'] = $perm_name;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
function ModuleInclude($params)
{
foreach ($params as $param_name => $param_value) {
$params[$param_name] = kUtil::replaceModuleSection($param_value);
}
return $this->Application->ProcessParsedTag('m', 'ModuleInclude', $params);
}
function TodayDate($params)
{
return date($params['format']);
}
/**
* Draws section tabs using block name passed
*
* @param Array $params
*/
function ListTabs($params)
{
$sections_helper = $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
$section_data =& $sections_helper->getSectionData($params['section_name']);
$ret = '';
$block_params = Array('name' => $params['render_as']);
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $priority => $section_name) {
$perm_section = $sections_helper->getPermSection($section_name);
if ( !$this->Application->CheckPermission($perm_section.'.view') ) {
continue;
}
$tab_data =& $sections_helper->getSectionData($section_name);
$block_params['t'] = $tab_data['url']['t'];
$block_params['pass'] = $tab_data['url']['pass'];
$block_params['title'] = $tab_data['label'];
$block_params['main_prefix'] = $section_data['SectionPrefix'];
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
/**
* Returns list of module item tabs that have view permission in current category
*
* @param Array $params
*/
function ListCatalogTabs($params)
{
$ret = '';
$special = isset($params['special']) ? $params['special'] : '';
$replace_main = isset($params['replace_m']) && $params['replace_m'];
$skip_prefixes = isset($params['skip_prefixes']) ? explode(',', $params['skip_prefixes']) : Array ();
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
$prefix = $module_info['Var'];
if ( $prefix == 'm' && $replace_main ) {
$prefix = 'c';
}
if ( $this->Application->prefixRegistred($prefix) ) {
$config = $this->Application->getUnitConfig($prefix);
}
else {
$config = null;
}
if ( in_array($prefix, $skip_prefixes) || !is_object($config) || !$config->getCatalogItem() ) {
continue;
}
$icon = $config->getCatalogTabIcon();
if ( strpos($icon, ':') !== false ) {
list ($icon_module, $icon) = explode(':', $icon, 2);
}
else {
$icon_module = 'core';
}
$label = $config->getSetting($params['title_property']);
$block_params['title'] = $label;
$block_params['prefix'] = $prefix;
$block_params['icon_module'] = $icon_module;
$block_params['icon'] = $icon;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
/**
* Renders inividual catalog tab based on prefix and title_property given
*
* @param Array $params
* @return string
*/
function CatalogTab($params)
{
$config = $this->Application->getUnitConfig($params['prefix']);
$icon = $config->getCatalogTabIcon();
if ( strpos($icon, ':') !== false ) {
list ($icon_module, $icon) = explode(':', $icon, 2);
}
else {
$icon_module = 'core';
}
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
$block_params['icon_module'] = $icon_module;
$block_params['icon'] = $icon;
$block_params['title'] = $config->getSetting($params['title_property']);
return $this->Application->ParseBlock($block_params);
}
/**
* Allows to construct link for opening any type of catalog item selector
*
* @param Array $params
* @return string
*/
function SelectorLink($params)
{
$mode = 'catalog';
if (isset($params['mode'])) { // {catalog, advanced_view}
$mode = $params['mode'];
unset($params['mode']);
}
$params['t'] = 'catalog/item_selector/item_selector_'.$mode;
$params['m_cat_id'] = $this->Application->getBaseCategory();
$default_params = Array('no_amp' => 1, 'pass' => 'all,'.$params['prefix']);
unset($params['prefix']);
$pass_through = Array();
if (isset($params['tabs_dependant'])) { // {yes, no}
$pass_through['td'] = $params['tabs_dependant'];
unset($params['tabs_dependant']);
}
if (isset($params['selection_mode'])) { // {single, multi}
$pass_through['tm'] = $params['selection_mode'];
unset($params['selection_mode']);
}
if (isset($params['tab_prefixes'])) { // {all, none, <comma separated prefix list>}
$pass_through['tp'] = $params['tab_prefixes'];
unset($params['tab_prefixes']);
}
if ($pass_through) {
// add pass_through to selector url if any
$params['pass_through'] = implode(',', array_keys($pass_through));
$params = array_merge($params, $pass_through);
}
// user can override default parameters (except pass_through of course)
$params = array_merge($default_params, $params);
return $this->Application->ProcessParsedTag('m', 'T', $params);
}
function TimeFrame($params)
{
$w = adodb_date('w');
$m = adodb_date('m');
$y = adodb_date('Y');
//FirstDayOfWeek is 0 for Sunday and 1 for Monday
$fdow = $this->Application->ConfigValue('FirstDayOfWeek');
if ( $fdow && $w == 0 ) {
$w = 7;
}
$today_start = adodb_mktime(0, 0, 0, adodb_date('m'), adodb_date('d'), $y);
$first_day_of_this_week = $today_start - ($w - $fdow) * 86400;
$first_day_of_this_month = adodb_mktime(0, 0, 0, $m, 1, $y);
$this_quater = ceil($m / 3);
$this_quater_start = adodb_mktime(0, 0, 0, $this_quater * 3 - 2, 1, $y);
switch ( $params['type'] ) {
case 'last_week_start':
$timestamp = $first_day_of_this_week - 86400 * 7;
break;
case 'last_week_end':
$timestamp = $first_day_of_this_week - 1;
break;
case 'last_month_start':
$timestamp = $m == 1 ? adodb_mktime(0, 0, 0, 12, 1, $y - 1) : adodb_mktime(0, 0, 0, $m - 1, 1, $y);
break;
case 'last_month_end':
$timestamp = $first_day_of_this_month = adodb_mktime(0, 0, 0, $m, 1, $y) - 1;
break;
case 'last_quater_start':
$timestamp = $this_quater == 1 ? adodb_mktime(0, 0, 0, 10, 1, $y - 1) : adodb_mktime(0, 0, 0, ($this_quater - 1) * 3 - 2, 1, $y);
break;
case 'last_quater_end':
$timestamp = $this_quater_start - 1;
break;
case 'last_6_months_start':
$timestamp = $m <= 6 ? adodb_mktime(0, 0, 0, $m + 6, 1, $y - 1) : adodb_mktime(0, 0, 0, $m - 6, 1, $y);
break;
case 'last_year_start':
$timestamp = adodb_mktime(0, 0, 0, 1, 1, $y - 1);
break;
case 'last_year_end':
$timestamp = adodb_mktime(23, 59, 59, 12, 31, $y - 1);
break;
default:
$timestamp = 0;
break;
}
if ( isset($params['format']) ) {
$format = $params['format'];
if ( preg_match("/_regional_(.*)/", $format, $regs) ) {
$lang = $this->Application->recallObject('lang.current');
/* @var $lang LanguagesItem */
$format = $lang->GetDBField($regs[1]);
}
return adodb_date($format, $timestamp);
}
return $timestamp;
}
/**
* Redirect to cache rebuild template, when required by installator
*
* @param Array $params
*/
function CheckPermCache($params)
{
// we have separate session between install wizard and admin console, so store in cache
$global_mark = $this->Application->getDBCache('ForcePermCacheUpdate');
$local_mark = $this->Application->RecallVar('PermCache_UpdateRequired');
if ( $global_mark || $local_mark ) {
$this->Application->RemoveVar('PermCache_UpdateRequired');
$rebuild_mode = $this->Application->ConfigValue('CategoryPermissionRebuildMode');
if ( $rebuild_mode == CategoryPermissionRebuild::SILENT ) {
$updater = $this->Application->makeClass('kPermCacheUpdater');
/* @var $updater kPermCacheUpdater */
$updater->OneStepRun();
$this->Application->HandleEvent(new kEvent('c:OnResetCMSMenuCache'));
}
elseif ( $rebuild_mode == CategoryPermissionRebuild::AUTOMATIC ) {
// update with progress bar
return true;
}
}
return false;
}
/**
* Checks if current protocol is SSL
*
* @param Array $params
* @return int
*/
function IsSSL($params)
{
return (PROTOCOL == 'https://')? 1 : 0;
}
function PrintColumns($params)
{
/* @var $picker_helper kColumnPickerHelper */
$picker_helper = $this->Application->recallObject('ColumnPickerHelper');
$picker_helper->SetGridName($this->Application->GetLinkedVar('grid_name'));
$main_prefix = $this->Application->RecallVar('main_prefix');
$cols = $picker_helper->LoadColumns($main_prefix);
$this->Application->Phrases->AddCachedPhrase('__FREEZER__', '-------------');
$o = '';
if (isset($params['hidden']) && $params['hidden']) {
foreach ($cols['hidden_fields'] as $col) {
$title = $this->Application->Phrase($cols['titles'][$col]);
$o .= "<option value='$col'>".$title;
}
}
else {
foreach ($cols['order'] as $col) {
if (in_array($col, $cols['hidden_fields'])) continue;
$title = $this->Application->Phrase($cols['titles'][$col]);
$o .= "<option value='$col'>".$title;
}
}
return $o;
}
/**
* Allows to set popup size (key - current template name)
*
* @param Array $params
* @return string
* @access protected
*/
protected function SetPopupSize($params)
{
$width = $params['width'];
$height = $params['height'];
if ( $this->Application->GetVar('ajax') == 'yes' ) {
// during AJAX request just output size
die($width . 'x' . $height);
}
if ( !$this->UsePopups($params) ) {
return;
}
$t = $this->Application->GetVar('t');
$sql = 'SELECT *
FROM ' . TABLE_PREFIX . 'PopupSizes
WHERE TemplateName = ' . $this->Conn->qstr($t);
$popup_info = $this->Conn->GetRow($sql);
if ( !$popup_info ) {
// create new popup size record
$fields_hash = Array (
'TemplateName' => $t,
'PopupWidth' => $width,
'PopupHeight' => $height,
);
$this->Conn->doInsert($fields_hash, TABLE_PREFIX . 'PopupSizes');
}
elseif ( $popup_info['PopupWidth'] != $width || $popup_info['PopupHeight'] != $height ) {
// popup found and size in tag differs from one in db -> update in db
$fields_hash = Array (
'PopupWidth' => $width,
'PopupHeight' => $height,
);
$this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'PopupSizes', 'PopupId = ' . $popup_info['PopupId']);
}
}
/**
* Allows to check if popups are generally enabled OR to check for "popup" or "modal" mode is enabled
*
* @param Array $params
* @return bool
*/
function UsePopups($params)
{
if ($this->Application->GetVar('_force_popup')) {
return true;
}
$use_popups = (int)$this->Application->ConfigValue('UsePopups');
if (array_key_exists('mode', $params)) {
$mode_mapping = Array ('popup' => 1, 'modal' => 2);
return $use_popups == $mode_mapping[ $params['mode'] ];
}
return $use_popups;
}
function UseToolbarLabels($params)
{
return (int)$this->Application->ConfigValue('UseToolbarLabels');
}
/**
* Checks if debug mode enabled (optionally) and specified constant is on
*
* @param Array $params
* @return bool
* @todo Could be a duplicate of kMainTagProcessor::ConstOn
*/
function ConstOn($params)
{
$constant_name = $this->SelectParam($params, 'name,const');
$debug_mode = isset($params['debug_mode']) && $params['debug_mode'] ? $this->Application->isDebugMode() : true;
return $debug_mode && kUtil::constOn($constant_name);
}
/**
* Builds link to last template in main frame of admin
*
* @param Array $params
* @return string
*/
function MainFrameLink($params)
{
$persistent = isset($params['persistent']) && $params['persistent'];
if ($persistent && $this->Application->ConfigValue('RememberLastAdminTemplate')) {
// check last_template in persistent session
$last_template = $this->Application->RecallPersistentVar('last_template_popup');
}
else {
// check last_template in session
$last_template = $this->Application->RecallVar('last_template_popup'); // because of m_opener=s there
}
if (!$last_template) {
$params['persistent'] = 1;
return $persistent ? false : $this->MainFrameLink($params);
}
list($index_file, $env) = explode('|', $last_template);
$vars = $this->Application->processQueryString($env, 'pass');
$recursion_templates = Array ('login', 'index', 'no_permission');
if (isset($vars['admin']) && $vars['admin'] == 1) {
// index template doesn't begin recursion on front-end (in admin frame)
$vars['m_theme'] = '';
if (isset($params['m_opener']) && $params['m_opener'] == 'r') {
// front-end link for highlighting purposes
$vars['t'] = 'index';
$vars['m_cat_id'] = $this->Application->getBaseCategory();
}
unset($recursion_templates[ array_search('index', $recursion_templates)]);
}
if (in_array($vars['t'], $recursion_templates)) {
// prevents redirect recursion OR old in-portal pages
$params['persistent'] = 1;
return $persistent ? false : $this->MainFrameLink($params);
}
$vars = array_merge($vars, $params);
$t = $vars['t'];
unset($vars['t'], $vars['persistent']);
// substitute language in link to current (link will work, even when language will be changed)
$vars['m_lang'] = $this->Application->GetVar('m_lang');
return $this->Application->HREF($t, '', $vars, $index_file);
}
/**
* Returns menu frame width or 200 in case, when invalid width specified in config
*
* @param Array $params
* @return string
*/
function MenuFrameWidth($params)
{
$width = (int)$this->Application->ConfigValue('MenuFrameWidth');
return $width > 0 ? $width : 200;
}
function AdminSkin($params)
{
$skin_helper = $this->Application->recallObject('SkinHelper');
/* @var $skin_helper SkinHelper */
return $skin_helper->AdminSkinTag($params);
}
/**
* Prints errors, discovered during mass template compilation
*
* @param $params
* @return string
* @access protected
*/
protected function PrintCompileErrors($params)
{
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
$errors = $this->Application->RecallVar('compile_errors');
if ( !$errors ) {
return '';
}
$ret = '';
$errors = unserialize($errors);
$path_regexp = '/^' . preg_quote(FULL_PATH, '/') . '/';
foreach ($errors as $an_error) {
$block_params = array_merge($block_params, $an_error);
$block_params['file'] = preg_replace($path_regexp, '', $an_error['file'], 1);
$ret .= $this->Application->ParseBlock($block_params);
}
$this->Application->RemoveVar('compile_errors');
return $ret;
}
function CompileErrorCount($params)
{
$errors = $this->Application->RecallVar('compile_errors');
if (!$errors) {
return 0;
}
return count( unserialize($errors) );
}
/**
* Detects if given exception isn't one caused by tag error
*
* @param Array $params
* @return string
* @access protected
*/
protected function IsParserException($params)
{
return mb_strtolower($params['class']) == 'parserexception';
}
function ExportData($params)
{
$export_helper = $this->Application->recallObject('CSVHelper');
/* @var $export_helper kCSVHelper */
$result = $export_helper->ExportData( $this->SelectParam($params, 'var,name,field') );
return ($result === false) ? '' : $result;
}
function ImportData($params)
{
$import_helper = $this->Application->recallObject('CSVHelper');
/* @var $import_helper kCSVHelper */
$result = $import_helper->ImportData( $this->SelectParam($params, 'var,name,field') );
return ($result === false) ? '' : $result;
}
function PrintCSVNotImportedLines($params)
{
$import_helper = $this->Application->recallObject('CSVHelper');
/* @var $import_helper kCSVHelper */
return $import_helper->GetNotImportedLines();
}
/**
* Returns input field name to
* be placed on form (for correct
* event processing)
*
* @param Array $params
* @return string
* @access public
*/
function InputName($params)
{
list($id, $field) = $this->prepareInputName($params);
$ret = $this->getPrefixSpecial().'[0]['.$field.']'; // 0 always, as has no idfield
if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/');
return $ret;
}
/**
* Returns list of all backup file dates formatted
* in passed block
*
* @param Array $params
* @return string
* @access public
*/
function PrintBackupDates($params)
{
$backup_helper = $this->Application->recallObject('BackupHelper');
/* @var $backup_helper BackupHelper */
$ret = '';
$dates = $backup_helper->getBackupFiles();
foreach ($dates as $date) {
$params['backuptimestamp'] = $date['filedate'];
$params['backuptime'] = date('F j, Y, g:i a', $date['filedate']);
$params['backupsize'] = round($date['filesize'] / 1024 / 1024, 2); // MBytes
$ret .= $this->Application->ParseBlock($params);
}
return $ret;
}
/**
* Returns phpinfo() output
*
* @param Array $params
* @return string
*/
function PrintPHPinfo($params)
{
ob_start();
phpinfo();
return ob_get_clean();
}
function PrintSqlCols($params)
{
$ret = '';
$block = $params['render_as'];
$a_data = unserialize($this->Application->GetVar('sql_rows'));
$a_row = current($a_data);
foreach ($a_row AS $col => $value) {
$ret .= $this->Application->ParseBlock(Array ('name' => $block, 'value' => $col));
}
return $ret;
}
function PrintSqlRows($params)
{
$ret = '';
$block = $params['render_as'];
$a_data = unserialize($this->Application->GetVar('sql_rows'));
foreach ($a_data as $a_row) {
$cells = '';
foreach ($a_row as $value) {
$cells .= '<td>' . kUtil::escape($value, kUtil::ESCAPE_HTML) . '</td>';
}
$ret .= $this->Application->ParseBlock(Array ('name' => $block, 'cells' => $cells));
}
return $ret;
}
/**
* Prints available and enabled import sources using given block
*
* @param Array $params
* @return string
*/
function PrintImportSources($params)
{
$sql = 'SELECT *
FROM ' . TABLE_PREFIX . 'ImportScripts
WHERE (Status = ' . STATUS_ACTIVE . ') AND (Type = "CSV")';
$import_sources = $this->Conn->Query($sql);
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
$ret = '';
foreach ($import_sources as $import_source) {
$block_params['script_id'] = $import_source['ImportId'];
$block_params['script_module'] = mb_strtolower($import_source['Module']);
$block_params['script_name'] = $import_source['Name'];
$block_params['script_prefix'] = $import_source['Prefix'];
$block_params['module_path'] = $this->Application->findModule('Name', $import_source['Module'], 'Path');
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
/**
* Checks, that new window should be opened in "incs/close_popup" template instead of refreshing parent window
*
* @param Array $params
* @return bool
*/
function OpenNewWindow($params)
{
if (!$this->UsePopups($params)) {
return false;
}
$diff = array_key_exists('diff', $params) ? $params['diff'] : 0;
$wid = $this->Application->GetVar('m_wid');
$stack_name = rtrim('opener_stack_' . $wid, '_');
$opener_stack = $this->Application->RecallVar($stack_name);
$opener_stack = $opener_stack ? unserialize($opener_stack) : Array ();
return count($opener_stack) >= 2 - $diff;
}
/**
* Allows to dynamically change current language in template
*
* @param Array $params
*/
function SetLanguage($params)
{
$this->Application->SetVar('m_lang', $params['language_id']);
$this->Application->Phrases->Init('phrases', '', $params['language_id']);
}
/**
* Performs HTTP Authentification for administrative console
*
* @param Array $params
* @return bool
*/
function HTTPAuth($params)
{
if ( !$this->Application->ConfigValue('UseHTTPAuth') ) {
// http authentification not required
return true;
}
$super_admin_ips = defined('SA_IP') ? SA_IP : false;
$auth_bypass_ips = $this->Application->ConfigValue('HTTPAuthBypassIPs');
if ( ($auth_bypass_ips && kUtil::ipMatch($auth_bypass_ips)) || ($super_admin_ips && kUtil::ipMatch($super_admin_ips)) ) {
// user ip is in ip bypass list
return true;
}
if ( !array_key_exists('PHP_AUTH_USER', $_SERVER) ) {
// ask user to authentificate, when not authentificated before
return $this->_httpAuthentificate();
}
else {
// validate user credentials (browsers remembers user/password
// and sends them each time page is visited, so no need to save
// authentification result in session)
if ( $this->Application->ConfigValue('HTTPAuthUsername') != $_SERVER['PHP_AUTH_USER'] ) {
// incorrect username
return $this->_httpAuthentificate();
}
$password_formatter = $this->Application->recallObject('kPasswordFormatter');
/* @var $password_formatter kPasswordFormatter */
if ( !$password_formatter->checkPasswordFromSetting('HTTPAuthPassword', $_SERVER['PHP_AUTH_PW']) ) {
// incorrect password
return $this->_httpAuthentificate();
}
}
return true;
}
/**
* Ask user to authentificate
*
* @return bool
*/
function _httpAuthentificate()
{
$realm = strip_tags( $this->Application->ConfigValue('Site_Name') );
header('WWW-Authenticate: Basic realm="' . $realm . '"');
header('HTTP/1.0 401 Unauthorized');
return false;
}
/**
* Checks, that we are using memory cache
*
* @param Array $params
* @return bool
*/
function MemoryCacheEnabled($params)
{
return $this->Application->isCachingType(CACHING_TYPE_MEMORY);
}
/**
* Generates HTML for additional js and css files inclusion in accordance to selected editor language
*
* @param Array $params
* @return string
* @access protected
*/
protected function IncludeCodeMirrorFilesByLanguage($params)
{
$ret = '';
$language = $params['language'];
$language_map = Array (
'application/x-httpd-php' => Array (
'htmlmixed.js', 'xml.js', 'javascript.js', 'css.js', 'clike.js', 'php.js'
),
'text/html' => Array (
'xml.js', 'javascript.js', 'css.js', 'htmlmixed.js'
)
);
if ( !isset($language_map[$language]) ) {
$language_map[$language] = Array ($language . '.js');
}
foreach ($language_map[$language] as $filename) {
$ret .= $this->_includeCodeMirrorFile($filename, $params);
}
return $ret;
}
/**
* Generates code for one CodeMirror additional file inclusion
*
* @param string $filename
* @param Array $params
* @return string
* @access protected
* @throws InvalidArgumentException
*/
protected function _includeCodeMirrorFile($filename, $params)
{
static $included = Array ();
$name = pathinfo($filename, PATHINFO_FILENAME);
$extension = pathinfo($filename, PATHINFO_EXTENSION);
if ( $extension != 'js' && $extension != 'css' ) {
throw new InvalidArgumentException('Extension "' . $extension . '" not supported');
}
if ( isset($included[$filename]) ) {
return '';
}
$included[$filename] = 1;
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['render_as'];
$block_params['resource_extension'] = $extension;
$block_params['resource_file'] = $name . '/' . $filename;
return $this->Application->ParseBlock($block_params);
}
}
\ No newline at end of file
Index: branches/5.3.x/core/admin_templates/tree.tpl
===================================================================
--- branches/5.3.x/core/admin_templates/tree.tpl (revision 15906)
+++ branches/5.3.x/core/admin_templates/tree.tpl (revision 15907)
@@ -1,196 +1,196 @@
<inp2:m_Set skip_last_template="1"/>
<inp2:m_include t="incs/header" nobody="yes" noform="yes"/>
<inp2:m_NoDebug/>
<body class="tree-body" onresize="onTreeFrameResize();">
<script type="text/javascript">
var $save_timer = null,
$last_width = parseInt('<inp2:m_GetConfig name="MenuFrameWidth"/>');
function credits(url) {
openwin(url, 'credits', 280, 520);
}
function onTreeFrameResize() {
var $frameset = $('#sub_frameset', window.parent.document);
if (!$frameset.length) {
return ;
}
var $width = $frameset.attr('cols').split(',')[0];
if (($width <= 0) || ($width == $last_width)) {
// don't save zero width
return ;
}
clearTimeout($save_timer);
$save_timer = setTimeout( function() {saveFrameWidth($width);}, 2000);
}
function saveFrameWidth($width) {
getFrame('head').$FrameResizer.OpenWidth = $width;
$.get(
'<inp2:m_Link template="index" adm_event="OnSaveMenuFrameWidth" pass="m,adm" js_escape="1" no_amp="1"/>',
{width: $width}
);
$last_width = $width;
}
</script>
<script type="text/javascript" src="<inp2:m_Compress files='js/tree.js'/>"></script>
<table style="height: 100%; width: 100%; border-right: 1px solid #777; border-bottom: 1px solid #777;">
<tr>
<td colspan="2" style="vertical-align: top; padding: 5px;">
<inp2:m_DefineElement name="xml_node" icon_module="">
<inp2:m_if check="m_ParamEquals" param="children_count" value="0">
- <item href="<inp2:m_param name='section_url' js_escape='1'/>" priority="<inp2:m_param name='priority'/>" onclick="<inp2:m_param name='onclick' js_escape='1'/>" icon="<inp2:$SectionPrefix_ModulePath module='$icon_module'/>img/icons/icon24_<inp2:m_param name='icon'/>.png"<inp2:m_if check="m_Param" name="debug_only"> debug_only="1"</inp2:m_if>><inp2:m_phrase name="$label" escape="1"/></item>
+ <item href="<inp2:m_param name='section_url' html_escape='1'/>" priority="<inp2:m_param name='priority' html_escape='1'/>" onclick="<inp2:m_param name='onclick' html_escape='1'/>" icon="<inp2:$SectionPrefix_ModulePath module='$icon_module'/>img/icons/icon24_<inp2:m_param name='icon'/>.png"<inp2:m_if check="m_Param" name="debug_only"> debug_only="1"</inp2:m_if>><inp2:m_phrase name="$label" html_escape="1"/></item>
<inp2:m_else/>
- <folder href="<inp2:m_param name='section_url' js_escape='1'/>" priority="<inp2:m_param name='priority'/>" container="<inp2:m_param name='container'/>" onclick="<inp2:m_param name='onclick' js_escape='1'/>" name="<inp2:m_phrase name='$label' escape='1'/>" icon="<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name='icon'/>.png" load_url="<inp2:m_param name='late_load' js_escape='1'/>"<inp2:m_if check="m_Param" name="debug_only"> debug_only="1"</inp2:m_if>><inp2:adm_PrintSections render_as="xml_node" section_name="$section_name"/></folder>
+ <folder href="<inp2:m_param name='section_url' html_escape='1'/>" priority="<inp2:m_param name='priority' html_escape='1'/>" container="<inp2:m_param name='container' html_escape='1'/>" onclick="<inp2:m_param name='onclick' html_escape='1'/>" name="<inp2:m_phrase name='$label' html_escape='1'/>" icon="<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name='icon'/>.png" load_url="<inp2:m_param name='late_load' html_escape='1'/>"<inp2:m_if check="m_Param" name="debug_only"> debug_only="1"</inp2:m_if>><inp2:adm_PrintSections render_as="xml_node" section_name="$section_name"/></folder>
</inp2:m_if>
</inp2:m_DefineElement>
<table class="tree">
<tbody id="tree">
</tbody>
</table>
<script type="text/javascript">
var TREE_ICONS_PATH = 'img/tree';
var TREE_SHOW_PRIORITY = <inp2:m_if check="adm_ConstOn" name="DBG_SHOW_TREE_PRIORITY" debug_mode="1">1<inp2:m_else/>0</inp2:m_if>;
var TREE_LOADING_NODE = {
text: '<inp2:m_Phrase name="la_title_Loading" no_editing="1"/>',
icon: '<inp2:adm_ModulePath module="core"/>img/icons/icon24_loading.gif'
};
<inp2:m_DefineElement name="root_node">
- var the_tree = new TreeFolder('tree', '<inp2:m_param name="label" js_escape="1"/>', '<inp2:m_param name="section_url" js_escape="1"/>', '<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.png', null, null, '<inp2:m_param name="priority"/>', '<inp2:m_param name="container"/>');
+ var the_tree = new TreeFolder('tree', '<inp2:m_param name="label" js_escape="1"/>', '<inp2:m_param name="section_url" js_escape="1"/>', '<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.png', null, null, '<inp2:m_param name="priority" js_escape='1'/>', '<inp2:m_param name="container" js_escape="1"/>');
</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>');
+ the_tree.AddFromXML('<tree><inp2:adm_PrintSections render_as="xml_node" section_name="in-portal:root" js_escape="1"/></tree>');
<inp2:m_if check="adm_MainFrameLink">
var fld = the_tree.locateItemByURL('<inp2:adm_MainFrameLink m_opener="r" no_amp="1"/>');
if (fld) {
fld.highLight();
}
else {
the_tree.highLight();
}
<inp2:m_else/>
the_tree.highLight();
</inp2:m_if>
</script>
</td>
</tr>
</table>
<script type="text/javascript">
function checkCatalog($cat_id) {
var $ret = checkEditMode(false);
var $right_frame = getFrame('main');
if ($ret && $right_frame.$is_catalog) {
$right_frame.$Catalog.go_to_cat($cat_id);
return 1; // this opens folder, but disables click
}
return $ret;
}
function setCatalogTab($prefix) {
var $ret = checkEditMode(false);
if ($ret) {
var $right_frame = getFrame('main');
var $catalog_type = (typeof $right_frame.$Catalog != 'undefined') ? $right_frame.$Catalog.type : '';
// highlight "Structure & Data" node, when one of it's shortcut nodes are clicked
<inp2:m_DefineElement name="section_url_element"><inp2:m_param name="section_url"/></inp2:m_DefineElement>
var $structure_node = the_tree.locateItemByURL('<inp2:adm_PrintSection render_as="section_url_element" section_name="in-portal:browse"/>');
if ($catalog_type == 'AdvancedView') {
$right_frame.$Catalog.switchTab($prefix);
return $structure_node; // this opens folder, but disables click
}
// this disabled click and causes other node to be highlighted
return $structure_node;
}
return $ret;
}
function checkEditMode($reset_toolbar)
{
if (!isset($reset_toolbar)) {
$reset_toolbar = true;
}
if ($reset_toolbar) {
getFrame('head').$('#extra_toolbar').html('');
}
var $phrase = '<inp2:m_Phrase label="la_EditingInProgress" js_escape="1"/>';
if (getFrame('main').$edit_mode) {
return confirm($phrase) ? true : false;
}
return true;
}
function ReloadFolder(url, with_late_load)
{
if (!with_late_load) with_late_load = false;
var fld = the_tree.locateItemByURL(url.replace(/&amp;/g, '&'), with_late_load);
if (fld) {
fld.reload();
}
}
function ShowStructure($url, $visible)
{
var fld = the_tree.locateItemByURL($url, true);
if (fld) {
if ($visible) {
fld.expand();
}
else {
fld.collapse();
}
}
}
function SyncActive(url) {
var fld = the_tree.locateItemByURL(url);
if (fld) {
fld.highLight();
}
}
<inp2:m_DefineElement name="container_node">
var $container_node = the_tree.locateItemByURL('<inp2:m_param name="section_url" js_escape="1"/>');
$container_node.Container = true;
</inp2:m_DefineElement>
<inp2:m_DefineElement name="container_node_fix">
<inp2:m_if check="m_GetConfig" name="$config_var">
<inp2:m_ifnot check="m_IsDebugMode">
<inp2:adm_PrintSection render_as="container_node" section_name="$section"/>
</inp2:m_ifnot>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_RenderElement name="container_node_fix" config_var="DebugOnlyFormConfigurator" section="in-portal:forms"/>
<inp2:m_RenderElement name="container_node_fix" config_var="DebugOnlyPromoBlockGroupConfigurator" section="in-portal:promo_block_groups"/>
</script>
<!--## when form is on top, then 100% height is broken ##-->
<inp2:m_RenderElement name="kernel_form"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: branches/5.3.x/core/admin_templates/js/toolbar.js
===================================================================
--- branches/5.3.x/core/admin_templates/js/toolbar.js (revision 15906)
+++ branches/5.3.x/core/admin_templates/js/toolbar.js (revision 15907)
@@ -1,420 +1,415 @@
function ToolBarButton(title, alt, onclick, $hidden, prefix)
{
this.Title = title || '';
this.TranslateLink = false;
this.CheckTitleModule();
- this.Alt = RemoveTranslationLink(alt || '');
+ this.Alt = RemoveTranslationLink(alt || '', false);
if (this.Alt != alt) {
this.TranslateLink = alt || '';
- this.TranslateLink = this.TranslateLink.replace(/&lt;a href=&quot;(.*?)&quot;.*&gt;(.*?)&lt;\/a&gt;/g, '$1');
+ this.TranslateLink = this.TranslateLink.replace(/<a href="(.*?)".*>(.*?)<\/a>/g, '$1');
}
if (this.Alt.match(/(.*)::(.*)/)) {
this.Alt = RegExp.$1;
this.Label = RegExp.$2
}
else {
this.Label = this.Alt;
}
if ( $.isFunction(onclick) ) {
this.onClick = onclick;
}
else {
this.onClick = function() {
this.runFunction(this.Title);
}
}
this.imgObject = null;
this.Enabled = true;
this.Hidden = $hidden ? true : false;
this.ToolBar = null;
this.Prefix = prefix ? prefix : '';
this.Separator = false;
// all buttons are read-only until page is fully loaded!
this.ReadOnly = true;
}
ToolBarButton.prototype.CheckTitleModule = function()
{
if (this.Title.match(/([^:]+):(.*)$/)) {
// has module set directly
this.Title = RegExp.$2;
this.Module = RegExp.$1.toLowerCase();
if (this.Module == 'in-portal') {
this.Module = 'core';
}
}
else {
// use default module
this.Module = 'core';
}
}
ToolBarButton.prototype.IconsPath = function($module_path)
{
if ( $module_path === undefined ) {
$module_path = this.Module;
}
if ( $module_path != 'core' ) {
$module_path = 'modules/' + $module_path;
}
return this.ToolBar.IconPath.replace('#MODULE#', $module_path) + 'toolbar/';
}
ToolBarButton.prototype.GetHTML = function() {
var add_style = this.ToolBar.ButtonStyle ? 'style="' + this.ToolBar.ButtonStyle + '"' : '',
o = '<div class="toolbar-button" id="' + this.GetToolID('div') + '" ' + add_style + '>';
o += '<img class="' + this.Module + '-toolbar-sprite" id="' + this.GetToolID() + '" width="' + this.ToolBar.IconSize.w + '" height="' + this.ToolBar.IconSize.h + '" src="' + this.IconsPath('core') + '../spacer.gif" title="' + this.Alt + '&nbsp;">';
if ( this.ToolBar.UseLabels ) {
o += '<br/>' + this.Label;
}
o += '</div>'
return o;
}
ToolBarButton.prototype.GetToolID = function(item) {
if ( item === undefined ) {
item = 'tool';
}
if ( this.Prefix == '' ) {
return item == 'tool' ? this.Module + '-tb-' + this.Title : item + '_' + this.Title;
}
return item + '_[' + this.Prefix + '][' + this.Title + ']'
}
ToolBarButton.prototype.Init = function() {
img = document.getElementById(this.GetToolID());
this.imgObject = img;
this.Container = document.getElementById(this.GetToolID('div')) ? document.getElementById(this.GetToolID('div')) : false;
this.Container.btn = this;
img.btn = this;
this.SetOnMouseOver();
this.SetOnMouseOut();
this.SetOnClick();
this.SetOnRightClick()
if (this.Hidden) this.Hide();
}
ToolBarButton.prototype.EditTitle = function() {
- if (this.TranslateLink !== false && !this.ReadOnly) {
- var $links = this.TranslateLink;
+ if ( this.TranslateLink === false || this.ReadOnly ) {
+ return true;
+ }
- $links = $links.split('::');
- var $i = 0;
- while ($i < $links.length) {
- var $link = $links[$i];
- if ($link.match(/(javascript:|http:\/\/)(.*)/)) {
- var $link_type = RegExp.$1;
- $link = RegExp.$2.replace(/&#[0]{0,1}39;/g, '"');
- if ($link_type == 'javascript:') {
- eval($link);
- }
- else {
- window.location.href = 'http://' + $link;
- }
+ var $link = '',
+ $links = this.TranslateLink.split('::');
- // edit one phrase at a time
- break;
- }
- $i++;
- }
+ // edit one phrase at a time
+ for ( var $i = 0; $i < $links.length; $i++ ) {
+ $link = htmlspecialchars_decode($links[$i]);
- return false;
+ if ( $link.match(/^javascript:(.*)/) ) {
+ eval(RegExp.$1);
+ break;
+ }
+ else if ( $link.match(/^http:\/\/(.*)/) ) {
+ window.location.href = 'http://' + RegExp.$1;
+ break;
+ }
}
- return true;
+ return false;
}
ToolBarButton.prototype.SetOnMouseOver = function() {
this.Container.onmouseover = function() {
$(this.btn.imgObject).addClass('hover');
this.className = 'toolbar-button-over';
};
}
ToolBarButton.prototype.SetOnMouseOut = function() {
this.Container.onmouseout = function() {
$(this.btn.imgObject).removeClass('hover');
this.className = 'toolbar-button';
};
}
ToolBarButton.prototype.runFunction = function($name) {
if ( window[$name] !== undefined && $.isFunction( window[$name] ) ) {
window[$name]();
}
}
ToolBarButton.prototype.SetOnClick = function() {
// we have SetOnMouseOut for this ???
/*this.Container.onmouseout = function() {
this.btn.imgObject.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '.gif';
};*/
this.Container.inClick = false;
if (typeof(this.onClick) != 'function') {
this.Container.onclick = function() {
if (this.inClick || this.btn.ReadOnly) return;
this.inClick = true;
this.runFunction(this.btn.Title);
this.inClick = false;
}
}
else {
this.Container.onclick = function() {
if (this.inClick || this.btn.ReadOnly) return;
this.inClick = true;
this.btn.onClick();
this.inClick = false;
}
}
// the following lines are correct, as long as mozilla understands 'pointer', but IE 'hand',
// do not change the order of these lines!
if (is.ie6up || is.gecko) {
this.Container.style.cursor = 'pointer';
}
else {
// somehow set cursor hand for IE 5/ 5.5
// this.imgObject.style = 'cursor: hand';
}
}
ToolBarButton.prototype.SetOnRightClick = function() {
this.Container.oncontextmenu = function() {
return this.btn.EditTitle();
}
}
ToolBarButton.prototype.Disable = function() {
if ( !this.Enabled ) return;
$(this.imgObject).addClass('disabled');
this.Container.onmouseover = null;
this.Container.onmouseout = null;
this.Container.onclick = null;
this.Container.style.cursor = 'default';
this.Enabled = false;
this.Container.className = 'toolbar-button-disabled'
}
ToolBarButton.prototype.Enable = function() {
if (this.Enabled) return;
$(this.imgObject).removeClass('hover disabled');
this.SetOnMouseOver();
this.SetOnMouseOut();
this.SetOnClick();
this.Enabled = true;
this.Container.className = 'toolbar-button'
}
ToolBarButton.prototype.Hide = function() {
this.Container.style.display = 'none';
this.Hidden = true;
}
ToolBarButton.prototype.Show = function() {
this.Container.style.display = '';
this.Hidden = false;
}
/* ----------- */
function ToolBarSeparator(title, $hidden) //extends ToolBarButton
{
this.Title = title;
this.Hidden = $hidden ? true : false;
this.Separator = true;
}
ToolBarSeparator.prototype = new ToolBarButton;
ToolBarSeparator.prototype.GetHTML = function() {
var add_style = this.ToolBar.ButtonStyle ? 'style="' + this.ToolBar.ButtonStyle + '"' : '';
var padding = this.ToolBar.UseLabels ? '12px' : '2px'
return '<div id="' + this.GetToolID('div') + '" class="toolbar-button" style="padding-top: ' + padding + '; height: 32px;" ' + add_style + '><img id="' + this.GetToolID() + '" src="' + this.IconsPath() + 'tool_divider.gif"></div>';
}
ToolBarSeparator.prototype.Init = function() {
img = document.getElementById(this.Module + '-tb-' + this.Title);
this.Container = document.getElementById(this.GetToolID('div')) ? document.getElementById(this.GetToolID('div')) : false;
this.imgObject = img;
img.btn = this;
if (this.Hidden) {
this.Hide();
}
}
ToolBarSeparator.prototype.Enable = function() { }
ToolBarSeparator.prototype.Disable = function() { }
/* ----------- */
function ToolBarMarkup(title, html) //extends ToolBarButton
{
this.Title = title;
this.HTML = html;
}
ToolBarMarkup.prototype = new ToolBarButton;
ToolBarMarkup.prototype.GetHTML = function() {
return this.HTML;
}
ToolBarMarkup.prototype.Init = function() { }
ToolBarMarkup.prototype.Enable = function() { }
ToolBarMarkup.prototype.Disable = function() { }
/* ----------- */
function ToolBar(icon_prefix, $module, $image_path)
{
this.Module = $module ? $module : 'core';
this.IconPrefix = icon_prefix ? icon_prefix : 'tool_';
this.IconSize = {w:32,h:32};
this.Buttons = {};
this.UseLabels = typeof($use_toolbarlabels) != 'undefined' ? $use_toolbarlabels : false;
if ( $image_path !== undefined ) {
this.IconPath = $image_path;
}
else if ( typeof(img_path) != 'undefined' ) {
this.IconPath = img_path;
}
else {
this.IconPath = '';
// alert('error: toolbar image path not set');
}
}
ToolBar.prototype.AddButton = function(a_button)
{
if ($visible_toolbar_buttons === true || in_array(a_button.Title, $visible_toolbar_buttons) || a_button.Separator) {
a_button.ToolBar = this;
this.Buttons[a_button.Title] = a_button;
}
}
ToolBar.prototype._removeSeparators = function()
{
var $i, $buttons = [], $separator = false;
// 1. convert to 0-based array && filter out trailing separators from the middle
$.each(this.Buttons, function ($button_title, $button) {
if ( $separator && $button.Separator ) {
// duplicate separator - skip
return true;
}
// remember separator status
$buttons.push($button);
$separator = $button.Separator;
});
// 2. remove first separator
if ( $buttons.length && $buttons[0].Separator ) {
$buttons.shift();
}
// 3. remove last separator
if ( $buttons.length && $buttons[$buttons.length - 1].Separator ) {
$buttons.pop();
}
// 4. convert to associative array
this.Buttons = {};
for ($i = 0; $i < $buttons.length; $i++) {
this.Buttons[$buttons[$i].Title] = $buttons[$i];
}
}
ToolBar.prototype.Render = function($container)
{
// remove duplicate separators or separators at the end of button list
this._removeSeparators();
if ($container) {
var tmp = '';
for (var i in this.Buttons) {
btn = this.Buttons[i];
tmp += btn.GetHTML();
}
$container.innerHTML = tmp; // container will contain only buttons
// init all buttons after because objects are not yet created directly after assigning to innerHTML
for (var i in this.Buttons) {
btn = this.Buttons[i];
btn.Init();
}
}
else {
for (var i in this.Buttons) {
btn = this.Buttons[i];
document.write( btn.GetHTML() );
btn.Init();
}
}
var $me = this;
$(document).ready(
function () {
for (var $button_name in $me.Buttons) {
$me.Buttons[$button_name].ReadOnly = false;
}
}
);
}
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';
}
Index: branches/5.3.x/core/admin_templates/js/script.js
===================================================================
--- branches/5.3.x/core/admin_templates/js/script.js (revision 15906)
+++ branches/5.3.x/core/admin_templates/js/script.js (revision 15907)
@@ -1,1937 +1,1946 @@
if ( !( isset($init_made) && $init_made ) ) {
var Application = new kApplication();
var Grids = [],
GridScrollers = [],
Toolbars = [],
$Menus = [],
$ViewMenus = [],
$nls_menus = [],
$MenuNames = [];
var $CKEditors = {}; // input name VS ck options mapping
var $CodeMirrorEditors = {}; // input name VS code mirror options mapping
var $form_name = 'kernel_form';
if ( !$fw_menus ) {
var $fw_menus = new Array();
}
var $env = '',
submitted = false,
unload_legal = false,
$edit_mode = false,
$init_made = true; // in case of double inclusion of script.js :)
// hook processing
var hBEFORE = 1; // this is const, but including this twice causes errors
var hAFTER = 2; // this is const, but including this twice causes errors
replaceFireBug();
}
function use_popups($prefix_special, $event, $mode) {
if ( $mode === undefined || $mode == 'popup' ) {
return $use_popups;
}
return $modal_windows;
}
function getArrayValue() {
var $value = arguments[0];
var $current_key = 0;
$i = 1;
while ($i < arguments.length) {
$current_key = arguments[$i];
if ( isset($value[$current_key]) ) {
$value = $value[$current_key];
}
else {
return false;
}
$i++;
}
return $value;
}
function setArrayValue() {
// first argument - array, other arguments - keys (arrays too), last argument - value
var $array = arguments[0];
var $current_key = 0;
$i = 1;
while ($i < arguments.length - 1) {
$current_key = arguments[$i];
if ( !isset($array[$current_key]) ) {
$array[$current_key] = new Array();
}
$array = $array[$current_key];
$i++;
}
$array[$array.length] = arguments[arguments.length - 1];
}
function resort_grid($prefix_special, $field, $ajax) {
set_form($prefix_special, $ajax);
set_hidden_field($prefix_special + '_Sort1', $field);
submit_event($prefix_special, 'OnSetSorting', null, null, $ajax);
}
function direct_sort_grid($prefix_special, $field, $direction, $field_pos, $ajax) {
if ( !isset($field_pos) ) {
$field_pos = 1;
}
set_form($prefix_special, $ajax);
set_hidden_field($prefix_special + '_Sort' + $field_pos, $field);
set_hidden_field($prefix_special + '_Sort' + $field_pos + '_Dir', $direction);
set_hidden_field($prefix_special + '_SortPos', $field_pos);
submit_event($prefix_special, 'OnSetSortingDirect', null, null, $ajax);
}
function reset_sorting($prefix_special, $ajax) {
submit_event($prefix_special, 'OnResetSorting', null, null, $ajax);
}
function set_per_page($prefix_special, $per_page, $ajax) {
set_form($prefix_special, $ajax);
set_hidden_field($prefix_special + '_PerPage', $per_page);
submit_event($prefix_special, 'OnSetPerPage', null, null, $ajax);
}
function set_refresh_interval($prefix_special, $refresh_interval, $ajax) {
set_form($prefix_special, $ajax);
set_hidden_field('refresh_interval', $refresh_interval);
submit_event($prefix_special, 'OnSetAutoRefreshInterval', null, null, $ajax);
}
function submit_event(prefix_special, event, t, form_action, $ajax) {
if ( !Application.processHooks(prefix_special + ':' + event) ) {
return false;
}
if ( $ajax ) {
return $Catalog.submit_event(prefix_special, event, t);
}
if ( event ) {
set_hidden_field('events[' + prefix_special + ']', event);
}
if ( t ) {
set_hidden_field('t', t);
}
if ( form_action ) {
var old_env = '';
if ( !form_action.match(/\?/) ) {
document.getElementById($form_name).action.match(/.*(\?.*)/);
old_env = RegExp.$1;
}
document.getElementById($form_name).action = form_action + old_env;
}
submit_kernel_form();
// reset remove special mark (otherwise all future events will have special removed too)
set_hidden_field('remove_specials[' + prefix_special + ']', null);
}
function submit_event_ajax(prefix_special, event, t, $callback) {
if ( !Application.processHooks(prefix_special + ':' + event) ) {
return false;
}
if ( event ) {
set_hidden_field('events[' + prefix_special + ']', event);
}
if ( t ) {
set_hidden_field('t', t);
}
var $form = $('#kernel_form'),
$from_params = $form.serialize();
$.post($form.attr('action'), $from_params, $callback);
// reset remove special mark (otherwise all future events will have special removed too)
set_hidden_field('events[' + prefix_special + ']', '');
set_hidden_field('remove_specials[' + prefix_special + ']', null);
}
function submit_action($url, $action) {
$form = document.getElementById($form_name);
$form.action = $url;
set_hidden_field('Action', $action);
submit_kernel_form();
}
function show_form_data() {
var $kf = document.getElementById($form_name);
$ret = '';
for (var i in $kf.elements) {
$elem = $kf.elements[i];
$ret += $elem.id + ' = ' + $elem.value + "\n";
}
alert($ret);
}
function submit_kernel_form() {
if ( submitted ) {
return;
}
submitted = true;
unload_legal = true; // bug: when opening new popup from this window, then this window is not refreshed and this mark stays forever
var $form = document.getElementById($form_name);
if ( $.isFunction($form.onsubmit) ) {
$form.onsubmit();
}
$($form).submit();
$form.target = '';
set_hidden_field('t', t);
// window.setTimeout(function() {submitted = false}, 500);
}
function set_event(prefix_special, event) {
var event_field = document.getElementById('events[' + prefix_special + ']');
if ( isset(event_field) ) {
event_field.value = event;
}
}
function isset(variable) {
if ( variable == null ) {
return false;
}
return (typeof(variable) == 'undefined') ? false : true;
}
function in_array(needle, haystack) {
return array_search(needle, haystack) != -1;
}
function array_search(needle, haystack) {
for (var i = 0; i < haystack.length; i++) {
if ( haystack[i] == needle ) return i;
}
return -1;
}
function print_pre(variable, msg) {
if ( !isset(msg) ) {
msg = '';
}
var s = msg;
for (prop in variable) {
s += prop + " => " + variable[prop] + "\n";
}
alert(s);
}
function go_to_page($prefix_special, $page, $ajax) {
set_form($prefix_special, $ajax);
set_hidden_field($prefix_special + '_Page', $page);
submit_event($prefix_special, 'OnSetPage', 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/index.php', 'popups/editor');
$url = $url + '&TargetForm=' + TargetForm + '&TargetField=' + TargetField + '&destform=popup';
if ( extra_env.length > 0 ) {
$url += extra_env;
}
openwin($url, 'html_edit', 800, 575);
}
// in-portal compatibility functions: end
function InitTranslator(prefix, field, t, multi_line, $before_callback) {
var $window_name = 'select_' + t.replace(/(\/|-)/g, '_');
var $options = {
onAfterShow: function ($popup_window) {
if ( $modal_windows ) {
getFrame('main').initTranslatorOnAfterShow(prefix, field, t, multi_line, $before_callback);
}
else {
initTranslatorOnAfterShow(prefix, field, t, multi_line, $before_callback, $popup_window);
}
}
};
openwin('', $window_name, 750, 400, $options);
}
function initTranslatorOnAfterShow(prefix, field, t, multi_line, $before_callback, $popup_window) {
var $window_name = 'select_' + t.replace(/(\/|-)/g, '_');
$popup_window = onAfterWindowOpen($window_name, undefined, $popup_window);
if ( $popup_window === false ) {
// iframe onload happens on frame content change too -> don't react on it
return;
}
var $opener = getWindowOpener($popup_window);
var $prev_opener = get_hidden_field('m_opener');
$opener.set_hidden_field('m_opener', 'p');
$opener.set_hidden_field('translator_wnd_name', $window_name);
$opener.set_hidden_field('translator_field', field);
$opener.set_hidden_field('translator_t', t);
$opener.set_hidden_field('translator_prefixes', prefix);
$opener.set_hidden_field('translator_multi_line', isset(multi_line) ? multi_line : 0);
if ( $.isFunction($before_callback) ) {
$before_callback($opener);
}
$opener.document.getElementById($opener.$form_name).target = $window_name;
var split_prefix = prefix.split(',');
$opener.submit_event(split_prefix[0], 'OnPreSaveAndOpenTranslator');
$opener.set_hidden_field('m_opener', $prev_opener);
$opener.submitted = false;
}
function PreSaveAndOpenTranslator(prefix, field, t, multi_line) {
InitTranslator(prefix, field, t, multi_line);
}
function PreSaveAndOpenTranslatorCV(prefix, field, t, resource_id, multi_line) {
InitTranslator(
prefix, field, t, multi_line,
function ($opener) {
$opener.set_hidden_field('translator_resource_id', resource_id);
}
);
}
function openTranslator(prefix, field, url, wnd) {
var $kf = document.getElementById($form_name);
set_hidden_field('trans_prefix', prefix);
set_hidden_field('trans_field', field);
set_hidden_field('events[trans]', 'OnLoad');
var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(.*)');
var $t = $regex.exec(url)[3];
$kf.target = wnd;
submit_event(prefix, '', $t, url);
submitted = false;
}
function openwin($url, $name, $width, $height, $options) {
var $settings = {
url: base_url + 'core/admin_templates/blank.html?width=' + $width + '&height=' + $height + '&TB_iframe=true&modal=true',
caption: 'Loading ...',
onAfterShow: function ($popup_window) {
if ( $modal_windows ) {
getFrame('main').onAfterWindowOpen($name, $url);
}
else {
onAfterWindowOpen($name, $url, $popup_window);
}
}
};
if ( $options !== undefined ) {
$.extend($settings, $options);
}
if ( $modal_windows ) {
if ( window.name != 'main' ) {
// all popups are opened based on main frame
return getFrame('main').TB.show($settings);
}
TB.show($settings);
return;
}
// prevent window from opening larger, then screen resolution on user's computer (to Kostja)
var left = Math.round((screen.width - $width) / 2);
var top = Math.round((screen.height - $height) / 2);
var cur_x = document.all ? window.screenLeft : window.screenX;
var cur_y = document.all ? window.screenTop : window.screenY;
var $window_params = 'left=' + left + ',top=' + top + ',width=' + $width + ',height=' + $height + ',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no';
var $popup_window = window.open($url, $name, $window_params);
if ( $.isFunction($settings.onAfterShow) ) {
$settings.onAfterShow($popup_window);
}
return $popup_window;
}
function onAfterWindowOpen($window_name, $url, $popup_window) {
// this is always invoked from "main" frame
if ( $popup_window === undefined ) {
var $popup_window = $('#' + TB.getId('TB_iframeContent')).get(0).contentWindow;
if ( !$.isFunction($popup_window.onLoad) ) {
// iframe onload happens on frame content change too -> don't react on it
return false;
}
$popup_window.onLoad();
}
$popup_window.name = $window_name;
if ( $url !== undefined ) {
$popup_window.location.href = $url;
}
if ( $modal_windows ) {
TB.setWindowMetaData('window_name', $window_name); // used to simulate window.opener functionality
}
return $popup_window;
}
function OnResizePopup(e) {
if ( !document.all ) {
var $winW = window.innerWidth;
var $winH = window.innerHeight;
}
else {
var $winW = window.document.body.offsetWidth;
var $winH = window.document.body.offsetHeight;
}
window.status = '[width: ' + $winW + '; height: ' + $winH + ']';
}
function opener_action(new_action) {
var $prev_opener = get_hidden_field('m_opener');
set_hidden_field('m_opener', new_action);
return $prev_opener;
}
function open_popup($prefix_special, $event, $t, $window_size, $onAfterOpenPopup) {
if ( !$window_size ) {
// if no size given, then query it from ajax
var $default_size = '750x400';
var $pm = getFrame('head').$popup_manager;
if ( $pm ) {
// popup manager was found in head frame
$pm.GetSize($t, function ($response) {
if ( !$response.match(/([\d]+)x([\d]+)/) ) {
// invalid response was received, may be php fatal error during AJAX request
$response = $default_size;
}
open_popup($prefix_special, $event, $t, $response, $onAfterOpenPopup);
});
return;
}
$window_size = $default_size;
}
$window_size = $window_size.split('x');
var $window_name = $t.replace(/(\/|-)/g, '_'); // replace "/" and "-" with "_"
var $options = {
onAfterShow: function ($popup_window) {
if ( $modal_windows ) {
getFrame('main').onAfterOpenPopup($prefix_special, $event, $t);
}
else {
onAfterOpenPopup($prefix_special, $event, $t, $popup_window);
}
if ( $onAfterOpenPopup !== undefined && $.isFunction($onAfterOpenPopup) ) {
$onAfterOpenPopup($popup_window);
}
}
};
openwin('', $window_name, $window_size[0], $window_size[1], $options);
}
function onAfterOpenPopup($prefix_special, $event, $t, $popup_window) {
// this is always invoked from "main" frame
var $window_name = $t.replace(/(\/|-)/g, '_'); // replace "/" and "-" with "_"
$popup_window = onAfterWindowOpen($window_name, undefined, $popup_window);
if ( $popup_window === false ) {
// iframe onload happens on frame content change too -> don't react on it
return;
}
var $opener = getWindowOpener($popup_window);
if ( $opener === null ) {
// we are already in main window
$opener = window;
}
$opener.document.getElementById($opener.$form_name).target = $window_name;
var $prev_opener = $opener.opener_action('p');
event_bak = $opener.get_hidden_field('events[' + $prefix_special + ']')
if ( !event_bak ) {
event_bak = '';
}
$opener.submit_event($prefix_special, $event, $t);
$opener.opener_action($prev_opener); // restore opener in parent window
$opener.set_hidden_field('events[' + $prefix_special + ']', event_bak); // restore event
// AJAX popup size respoce is received after std_edit_item/std_precreate_item function exit
$opener.set_hidden_field($prefix_special + '_mode', null);
$opener.submitted = false;
$opener.Application.processHooks($prefix_special + ':OnAfterOpenPopup');
}
function openSelector($prefix, $url, $dst_field, $window_size, $event) {
// get template name from url
var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)');
$regex = $regex.exec($url);
var $t = $regex[3];
// substitute form action with selector's url
var $kf = document.getElementById($form_name);
var $prev_action = $kf.action;
$kf.action = $url;
// check parameter values
if ( !isset($event) ) {
$event = '';
}
Application.processHooks($prefix + ':OnBeforeOpenSelector');
// set variables need for selector to work
set_hidden_field('main_prefix', $prefix);
set_hidden_field('dst_field', $dst_field);
// alert('openSelector(' + $prefix + ', ' + $event + ', ' + $t + ', ' + $window_size + ')');
open_popup(
$prefix, $event, $t, $window_size,
function () {
// restore form action back
$kf.action = $prev_action;
}
);
}
function translate_phrase($label, $edit_template, $options) {
set_hidden_field('phrases_label', $label);
var $event = $options.event === undefined ? 'OnNew' : $options.event;
if ( $options.simple_mode !== undefined ) {
Application.SetVar('simple_mode', $options.simple_mode ? 1 : 0);
if ( $options.simple_mode ) {
Application.SetVar('front', 1);
}
}
else {
Application.SetVar('front', null);
Application.SetVar('simple_mode', null);
Application.SetVar('phrases_label', null);
}
if ( use_popups('phrases', $event) ) {
open_popup('phrases', $event, $edit_template, null, function () {
Application.SetVar('front', null);
Application.SetVar('simple_mode', null);
});
}
else {
opener_action('d');
submit_event('phrases', $event, $edit_template);
Application.SetVar('front', null);
Application.SetVar('simple_mode', null);
Application.SetVar('phrases_label', null);
}
}
function direct_edit($prefix_special, $url) {
if ( use_popups($prefix_special, '') ) {
openSelector($prefix_special, $url);
}
else {
redirect($url);
}
return false;
}
function std_precreate_item(prefix_special, edit_template, $onAfterOpenPopup) {
set_hidden_field(prefix_special + '_mode', 't');
if ( use_popups(prefix_special, 'OnPreCreate') ) {
open_popup(prefix_special, 'OnPreCreate', edit_template, null, $onAfterOpenPopup);
}
else {
opener_action('d');
submit_event(prefix_special, 'OnPreCreate', edit_template);
}
// set_hidden_field(prefix_special+'_mode', '');
}
function std_new_item(prefix_special, edit_template, $onAfterOpenPopup) {
if ( use_popups(prefix_special, 'OnNew') ) {
open_popup(prefix_special, 'OnNew', edit_template, null, $onAfterOpenPopup);
}
else {
opener_action('d');
submit_event(prefix_special, 'OnNew', edit_template);
}
}
function std_edit_item(prefix_special, edit_template, $onAfterOpenPopup) {
set_hidden_field(prefix_special + '_mode', 't');
if ( use_popups(prefix_special, 'OnEdit') ) {
open_popup(prefix_special, 'OnEdit', edit_template, null, $onAfterOpenPopup);
}
else {
opener_action('d');
submit_event(prefix_special, 'OnEdit', edit_template);
}
// set_hidden_field(prefix_special+'_mode', '');
}
function std_edit_temp_item(prefix_special, edit_template, $onAfterOpenPopup) {
if ( use_popups(prefix_special, 'OnStoreSelected') ) {
open_popup(prefix_special, 'OnStoreSelected', edit_template, null, $onAfterOpenPopup);
}
else {
opener_action('d');
submit_event(prefix_special, 'OnStoreSelected', edit_template);
}
}
function std_delete_items(prefix_special, t, $ajax) {
var phrase = phrases['la_Delete_Confirm'] ? phrases['la_Delete_Confirm'] : 'Are you sure you want to delete selected items?';
if ( inpConfirm(phrase) ) {
submit_event(prefix_special, 'OnMassDelete', t, null, $ajax);
}
}
function std_csv_export(prefix_special, grid, template) {
set_hidden_field('PrefixSpecial', prefix_special);
set_hidden_field('grid', grid);
open_popup(prefix_special, '', template);
}
function std_csv_import(prefix_special, grid, template) {
set_hidden_field('PrefixSpecial', prefix_special);
set_hidden_field('grid', grid);
if ( use_popups(prefix_special, '') ) {
open_popup(prefix_special, '', template);
}
else {
submit_event(prefix_special, '', template);
}
}
// set current form base on ajax
function set_form($prefix_special, $ajax) {
if ( $ajax ) {
$form_name = $Catalog.queryTabRegistry('prefix', $prefix_special, 'tab_id') + '_form';
}
}
// sets hidden field value
// if the field does not exist - creates it
function set_hidden_field($field_id, $value, $has_id) {
var $kf = document.getElementById($form_name);
var $field = $kf.elements[$field_id];
if ( $value === null ) {
if ( $field ) {
// alert('tag name on remove: ' + $field.parentNode.tagName);
$field.parentNode.removeChild($field); // bug: sometimes hidden fields are inside BODY tag in DOM model, why?
}
return true;
}
if ( $field ) {
$field.value = $value;
return true;
}
$field = document.createElement('INPUT');
$field.type = 'hidden';
$field.name = $field_id;
if ( !isset($has_id) || $has_id ) {
$field.id = $field_id;
}
$field.value = $value;
$kf.appendChild($field);
return false;
}
// sets hidden field value
// if the field does not exist - creates it
function setInnerHTML($field_id, $value) {
$(jq('#' + $field_id)).html($value);
}
function get_hidden_field($field) {
var $kf = document.getElementById($form_name);
return $kf.elements[$field] ? $kf.elements[$field].value : false;
}
function search($prefix_special, $grid_name, $ajax) {
set_form($prefix_special, $ajax);
set_hidden_field('grid_name', $grid_name);
submit_event($prefix_special, 'OnSearch', null, null, $ajax);
}
function search_reset($prefix_special, $grid_name, $ajax) {
set_form($prefix_special, $ajax);
set_hidden_field('grid_name', $grid_name);
submit_event($prefix_special, 'OnSearchReset', null, null, $ajax);
}
function search_keydown($event, $prefix_special, $grid, $ajax) {
if ( $prefix_special !== undefined ) {
// if $prefix_special is passed, then keydown event was not assigned by jQuery
$event = $event ? $event : event;
if ( window.event ) {// IE
var $key_code = $event.keyCode;
}
else if ( $event.which ) { // Netscape/Firefox/Opera
var $key_code = $event.which;
}
}
else {
// event bind with jQuery, so always use which
var $key_code = $event.which;
$prefix_special = $(this).attr('PrefixSpecial');
$grid = $(this).attr('Grid');
$ajax = $(this).attr('ajax');
}
switch ($key_code) {
case 13:
search($prefix_special, $grid, parseInt($ajax));
break;
case 27:
search_reset($prefix_special, $grid, parseInt($ajax));
break;
}
}
function getRealLeft(el) {
if ( typeof(el) == 'string' ) {
el = document.getElementById(el);
}
xPos = el.offsetLeft;
tempEl = el.offsetParent;
while (tempEl != null) {
xPos += tempEl.offsetLeft;
tempEl = tempEl.offsetParent;
}
// if (obj.x) return obj.x;
return xPos;
}
function getRealTop(el) {
if ( typeof(el) == 'string' ) {
el = document.getElementById(el);
}
yPos = el.offsetTop;
tempEl = el.offsetParent;
while (tempEl != null) {
yPos += tempEl.offsetTop;
tempEl = tempEl.offsetParent;
}
// if (obj.y) return obj.y;
return yPos;
}
function show_viewmenu_old($toolbar, $button_id) {
var $img = $toolbar.GetButtonImage($button_id);
var $pos_x = getRealLeft($img) - ((document.all) ? 6 : -2);
var $pos_y = getRealTop($img) + 32;
var $prefix_special = '';
window.triedToWriteMenus = false;
if ( $ViewMenus.length == 1 ) {
$prefix_special = $ViewMenus[$ViewMenus.length - 1];
$fw_menus[$prefix_special + '_view_menu']();
$Menus[$prefix_special + '_view_menu'].writeMenus('MenuContainers[' + $prefix_special + ']');
window.FW_showMenu($Menus[$prefix_special + '_view_menu'], $pos_x, $pos_y);
}
else {
// prepare menus
for (var $i in $ViewMenus) {
$prefix_special = $ViewMenus[$i];
$fw_menus[$prefix_special + '_view_menu']();
}
$Menus['mixed'] = new Menu('ViewMenu_mixed');
// merge menus into new one
for (var $i in $ViewMenus) {
$prefix_special = $ViewMenus[$i];
$Menus['mixed'].addMenuItem($Menus[$prefix_special + '_view_menu']);
}
$Menus['mixed'].writeMenus('MenuContainers[mixed]');
window.FW_showMenu($Menus['mixed'], $pos_x, $pos_y);
}
}
var nlsMenuRendered = false;
function show_viewmenu($toolbar, $button_id) {
if ( $ViewMenus.length == 1 ) {
$prefix_special = $ViewMenus[$ViewMenus.length - 1];
menu_to_show = $prefix_special + '_view_menu';
}
else {
mixed_menu = menuMgr.createMenu(rs('mixed_menu'));
mixed_menu.applyBorder(false, false, false, false);
mixed_menu.dropShadow("none");
mixed_menu.showIcon = true;
// merge menus into new one
for (var $i in $ViewMenus) {
$prefix_special = $ViewMenus[$i];
mixed_menu.addItem(rs($prefix_special + '.view.menu.mixed'),
$MenuNames[$prefix_special + '_view_menu'],
'javascript:void()', null, true, null,
rs($prefix_special + '.view.menu'), $MenuNames[$prefix_special + '_view_menu']);
}
menu_to_show = 'mixed_menu';
}
renderMenus();
nls_showMenu(rs(menu_to_show), $toolbar.GetButtonImage($button_id))
}
function renderMenus() {
// menuMgr.renderMenus closes all opened menus, but doesn't mark them as closed
menuMgr.hideMenus();
menuMgr.renderMenus('nlsMenuPlace');
nlsMenuRendered = true;
}
function set_window_title($title) {
var $window = window;
if ( $window.name != 'main' ) {
// traverse through real popups
$window = getFrame('main');
}
$window.top.document.title = (main_title.length ? main_title + ' - ' : '') + $title;
if ( $modal_windows ) {
$window.TB.setWindowTitle('');
}
}
function set_filter($prefix_special, $filter_id, $filter_value, $ajax) {
set_form($prefix_special, $ajax);
set_hidden_field('filter_id', $filter_id);
set_hidden_field('filter_value', $filter_value);
submit_event($prefix_special, 'OnSetFilter', null, null, $ajax);
}
function filters_remove_all($prefix_special, $ajax) {
set_form($prefix_special, $ajax);
submit_event($prefix_special, 'OnRemoveFilters', null, null, $ajax);
}
function filters_apply_all($prefix_special, $ajax) {
set_form($prefix_special, $ajax);
submit_event($prefix_special, 'OnApplyFilters', null, null, $ajax);
}
function filter_toggle($row_id, $prefix) {
// var $row = $('#' + jq($row_id));
var $row = $('tr.to-range-filter');
var $hidden = $row.hasClass('hidden-filter');
if ( $hidden ) {
$('td', $row).show();
$row.removeClass('hidden-filter');
}
else {
$('td', $row).hide();
$row.addClass('hidden-filter');
}
// recalculate filter row heights/widths
var $grid = GridScrollers[$prefix];
$grid.UpdateColWidths();
if ( $hidden && $grid.FiltersExpanded !== true ) {
$grid.AdjustInputWidths();
$grid.FiltersExpanded = true;
}
// $grid.SetLeftHeights();
// $grid.UpdateTotalDimensions();
// $grid.SyncScroll();
// $grid.Resize( $grid.GetAutoSize() );
}
+function htmlspecialchars_decode(string) {
+ string = string.toString().replace(/&lt;/g, '<').replace(/&gt;/g, '>');
+ string = string.replace(/&#0*39;/g, "'");
+ string = string.replace(/&quot;/g, '"');
+ string = string.replace(/&amp;/g, '&');
+
+ return string;
+}
+
function RemoveTranslationLink($string, $escaped) {
if ( !isset($escaped) ) $escaped = true;
if ( $escaped ) {
return $string.replace(/&lt;a href=&quot;(.*?)&quot;.*&gt;(.*?)&lt;\/a&gt;/g, '$2');
}
return $string.replace(/<a href="(.*?)".*>(.*?)<\/a>/g, '$2');
}
function redirect($url) {
window.location.href = $url;
}
function update_checkbox_options($cb_mask, $hidden_id) {
var $kf = document.getElementById($form_name);
var $tmp = '';
for (var i = 0; i < $kf.elements.length; i++) {
if ( $kf.elements[i].id.match($cb_mask) ) {
if ( $kf.elements[i].checked ) {
$tmp += '|' + $kf.elements[i].value;
}
}
}
if ( $tmp.length > 0 ) {
$tmp += '|';
}
document.getElementById($hidden_id).value = $tmp.replace(/,$/, '');
}
function update_multiple_options($hidden_id) {
var $select = document.getElementById($hidden_id + '_select');
var $result = '';
for (var $i = 0; $i < $select.options.length; $i++) {
if ( $select.options[$i].selected ) {
$result += $select.options[$i].value + '|';
}
}
document.getElementById($hidden_id).value = $result ? '|' + $result : '';
}
// related to lists operations (moving)
function move_selected($from_list, $to_list, $error_msg) {
if ( typeof($from_list) != 'object' ) $from_list = document.getElementById($from_list);
if ( typeof($to_list) != 'object' ) $to_list = document.getElementById($to_list);
if ( has_selected_options($from_list) ) {
var $from_array = select_to_array($from_list);
var $to_array = select_to_array($to_list);
var $new_from = Array();
var $cur = null;
for (var $i = 0; $i < $from_array.length; $i++) {
$cur = $from_array[$i];
if ( $cur[2] ) // If selected - add to To array
{
$to_array[$to_array.length] = $cur;
}
else //Else - keep in new From
{
$new_from[$new_from.length] = $cur;
}
}
$from_list = array_to_select($new_from, $from_list);
$to_list = array_to_select($to_array, $to_list);
}
else {
alert(isset($error_msg) ? $error_msg : 'Please select items to perform moving!');
}
}
function select_to_array($aSelect) {
var $an_array = new Array();
var $cur = null;
for (var $i = 0; $i < $aSelect.length; $i++) {
$cur = $aSelect.options[$i];
$an_array[$an_array.length] = new Array($cur.text, $cur.value, $cur.selected);
}
return $an_array;
}
function array_to_select($anArray, $aSelect) {
var $initial_length = $aSelect.length;
for (var $i = $initial_length - 1; $i >= 0; $i--) {
$aSelect.options[$i] = null;
}
for (var $i = 0; $i < $anArray.length; $i++) {
$cur = $anArray[$i];
$aSelect.options[$aSelect.length] = new Option($cur[0], $cur[1]);
}
}
function select_compare($a, $b) {
if ( $a[0] < $b[0] ) {
return -1;
}
if ( $a[0] > $b[0] ) {
return 1;
}
return 0;
}
function select_to_string($aSelect) {
var $result = '';
var $cur = null;
if ( typeof($aSelect) != 'object' ) $aSelect = document.getElementById($aSelect);
for (var $i = 0; $i < $aSelect.length; $i++) {
$result += $aSelect.options[$i].value + '|';
}
return $result.length ? '|' + $result : '';
}
function selected_to_string($aSelect) {
var $result = '';
var $cur = null;
if ( typeof($aSelect) != 'object' ) $aSelect = document.getElementById($aSelect);
for (var $i = 0; $i < $aSelect.length; $i++) {
$cur = $aSelect.options[$i];
if ( $cur.selected && $cur.value != '' ) {
$result += $cur.value + '|';
}
}
return $result.length ? '|' + $result : '';
}
function string_to_selected($str, $aSelect) {
var $cur = null;
for (var $i = 0; $i < $aSelect.length; $i++) {
$cur = $aSelect.options[$i];
$aSelect.options[$i].selected = $str.match('\\|' + $cur.value + '\\|') ? true : false;
}
}
function set_selected($selected_options, $aSelect) {
if ( !$selected_options.length ) return false;
for (var $i = 0; $i < $aSelect.length; $i++) {
for (var $k = 0; $k < $selected_options.length; $k++) {
if ( $aSelect.options[$i].value == $selected_options[$k] ) {
$aSelect.options[$i].selected = true;
}
}
}
}
function get_selected_count($theList) {
var $count = 0;
var $cur = null;
for (var $i = 0; $i < $theList.length; $i++) {
$cur = $theList.options[$i];
if ( $cur.selected ) {
$count++;
}
}
return $count;
}
function get_selected_index($aSelect, $typeIndex) {
var $index = 0;
for (var $i = 0; $i < $aSelect.length; $i++) {
if ( $aSelect.options[$i].selected ) {
$index = $i;
if ( $typeIndex == 'firstSelected' ) {
break;
}
}
}
return $index;
}
function has_selected_options($theList) {
var $ret = false;
var $cur = null;
for (var $i = 0; $i < $theList.length; $i++) {
$cur = $theList.options[$i];
if ( $cur.selected ) {
$ret = true;
break;
}
}
return $ret;
}
function select_sort($aSelect) {
if ( typeof($aSelect) != 'object' ) {
$aSelect = document.getElementById($aSelect);
}
var $to_array = select_to_array($aSelect);
$to_array.sort(select_compare);
array_to_select($to_array, $aSelect);
}
function move_options_up($aSelect, $interval) {
if ( typeof($aSelect) != 'object' ) {
$aSelect = document.getElementById($aSelect);
}
if ( has_selected_options($aSelect) ) {
var $selected_options = Array();
var $first_selected = get_selected_index($aSelect, 'firstSelected');
for (var $i = 0; $i < $aSelect.length; $i++) {
if ( $aSelect.options[$i].selected && ($first_selected > 0) ) {
swap_options($aSelect, $i, $i - $interval);
$selected_options[$selected_options.length] = $aSelect.options[$i - $interval].value;
}
else if ( $first_selected == 0 ) {
//alert('Begin of list');
break;
}
}
set_selected($selected_options, $aSelect);
}
else {
//alert('Check items from moving');
}
}
function move_options_down($aSelect, $interval) {
if ( typeof($aSelect) != 'object' ) {
$aSelect = document.getElementById($aSelect);
}
if ( has_selected_options($aSelect) ) {
var $last_selected = get_selected_index($aSelect, 'lastSelected');
var $selected_options = Array();
for (var $i = $aSelect.length - 1; $i >= 0; $i--) {
if ( $aSelect.options[$i].selected && ($aSelect.length - ($last_selected + 1) > 0) ) {
swap_options($aSelect, $i, $i + $interval);
$selected_options[$selected_options.length] = $aSelect.options[$i + $interval].value;
}
else if ( $last_selected + 1 == $aSelect.length ) {
//alert('End of list');
break;
}
}
set_selected($selected_options, $aSelect);
}
else {
//alert('Check items from moving');
}
}
function swap_options($aSelect, $src_num, $dst_num) {
var $src_html = $aSelect.options[$src_num].innerHTML;
var $dst_html = $aSelect.options[$dst_num].innerHTML;
var $src_value = $aSelect.options[$src_num].value;
var $dst_value = $aSelect.options[$dst_num].value;
var $src_option = document.createElement('OPTION');
var $dst_option = document.createElement('OPTION');
$aSelect.remove($src_num);
$aSelect.options.add($dst_option, $src_num);
$dst_option.innerText = $dst_html;
$dst_option.value = $dst_value;
$dst_option.innerHTML = $dst_html;
$aSelect.remove($dst_num);
$aSelect.options.add($src_option, $dst_num);
$src_option.innerText = $src_html;
$src_option.value = $src_value;
$src_option.innerHTML = $src_html;
}
function getXMLHTTPObject(content_type) {
if ( !isset(content_type) ) {
content_type = 'text/plain';
}
var http_request = false;
if ( window.XMLHttpRequest ) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if ( http_request.overrideMimeType ) {
http_request.overrideMimeType(content_type);
// See note below about this line
}
} else if ( window.ActiveXObject ) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
}
}
}
return http_request;
}
function str_repeat($symbol, $count) {
var $i = 0;
var $ret = '';
while ($i < $count) {
$ret += $symbol;
$i++;
}
return $ret;
}
function getDocumentFromXML(xml) {
if ( window.ActiveXObject ) {
var doc = new ActiveXObject("Microsoft.XMLDOM");
doc.async = false;
doc.loadXML(xml);
}
else {
var parser = new DOMParser();
var doc = parser.parseFromString(xml, "text/xml");
}
return doc;
}
function set_persistant_var($var_name, $var_value, $t, $form_action) {
set_hidden_field('field', $var_name);
set_hidden_field('value', $var_value);
submit_event('u', 'OnSetPersistantVariable', $t, $form_action);
}
function setCookie($Name, $Value) {
// set cookie
if ( getCookie($Name) != $Value ) {
document.cookie = $Name + '=' + escape($Value);
}
}
function getCookie($Name) {
// get cookie
var $cookieString = document.cookie;
var $index = $cookieString.indexOf($Name + '=');
if ( $index == -1 ) {
return null;
}
$index = $cookieString.indexOf('=', $index) + 1;
var $endstr = $cookieString.indexOf(';', $index);
if ( $endstr == -1 ) {
$endstr = $cookieString.length;
}
return unescape($cookieString.substring($index, $endstr));
}
function deleteCookie($Name) {
// deletes cookie
if ( getCookie($Name) ) {
var d = new Date();
document.cookie = $Name + '=;expires=' + d.toGMTString() + ';' + ';';
}
}
function addElement($dst_element, $tag_name) {
var $new_element = document.createElement($tag_name.toUpperCase());
$dst_element.appendChild($new_element);
return $new_element;
}
Math.sum = function ($array) {
var $i = 0;
var $total = 0;
while ($i < $array.length) {
$total += $array[$i];
$i++;
}
return $total;
}
Math.average = function ($array) {
return Math.sum($array) / $array.length;
}
// remove spaces and underscores from a string, used for nls_menu
function rs(str, is_phrase) {
if ( isset(is_phrase) && is_phrase ) {
str = RemoveTranslationLink(str, false);
}
return str.replace(/[ _\']+/g, '.');
}
function getFrame($name) {
var $main_window = window;
// 1. cycle through popups to get main window
try {
// will be error, when other site is opened in parent window
var $i = 0,
$opener,
$is_frameset = false;
do {
if ( $i == 10 || $is_frameset ) {
break;
}
// try to get popup window opener
$opener = $main_window.opener;
if ( !$opener ) {
// not inside a popup, then we're inside a frameset already - get it once
$is_frameset = true;
$opener = $main_window.parent;
}
if ( $opener ) {
$main_window = $opener;
}
$i++;
} while ($opener);
}
catch (err) {
// catch Access/Permission Denied error
// alert('getFrame.Error: [' + err.description + ']');
return window;
}
var $frameset = $main_window.parent.frames;
for ($i = 0; $i < $frameset.length; $i++) {
if ( $frameset[$i].name == $name ) {
return $frameset[$i];
}
}
return $main_window.parent;
}
function ClearBrowserSelection() {
if ( window.getSelection ) {
// removeAllRanges will be supported by Opera from v 9+, do nothing by now
var selection = window.getSelection();
if ( selection.removeAllRanges ) { // Mozilla & Opera 9+
// alert('clearing FF')
window.getSelection().removeAllRanges();
}
} else if ( document.selection && !is.opera ) { // IE
// alert('clearing IE')
document.selection.empty();
}
}
function reset_form(prefix, event, msg) {
if ( confirm(RemoveTranslationLink(msg, true)) ) {
submit_event(prefix, event)
}
}
function cancel_edit(prefix, cancel_ev, save_ev, msg) {
if ( (!Form || (Form && Form.HasChanged)) && confirm(RemoveTranslationLink(msg, true)) ) {
submit_event(prefix, save_ev)
}
else {
submit_event(prefix, cancel_ev)
}
}
function execJS(node) {
var bSaf = (navigator.userAgent.indexOf('Safari') != -1);
var bOpera = (navigator.userAgent.indexOf('Opera') != -1);
var bMoz = (navigator.appName == 'Netscape');
if ( !node ) {
return;
}
/* IE wants it uppercase */
var st = node.getElementsByTagName('SCRIPT');
var strExec;
for (var i = 0; i < st.length; i++) {
if ( bSaf ) {
strExec = st[i].innerHTML;
st[i].innerHTML = "";
} else if ( bOpera ) {
strExec = st[i].text;
st[i].text = "";
} else if ( bMoz ) {
strExec = st[i].textContent;
st[i].textContent = "";
} else {
strExec = st[i].text;
st[i].text = "";
}
try {
var x = document.createElement("script");
x.type = "text/javascript";
/* In IE we must use .text! */
if ( (bSaf) || (bOpera) || (bMoz) ) {
x.innerHTML = strExec;
}
else {
x.text = strExec;
}
document.getElementsByTagName("head")[0].appendChild(x);
} catch (e) {
alert(e);
}
}
}
;
function NumberFormatter() {
}
NumberFormatter.ThousandsSep = '\'';
NumberFormatter.DecimalSep = '.';
NumberFormatter.Parse = function (num) {
if ( num == '' ) {
return 0;
}
var $string = num.toString();
// we could have multiple thousand separators !
return parseFloat($string.replace(new RegExp(this.ThousandsSep, 'g'), '').replace(this.DecimalSep, '.'));
}
NumberFormatter.Format = function (num) {
num += '';
x = num.split('.');
x1 = x[0];
x2 = x.length > 1 ? this.DecimalSep + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + this.ThousandsSep + '$2');
}
return x1 + x2;
}
function getDimensions(obj) {
var style
if ( obj.currentStyle ) {
style = obj.currentStyle;
}
else {
style = getComputedStyle(obj, '');
}
padding = [parseInt(style.paddingTop), parseInt(style.paddingRight), parseInt(style.paddingBottom), parseInt(style.paddingLeft)]
border = [parseInt(style.borderTopWidth), parseInt(style.borderRightWidth), parseInt(style.borderBottomWidth), parseInt(style.borderLeftWidth)]
for (var i = 0; i < padding.length; i++) {
if ( isNaN(padding[i]) ) {
padding[i] = 0
}
}
for (var i = 0; i < border.length; i++) {
if ( isNaN(border[i]) ) {
border[i] = 0
}
}
var result = new Object();
result.innerHeight = obj.clientHeight - padding[0] - padding[2];
result.innerWidth = obj.clientWidth - padding[1] - padding[3];
result.padding = padding;
result.borders = border;
result.outerHeight = obj.clientHeight + border[0] + border[2];
result.outerWidth = obj.clientHeight + border[1] + border[3];
return result;
}
function findPos(obj, with_scroll) {
/*var $offset = $(obj).offset();
return [$offset.left, $offset.top];*/
if ( !with_scroll ) {
var with_scroll = false;
}
var curleft = curtop = 0;
if ( obj.offsetParent ) {
curleft = obj.offsetLeft - (with_scroll ? obj.scrollLeft : 0)
curtop = obj.offsetTop - (with_scroll ? obj.scrollTop : 0)
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft - (with_scroll ? obj.scrollLeft : 0)
curtop += obj.offsetTop - (with_scroll ? obj.scrollTop : 0)
}
}
return [curleft, curtop];
}
function scrollbarWidth() {
// Scrollbalken im Body ausschalten
var $overflow_backup = document.body.style.overflow;
document.body.style.overflow = 'hidden';
var width = document.body.clientWidth;
// Scrollbalken
document.body.style.overflow = 'scroll';
width -= document.body.clientWidth;
// Der IE im Standardmode
if ( !width ) {
width = document.body.offsetWidth - document.body.clientWidth;
}
// urspr?ngliche Einstellungen
document.body.style.overflow = $overflow_backup;
return width;
}
function maximizeElement($selector, $max_height) {
if ( $max_height === undefined ) {
$max_height = false;
}
var $element = $($selector);
if ( $element.length == 0 ) {
return;
}
$element.width('100%');
var $container_id = $element.attr('id') + '_container';
var $container = $(jq('#' + $container_id));
if ( $container.length == 0 ) {
// don't create same container twice
// all <script> tags will be executed again after wrap method is called, so remove them to prevent that
$('script', $element).remove();
$element.wrap('<div id="' + $container_id + '" style="position: relative; overflow: auto; width: 100%;"></div>');
$container = $(jq('#' + $container_id));
$(window).resize(
function () {
maximizeElement($selector, $max_height);
}
);
}
var $offset_top = $container.offset().top;
var $window_height = $(window).height();
var $height_left = $window_height - $offset_top;
if ( ($max_height !== false) && ($max_height < $height_left) ) {
$height_left = $max_height;
}
$height_left -= ($element.outerHeight() - $element.height());
$container.height($height_left);
var $element_width = $(window).width() - ($element.outerWidth() - $element.width());
if ( $height_left < $element.height() ) {
// needs vertical scrolling, so substract vertical scrollbar width
$element_width -= scrollbarWidth();
}
$element.width($element_width);
}
function addEvent(el, evname, func, traditional) {
if ( traditional ) {
eval('el.on' + evname + '=' + func);
return;
}
if ( evname.match(/mousedown|mousemove|mouseup/) ) {
$(el)
.unbind(evname)// don't allow more then one
.bind(evname, func);
return;
}
if ( is.ie ) {
el.attachEvent("on" + evname, func);
} else {
el.addEventListener(evname, func, true);
}
}
/*function removeEvent(el, evname, func) {
if (is.ie) {
el.detachEvent('on' + evname, func);
} else {
el.removeEventListener(evname, func, true);
}
}*/
function addLoadEvent(func, wnd) {
Application.setHook('m:OnAfterWindowLoad', func);
}
function replaceFireBug() {
if ( 'object' !== typeof console ) {
var names = [
'log', 'debug', 'info', 'warn', 'error', 'assert', 'dir', 'dirxml',
'group', 'groupEnd', 'time', 'timeEnd', 'count', 'trace', 'profile', 'profileEnd'
];
window.console = {};
for ( var i = 0; i < names.length; ++i ) {
window.console[names[i]] = function ($msg) {
alert('Console object methods are not available outside Firefox/Chrome!' + "\n" + $msg);
}
}
}
}
function runOnChange(elId) {
var evt;
var el = typeof(elId) == 'string' ? document.getElementById(elId) : elId
if ( document.createEvent ) {
evt = document.createEvent("HTMLEvents");
evt.initEvent("change", true, false);
(evt) ? el.dispatchEvent(evt) : (el.onchange && el.onchange());
return;
}
if ( el.fireEvent ) {
el.fireEvent('onchange');
}
}
function WatchClosing(win, $url) {
window.setTimeout(function () {
if ( win.closed ) {
var req = Request.getRequest();
var $ajax_mark = ($url.indexOf('?') ? '&' : '?') + 'ajax=yes';
req.open('GET', $url + $ajax_mark, false); //!!!SYNCRONIOUS!!! REQUEST (3rd param = false!!!)
req.send(null);
}
},
2000
)
}
function IterateUploaders($method) {
if ( typeof UploadsManager != 'undefined' ) {
UploadsManager.iterate($method);
}
}
String.prototype.trim = function () {
return this.replace(/\s*((\S+\s*)*)/, "$1").replace(/((\s*\S+)*)\s*/, "$1");
}
String.prototype.toNumeric = function () {
return parseInt(this.replace(/(auto|medium)/, '0px').replace(/[a-z]/gi, ''));
}
function jq($selector) {
return $selector.replace(/(\[|\]|\.)/g, '\\$1');
}
function setHelpLink($user_docs_url, $title_preset) {
if ( !$user_docs_url ) {
return;
}
$('#help_link', getFrame('head').document).attr('href', $user_docs_url + '/' + $title_preset);
}
// window management functions:
function getWindowOpener($window) {
// use this intead of "window.opener"
if ( !$modal_windows ) {
return $window.opener;
}
if ( $window.name == 'main' || $window.name == 'main_frame' ) {
return null;
}
return getFrame('main').TB.findWindow($window.name, -1);
}
function window_close($close_callback) {
// use this instead of "window.close();"
if ( !$modal_windows ) {
if ( $.isFunction($close_callback) ) {
// use close callback, because iframe will be removed later in this method
$close_callback();
}
window.close();
return;
}
if ( window.name == 'main' ) {
return;
}
if ( $close_callback !== undefined ) {
return getFrame('main').TB.remove(null, $close_callback);
}
return getFrame('main').TB.remove();
}
function onAfterWindowClose($redirect_url, $open_new_window, $force_skip_refresh) {
if ( $open_new_window ) {
var $ru = $redirect_url;
// setTimeout allows to call method indirectly. Without it whole idea won't work 2nd time (try adding 2 relations one after another)
setTimeout(
function () {
openSelector('adm', $ru.replace(/%5C/g, '\\') + '&merge_opener_stack=1');
},
200
);
return;
}
window.focus();
if ( !(($force_skip_refresh === true) || (typeof $skip_refresh != 'undefined' && $skip_refresh)) ) {
window.location.href = $redirect_url.replace(/%5C/g, '\\');
}
}
function get_control($mask, $field, $append, $prepend) {
$append = $append !== undefined ? '_' + $append : '';
$prepend = $prepend !== undefined ? $prepend + '_' : '';
return document.getElementById($prepend + $mask.replace('#FIELD_NAME#', $field) + $append);
}
Array.prototype.each = function ($callback) {
var $result = null;
for (var $i = 0; $i < this.length; $i++) {
$result = $callback.call(this[$i], $i);
if ( $result === false ) {
break;
}
}
}
function disable_categories($category_dropdown_id, $allowed_categories) {
if ( $allowed_categories === true ) {
return;
}
var $selected_category = false;
var $categories = $(jq('#' + $category_dropdown_id)).children('option');
$categories.each(
function () {
var $me = $(this);
var $category_id = parseInt($me.attr('value'));
if ( !in_array($category_id, $allowed_categories) ) {
if ( $me.prop('selected') ) {
$selected_category = $me;
}
$me.prop('disabled', true);
}
}
);
if ( $selected_category !== false && $allowed_categories.length > 0 ) {
// when selected category became disabled -> select 1st available category
$selected_category.prop('selected', false);
$("option[value='" + $allowed_categories[0] + '"]', $categories).prop('selected', true);
}
}
function crc32(str) {
var table = '00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D';
var crc = 0;
var x = 0;
var y = 0;
crc = crc ^ (-1);
for (var i = 0, iTop = str.length; i < iTop; i++) {
y = ( crc ^ str.charCodeAt(i) ) & 0xFF;
x = "0x" + table.substr(y * 9, 8);
crc = ( crc >>> 8 ) ^ x;
}
return crc ^ (-1);
}
function ckeditors_apply_typekit() {
if ( $typekit_id === undefined || $typekit_id.length == 0 ) {
return;
}
CKEDITOR.on(
'instanceReady',
function (ev) {
setTimeout(function () {
var $script = document.createElement('script'),
$editor_instance = CKEDITOR.instances[ev.editor.name];
$script.src = '//use.typekit.com/' + $typekit_id + '.js';
$script.onload = function () {
try {
$editor_instance.window.$.Typekit.load();
} catch (e) {}
};
$editor_instance.document.getHead().$.appendChild($script);
}, 1000);
}
);
}
Index: branches/5.3.x/core/admin_templates/catalog/catalog.tpl
===================================================================
--- branches/5.3.x/core/admin_templates/catalog/catalog.tpl (revision 15906)
+++ branches/5.3.x/core/admin_templates/catalog/catalog.tpl (revision 15907)
@@ -1,306 +1,306 @@
<inp2:m_include t="incs/header" noform="yes"/>
<inp2:m_include template="catalog/catalog_elements"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:browse" prefix="c" title_preset="catalog" tabs="catalog/catalog_tabs" additional_blue_bar_render_as="theme_selector"/>
<!-- main kernel_form: begin -->
<inp2:m_RenderElement name="kernel_form"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<input type="hidden" name="m_cat_id" value="<inp2:m_get name="m_cat_id"/>"/>
<link rel="stylesheet" rev="stylesheet" href="<inp2:m_Compress files='incs/nlsmenu.css'/>" type="text/css" />
<script type="text/javascript" src="<inp2:m_Compress files='
js/nlsmenu.js|
js/nlsmenueffect_1_2_1.js|
js/catalog.js
'/>"></script>
<script type="text/javascript">
<inp2:m_if check="adm_CheckPermCache">
$(document).ready(
function() {
Application.SetVar('continue', 1);
openSelector('c', '<inp2:m_t t="categories/cache_updater" pass="m"/>');
}
);
</inp2:m_if>
var menuMgr = new NlsMenuManager("mgr");
menuMgr.timeout = 500;
menuMgr.flowOverFormElement = true;
Request.progressText = '<inp2:m_phrase name="la_title_Loading" no_editing="1" escape="1"/>';
var $is_catalog = true;
var $Catalog = new Catalog('<inp2:m_Link template="#TEMPLATE_NAME#" m_cat_id="#CATEGORY_ID#" no_amp="1"/>', 'catalog_', 'Catalog');
$Catalog.TabByCategory = <inp2:m_if check="m_GetConfig" name="Catalog_PreselectModuleTab">true<inp2:m_else/>false</inp2:m_if>;
var a_toolbar = new ToolBar();
a_toolbar.AddButton(
new ToolBarButton(
'upcat',
'<inp2:m_phrase label="la_ToolTip_Up" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_GoUp" escape="1"/>',
function() {
$Catalog.go_to_cat($Catalog.ParentCategoryID);
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'homecat',
'<inp2:m_phrase label="la_ToolTip_Home" escape="1"/>',
function() {
$Catalog.go_to_cat(<inp2:c_HomeCategory/>);
}
)
);
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
<inp2:m_ModuleInclude template="catalog_tab" tab_init="1" replace_m="yes"/>
a_toolbar.AddButton(
new ToolBarButton(
'edit',
'<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>',
edit
)
);
a_toolbar.AddButton(
new ToolBarButton(
'delete',
'<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
var $template = $Catalog.queryTabRegistry('prefix', $Catalog.getCurrentPrefix(), 'view_template');
std_delete_items($Catalog.getCurrentPrefix(), $template, 1);
}
)
);
<inp2:m_ModuleInclude template="catalog_buttons" main_template="catalog"/>
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton(
new ToolBarButton(
'approve',
'<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>',
function() {
askCategoryPropagate();
$Catalog.submit_event(null, 'OnMassApprove');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'decline',
'<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>',
function() {
askCategoryPropagate();
$Catalog.submit_event(null, 'OnMassDecline');
}
)
);
function askCategoryPropagate() {
if ($Catalog.getCurrentPrefix() == 'c') {
var $propagate_status = confirm('<inp2:m_Phrase name="la_msg_PropagateCategoryStatus" escape="1"/>');
$form_name = $Catalog.queryTabRegistry('prefix', 'c', 'tab_id') + '_form';
Application.SetVar('propagate_category_status', $propagate_status ? 1 : 0);
}
}
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton(
new ToolBarButton(
'cut',
'<inp2:m_phrase label="la_ToolTip_Cut" escape="1"/>',
function() {
$Catalog.submit_event(null, 'OnCut');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'copy',
'<inp2:m_phrase label="la_ToolTip_Copy" escape="1"/>',
function() {
$Catalog.submit_event(null, 'OnCopy');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'paste',
'<inp2:m_phrase label="la_ToolTip_Paste" escape="1"/>',
function() {
submit_event('c', 'OnPasteClipboard', 'catalog/catalog');
/*$Catalog.submit_event(
'c', 'OnPasteClipboard', null,
function($object) {
$object.resetTabs(true);
$object.switchTab();
}
);*/
}
)
);
/*a_toolbar.AddButton( new ToolBarButton('clear_clipboard', '<inp2:m_phrase label="la_ToolTip_ClearClipboard" escape="1"/>', function() {
if (confirm('<inp2:m_phrase name="la_text_ClearClipboardWarning" js_escape="1"/>')) {
$Catalog.submit_event('c', 'OnClearClipboard', null, function($object) {
$GridManager.CheckDependencies($object.ActivePrefix);
} );
}
}
) );*/
a_toolbar.AddButton( new ToolBarSeparator('sep5') );
a_toolbar.AddButton(
new ToolBarButton(
'move_up',
'<inp2:m_phrase label="la_ToolTip_MoveUp" escape="1"/>::<inp2:m_phrase label="la_ToolTipShort_Move_Up" escape="1"/>',
function() {
$Catalog.submit_event(null, 'OnMassMoveUp');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'move_down',
'<inp2:m_phrase label="la_ToolTip_MoveDown" escape="1"/>::<inp2:m_phrase label="la_ToolTipShort_Move_Down" escape="1"/>',
function() {
$Catalog.submit_event(null, 'OnMassMoveDown');
}
)
);
a_toolbar.AddButton( new ToolBarSeparator('sep6') );
a_toolbar.AddButton(
new ToolBarButton(
'tools',
'<inp2:m_Phrase label="la_ToolTip_Tools" escape="1"/>',
function() {
var $menu = menuMgr.createMenu(rs('tools_menu'));
$menu.applyBorder(false, false, false, false);
$menu.dropShadow('none');
$menu.showIcon = true;
$menu.addItem(rs('editcat'), '<inp2:m_Phrase name="la_ToolTip_Edit_Current_Category" js_escape="1"/>', 'javascript:executeButton("editcat");');
$menu.addItem(rs('export'), '<inp2:m_Phrase name="la_ToolTip_Export" js_escape="1"/>', 'javascript:executeButton("export");');
$menu.addSeparator();
$menu.addItem(rs('rebuild_cache'), '<inp2:m_Phrase name="la_ToolTip_RebuildCategoryCache" js_escape="1"/>', 'javascript:executeButton("rebuild_cache");');
if ($Catalog.ActivePrefix == 'c') {
$menu.addItem(rs('recalculate_priorities'), '<inp2:m_Phrase name="la_ToolTip_RecalculatePriorities" js_escape="1"/>', 'javascript:executeButton("recalculate_priorities");');
}
renderMenus();
nls_showMenu(rs('tools_menu'), a_toolbar.GetButtonImage('tools'));
}
)
);
function executeButton($button_name) {
switch ($button_name) {
case 'editcat':
var $edit_url = '<inp2:m_t t="#TEMPLATE#" m_opener="d" c_mode="t" c_event="OnEdit" c_id="#CATEGORY_ID#" pass="all,c" no_amp="1"/>';
var $category_id = get_hidden_field('m_cat_id');
var $redirect_url = $edit_url.replace('#CATEGORY_ID#', $category_id);
$redirect_url = $redirect_url.replace('#TEMPLATE#', $category_id == 0 || $category_id == <inp2:c_HomeCategory/> ? 'categories/categories_edit_permissions' : 'categories/categories_edit');
direct_edit('c', $redirect_url);
break;
case 'export':
var $export_templates = <inp2:c_PrintCatalogExportTemplates prefixes="l,n,p"/>;
if ($export_templates[$Catalog.ActivePrefix] != undefined) {
$Catalog.storeIDs('export_categories');
open_popup($Catalog.ActivePrefix, 'OnExport', $export_templates[$Catalog.ActivePrefix]);
}
else {
alert('<inp2:m_phrase name="la_Text_InDevelopment" escape="1"/>');
}
break;
case 'rebuild_cache':
openSelector('c', '<inp2:m_t t="categories/cache_updater" pass="m"/>');
break;
case 'recalculate_priorities':
$Catalog.submit_event('c', 'OnRecalculatePriorities');
break;
}
}
a_toolbar.AddButton(
new ToolBarButton(
'view',
'<inp2:m_phrase label="la_ToolTip_View" escape="1"/>',
function() {
show_viewmenu(a_toolbar, 'view');
}
)
);
a_toolbar.Render();
function edit() {
var $current_prefix = $Catalog.getCurrentPrefix();
$form_name = $Catalog.queryTabRegistry('prefix', $current_prefix, 'tab_id') + '_form';
std_edit_item($current_prefix, $Catalog.queryTabRegistry('prefix', $current_prefix, 'edit_template'));
}
function add_item() {
var $current_prefix = $Catalog.getCurrentPrefix();
$form_name = $Catalog.queryTabRegistry('prefix', $current_prefix, 'tab_id') + '_form';
std_precreate_item($current_prefix, $Catalog.queryTabRegistry('prefix', $current_prefix, 'edit_template'));
}
</script>
</td>
<inp2:m_RenderElement name="catalog_search_box"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="kernel_form_end"/>
<!-- main kernel_form: end -->
<inp2:m_ModuleInclude template="catalog_tab" tab_init="2" strip_nl="2"/>
<script type="text/javascript">
var $menu_frame = getFrame('menu');
if (typeof $menu_frame.ShowStructure != 'undefined') {
<inp2:m_DefineElement name="structure_node"><inp2:m_param name="section_url"/></inp2:m_DefineElement>
- $menu_frame.ShowStructure('<inp2:adm_PrintSection escape="1" render_as="structure_node" section_name="in-portal:browse"/>', true);
+ $menu_frame.ShowStructure('<inp2:adm_PrintSection js_escape="1" render_as="structure_node" section_name="in-portal:browse"/>', true);
}
Application.setHook(
'm:OnAfterWindowLoad',
function() {
$Catalog.Init();
getFrame('head').$('#extra_toolbar').html('<inp2:m_RenderElement name="extra_toolbar" js_escape="1"/>');
}
);
</script>
<inp2:m_include t="incs/footer" noform="yes"/>
\ No newline at end of file
Index: branches/5.3.x/core/admin_templates/catalog/advanced_view.tpl
===================================================================
--- branches/5.3.x/core/admin_templates/catalog/advanced_view.tpl (revision 15906)
+++ branches/5.3.x/core/admin_templates/catalog/advanced_view.tpl (revision 15907)
@@ -1,149 +1,149 @@
<inp2:m_include t="incs/header" noform="yes"/>
<inp2:m_include template="catalog/catalog_elements"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:browse" prefix="c" title_preset="advanced_view" tabs="catalog/catalog_tabs" special=".showall" additional_blue_bar_render_as="theme_selector"/>
<!-- main kernel_form: begin -->
<inp2:m_RenderElement name="kernel_form"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<input type="hidden" name="m_cat_id" value="<inp2:m_get name="m_cat_id"/>"/>
<link rel="stylesheet" rev="stylesheet" href="<inp2:m_Compress files='incs/nlsmenu.css'/>" type="text/css" />
<script type="text/javascript" src="<inp2:m_Compress files='
js/nlsmenu.js|
js/nlsmenueffect_1_2_1.js|
js/catalog.js
'/>"></script>
<script type="text/javascript">
<inp2:m_if check="adm_CheckPermCache">
$(document).ready(
function() {
Application.SetVar('continue', 1);
openSelector('c', '<inp2:m_t t="categories/cache_updater" pass="m"/>');
}
);
</inp2:m_if>
var menuMgr = new NlsMenuManager("mgr");
menuMgr.timeout = 500;
menuMgr.flowOverFormElement = true;
Request.progressText = '<inp2:m_phrase name="la_title_Loading" no_editing="1" escape="1"/>';
Catalog.prototype.AfterInit = function() {
this.switchTab();
}
var $Catalog = new Catalog('<inp2:m_Link template="#TEMPLATE_NAME#" pass_through="ts,td" ts="showall" td="no" m_cat_id="#CATEGORY_ID#" no_amp="1"/>', 'advanced_view_', 'AdvancedView');
var a_toolbar = new ToolBar();
<inp2:m_set ts="showall" td="no"/>
<inp2:m_ModuleInclude template="catalog_tab" tab_init="1" replace_m="yes"/>
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
var $template = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'view_template');
$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';
set_hidden_field('remove_specials[' + $Catalog.ActivePrefix + ']', 1);
std_delete_items($Catalog.ActivePrefix, $template, 1);
} ) );
<inp2:m_ModuleInclude template="catalog_buttons" main_template="advanced_view"/>
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';
set_hidden_field('remove_specials[' + $Catalog.ActivePrefix + ']', 1);
$Catalog.submit_event($Catalog.ActivePrefix, 'OnMassApprove');
}
) );
a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';
set_hidden_field('remove_specials[' + $Catalog.ActivePrefix + ']', 1);
$Catalog.submit_event($Catalog.ActivePrefix, 'OnMassDecline');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar, 'view');
}
) );
a_toolbar.Render();
function edit() {
$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';
var $kf = document.getElementById($form_name);
var $prev_action = $kf.action;
$kf.action = '<inp2:m_t pass="all" no_pass_through="1"/>';
set_hidden_field('remove_specials[' + $Catalog.ActivePrefix + ']', 1);
std_edit_item(
$Catalog.ActivePrefix, $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'edit_template'),
function() {
$kf.action = $prev_action;
}
);
}
function add_item() {
$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';
var $kf = document.getElementById($form_name);
var $prev_action = $kf.action;
$kf.action = '<inp2:m_t pass="all" no_pass_through="1"/>';
set_hidden_field('remove_specials[' + $Catalog.ActivePrefix + ']', 1);
std_precreate_item(
$Catalog.ActivePrefix, $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'edit_template'),
function() {
$kf.action = $prev_action;
}
);
}
</script>
</td>
<inp2:m_RenderElement name="catalog_search_box"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="kernel_form_end"/>
<!-- main kernel_form: end -->
<inp2:m_set ts="showall" td="no"/>
<inp2:m_ModuleInclude template="catalog_tab" tab_init="2"/>
<script type="text/javascript">
var $menu_frame = getFrame('menu');
if (typeof $menu_frame.ShowStructure != 'undefined') {
<inp2:m_DefineElement name="structure_node"><inp2:m_param name="section_url"/></inp2:m_DefineElement>
- $menu_frame.ShowStructure('<inp2:adm_PrintSection escape="1" render_as="structure_node" section_name="in-portal:browse"/>', false);
+ $menu_frame.ShowStructure('<inp2:adm_PrintSection js_escape="1" render_as="structure_node" section_name="in-portal:browse"/>', false);
}
Application.setHook(
'm:OnAfterWindowLoad',
function() {
$Catalog.Init();
<inp2:m_if check="m_get" var="SetTab">
$Catalog.switchTab('<inp2:m_get var="SetTab"/>.showall');
</inp2:m_if>
getFrame('head').$('#extra_toolbar').html('<inp2:m_RenderElement name="extra_toolbar" js_escape="1"/>');
}
);
</script>
<inp2:m_include t="incs/footer" noform="yes"/>
\ No newline at end of file
Index: branches/5.3.x/CREDITS
===================================================================
--- branches/5.3.x/CREDITS (revision 15906)
+++ branches/5.3.x/CREDITS (revision 15907)
Property changes on: branches/5.3.x/CREDITS
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
Merged /in-portal/branches/5.2.x/CREDITS:r15902-15906
Index: branches/5.3.x/README
===================================================================
--- branches/5.3.x/README (revision 15906)
+++ branches/5.3.x/README (revision 15907)
Property changes on: branches/5.3.x/README
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
Merged /in-portal/branches/5.2.x/README:r15902-15906
Index: branches/5.3.x/index.php
===================================================================
--- branches/5.3.x/index.php (revision 15906)
+++ branches/5.3.x/index.php (revision 15907)
Property changes on: branches/5.3.x/index.php
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
Merged /in-portal/branches/5.2.x/index.php:r15902-15906
Index: branches/5.3.x/LICENSES
===================================================================
--- branches/5.3.x/LICENSES (revision 15906)
+++ branches/5.3.x/LICENSES (revision 15907)
Property changes on: branches/5.3.x/LICENSES
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
Merged /in-portal/branches/5.2.x/LICENSES:r15902-15906
Index: branches/5.3.x/INSTALL
===================================================================
--- branches/5.3.x/INSTALL (revision 15906)
+++ branches/5.3.x/INSTALL (revision 15907)
Property changes on: branches/5.3.x/INSTALL
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
Merged /in-portal/branches/5.2.x/INSTALL:r15902-15906
Index: branches/5.3.x/COPYRIGHT
===================================================================
--- branches/5.3.x/COPYRIGHT (revision 15906)
+++ branches/5.3.x/COPYRIGHT (revision 15907)
Property changes on: branches/5.3.x/COPYRIGHT
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
Merged /in-portal/branches/5.2.x/COPYRIGHT:r15902-15906
Index: branches/5.3.x/.htaccess
===================================================================
--- branches/5.3.x/.htaccess (revision 15906)
+++ branches/5.3.x/.htaccess (revision 15907)
Property changes on: branches/5.3.x/.htaccess
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
Merged /in-portal/branches/5.2.x/.htaccess:r15902-15906
Index: branches/5.3.x
===================================================================
--- branches/5.3.x (revision 15906)
+++ branches/5.3.x (revision 15907)
Property changes on: branches/5.3.x
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
Merged /in-portal/branches/5.2.x:r15902-15906

Event Timeline