Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Jun 15, 11:08 PM

in-portal

This file is larger than 256 KB, so syntax highlighting was skipped.
Index: trunk/kernel/parser.php
===================================================================
--- trunk/kernel/parser.php (revision 6427)
+++ trunk/kernel/parser.php (revision 6428)
@@ -1,3808 +1,3839 @@
<?php
$ItemTypes["category"]=1;
$ItemTables[1] = "Category";
$ParserFiles[] = "kernel/parser.php";
function m_ParseEnv($str = NULL)
{
global $m_var_list, $objConfig, $objCatList, $objLanguages, $objThemes;
if ($str != NULL)
{
$str = substr($str,1);
$pieces = explode("-", $str);
//echo "<PRE>";print_r($pieces);echo "</PRE>";
$m_var_list["cat"] = $pieces[0];
$m_var_list["p"] = $pieces[1];
$objCatList->Page = $m_var_list["p"];
$m_var_list["lang"] = $pieces[2];
$m_var_list["theme"] = $pieces[3];
$m_var_list['opener']=$pieces[4];
}
else
{
$m_var_list["cat"]=0;
$m_var_list["p"] = 1;
$m_var_list["lang"] = $objLanguages->GetPrimary();
$m_var_list["theme"]= $objThemes->GetPrimaryTheme();
$m_var_list['opener']='s';
}
}
function m_BuildEnv()
{
global $m_var_list, $m_var_list_update;
$module_vars = Array('cat','p','lang','theme','opener');
$ret = GenerateModuleEnv('m', $module_vars);
if( isset($GLOBALS['m_var_list_update']['cat']) ) unset($GLOBALS['m_var_list_update']['cat']);
return $ret;
}
function m_BuildEnv_NEW()
{
global $m_var_list, $m_var_list_update;
$module_vars = Array( 'cat' => 'm_cat_id', 'p' => 'm_cat_page', 'lang' => 'm_lang',
'theme' => 'm_theme', 'opener' => 'm_opener');
+ $pass_cat = 0;
+ if (isset($m_var_list_update['cat'])) {
+ $pass_cat = 1;
+ }
$ret = GenerateModuleEnv_NEW('m', $module_vars);
+ if ($pass_cat) {
+ $ret['pass_category'] = 1;
+ }
if( isset($GLOBALS['m_var_list_update']['cat']) ) unset($GLOBALS['m_var_list_update']['cat']);
return $ret;
}
function m_GetVar($name)
{
// get variable from template variable's list
global $m_var_list, $m_var_list_update;
return isset($m_var_list_update[$name]) ? $m_var_list_update[$name] : $m_var_list[$name];
}
function LoadRelatedItems(&$Relations,&$RelatedItems,$ResourceId)
{
global $objItemTypes;
if(!is_object($Relations))
{
$Relations = new clsRelationshipList();
}
//$Relations->debuglevel = 2;
if ($ResourceId != '') {
$sql = sprintf("SELECT RelationshipId, Type, Enabled, Priority,
IF(TargetId = %1\$s, TargetId, SourceId) AS SourceId,
IF(TargetId = %1\$s, SourceId, TargetId) AS TargetId,
IF(TargetId = %1\$s, TargetType, SourceType) AS SourceType,
IF(TargetId = %1\$s, SourceType, TargetType) AS TargetType
FROM %%s", $ResourceId);
$where = "((SourceId=$ResourceId) OR (TargetId=$ResourceId AND Type=1)) AND Enabled=1";
$Relations->LoadRelated($where,"",$sql);
$ids = array();
if($Relations->NumItems()>0)
{
foreach($Relations->Items as $r)
{
if($r->Get("SourceId")==$ResourceId)
{
$ids[$r->Get("TargetType")][] = $r->Get("TargetId");
}
if($r->Get("TargetId")==$ResourceId && $r->Get("Type")==1)
{
$ids[$r->Get("SourceType")][] = $ResourceId;
}
}
foreach($ids as $ItemType=>$idlist)
{
$Item =& $objItemTypes->GetItem($ItemType);
if( !is_object($Item) )
{
if( isDebugMode() ) echo 'Item with RID [<b>'.$ResourceId.'</b>] has <b>invalid relation</b> to items with RIDS: <b>'.print_r($idlist, true).'</b><br>';
continue;
}
$table = GetTablePrefix().$Item->Get("SourceTable");
if($ItemType!=1)
{
$cattable = GetTablePrefix()."CategoryItems";
$sql = "SELECT *,CategoryId FROM $table INNER JOIN $cattable ON ";
$sql .=" ($table.ResourceId=$cattable.ItemResourceId) WHERE $table.Status=1 AND PrimaryCat=1 ";
$sql .=" AND ResourceId IN (".implode(",",$ids[$ItemType]).")";
}
else
{
$sql = "SELECT *,CategoryId FROM $table ";
$sql .="WHERE $table.Status=1 ";
$sql .=" AND ResourceId IN (".implode(",",$ids[$ItemType]).")";
}
// echo $sql."<br>\n";
$RelatedItems->Query_Item($sql,-1,-1,$ItemType);
}
}
}
}
/*
@description: Inserts the html from a remote source
@attrib: _url:: Remote URL to include
@attrib: _StartPos:: Numeric start point of text to include, or string match
@attrib: _EndPos:: Numeric end point of text to include, or string match
@example: <inp:m_insert_url _Url="http://www.google.com" _StartPos="\<center\>" _EndPos="\</center\>" />
*/
function m_insert_url($attribs=array())
{
global $pathtoroot;
$url = $attribs["_url"];
$StartPos = $attribs["_startpos"];
$EndPos = $attribs["_endpos"];
$socket = new Socket($url,0,NULL);
$txt = $socket->socket_read_all();
$lines = explode("\n",$txt);
$txt = substr($txt,strpos($txt,"<"));
$tmp = strtolower($txt);
$bodypos = strpos($tmp,"<body");
if(strlen($bodypos)>0)
{
$head = substr($txt,0,$bodypos-1);
$body = substr($txt,$bodypos);
if(substr($tmp,-7)=="</html>")
$body = substr($body,0,-7);
}
else
$body = $txt;
if(strlen($body))
{
if(strlen($StartPos))
{
if(!is_numeric($StartPos))
{
$start = strpos($body,$StartPos);
}
else
$start = (int)$StartPos;
}
else
$start = 0;
if(strlen($EndPos))
{
if(!is_numeric($EndPos))
{
$end = strpos($body,$EndPos,$start) + strlen($EndPos);
}
else
$end = (int)$EndPos;
}
else
$end = NULL;
$o = substr($body,$start,$end-$start);
}
return $o;
}
/*
@description: Displays a template depending on the login status of the user
@attrib: _logintemplate:tpl: template to display when the user is NOT logged in
@attrib: _LoggedinTemplate:tpl: template to display when the user is logged in
@example: <inp:m_loginbox _LoginTemplate="right_login" _LoggedInTemplate="right_loggedin" />
*/
function m_loginbox($attribs = array())
{
global $var_list, $objSession, $objUsers, $objTemplate;
$userid = $objSession->Get('PortalUserId');
if ($userid <= 0) {
if ( getArrayValue($attribs, '_logintemplate')) {
$t = $objTemplate->ParseTemplate($attribs['_logintemplate']);
}
return $t;
}
else {
$user =& $objUsers->GetItem($userid);
if (getArrayValue($attribs, '_loggedintemplate')) {
$t = $user->ParseTemplate($attribs['_loggedintemplate']);
}
return $t;
}
}
/*
@description: result of suggest site action
*/
function m_suggest_result()
{
global $objSession;
$ret = $objSession->GetVariable('suggest_result');
$objSession->SetVariable('suggest_result', '');
return $ret;
}
/*
@description: result of subscribe to mailing list action
*/
function m_subscribe_result()
{
global $SubscribeResult;
if(strlen($SubscribeResult))
return language($SubscribeResult);
return "";
}
/*
@description: email address of user subscribing to mailing list
*/
function m_subscribe_address()
{
global $objSession;
return $objSession->GetVariable('SubscribeAddress');
}
/*
@description: Error message of subscribe to mailing list action
*/
function m_subscribe_error()
{
global $objSession;
$error_phrase = $objSession->GetVariable('SubscribeError');
return $error_phrase ? language($error_phrase) : '';
}
/*
@description: Displays a prompt for a form field
@attrib: _Form:: Form name for the field
@attrib: _Field:: Field Name
@attrib: _LangText:lang: Language var to use for field label
@attrib: _plaintext:: Plain text to use for field label (langtext is used by default if both are set)
@attrib: _Template:tpl: template used to display the field label (if not set "<inp:form_prompt />" is used
@attrib: _ErrorTemplate:tpl: If the field is in an error state (ie missing input) this template is used. Will default to the normal template if not set
*/
function m_form_prompt($attribs = array())
{
global $FormError, $objTemplate, $objConfig;
$form = strtolower($attribs["_form"]);
$field = strtolower($attribs["_field"]);
if($form=="m_register" && ($field=="password" || $field=="passwordverify") && $objConfig->Get("User_Password_Auto"))
{
$o = "";
}
else
{
$t = $attribs["_template"];
if(!strlen($t))
{
$templateText = "<inp:form_prompt />";
}
$e = $attribs["_errortemplate"];
if(!strlen($e))
$e = $t;
if(strlen($attribs["_langtext"]))
{
$txt = language($attribs["_langtext"]);
}
else
$txt = $attribs["_plaintext"];
if (strtolower($field) == "dob")
{
if (isset($FormError[strtolower($form)][strtolower($field."_day")]) || isset($FormError[strtolower($form)][strtolower($field."_month")]) || isset($FormError[strtolower($form)][strtolower($field."_year")]))
$rawtext = $objTemplate->GetTemplate($e, true);
}
if(isset($FormError[strtolower($form)][strtolower($field)]))
{
$rawtext = $objTemplate->GetTemplate($e);
}
elseif (strlen($t))
$rawtext = $objTemplate->GetTemplate($t);
if(is_object($rawtext))
{
$src = $rawtext->source;
$o = str_replace("<inp:form_prompt />",$txt, $src);
}
else
$o = str_replace("<inp:form_prompt />", $txt, $templateText);
}
return $o;
}
/*
@description: Returns text if system is configured to use auto-generated passwords
@attrib:_LangText:lang:Language tag to return
@attrib:_PlainText::Plain text to return (_LangText takes precedece)
@attrib:_Value:bool:Auto Password setting value to match
*/
function m_autopassword($attribs = array())
{
global $objConfig;
if($attribs["_value"]=="true" || $attribs["_value"]==1)
{
$IsAuto = $objConfig->Get("User_Password_Auto");
}
else
{
$IsAuto = !$objConfig->Get("User_Password_Auto");
}
if($IsAuto)
{
if(strlen($attribs["_langtext"]))
{
$ret = language($attribs["_langtext"]);
}
else
$ret = $attribs["_plaintext"];
if(!$ret)
return "true";
}
return $ret;
}
/*
@description: checks if field specified is equals to value specified
@attrib: _Form:: Form name for the field
@attrib: _Field:: Field Name
@attrib: _Value:: Field value to compare to
@example: <inp:m_field_equals _field="topic_subject" _Form="edit_topic" _Value="test" />true</inp:m_field_equals>
*/
function m_field_equals($attribs = array())
{
global $FormValues;
//print_pre($attribs);
$form = $attribs["_form"];
$field = $attribs["_field"];
if(isset($_POST[$field]))
{
$value = $_POST[$field];
}
else
{
$value = $FormValues[$form][$field];
if (is_array($value))
{
$value = is_null($value['lang_value'])? $value['value'] : $value['lang_value'];
}
}
//echo "POST_VALUE: [$value] vs USER_VALUE: [".$attribs['_value']."]<br>";
return $value == $attribs['_value'] ? 1 : '';
}
/*
@description: creates an INPUT tag for a form field. All extra attributes are passed to the INPUT tag
@attrib: _Form:: Form name for the field
@attrib: _Field:: Field Name
@attrib: _ForgetValue:bool: if true, forget value
@attrib: _Required:bool: If set, In-Portal requires this field have a value when submitting
@example: <inp:m_form_input type="text" class="input" style="width:600px;" _field="topic_subject" _Form="edit_topic" _Required="1" />
*/
function m_form_input($attribs = array())
{
global $FormValues, $objConfig;
$html_attribs = ExtraAttributes($attribs);
$form = $attribs["_form"];
$field = strtolower($attribs["_field"]);
// $field = $attribs["_field"];
$value='';
if(isset($_POST[$field]) && getArrayValue($attribs,'_forgetvalue') != 1)
{
$value = inp_htmlize($_POST[$field],1);
}
else {
if (getArrayValue($attribs,'_forgetvalue') != 1 && getArrayValue($FormValues[$form],$field) ) {
$value = $FormValues[$form][$field];
if (is_array($value))
{
$value = is_null($value['lang_value'])? $value['value'] : $value['lang_value'];
}
$value = inp_htmlize($value);
}
}
if($form=='new_pm' && $field=='pm_subject' && !get_magic_quotes_gpc())
{
$value = stripslashes($value);
}
// print_pre($FormValues);
// echo $form.".".$field."=".$value." = ".$attribs['_forgetvalue']."<br>\n";
if($form=="m_register" && ($field=="password" || $field=="passwordverify") && $objConfig->Get("User_Password_Auto"))
{
$ret = "";
}
else
{
$ret = "<INPUT ".$html_attribs." name=\"$field\" VALUE=\"$value\" />";
if(getArrayValue($attribs,'_required'))
$ret .= "<input type=hidden name=\"required[]\" VALUE=\"$field\" />";
if(getArrayValue($attribs,'_custom'))
$ret .= "<input type=hidden name=\"custom[]\" VALUE=\"$field\" />";
}
return $ret;
}
/*
@description: creates an INPUT tag (type checkbox) for a form field. All extra attributes are passed to the INPUT tag
@attrib: _Form:: Form name for the field
@attrib: _Field:: Field Name
@attrib: _Value:bool: If true, the radio button is CHECKED
@attrib: _Required:bool: If set, In-Portal requires this field have a value when submitting
@attrib: _Custom:bool: If set, handled as a custom field
@example: <inp:m_form_checkbox _field="owner_notify" _Form="edit_topic" />
*/
function m_form_checkbox($attribs = array())
{
global $FormValues, $objConfig;
$html_attribs = ExtraAttributes($attribs);
$form = $attribs['_form'];
$field = strtolower($attribs['_field']);
if(isset($_POST[$field]))
{
$value = (int)$_POST[$field];
if($value==1) $checked = ' CHECKED';
}
else
{
$value = $FormValues[$form][$field];
if (is_array($value)) {
$value = $value['value'];
}
if ((int)$value==1) {
$checked = ' CHECKED';
}
}
//echo $form.".".$field."=".$value."<br>\n";
$ret = "<INPUT TYPE=\"checkbox\" $html_attribs name=\"$field\" VALUE=\"1\" $checked />";
if($attribs["_required"])
$ret .= "<input type=hidden name=\"required[]\" VALUE=\"$field\" />";
if($attribs["_custom"])
$ret .= "<input type=hidden name=\"custom[]\" VALUE=\"$field\" />";
$ret .= '<input type="hidden" name="form_fields[]" VALUE="'.$field.'" />';
return $ret;
}
/*
@description: creates an INPUT tag (type radio) for a form field. All extra attributes are passed to the INPUT tag
@attrib: _Form:: Form name for the field
@attrib: _Field:: Field Name
@attrib: _Value:: Value assigned to radio button. If the form field value matches this attribute, the radio button is CHECKED
@attrib: _Required:bool: If set, In-Portal requires this field have a value when submitting
@attrib: _Default:string: Default value for radiobutton if not checked
@attrib: _Custom:bool: If set, handled as a custom field
@example: <inp:m_form_radio _field="owner_notify" _Form="edit_topic" />
*/
function m_form_radio($attribs = array())
{
global $FormValues, $objConfig;
$html_attribs = ExtraAttributes($attribs);
$form = $attribs['_form'];
$field = strtolower($attribs['_field']);
$val = $attribs['_value'];
if( GetVar($field) !== false )
{
$value = GetVar($field);
if($value == $val) $checked = ' CHECKED';
}
else
{
$value = $FormValues[$form][$field];
if (is_array($value))
{
$value = $value['value'];
}
if( !isset($value) && getArrayValue($attribs,'_default') ) $value = $val;
if($value==$val) $checked=' CHECKED';
}
//echo $form.".".$field."=".$value."<br>\n";
$ret = "<INPUT TYPE=\"radio\" $html_attribs name=\"$field\" VALUE=\"$val\" $checked />";
if($attribs["_required"])
$ret .= "<input type=hidden name=\"required[]\" VALUE=\"$field\" />";
if($attribs["_custom"])
$ret .= "<input type=hidden name=\"custom[]\" VALUE=\"$field\" />";
return $ret;
}
/*
@description: returns the value for a form field. This may be defaulted by the system or set by a previus submit (as in an error condition)
@attrib: _Form:: Form name for the field
@attrib: _Field:: Field Name
@example: <inp:m_form_value _field="owner_notify" _Form="edit_topic" />
*/
function m_form_value($attribs = array())
{
global $FormValues;
$form = $attribs["_form"];
$field = strtolower($attribs["_field"]);
if(isset($_POST[$field]))
{
$value = inp_htmlize($_POST[$field],1);
}
elseif(getArrayValue($_GET, 'search_type') == 'advanced')
{
$value = '';
}
else
{
$value = inp_htmlize($FormValues[$form][$field], 1);
if (is_array($value))
{
$value = is_null($value['lang_value'])? $value['value'] : $value['lang_value'];
}
$value = inp_htmlize($value, 1);
}
//echo "<pre>"; print_r($FormValues); echo "</pre>";
return $value;
}
/*
@description: creates an form OPTION tag for a form SELECT tag.
All extra attributes are passed to the OPTION tag.
@attrib: _Form:: Form name for the field
@attrib: _Field:: Field Name
@attrib: _Value:: Value to use for this option (ie the value attribute) If the current value of the select
field is the same as this attribute, then this option will be set SELECTED.
@attrib: _langtext:lang: language tag to display for this option in the SELECT dropdown
@attrib: _plaintext:: plain text to display for this option in the SELECT dropdown (if _langtext is set, it is used instead of _plaintext)
@example: <inp:m_form_option _value="3321" _field="formfield" _form="formname" _langtext="lu..."
*/
function m_form_option($attribs = array())
{
global $FormValues, $objSession;
$html_attribs = ExtraAttributes($attribs);
$field = getArrayValue($attribs, "_field");
$form = getArrayValue($attribs, "_form");
$val = getArrayValue($attribs, "_value");
if(isset($_POST[$field]))
{
$value = $_POST[$field];
}
else
{
$value = isset($FormValues[$form][$field]) ? $FormValues[$form][$field] : $objSession->GetPersistantVariable($field);
// No need to read lan_value since it's options/drop-down field
if (is_array($value))
$value = $value['value'];
}
$selected = (strtolower($val) == strtolower($value))? "SELECTED" : "";
//echo "Sel $field = $value: $selected<br>";
if( getArrayValue($attribs,'_langtext') )
{
$txt = language($attribs["_langtext"]);
}
else
$txt = $attribs["_plaintext"];
$o = "<OPTION $html_attribs VALUE=\"$val\" $selected>$txt</OPTION>";
return $o;
}
function m_form_custom_options($attribs = array())
{
global $FormValues, $objSession;
$html_attribs = ExtraAttributes($attribs);
$form = $attribs['_form'];
$field = $attribs['_field'];
$application =& kApplication::Instance();
$item_type = $application->getUnitOption($attribs['_prefix'], 'ItemType');
$sql = 'SELECT ValueList FROM '.GetTablePrefix().'CustomField WHERE FieldName = %s AND Type = %s';
$values = $application->Conn->GetOne( sprintf($sql, $application->DB->qstr($field), $item_type ) );
if(!$values) return '';
if( GetVar($field) )
{
$value = GetVar($field);
}
else
{
$value = $FormValues[$form][$field];
if( is_array($value) ) $value = $value['value'];
}
$ret = '';
$values = explode(',', $values);
$option_tpl = '<option value="%s"%s>%s</option>';
foreach($values as $mixed_value)
{
$mixed_value = explode('=', $mixed_value);
$label = substr($mixed_value[1],0,1) == '+' ? substr($mixed_value[1],1,strlen($mixed_value[1])) : language($mixed_value[1]);
$selected = $mixed_value[0] == $value ? ' selected' : '';
$ret .= sprintf($option_tpl, $mixed_value[0], $selected, $label);
}
return $ret;
}
/*
@description: creates an form TEXTAREA field. All extra attributes are passed to the TEXTAREA tag
@attrib: _Form:: Form name for the field
@attrib: _Field:: Field Name
@attrib: _Required:bool: If set, In-Portal requires this field have a value when submitting
@attrib: _Custom:bool: If set, handled as a custom field
@example: <inp:m_form_textarea class="textarea" _field="bb_signature" _Form="bb_profile" ID="textbody" style="width:300px;" ROWS=10 COLS=65 WRAP="VIRTUAL" />
*/
function m_form_textarea($attribs = array())
{
global $FormValues;
$html_attribs = ExtraAttributes($attribs);
$field = $attribs["_field"];
$form = $attribs["_form"];
if(isset($_POST[$field]))
{
$value = inp_htmlize($_POST[$field],1);
}
else
{
$value = $FormValues[$form][$field];
if (is_array($value)) $value = $value['value'];
$value = inp_htmlize($value);
}
$ret = "<TEXTAREA NAME=\"$field\" $html_attribs>$value</TEXTAREA>";
if( getArrayValue($attribs,'_required') )
{
$ret .= "<input type=hidden name=required[] VALUE=\"$field\" />";
}
if( getArrayValue($attribs,'_custom') )
{
$ret .= "<input type=hidden name=\"custom[]\" VALUE=\"$field\" />";
}
return $ret;
}
/*
@description: creates an form field to upload images. (INPUT type=file) All extra attributes are passed to the INPUT tag
@attrib: _Form:: Form name for the field
@attrib: _Field:: Field Name
@attrib: _Required:bool: If set, In-Portal requires this field have a value when submitting
@attrib: _ImageTypes:: Comma-separated list of file extensions allowed
@attrib: _Thumbnail:bool: If true, image is treated as a thumbnail
@attrib: _ImageName:: System name of image being uploaded
@attrib: _MaxSize:int: Maximum size of image to upload, or 0 to allow all
*/
function m_form_imageupload($attribs = array())
{
$html_attribs = ExtraAttributes($attribs);
$field = $attribs["_field"];
$form = $attribs["_form"];
$TypesAllowed = getArrayValue($attribs,'_imagetypes');
$isthumb = (int)getArrayValue($attribs,'_thumbnail');
$imgname = getArrayValue($attribs,'_imagename');
$maxsize = getArrayValue($attribs,'_maxsize');
$is_default = getArrayValue($attribs, '_default');
$ret = "<INPUT $html_attribs TYPE=file NAME=\"$field\" >";
$ret .= "<INPUT TYPE=HIDDEN name=\"isthumb[$field]\" VALUE=\"$isthumb\">";
$ret .= "<INPUT TYPE=HIDDEN name=\"imagetypes[$field]\" VALUE=\"$TypesAllowed\">";
$ret .= "<INPUT TYPE=HIDDEN name=\"imagename[$field]\" VALUE=\"$imgname\">";
$ret .= "<INPUT TYPE=HIDDEN name=\"maxsize[$field]\" VALUE=\"$maxsize\">";
if($is_default) $ret .= '<input type="hidden" name="imgdefault['.$field.']" value="1">';
if( getArrayValue($attribs,'_required') )
{
$ret .= "<input type=hidden name=required[] VALUE=\"$field\" />";
}
return $ret;
}
/*
@description: Returns the error text for a form field, or nothing if no error exists for the field
@attrib: _Form:: Form name for the field
@attrib: _Field:: Field Name
*/
function m_form_error($attribs = array())
{
global $FormError;
$form = $attribs["_form"];
$field = $attribs["_field"];
return $FormError[$form][$field];
}
/**
@description: Provides a simple solution for displaying a language flag when a form has an error. Generic and limited to 1 language vairable.
@attrib: _Form:: Form name for the field
*/
function m_form_has_errors($attribs = array())
{
// shows specified template once if form has error(-s)
global $FormError;
$f = $attribs["_form"];
$ret = is_array($FormError[$f]);
if(!$ret) return '';
return isset($attribs["_asif"]) ? true : language('lu_errors_on_form');
}
/**
@description: Lists form errors for all fields in a form
@attrib: _Form:: Form name for the field
@attrib: _ItemTemplate:tpl: Template used to display each form error (if not set, "<inp:form_error />" is used)
*/
function m_list_form_errors($attribs = array())
{
global $FormError, $content_set, $objTemplate;
$t = $attribs["_itemtemplate"];
if(!strlen($t))
$templateText = "<inp:form_error />";
$f = $attribs["_form"];
$o = "";
if (strlen($t))
{
$rawtext = $objTemplate->GetTemplate($t, true);
$src = $rawtext->source;
}
else
$src = $templateText;
//echo $f."<br>";
//echo $t."<br>";
// echo "<PRE>"; print_r($FormError); echo "</pre>";
if( getArrayValue($FormError,$f) && is_array($FormError[$f]))
{
foreach($FormError[$f] as $e)
{
$o .= str_replace("<inp:form_error />",$e, $src);
}
}
if(!strlen($o))
$content_set = 0;
return $o;
}
function m_form_load_values($FormName,$IdValue)
{
global $FormValues, $objUsers, $objSession, $objConfig;
switch($FormName)
{
case "m_acctinfo":
$u =& $objUsers->GetItem($IdValue);
$FormValues[$FormName]["username"] = $u->Get("Login");
//$FormValues[$FormName]["password"] = $u->Get("Password");
//$FormValues[$FormName]["passwordverify"] = $u->Get("Password");
$FormValues[$FormName]["password"] = "";
$FormValues[$FormName]["passwordverify"] = "";
$FormValues[$FormName]["firstname"] = $u->Get("FirstName");
$FormValues[$FormName]["lastname"] = $u->Get("LastName");
$FormValues[$FormName]["company"] = $u->Get("Company");
$FormValues[$FormName]["email"] = $u->Get("Email");
$FormValues[$FormName]["phone"] = $u->Get("Phone");
$FormValues[$FormName]["fax"] = $u->Get("Fax");
$FormValues[$FormName]["street"] = $u->Get("Street");
$FormValues[$FormName]["street2"] = $u->Get("Street2");
$FormValues[$FormName]["city"] = $u->Get("City");
$FormValues[$FormName]["state"] = $u->Get("State");
$FormValues[$FormName]["zip"] = $u->Get("Zip");
$FormValues[$FormName]["country"] = $u->Get("Country");
$FormValues[$FormName]["minpwresetdelay"] = $u->Get("MinPwResetDelay");
// $FormValues[$FormName]["dob"] = LangDate($u->Get("dob"), 0, true);
$FormValues[$FormName]["dob_day"] = adodb_date("d", $u->Get("dob"));
$FormValues[$FormName]["dob_year"] = adodb_date("Y", $u->Get("dob"));
$FormValues[$FormName]["dob_month"] = adodb_date("m", $u->Get("dob"));
$u->LoadCustomFields();
if(is_array($u->CustomFields))
{
foreach($u->CustomFields as $f=>$v)
{
$FormValues[$FormName][$f] = $v;
}
}
break;
case "m_profile":
$u =& $objUsers->GetItem($IdValue);
if(is_object($u))
{
$FormValues[$FormName]["pp_firstname"] = $objSession->GetPersistantVariable("pp_firstname");
$FormValues[$FormName]["pp_lastname"] = $objSession->GetPersistantVariable("pp_lastname");
$FormValues[$FormName]["pp_dob"] = $objSession->GetPersistantVariable("pp_dob");
$FormValues[$FormName]["pp_email"] = $objSession->GetPersistantVariable("pp_email");
$FormValues[$FormName]["pp_phone"] = $objSession->GetPersistantVariable("pp_phone");
$FormValues[$FormName]["pp_street"] = $objSession->GetPersistantVariable("pp_street");
$FormValues[$FormName]["pp_city"] = $objSession->GetPersistantVariable("pp_city");
$FormValues[$FormName]["pp_state"] = $objSession->GetPersistantVariable("pp_state");
$FormValues[$FormName]["pp_zip"] = $objSession->GetPersistantVariable("pp_zip");
$FormValues[$FormName]["pp_country"] = $objSession->GetPersistantVariable("pp_country");
}
break;
case "m_simplesearch":
$FormValues[$FormName]["keywords"] = $objSession->GetVariable("Search_Keywords");
break;
case "m_simple_subsearch":
$FormValues[$FormName]["keywords"] = $objSession->GetVariable("Search_Keywords");
break;
}
}
/*
@description: Generates the ACTTION property for a FORM tag used by In-Portal
@attrib: _Template:tpl: If set, this is the template the form submits to (default is the current template)
@attrib: _Form:: The form name<br>Possible Values:
<UL>
<LI>login: user login
<LI>logout: user logout
<LI>forgotpw: Form to prompt the user for forgotten password information
<LI>forgotpw_confirm: confirmation form for forgotpw
<LI>suggest: form to suggest the site to a friend
<LI>suggest_confirm: form to confirm suggestion of the site to a friend
<LI>m_subscribe: form to subscribe to the mailing list
<LI>subscribe_confirm: form to confirm subscription to the mailing list
<LI>m_unsubscribe: form to unsubscribe from the mailing list
<LI>unsubscribe_confirm: form to confirm un-subscription from the mailing list
<LI>m_acctinfo: user account information
<LI>m_profile: system-level profile information
<LI>m_register: New User registration form
<LI>m_addcat: Suggest Category form
<LI>m_addcat_confirm: Confirmation for add category
<LI>m_simplesearch: Perform a simple search
<LI>m_simple_subsearch: Search within results
<LI>m_adv_searchtype: Form to select type of advanced search
<LI>m_adv_subsearch: Advanced Search
<LI>m_sort_cats: Sort categories
<LI>error_access: form displayed on the access denied template
<LI>error_template: Form displayed on the template error page
<LI>m_set_theme: Form displayed for theme selection
</UL>
@attrib: _SubscribeTemplate:tpl: The destination template with "m_subscribe", "subscribe_confirm", "unsubscribe_confirm" _Form actions. Can be reused in other scenarios as programmed.
@attrib: _UnSubscribeTemplate:tpl: The destination template for "m_subscribe" _Form action. Can be reused in other scenarios as programmed.
@attrib: _ConfirmTemplate:tpl: The destination template for "m_unsubscribe", "suggest" _Form actions. Can be reused in other scenarios as programmed.
@attrib: _DestTemplate:tpl: The destination template for "suggest_confirm", "suggest" _Form actions. Can be reused in other scenarios as programmed.
@attrib: _ErrorTemplate:tpl: The destination template extensively used in most of _Form actions in case of error.
@attrib: _Referer:bool: The destination template will be taken from referer page we can from.
@example: <FORM enctype="multipart/form-data" method="POST" NAME="article_review" ACTION="<inp:m_form_action _Form="register" _confirm="join_confirm" />">
*/
function m_form_action($attribs = array())
{
global $var_list, $var_list_update, $m_var_list_update, $objSession, $objConfig, $objCatList;
$var_list_update['t'] = getArrayValue($attribs, '_template') ? $attribs['_template'] : $var_list['t'];
$ret = '';
$form = strtolower( $attribs['_form'] );
$url_params = Array();
switch($form)
{
case 'login':
if( !$objSession->SessionEnabled() )
{
$var_list_update['t'] = 'error_session';
}
else
{
$url_params = Array('Action' => 'm_login');
if( getArrayValue($attribs, '_successtemplate') )
{
$url_params['dest'] = $attribs['_successtemplate'];
}
else
{
if( getArrayValue($var_list, 'dest') )
{
$var_list_update['t'] = $var_list['dest'];
// $url_params['dest'] = $var_list['dest'];
}
}
$url_params['pass'] = 'all';
}
break;
case 'logout':
$url_params = Array('Action' => 'm_logout');
break;
case 'forgotpw':
if(!$objSession->SessionEnabled())
{
$var_list_update['t'] = 'error_session';
}
else
{
$url_params = Array('Action' => 'm_forgotpw');
$url_params['error'] = getArrayValue($attribs, '_errortemplate') ? $attribs['_errortemplate'] : $var_list['t'];
if( getArrayValue($attribs, '_confirm') ) $url_params['Confirm'] = $attribs['_confirm'];
}
break;
/*case 'forgotpw_confirm':
break;*/
case 'm_sort_cats':
$url_params = Array('Action' => 'm_sort_cats');
break;
case 'suggest':
if( !$objSession->SessionEnabled() )
{
$var_list_update['t'] = 'error_session';
}
else
{
$url_params = Array('Action' => 'm_suggest_email');
if( getArrayValue($attribs, '_confirmtemplate') )
{
$url_params['Confirm'] = $attribs['_confirmtemplate'];
$url_params['DestTemplate'] = $var_list['t'];
}
if( getArrayValue($attribs, '_errortemplate') ) $url_params['Error'] = $attribs['_errortemplate'];
}
break;
case 'suggest_confirm':
if( !$objSession->SessionEnabled() )
{
$var_list_update['t'] = 'error_session';
}
else
{
$var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : 'index';
}
break;
case 'm_subscribe':
if( !$objSession->SessionEnabled() )
{
$var_list_update['t'] = 'error_session';
}
else
{
$url_params = Array('Action' => 'm_subscribe_confirm');
$params_map = Array('_subscribetemplate' => 'Subscribe', '_unsubscribetemplate' => 'Unsubscribe', '_errortemplate' => 'Error');
MapTagParams($url_params, $attribs, $params_map);
}
break;
case 'subscribe_confirm':
$url_params = Array('Action' => 'm_subscribe');
$params_map = Array('_subscribetemplate' => 'Subscribe');
MapTagParams($url_params, $attribs, $params_map);
break;
case 'unsubscribe_confirm':
$url_params = Array('Action' => 'm_unsubscribe');
$params_map = Array('_subscribetemplate' => 'Subscribe');
MapTagParams($url_params, $attribs, $params_map);
break;
case 'm_unsubscribe':
$params_map = Array('_confirmtemplate' => 'ErrorTemplate');
MapTagParams($url_params, $attribs, $params_map);
if( !$objSession->SessionEnabled() )
{
$var_list_update['t'] = 'error_session';
}
else
{
$url_params['Action'] = 'm_unsubscribe';
if( getArrayValue($attribs, '_confirmtemplate') )
{
$url_params['Confirm'] = $attribs['_confirmtemplate'];
$url_params['DestTemplate'] = $var_list['t'];
}
}
break;
/*case 'm_unsubscribe_confirm':
break;*/
case 'm_acctinfo':
$url_params = Array('Action' => 'm_acctinfo', 'UserId' => $objSession->Get('PortalUserId') );
m_form_load_values( $form, $objSession->Get('PortalUserId') );
break;
case 'm_profile':
$url_params = Array('Action' => 'm_profile', 'UserId' => $objSession->Get('PortalUserId') );
m_form_load_values( $form, $objSession->Get('PortalUserId') );
break;
case 'm_set_theme':
$url_params = Array('Action' => 'm_set_theme');
break;
case 'm_register':
if( !$objSession->SessionEnabled() )
{
$var_list_update['t'] = 'error_session';
}
else
{
$url_params = Array('Action' => 'm_register');
switch ( $objConfig->Get('User_Allow_New') )
{
case 1:
if( getArrayValue($attribs, '_confirmtemplate') && $objConfig->Get('User_Password_Auto') )
{
$url_params['dest'] = $attribs['_confirmtemplate'];
}
else
{
$url_params['dest'] = $attribs['_logintemplate'];
}
break;
case 2:
if( getArrayValue($attribs, '_notallowedtemplate') ) $url_params['dest'] = $attribs['_notallowedtemplate'];
break;
case 3:
if( getArrayValue($attribs, '_pendingtemplate') ) $url_params['dest'] = $attribs['_pendingtemplate'];
break;
}
}
break;
case 'register_confirm':
if( !$objSession->SessionEnabled() ) $var_list_update['t'] = 'error_session';
break;
case 'm_addcat':
if( !$objSession->SessionEnabled() )
{
$var_list_update['t'] = 'error_session';
}
else
{
$url_params = Array('Action' => 'm_add_cat');
if ( $objSession->HasCatPermission('CATEGORY.ADD.PENDING') )
{
$url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ];
$url_params['Action'] = 'm_add_cat_confirm';
}
if ( $objSession->HasCatPermission('CATEGORY.ADD') )
{
$url_params['Confirm'] = $attribs['_confirm'];
$url_params['Action'] = 'm_add_cat_confirm';
}
if( !$url_params['Confirm'] ) unset($url_params['Confirm']);
if ( getArrayValue($attribs, '_mod_finishtemplate') )
{
$CurrentCat = (int)$objCatList->CurrentCategoryID();
if($CurrentCat > 0)
{
$c = $objCatList->GetCategory($CurrentCat);
//will prefix the template with module template root path depending on category
$ids = $c->GetParentIds();
$tpath = GetModuleArray('template');
$roots = GetModuleArray('rootcat');
// get template path of module, by searching for moudle name
// in this categories first parent category
// and then using found moudle name as a key for module template paths array
$path = $tpath[ array_search($ids[0], $roots) ];
$url_params['DestTemplate'] = $path . $attribs['_mod_finishtemplate'];
}
else
{
$url_params['DestTemplate'] = $attribs['_mod_finishtemplate']; //Just in case
}
}
else
{
$url_params['DestTemplate'] = $attribs['_finishtemplate'];
}
}
break;
case 'm_addcat_confirm':
$var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t'];
break;
case 'm_simplesearch':
if( !$objSession->SessionEnabled() )
{
$var_list_update['t'] = 'error_session';
}
else
{
$url_params = Array('Action' => 'm_simple_search');
if( getArrayValue($attribs, '_errortemplate') ) $url_params['Error'] = $attribs['_errortemplate'];
m_form_load_values($form, 0);
}
break;
case 'm_simple_subsearch':
if( !$objSession->SessionEnabled() )
{
$var_list_update['t'] = 'error_session';
}
else
{
$url_params = Array('Action' => 'm_simple_subsearch');
m_form_load_values($form,0);
}
break;
case 'm_adv_search_type':
if( !$objSession->SessionEnabled() )
{
$var_list_update['t'] = 'error_session';
}
else
{
$url_params = Array('Action' => 'm_advsearch_type');
m_form_load_values($form,0);
}
break;
case 'm_adv_search':
$SearchType = getArrayValue($_GET, 'type') ? $_GET['type'] : $_POST['itemtype'];
if( !$objSession->SessionEnabled() && !$SearchType )
{
$var_list_update['t'] = 'error_session';
}
else
{
$url_params = Array('Action' => 'm_adv_search', 'type' => $SearchType);
m_form_load_values($form,0);
}
break;
case 'error_access':
$var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : 'login';
break;
case 'error_template':
$target_template = getArrayValue($_GET, 'DestTemplate');
if($attribs['_referer'] == 1)
{
$target_template = '_referer_';
}
elseif (!$target_template)
{
$target_template = 'index';
}
$var_list_update['t'] = $target_template;
break;
}
return HREF_Wrapper('', $url_params);
}
/*
@description: creates a URL to allow the user to log out. Accepts the same attributes as m_template_link
*/
function m_logout_link($attribs)
{
$query = getArrayValue($attribs, '_query');
$attribs['_query'] = $query.'&Action=m_logout';
$ret = m_template_link($attribs);
return $ret;
}
/*
@description: returns a URL to the current theme
@attrib: _page:: Additional address to be added to the end of the theme URL
*/
function m_theme_url($attribs=array())
{
global $objConfig,$objSession, $objThemes, $CurrentTheme;
if(!is_object($CurrentTheme))
$CurrentTheme = $objThemes->GetItem($m_var_list["theme"]);
$theme_url = PROTOCOL.SERVER_NAME.rtrim(BASE_PATH, '/').'/themes/'.$CurrentTheme->Get('Name').'/';
if(getArrayValue($attribs,'_page'))
{
if ($attribs["_page"] != 'current')
{
$theme_url .= $attribs["_page"];
}
else
{
$theme_url = PROTOCOL.SERVER_NAME.rtrim(BASE_PATH, '/').'/index.php?env='.BuildEnv();
}
}
return $theme_url;
}
/*
@description: returns a URL to the current theme
*/
function m_current_page_url($attribs=array())
{
global $objConfig,$objSession;
$theme_url = "http://".$objConfig->Get("Site_Path")."index.php?env=".BuildEnv();
return $theme_url;
}
/*
@description: returns a URL to the current theme
@attrib: _fullpath:bool: Append the title with the full path of the current category
@attrib: _currentcategory:bool: Append the title with the current category
@attrib: _catfield:: If _currentcategory is used, this attribute determines which category field to use (Name, Description, etc) Defaults to Name
*/
function m_page_title($attribs = array())
{
global $objConfig, $objCatList;
+ $application =& kApplication::Instance();
+ if ($application->isModuleEnabled('In-Edit')) {
+ $title = $application->ProcessTag('cms:PageInfo type="htmlhead_title"');
+ if ($title && !preg_match('/^_Auto.*/', $title)) {
+ return $title;
+ }
+ }
+
$ret = strip_tags( $objConfig->Get('Site_Name') );
if(getArrayValue($attribs,'_fullpath') || getArrayValue($attribs,'_currentcategory'))
{
$CurrentCat = $objCatList->CurrentCategoryID();
if((int)$CurrentCat>0)
{
$c = $objCatList->GetCategory($CurrentCat);
if($attribs["_fullpath"])
{
$application =& kApplication::Instance();
$ml_formatter =& $application->recallObject('kMultiLanguage');
$path = $c->Get($ml_formatter->LangFieldName('CachedNavbar'));
if (strlen($path)) {
$ret .= " - ".str_replace('&|&', ' > ', $path);
}
}
else
{
if($attribs["_currentcategory"])
{
$f = $attribs["_catfield"];
if (!strlen($f)) {
$f = "Name";
}
if ($f == 'Name') $f = $objCatList->TitleField;
$ret .= " - ".$c->Get($f);
}
}
}
}
$ret = stripslashes($ret);
return $ret;
}
/*
@description: list all active themes
@attrib: _ItemTemplate:tpl: Template to display each theme in the list
*/
function m_list_themes($attribs=array())
{
global $objThemes;
$t = $attribs["_itemtemplate"];
if(strlen($t))
{
$objThemes->Clear();
$objThemes->LoadThemes("Enabled=1","PrimaryTheme DESC");
foreach($objThemes->Items as $theme)
{
$o .= $theme->ParseTemplate($t);
}
}
return $o;
}
/*
@description: display text based on the user's language
@attrib: _Phrase:lang: label to replace with language-specific text
@example: <inp:m_language _Phrase="lu_hello_world" />
*/
function m_language($attribs)
{
global $objSession, $objLanguages, $ForceLanguage;
$phrase = $attribs["_phrase"];
$LangId = (int)$ForceLanguage;
if(strlen($phrase))
{
$lang = getArrayValue($attribs,'_language');
if(strlen($lang))
{
$l = $objLanguages->GetItemByField("PackName",$lang);
if(is_object($l))
{
$LangId = $l->Get("LanguageId");
}
}
return language($phrase,$LangId);
}
else
return "";
}
/*
@description: Creates a URL used to set the current language for a user
@attrib: _language:: Language to set (this value should be the language Pack Name)
*/
function m_setlang_link($attribs)
{
global $m_var_list_update, $objSession,$objLanguages;
$lang = getArrayValue($attribs, '_language');
if($lang)
{
$l = $objLanguages->GetItemByField('PackName', $lang);
if( is_object($l) ) $LangId = $l->Get('LanguageId');
}
else
{
$LangId = $objSession->Get('Language');
}
if($LangId)
{
$m_var_list_update['lang'] = $LangId;
$ret = HREF_Wrapper();
unset($m_var_list_update['lang']);
}
else
{
$ret = '';
}
return $ret;
}
/*
@description: list all active languages
@attrib: _ItemTemplate:tpl: Template to display each language in the list
*/
function m_list_languages($attribs)
{
global $objLanguages, $content_set;
$sql = "SELECT * FROM ".GetTablePrefix()."Language WHERE Enabled=1";
$objLanguages->Clear();
$objLanguages->Query_Item($sql);
$o='';
if($objLanguages->NumItems()>0)
{
foreach($objLanguages->Items as $l)
$o .= $l->ParseTemplate($attribs["_itemtemplate"]);
}
else
$content_set=0;
return $o;
}
/*
@description: returns the date format for a language
@attrib: _lang:: Pack Name of language to use. The current language is used if this is not set
*/
function m_lang_dateformat($attribs=array())
{
global $objLanguages, $objSession;
$lang = $attribs["_lang"];
if(!strlen($lang))
{
$LangId = $objSession->Get("Language");
$l = $objLanguages->GetItem($LangId);
}
else
{
$l = $objLanguages->GetItemByField("PackName",$lang);
}
$fmt = GetDateFormat($LangId, true);
$fmt = GetStdFormat($fmt);
return $fmt;
}
/*
@description: returns a language field value
@attrib: _Field:: Language field to return
@attrib: _lang:: Pack Name of language to use. The current language is used if this is not set
*/
function m_lang_field($attribs = array())
{
global $objLanguages, $objSession;
if(!strlen($attribs["_field"]))
return "";
$lang = getArrayValue($attribs,'_lang');
if(!strlen($lang))
{
$LangId = $objSession->Get("Language");
$l = $objLanguages->GetItem($LangId);
}
else
{
$l = $objLanguages->GetItemByField("PackName",$lang);
}
if(is_object($l))
{
//$ret = $l->Get($attribs["_field"]);
$e = new clsHtmlTag();
$e->name=$l->TagPrefix;
$e->attributes=$attribs;
$ret = $l->ParseObject($e);
}
return $ret;
}
/*
@description: Creates a URL used to set the current theme for a user
@attrib: _theme:: Name of Theme to set. The template selected in the new them is always "index"
*/
function m_settheme_link($attribs)
{
global $m_var_list_update, $objSession, $objThemes, $CurrentTheme;
$ThemeName = getArrayValue($attribs, '_theme');
if($ThemeName)
{
$t = $objThemes->GetItemByField('Name',$ThemeName);
$Id = is_object($t) ? $t->Get('ThemeId') : 0;
}
else
{
$t = $CurrentTheme;
$Id = 0;
}
$m_var_list_update['theme'] = $Id;
$ret = HREF_Wrapper();
unset($m_var_list_update['theme']);
return $ret;
}
/*
@description: Initializes categories
*/
function m_init_cats($attribs = array())
{
// save current & previous category (used in pagination)
global $objSession, $objCatList;
global $var_list;
$objSession->SetVariable('prev_category', $objSession->GetVariable('last_category') );
$objSession->SetVariable('last_category', $objCatList->CurrentCategoryID() );
//$last_cat = $objSession->GetVariable('last_category');
//$prev_cat = $objSession->GetVariable('prev_category');
//echo "Last CAT: [$last_cat]<br>";
//echo "Prev CAT: [$prev_cat]<br>";
}
/*
@description: List all subcategories a user is allowed to view
@attrib: _columns:int: Numver of columns to display the categories in (defaults to 1)
@attrib: _maxlistcount:int: Maximum number of categories to list
@attrib: _FirstItemTemplate:tpl: Template used for the first category listed
@attrib: _LastItemTemplate:tpl: Template used for the last category listed
@attrib: _EdItemTemplate:tpl: Editors Pick template used for category list items
@attrib: _ItemTemplate:tpl: default template used for category list items
@attrib: _NoTable:bool: If set to 1, the categories will not be listed in a table. If a table is used, all HTML attributes are passed to the TABLE tag
@example: <inp:m_list_cats _NoTable="0" _columns="2" _ItemTemplate="catlist_element" border="0" cellspacing="0" cellpadding="0" width="98%" />
*/
function m_list_cats($attribs = array())
{
global $var_list, $objConfig, $objSession, $objCatList, $var_list_update, $content_set, $objSystemCache;
$CachedList = GetTagCache("kernel","m_list_cats",$attribs,m_BuildEnv());
if(strlen($CachedList))
{
return $CachedList;
}
$cols = $attribs["_columns"];
if($cols<1)
$cols =1;
$CategoryId = getArrayValue($attribs,'_catid');
if(!is_numeric($CategoryId))
$CategoryId = $objCatList->CurrentCategoryID();
$cat_count = (int)getArrayValue($attribs,'_maxlistcount');
/* validation */
if(strlen($attribs["_itemtemplate"])==0)
{
if($attribs["dataexists"])
$content_set = 0;
return "";
}
$GroupList = $objSession->Get("GroupList");
if(strlen($GroupList))
{
$Groups = explode(",",$GroupList);
}
$acl_where = "";
if(@count($Groups)>0 && is_array($Groups))
{
$acl_where = array();
for($i=0;$i<count($Groups);$i++)
{
$g = $Groups[$i];
$acl_where[] = "FIND_IN_SET($g,acl) ";
}
if(count($acl_where))
{
$acl_where = "(".implode(" OR ",$acl_where).")";
}
else {
$acl_where = "FIND_IN_SET(0,acl)";
}
}
else {
$acl_where = "FIND_IN_SET(0,acl)";
}
$objCatList->Clear();
$OrderBy = $objCatList->QueryOrderByClause(TRUE,TRUE,TRUE);
$objCatList->LoadCategories("ParentId=$CategoryId AND Status=1",$OrderBy, false);
if ($objCatList->NumItems() == 0)
{
if($attribs["_dataexists"])
$content_set = 0;
return "";
}
$html_attr = ExtraAttributes($attribs);
$o="";
$notable = $attribs["_notable"];
$count=0;
$row=0;
$var_list_update["t"] = $var_list["t"];
if(!$notable)
{
$per_row = ceil($objCatList->NumItems()/$cols);
$o = '<table '.$html_attr.'><tr class="m_list_cats">';
$o .= '<td valign="top">';
$CatCount = $objCatList->NumItems();
foreach($objCatList->Items as $cat)
{
$parsed=0;
if($count==$per_row)
{
$o .= '</td><td valign="top">';
$count=0;
}
if($row==0 && strlen($attribs["_firstitemtemplate"]))
{
$o.= $cat->ParseTemplate($attribs["_firstitemtemplate"]);
$parsed=1;
}
if($row==$CatCount-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0)
{
$o .= $cat->ParseTemplate($attribs["_lastitemtemplate"]);
$parsed=1;
}
if(!$parsed)
{
if (getArrayValue($attribs, '_editemtemplate') && (int)$cat->Get('EditorsPick'))
{
$o .= $cat->ParseTemplate($attribs["_editemtemplate"]);
}
else
{
$o .= $cat->ParseTemplate($attribs['_itemtemplate']);
}
}
$count++;
$row++;
}
if($count != $per_row)
$o .= '</td>';
$o .= "\n</tr></table>\n";
}
else
{
$CatCount = $objCatList->NumItems();
foreach($objCatList->Items as $cat)
{
if($cat->Get("ParentId")==$CategoryId)
{
if($row==0 && strlen($attribs["_firstitemtemplate"]))
{
//echo 'Saving <b>ID</b> in <b>m_sub_cats</b>[ first ] '.$cat->UniqueId().'<br>';
//$GLOBALS['cat_ID'] = $cat->UniqueId();
$o.= $cat->ParseTemplate($attribs["_firstitemtemplate"]);
$parsed=1;
}
if($row==$CatCount-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0)
{
//echo 'Saving <b>ID</b> in <b>m_sub_cats</b>[ last ] '.$cat->UniqueId().'<br>';
//$GLOBALS['cat_ID'] = $cat->UniqueId();
$o .= $cat->ParseTemplate($attribs["_lastitemtemplate"]);
$parsed=1;
}
if(!$parsed)
{
//echo 'Saving <b>ID</b> in <b>m_sub_cats</b>[ each ] '.$cat->UniqueId().'<br>';
//$GLOBALS['cat_ID'] = $cat->UniqueId();
$o .= $cat->ParseTemplate($attribs["_itemtemplate"]);
}
$row++;
$i++;
$count++;
if($count>=$cat_count && $cat_count>0)
break;
}
}
}
unset($var_list_update["t"]);
SaveTagCache("kernel","m_list_cats",$attribs,m_BuildEnv(),$o);
return $o;
}
function LoadCatSearchResults($attribs)
{
global $objSession, $objPermissions, $objCatList, $objSearchCats, $objConfig, $CountVal, $m_var_list;
$GroupList = $objSession->Get("GroupList");
if(strlen($GroupList))
$Groups = explode(",",$GroupList);
$acl_where = "";
if(@count($Groups)>0 && is_array($Groups))
{
$acl_where = array();
for($i=0;$i<count($Groups);$i++)
{
$g = $Groups[$i];
$acl_where[] = "FIND_IN_SET($g,acl) ";
}
if(count($acl_where))
{
$acl_where = "(".implode(" OR ",$acl_where).")";
}
else {
$acl_where = "FIND_IN_SET(0,acl)";
}
}
else {
$acl_where = "FIND_IN_SET(0,acl)";
}
$order_by = "EdPick DESC,Relevance DESC";
if ($objSession->GetVariable("Category_Sortfield") != "") {
$order_by = $objSession->GetVariable("Category_Sortfield")." ".$objSession->GetVariable("Category_Sortorder");
}
$CAT_VIEW = $objPermissions->GetPermId("CATEGORY.VIEW");
$ctable = $objCatList->SourceTable;
$stable = $objSession->GetSearchTable(); // $objSearchCats->SourceTable;
$ptable = GetTablePrefix()."PermCache";
$sql = "SELECT * FROM $stable INNER JOIN $ctable ON ($stable.ItemId=$ctable.CategoryId) ";
$sql .= "INNER JOIN $ptable ON ($ctable.CategoryId=$ptable.CategoryId) ";
$sql .="WHERE ItemType=1 AND Status=1 AND $acl_where AND PermId=$CAT_VIEW ORDER BY $order_by ";
$objSearchCats->Page = $m_var_list["p"];
if($objSearchCats->Page<1)
$objSearchCats->Page=1;
if(is_numeric($objConfig->Get($objSearchCats->PerPageVar)))
{
$Start = ($objSearchCats->Page-1)*$objConfig->Get($objSearchCats->PerPageVar);
$limit = "LIMIT ".$Start.",".$objConfig->Get($objSearchCats->PerPageVar);
}
else
$limit = NULL;
if(strlen($limit))
$sql .= $limit;
// echo "TEST:<BR>$sql<br>\n";
$objSearchCats->Query_Item($sql);
$where = "ItemType=1";
$Keywords = GetKeywords($objSession->GetVariable("Search_Keywords"));
//echo "SQL Loaded ItemCount (<b>".get_class($this).'</b>): '.$this->NumItems().'<br>';
for($i = 0; $i < $objSearchCats->NumItems(); $i++)
{
$objSearchCats->Items[$i]->Keywords = $Keywords;
}
if(is_numeric($CountVal[1]))
{
$objSearchCats->QueryItemCount = $CountVal[1];
}
else
{
$objSearchCats->QueryItemCount = QueryCount($sql);
$CountVal[1]= $objSearchCats->QueryItemCount;
}
}
/*
@description: Used in conjuction with m_search_list_cats. This function generates a navigation link which is
used to switch from a short list to a longer list. The page number is not changed.
If this tag is called before the list tag, this function will load the category list.
Generally, it is good practice to duplicate all attributes set for m_search_list_cats.
Any extra HTML attributes are passed to the anchor tag
@attrib: _Template:tpl: Template to link to
@attrib: _text:lang: language tag to include as text for the anchor tag
@attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence
if both are included.
@attrib: _image:: URL to an image to include inside the anchor tag.
*/
function m_search_cat_more($attribs = array())
{
global $objSearchCats, $objConfig, $m_var_list_update;
$html_attribs = ExtraAttributes($attribs);
$DestTemplate = $attribs["_template"];
if($attribs["_shortlist"])
$objSearchList->PerPageVar = "Perpage_Category_Short";
if($objSearchCats->NumItems()==0)
{
LoadCatSearchResults($attribs);
}
$max = $objConfig->Get($objSearchList->PerPageVar);
$val = $objSearchCats->QueryItemCount;
if($val > $max)
{
if($attribs["_root"])
$attribs["_category"]=0;
$m_var_list_update["p"]=1;
$url = m_template_link($attribs);
unset($m_var_list_update["p"]);
$o = "<A $html_attribs HREF=\"$url\">";
$text = $attribs["_text"];
if(!strlen($text))
{
$text = $attribs["_plaintext"];
if(!strlen($text))
{
}
$o .= $text."</A>";
}
else
$o .= language($text);
if(strlen($attribs["_image"]))
{
$o .= "<IMG SRC=\"".$attribs["_image"]."\" BORDER=\"0\" alt=\"\"/>";
}
$o .= "</A>";
}
return $o;
}
/*
@description: Used in conjuction with l_list_cats. This function generates the page navigation
for the list. If this tag is called before the list tag, this function will load
the links. For that reason, the _ListType attribute is required if the pagnav
tag preceeds the l_list_links tag in the template. Generally, it is good practice to
duplicate all attributes set for l_list_links.
@attrib: _PagesToList:int: Number of pages to list (default is 10)
@attrib: _ShortList:bool: If set, uses the shortlist configuration value for links
@attrib: _label:lang: language tag to include in the output if there are pages to list. If there are no pages listed, this text will not be included (resulting in an empty output)
@attrib: _ListType::Determines the type of list to generate<br>
Possible values:<UL>
<LI>Category: List links from the current category (default)
</UL>
*/
function l_cat_pagenav($attribs = array())
{
global $objCatList, $objSession;
$DestTemplate = getArrayValue($attribs,'_template');
$PagesToList = getArrayValue($attribs,'_pagestolist');
$image = getArrayValue($attribs,'_PageIcon');
if(!is_numeric($PagesToList))
$PagesToList = 10;
$CatId = getArrayValue($attribs,'_catid');
if(!is_numeric($CatId))
$CatId = $objCatList->CurrentCategoryID();
if($attribs["_shortlist"] == 1)
$objCatList->PerPageVar = "Perpage_Category_Short";
$ListType = getArrayValue($attribs,'_listtype');
if(!strlen($ListType))
$ListType="category";
/*
if($objLinkList->ListType != $ListType) {
LoadLinkList($attribs);
}
*/
$o = $objCatList->GetPageLinkList($DestTemplate, '', 10, true, ExtraAttributes($attribs) );
if (strlen($image)) {
$o_i = '<img src="'.$image.'" width="9" height="12" alt="">&nbsp;';
}
if(strlen($o) && strlen($attribs["_label"]))
$o = $o_i.language($attribs["_label"]).' '.$o;
return $o;
}
/*
@description: Used in conjuction with m_search_list_cats. This function generates the page navigation
for the list. If this tag is called before the list tag, this function will load
the category list. Generally, it is good practice to duplicate all attributes set for
m_search_list_cats.
@attrib: _PagesToList:int: Number of pages to list (default is 10)
@attrib: _label:lang: language tag to include in the output if there are pages to list. If there are no pages
listed, this text will not be included (resulting in an empty output)
*/
function m_search_cat_pagenav($attribs = array())
{
global $objSearchCats, $objConfig, $objCatList, $objSession;
$DestTemplate = $attribs["_template"];
$PagesToList = $attribs["_pagestolist"];
if(!is_numeric($PagesToList))
$PagesToList = 10;
$CatId = $attribs["_catid"];
if(!is_numeric($CatId))
$CatId = $objCatList->CurrentCategoryID();
$objSearchCats->PerPageVar = "Perpage_Category";
if($attribs["_shortlist"])
$objSearchCats->PerPageVar = "Perpage_Category_Short";
if($objSearchCats->NumItems()==0)
{
LoadCatSearchResults($attribs);
}
$o = $objSearchCats->GetPageLinkList($DestTemplate, '', 10, true, ExtraAttributes($attribs));
if(strlen($o) && strlen($attribs["_label"]))
$o = language($attribs["_label"]).' '.$o;
return $o;
}
/*
@description: List all categories matched in a search
@attrib: _columns:int: Numver of columns to display the categories in (defaults to 1)
@attrib: _maxlistcount:int: Maximum number of categories to list
@attrib: _ShortList:bool: If set, the Perpage_Category_Short setting is used instead of Perpage_Category
@attrib: _FirstItemTemplate:tpl: Template used for the first category listed
@attrib: _LastItemTemplate:tpl: Template used for the last category listed
@attrib: _ItemTemplate:tpl: default template used for category list items
@attrib: _NoTable:bool: If set to 1, the categories will not be listed in a table. If a table is used, all HTML attributes are passed to the TABLE tag
@example: <inp:m_search_list_cats _NoTable="1" _ItemTemplate="category_search_results_element" />
*/
function m_search_list_cats($attribs = array())
{
global $var_list, $objConfig, $objSession, $objCatList, $var_list_update, $content_set,
$objSearchCats, $objPermissions, $m_var_list;
if(!is_object($objSearchCats))
{
$objSearchCats = new clsCatList();
$objSearchCats->SourceTable = $objSession->GetSessionTable('Search'); //"ses_".$objSession->GetSessionKey()."_Search"
$objSearchCats->Clear();
}
$objSearchCats->PerPageVar = "Perpage_Category";
if($attribs["_shortlist"])
{
$objSearchCats->Page=1;
$m_var_list["p"] = 1;
$objSearchCats->PerPageVar = "Perpage_Category_Short";
}
$keywords = $objSession->GetVariable("Search_Keywords"); // for using in all this func branches
if($objSearchCats->NumItems()==0)
{
LoadCatSearchResults($attribs);
//echo "Cat count: ". $objSearchCats->QueryItemCount;
$ret = 0;
if ($keywords) {
foreach ($objSearchCats->Items as $cat) {
if (strstr(strip_tags(strtolower($cat->Data[$cat->TitleField])), strtolower($_POST['keywords'])) || strstr(strip_tags(strtolower($cat->Data[$cat->DescriptionField])), strtolower($_POST['keywords']))) {
$ret++;
}
}
}
else {
$ret = $objSearchCats->QueryItemCount;
}
if ($ret == 0) //if ($objSearchCats->NumItems() == 0)
{
$content_set = 0;
return language("lu_no_categories");
}
}
$html_attr = ExtraAttributes($attribs);
$cols = $attribs["_columns"];
if($cols<1)
$cols =1;
$cat_count = (int)$attribs["_maxlistcount"];
/* validation */
if(strlen($attribs["_itemtemplate"])==0)
{
$content_set = 0;
return "ERROR -1";
}
$o="";
$notable = $attribs["_notable"];
$max_categories = $objConfig->Get($objSearchCats->PerPageVar);
$count=0;
$row=0;
$var_list_update["t"] = $var_list["t"];
if(!$notable)
{
$per_row = ceil($objCatList->NumItems()/$cols);
$o = "<TABLE $html_attr><TR CLASS=\"m_list_cats\">";
$o .= "<TD valign=\"top\">";
foreach($objSearchCats->Items as $cat)
{
$parsed=0;
if($count==$per_row)
{
$o .= "</TD><TD valign=\"top\">";
$count=0;
}
if($row==0 && strlen($attribs["_firstitemtemplate"]))
{
$o.= $cat->ParseTemplate($attribs["_firstitemtemplate"]);
$parsed=1;
}
if($row==$objSearchCats->NumItems()-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0)
{
$o .= $cat->ParseTemplate($attribs["_lastitemtemplate"]);
$parsed=1;
}
if(!$parsed)
$o.= $cat->ParseTemplate($attribs["_itemtemplate"]);
$count++;
}
if($count != $per_row)
$o .= "</TD>";
$o .= "\n</tr></table>\n";
}
else
{
//echo "<pre>"; print_r($objSearchCats->Items); echo "</pre>";
foreach($objSearchCats->Items as $cat)
{
//$cat->Keywords = GetKeywords($objSession->GetVariable("Search_Keywords"));
/* $keywords_found = strstr( strip_tags(strtolower($cat->Data[$objCatList->TitleField])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data[$cat->DescriptionField])), strtolower($keywords));
if(!$keywords) $keywords_found = true;
if ($keywords_found) {*/
if($row==0 && strlen($attribs["_firstitemtemplate"]))
{
$o.= $cat->ParseTemplate($attribs["_firstitemtemplate"]);
$parsed=1;
}
if($row==$objSearchCats->NumItems()-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0)
{
$o .= $cat->ParseTemplate($attribs["_lastitemtemplate"]);
$parsed=1;
}
if(!$parsed)
$o.= $cat->ParseTemplate($attribs["_itemtemplate"]);
$row++;
$i++;
$count++;
if($count == $max_categories) break;
// }
}
}
unset($var_list_update["t"]);
return $o;
}
/*
@description: Parse a template based on the current advanced search type
@attrib:_TypeSelect:tpl:Template to parse if no item type has been selected
@attrib:_ItemSelect:tpl:Template to parse if an item type has been selected to search
*/
function m_advsearch_include($attribs)
{
global $objTemplate;
$TypeSelectTemplate = $attribs["_typeselect"];
$ItemTemplate = $attribs["_itemselect"];
if((strlen($_GET["type"])>0 || $_POST["itemtype"]>0) && ($_GET["Action"]=="m_advsearch_type" || $_GET["Action"]=="m_adv_search"))
{
$o = $objTemplate->ParseTemplate($ItemTemplate);
}
else
$o = $objTemplate->ParseTemplate($TypeSelectTemplate);
return $o;
}
/*
@description: Returns the name of the item type currently being advanced searched
@attrib::_plaintext:bool:If set, simply returns the name of the item if not, builds a language tag (lu_searchtitle_[name])
*/
function m_advsearch_type($attribs)
{
global $objItemTypes;
if($_GET["Action"]=="m_advsearch_type")
{
$ItemType = $_POST["itemtype"];
}
elseif($_GET["Action"]=="m_adv_search")
$ItemType = $_GET["type"];
$o = "";
if((int)$ItemType>0)
{
$Item = $objItemTypes->GetItem($ItemType);
if(is_object($Item))
{
$name = strtolower($Item->Get("ItemName"));
if($attribs["_plaintext"])
{
$o .= $name;
}
else
$o = language("lu_searchtitle_".strtolower($name));
}
}
return $o;
}
/*
@description: Lists advanced search fields for the selected item type
@attrib: _FirstItemTemplate:tpl: Template used for the first field listed
@attrib: _LastItemTemplate:tpl: Template used for the last field listed
@attrib: _AltLastItemTemplate:tpl: Altername Template used for the last field listed
@attrib: _ItemTemplate:tpl: default template used for field list items
@attrib: _AltTemplate:tpl: Alternate template used for field list items
*/
function m_advsearch_fields($attribs)
{
global $objItemTypes, $objTemplate, $objSearchConfig;
if(!is_object($objSearchConfig))
$objSearchConfig = new clsSearchConfigList();
if($_GET["Action"]=="m_advsearch_type")
{
$ItemType = $_POST["itemtype"];
}
elseif($_GET["Action"]=="m_adv_search")
$ItemType = $_GET["type"];
$o = "";
if((int)$ItemType>0)
{
$Item = $objItemTypes->GetItem($ItemType);
if(is_object($Item))
{
$name = strtolower($Item->Get("ItemName"));
$table = $Item->Get("SourceTable");
//$sql = "SELECT * FROM ".$objSearchConfig->SourceTable." WHERE TableName='$table' AND AdvancedSearch=1 ORDER BY DisplayOrder";
$sql = "SELECT sc.* FROM ".$objSearchConfig->SourceTable." AS sc LEFT JOIN ".GetTablePrefix()."CustomField AS cf ON sc.CustomFieldId = cf.CustomFieldId WHERE (TableName='$table' OR ((TableName='".GetTablePrefix()."CustomField' OR TableName='CustomField') AND cf.Type = $ItemType)) AND AdvancedSearch=1 ORDER BY sc.DisplayOrder";
$objSearchConfig->Query_Item($sql);
$row=0;
if(is_array($objSearchConfig->Items))
{
$ItemCount = count($objSearchConfig->Items);
foreach($objSearchConfig->Items as $s)
{
$even = (($row+1) % 2 == 0);
$parsed=0;
if($row==0 && strlen($attribs["_firstitemtemplate"]))
{
$o .= $s->ParseTemplate($attribs["_firstitemtemplate"]);
$parsed=1;
}
if($row==$ItemCount-1 && $even && !$parsed && strlen($attribs["_altlastitemtemplate"])>0)
{
$o .= $s->ParseTemplate($attribs["_altlastitemtemplate"]);
$parsed=1;
}
if($row==$ItemCount-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0)
{
$o .= $s->ParseTemplate($attribs["_lastitemtemplate"]);
$parsed=1;
}
if(!$parsed)
{
if($even && strlen($attribs["_altitemtemplate"])>0)
{
$o .= $s->ParseTemplate($attribs["_altitemtemplate"]);
}
else
$o .= $s->ParseTemplate($attribs["_itemtemplate"]);
}
$row++;
}
}
}
}
return $o;
}
/*
@description: create a link to a template based on attributes passed into the tag. All extra HTML attributes
are passed to the anchor tag created.
@attrib: _Template:tpl: Template to link to. Just the template name is listed here. (ex: use "index" instead if "inlink/index")
@attrib: _Module:: Module being linked to (ie In-Bulletin or In-News or In-Link)
@attrib: _perm:: A list of permissions to check. If the user has any of the the permissions in the list,
the link will be generated. (If the _DeniedTemplate attribute is set, this template is used
and the link is created.)
@attrib: _DeniedTemplate:tpl: This template is used if the user does not have a permission listed in the _perm
attribute. If this attirbute is not included and the user does not have access,
nothing is returned. (The link is not created.)
@attrib: _Root:bool: If set, the current category is set to the module's root category
@attrib: _text:lang: language tag to include as text for the anchor tag
@attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence
if both are included.
@attrib: _image:: URL to an image to include inside the anchor tag.
@attrib: _image_actions:: Image events.
*/
function m_module_link($attribs = array())
{
global $objCatList, $objSession;
$permission = getArrayValue($attribs,'_perm');
$o = "";
$tpath = GetModuleArray("template");
if(strlen($permission))
{
$perms = explode(",",$permission);
$hasperm = FALSE;
for($x=0;$x<count($perms);$x++)
{
if($objSession->HasCatPermission($perms[$x]))
{
$hasperm = TRUE;
break;
}
}
}
else
$hasperm = TRUE;
if(!$hasperm && getArrayValue($attribs,'_deniedtemplate') )
{
$hasperm = TRUE;
$attribs["_template"]=$attribs["_deniedtemplate"];
}
if($hasperm)
{
$module = $attribs["_module"];
if(ModuleEnabled($module))
{
$t = $tpath[$attribs["_module"]];
$t .= $attribs["_template"];
$attribs["_template"] = $t;
$html_attr = ExtraAttributes($attribs);
if($attribs["_root"])
{
$func = ModuleTagPrefix($module)."_root_link";
if(function_exists($func))
{
$url = $func($attribs);
}
else
$url = m_template_link($attribs);
}
else
$url = m_template_link($attribs);
$o = "<A $html_attr HREF=\"";
$o .= $url;
$o .= "\"> ";
$text = getArrayValue($attribs,'_text');
if(!strlen($text))
{
$text = getArrayValue($attribs,'_plaintext');
if(!strlen($text))
{
if(strlen($attribs["_image"]))
{
$text = "<IMG SRC=\"".$attribs["_image"]."\" BORDER=\"0\" alt=\"\">";
}
}
$o .= $text."</A>";
}
else
$o .= language($text)."</A>";
}
else
{
$o = "";
}
}
return $o;
}
/*
@description: create a link to a template based on attributes passed into the tag. All extra HTML attributes
are passed to the anchor tag created.
@attrib: _Template:tpl: Template to link to. Just the template name is listed here. (ex: use "index" instead if "inlink/index")
@attrib: _perm:: A list of permissions to check. If the user has any of the the permissions in the list,
the link will be generated. (If the _DeniedTemplate attribute is set, this template is used
and the link is created.)
@attrib: _DeniedTemplate:tpl: This template is used if the user does not have a permission listed in the _perm
attribute. If this attirbute is not included and the user does not have access,
nothing is returned. (The link is not created.)
@attrib: _text:lang: language tag to include as text for the anchor tag
@attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence
if both are included.
@attrib: _image:: URL to an image to include inside the anchor tag.
*/
function m_permission_link($attribs = array())
{
global $objCatList, $objSession;
$permission = $attribs["_perm"];
$o = "";
if(strlen($permission))
{
$perms = explode(",",$permission);
$hasperm = FALSE;
for($x=0;$x<count($perms);$x++)
{
if($objSession->HasCatPermission($perms[$x]))
{
$hasperm = TRUE;
break;
}
}
}
else
$hasperm = TRUE;
if(!$hasperm && strlen($attribs["_deniedtemplate"])>0)
{
$hasperm = TRUE;
$attribs["_template"]=$attribs["_deniedtemplate"];
}
if($hasperm)
{
$url = m_template_link($attribs);
$o = "<A $html_attr HREF=\"";
$o .= $url;
$o .= "\"> ";
$text = $attribs["_text"];
if(!strlen($text))
{
$text = $attribs["_plaintext"];
if(!strlen($text))
{
if(strlen($attribs["_image"]))
{
$text = "<IMG SRC=\"".$attribs["_image"]."\" BORDER=\"0\" alt=\"\">";
}
}
$o .= $text."</A>";
}
else
$o .= language($text)."</A>";
}
else
{
$o = "";
}
return $o;
}
function m_confirm_password_link($attribs = array())
{
global $m_var_list_update, $var_list_update, $objSession, $objConfig;
$template = "forgotpw_reset_result";
// $user = $objSession->Get("tmp_user_id").";".$objSession->Get("tmp_email");
$tmp_user_id = $objSession->Get("tmp_user_id");
$conn = &GetADODBConnection();
$code = md5(GenerateCode());
$sql = 'UPDATE '.GetTablePrefix().'PortalUser SET PwResetConfirm="'.$code.'", PwRequestTime='.adodb_mktime().' WHERE PortalUserId='.$tmp_user_id;
$query = "&user_key=".$code."&Action=m_resetpw";
$conn->Execute($sql);
$var_list_update["t"] = $template;
$ret = ($attribs["_secure"]?"https://":"http://").ThisDomain().$objConfig->Get("Site_Path")."index.php?env=".BuildEnv().$query;
return $ret;
}
/**
* Returns result of password reset confirmation
* code validation as appropriate phrase
*
* @return string
* @example <inp:m_codevalidationresult />
*/
function m_codevalidationresult($attribs=Array())
{
global $objSession;
$result_phrase = $objSession->GetVariable('codevalidationresult');
return $result_phrase ? language($result_phrase) : '';
}
/*
@description: Create a link to a template.
@attrib: _Template:tpl: Template to link to (ex: "inbulletin/post_list")
@attrib: _Query:str: Extra query sring to be added to link URL (ex: "&test=test")
@attrib: _Category:int: Set the current category to this ID. If not set, the current category is unchanged
@attrib: _anchor:: If included, a local anchor (#) is added. (ex: _anchor="top" results in <A HREF="..#top">)
@attrib: _Root:bool:If set, gets module root category id
@attrib: _Module:str:Module Name
@attrib: _Relative:bool: Is set, creates an relative url url (../..address)
@example: <a href="<inp:m_template_link _Template="index" _Category=0 />"><inp:m_language _Phrase="lu_home" /></a>
*/
function m_template_link($attribs = array())
{
global $var_list, $var_list_update, $m_var_list_update, $objCatList;
$var_list_update['t'] = getArrayValue($attribs,'_template') ? $attribs['_template'] : $var_list['t'];
$query_string = trim( getArrayValue($attribs,'_query') );
$url_params = $query_string ? ExtractParams($query_string) : Array();
$cat = getArrayValue($attribs, '_category');
if($cat !== false) $m_var_list_update['cat'] = ($cat == 'NULL') ? 0 : $cat;
if( getArrayValue($attribs,'_anchor') ) $url_params['anchor'] = $attribs['_anchor'];
$ret = HREF_Wrapper('', $url_params);
unset( $var_list_update['t'] );
if($cat) unset( $m_var_list_update['cat'] );
return $ret;
}
/*
@description: create a link to a template based on user permissions. All extra HTML attributes are passed to the anchor tag created.
@attrib: _Template:tpl: Template to link to if the user has access
@attrib: _DeniedTemplate:tpl: This template is used if the user does not have a permission listed in the _perm
attribute. If this attirbute is not included and the user does not have access,
the "login" template is used.
@attrib: _perm:: A list of permissions to check. If the user has any of the the permissions in the list,
the link will be generated. (If the _DeniedTemplate attribute is set, this template is used
and the link is created.)
@attrib: _System:bool: Set this attribute if one of the permissions in the list is a system permission (ie: LOGIN)
@attrib: _Category:int: Set the current category to this ID. If not set, the current category is unchanged
@example: <a href="<inp:m_access_template_link _Template="my_account" _DeniedTemplate="login" _Perm="login" />"><inp:m_language _Phrase="lu_myaccount" /></A>
*/
function m_access_template_link($attribs = array(), $Permission="")
{
global $var_list, $var_list_update, $m_var_list_update, $objCatList, $objSession;
$cat = getArrayValue($attribs,'_category');
if(strlen($cat))
{
if($cat=="NULL")
$cat = 0;
}
else
$cat = $objCatList->CurrentCategoryID();
if(!strlen($Permission))
{
$Permission = strtoupper($attribs["_perm"]);
}
$o = "";
$hasperm = FALSE;
if(strlen($Permission))
{
$perms = explode(",",$Permission);
for($x=0;$x<count($perms);$x++)
{
if($objSession->HasCatPermission(trim($perms[$x]),$cat))
{
$hasperm = TRUE;
break;
}
}
if(!$hasperm && $attribs["_system"])
{
for($x=0;$x<count($perms);$x++)
{
if($objSession->HasSystemPermission(trim($perms[$x])))
{
$hasperm = TRUE;
break;
}
}
}
}
$url_params = Array('dest' => '');
$access = $attribs["_template"];
$denied = $attribs["_deniedtemplate"];
if(!strlen($denied))
$denied = "login";
$m_var_list_update["cat"] = $cat;
if($hasperm)
{
$template = $access;
if(!strlen($template))
$template = $var_list["t"];
$var_list_update["t"] = $template;
}
else
{
$template = $denied;
if(!strlen($template))
$template = $var_list["t"];
if($template == "login")
{
$url_params['dest'] = $access;
}
$var_list_update["t"] = $template;
}
if( !$url_params['dest'] ) unset($url_params['dest']);
$ret = HREF_Wrapper('', $url_params);
unset($var_list_update["t"]);
return $ret;
}
/*
@description: returns a text based on user permissions. Text from inside of the tag will be returned if text attributes are not specified and user has permissions to category, or if _NoPerm attribute set to 1 and user doesn't have permissions. Otherwise entire section will be excluded.
@attrib: _Text:lang: Template to link to if the user has access
@attrib: _PlainText:: This template is used if the user does not have a permission listed in the _perm attribute. If this attirbute is not included and the user does not have access, the "login" template is used.
@attrib: _DenyText:lang: Template to link to if the user has access
@attrib: _PlainDenyText:: This exact text is used if the user does not have a permission listed in the _perm attribute and _DenyText attribute is not set.
@attrib: _perm:: A list of permissions to check. If the user has any of the the permissions in the list, the link will be generated.
@attrib: _System:bool: Set this attribute if one of the permissions in the list is a system permission (ie: LOGIN)
@attrib: _Category:int: Set the current category to this ID. If not set, the current category is unchanged
@attrib: _MatchAllPerms:int: Checks for all listed Permissions to be TRUE. Note: this attribute is rarely used.
@attrib: _NoPerm:int: The whole tag will return inner text if user has no permissions and attribute set to 1. Default value is 0.
@example: <inp:m_perm_text _Text="!lu_allow_language_tag!" _PlainText="Just a text" _DenyText="!lu_deny_language_tag!" _PlainDenyText="Just a plain text" _Perm="login" _MatchAllPerms="1" _NoPerm="0">Some HTML here!</inp>
*/
function m_perm_text($attribs = array())
{
global $var_list, $var_list_update, $m_var_list_update, $objCatList, $objSession;
$cat = getArrayValue($attribs,'_category');
if(strlen($cat))
{
if($cat=="NULL")
$cat = 0;
}
else
$cat = $objCatList->CurrentCategoryID();
//if(!strlen($Permission))
$Permission = strtoupper($attribs["_perm"]);
$o = "";
$hasperm = FALSE;
$count = 0;
if(strlen($Permission))
{
$perms = explode(",",$Permission);
for($x=0;$x<count($perms);$x++)
{
$_AllPermsCount[$count] = 0;
if($objSession->HasCatPermission($perms[$x],$cat))
{
$hasperm = TRUE;
$_AllPermsCount[$count] = 1;
// break;
}
$count++;
}
if( !$hasperm && getArrayValue($attribs,'_system') )
{
for($x=0; $x<count($perms); $x++)
{
$_AllPermsCount[$count] = 0;
if($objSession->HasSystemPermission($perms[$x]))
{
$hasperm = TRUE;
$_AllPermsCount[$count] = 1;
// break;
}
$count++;
}
}
}
if ((int)getArrayValue($attribs,'_matchallperms'))
{
if (count($_AllPermsCount) != array_sum($_AllPermsCount))
$hasperm = FALSE;
}
$text = getArrayValue($attribs,'_text');
$plaintext = getArrayValue($attribs,'_plaintext');
$denytext = getArrayValue($attribs,'_denytext');
$plaindenytext = getArrayValue($attribs,'_plaindenytext');
$nopermissions_status = (int)getArrayValue($attribs,'_noperm')? 1 : 0;
//if(!strlen($denied)) $denied = "login";
if (!$nopermissions_status)
{
if ($hasperm)
{
if (strlen($text) || strlen($plaintext))
{
$ret = strlen($text)? language($text) : $plaintext;
}
else
{
$ret = "1";
}
}
else
{
$ret = strlen($denytext)? language($denytext) : $plaindenytext;
}
}
elseif (!$hasperm)
{
$ret = "1";
}
return $ret;
}
/*
@description: Returns the error string associated with a permission
*/
function m_permission_error($attribs = array())
{
global $objPermissions;
$ret = "";
$perm = strtoupper($_GET["error"]);
if(strlen($perm))
{
$ado = &GetADODBConnection();
$sql = "SELECT * FROM ".GetTablePrefix()."PermissionConfig WHERE PermissionName ='$perm'";
$rs = $ado->Execute($sql);
if($rs && !$rs->EOF)
{
$data = $rs->fields;
$error_tag = $data["ErrorMessage"];
}
else
$error_tag = "lu_unknown_error";
$ret = language($error_tag);
}
return $ret;
}
/*
@description: Returns the error text encountered when parsing templates
*/
function m_template_error($attribs = array())
{
global $objTemplate;
$ret = "";
if($objTemplate->ErrorNo<0)
{
$ret = $objTemplate->ErrorStr;
}
return $ret;
}
/*
@description: Creates a category navigation bar
@attrib: _Template:tpl: template to use for navigation links
@attrib: _RootTemplate:bool: If set, this template is linked to for the root category
@attrib: _LinkCurrent:bool: If set, the last (current) category is linked. Otherwise the current category is simply displayed
@attrib: _Separator:: text to display between levels of the navigation bar
@attrib: _Root:: Root category configuration variable to use. (ex: Link for In-Link's root category) If not set, the system root is used
@example: <inp:m_navbar _RootTemplate="index" _Template="inbulletin/index" _LinkCurrent="1" _separator=" &gt; " />
*/
function m_navbar($attribs = array())
{
global $m_var_list_update, $var_list, $objCatList, $objConfig, $objModules;
$separator = getArrayValue($attribs, '_separator');
if(!$separator) $separator = "<span class=\"NAV_ARROW\"> > </span>";
$admin = (int)getArrayValue($attribs, 'admin');
$t = getArrayValue($attribs, '_template');
$LinkLeafNode = getArrayValue($attribs, '_linkcurrent');
$catid = (int)getArrayValue($attribs, '_catid');
if( getArrayValue($attribs, '_root') )
{
$var = getArrayValue($attribs, '_root')."_Root";
$Root = (int)$objConfig->Get($var);
}
else
$Root = 0;
$RootTemplate = getArrayValue($attribs, '_roottemplate');
if($RootTemplate === false) $RootTemplate = '';
$Module = getArrayValue($attribs, '_module');
$ModuleRootTemplate = '';
if($Module)
{
$ModuleRootCat = $objModules->GetModuleRoot($Module);
if($ModuleRootCat>0)
{
$modkey = "_moduleroottemplate";
$ModuleRootTemplate = getArrayValue($attribs, $modkey);
}
else
$ModuleRootTemplate="";
}
else
$ModuleRootCat = 0;
if(!$catid)
$catid = $objCatList->CurrentCategoryID();
$ret = $objCatList->cat_navbar($admin, $catid, $t, $separator,$LinkLeafNode,$Root,$RootTemplate,$ModuleRootCat,$ModuleRootTemplate);
return $ret;
}
/*
@description: Parse a category field and return the value
@attrib: _Field:: Category field to parse
@attrib: _CatId:int: Category ID to parse (uses current category if not set)
@attrib: _StripHTML:bool: if set, all HTML is removed from the output
*/
function m_category_field($attribs)
{
global $objCatList;
$ret = "";
$catid = (int)getArrayValue($attribs,'_catid');
$field = $attribs["_field"];
if(!$catid)
$catid = $objCatList->CurrentCategoryID();
if(strlen($field))
{
$cat =& $objCatList->GetCategory($catid);
if(is_object($cat))
{
$element = new clsHtmlTag();
$element->name=$cat->TagPrefix;
$element->attributes = $attribs;
$ret = $cat->ParseObject($element);
}
}
if(getArrayValue($attribs,'_striphtml'))
$ret = strip_tags($ret);
return $ret;
}
/*
@description: returns the date of the last modification to a category
@attrib: _Part:: part of the date to display
@attrib: _Local:bool: If set, only subcategories of the current category is checked
@example: <inp:m_category_modified />
*/
function m_category_modified($attribs)
{
global $objConfig, $objCatList;
$ado = &GetADODBConnection();
$ret='';
if(getArrayValue($attribs,'_local') && $objCatList->CurrentCategoryID() != 0)
{
$c =& $objCatList->GetItem($objCatList->CurrentCategoryID());
$catlist = $c->GetSubCatIds();
$catwhere = "CategoryId IN (".explode(",",$catlist).")";
$sql = "SELECT MAX(Modified) as ModDate,MAX(CreatedOn) as NewDate FROM ".GetTablePrefix()."Category ";
$sql .= "INNER JOIN ".GetTablePrefix()."CategoryItems ON (".GetTablePrefix()."Category.ResourceId=".GetTablePrefix()."CategoryItems.ItemResourceId) ";
$sql .= "WHERE $catwhere LIMIT 1";
}
else
{
$sql = "SELECT MAX(Modified) as ModDate FROM ".GetTablePrefix()."Category LIMIT 1";
}
$rs = $ado->Execute($sql);
if($rs && ! $rs->EOF)
{
$mod = $rs->fields["ModDate"];
if($mod)
{
$part = strtolower(getArrayValue($attribs,'_part'));
$ret = $part?ExtractDatePart($part,$mod):LangDate($mod);
}
}
return $ret;
}
/*
@description: creates LINK tags to include all module style sheets
@attrib: _Modules:: Accepts a comma-separated list of modules to include (ie: "In-Link, In-News, In-Bulletin")
@attrib: _*css:none: Each module may set a custom-named stylesheet. For example, for In-Link the attribute would be _In-Linkcss="..".
If a module does not have a *css attribute, the default (style.css) is assumed.
@example: <inp:m_module_stylesheets _Modules="In-Portal,In-News,In-Bulletin,In-Link" _In-PortalCss="incs/inportal_main.css" />
*/
function m_module_stylesheets($attribs)
{
global $TemplateRoot;
$require_css = explode(',', trim($attribs['_modules']) );
$tpath = GetModuleArray('template');
$ret = '';
foreach($require_css as $module_name)
{
$css_attr = '_'.strtolower($module_name).'css';
$mod_css = getArrayValue($attribs,$css_attr) ? $attribs[$css_attr] : 'style.css';
$file = $TemplateRoot.getArrayValue($tpath,$module_name).$mod_css;
if( file_exists($file) )
{
$ret .= '<link rel="stylesheet" href="'.$tpath[$module_name].$mod_css.'" type="text/css" />'."\n";
}
}
return $ret;
}
/*
@description: lists items related to a category
@attrib:CatId:int: Category ID of category, or current category if not set
@attrib:_ListItem: Comma-separated list of item types (ie: Link, Topic, Category, News) The items are listed in the order this list provides, then by priority.
Each item should have its own template passed in as an attribute (_{ItemType}Template)
*/
function m_related_items($attribs)
{
global $objItemTypes, $objCatList, $content_set, $CatRelations;
static $Related;
$cat = getArrayValue($attribs,'_catid');
if(!is_numeric($cat))
{
$cat = $objCatList->CurrentCategoryID();
}
$c =& $objCatList->GetCategory($cat);
$data_sent=0;
if(is_object($c))
{
$ResourceId = $c->Get("ResourceId");
$IncludeList = explode(",",trim(strtolower($attribs["_listitems"])));
$o = "";
if(!is_object($CatRelations))
{
$CatRelations = new clsMultiTypeList();
LoadRelatedItems($Related, $CatRelations,$c->Get("ResourceId"));
}
if($CatRelations->NumItems()>0)
{
for($inc=0;$inc<count($IncludeList);$inc++)
{
$t_attr = "_".$IncludeList[$inc]."template";
$t = $attribs[$t_attr];
$item_type = $IncludeList[$inc];
if(strlen($item_type))
{
$objType = $objItemTypes->GetTypeByName($item_type);
if(is_object($objType))
{
foreach($CatRelations->Items as $item)
{
if(is_object($item))
{
if(strtolower($objType->Get("ItemName")) == strtolower($item_type) && $item->type==$objType->Get("ItemType"))
{
if(strlen($item->BasePermissionName))
{
$perm = $item->BasePermissionName.".VIEW";
$haspem = $objSession->HasCatPermission($perm,$item->Get("CategoryId"));
}
else
$hasperm = 1;
if($hasperm)
{
$data_sent =1;
$classname = $objType->Get("ClassName");
if(strlen($classname))
{
$l = new $classname;
$l->Data = $item->Data;
$o .= $l->ParseTemplate($t);
}
}
}
}
$item = NULL;
}
}
else
echo $item_type." not found <br>\n";
}
}
if($data_sent)
{
return $o;
}
else
{
$content_set=0;
return "";
}
}
else
{
$content_set = 0;
return "";
}
}
else
{
$content_set = 0;
return "";
}
}
/*
@description: Returns the number of items related to the current category
@attrib:_CatId:int: If set, this is the category ID to use, otherwise the current category is used
@attrib:_ItemType::Name of item to count. If not set, all related items are counted
*/
function m_related_count($attribs)
{
global $objItemTypes, $objCatList, $content_set, $CatRelations;
$cat = getArrayValue($attribs,'_catid');
if(!is_numeric($cat))
{
$cat = $objCatList->CurrentCategoryID();
}
$c =& $objCatList->GetCategory($cat);
$data_sent=0;
//echo "Category: $cat<pre>"; print_r($c); echo " </pre>";
if(is_object($c))
{
$ResourceId = $c->Get("ResourceId");
if(!is_object($CatRelations))
{
$CatRelations = new clsMultiTypeList();
LoadRelatedItems($Related, $CatRelations, $c->Get("ResourceId"));
}
$item_type = getArrayValue($attribs,'_itemtype');
if(strlen($item_type))
{
$objType = $objItemTypes->GetTypeByName($item_type);
if(is_object($objType))
{
$TargetType = $objType->Get("ItemType");
}
else
$TargetType="";
}
$count=0;
if($CatRelations->NumItems()>0)
{
for($x=0;$x<$CatRelations->NumItems();$x++)
{
$a = $CatRelations->GetItemByIndex($x);
if($a->type == $TargetType || !strlen($TargetType))
{
$count++;
}
}
}
}
return $count;
}
/*
@description: Returns the MetaKeywords field for a category, or the system MetaKeywords value if the category doesn't have a value for MetaKeywords
@attrib: _CatId:int: Category to use (The current category is used by default)
*/
function m_meta_keywords($attribs = array())
{
global $objCatList, $objConfig;
+ $application =& kApplication::Instance();
+ if ($application->isModuleEnabled('In-Edit')) {
+ $keywords = $application->ProcessTag('cms:PageInfo type="meta_keywords"');
+ if ($keywords) {
+ return $keywords;
+ }
+ }
+
$keywords = '';
$catid = (int)getArrayValue($attribs, '_catid');
if (!$catid)
{
$catid = $objCatList->CurrentCategoryID();
}
if ($catid)
{
$c = $objCatList->GetItem($catid);
$keywords = $c->Get('MetaKeywords');
}
if (!$keywords)
{
$keywords = $objConfig->Get('Category_MetaKey');
}
return $keywords;
}
/*
@description: Returns the MetaDescription field for a category, or the system MetaDescription value if the category doesn't have a value for MetaDescription
@attrib: _CatId:int: Category to use (The current category is used by default)
*/
function m_meta_description($attribs = array())
{
- global $objCatList, $objConfig;
+ global $objCatList, $objConfig;
+
+ $application =& kApplication::Instance();
+ if ($application->isModuleEnabled('In-Edit')) {
+ $description = $application->ProcessTag('cms:PageInfo type="meta_description"');
+ if ($description) {
+ return $description;
+ }
+ }
$description = '';
- $catid = (int)getArrayValue($attribs, '_catid');
- if (!$catid)
- {
+ $catid = (int)getArrayValue($attribs, '_catid');
+ if (!$catid)
+ {
$catid = $objCatList->CurrentCategoryID();
- }
+ }
- if ($catid)
- {
- $c = $objCatList->GetItem($catid);
- $description = $c->Get('MetaDescription');
- }
+ if ($catid)
+ {
+ $c = $objCatList->GetItem($catid);
+ $description = $c->Get('MetaDescription');
+ }
- if (!$description)
- {
- $description = $objConfig->Get('Category_MetaDesc');
- }
- return $description;
+ if (!$description)
+ {
+ $description = $objConfig->Get('Category_MetaDesc');
+ }
+ return $description;
}
/*
@description: return the number of items in the database
@attrib: _ItemType:: Name of item to count
@attrib: _ListType:: Type of item to count (ie: favorites, editor's pick, etc)
@attrib: _CategoryCount:int: Limit scope to the current category
@attrib: _SubCats:bool: Count items in all subcategories (_CategoryCount must be set)
@attrib: _Today:bool: Count items added today
@attrib: _GroupOnly:bool: Only count items the current user can view
@attrib: _NoCache:bool: Count without using cache
*/
function m_itemcount($attribs = array())
{
global $objItemTypes, $objCatList, $objSession, $objCountCache;
$Bit_None = 0;
$Bit_Today = 1;
$Bit_Owner = 2;
$Bit_Global = 4;
$Bit_SubCats=8;
if(getArrayValue($attribs,'_categorycount'))
{
$evar = m_BuildEnv();
}
else
$evar = "";
$cat = getArrayValue($attribs,'_catid');
if(!is_numeric($cat))
{
$cat = $objCatList->CurrentCategoryID();
}
if((int)$cat>0)
$c = $objCatList->GetCategory($cat);
if(is_numeric($attribs["_itemtype"]))
{
$item = $objItemTypes->GetItem($attribs["_itemtype"]);
}
else
$item = $objItemTypes->GetTypeByName($attribs["_itemtype"]);
$DoUpdate=0;
//echo "<pre>"; print_r($item); echo "</pre>";
$ExtraId="";
if(is_object($item))
{
if($item->Get("ItemType")==1) /* counting categories */
{
$ret = $objCatList->CountCategories($attribs);
}
else
{
$ListVar =& GetItemCollection($attribs["_itemtype"]);
if(is_object($ListVar))
{
//echo get_class($ListVar)."<br>";
//print_pre($attribs);
$ret = $ListVar->PerformItemCount($attribs);
//echo "m_itemcount: $ret<br>";
}
}
}
else
$ret = 0;
return !$ret ? 0 : $ret;
}
/*
@description: Parse a User field and return the value
@attrib: _Field:: User field to parse
@attrib: _UserId:int: Category ID to parse (uses current user if not set)
*/
function m_user_field($attribs)
{
global $objUsers, $objSession;
$o = "";
$userid = getArrayValue($attribs,'_userid');
if(!is_numeric($userid) || $userid=="0")
$userid = $objSession->Get("PortalUserId");
if($userid)
{
$u =& $objUsers->GetItem($userid);
if(is_object($u))
{
$element = new clsHtmlTag();
$element->name = $u->TagPrefix;
$element->attributes = $attribs;
$o = $u->ParseObject($element);
}
}
return $o;
}
/*
@description: Parses a user template
@attrib:_Template:tpl: Template to parse
@attrib:_UserId:int: User ID to parse. If not set, the current user is used
*/
function m_user_detail($attribs = array())
{
global $objTemplate, $objUsers, $objSession;
$tname = $attribs["_template"];
$UserId = (int)$attribs["_userid"];
if(!$UserId)
{
$UserId=$objSession->Get("PortalUserId");
}
if($UserId>0)
{
$u = $objUsers->GetUser($UserId);
$o = $u->ParseTemplate($tname);
}
else
{
$u = new clsPortalUser(NULL);
$o = $u->ParseTemplate($tname);
}
return $o;
}
/*
@description: returns a user field from the current profile being viewed
@example:<inp:m_user_profile_field _Field="login" />
*/
function m_user_profile_field($attribs = array())
{
if((int)$_GET["UserId"])
{
$attribs["_userid"] = $_GET["UserId"];
}
$ret = m_user_field($attribs);
/* if ($ret == '') {
$ret = admin_language("lu_Guest");
}*/
return $ret;
}
/*
@description: Parses a user profile template
@attrib:_Template:tpl: Template to parse
@attrib:_UserId:int: User ID to parse. If not set, the current user is used
*/
function m_user_profile_detail($attribs)
{
if((int)$_GET["UserId"])
{
$attribs["_userid"] = $_GET["UserId"];
}
$ret = m_user_detail($attribs);
return $ret;
}
/*
@description: Lists all user profile fields the user has indicated to be public
@attrib: _ItemTemplate:tpl: Template used to list each field
@example:<inp:m_user_profile _ItemTemplate="view_profile_field" />
*/
function m_user_profile($attribs = array())
{
global $objTemplate, $objUsers;
$tname = $attribs["_itemtemplate"];
$t = $objTemplate->GetTemplate($tname);
if(is_object($t))
{
$html = $t->source;
}
$userid = $_GET["UserId"];
$o = "";
if((int)$userid>0)
{
$u = $objUsers->GetItem($userid);
$vars = $u->GetAllPersistantVars();
foreach($vars as $field=>$value)
{
if(substr($field,0,3)=="pp_")
{
if($value==1)
{
$src = $html;
$src = str_replace("<inp:user_profile_field />","<inp:user _field=\"".substr($field,3)."\" />",$src);
$src = str_replace("lu_profile_field","lu_".$field,$src);
$o .= $u->ParseTemplateText($src);
}
}
}
}
return $o;
}
/*
@description: List users the current user has marked as 'friend'
@attrib: _Status:: Determines which online status to list, either "online" or "offline".
@attrib: _ItemTemplate:tpl: Template used to parse list items
*/
function m_list_friends($attribs = array())
{
global $objUsers, $objSession;
global $online_friends;
$ado = &GetADODBConnection();
$status = strtolower($attribs["_status"]);
$logedin_user = $objSession->Get("PortalUserId");
$u =& $objUsers->GetUser($logedin_user);
//echo "<pre>"; print_r($u); echo "</pre>";
if(!isset($online_friends) || $status=="online")
{
$ftable = GetTablePrefix()."Favorites";
$stable = GetTablePrefix()."UserSession";
$ptable = GetTablePrefix()."PortalUser";
if(isset($online_friends))
{
foreach($online_friends as $id=>$name)
{
$u =& $objUsers->GetUser($id);
$o .= $u->ParseTemplate($attribs["_itemtemplate"]);
}
}
else
{
$sql = "SELECT $ftable.ResourceId,$ftable.ItemTypeId, $ptable.PortalUserId,$stable.PortalUserId FROM $ftable ";
$sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) INNER JOIN $stable ON ";
$sql .= "($ptable.PortalUserId=$stable.PortalUserId) WHERE ItemTypeId=6 AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId'];
//echo $sql;
$rs = $ado->Execute($sql);
while($rs && ! $rs->EOF)
{
$u =& $objUsers->GetItem($rs->fields["PortalUserId"]);
if($status=="online")
{
$o .= $u->ParseTemplate($attribs["_itemtemplate"]);
}
$online_friends[]=$rs->fields["PortalUserId"];
if(ADODB_EXTENSION>0)
{
adodb_movenext($rs);
}
else
$rs->MoveNext();
}
}
}
if($status=="offline")
{
$ftable = GetTablePrefix()."Favorites";
$stable = GetTablePrefix()."UserSession";
$ptable = GetTablePrefix()."PortalUser";
$sessql = "SELECT DISTINCT(PortalUserId) FROM $stable";
if(count($online_friends)>0)
{
$sql = "SELECT $ftable.ResourceId,$ftable.ItemTypeId, $ptable.PortalUserId FROM $ftable ";
$sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND ";
$sql .= " $ptable.PortalUserId NOT IN (".implode(",",$online_friends).") AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId'];
}
else
{
$sql = "SELECT $ftable.ResourceId,$ftable.ItemTypeId, $ptable.PortalUserId FROM $ftable ";
$sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId'];
}
//echo $sql;
$rs = $ado->Execute($sql);
while($rs && ! $rs->EOF)
{
$u = $objUsers->GetItem($rs->fields["PortalUserId"]);
$o .= $u->ParseTemplate($attribs["_itemtemplate"]);
if(ADODB_EXTENSION>0)
{
adodb_movenext($rs);
}
else
$rs->MoveNext();
}
}
$t = $attribs["_itemtemplate"];
return $o;
}
/*
@description: Returns the number of users the current user has marked as 'friend'
@attrib: _Status:: Determines which online status to count, either "online" or "offline".
*/
function m_friend_count($attribs=array())
{
global $objUsers, $objSession;
global $online_friends;
$ado = &GetADODBConnection();
$logedin_user = $objSession->Get("PortalUserId");
$u =& $objUsers->GetUser($logedin_user);
$status = strtolower($attribs["_status"]);
if(!isset($online_friends) || $status=="online")
{
$ftable = GetTablePrefix()."Favorites";
$stable = GetTablePrefix()."UserSession";
$ptable = GetTablePrefix()."PortalUser";
if(isset($online_friends) && $status="online")
{
return count($online_friends);
}
else
{
$online_friends = array();
$sql = "SELECT $ftable.ResourceId,$ftable.ItemTypeId, $ptable.PortalUserId,$stable.PortalUserId FROM $ftable ";
$sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) INNER JOIN $stable ON ";
$sql .= "($ptable.PortalUserId=$stable.PortalUserId) WHERE ItemTypeId=6 AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId'];
//echo $sql."<br>\n";
$rs = $ado->Execute($sql);
while($rs && ! $rs->EOF)
{
$online_friends[$rs->fields["PortalUserId"]]=$rs->fields["PortalUserId"];
if(ADODB_EXTENSION>0)
{
adodb_movenext($rs);
}
else
$rs->MoveNext();
}
if($status=="online")
return count($online_friends);
}
}
if($status=="offline")
{
$ftable = GetTablePrefix()."Favorites";
$stable = GetTablePrefix()."UserSession";
$ptable = GetTablePrefix()."PortalUser";
$sessql = "SELECT DISTINCT(PortalUserId) FROM $stable";
if(count($online_friends)>0)
{
$sql = "SELECT count($ftable.ResourceId) as ItemCount FROM $ftable ";
$sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND ";
$sql .= " $ptable.PortalUserId NOT IN (".implode(",",$online_friends).") AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId'];
}
else
{
$sql = "SELECT count($ftable.ResourceId) as ItemCount FROM $ftable ";
$sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId'];
}
$rs = $ado->Execute($sql);
return $rs->fields["ItemCount"];
}
}
/*
@description: Returns the number of users the current user has marked as 'friend' today
*/
function m_friend_count_today($attribs)
{
global $objSession;
$logedin_user = $objSession->Get("PortalUserId");
$ret =0;
$ado = &GetADODBConnection();
$today = adodb_mktime(0, 0, 0, adodb_date("m"), adodb_date("d"), adodb_date("Y"));
$sql = "SELECT count(*) as c FROM ".GetTablePrefix()."Favorites WHERE ItemTypeId=6 and PortalUserId=".$objSession->Get("PortalUserId")." AND Modified>$today";
$rs = $ado->Execute($sql);
if($rs && !$rs->EOF)
$ret = $rs->fields["c"];
return $ret;
}
/*
@description: Returns the number of items in a search result
@Example: <span>(<inp:m_search_item_count _ItemType="Topic" />)</span>
*/
function m_search_item_count($attribs)
{
global $objItemTypes, $objCatList, $objSession, $CountVal;
if(!is_array($CountVal))
$CountVal=array();
$item = $objItemTypes->GetTypeByName($attribs["_itemtype"]);
if(is_object($item))
{
$val = $CountVal[$item->Get("ItemType")];
if(is_numeric($val))
return $val;
$where = "ItemType=".$item->Get("ItemType");
$table = $objSession->GetSearchTable();
$ret = TableCount($table,$where,0);
$CountVal[$item->Get("ItemType")]=(int)$ret;
}
return $ret;
}
/*
@description: Returns the number of categories in a search result
@Example: <span>(<inp:m_search_cat_count />)</span>
*/
function m_search_cat_count($attribs = array())
{
global $objItemTypes, $objCatList, $objSession, $CountVal, $objSearchCats;
if(!is_object($objSearchCats))
{
$objSearchCats = new clsCatList();
$objSearchCats->SourceTable = $objSession->GetSearchTable();
$objSearchCats->Clear();
}
if( !clsParsedItem::TableExists( $objSearchCats->SourceTable ) )
{
return 0;
}
LoadCatSearchResults($attribs);
//echo "<pre>"; print_r($objSearchCats->Items); echo "</pre>";
$ret = 0;
$keywords = $objSession->GetVariable("Search_Keywords");
/*if ($keywords) {
foreach ($objSearchCats->Items as $cat) {
if (strstr(strip_tags(strtolower($cat->Data[$objCatList->TitleField])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data[$cat->DescriptionField])), strtolower($keywords))) {
$ret++;
}
}
}*/
//else {
$ret = $objSearchCats->QueryItemCount;
//}
if ($ret == '') {
$ret = 0;
}
//echo $ret;
//$objSearchCats->QueryItemCount = $ret;
return $ret;
}
/*
@description: Returns super global variable by type and name
@attrib: _Name:: Name of variable
@attrib: _Type:: Type super global variable <br>Possible Values:
<UL>
<LI>get: $_GET super variable
<LI>post: $_POST super variable
<LI>cookie: $_COOKIE super variable
<LI>env: $_ENV super variable
<LI>server: $_SERVER super variable
<LI>session: $_SESSION super variable
</UL>
@Example: <inp:m_get_var _name="url" _type="get" />
*/
function m_get_var($attribs = array())
{
$type = strtoupper( $attribs['_type'] );
$name = $attribs['_name'];
$array_name = '_'.$type;
$vars = $GLOBALS[ isset( $GLOBALS[$array_name] ) ? $array_name : '_POST' ];
return $vars[$name];
}
/*
@description: Returns number of users currently on-line
@attrib: _LastActive:: Last user/session activity in seconds
@attrib: _OwnCount:bool: Count user's own session
*/
function m_users_online($attribs = array())
{
global $objSession;
$LastActive = (int)($attribs['_lastactive']);
$OwnCount = (int)($attribs['_owncount']);
if ($LastActive && !is_null($LastActive))
$sql_add = " AND LastAccessed>".(adodb_mktime()-$LastActive);
if (!$OwnCount || is_null($OwnCount))
$sql_add.= " AND SessionKey!='".$objSession->GetSessionKey()."'";
$ado = &GetADODBConnection();
$sql = "SELECT COUNT(*) AS Counter FROM ".GetTablePrefix()."UserSession WHERE Status=1".$sql_add;
$rs = $ado->Execute($sql);
$ret = ($rs && !$rs->EOF)? $rs->fields["Counter"] : 0;
return $ret;
}
function m_debug_mode($attribs = array())
{
$const_name = $attribs['_debugconst'];
return defined($const_name) && (constant($const_name) == 1) ? 'yes' : '';
}
function m_info($attribs = array())
{
switch ($attribs['_infotype'])
{
case 'site':
global $objConfig;
$ret = ThisDomain().$objConfig->Get('Site_Path');
break;
default:
$ret = '';
break;
}
return $ret;
}
function m_module_enabled($attribs = array())
{
global $objModules;
$module = $attribs['_module'];
// check if module is installed
$ModuleItem = $objModules->GetItemByField('Name', $module);
if( !is_object($ModuleItem) ) return '';
// module is enabled
$ret = $ModuleItem->Get('Loaded') == 1;
// check if installed module is licensed
return $ret ? 'yes' : '';
}
function m_recall($attribs = array())
{
global $objSession;
return $objSession->GetVariable($attribs['_name']);
}
function m_regional_option($attribs = array())
{
return GetRegionalOption($attribs['_name']);
}
/*
@description: Returns a sitemap
@attrib: _CatId:int: Top Level Catagory ID to start sitemap with.
@attrib: _ModuleName:: Module name (optional, default none)
@attrib: _MainItemTemplate:tpl: Item template for Top level category
@attrib: _SubCatItemTemplate:tpl: Item template for Sub categories
@attrib: _MaxDepth:: Max Depth, default all, minimum 2
@attrib: _MaxCats:: Maximum number of Categories for each Module, default 300
*/
function m_sitemap($attribs = array())
{
global $objModules, $objConfig, $objCatList;
$html_attribs = ExtraAttributes($attribs);
$mod_name = getArrayValue($attribs, "_modulename");
$StartCatId = getArrayValue($attribs, "_catid");
$MaxDepth = (int)getArrayValue($attribs, "_maxdepth");
$MaxCats = getArrayValue($attribs, "_maxcats");
$MaxCats = !empty($MaxCats) ? (int)$MaxCats : 300;
if ($MaxDepth == 0)
unset($MaxDepth);
elseif ($MaxDepth < 2)
$MaxDepth = 2;
$MainItemTemplate = getArrayValue($attribs, "_mainitemtemplate");
$SubCatItemTemplate = getArrayValue($attribs, "_subcatitemtemplate");
if (!strlen($SubCatItemTemplate))
$SubCatItemTemplate = "sitemap_subcat_element";
if (!strlen($MainItemTemplate))
$MainItemTemplate = "sitemap_cat_element";
$cols = getArrayValue($attribs, "_columns");
$cols = ($cols<1)? 2 : $cols;
if (!isset($StartCatId))
{
if (!strlen($mod_name))
{
$_RootCat = 0;
}
else
{
$_RootCat = $objModules->GetModuleRoot($mod_name);
}
}
else
{
$_RootCat = (int)$StartCatId? (int)$StartCatId : 0;
}
// Get Root Categories of all installed Modules
if (is_array($objModules->Items))
{
foreach ($objModules->Items as $curr_mod)
{
if( !$curr_mod->Get('Loaded') || ($curr_mod->Get('Name') == 'In-Portal') ) continue;
$mod_name = (int)$curr_mod->Get('RootCat');
if( !empty($mod_name) )
{
$modules[$mod_name] = !isset($modules[$mod_name]) ? $curr_mod->Get('TemplatePath') : '';
}
else
{
$modules[$mod_name] = '';
}
}
}
$_C_objCat = new clsCatList();
$_Where = GetTablePrefix()."Category.ParentId = $_RootCat AND Status = 1";
$_OrderBy = " ORDER BY ".GetTablePrefix()."Category.Priority DESC ";
$_C_catList = $_C_objCat->LoadCategories($_Where, $_OrderBy, false);
## getting TOP level categories
if( is_array($_C_catList) && count($_C_catList) )
{
$ret = "<TABLE $html_attribs><TR CLASS=\"m_list_cats\">";
$ret.= "<TD valign=\"top\">";
$CatCount = $_C_objCat->NumCategories();
$per_row = ceil($CatCount / $cols);
foreach ($_C_catList as $cat)
{
$text = $cat->Get($objCatList->TitleField);
$val = $cat->Get("CategoryId");
$sub_path = $cat->Get("ParentPath");
$add_path = "";
if( is_array($modules) )
{
foreach($modules as $curr => $v)
{
if (strpos($sub_path, "|$curr|") !== false)
{
$add_path = $v;
break;
}
}
}
if(!$add_path) continue;
$main_templ = $add_path.$MainItemTemplate;
$ret.= $cat->ParseTemplate($main_templ);
$count++;
$row++;
$_C_objCatSubs = new clsCatList();
$ParentPath = empty($_RootCat) ? '|'.$val.'|%' : '|'.$_RootCat.'|'.$val.'|%';
$_Where = GetTablePrefix()."Category.ParentPath LIKE '$ParentPath' AND ".GetTablePrefix()."Category.CategoryId!=$val AND Status=1";
$_OrderBy = " ORDER BY ".GetTablePrefix()."Category.ParentPath ASC, ".GetTablePrefix()."Category.".$objCatList->TitleField." ASC";
$old_value = $objConfig->Get($_C_objCatSubs->PerPageVar);
$objConfig->Set($_C_objCatSubs->PerPageVar, (int)$MaxCats);
$SubCats = $_C_objCatSubs->LoadCategories($_Where, $_OrderBy, false);
$objConfig->Set($_C_objCatSubs->PerPageVar, $old_value);
if (is_array($SubCats) && count($SubCats))
{
foreach ($SubCats as $subcat)
{
$SubCatName = $subcat->Get($objCatList->TitleField);
$SubCatId = $subcat->Get("CategoryId");
$SubPath = $subcat->Get("ParentPath");
$add_path = "";
if (is_array($modules))
{
foreach ($modules as $curr => $v)
{
if (strpos($SubPath, "|$curr|") !== false)
{
$add_path = $v;
break;
}
}
}
$CatIds = $subcat->GetParentIds();
$nbs = "";
// echo 'MD: <b>'.$MaxDepth.'</b>, CATS: <b>'.count($CatIds).'</b><br />';
if (!isset($MaxDepth) || (isset($MaxDepth) && ($MaxDepth >= count($CatIds))))
{
for ($i = (count($CatIds)-2); $i>0; $i--)
$nbs.= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
$sub_templ = $add_path.$SubCatItemTemplate;
$ret.= $nbs.$subcat->ParseTemplate($sub_templ);
}
}
}
unset($_C_objCatSubs);
if($count==$per_row)
{
$ret.= "</TD><TD valign=\"top\">";
$count=0;
}
else
$ret.= "<BR />";
}
if($count != $per_row)
$ret .= "</TD>";
$ret.= "\n</tr></table>\n";
}
return $ret;
}
function m_IsDebugMode($params)
{
// echo 'kool';
return IsDebugMode() ? true : '';
}
function m_param($params)
{
$parser_params = GetVar('parser_params');
$param_name = strtolower($params['_name']);
$value = getArrayValue($parser_params, $param_name);
if ($value) {
if (getArrayValue($params, '_asphrase')) {
$value = language($value);
}
}
return $value;
}
function m_set_category($params)
{
global $m_var_list;
if (getArrayValue($params, '_onlyonce') && $m_var_list['cat']) return ;
$db =& GetADODBConnection();
$category_id = getArrayValue($params, '_catid');
if (!$category_id) {
$module = getArrayValue($params, '_module');
if ($module) {
$sql = 'SELECT RootCat FROM '.GetTablePrefix().'Modules WHERE LOWER(Name) = '.$db->qstr( strtolower($module) );
$category_id = $db->GetOne($sql);
}
}
if ($category_id) {
$m_var_list['cat'] = $category_id;
}
}
function m_template_equals($params)
{
$t = preg_replace('/(.*)\.tpl/', '\\1', $params['_template']);
return $GLOBALS['var_list']['t'] == $t ? true : '';
}
function m_ShowSearchError($params)
{
global $objSession, $objTemplate;
$error_phrase = $objSession->GetVariable('search_error');
if (!$error_phrase) {
return '';
}
$template = getArrayValue($params, '_itemtemplate');
if (!$template) {
$ret = '<inp:form_error />';
}
$ret = $objTemplate->GetTemplate($template, true);
$ret = $ret->source;
return str_replace('<inp:form_error />', language($error_phrase), $ret);
}
/*function m_object($attribs=Array())
{
$element = new clsHtmlTag();
$element->name=$attribs['_prefix'];
$element->attributes = $attribs;
$ret = $cat->ParseObject($element);
}*/
?>
Property changes on: trunk/kernel/parser.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.101
\ No newline at end of property
+1.102
\ No newline at end of property
Index: trunk/kernel/include/emailmessage.php
===================================================================
--- trunk/kernel/include/emailmessage.php (revision 6427)
+++ trunk/kernel/include/emailmessage.php (revision 6428)
@@ -1,1006 +1,1008 @@
<?php
class clsEmailMessage extends clsParsedItem
{
var $Event = "";
var $Item;
var $headers = array();
var $subject = "";
var $body = "";
var $TemplateParsed = FALSE;
var $recipient = NULL;
var $fromuser = NULL;
function clsEmailMessage($MessageId=NULL,$Item=NULL)
{
$this->clsParsedItem();
$this->tablename = GetTablePrefix()."EmailMessage";
$this->Item = $Item;
$this->BasePermission = "EMAIL";
$this->id_field = "EmailMessageId";
$this->TagPrefix = "email";
$this->NoResourceId=1;
if($MessageId)
$this->LoadFromDatabase($MessageId);
}
function LoadEvent($event,$language=NULL)
{
global $objConfig, $objLanguages;
if(!strlen($language))
$language = $objLanguages->GetPrimary();
$sql = "SELECT * FROM ".$this->tablename." WHERE EventId = $event AND LanguageId=$language";
$rs = $this->adodbConnection->Execute($sql);
if($rs && !$rs->EOF)
{
$data = $rs->fields;
$this->SetFromArray($data);
$this->Clean();
return TRUE;
}
else
return FALSE;
}
function LoadFromDatabase($MessageId)
{
global $Errors;
$sql = sprintf("SELECT * FROM ".$this->tablename." WHERE ".$this->IdField()." = '%s'",$MessageId);
$result = $this->adodbConnection->Execute($sql);
if ($result === FALSE)
{
$Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase");
return FALSE;
}
$data = $result->fields;
$this->SetFromArray($data);
return TRUE;
}
function EditTemplate()
{
}
/* read the template, split into peices */
function ReadTemplate()
{
if (!$this->TemplateParsed) {
$this->headers = Array();
// add footer: begin
$sql = 'SELECT em.Template
FROM '.$this->tablename.' em
LEFT JOIN '.TABLE_PREFIX.'Events e ON e.EventId = em.EventId
WHERE em.LanguageId = '.$this->Get('LanguageId').' AND e.Event = "COMMON.FOOTER"';
$footer = explode("\n\n", $this->Conn->GetOne($sql));
$email_object = &$this->Application->recallObject('kEmailMessage');
$email_object->Clear();
$footer = $this->Get('MessageType') == 'text' ? $email_object->convertHTMLtoPlain($footer[1]) : '<br/>'.$footer[1];
$template = $this->Get('Template')."\r\n".$footer;
// add footer: end
$template = str_replace("\r", '', $template);
$lines = explode("\n", $template);
$header_end = false;
$i = 0;
while(!$header_end && $i<count($lines))
{
$h = $lines[$i];
if (strlen(trim($h))==0 || ($h==".")) {
$header_end = true;
}
else {
$parts = explode(":",$h,2);
if (strtolower($parts[0])=="subject") {
$this->subject = $h;
}
else {
$this->headers[] = $h;
}
}
$i++;
}
while ($i<count($lines)) {
$this->body .= trim($lines[$i++])."\r\n";
}
// $this->body .= "\r".$footer;
$this->TemplateParsed = true;
}
}
function ParseSection($text, $parser=null)
{
global $objUsers, $objTemplate;
$res = $this->ParseTemplateText($text);
/* parse email class tags */
if(!is_object($this->fromuser))
{
$this->fromuser = $objUsers->GetItem($this->Get("FromUserId"));
$this->fromuser->TagPrefix = "fromuser";
}
/* parse from user object */
if(is_object($this->fromuser))
{
$res = $this->fromuser->ParseTemplateText($res);
}
/* parse recipient user object */
if(is_object($this->recipient))
{
$res = $this->recipient->ParseTemplateText($res);
}
//print_pre($this->Item);
if(is_object($this->Item))
{
$res = $this->Item->ParseTemplateText($res);
}
else
{
if(!is_object($objTemplate))
$objTemplate = new clsTemplateList(" ");
$res = $objTemplate->ParseTemplateText($res);
}
return $res;
}
function SendToGroup($GroupId)
{
global $objUsers;
$users = $objUsers->Query_GroupPortalUser("GroupId=$GroupId");
if(is_array($users))
{
foreach($users as $u)
{
$this->SendToUser($u->Get("PortalUserId"));
}
}
}
function SendToAddress($EmailAddress,$name="")
{
global $objUsers, $objEmailQueue,$objConfig;
$conn = &GetADODBConnection();
//$this->recipient = $objUsers->GetUser($UserId);
//$this->recipient->TagPrefix="touser";
if(strlen($EmailAddress))
{
$to_addr = $EmailAddress;
$this->ReadTemplate();
$subject = $this->ParseSection($this->subject);
$body = $this->ParseSection($this->body);
if(is_object($this->fromuser))
{
$FromAddr = $this->fromuser->Get("Email");
$FromName = trim($this->fromuser->Get("FirstName")." ".$this->fromuser->Get("LastName"));
}
if(!strlen($FromAddr))
{
$FromName = strip_tags( $objConfig->Get('Site_Name') );
$FromAddr = $objConfig->Get("Smtp_AdminMailFrom");
}
$charset = "ascii-us";
if($this->Get("MessageType")=="html")
{
$objEmailQueue->SendMail($FromAddr,$FromName,$to_addr,$To,$subject,"",$body,$charset, $this->Get("Event"),NULL,NULL,NULL,$this->headers);
}
else
{
// $body = nl2br($body);
// $body = str_replace("<br />","\n",$body);
$objEmailQueue->SendMail($FromAddr,$FromName,$to_addr,$To,$subject,$body,"",$charset, $this->Get("Event"),NULL,NULL,NULL,$this->headers);
}
/*$time = adodb_mktime();
$sql = "INSERT INTO ".GetTablePrefix()."EmailLog VALUES ('', '$FromName', '$To', '$subject', $time, '')";
$conn->Execute($sql); */
return TRUE;
}
return FALSE;
}
function SendToUser($UserId)
{
global $objUsers, $objEmailQueue, $objConfig;
$conn = &GetADODBConnection();
//echo "Handling Event ".$this->Get("Event")." for user $UserId <br>\n";
$this->recipient = new clsPortalUser($UserId); // $objUsers->GetItem($UserId);
//echo "<PRE>";print_r($this->recipient); echo "</PRE>";
$this->recipient->TagPrefix="touser";
if($this->recipient->Get("PortalUserId")==$UserId)
{
$to_addr = $this->recipient->Get("Email");
$To = trim($this->recipient->Get("FirstName")." ".$this->recipient->Get("LastName"));
$this->ReadTemplate();
$subject = $this->ParseSection($this->subject, $this->recipient);
$body = $this->ParseSection($this->body);
if(!is_object($this->fromuser))
{
$this->fromuser = $objUsers->GetItem($this->Get("FromUserId"));
}
if(is_object($this->fromuser))
{
$FromAddr = $this->fromuser->Get("Email");
$FromName = trim($this->fromuser->Get("FirstName")." ".$this->fromuser->Get("LastName"));
$charset = "ascii-us";
}
if(!strlen($FromAddr))
{
$FromName = strip_tags( $objConfig->Get('Site_Name') );
$FromAddr = $objConfig->Get("Smtp_AdminMailFrom");
}
// echo $this->Event;
if($this->Get("MessageType")=="html")
{
$objEmailQueue->SendMail($FromAddr,$FromName,$to_addr,$To,$subject,"",$body,$charset, $this->Get("Event"),NULL,NULL,NULL,$this->headers);
}
else
{
// $body = str_replace("\r", "", $body);
$objEmailQueue->SendMail($FromAddr,$FromName,$to_addr,$To,$subject,$body,"",$charset, $this->Get("Event"),NULL,NULL,NULL,$this->headers);
}
/*$time = adodb_mktime();
$sql = "INSERT INTO ".GetTablePrefix()."EmailLog VALUES ('', '$FromName', '$To ($to_addr)', '$subject', $time, '')";
$conn->Execute($sql); */
return TRUE;
}
return FALSE;
}
function SendAdmin()
{
global $objUsers, $objConfig, $objEmailQueue;
$conn = &GetADODBConnection();
$this->recipient = $objUsers->GetUser($this->Get("FromUserId"));
$this->recipient->TagPrefix="touser";
if($this->recipient->Get("PortalUserId")==$this->Get("FromUserId") || strlen($this->recipient->Get("PortalUserId")) == 0)
{
$to_addr = $this->recipient->Get("Email");
$To = trim($this->recipient->Get("FirstName")." ".$this->recipient->Get("LastName"));
$this->ReadTemplate();
if (strlen($to_addr) == 0) {
$to_addr = $objConfig->Get("Smtp_AdminMailFrom");
}
$subject = $this->ParseSection($this->subject);
$body = $this->ParseSection($this->body);
$FromName = strip_tags( $objConfig->Get('Site_Name') );
$FromAddr = $objConfig->Get("Smtp_AdminMailFrom");
if(strlen($FromAddr))
{
$charset = "ascii-us";
if($this->Get("MessageType")=="html")
{
$objEmailQueue->SendMail($FromAddr,$FromName,$to_addr,$To,$subject,"",$body,$charset,$this->Get("Event"),NULL,NULL,NULL,$this->headers);
}
else
{
// $body = str_replace("\r", "", $body);
$objEmailQueue->SendMail($FromAddr,$FromName,$to_addr,$To,$subject,$body,"",$charset, $this->Get("Event"),NULL,NULL,NULL,$this->headers);
}
/* $time = adodb_mktime();
$sql = "INSERT INTO ".GetTablePrefix()."EmailLog VALUES ('', '$FromName', '$To ($to_addr)', '$subject', $time, '')";
$conn->Execute($sql);
*/
return TRUE;
}
}
return FALSE;
}
function ParseTemplateText($text)
{
$html = $text;
$search = "<inp:";
//$search = "<inp:".$this->TagPrefix;
//$next_tag = strpos($html,"<inp:");
$next_tag = strpos($html,$search);
while($next_tag)
{
$closer = strpos(strtolower($html),">",$next_tag);
$end_tag = strpos($html,"/>",$next_tag);
if($end_tag < $closer || $closer == 0)
{
$tagtext = substr($html,$next_tag,($end_tag - $next_tag)+2);
$pre = substr($html,0,$next_tag);
$post = substr($html,$end_tag+2);
$inner = $this->ParseElement($tagtext);
$html = $pre.$inner.$post;
}
else
{
$OldTagStyle = "</inp>";
## Try to find end of TagName
$TagNameEnd = strpos($html, " ", $next_tag);
## Support Old version
// $closer = strpos(strtolower($html),"</inp>",$next_tag);
if ($TagNameEnd)
{
$Tag = strtolower(substr($html, $next_tag, $TagNameEnd-$next_tag));
$TagName = explode(":", $Tag);
if (strlen($TagName[1]))
$CloserTag = "</inp:".$TagName[1].">";
}
else
{
$CloserTag = $OldTagStyle;
}
$closer = strpos(strtolower($html), $CloserTag, $next_tag);
## Try to find old tag closer
if (!$closer && ($CloserTag != $OldTagStyle))
{
$CloserTag = $OldTagStyle;
$closer = strpos(strtolower($html), $CloserTag, $next_tag);
}
$end_tag = strpos($html,">",$next_tag);
$tagtext = substr($html,$next_tag,($end_tag - $next_tag)+1);
$pre = substr($html,0,$next_tag);
$inner = substr($html,$end_tag+1,$closer-($end_tag+1));
$post = substr($html,$end_tag+1+strlen($inner) + strlen($CloserTag));
//echo "PRE:". htmlentities($pre,ENT_NOQUOTES);
//echo "INNER:". htmlentities($inner,ENT_NOQUOTES);
//echo "POST:". htmlentities($post,ENT_NOQUOTES);
$parsed = $this->ParseElement($tagtext);
if(strlen($parsed))
{
$html = $pre.$this->ParseTemplateText($inner).$post;
}
else
$html = $pre.$post;
}
$next_tag = strpos($html,$search);
}
return $html;
}
function ParseElement($raw, $inner_html ="")
{
$tag = new clsHtmlTag($raw);
$tag->inner_html = $inner_html;
if($tag->parsed)
{
if($tag->name=="include" || $tag->name=="perm_include" || $tag->name=="lang_include")
{
$output = $this->Parser->IncludeTemplate($tag);
}
else
{
if (is_object($this->Item)) {
$this->Item->TagPrefix = $tag->name;
$output = $this->Item->ParseObject($tag);
}
else {
$output = $this->ParseObject($tag);
}
if(substr($output,0,9)=="Undefined")
{
$output = $tag->Execute();
// if(substr($output,0,8)="{Unknown")
// $output = $raw;
} return $output;
}
}
else
return "";
}
}
class clsEmailMessageList extends clsItemCollection
{
function clsEmailMessageList()
{
$this->clsItemCollection();
$this->classname = "clsEmailMessage";
$this->SourceTable = GetTablePrefix()."EmailMessage";
$this->PerPageVar = "Perpage_EmailEvents";
$this->AdminSearchFields = array("Template","Description", "Module","Event");
}
function LoadLanguage($LangId=NULL)
{
global $objLanguages;
if(!$LangId)
$LangId = $objLanguages->GetPrimary();
$sql = "SELECT * FROM ".$this->SourceTable." WHERE LanguageId=$LangId";
$this->Clear();
return $this->Query_Item($sql);
}
function &AddEmailEvent($Template, $Type, $LangId, $EventId)
{
$e = new clsEmailMessage();
$e->tablename = $this->SourceTable;
$e->Set(array("Template","MessageType","LanguageId","EventId"),
array($Template,$Type,$LangId,$EventId));
$e->Dirty();
$e->Create();
return $e;
}
function DeleteLanguage($LangId)
{
$sql = "DELETE FROM ".$this->SourceTable." WHERE LanguageId=$LangId OR LanguageId = 0";
if( $GLOBALS['debuglevel'] ) echo $sql."<br>\n";
$this->adodbConnection->Execute($sql);
}
function &GetMessage($EventId,$LangId,$LoadFromDB=TRUE)
{
$found=FALSE;
if(is_array($this->Items))
{
for($x=0;$x<count($this->Items);$x++)
{
$i =& $this->GetItemRefByIndex($x);
if(is_object($i))
{
if($i->Get("EventId")==$EventId && $i->Get("LanguageId")==$LangId)
{
$found=TRUE;
break;
}
}
}
}
if(!$found)
{
if($LoadFromDB)
{
$n = NULL;
$n = new $this->classname();
$n->tablename = $this->SourceTable;
if($n->LoadEvent($EventId,$LangId))
{
array_push($this->Items, $n);
$i =& $this->Items[count($this->Items)-1];
}
else
$i = FALSE;
}
else
$i = FALSE;
}
return $i;
}
function CreateEmptyEditTable($IdList, $use_parent = false)
{
global $objSession;
if (!$use_parent) {
$edit_table = $objSession->GetEditTable($this->SourceTable);
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
$query = "SELECT * FROM ".$this->SourceTable." WHERE 0";
$insert = "CREATE TABLE ".$edit_table." ".$query;
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($insert,ENT_NOQUOTES)."<br>\n";
$this->adodbConnection->Execute($insert);
$this->LoadLanguage();
$idvalue = -1;
for($i=0;$i<$this->NumItems();$i++)
{
$e =& $this->Items[$i];
$e->SourceTable = $edit_table;
if(is_array($IdList))
{
foreach($IdList as $id)
{
$e->UnsetIdField();
$e->Set("EmailMessageId",$idvalue--);
$e->Set("LanguageId",$id);
// $e->Set("Description",admin_language("la_desc_emailevent_".$e->Get("Event"),$id));
$e->Create();
}
}
else
{
$e->UnsetIdField();
$e->Set("EmailMessageId",$idvalue--);
$e->Set("LanguageId",$IdList);
// $e->Set("Description",admin_language("la_desc_emailevent_".$e->Get("Event"),$LangId));
$e->Create();
}
}
$this->Clear();
}
else {
parent::CreateEmptyEditTable($IdList);
}
}
function CopyFromEditTable()
{
global $objSession;
$GLOBALS['_CopyFromEditTable']=1;
$idfield = "EmailMessageId";
$edit_table = $objSession->GetEditTable($this->SourceTable);
$sql = "SELECT * FROM $edit_table WHERE LanguageId <> 0";
$rs = $this->adodbConnection->Execute($sql);
while($rs && !$rs->EOF)
{
$data = $rs->fields;
$c = new $this->classname;
$c->SetFromArray($data);
//$c->idfield = $idfield;
if($c->Get($idfield)<1)
{
$old_id = $c->Get($idfield);
$c->Dirty();
$c->UnsetIdField();
$c->Create();
}
else
{
$c->Dirty();
$c->Update();
}
$rs->MoveNext();
}
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
unset($GLOBALS['_CopyFromEditTable']);
}
function PurgeEditTable()
{
global $objSession;
$edit_table = $objSession->GetEditTable($this->SourceTable);
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
}
function &GetEmailEventObject($EventName,$Type=0,$LangId=NULL)
{
global $objLanguages;
if(!$LangId)
$LangId = $objLanguages->GetPrimary();
$EmailTable = $this->SourceTable;
$EventTable = GetTablePrefix()."Events";
$sql = "SELECT * FROM $EventTable INNER JOIN $EmailTable ON ($EventTable.EventId = $EmailTable.EventId) ";
$sql .="WHERE Event='$EventName' AND LanguageId=$LangId AND Type=$Type";
$result = $this->adodbConnection->Execute($sql);
if ($result === FALSE)
{
//$Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"","clsEvent","GetEmailEventObject");
return FALSE;
}
$data = $result->fields;
$e = new clsEmailMessage();
$e->SetFromArray($data);
$e->Clean();
return $e;
}
function ReadImportTable($TableName,$Overwrite=FALSE, $MaxInserts=100,$Offset=0)
{
$eml = new clsEmailMessageList();
$this->Clear();
$Inserts = 0;
$sql = "SELECT * FROM $TableName LIMIT $Offset,$MaxInserts";
$this->Query_Item($sql);
if($this->NumItems()>0)
{
foreach($this->Items as $i)
{
$e = $eml->GetMessage($i->Get("EventId"),$i->Get("LanguageId"));
if(is_object($e))
{
if($Overwrite)
{
$e->Set("MessageType",$i->Get("MessageType"));
$e->Set("Template",$i->Get("Template"));
$e->Update();
}
}
else
{
$i->Create();
}
$Inserts++;
}
}
$Offset = $Offset + $Inserts;
return $Offset;
}
}
function EventEnabled($e)
{
global $objConfig;
$var = "Email_".$e."_Enabled";
return ($objConfig->Get($var)=="1");
}
class clsEmailQueue
{
var $SourceTable;
var $MessagesAtOnce;
var $MessagesSent=0;
var $LogLevel = 0;
var $HLB = "\n"; // Headers Line Break
var $BLB = "\n"; // Body Line Break
function clsEmailQueue($SourceTable=NULL,$MessagesAtOnce=NULL)
{
global $objConfig;
$this->HLB = chr(10);
$this->BLB = chr(10);
if($SourceTable)
{
$this->SourceTable=$SourceTable;
}
else
$this->SourceTable = GetTablePrefix()."EmailQueue";
if(!$MessagesAtOnce)
$MessagesAtOnce = (int)$objConfig->Get("Email_MaxSend");
if($MessagesAtOnce<1)
$MessagesAtOnce=1;
$this->MessagesAtOnce = $MessagesAtOnce;
$this->LogLevel = (int)$objConfig->Get("Smtp_LogLevel");
}
function WriteToMailLog($text)
{
global $pathtoroot,$admin;
//echo htmlentities($text)."<br>\n";
if($this->LogLevel>0)
{
$Logfile = $pathtoroot.$admin."/email/log.txt";
if(is_writable($Logfile))
{
$fp = fopen($Logfile,"a");
if($fp)
{
fputs($fp,$text."\n");
fclose($fp);
}
}
}
}
function AllowSockets()
{
$minver = explode(".", "4.3.0");
$curver = explode(".", phpversion());
if (($curver[0] < $minver[0])
|| (($curver[0] == $minver[0])
&& ($curver[1] < $minver[1]))
|| (($curver[0] == $minver[0]) && ($curver[1] == $minver[1])
&& ($curver[2][0] < $minver[2][0])))
return false;
else
return true;
}
function DeliverMail($To,$From,$Subject,$Msg,$headers, $ForceSend=0)
{
global $MessagesSent,$objConfig;
if(($this->MessagesSent >$this->MessagesAtOnce) && !$ForceSend)
{
$this->EnqueueMail($To,$From,$Subject,$Msg,$headers);
return TRUE;
}
else
{
$this->MessagesSent++;
$time = adodb_mktime();
$conn = &GetADODBConnection();
/* $sql = "INSERT INTO ".GetTablePrefix()."EmailLog VALUES ('', '".htmlspecialchars($From)."', '".htmlspecialchars($To)."', '$Subject', $time, '')";
$conn->Execute($sql);*/
$headers = "Date: ".adodb_date("r")."\n".$headers;
$headers = "Return-Path: ".$objConfig->Get("Smtp_AdminMailFrom")."\n".$headers;
/* ensure headers are using \r\n instead of \n */
$headers = str_replace("\n\n","\r\n\r\n",$headers);
$headers = str_replace("\r\n","\n",$headers);
$headers = str_replace("\n","\r\n",$headers);
// if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
$Msg = str_replace("\n\n","\r\n\r\n",$Msg);
$Msg = str_replace("\r\n","\n",$Msg);
$Msg = str_replace("\n","\r\n",$Msg);
// }
//echo "<PRE>"; print_r(htmlentities($headers)); echo "</PRE>";
//echo "<PRE>"; print_r(htmlentities($Msg)); echo "</PRE>";
$ver = phpversion();
if(substr($Subject,0,9)=="Subject: ")
$Subject = substr($Subject,9);
if(!strlen($objConfig->Get("Smtp_Server")) || !$this->AllowSockets())
{
return mail($To,trim($Subject),$Msg, $headers);
}
$headers = "To: <".$To.">"."\r\n".$headers;
$headers = "Subject: ".trim($Subject)."\r\n".$headers;
if (strpos($To, ',') !== false) {
$To = str_replace(' ', '', $this->To);
$send_params['recipients'] = explode(',', $this->To);
}
else {
$send_params['recipients'] = array($To); // The recipients (can be multiple)
}
$send_params['from'] = $From; // This is used as in the MAIL FROM: cmd
$send_params['headers'] = explode("\r\n",$headers);
// It should end up as the Return-Path: header
$send_params['body'] = $Msg; // The body of the email
$params['host'] = $objConfig->Get("Smtp_Server"); // The smtp server host/ip
$params['port'] = 25; // The smtp server port
$params['hello'] = 'INPORTAL'; // What to use when sending the helo command. Typically, your domain/hostname
if($objConfig->Get("Smtp_Authenticate")) // Whether to use basic authentication or not
{
$params['auth'] = TRUE;
$params['user'] = $objConfig->Get("Smtp_User");
$params['pass'] = $objConfig->get("Smtp_Pass");
}
else
$params['auth'] = FALSE;
$this->LogLevel=0;
$SmtpServer = new smtp($params);
if($this->LogLevel>0)
{
$SmtpServer->debug=1;
foreach($params as $key=>$value)
{
$this->WriteToMailLog($key."=".$value);
}
}
else
{
//$SmtpServer->debug = 1;
}
$connected = $SmtpServer->connect();
if($connected)
{
if($this->LogLevel>1)
{
$this->WriteToMailLog("Connected to ".$params['host']);
}
$res = $SmtpServer->send($send_params);
}
$SmtpServer->disconnect();
if($this->LogLevel>1)
{
foreach($SmtpServer->buffer as $l)
{
$this->WriteToMailLog($l);
}
}
if($this->LogLevel>0)
{
if(count($SmtpServer->errors)>0)
{
foreach($SmtpServer->errors as $e)
{
$this->WriteToMailLog($e);
}
}
else
$this->WriteToMailLog("Message to $From Delivered Successfully");
}
unset($SmtpServer);
return $res;
}
}
function EnqueueMail($To,$From,$Subject,$Msg,$headers)
{
global $objSession;
$ado = &GetADODBConnection();
$To = mysql_escape_string($To);
$From = mysql_escape_string($From);
$Msg = mysql_escape_string($Msg);
$headers = mysql_escape_string($headers);
$Subject = mysql_escape_string($Subject);
$sql = "INSERT INTO ".$this->SourceTable." (toaddr,fromaddr,subject,message,headers) VALUES ('$To','$From','$Subject','$Msg','$headers')";
$ado->Execute($sql);
}
function SendMailQeue()
{
global $objConfig, $objSession, $TotalMessagesSent;
$ado = &GetADODBConnection();
$MaxAllowed = $this->MessagesAtOnce;
$del_sql = array();
$NumToSend = $MaxAllowed - $this->MessagesSent;
if($NumToSend < 0) $NumToSend=1; // Don't really know why, but this could happend, so issued this temp fix
$sql = "SELECT * FROM ".$this->SourceTable." ORDER BY queued ASC LIMIT $NumToSend";
$rs = $ado->Execute($sql);
while($rs && !$rs->EOF)
{
$data = $rs->fields;
$this->DeliverMail($data["toaddr"],$data["fromaddr"],$data["Subject"],$data["message"],$data["headers"],1);
$del_sql[] = "DELETE FROM ".$this->SourceTable." WHERE queued='".$data["queued"]."'";
$rs->MoveNext();
}
$numdel = count($del_sql);
for($i=0;$i<$numdel;$i++)
{
$sql = $del_sql[$i];
if(strlen($sql))
$ado->Execute($sql);
if($objSession->HasSystemPermission("DEBUG.ITEM"))
echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
}
}
function SendMail($From, $FromName, $ToAddr, $ToName, $Subject, $Text, $Html, $charset, $SendEvent,$FileName="",$FileLoc="",$QueueOnly=0,$extra_headers = array())
{
+ $charset = GetRegionalOption('Charset');
+
$HasFile = FALSE;
$HasFile = (strlen($FileName)>0);
$OB="----=_OuterBoundary_000".md5( uniqid (rand()));
$boundary = "-----=".md5( uniqid (rand()));
$f = "\"$FromName\" <".$From.">";
$headers = "From: $f"."\n";
$headers .= "MIME-Version: 1.0"."\n";
$conn = &GetADODBConnection();
$time = adodb_mktime();
$sendTo = $ToName;
if (strlen($sendTo) > 0) {
$sendTo .= "($ToAddr)";
}
else {
$sendTo = $ToAddr;
}
$sendTo=addslashes($sendTo);
$sql = "INSERT INTO ".GetTablePrefix()."EmailLog VALUES ('', ".$conn->qstr($FromName).", ".$conn->qstr($sendTo).", ".$conn->qstr( str_replace("Subject:", "", $Subject) ).", $time, '$SendEvent')";
$conn->Execute($sql);
if(is_array($extra_headers))
{
foreach ($extra_headers as $h)
{
$headers .= $h."\n";
}
}
$msg .="This is a multi-part message in MIME format."."\n"."\n";
if($HasFile)
{
//Messages start with text/html alternatives in OB
$headers.="Content-Type: multipart/mixed;"."\n"."\tboundary=\"".$OB."\""."\n"."\n";
$msg.="--".$OB."\n";
$msg.="Content-Type: multipart/alternative; boundary=\"$boundary\""."\n"."\n"."\n";
}
else {
$headers .= "Content-Type: multipart/alternative; boundary=\"$boundary\""."\n";
}
$application =& kApplication::Instance();
$db =& $application->GetADODBConnection();
if (!$Text) {
$Text = strip_tags($Html);
}
else {
$Text = strip_tags($Text);
}
$msg .= "--" . $boundary . "\n";
$msg .= "Content-Type: text/plain; charset=\"$charset\""."\n";
$msg .= "Content-Transfer-Encoding: 8bit"."\n"."\n";
$msg .= stripslashes($Text);
$msg .= "\n"."\n";
if(strlen($Html)>0)
{
$msg .= "--" . $boundary . "\n";
- $msg .= "Content-Type: text/html; charset=\"iso-8859-1\""."\n";
+ $msg .= "Content-Type: text/html; charset=\"".$charset."\""."\n";
$msg .= "Content-Transfer-Encoding: 8bit"."\n"."\n";
$msg .= stripslashes($Html);
$msg .= "\n"."\n";
}
$msg .= "--" . $boundary . "--"."\n";
if($HasFile)
{
if(!strlen($FileLoc)) {
$FileLoc = $FileName;
}
$FileName = basename($FileName);
$msg .= "\n"."--".$OB."\n";
$msg.="Content-Type: application/octetstream;"."\n"."\tname=\"".$FileName."\""."\n";
$msg.="Content-Transfer-Encoding: base64"."\n";
$msg.="Content-Disposition: attachment;"."\n"."\tfilename=\"".$FileName."\""."\n"."\n";
//file goes here
$fd=fopen ($FileLoc, "r");
if($fd)
{
$FileContent=fread($fd,filesize($FileLoc));
fclose ($fd);
}
$FileContent=chunk_split(base64_encode($FileContent));
$msg .= $FileContent."\n";
$msg .= "--".$OB."--"."\n";
}
if($this->MessagesSent>$this->MessagesAtOnce || $QueueOnly==1)
{
$this->EnqueueMail($ToAddr,$From,$Subject,$msg,$headers);
}
else
{
$this->DeliverMail($ToAddr,$From,$Subject,$msg,$headers);
}
}
}
?>
Property changes on: trunk/kernel/include/emailmessage.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.58
\ No newline at end of property
+1.59
\ No newline at end of property
Index: trunk/kernel/include/modules.php
===================================================================
--- trunk/kernel/include/modules.php (revision 6427)
+++ trunk/kernel/include/modules.php (revision 6428)
@@ -1,1009 +1,1026 @@
<?php
/* List of installed modules and module-specific variables
Copyright 2002, Intechnic Corporation, All rights reserved
*/
$ado =& GetADODBConnection();
-$session_cookie_name = $ado->GetOne('SELECT VariableValue FROM '.$g_TablePrefix.'ConfigurationValues WHERE VariableName = "SessionCookieName"');
-define('SESSION_COOKIE_NAME', $session_cookie_name ? $session_cookie_name : 'sid');
+$application =& kApplication::Instance();
+define('SESSION_COOKIE_NAME', $application->Session->CookieName);
+
+/*$session_cookie_name = $ado->GetOne('SELECT VariableValue FROM '.$g_TablePrefix.'ConfigurationValues WHERE VariableName = "SessionCookieName"');
+define('SESSION_COOKIE_NAME', $session_cookie_name ? $session_cookie_name : 'sid');
+*/
set_cookie('cookies_on', '1', adodb_mktime() + 31104000);
// if branches that uses if($mod_prefix) or like that will never be executed
// due global variable $mod_prefix is never defined
$ExtraVars = array();
function ParseEnv()
{
global $env, $var_list, $mod_prefix,$objSession, $SessionQueryString;
/* parse individual sections */
$env = GetVar('env');
if (!$env)
{
$var_list['t'] = 'index';
if (is_array($mod_prefix))
{
foreach($mod_prefix as $module_prefix => $module_name)
{
$parser_name = $module_prefix.'_ParseEnv';
if( function_exists($parser_name) ) $parser_name();
}
}
}
else
{
$env_sections = explode(':', $env);
$main = array_shift($env_sections);
if($main)
{
list($sid, $template) = explode('-', $main, 2);
if(!$SessionQueryString)
{
if (!$sid || $sid == '_')
{
if ($sid != '_') $sid = $_COOKIE[SESSION_COOKIE_NAME];
}
else
{
$SessionQueryString = true;
}
}
$var_list['sid'] = $sid;
$var_list['t'] = $template;
if( getArrayValue($_GET, 'dest') ) $var_list['dest'] = $_GET['dest'];
}
foreach ($env_sections as $env_section)
{
$env_section = preg_replace("/^([a-zA-Z]+)([0-9]+)-(.*)/", "$1-$2-$3", $env_section);
$pieces = explode('-', $env_section);
$parser_name = $pieces[0].'_ParseEnv';
if( function_exists($parser_name) )
{
$env_section = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/','\\1\\2-\\3', $env_section);
$parser_name($env_section);
}
}
}
if(!$SessionQueryString) $var_list['sid'] = $_COOKIE[SESSION_COOKIE_NAME];
}
function LoadEnv()
{
global $env, $var_list, $mod_prefix,$objSession;
$env = $_GET["env"];
// echo "Loading Variables..<br>\n";
if ($env != "")
{
$envsections = explode(":", $env);
foreach($mod_prefix as $key => $value)
{
if(strlen($key))
{
$parsed=FALSE;
for($i=1; $i<sizeof($envsections); $i++)
{
$pieces = explode("-", $envsections[$i]);
if(substr($pieces[0],0,strlen($key))==$key)
{
$parsed=TRUE;
break;
}
}
if(!$parsed)
{
$parser_name = $key . "_LoadEnv";
//echo $parser_name;
if(function_exists($parser_name))
{
$parser_name();
}
}
else
{
$parser_name = $key . "_SaveEnv";
//echo $parser_name;
if(function_exists($parser_name))
{
$parser_name($envsections[$i]);
}
}
}
}
}
}
function BuildEnv($mod_prefix = false)
{
global $var_list,$m_var_list, $var_list_update, $mod_prefix, $objSession, $objConfig,
$ExtraVars, $objThemes, $CurrentTheme, $SessionQueryString, $FrontEnd;
static $theme;
$env = "";
//echo "Query String: $SessionQueryString<br>\n";
if(($objConfig->Get("CookieSessions")==0 || !$FrontEnd || ($objConfig->Get("CookieSessions")==2 && $SessionQueryString==TRUE)))
{
if(!$objSession->UseTempKeys)
{
$sessionkey = $objSession->GetSessionKey();
}
else
$sessionkey = $objSession->Get("CurrentTempKey");
$env = $sessionkey;
}
$env .= "-";
if (isset($var_list_update["t"]))
{
if($var_list_update["t"]=="_referer_")
{
$var_list_update["t"] =$objSession->GetVariable("Template_Referer");
}
$t = $var_list_update["t"];
if (substr($t, 0, strlen('kernel4:')) == 'kernel4:')
{
$t = substr($t, strlen('kernel4:'));
$env .= $t;
}
else {
if(!is_numeric($t))
{
if(!is_object($theme))
$theme = $objThemes->GetItem($m_var_list["theme"]);
$id = $theme->GetTemplateId($t);
$var_list_update["t"] = $id;
}
$env .= $var_list_update["t"];
}
}
else
{
$t = isset($var_list['t']) ? $var_list['t'] : '';
if(!is_numeric($t))
{
if(!is_object($theme))
$theme = $objThemes->GetItem($m_var_list["theme"]);
$id = $theme->GetTemplateId($t);
$t = $id;
}
$env .= $t;
}
if(is_array($mod_prefix))
{
foreach($mod_prefix as $key => $value)
{
$builder_name = $key . "_BuildEnv";
if(function_exists($builder_name))
{
if($key == 'm')
{
$GLOBALS[$key.'_var_list_update']['test'] = 'test';
}
$env .= $builder_name();
}
}
}
$extra = "";
$keys = array_keys($ExtraVars);
if(is_array($keys))
{
for($i=0;$i<count($keys);$i++)
{
$key = $keys[$i];
$e = "&".$key."=".$ExtraVars[$key];
$extra .= $e;
$e = "";
}
}
$env .= $extra;
return $env;
}
function BuildEnv_NEW($mod_prefix = false)
{
global $var_list, $var_list_update, $mod_prefix, $objSession;
$t = getArrayValue($var_list_update, 't') ? $var_list_update['t'] : $var_list['t'];
if($t == '_referer_') $t = $objSession->GetVariable('Template_Referer');
if ( substr($t, 0, strlen('kernel4:') ) == 'kernel4:' ) $t = substr($t, strlen('kernel4:') );
$url_params = Array('t' => $t);
+ // sicne 1.3.0 the category is not passed by default when mod_rewrite is on
+ // enable pass category for module templates (they usually need it) and suggest_cat.
+ // platform templates usually do not need category
+ if (
+ preg_match('/^inlink|^inbulletin|^innews/', $t) ||
+ in_array(preg_replace('/\.tpl$/', '', $t), array('suggest_cat'))
+ ) {
+ $url_params['pass_category'] = 1;
+ }
$app =& kApplication::Instance();
$app->SetVar('prefixes_passed', Array() );
if( is_array($mod_prefix) )
{
foreach($mod_prefix as $key => $value)
{
$builder_name = $key.'_BuildEnv_NEW';
if( function_exists($builder_name) )
{
if($key == 'm')
{
$GLOBALS[$key.'_var_list_update']['test'] = 'test';
}
$url_params = array_merge_recursive2($url_params, $builder_name() );
}
}
}
$url_params['pass'] = implode( ',', $app->GetVar('prefixes_passed') );
return $url_params;
}
function CategoryActionFunc($basename,$CatList)
{
global $mod_prefix;
foreach($mod_prefix as $key => $value)
{
$function_name = $key."_".$basename;
if(function_exists($function_name))
{
$function_name($CatList);
}
}
}
function RegisterEnv($Var,$Value)
{
global $ExtraVars;
$ExtraVars[$Var] = $Value;
}
function UnregisterEnv($Var)
{
global $ExtraVars;
unset($ExtraVars[$Var]);
}
function ModuleTagPrefix($name)
{
global $modules_loaded;
$ret = "";
foreach($modules_loaded as $prefix=>$mod_name)
{
if($name==$mod_name)
{
$ret = $prefix;
break;
}
}
return $ret;
}
function ModuleEnabled($name)
{
global $template_path;
$a = array_keys($template_path);
if(in_array($name,$a))
return TRUE;
return FALSE;
}
function GetModuleArray($array_name="mod_prefix")
{
switch($array_name)
{
case "mod_prefix":
global $mod_prefix;
return $mod_prefix;
break;
case "admin":
global $mod_prefix, $modules_loaded;
$mod = array();
if(is_array($mod_prefix) && is_array($modules_loaded))
{
foreach ($mod_prefix as $key=>$value)
{
if($key != 'bbcat' && _ModuleLicensed($modules_loaded[$key]) || $key=="m")
{
$mod[$key] = $value;
}
}
}
return $mod;
break;
case "loaded":
global $modules_loaded;
return $modules_loaded;
break;
case "template":
global $template_path;
return $template_path;
case "rootcat":
global $mod_root_cats;
return $mod_root_cats;
break;
}
}
function admin_login()
{
- global $objSession,$login_error, $objConfig,$g_Allow,$g_Deny;
-// echo "<pre>"; print_r($objSession); echo "</pre>";
+ global $objSession,$login_error, $objConfig,$g_Allow,$g_Deny;
+ // echo "<pre>"; print_r($objSession); echo "</pre>";
if( GetVar('help_usage') == 'install' ) return true;
- $env_arr = explode('-', $_GET['env']);
- $get_session_key = $env_arr[0];
- $admin_login = isset($_POST['adminlogin']) && $_POST['adminlogin'];
- if(!$objSession->ValidSession() || ($objSession->GetSessionKey() != $get_session_key && !$admin_login)) {
- if( isset($_GET['expired']) && ($_GET['expired'] == 1) )
- $login_error = admin_language("la_text_sess_expired");
+ $env_arr = explode('-', $_GET['env']);
+ $get_session_key = $env_arr[0];
+ $admin_login = isset($_POST['adminlogin']) && $_POST['adminlogin'];
+ if(!$objSession->ValidSession()) { // || ($objSession->GetSessionKey() != $get_session_key && !$admin_login)
+ if( isset($_GET['expired']) && ($_GET['expired'] == 1) )
+ $login_error = admin_language("la_text_sess_expired");
- return FALSE;
- //echo "Expired<br>";
- }
+ return FALSE;
+ //echo "Expired<br>";
+ }
if ($objSession->HasSystemPermission("ADMIN") == 1)
- return TRUE;
+ return TRUE;
- if(count($_POST)==0 || $_POST["adminlogin"]!=1)
- return FALSE;
- $login=$_POST["login"];
- $password = $_POST["password"];
+ if(count($_POST)==0 || $_POST["adminlogin"]!=1)
+ return FALSE;
+ $login=$_POST["login"];
+ $password = $_POST["password"];
- if (strlen($login) && strlen($password))
- {
- if(!_IpAccess($_SERVER['REMOTE_ADDR'],$g_Allow,$g_Deny))
- {
- $login_error = admin_language("la_text_address_denied");
- return FALSE;
- }
- $valid = $objSession->Login($login, md5($password));
- $hasperm = ($objSession->HasSystemPermission("ADMIN") == 1);
- if (($login=="root" || $hasperm) && $valid)
- {
- if(_ValidateModules())
- {
- return TRUE;
- }
- else
- $login_error = "Missing or invalid In-Portal License";
- }
- else
- {
- if(!$hasperm && $valid)
- {
- $login_error = admin_language("la_text_nopermissions");
- }
- else
- {
- $login_error = admin_language("la_Text_Access_Denied");
- }
- return FALSE;
- }
+ if (strlen($login) && strlen($password))
+ {
+ if(!_IpAccess($_SERVER['REMOTE_ADDR'],$g_Allow,$g_Deny))
+ {
+ $login_error = admin_language("la_text_address_denied");
+ return FALSE;
+ }
+ $valid = $objSession->Login($login, md5($password));
+ $hasperm = ($objSession->HasSystemPermission("ADMIN") == 1);
+ if (($login=="root" || $hasperm) && $valid)
+ {
+ if(_ValidateModules())
+ {
+ return TRUE;
+ }
+ else
+ $login_error = "Missing or invalid In-Portal License";
+ }
+ else
+ {
+ if(!$hasperm && $valid)
+ {
+ $login_error = admin_language("la_text_nopermissions");
+ }
+ else
+ {
+ $login_error = admin_language("la_Text_Access_Denied");
+ }
+ return FALSE;
+ }
+ }
+ else
+ {
+ if(!strlen($login))
+ {
+ $login_error = admin_language("la_Text_Missing_Username");
+ }
+ else
+ if(!strlen($password))
+ $login_error = admin_language("la_Text_Missing_Password");
+ return FALSE;
}
- else
- {
- if(!strlen($login))
- {
- $login_error = admin_language("la_Text_Missing_Username");
- }
- else
- if(!strlen($password))
- $login_error = admin_language("la_Text_Missing_Password");
- return FALSE;
- }
}
#---------------------------------------------------------------------------
function _EnableCookieSID()
{
global $var_list, $objConfig;
if((!$_COOKIE[SESSION_COOKIE_NAME] && $objConfig->Get("CookieSessions")>0 && strlen($var_list["sid"])<2 && !headers_sent())
|| strlen($_COOKIE[SESSION_COOKIE_NAME]) > 0)
{
return TRUE;
}
else
return FALSE;
}
function _IsSpider($UserAgent)
{
global $robots, $pathtoroot;
$lines = file($pathtoroot."robots_list.txt");
if(!is_array($robots))
{
$robots = array();
for($i=0;$i<count($lines);$i++)
{
$l = $lines[$i];
$p = explode("\t",$l,3);
$robots[] = $p[2];
}
}
return in_array($UserAgent,$robots);
}
function _StripDomainHost($d)
{
$dotcount = substr_count($d,".");
if($dotcount==3)
{
$IsIp = TRUE;
for($x=0;$x<strlen($d);$x++)
{
if(!is_numeric(substr($d,$x,1)) && substr($d,$x,1)!=".")
{
$IsIp = FALSE;
break;
}
}
}
if($dotcount>1 && !$IsIp)
{
$p = explode(".",$d);
$ret = $p[count($p)-2].".".$p[count($p)-1];
}
else
$ret = $d;
return $ret;
}
function _MatchIp($ip1,$ip2)
{
$matched = TRUE;
$ip = explode(".",$ip1);
$MatchIp = explode(".",$ip2);
for($i=0;$i<count($ip);$i++)
{
if($i==count($MatchIp))
break;
if(trim($ip[$i]) != trim($MatchIp[$i]) || trim($ip[$i])=="*")
{
$matched=FALSE;
break;
}
}
return $matched;
}
function _IpAccess($IpAddress,$AllowList,$DenyList)
{
$allowed = explode(",",$AllowList);
$denied = explode(",",$DenyList);
$MatchAllowed = FALSE;
for($x=0;$x<count($allowed);$x++)
{
$ip = explode(".",$allowed[$x]);
$MatchAllowed = _MatchIp($IpAddress,$allowed[$x]);
if($MatchAllowed)
break;
}
$MatchDenied = FALSE;
for($x=0;$x<count($denied);$x++)
{
$ip = explode(".",$denied[$x]);
$MatchDenied = _MatchIp($IpAddress,$denied[$x]);
if($MatchDenied)
break;
}
$Result = (($MatchAllowed && !$MatchDenied) || (!$MatchAllowed && !$MatchDenied) ||
($MatchAllowed && $MatchDenied));
return $Result;
}
function _ValidateModules()
{
global $i_Keys, $objConfig, $g_License;
$lic = base64_decode($g_License);
_ParseLicense($lic);
$modules = array();
//echo "License: ".$lic."<br>";
$domain = _GetDomain();
//echo "Domain: ".$domain."<br>";
if(!_IsLocalSite($domain))
{
$domain = _StripDomainHost($domain);
//echo "New domain: $domain<br>";
// echo "<pre>"; print_r($i_Keys); echo "</pre>";
for($x=0;$x<count($i_Keys);$x++)
{
$key = $i_Keys[$x];
if(strlen(stristr($key["domain"],$domain)))
{
$modules = explode(",",$key["mod"]);
//echo "Modules: $modules";
}
}
if(count($modules)>0)
{
return TRUE;
}
}
else
return TRUE;
return FALSE;
}
function _ModuleLicensed($name)
{
global $i_Keys, $objConfig, $pathtoroot;
$vars = parse_portal_ini($pathtoroot.'config.php');
// globalize vars from config (theese vars are already present, why to do this again?)
foreach ($vars as $config_key => $config_value) {
$GLOBALS['g_'.$config_key] = $config_value;
}
$lic = base64_decode($GLOBALS['g_License']);
_ParseLicense($lic);
$modules = array();
if(!_IsLocalSite(_GetDomain()))
{
for($x=0;$x<count($i_Keys);$x++)
{
$key = $i_Keys[$x];
if(strlen(stristr(_GetDomain(),$key["domain"])))
{
//echo "ok<br>";
$modules = explode(",",$key["mod"]);
}
}
//print_pre($modules);
if(in_array($name,$modules)) {
//echo "ok<br>";
return TRUE;
}
}
else {
return TRUE;
}
return FALSE;
}
function _GetDomain()
{
global $objConfig, $g_Domain;
if($objConfig->Get("DomainDetect"))
{
$d = $_SERVER['HTTP_HOST'];
}
else
$d = $g_Domain;
return $d;
}
function _keyED($txt,$encrypt_key)
{
$encrypt_key = md5($encrypt_key);
$ctr=0;
$tmp = "";
for ($i=0;$i<strlen($txt);$i++)
{
if ($ctr==strlen($encrypt_key)) $ctr=0;
$tmp.= substr($txt,$i,1) ^ substr($encrypt_key,$ctr,1);
$ctr++;
}
return $tmp;
}
function _decrypt($txt,$key)
{
$txt = _keyED($txt,$key);
$tmp = "";
for ($i=0;$i<strlen($txt);$i++)
{
$md5 = substr($txt,$i,1);
$i++;
$tmp.= (substr($txt,$i,1) ^ $md5);
}
return $tmp;
}
function LoadFromRemote()
{
return "";
}
function DLid()
{
global $lid;
echo $lid."\n";
die();
}
function _LoadLicense($LoadRemote=FALSE)
{
global $pathtoroot, $objConfig;
$f = $pathtoroot."intechnic.php";
if (_falseIsLocalSite($f)) $ret = true;
if(file_exists($f))
{
$contents = file($f);
$data = base64_decode($contents[1]);
}
else
if($LoadRemote)
return $LoadFromRemote;
return $data;
}
function _VerifyKey($domain,$k)
{
$key = md5($domain);
$lkey = substr($key,0,strlen($key)/2);
$rkey = substr($key,strlen($key)/2);
$r = $rkey.$lkey;
if($k==$r)
return TRUE;
return FALSE;
}
function _ParseLicense($txt)
{
global $i_User, $i_Pswd, $i_Keys;
if (!_falseIsLocalSite($txt)) $nah = false;
$data = _decrypt($txt,"beagle");
$i_Keys = array();
$lines = explode("\n",$data);
for($x=0;$x<count($lines);$x++)
{
$l = $lines[$x];
$p = explode("=",$l,2);
switch($p[0])
{
case "Username":
$i_User = $p[1];
break;
case "UserPass":
$i_Pswd = $p[1];
break;
default:
if(substr($p[0],0,3)=="key")
{
$parts = explode("|",$p[1]);
if(_VerifyKey($parts[0],$parts[1]))
{
unset($K);
$k["domain"]=$parts[0];
$k["key"]=$parts[1];
$k["desc"]=$parts[2];
$k["mod"]=$parts[3];
$i_Keys[] = $k;
}
}
break;
}
}
}
function _GetObscureValue($i)
{
if ($i == 'x') return 0254; $z = '';
if ($i == 'z') return 0x7F.'.';
if ($i == 'c') return '--code--';
if ($i >= 5 && $i < 7) return _GetObscureValue($z)*_GetObscureValue('e');
if ($i > 30) return Array(0x6c,0x6f,0x63,0x61,0x6c,0x68,0x6f,0x73,0x74);
if ($i > 20) return 99;
if ($i > 10) return '.'.(_GetObscureValue(6.5)+1);
if ($i == 'a') return 0xa;
}
function _Chr($val)
{
$x = _GetObscureValue(25);
$f = chr($x).chr($x+5).chr($x+15);
return $f($val);
}
function _IsLocalSite($domain)
{
$ee = _GetObscureValue(35); $yy = '';
foreach ($ee as $e) $yy .= _Chr($e);
$localb = FALSE;
if(substr($domain,0,3)==_GetObscureValue('x'))
{
$b = substr($domain,0,6);
$p = explode(".",$domain);
$subnet = $p[1];
if($p[1]>15 && $p[1]<32)
$localb=TRUE;
}
$zz = _GetObscureValue('z')._GetObscureValue(5).'.'.(int)_GetObscureValue(7)._GetObscureValue(12);
$ff = _GetObscureValue('z')+65;
$hh = $ff-0x18;
if($domain==$yy || $domain==$zz || substr($domain,0,7)==$ff._Chr(46).$hh ||
substr($domain,0,3)==_GetObscureValue('a')._Chr(46) || $localb || strpos($domain,".")==0)
{
return TRUE;
}
return FALSE;
}
function _falseIsLocalSite($domain)
{
$localb = FALSE;
if(substr($domain,0,3)=="172")
{
$b = substr($domain,0,6);
$p = explode(".",$domain);
$subnet = $p[1];
if($p[1]>15 && $p[1]<32)
$localb=TRUE;
}
if($domain=="localhost" || $domain=="127.0.0.1" || substr($domain,0,7)=="192.168" ||
substr($domain,0,3)=="10." || $localb || strpos($domain,".")==0)
{
return TRUE;
}
return FALSE;
}
//echo "Before Stuff<br>";
LogEntry("Loading Modules\n");
/* get the module list from the database */
$adodbConnection = &GetADODBConnection();
$sql = "SELECT Name, Path, Var,TemplatePath, RootCat from ".GetTablePrefix()."Modules where Loaded=1 ORDER BY LoadOrder";
$rs = $adodbConnection->Execute($sql);
while($rs && !$rs->EOF)
{
$key = $rs->fields["Var"];
$mod_prefix[$key] = $rs->fields["Path"];
$modules_loaded[$key] = $rs->fields["Name"];
$name = $rs->fields["Name"];
$template_path[$name] = $rs->fields["TemplatePath"];
$mod_root_cats[$name] = $rs->fields["RootCat"];
// echo $key . "=". $modules_loaded[$key]."<br>\n";
$rs->MoveNext();
}
LogEntry("Loading Module Parser scripts\n");
/* for each module enabled, load up parser.php */
//foreach($mod_prefix as $key => $value)
$LogLevel++;
if(is_array($mod_prefix))
{
foreach($mod_prefix as $key => $value)
{
$mod = $pathtoroot . $value . "parser.php";
// LogEntry("Loading parser $mod \n");
if (file_exists($mod)) { // k4 modules may have no parser.php
require_once($mod);
}
}
}
$LogLevel--;
LogEntry("Finished Loading Module Parser scripts\n");
/*now each module gets a look at the environment string */
// SID detecting engine: begin
$SessionQueryString = false; // by default assume, that SID is located in cookie
if( !isset($FrontEnd) ) $FrontEnd = false; // if frontend not explicitly defined, than
-if($FrontEnd != 1)
+ $SessionQueryString = $application->Session->NeedQueryString();
+
+
+/*if($FrontEnd != 1) {
$SessionQueryString = true;
+}*/
if (is_array($mod_prefix)) {
ParseEnv();
}
if (defined('THIS_FILE') && (THIS_FILE == 'admin/index') ) {
// this is admin login screen & we don't have sid in url here,
// but session is already created by K4, then gether sid from it
$application =& kApplication::Instance();
$var_list['sid'] = $application->GetSID();
}
/* create the session object */
$ip = $_SERVER["REMOTE_ADDR"];
if ( !isset($var_list['sid']) ) $var_list['sid'] = '';
if ( !isset($_GET['env']) ) $_GET['env'] = '';
-if(strlen($var_list["sid"])==0 && strlen($_GET["env"])>0 && $objConfig->Get("CookieSessions")==2)
+if(strlen($var_list["sid"])==0 && strlen($_GET["env"])>0 && $objConfig->Get("CookieSessions")==smCOOKIES_ONLY)
{
- if(_IsSpider($_SERVER["HTTP_USER_AGENT"]))
- {
- $UseSession = FALSE;
- }
- else
- {
- /* switch user to GET session var */
- if (!$_COOKIE[SESSION_COOKIE_NAME]) {
- $SessionQueryString = TRUE;
- }
- //else {
- //$cg = '--code--';
- //}
- $UseSession = TRUE;
- }
+ if(_IsSpider($_SERVER["HTTP_USER_AGENT"]))
+ {
+ $UseSession = FALSE;
+ }
+ else
+ {
+ /* switch user to GET session var */
+ if (!$_COOKIE[SESSION_COOKIE_NAME]) {
+ $SessionQueryString = TRUE;
+ }
+ //else {
+ //$cg = '--code--';
+ //}
+ $UseSession = TRUE;
+ }
}
else {
- $UseSession = TRUE;
+ $UseSession = TRUE;
}
if($var_list["sid"]=="_")
$var_list["sid"]="";
/*setup action variable*/
$Action = isset($_REQUEST['Action']) ? $_REQUEST['Action'] : '';
if($Action == 'm_logout')
{
- $u = new clsUserSession($var_list['sid'] ,($SessionQueryString && $FrontEnd==1));
+ $u = new clsUserSession($var_list['sid']); // ,($SessionQueryString && $FrontEnd==1)
$application =& kApplication::Instance();
$application->HandleEvent( new kEvent('u:OnInpLogout') );
$u->Logout();
unset($u);
$var_list_update['t'] = 'index';
$var_list['t'] = '';
$var_list['sid'] = '';
set_cookie('login', '', adodb_mktime() - 3600);
set_cookie(SESSION_COOKIE_NAME, '', adodb_mktime() - 3600);
}
$CookieTest = isset($_COOKIE['cookies_on']) ? $_COOKIE['cookies_on'] : '';
if($var_list['sid'] && !$CookieTest) // when going from http -> https and via versa assume, that cookies are allowed
{
$CookieTest = true;
$_COOKIE['cookies_on'] = 1;
}
$HTTP_REFERER = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
-if ( ($CookieTest == 1) /*|| !strstr($HTTP_REFERER, $_SERVER['HTTP_HOST'].$objConfig->Get("Site_Path"))*/) {
+/*if ( ($CookieTest == 1) ) { // || !strstr($HTTP_REFERER, $_SERVER['HTTP_HOST'].$objConfig->Get("Site_Path"))
$SessionQueryString = FALSE;
}
if ($FrontEnd != 1) {
$SessionQueryString = TRUE;
-}
+}*/
// SID detecting engine: end
$objSession = new clsUserSession($var_list["sid"],($SessionQueryString && $FrontEnd==1));
if($UseSession)
{
if(!$objSession->ValidSession())
{
/* Get rid of Invalid Session and make a brand new one*/
// echo "Dumping Session ".$var_list["sid"]."<br>";
unset($var_list["sid"]);
$objSession->GetNewSession();
$var_list["sid"] = $objSession->GetSessionKey();
$var_list_update["sid"]=$objSession->GetSessionKey();
if(is_numeric($m_var_list["theme"]))
$objSession->SetThemeName($m_var_list["theme"]);
if($objConfig->Get("CookieSessions")>0 && !$SessionQueryString && !headers_sent())
{
- set_cookie(SESSION_COOKIE_NAME, $var_list['sid'], 0);
+// set_cookie(SESSION_COOKIE_NAME, $var_list['sid'], 0);
}
//echo "New Session: ".$objSession->GetSessionKey()."<br>\n";
if(isset($_COOKIE["login"]) && $Action != "m_logout" && $FrontEnd==1)
{
$parts = explode("|",$_COOKIE["login"]);
$username = $parts[0];
$pass = $parts[1];
$objSession->Login($username,$pass);
}
}
else
{
if($objSession->Get("Language")!=$m_var_list["lang"])
{
$objSession->Set("Language",$m_var_list["lang"]);
}
$objSession->LoadSessionData();
$objSession->UpdateAccessTime();
$objSession->Update();
LoadEnv();
}
}
if( isset($var_list['t']) && is_numeric($var_list['t']))
{
if( !isset($CurrentTheme) ) $CurrentTheme = null;
if(!is_object($CurrentTheme))
$CurrentTheme = $objThemes->GetItem($m_var_list["theme"]);
$var_list["t"] = $CurrentTheme->GetTemplateById($var_list["t"]);
$objSession->Set("Theme",$CurrentTheme->Get("Name"));
}
/*create the global current user object */
$UserID=$objSession->Get("PortalUserId");
$objCurrentUser = new clsPortalUser($UserID);
$objLanguageCache = new clsLanguageCache($m_var_list["lang"]);
/* include each module's action.php script */
LogEntry("Loading Module action scripts\n");
## Global Referer Template
$_local_t = isset($var_list['t']) ? $var_list['t'] : '';
if(is_array($mod_prefix))
{
foreach($mod_prefix as $key => $folder_name)
{
$var_to_global = $key.'_var_list';
global $$var_to_global;
$application =& kApplication::Instance(); // just to sure, that object is here in all actions
if($FrontEnd == 0 || !is_numeric($FrontEnd) || $FrontEnd == 2) {
$rootURL = 'http://'.ThisDomain().$objConfig->Get('Site_Path');
$admin = $objConfig->Get("AdminDirectory");
if( !strlen($admin) ) $admin = "admin";
$adminURL = $rootURL.$admin;
$imagesURL = $adminURL."/images";
if( $key != 'bbcat' && _ModuleLicensed($modules_loaded[$key]) )
{
$mod = $pathtoroot.$folder_name."module_init.php";
if( file_exists($mod) ) require_once($mod);
$mod = $pathtoroot.$folder_name."action.php";
if( file_exists($mod) ) require_once($mod);
$mod = $pathtoroot.$folder_name."searchaction.php";
if( file_exists($mod) ) require_once($mod);
}
}
if($FrontEnd==1 || $FrontEnd==2)
{
$mod = $pathtoroot.$folder_name."module_init.php";
if(file_exists($mod))
require_once($mod);
$mod = $pathtoroot.$folder_name."frontaction.php";
if(file_exists($mod))
require_once($mod);
}
}
}
if (strstr($_SERVER['SCRIPT_NAME'], 'install') && $objSession->Get("PortalUserId") == 0) {
$objSession->Delete();
}
if( !isset($SearchPerformed) ) $SearchPerformed = false;
if($SearchPerformed == true) $objSearch->BuildIndexes();
LogEntry("Finished Loading Module action scripts\n");
?>
\ No newline at end of file
Property changes on: trunk/kernel/include/modules.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.51
\ No newline at end of property
+1.52
\ No newline at end of property
Index: trunk/kernel/include/image.php
===================================================================
--- trunk/kernel/include/image.php (revision 6427)
+++ trunk/kernel/include/image.php (revision 6428)
@@ -1,1255 +1,1257 @@
<?php
class clsImage extends clsParsedItem
{
var $Pending;
function clsImage($id=NULL)
{
global $objSession;
$this->clsParsedItem();
$this->tablename = GetTablePrefix()."Images";
$this->Pending = FALSE;
$this->id_field = "ImageId";
$this->type=-30;
$this->TagPrefix = "image";
$this->NoResourceId=1;
if($id)
$this->LoadFromDatabase($id);
//$this->SetDebugLevel(0);
}
function DetectChanges($name, $value)
{
global $objSession;
//print_pre($_POST);
if (!isset($this->Data[$name]) ) return false;
if ($this->Data[$name] != $value) {
//echo "$name Modified tt ".$this->Data[$name]." tt $value<br>";
if (!stristr($name, 'Resource') && !stristr($name, 'ImageId')) {
if ($objSession->GetVariable("HasChanges") != 1) {
$objSession->SetVariable("HasChanges", 2);
}
}
}
}
function GetFileName($thumb = 0)
{
global $pathtoroot;
if($thumb)
{
$p = $this->Get("ThumbPath");
}
else
{
$p = $this->Get("LocalPath");
if(!strlen($p) && $this->Get("SameImages"))
{
$p = $this->Get("ThumbPath");
}
}
if(strlen($p))
{
$parts = pathinfo($pathtoroot.$p);
$filename = $parts["basename"];
}
else
$filename = "";
return $filename;
}
function GetImageDir()
{
global $pathtoroot;
$p = $this->Get("ThumbPath");
$localp = $this->Get("LocalPath");
if(strlen($p))
{
$parts = pathinfo($pathtoroot.$p);
$d = $parts["dirname"]."/";
}
elseif (strlen($localp))
{
$parts = pathinfo($pathtoroot.$localp);
$d = $parts["dirname"]."/";
}
if($this->Pending)
$d .= "pending/";
return $d;
}
function Delete()
{
$this->DeleteLocalImage();
parent::Delete();
}
function Update($UpdatedBy=NULL,$modificationDate = null)
{
global $Errors, $objSession;
if(count($this->m_dirtyFieldsMap) == 0)
return true;
$this->SetModified($UpdatedBy,$modificationDate);
$sql = "UPDATE ".$this->tablename ." SET ";
$first = 1;
foreach ($this->m_dirtyFieldsMap as $key => $value)
{
if(!is_numeric($key) && $key != $this->IdField())
{
if($first)
{
if(isset($GLOBALS['_CopyFromEditTable']))
$sql = sprintf("%s %s=%s",$sql,$key,$this->adodbConnection->qstr(($value)));
else
$sql = sprintf("%s %s=%s",$sql,$key,$this->adodbConnection->qstr(stripslashes($value)));
$first = 0;
}
else
{
if(isset($GLOBALS['_CopyFromEditTable']))
$sql = sprintf("%s, %s=%s",$sql,$key,$this->adodbConnection->qstr(($value)));
else
$sql = sprintf("%s, %s=%s",$sql,$key,$this->adodbConnection->qstr(stripslashes($value)));
}
}
}
$sql = sprintf("%s WHERE %s = '%s'",$sql, $this->IdField(), $this->UniqueId());
if($this->debuglevel>0)
echo $sql."<br>";
if ($this->adodbConnection->Execute($sql) === false)
{
$Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Update");
return false;
}
if ($objSession->GetVariable("HasChanges") == 2) {
$objSession->SetVariable("HasChanges", 1);
}
/* if ($this->adodbConnection->Affected_Rows() > 0) {
$objSession->SetVariable("HasChanges", 1);
}*/
return true;
}
function LoadFromDatabase($Id)
{
global $Errors;
if(!isset($Id))
{
$Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromDatabase");
return false;
}
$sql = sprintf("SELECT * FROM ".$this->tablename." WHERE ImageId = '%s'",$Id);
$result = $this->adodbConnection->Execute($sql);
if ($result === false || $result->EOF)
{
$Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase");
return false;
}
$data = $result->fields;
$this->SetFromArray($data);
$this->Clean();
return true;
}
function LoadFromResource($Id,$ImageIndex)
{
global $Errors;
if(!isset($Id) || !isset($ImageIndex))
{
$Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromResource");
return false;
}
$sql = sprintf("SELECT * FROM ".$this->tablename." WHERE ResourceId = '%s'AND ImageIndex = '%s'",$Id,$ImageIndex);
$result = $this->adodbConnection->Execute($sql);
if ($result === false || $result->EOF)
{
// $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromResource");
return false;
}
$data = $result->fields;
$this->SetFromArray($data);
return true;
}
function LocalImageExists()
{
global $objConfig, $pathtoroot;
$result=FALSE;
if($this->Get("LocalImage")==1 && $this->Get("SameImages")==0)
{
$imagepath = $pathtoroot.$this->Get("LocalPath");
// $imagepath = $this->GetImageDir().$this->GetFileName();
// echo "PATH: ".$this->GetImageDir()."; FILE: ".$this->GetFileName()."<BR>";
if(strlen($imagepath)>0)
{
$result = file_exists($imagepath);
}
}
return $result;
}
function LocalThumbExists()
{
$result=FALSE;
global $objConfig, $pathtoroot;
if($this->Get("LocalThumb")==1)
{
//$imagepath = $pathtoroot.$this->Get("ThumbPath");
$imagepath = $this->GetImageDir().$this->GetFileName(1);
if(strlen($imagepath)>0)
{
$result = file_exists($imagepath);
}
}
return $result;
}
function DeleteLocalImage($Thumb=TRUE,$Full=TRUE)
{
global $pathtoroot;
if($Full)
{
if($this->LocalImageExists())
{
// $filename = $this->GetImageDir().$this->GetFileName();
$filename = $pathtoroot.$this->Get("LocalPath");
// echo "FULL: $filename<BR>\n";
@unlink($filename);
}
}
if($Thumb)
{
if($this->LocalThumbExists())
{
$filename = $this->GetImageDir().$this->GetFileName(1);
// echo "THUMB: $filename<BR>\n";
@unlink($filename);
}
}
}
function StoreUploadedImage($file, $rewrite_name=1,$DestDir,$IsThumb=0,$IsUpload=TRUE)
{
/* move the uploaded image to its final location and update the LocalPath property */
/* returns the destination filename on success */
global $objConfig,$pathtoroot;
$Dest_Dir = $DestDir;
if($this->Pending)
$Dest_Dir .= "pending/";
if(((int)$file["error"]==0) && (substr($file["type"],0,6)=="image/") && @getimagesize($file["tmp_name"]) )
{
$parts = pathinfo($file["name"]);
$ext = strtolower($parts["extension"]);
if( $GLOBALS['debuglevel'] ) echo "Processing ".$file["tmp_name"]."<br>\n";
if($rewrite_name==1)
{
if($IsThumb)
$filename = "th_";
$filename .= $this->Get("ResourceId")."_".$this->Get("ImageIndex").".".$ext;
}
else
{
$filename = $file["name"];
}
$destination = $pathtoroot.$Dest_Dir.$filename;
if( $GLOBALS['debuglevel'] ) echo $file["tmp_name"]."=>".$destination."<br>\n";
if($IsUpload==TRUE)
{
$result = @move_uploaded_file($file["tmp_name"],$destination);
}
else
$result = copy($file["tmp_name"],$destination);
if($result)
{
@chmod($destination, 0666);
return $Dest_Dir.$filename;
}
else
return "";
}
else
return "";
}
function CopyToPending()
{
global $pathtoroot;
$ThumbPath = (strlen($this->Get("ThumbPath"))>0) ? $pathtoroot.$this->Get("ThumbPath") : '';
$FullPath = strlen($this->Get("LocalPath")) ? $pathtoroot.$this->Get("LocalPath") : '';
$dest = $this->GetImageDir()."pending/";
// echo "DESTIN DIR: $dest<BR>";
// echo "THUMB PATH: $ThumbPath <BR>";
if(strlen($ThumbPath))
{
if(file_exists($ThumbPath))
{
$p = pathinfo($ThumbPath);
$d = $dest.$p["basename"];
if(file_exists($d))
unlink($d);
copy($ThumbPath,$d);
@chmod($ThumbPath.$d, 0666);
}
}
if(strlen($FullPath))
{
if(file_exists($FullPath))
{
$p = pathinfo($FullPath);
$d = $dest.$p["basename"];
if(file_exists($d))
unlink($d);
copy($FullPath,$d);
@chmod($FullPath.$d, 0666);
}
}
}
function CopyFromPending()
{
global $pathtoroot,$pathchar;
$ThumbPath = $this->Get("ThumbPath");
$FullPath = $this->Get("LocalPath");
// $src = $this->GetImageDir()."pending/";
$src = $this->GetImageDir();
if(strlen($ThumbPath))
{
if(strpos($ThumbPath,"pending/"))
{
if(file_exists($pathtoroot.$ThumbPath))
{
$path = pathinfo($pathtoroot.$ThumbPath);
$p = explode("/",$ThumbPath);
unset($p[count($p)-2]);
$d = $pathtoroot.implode("/",$p);
if(file_exists($d))
unlink($d);
copy($pathtoroot.$ThumbPath,$d);
@chmod($pathtoroot.$ThumbPath.$d, 0666);
unlink($pathtoroot.$ThumbPath);
}
}
}
if(strlen($FullPath))
{
if(file_exists($pathtoroot.$FullPath))
{
if(strpos($FullPath,"pending/"))
{
$path = pathinfo($pathtoroot.$FullPath);
$p = explode("/",$FullPath);
unset($p[count($p)-2]);
$d = $pathtoroot.implode("/",$p);
if(file_exists($d))
unlink($d);
copy($pathtoroot.$FullPath,$d);
@chmod($pathtoroot.$FullPath.$d, 0666);
unlink($pathtoroot.$FullPath);
}
}
}
}
function DeleteFromPending()
{
global $pathtoroot;
$ThumbPath = $pathtoroot.$this->Get("ThumbPath");
$FullPath = $pathtoroot.$this->Get("LocalPath");
$src = $this->GetImageDir()."pending/";
$p = pathinfo($ThumbPath);
$d = $src.$p["basename"];
if(file_exists($d))
@unlink($d);
$p = pathinfo($FullPath);
$d = $src.$p["basename"];
if(file_exists($d))
@unlink($d);
}
function RenameFiles($OldResId,$NewResId)
{
global $pathtoroot;
if($this->Pending)
{
$ThumbPath = $this->GetImageDir().$this->GetFileName(TRUE);
}
else
$ThumbPath = $pathtoroot.$this->Get("ThumbPath");
$parts = pathinfo($ThumbPath);
$ext = $parts["extension"];
$pending="";
if($this->Pending)
{
$pending="pending/";
$FullPath = $this->GetImageDir().$this->GetFileName(FALSE);
}
else
$FullPath = $pathtoroot.$this->Get("LocalPath");
$NewThumb = $pathtoroot."kernel/images/".$pending."th_$NewResId_".$this->Get("ImageIndex").".$ext";
$NewFull = $pathtoroot."kernel/images/".$pending."$NewResId_".$this->Get("ImageIndex").".$ext";
if(file_exists($ThumbPath))
{
@rename($ThumbPath,$NewThumb);
}
if(file_exists($FullPath))
{
@rename($FullPath,$NewFull);
}
}
function ReplaceImageFile($file)
{
global $objConfig;
if($file["error"]==0)
{
$this->DeleteLocalImage();
move_uploaded_file($file,$this->Get("LocalPath"));
@chmod($this->Get("LocalPath"), 0666);
}
}
function FullURL($ForceNoThumb=FALSE,$Default="kernel/images/noimage.gif")
{
global $rootURL, $objConfig,$pathtoroot;
if($this->Get('SameImages') && !$ForceNoThumb)
if (!(($this->Get('LocalImage') && strlen($this->Get('LocalPath'))) ||
($this->Get('LocalImage') == 0 && strlen($this->Get('Url')))))
{
return $this->ThumbURL();
}
if(strlen($this->Get("Url")))
return $this->Get("Url");
if($this->Get("LocalImage")=="1")
{
$url = $this->Get("LocalPath");
//$url = $this->GetImageDir().$this->GetFileName();
if(file_exists($pathtoroot.$url))
{
if(strlen($url))
{
$url = $rootURL.$url;
return $url;
}
else
{
if(strlen($Default))
$url = $rootURL.$Default;
return $url;
}
}
else
{
if(strlen($Default))
{
return $rootURL.$Default;
}
else
return "";
}
}
else
{
if(strlen($Default))
{
return $rootURL.$Default;
}
else
return "";
}
}
function ThumbURL()
{
global $rootURL, $pathtoroot, $objConfig;
if(strlen($this->Get("ThumbUrl")))
{
return $this->Get("ThumbUrl");
}
if($this->Get("LocalThumb")=="1")
{
$url = $this->Get("ThumbPath");
//$url = $this->GetImageDir().$this->GetFileName();
if(file_exists($pathtoroot.$url))
{
if(strlen($url))
{
$url = $rootURL.$url;
}
else
$url = $rootURL."kernel/images/noimage.gif";
return $url;
}
else
return $rootURL."kernel/images/noimage.gif";
}
else
{
return $rootURL."kernel/images/noimage.gif";
}
}
function ParseObject($element)
{
$extra_attribs = ExtraAttributes($element->attributes);
if(strtolower($element->name)==$this->TagPrefix)
{
$field = strtolower($element->attributes["_field"]);
switch($field)
{
case "name":
$ret = $this->Get("Name");
break;
case "alt":
$ret = $this->Get("AltName");
break;
case "full_url":
$ret = $this->FullURL();
break;
case "thumb_url":
$ret = $this->ThumbURL();
break;
}
}
else
$ret = $element->Execute();
return $ret;
}
function parsetag($tag)
{
if(is_object($tag))
{
$tagname = $tag->name;
}
else
$tagname = $tag;
switch($tagname)
{
case "image_name":
$ret = $this->Get("Name");
break;
case "image_alt":
$ret = $this->Get("AltName");
break;
case "image_url":
$ret = $this->FullURL();
break;
case "thumb_url":
$ret = $this->ThumbURL();
break;
}
return $ret;
}
//Changes priority
function MoveUp()
{
$this->Increment("Priority");
}
function MoveDown()
{
$this->Decrement("Priority");
}
function GetMaxPriority()
{
$SourceId = $this->Get("ResourceId");
$sql = "SELECT MAX(Priority) as p from ".$this->tablename."WHERE ResourceId=$SourceId";
$result = $this->adodbConnection->Execute($sql);
return $result->fields["p"];
}
function GetMinPriority()
{
$SourceId = $this->Get("ResourceId");
$sql = "SELECT MIN(Priority) as p from ".$this->tablename."WHERE ResourceId=$SourceId";
$result = $this->adodbConnection->Execute($sql);
return $result->fields["p"];
}
function UpdatePriority()
{
$SourceId = $this->Get("ResourceId");
$sql = "SELECT MAX(Priority) as p from ".$this->tablename."WHERE ReourceId=$SourceId";
$result = $this->adodbConnection->Execute($sql);
$this->Set("Priority", $result->fields["p"]+1);
}
function MakeThumbnail () {
}
}
class clsImageList extends clsItemCollection
{
var $Page;
var $PerPageVar;
function clsImageList()
{
global $objConfig;
$this->clsItemCollection();
$this->PerPageVar = "Perpage_Images";
$this->PerPage = $objConfig->Get($this->PerPageVar);
$this->SourceTable = GetTablePrefix()."Images";
$this->classname = "clsImage";
}
function LoadImages($where="",$orderBy = "")
{
global $objConfig;
$this->Clear();
if($this->Page<1)
$this->Page=1;
if(is_numeric($objConfig->Get("Perpage_Images")))
{
$Start = ($this->Page-1)*$objConfig->Get("Perpage_Images");
$limit = "LIMIT ".$Start.",".$objConfig->Get("Perpage_Images");
}
else
$limit = NULL;
$this->QueryItemCount=TableCount("Images",$where,0);
//echo $this->QueryItemCount."<br>\n";
if(strlen(trim($orderBy))>0)
{
$orderBy = "Priority DESC, ".$orderBy;
}
else
$orderBy = "Priority DESC";
return $this->Query_Images($where,$orderBy,$limit);
}
function Query_Images($whereClause,$orderByClause=NULL,$limit=NULL)
{
global $objSession, $Errors;
$sql = "SELECT * FROM ".$this->SourceTable;
if(isset($whereClause))
$sql = sprintf('%s WHERE %s',$sql,$whereClause);
if(isset($orderByClause) && strlen(trim($orderByClause))>0)
$sql = sprintf('%s ORDER BY %s',$sql,$orderByClause);
if(isset($limit) && strlen(trim($limit)))
$sql .= " ".$limit;
//echo $sql;
return $this->Query_Item($sql);
}
function &Add($Name, $Alt, $ResourceId, $LocalImage, $LocalThumb,
$Url, $ThumbUrl, $Enabled=1, $Priority=0, $DefaultImg=0, $ImageIndex=0,
$SameImages=0, $ImageId=-999)
{
if($DefaultImg==1)
{
$sql = "UPDATE ".$this->SourceTable." SET DefaultImg=0 WHERE ResourceId=$ResourceId";
$this->adodbConnection->Execute($sql);
}
$img = new clsImage();
$img->tablename = $this->SourceTable;
$img->Set(array("Name","AltName","ResourceId","LocalImage","LocalThumb",
"Url","ThumbUrl","Enabled","Priority","DefaultImg","ImageIndex","SameImages"),
array($Name,$Alt,$ResourceId,$LocalImage,$LocalThumb,
$Url,$ThumbUrl,$Enabled,$Priority,$DefaultImg,$ImageIndex,$SameImages));
if ($ImageId != -999)
{
$img->Set("ImageId", $ImageId);
}
if((int)$ImageIndex==0)
$img->Set("ImageIndex",$this->GetNextImageIndex($ResourceId));
$img->Create();
array_push($this->Items,$img);
return $img;
}
function Edit($ImageId,$Name, $Alt, $ResourceId, $LocalImage, $LocalThumb,
$Url, $ThumbUrl, $Enabled=1, $Priority=0, $DefaultImg=0, $ImageIndex=0,
$SameImages=0)
{
$img = $this->GetItem($ImageId);
if((int)$ImageIndex==0)
$ImageIndex = $img->Get("ImageIndex");
if(!strlen($ThumbUrl) && !$LocalThumb)
$ThumbUrl = $img->Get("ThumbUrl");
$img->Set(array("Name","AltName","ResourceId","LocalImage","LocalThumb",
"Url","ThumbUrl","Enabled","Priority","DefaultImg","ImageIndex","SameImages"),
array($Name, $Alt, $ResourceId, $LocalImage, $LocalThumb,
$Url, $ThumbUrl, $Enabled, $Priority, $DefaultImg, $ImageIndex,$SameImages));
if((int)$ImageIndex==0)
$img->Set("ImageIndex",$this->GetNextImageIndex($ResourceId));
$img->Update();
if($DefaultImg==1)
{
$sql = "UPDATE ".$this->SourceTable." SET DefaultImg=0 WHERE ResourceId=".$ResourceId." AND ImageId !=$ImageId";
$this->adodbConnection->Execute($sql);
}
array_push($this->Items,$img);
return $img;
}
function Delete_Image($ImageId)
{
$i = $this->GetItem($ImageId);
$i->Delete();
}
function DeleteResource($ResourceId)
{
$this->Clear();
$images = $this->Query_Images("ResourceId=".$ResourceId);
if(is_array($images))
{
foreach($images as $i)
{
$i->Delete();
}
}
}
function LoadResource($ResourceId)
{
$sql = "SELECT * FROM ".$this->SourceTable." WHERE ResourceId=$ResourceId";
$this->Query_Item($sql);
}
function CopyResource($SourceId, $DestId, $main_prefix)
{
global $pathtoroot;
$this->Clear();
$this->LoadResource($SourceId);
foreach($this->Items as $i)
{
if($i->Get("LocalThumb"))
{
$f = $pathtoroot.$i->Get("ThumbPath");
if(file_exists($f))
{
$p = pathinfo($f);
$dir = $p["dirname"];
$ext = $p["extension"];
$newfile = $dir."/th_".$DestId."_".$i->Get("ImageIndex").".".$ext;
if(file_exists($newfile))
@unlink($newfile);
// echo $f." -> ".$newfile;
copy($f,$newfile);
}
}
if($i->Get("LocalImage"))
{
$f = $pathtoroot.$i->Get("LocalPath");
if(file_exists($f))
{
$p = pathinfo($f);
$dir = $p["dirname"];
$ext = $p["extension"];
$newfile = $dir."/".$DestId."_".$i->Get("ImageIndex").".".$ext;
if(file_exists($newfile))
@unlink($newfile);
// echo $f." -> ".$newfile;
copy($f,$newfile);
}
}
}
parent::CopyResource($SourceId, $DestId, $main_prefix);
$this->Clear();
$this->LoadResource($DestId);
foreach($this->Items as $img)
{
if($img->Get("LocalThumb"))
{
$f = str_replace("th_$SourceId","th_$DestId",$img->Get("ThumbPath"));
$img->Set("ThumbPath",$f);
}
if($img->Get("LocalImage"))
{
$f = str_replace("/".$SourceId."_","/".$DestId."_",$img->Get("LocalPath"));
$img->Set("LocalPath",$f);
}
$img->Update();
}
}
function GetImageByResource($ResourceId,$Index)
{
$found=FALSE;
if($this->NumItems()>0)
{
foreach($this->Items as $i)
{
if($i->Get("ResourceID")==$ResourceId and ($i->Get("ImageIndex")==$Index))
{
$found=TRUE;
break;
}
}
}
if(!$found)
{
$i = NULL;
$i = new clsImage();
if($i->LoadFromResource($ResourceId,$Index))
{
array_push($this->Items, $i);
}
else
unset($i);
}
if(is_object($i))
{
return $i;
}
else
return FALSE;
}
function &GetDefaultImage($ResourceId)
{
$sql = "SELECT * FROM ".$this->SourceTable." WHERE ResourceId=$ResourceId AND DefaultImg=1";
$rs = $this->adodbConnection->Execute($sql);
if($rs && ! $rs->EOF)
{
$data = $rs->fields;
$img= new clsImage();
$img->SetFromArray($data);
$img->Clean();
return $img;
}
else
return FALSE;
}
function &GetAvatarImage($ResourceId)
{
- $sql = 'SELECT * FROM '.$this->SourceTable.
- ' WHERE ResourceId='.$ResourceId.' AND Name="avatar" AND Enabled=1
+ $sql = 'SELECT *
+ FROM '.$this->SourceTable.'
+ WHERE ResourceId = '.(int)$ResourceId.' AND Name = "avatar" AND Enabled = 1
LIMIT 1';
$rs = $this->adodbConnection->Execute($sql);
if($rs && ! $rs->EOF)
{
$data = $rs->fields;
$img= new clsImage();
$img->SetFromArray($data);
$img->Clean();
return $img;
}
- else
- return FALSE;
+ else {
+ return false;
+ }
}
function HandleImageUpload($FILE,$ResourceId,$RelatedTo,$DestDir, $Name="",$AltName="",$IsThumb=0)
{
global $objConfig;
$img = $this->GetImageByResource($ResourceId,$RelatedTo);
if(is_object($img) && $RelatedTo>0)
{
$img->Set("LocalImage",1);
$img->Set("Name",$Name);
$img->Set("AltName",$AltName);
$img->Set("IsThumbnail",$IsThumb);
$dest = $img->StoreUploadedImage($FILE,1,$DestDir);
if(strlen($dest))
{
$img->Set("Url", $objConfig->Get("Site_Path").$dest);
$img->Update();
}
}
else
{
$img=$this->NewLocalImage($ResourceId,$RelatedTo,$Name,$AltName,$IsThumb,$FILE,$DestDir);
}
return $img;
}
function GetResourceImages($ResourceId)
{
$sql = "SELECT * FROM ".$this->SourceTable." WHERE ResourceId=".$ResourceId;
$rs = $this->adodbConnection->Execute($sql);
while($rs && !$rs->EOF)
{
$img = new clsImage();
$img->LoadFromResource($ResourceId,$rs->fields["RelatedTo"]);
array_push($this->Images,$img);
$rs->MoveNext();
}
}
function GetResourceThumbnail($ResourceId)
{
$found=FALSE;
foreach($this->Images as $img)
{
if($img->Get("ResourceId")==$ResourceId && $img->Get("IsThumbnail")==1)
{
$found=TRUE;
break;
}
}
if($found)
{
return $img;
}
else
return FALSE;
}
function &GetImageByName($ResourceId, $name, $enabled=0)
{
$found = FALSE;
foreach($this->Items as $img)
{
$search_condition = ($img->Get("ResourceId")==$ResourceId && $img->Get("Name")==$name);
if ($enabled)
{
$search_condition = $search_condition && $img->Get("Enabled");
}
if($search_condition)
{
$found=TRUE;
break;
}
}
if($found)
{
return $img;
}
else
{
$sql = "SELECT * FROM ".$this->SourceTable." WHERE ResourceId=$ResourceId AND Name LIKE '$name'";
if ($enabled)
{
$sql = $sql.' AND Enabled=1';
}
//echo $sql;
$rs = $this->adodbConnection->Execute($sql);
if($rs && !$rs->EOF)
{
$img = $this->AddItemFromArray($rs->fields);
return $img;
}
else
return FALSE;
}
}
function CopyToPendingFiles()
{
$sql = "SELECT * FROM ".$this->SourceTable;
$this->Clear();
$this->Query_Item($sql);
foreach($this->Items as $i)
{
if(strlen($i->Get("LocalImage")) || strlen($i->Get("LocalThumb")))
{
$i->CopyToPending();
}
}
}
function CopyFromPendingFiles($edit_table)
{
$sql = "SELECT * FROM ".$edit_table;
$this->Clear();
$this->Query_Item($sql);
foreach($this->Items as $i)
{
## Delete original Images
$OrgImage = new clsImage($i->Get("ImageId"));
$OrgImage->DeleteLocalImage();
if($i->Get("LocalImage") || $i->Get("LocalThumb"))
{
$i->CopyFromPending();
$t = $i->Get("LocalPath");
$p = pathinfo($t);
$p_arr = explode("/", $p['dirname']);
if (eregi("pending", $p_arr[count($p_arr)-1]))
{
unset($p_arr[count($p_arr)-1]);
$p['dirname'] = implode("/", $p_arr);
$LocalPath = $p['dirname']."/".$p['basename'];
$i->Set("LocalPath", $LocalPath);
}
$t = $i->Get("ThumbPath");
$p = pathinfo($t);
$p_arr = explode("/", $p['dirname']);
if (eregi("pending", $p_arr[count($p_arr)-1]))
{
unset($p_arr[count($p_arr)-1]);
$p['dirname'] = implode("/", $p_arr);
$ThumbPath = $p['dirname']."/".$p['basename'];
$i->Set("ThumbPath", $ThumbPath);
}
$i->tablename = $edit_table;
$update = 1;
}
## Empty the fields if are not used
if (!$i->Get("LocalImage"))
{
$i->Set("LocalPath", "");
$update = 1;
}
if (!$i->Get("LocalThumb"))
{
$i->Set("ThumbPath", "");
$update = 1;
}
if ($update)
$i->Update();
}
}
function DeletePendingFiles($edit_table)
{
$sql = "SELECT * FROM ".$edit_table;
$this->Clear();
$this->Query_Item($sql);
foreach($this->Items as $i)
{
$i->DeleteFromPending();
}
}
function CopyToEditTable($idfield, $idlist)
{
global $objSession;
$edit_table = $objSession->GetEditTable($this->SourceTable);
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
if(is_array($idlist))
{
$list = implode(",",$idlist);
}
else
$list = $idlist;
$query = "SELECT * FROM ".$this->SourceTable." WHERE $idfield IN ($list)";
$insert = "CREATE TABLE ".$edit_table." ".$query;
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($insert,ENT_NOQUOTES)."<br>\n";
$this->adodbConnection->Execute($insert);
$this->SourceTable = $edit_table;
$this->CopyToPendingFiles();
$this->UpdateFilenamesToPendings();
}
function UpdateFilenamesToPendings()
{
global $objSession;
$edit_table = $this->SourceTable;
$sql = "SELECT * FROM ".$edit_table." WHERE (LocalPath!='' AND LocalPath IS NOT NULL) OR (ThumbPath!='' AND ThumbPath IS NOT NULL)";
$this->Clear();
$this->Query_Item($sql);
foreach($this->Items as $i)
{
$set = "";
$ImageId = $i->Get("ImageId");
## Update Local Image Path -> add "pending/" to PATH
if (strlen($i->Get("LocalPath")))
{
$p = pathinfo($i->Get("LocalPath"));
if (!eregi("/pending $", $p['dirname']))
{
$LocalPath = $p['dirname']."/pending/".$p['basename'];
$set = "SET LocalPath='$LocalPath'";
}
}
// echo "LocalImage: ".$i->Get("LocalImage").", PATH: ".$i->Get("LocalPath")."<BR>";
## Update Local Thumb Path -> add "pending/" to PATH
if (strlen($i->Get("ThumbPath")))
{
$p = pathinfo($i->Get("ThumbPath"));
if (!eregi("/pending $", $p['dirname']))
{
$LocalThumb = $p['dirname']."/pending/".$p['basename'];
if (strlen($set))
$set.= ", ThumbPath='$LocalThumb'";
else
$set = "SET ThumbPath='$LocalThumb'";
}
}
// echo "LocalThumb: ".$i->Get("LocalThumb").", PATH: ".$i->Get("ThumbPath")."<BR>";
if (strlen($set))
{
$sql = "UPDATE $edit_table $set WHERE ImageId=$ImageId";
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
$this->adodbConnection->Execute($sql);
}
}
}
function CopyFromEditTable($idfield)
{
global $objSession;
$GLOBALS['_CopyFromEditTable']=1;
$edit_table = $objSession->GetEditTable($this->SourceTable);
$dummy =& $this->GetDummy();
if( !$dummy->TableExists($edit_table) )
{
echo 'ERROR: Table "<b>'.$edit_table.'</b>" missing (class: <b>'.get_class($this).'</b>)<br>';
//exit;
return;
}
$rs = $this->adodbConnection->Execute("SELECT * FROM $edit_table WHERE ResourceId=0");
while($rs && !$rs->EOF)
{
$id = $rs->fields["ImageId"];
if($id>0)
{
$img = $this->GetItem($id);
$img->Delete();
}
$rs->MoveNext();
}
$this->adodbConnection->Execute("DELETE FROM $edit_table WHERE ResourceId=0");
$this->CopyFromPendingFiles($edit_table);
parent::CopyFromEditTable($idfield);
unset($GLOBALS['_CopyFromEditTable']);
}
function PurgeEditTable($idfield)
{
global $objSession;
$edit_table = $objSession->GetEditTable($this->SourceTable);
$this->DeletePendingFiles($edit_table);
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
}
function GetNextImageIndex($ResourceId)
{
$sql = "SELECT MAX(ImageIndex) as MaxVal FROM ".$this->SourceTable." WHERE ResourceId=".$ResourceId;
$rs = $this->adodbConnection->Execute($sql);
if($rs)
{
$val = (int)$rs->fields["MaxVal"];
$val++;
}
return $val;
}
function GetMaxPriority($ResourceId)
{
$sql = "SELECT MAX(Priority) as p from ".$this->SourceTable."WHERE ResourceId=$ResourceId";
$result = $this->adodbConnection->Execute($sql);
return $result->fields["p"];
}
function GetMinPriority($ResourceId)
{
$sql = "SELECT MIN(Priority) as p from ".$this->SourceTable."WHERE ResourceId=$ResourceId";
$result = $this->adodbConnection->Execute($sql);
return $result->fields["p"];
}
} /*clsImageList*/
?>
Property changes on: trunk/kernel/include/image.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.20
\ No newline at end of property
+1.21
\ No newline at end of property
Index: trunk/kernel/admin/advanced_view.php
===================================================================
--- trunk/kernel/admin/advanced_view.php (revision 6427)
+++ trunk/kernel/admin/advanced_view.php (nonexistent)
@@ -1,57 +0,0 @@
-<?php
-##############################################################
-##In-portal ##
-##############################################################
-## In-portal ##
-## Intechnic Corporation ##
-## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
-## otherwise redistributed without proper written ##
-## consent of Intechnic Corporation. Violation will ##
-## result in revocation of the license and support ##
-## privileges along maximum prosecution allowed by law. ##
-##############################################################
-
-global $rootURL, $imagesURL, $adminURL,$admin,$pathtoroot;
-
-$localURL = $rootURL."kernel/";
-$pathtolocal = $pathtoroot."kernel/";
-
-require_once ($pathtolocal."admin/include/navmenu.php");
-
-//Set Section
-$section = 'in-portal:advanced_view';
-
-//Set Environment Variable
-$envar = "env=" . BuildEnv($mod_prefixes);
-
-?>
-<!-- CATS -->
-
-<div id="category" class="ini_tab" isTab="true" tabTitle="Categories" PrefixSpecial="c" ActionPrefix="m_cat_" EditURL="admin/category/addcategory">
-
-
-<table cellSpacing=0 cellPadding=2 width="100%" class="tabTable">
- <tr>
- <td align="left" width="70%">
- <img height=15 src="<?php echo $imagesURL; ?>/arrow.gif" width=15 align=absMiddle border=0>
- <b class=text><?php echo prompt_language("la_Page"); ?></b> <?php print $objCatList->GetAdminPageLinkList($_SERVER["PHP_SELF"]); ?>
- </td>
- <td align="right" width="30%">
- <?php ShowSearchForm('m', $envar, 'category'); ?>
-
- </td>
- </tr>
-</table><br>
-
-<form name=category_form action="" method=post>
- <input type="hidden" name="Action">
- <table cellSpacing=0 cellPadding=2 width="100%" border=0>
- <tbody>
- <?php print adListSubCats(0, 'cat_tab_element.tpl','m_adv_view_search'); ?>
- </tbody>
- </table>
-</form>
-</div>
-<!-- END CATS -->
\ No newline at end of file
Property changes on: trunk/kernel/admin/advanced_view.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.4
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/kernel/admin/include/toolbar/editgroup_permissions.php
===================================================================
--- trunk/kernel/admin/include/toolbar/editgroup_permissions.php (revision 6427)
+++ trunk/kernel/admin/include/toolbar/editgroup_permissions.php (nonexistent)
@@ -1,41 +0,0 @@
-<?php
- global $imagesURL;
-
-print<<<END
-<script language="javascript1.2">
-<!--
-
-AccessChecks = new Array();
-
-function SetPermImage(el)
-{
- img = el.getAttribute('permimg');
- if(el.checked==true)
- {
- img_url = '$imagesURL'+'/perm_green.gif';
- }
- else
- img_url = '$imagesURL'+'/perm_red.gif';
- //alert(img+' = '+img_url);
- swap(img,img_url);
-}
-
-function SetAccessEnabled(el)
-{
- if(el)
- {
- access_check = document.getElementById(el.getAttribute('access'));
- if(access_check)
- {
- access_check.checked = false
- SetPermImage(access_check);
- access_check.disabled = el.checked;
- }
- }
-}
-
-//-->
-</script>
-
-END;
-?>
Property changes on: trunk/kernel/admin/include/toolbar/editgroup_permissions.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/kernel/admin/include/toolbar/editcategory_permissions.php
===================================================================
--- trunk/kernel/admin/include/toolbar/editcategory_permissions.php (revision 6427)
+++ trunk/kernel/admin/include/toolbar/editcategory_permissions.php (nonexistent)
@@ -1,44 +0,0 @@
-<?php
-global $imagesURL;
-
-print<<<END
-
-<script language="javascript1.2">
-<!--
-
-AccessChecks = new Array();
-
-function SetPermImage(el)
-{
- img = el.getAttribute('permimg');
- if(el.checked==true)
- {
- img_url = '$imagesURL'+'/perm_green.gif';
- }
- else
- img_url = '$imagesURL'+'/perm_red.gif';
- //alert(img+' = '+img_url);
- swap(img,img_url);
-}
-
-function SetAccessEnabled(el)
-{
- access_check = document.getElementById(el.getAttribute('access'));
- if(el.checked == true)
- {
- access_check.checked = access_check.getAttribute('InheritValue');
- }
- else
- {
- access_check.checked = access_check.getAttribute('UnInheritValue');
- }
- SetPermImage(access_check);
- access_check.disabled = el.checked;
-}
-
-
-//-->
-</script>
-
-END;
-?>
Property changes on: trunk/kernel/admin/include/toolbar/editcategory_permissions.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/kernel/admin/include/toolbar/editcategory_relations.php
===================================================================
--- trunk/kernel/admin/include/toolbar/editcategory_relations.php (revision 6427)
+++ trunk/kernel/admin/include/toolbar/editcategory_relations.php (nonexistent)
@@ -1,32 +0,0 @@
-<?php
-print<<<END
-
-<script language="javascript1.2">
-<!--
-
-//function called when a listview item is double clicked
-function handleDoubleClick()
-{
- PermChecks.check_submit('addrelation', '');
-}
-
-//function called to create the right click popup menu
-function initContextMenu()
-{
- window.contextMenu = new Menu("Context");
- contextMenu.addMenuItem(lang_Edit,"PermChecks.check_submit('addrelation', '');","");
- contextMenu.addMenuItem(lang_Delete,"PermChecks.check_submit('addcategory_relations', 'm_rel_delete');","");
- contextMenu.addMenuSeparator();
- contextMenu.addMenuItem(lang_MoveUp,"PermChecks.check_submit('addcategory_relations', 'm_rel_move_up');","");
- contextMenu.addMenuItem(lang_MoveDn,"PermChecks.check_submit('addcategory_relations', 'm_rel_move_down');","");
-
- window.triedToWriteMenus = false;
- window.contextMenu.writeMenus();
- return true;
-}
-
-//-->
-</script>
-
-END;
-?>
Property changes on: trunk/kernel/admin/include/toolbar/editcategory_relations.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/kernel/admin/include/toolbar/editcategory_relationselect.php
===================================================================
--- trunk/kernel/admin/include/toolbar/editcategory_relationselect.php (revision 6427)
+++ trunk/kernel/admin/include/toolbar/editcategory_relationselect.php (nonexistent)
@@ -1,799 +0,0 @@
-<?php
-global $objConfig,$objSections,$section, $rootURL,$adminURL,$imagesURL,$envar,
- $m_var_list_update,$objCatList, $homeURL, $upURL, $objSession,$CatScopeClause,$DefaultTab;
-
-global $CategoryFilter,$TotalItemCount;
-
-global $Bit_All,$Bit_Pending,$Bit_Disabled,$Bit_New,$Bit_Pop,$Bit_Hot,$Bit_Ed;
-
-global $hideSelectAll;
-
-
-/* bit place holders for category view menu */
-$Bit_Active=64;
-$Bit_Pending=32;
-$Bit_Disabled=16;
-$Bit_New=8;
-$Bit_Pop=4;
-$Bit_Hot=2;
-$Bit_Ed=1;
-
-if(strlen($_GET["SetTab"]))
-{
- if($_GET["SetTab"] != "categories")
- {
- $m_tab_CatTab_Hide = 1;
- $DefaultTab = $_GET["SetTab"];
- }
- else
- {
- $DefaultTab="categories";
- $m_tab_CatTab_Hide = 0;
- }
-}
-else
- $m_tab_CatTab_Hide = (int)$objConfig->Get("CatTab_Hide");
-
-$CategoryView = $objConfig->Get("Category_View");
-if(!is_numeric($CategoryView))
-{
- $CategoryView = 127;
-}
-
-$Category_Sortfield = $objConfig->Get("Category_Sortfield");
-if(!strlen($Category_Sortfield))
- $Category_Sortfield = "Name";
-
-$Category_Sortorder = $objConfig->Get("Category_Sortorder");
-if(!strlen($Category_Sortorder))
- $Category_Sortorder = "desc";
-
-$Perpage_Category = (int)$objConfig->Get("Perpage_Category");
-if(!$Perpage_Category)
- $Perpage_Category="'all'";
-
-
-if($CategoryView == 127)
-{
- $Category_ShowAll = 1;
-}
-else
-{
- $Category_ShowAll=0;
- $Status = array();
- $Mod = array();
- if($CategoryView & $Bit_Pending)
- $Status[] = STATUS_PENDING;
-
- if($CategoryView & $Bit_Active)
- $Status[] = STATUS_ACTIVE;
-
-
- if($CategoryView & $Bit_Disabled)
- $Status[] = STATUS_DISABLED;
-
- if(count($Status))
- {
- $CategoryFilter .= " AND (Status IN (".implode(",",$Status).") ";
- }
- else
- $CategoryFilter .= " AND ((Status=-1) ";
-
- if($CategoryView & $Bit_Ed)
- {
- $CategoryFilter .= " OR (EditorsPick=1) ";
- }
-
- if($CategoryView & $Bit_New)
- {
- $cutoff = adodb_date("U") - ($objConfig->Get("Category_DaysNew") * 86400);
- $CategoryFilter .= " OR (CreatedOn > ".$cutoff.") ";
- }
- $CategoryFilter .= ")";
-}
-
-$list = $objSession->GetVariable("SearchWord");
-if(strlen($list))
-{
- $CatScope = $objSession->GetVariable("SearchScope");
- switch($CatScope)
- {
- case 0 :
- $CatScopeClause = "";
- break;
- case 1:
- $cat = $objCatList->CurrentCategoryID();
- if($cat>0)
- {
- $allcats = $objCatList->AllSubCats($cat);
- if(count($allcats)>0)
- {
- $catlist = implode(",",$allcats);
- $CatScopeClause = " CategoryId IN ($catlist) ";
- }
- }
- break;
- case 2:
- $CatScopeClause = "CategoryId=".$objCatList->CurrentCategoryID();
- break;
- }
-}
-else
- $CatScopeClause="";
-
-$mnuClearSearch = language("la_SearchMenu_Clear");
-$mnuNewSearch = language("la_SearchMenu_New");
-$mnuSearchCategory = language("la_SearchMenu_Categories");
-
-$lang_New = language("la_Text_New");
-$lang_Hot = language("la_Text_Hot");
-$lang_EdPick = language("la_prompt_EditorsPick");
-$lang_Pop = language("la_Text_Pop");
-
-$lang_Rating = language("la_prompt_Rating");
-$lang_Hits = language("la_prompt_Hits");
-$lang_Votes = language("la_prompt_Votes");
-$lang_Name = language("la_prompt_Name");
-
-$lang_Categories = language("la_ItemTab_Categories");
-$lang_Description = language("la_prompt_Description");
-$lang_MetaKeywords = language("la_prompt_MetaKeywords");
-$lang_SubSearch = language("la_prompt_SubSearch");
-$lang_Within = language("la_Text_Within");
-$lang_Current = language("la_Text_Current");
-$lang_Active = language("la_Text_Active");
-$lang_SubCats = language("la_Text_SubCats");
-$lang_SubItems = language("la_Text_Subitems");
-
-$selector = isset($_GET['Selector']) ? '&Selector='.$_GET['Selector'] : '';
-$destform = GetVar('destform');
-print <<<END
-
-<script language="JavaScript">
-var Category_Sortfield = '$Category_Sortfield';
-var Category_Sortorder = '$Category_Sortorder';
-var Category_Perpage = $Perpage_Category;
-var Category_ShowAll = $Category_ShowAll;
-var CategoryView = $CategoryView;
-var default_tab = "$DefaultTab";
-
-//JS Language variables
-var lang_New = "$lang_New";
-var lang_Hot = "$lang_Hot";
-var lang_EdPick = "$lang_EdPick";
-
-var lang_Pop = "$lang_Pop";
-var lang_Rating = "$lang_Rating";
-var lang_Hits = "$lang_Hits";
-var lang_Votes = "$lang_Votes";
-var lang_Name = "$lang_Name";
-var lang_Categories = "$lang_Categories";
-var lang_Description = "$lang_Description";
-var lang_MetaKeywords = "$lang_MetaKeywords";
-var lang_SubSearch = "$lang_SubSearch";
-var lang_Within="$lang_Within";
-var lang_Current = "$lang_Current";
-var lang_Active = "$lang_Active";
-var lang_SubCats = "$lang_SubCats";
-var lang_SubItems = "$lang_SubItems";
-
-var m_tab_CatTab_hide = $m_tab_CatTab_Hide;
-var hostname = '$rootURL';
-var env = '$envar';
-var actionlist = new Array();
-var homeURL = "$homeURL$selector&destform=$destform";
-var upURL = "$upURL$selector&destform=$destform";
-var Categories_Paste = false;
-
- // K4 code for handling toolbar operations: begin
- var \$TabRegistry = Array();
-
- function InpGrid(tab)
- {
- this.TabId = tab;
- }
-
- InpGrid.prototype.ClearSelection = function(force,called_from)
- {
- unselectAll(this.TabId, 1); //1 means don't upate toolbar
- }
-
- function registerTab(\$tab_id)
- {
- var \$tab = document.getElementById(\$tab_id);
- var \$index = \$TabRegistry.length;
-
- \$TabRegistry[\$index] = new Array();
- \$TabRegistry[\$index]['tab_id'] = \$tab_id;
- \$TabRegistry[\$index]['prefix_special'] = \$tab.getAttribute('PrefixSpecial');
- \$TabRegistry[\$index]['edit_template'] = \$tab.getAttribute('EditURL');
- }
-
- function queryTabRegistry(\$search_key, \$search_value, \$return_key)
- {
- var \$i = 0;
- while(\$i < \$TabRegistry.length)
- {
- if(\$TabRegistry[\$i][\$search_key] == \$search_value)
- {
- return \$TabRegistry[\$i][\$return_key];
- break;
- }
- \$i++;
- }
- return '<'+\$search_key+'='+\$search_value+'>';
- }
-
- function k4_actionHandler(action, prefix_special)
- {
- var k4_action = '';
- switch (action)
- {
- case 'edit':
- k4_action = 'edit_item("'+prefix_special+'")';
- break;
- case 'delete':
- k4_action = 'delete_items("'+prefix_special+'")';
- break;
- case 'unselect':
- k4_action = 'unselect("'+prefix_special+'")';
- break;
- case 'approve':
- k4_action = 'approve_items("'+prefix_special+'")';
- break;
- case 'decline':
- k4_action = 'decine_items("'+prefix_special+'")';
- break;
-
- case 'copy':
- k4_action = 'copy_items("'+prefix_special+'")';
- break;
- case 'cut':
- k4_action = 'cut_items("'+prefix_special+'")';
- break;
- case 'move_up':
- k4_action = 'move_up("'+prefix_special+'")';
- break;
- case 'move_down':
- k4_action = 'move_down("'+prefix_special+'")';
- break;
- }
-
- if (k4_action != '')
- {
- \$form_name = queryTabRegistry('prefix_special', prefix_special, 'tab_id') + '_form';
- eval(k4_action);
- }
- else alert(action+' not implemented');
-
- }
-
- function approve_items(prefix_special)
- {
- set_hidden_field('remove_specials['+prefix_special+']',1);
- submit_event(prefix_special,'OnMassApprove','')
- }
-
- function decine_items(prefix_special)
- {
- set_hidden_field('remove_specials['+prefix_special+']',1);
- submit_event(prefix_special,'OnMassDecline','')
- }
-
- function edit()
- {
- edit_item( queryTabRegistry('tab_id', activeTab.id, 'prefix_special') );
- }
-
- function edit_item(prefix_special)
- {
- opener_action('d');
- set_hidden_field(prefix_special+'_mode', 't');
- submit_event(prefix_special, 'OnEdit', queryTabRegistry('prefix_special', prefix_special, 'edit_template'), '../../admin/index.php');
- }
-
- function delete_items(prefix_special)
- {
- set_hidden_field('remove_specials['+prefix_special+']',1);
- submit_event(prefix_special,'OnMassDelete','')
- }
-
- function copy_items(prefix_special)
- {
- submit_event(prefix_special,'OnCopy','')
- }
-
- function cut_items(prefix_special)
- {
- submit_event(prefix_special,'OnCut','')
- }
-
- function move_up(prefix_special)
- {
- submit_event(prefix_special,'OnMassMoveUp','')
- }
-
- function move_down(prefix_special)
- {
- submit_event(prefix_special,'OnMassMoveDown','')
- }
-
- function unselect(prefix_special)
- {
- Grids[prefix_special].ClearSelection(null,'Inp_AdvancedView.Unselect');
- }
- // K4 code for handling toolbar operations: end
-
- function InitPage()
- {
- var main_form='kernel_form';
- if('$destform') main_form='$destform';
- addCommonActions(main_form);
- initToolbar('mainToolBar', actionHandler);
- initCheckBoxes();
- //toggleMenu();
- }
-
- function AddButtonAction(actionname,actionval)
- {
- var item = new Array(actionname,actionval);
- actionlist[actionlist.length] = item;
- }
-
- function actionHandler(button)
- {
- //alert('a button has been pressed!');
- for(i=0; i<actionlist.length;i++)
- {
-
- a = actionlist[i];
- if(button.action==a[0])
- {
- //alert('Button action '+a[0]+' is '+a[1]);
- eval(a[1]);
- break;
- }
- }
- }
-
- function addCommonActions(main_form)
- {
- AddButtonAction('upcat',"get_to_server(upURL,'');");// UP
- AddButtonAction('homecat',"get_to_server(homeURL,'');"); //home
- AddButtonAction('select',"check_submit('"+main_form+"');"); //edit
- AddButtonAction('stop',"window.close();"); //delete
- AddButtonAction('view',"toggleMenu(); window.FW_showMenu(window.cat_menu,getRealLeft(button) - ((document.all) ? 6 : -2),getRealTop(button)+32);");
- //AddButtonAction('search_a',"setSearchMenu(); window.FW_showMenu(window.SearchMenu,getRealLeft(button)-134 - ((document.all) ? 8 : -1),getRealTop(button)+22);");
- AddButtonAction('search_b',"search_submit();");
- AddButtonAction('search_c',"ClearSearch();");
- }
-
- function AdminCatNav(url)
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- f.action = url;
- new_search_submit();
- }
- }
-
- function search_submit()
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- //alert('Setting SearchWord to ' + f.value);
- f.Action.value = "m_SearchWord";
- f.submit();
- }
- }
- function new_search_submit()
- {
- var newSearchInput = document.getElementById("NewSearch");
- if (newSearchInput) newSearchInput.value = 1;
- search_submit();
- }
-
- function ClearSearch()
- {
- //alert('Clearing Search');
- f = document.getElementById("admin_search");
- if(f)
- {
- f.Action.value = "m_ClearSearch";
- f.submit();
- }
- }
-
- function SetSearchType(value)
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- f.SearchType.value = value;
- }
- }
-
- function SetSearchScope(value)
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- f.SearchScope.value = value;
- }
- }
-
- function ToggleNewSearch()
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- value = f.NewSearch.value;
- if(value==1)
- {
- f.NewSearch.value=0;
- }
- else
- f.NewSearch.value=1;
- }
- }
- function isNewSearch()
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- return f.NewSearch.value;
- }
- else return 0;
- }
-
-
- function get_to_server(path,attr)
- {
- if(attr.length>0)
- path = path + '?'+attr;
-
- //alert(path);
- window.location.href=path;
- return true;
- }
-
- function check_submit(main_form)
- {
- var formname = '';
-
- if ((activeTab) && (!isAnyChecked('categories')))
- {
- form_name = activeTab.id;
- }
- else
- {
- form_name = 'categories';
- }
- var f = document.getElementsByName(form_name+'_form')[0];
- var bf = window.opener.document.getElementById(main_form);
-
- if(bf)
- {
- if(typeof(LastCheckedItem.value) != 'undefined')
- {
- try{
- item_id = LastCheckedItem.value;
- item_type = LastCheckedItem.ItemType;
- }
- catch(err)
- {
- }
- bf.TargetId.value = item_id;
- bf.TargetType.value = item_type;
- bf.submit();
- window.close();
- }
- else {
- theMainScript.Alert(lang_Selection_Empty);
- }
- }
- } // check submit
-
- function flip_current(field_suffix)
- {
- if(activeTab)
- {
- field = activeTab.getAttribute("tabTitle")+field_suffix;
- return flip(eval(field));
- }
- }
-
- function config_current(field_suffix,value)
- {
- if(activeTab)
- {
- field = activeTab.getAttribute("tabTitle")+field_suffix;
- config_val(field,value);
- }
- }
-
- function getSType(type,value)
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- if (f.SearchType.value == type) return 2; else return 0;
- } else return 0;
-
- }
-
- function getSScope(scope)
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- if (f.SearchScope.value == scope) return 2; else return 0;
- } else return 0;
-
- }
-
-// function setSearchMenu()
-// {
-//
-// window.SearchMenu = new Menu("search");
-// SearchMenu.addMenuItem(lang_All,"SetSearchType('all');",getSType('all'));
-// SearchMenu.addMenuSeparator()
-//
-// SearchMenu.addMenuItem(lang_Categories, "SetSearchType('categories');",getSType('categories'));
-// param = "";
-//
-// for (var i = 0; i < tabIDs.length; i++)
-// {
-// d = document.getElementById(tabIDs[i]);
-// if(d)
-// {
-// tabname = d.getAttribute("tabTitle");
-// param = "SetSearchType('"+tabname+"');";
-//
-// SearchMenu.addMenuItem(tabname,param,getSType(tabname));
-// }
-// }
-//
-// SearchMenu.addMenuSeparator();
-// SearchMenu.addMenuItem(lang_All+' '+lang_Categories,"SetSearchScope('0');",getSScope(0));
-// SearchMenu.addMenuItem(lang_SubSearch,"ToggleNewSearch();",isNewSearch());
-// SearchMenu.addMenuItem(lang_Current+' '+lang_Categories,"SetSearchScope('2');",getSScope(2));
-// SearchMenu.addMenuItem(lang_Within+' '+lang_Categories,"SetSearchScope('1');",getSScope(1));
-//
-// SearchMenu.addMenuSeparator();
-//
-// window.SearchMenu.addMenuItem('$mnuClearSearch',"ClearSearch();","");
-// window.triedToWriteMenus = false;
-// window.SearchMenu.writeMenus();
-// }
-
- function Category_SortMenu(caption)
- {
- menu_sorting = new Menu(caption);
-
- menu_sorting.addMenuItem(lang_Asc,"config_val('Category_Sortorder','asc');",RadioIsSelected(Category_Sortorder,'asc'));
- menu_sorting.addMenuItem(lang_Desc,"config_val('Category_Sortorder','desc');",RadioIsSelected(Category_Sortorder,'desc'));
- menu_sorting.addMenuSeparator();
-
- menu_sorting.addMenuItem(lang_Default,"config_val('Category_Sortfield','Name');","");
- menu_sorting.addMenuItem(lang_Name,"config_val('Category_Sortfield','Name');",RadioIsSelected(Category_Sortfield,'Name'));
- menu_sorting.addMenuItem(lang_Description,"config_val('Category_Sortfield','Description');",RadioIsSelected(Category_Sortfield,'Description'));
-
- menu_sorting.addMenuItem(lang_CreatedOn,"config_val('Category_Sortfield','CreatedOn');",RadioIsSelected(Category_Sortfield,'CreatedOn'));
- menu_sorting.addMenuItem(lang_SubCats,"config_val('Category_Sortfield','CachedDescendantCatsQty');",RadioIsSelected(Category_Sortfield,'CachedDescendantCatsQty'));
- menu_sorting.addMenuItem(lang_SubItems,"config_val('Category_Sortfield','SubItems');",RadioIsSelected(Category_Sortfield,'SubItems'));
-
- return menu_sorting;
-
- }
-
-
- function Category_FilterMenu(caption)
- {
- menu_filter = new Menu(caption);
- menu_filter.addMenuItem(lang_All,"config_val('Category_View', 127);",CategoryView==127);
- menu_filter.addMenuSeparator();
- menu_filter.addMenuItem(lang_Active,"FlipBit('Category_View',CategoryView,6);",BitStatus(CategoryView,6));
- menu_filter.addMenuItem(lang_Pending,"FlipBit('Category_View',CategoryView,5);", BitStatus(CategoryView,5));
- menu_filter.addMenuItem(lang_Disabled,"FlipBit('Category_View',CategoryView,4);",BitStatus(CategoryView,4));
-
- menu_filter.addMenuSeparator();
- menu_filter.addMenuItem(lang_New,"FlipBit('Category_View',CategoryView,3);",BitStatus(CategoryView,3));
- menu_filter.addMenuItem(lang_EdPick,"FlipBit('Category_View',CategoryView,0);",BitStatus(CategoryView,0));
-
- return menu_filter;
- }
-
- function toggleMenu()
- {
- //var tab_title = GetTabTitle(activeTab.id);
- //alert(tab_title);
- if ((document.getElementById('categories').active) && (activeTab))
- {
- filterfunc = activeTab.getAttribute("tabTitle")+'_FilterMenu();';
-
- window.cat_menu_filter_sub = Category_FilterMenu(lang_Categories);
- window.sub_menu_filter_sub = eval(filterfunc);
-
- window.cat_menu_filter = new Menu(lang_View);
- cat_menu_filter.addMenuItem(cat_menu_filter_sub);
- cat_menu_filter.addMenuItem(sub_menu_filter_sub);
- }
- else
- {
- if (document.getElementById('categories').active)
- {
- window.cat_menu_filter = Category_FilterMenu(lang_View);
- }
- if (activeTab)
- {
- filterfunc = activeTab.getAttribute("tabTitle")+'_FilterMenu();';
- window.cat_menu_filter = eval(filterfunc);
- }
- } // Filter
-
- //Sorting
- if ((document.getElementById('categories').active) && (activeTab))
- {
- //Sort->Categories
- sortfunc = activeTab.getAttribute("tabTitle")+'_SortMenu();';
-
- window.cat_menu_sorting_sub = Category_SortMenu(lang_Categories);
- window.sub_menu_sorting_sub = eval(sortfunc);
-
- window.cat_menu_sorting = new Menu(lang_Sort);
- cat_menu_sorting.addMenuItem(cat_menu_sorting_sub);
- cat_menu_sorting.addMenuItem(sub_menu_sorting_sub);
- }
- else
- {
- if (document.getElementById('categories').active)
- {
- window.cat_menu_sorting = Category_SortMenu(lang_Sort);
-
- } // categories
- if (activeTab)
- {
- window.cat_menu_sorting = Category_SortMenu(lang_Sort);
- }
-
- } // && Sorting
- if ((document.getElementById('categories').active) && (activeTab))
- {
- window.cat_menu_select_sub = new Menu(lang_Categories);
- cat_menu_select_sub.addMenuItem(lang_All,"javascript:selectAll('categories');","");
- cat_menu_select_sub.addMenuItem(lang_Unselect,"javascript:unselectAll('categories');","");
- cat_menu_select_sub.addMenuItem(lang_Invert,"javascript:invert('categories');","");
-
- selectfunc = activeTab.getAttribute("tabTitle")+"_SelectMenu();";
-
- window.sub_menu_select_sub = eval(selectfunc);
-// sub_menu_select_sub.addMenuItem(lang_All,"javascript:selectAll('"+activeTab.id+"');","");
-// sub_menu_select_sub.addMenuItem(lang_Unselect,"javascript:unselectAll('"+activeTab.id+"');","");
-// sub_menu_select_sub.addMenuItem(lang_Invert,"javascript:invert('"+activeTab.id+"');","");
-
-END;
-if (!$hideSelectAll) {
-echo "
- window.cat_menu_select = new Menu(lang_Select);
- cat_menu_select.addMenuItem(cat_menu_select_sub);
- cat_menu_select.addMenuItem(sub_menu_select_sub);";
-}
-print <<<END
- }
- else
- {
-END;
-if (!$hideSelectAll) {
-echo '
- if (document.getElementById(\'categories\').active)
- {
- window.cat_menu_select = new Menu(lang_Select);
- cat_menu_select.addMenuItem(lang_All,"javascript:selectAll(\'categories\');","");
- cat_menu_select.addMenuItem(lang_Unselect,"javascript:unselectAll(\'categories\');","");
- cat_menu_select.addMenuItem(lang_Invert,"javascript:invert(\'categories\');","");
- } ';
-
-echo ' if (activeTab)
- {
-
- window.cat_menu_select = new Menu(lang_Select);
- cat_menu_select.addMenuItem(lang_All,"javascript:selectAllC(\'"+activeTab.id+"\');","");
- cat_menu_select.addMenuItem(lang_Unselect,"javascript:unselectAll(\'"+activeTab.id+"\');","");
- cat_menu_select.addMenuItem(lang_Invert,"javascript:invert(\'"+activeTab.id+"\');","");
- } ';
-}
-print <<<END
- }
- if(activeTab)
- {
- pagefunc = activeTab.getAttribute("tabTitle")+"_PerPageMenu();";
- window.PerPageMenu = eval(pagefunc);
- }
- window.cat_menu = new Menu("root");
- if ((document.getElementById('categories').active) || (activeTab)) window.cat_menu.addMenuItem(cat_menu_filter);
- if ((document.getElementById('categories').active) || (activeTab)) window.cat_menu.addMenuItem(cat_menu_sorting);
- if(activeTab) window.cat_menu.addMenuItem(PerPageMenu);
-
-END;
-if (!$hideSelectAll) {
-echo '
- if ((document.getElementById(\'categories\').active) || (activeTab)) window.cat_menu.addMenuItem(cat_menu_select);
-';
-}
-print <<<END
-
- window.triedToWriteMenus = false;
- window.cat_menu.writeMenus();
-
- }
-
-function toggleCategoriesA(tabHeader)
-{
- var categories = document.getElementById('categories');
- if (!categories) return;
- toggleCategories();
- tabHeader.setAttribute("background", '$imagesURL'+'/itemtabs/' + ((categories.active) ? "tab_active" : "tab_inactive") + ".gif")
- var images = tabHeader.getElementsByTagName("IMG");
- if (images.length < 1) return;
- images[0].src = '$imagesURL'+'/itemtabs/' + ((categories.active) ? "divider_up" : "divider_dn") + ".gif";
-}
-
-function toggleTabA(tabId, atm)
-{
- var hl = document.getElementById("hidden_line");
- var activeTabId;
- if (activeTab) activeTabId = activeTab.id;
- if (activeTabId == tabId)
- {
- var devider = document.getElementById("tabsDevider");
- devider.style.display = "";
-
- unselectAll(tabId);
- var tab = document.getElementById(tabId);
- tab.active = false;
- activeTab = null;
- collapseTab = tab;
- toolbar.setTab(null);
- showTab();
- }
-
- else
- {
- if (activeTab) toggleTab(tabId, true)
- else toggleTab(tabId, atm)
-
- if (hl) hl.style.display = "none";
- }
- tab_hdr = document.getElementById('tab_headers');
- if (!tab_hdr) return;
- for (var i = 0; i < tabIDs.length; i++)
- {
- var tabHeader;
- TDs = tab_hdr.getElementsByTagName("TD");
- for (var j = 0; j < TDs.length; j++)
- if (TDs[j].getAttribute("tabHeaderOf") == tabIDs[i])
- {
- tabHeader = TDs[j];
- break;
- }
- if (!tabHeader) continue;
-
- var tab = document.getElementById(tabIDs[i]);
- if (!tab) continue;
-
- tabHeader.setAttribute("background", "$imagesURL/itemtabs/" + ((tab.active) ? "tab_active" : "tab_inactive") + ".gif")
-
- var images = tabHeader.getElementsByTagName("IMG");
- if (images.length < 1) continue;
-
- images[0].src = "$imagesURL/itemtabs/" + ((tab.active) ? "divider_up" : "divider_empty") + ".gif";
- }
-}
-
-</script>
-
-END;
-?>
Property changes on: trunk/kernel/admin/include/toolbar/editcategory_relationselect.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.7
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/kernel/admin/include/toolbar/editgroup_users.php
===================================================================
--- trunk/kernel/admin/include/toolbar/editgroup_users.php (revision 6427)
+++ trunk/kernel/admin/include/toolbar/editgroup_users.php (nonexistent)
@@ -1,93 +0,0 @@
-<?php
-global $pathtoroot, $envar, $rootURL,$imagesURL,$UserFilter, $objSession, $adminURL;
-
-/* bit place holders for category view menu */
-$user_select = $adminURL."/users/user_select.php";
-
-$ViewNormal=1;
-$Bit_Pending=4;
-$Bit_Disabled=2;
-$Bit_Valid=1;
-$Bit_All = 7;
-
-if( GetVar('resetpage') == 1 ) $objSession->SetVariable("Page_Userlist","1");
-
-/* determine current view menu settings */
-$UserView = $objConfig->Get("User_View");
-$ViewNormal = 0;
-
-if(!is_numeric($UserView))
-{
- $UserView = $Bit_All; //Set all bits ON
- $UserFilter = "";
-}
- if($UserView & $Bit_Valid)
- $Status[] = 1;
-
- if($UserView & $Bit_Disabled)
- $Status[] = 0;
-
- if($UserView & $Bit_Pending)
- $Status[] = 2;
-
-
- if(count($Status)>0)
- {
- $UserFilter = "Status IN (".implode(",",$Status).")";
- }
- else
- $UserFilter = "Status = -1";
-
-/* Set the Items PerPage value */
-$User_Page = (int)$objConfig->Get("Perpage_User");
-if(!$User_Page)
- $User_Page = 10;
-
-/* Set the sort values */
-$SortField = trim($objConfig->Get("User_SortField"));
-$SortOrder = trim($objConfig->Get("User_SortOrder"));
-
-if(!strlen($SortOrder))
- $SortOrder = "asc";
-
-$browseURL = $adminURL."/browse";
-
-$lang_users = admin_language("la_Text_Users");
-$lang_Username = admin_language("la_prompt_Username");
-$lang_LastName = admin_language("la_prompt_LastName");
-$lang_FirstName = admin_language("la_prompt_FirstName");
-$lang_Email = admin_language("la_prompt_Email");
-$lang_PrimaryGroup = admin_language("la_prompt_PrimaryGroup");
-$lang_Valid = admin_language("la_Text_Valid");
-
-print <<<END
-<script language="Javascript">
-<!--
-
-var lang_Users = "$lang_users";
-var lang_Username = "$lang_Username";
-var lang_LastName = "$lang_LastName";
-var lang_FirstName = "$lang_FirstName";
-var lang_Email = "$lang_Email";
-var lang_PrimaryGroup = "$lang_PrimaryGroup";
-var lang_Valid = "$lang_Valid";
-var email_url = '$adminURL'+'/email/sendmail.php?$envar';
-var UserView = $UserView;
-var UserPage = $User_Page;
-
-//-->
-</script>
-
-<script language="JavaScript1.2" src="$browseURL/fw_menu.js"></script>
-<script language="JavaScript1.2" src="$adminURL/include/checkarray.js"></script>
-<script language="Javascript">
-
-UserChecks = new CheckArray();
-
-UserChecks.formname = 'editgroup';
-UserChecks.envar = '$envar';
-
-</script>
-
-END;
-?>
\ No newline at end of file
Property changes on: trunk/kernel/admin/include/toolbar/editgroup_users.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/kernel/admin/include/toolbar/advanced_view.php
===================================================================
--- trunk/kernel/admin/include/toolbar/advanced_view.php (revision 6427)
+++ trunk/kernel/admin/include/toolbar/advanced_view.php (nonexistent)
@@ -1,555 +0,0 @@
-<?php
-global $objConfig,$objSections,$section, $rootURL,$adminURL, $admin, $imagesURL,$envar,
- $m_var_list_update,$objCatList, $homeURL, $upURL, $objSession,$DefaultTab;
-
-global $CategoryFilter,$TotalItemCount;
-
-global $Bit_All,$Bit_Pending,$Bit_Disabled,$Bit_New,$Bit_Pop,$Bit_Hot,$Bit_Ed;
-
-//global $hideSelectAll;
-
-
-$m_tab_Categories_hide = isset($DefaultTab) && ($DefaultTab == 'category') ? 0 : 1;
-
-
-/* bit place holders for category view menu */
-$Bit_Active=64;
-$Bit_Pending=32;
-$Bit_Disabled=16;
-$Bit_New=8;
-$Bit_Pop=4;
-$Bit_Hot=2;
-$Bit_Ed=1;
-
-
-if( isset($_GET['SetTab']) ) $DefaultTab = $_GET["SetTab"];
-
-$application =& kApplication::Instance();
-$force_tab = $application->RecallVar('force_tab');
-if ($force_tab) {
- $DefaultTab = $force_tab;
- $application->RemoveVar('force_tab');
-}
-
-
-// category list filtering stuff: begin
-
-$CategoryView = $objConfig->Get("Category_View");
-if(!is_numeric($CategoryView))
-{
- $CategoryView = 127;
-}
-
-$Category_Sortfield = $objConfig->Get("Category_Sortfield");
-if( !strlen($Category_Sortfield) ) $Category_Sortfield = "Name";
-
-$Category_Sortorder = $objConfig->Get("Category_Sortorder");
-if( !strlen($Category_Sortorder) ) $Category_Sortorder = "desc";
-
-$Perpage_Category = (int)$objConfig->Get("Perpage_Category");
-if(!$Perpage_Category)
- $Perpage_Category="'all'";
-
-
-if($CategoryView == 127)
-{
- $Category_ShowAll = 1;
-}
-else
-{
- $Category_ShowAll = 0;
- // FILTERING CODE V. 1.2
- $where_clauses = Array(); $q = '';
-
- //Group #1: Category Statuses (active,pending,disabled)
- $Status = array(-1);
- if($CategoryView & $Bit_Pending) $Status[] = STATUS_PENDING;
- if($CategoryView & $Bit_Active) $Status[] = STATUS_ACTIVE;
- if($CategoryView & $Bit_Disabled) $Status[] = STATUS_DISABLED;
- if( count($Status) ) $where_clauses[] = 'Status IN ('.implode(',', $Status).')';
-
- //Group #2: Category Statistics (new,pick)
- $Status = array();
- if(!($CategoryView & $Bit_New))
- {
- $cutoff = adodb_date("U") - ($objConfig->Get("Category_DaysNew") * 86400);
- if($cutoff > 0) $q = 'CreatedOn > '.$cutoff;
- $q .= (!empty($q) ? ' OR ' : '').'NewItem = 1';
- $Status[] = "NOT ($q)";
- }
- if(!($CategoryView & $Bit_Ed)) $Status[] = 'NOT (EditorsPick = 1)';
-
- if( count($Status) )
- $where_clauses[] = '('.implode(') AND (', $Status).')';
-
- $CategoryFilter = count($where_clauses) ? '('.implode(') AND (', $where_clauses).')' : '';
-}
-
-// category list filtering stuff: end
-
- $OrderBy = $objCatList->QueryOrderByClause(TRUE,TRUE,TRUE);
- $objCatList->Clear();
- $IsSearch = FALSE;
-
- $list = $objSession->GetVariable("m_adv_view_search");
- $SearchQuery = $objCatList->AdminSearchWhereClause($list);
- if(strlen($SearchQuery))
- {
- $SearchQuery = " (".$SearchQuery.")".($CategoryFilter ? 'AND ('.$CategoryFilter.')' : '');
- $objCatList->LoadCategories($SearchQuery,$OrderBy, false, 'set_last');
- $IsSearch = TRUE;
- }
- else
- $objCatList->LoadCategories($CategoryFilter,$OrderBy, false, 'set_last');
-
- $TotalItemCount += $objCatList->QueryItemCount;
-
-
-$CatTotal = TableCount($objCatList->SourceTable,null,false);
-
-$mnuClearSearch = language("la_SearchMenu_Clear");
-$mnuNewSearch = language("la_SearchMenu_New");
-$mnuSearchCategory = language("la_SearchMenu_Categories");
-
-$lang_New = language("la_Text_New");
-$lang_Hot = language("la_Text_Hot");
-$lang_EdPick = language("la_prompt_EditorsPick");
-$lang_Pop = language("la_Text_Pop");
-
-$lang_Rating = language("la_prompt_Rating");
-$lang_Hits = language("la_prompt_Hits");
-$lang_Votes = language("la_prompt_Votes");
-$lang_Name = language("la_prompt_Name");
-
-$lang_Categories = language("la_ItemTab_Categories");
-$lang_Description = language("la_prompt_Description");
-$lang_MetaKeywords = language("la_prompt_MetaKeywords");
-$lang_SubSearch = language("la_prompt_SubSearch");
-$lang_Within = language("la_Text_Within");
-$lang_Current = language("la_Text_Current");
-$lang_Active = language("la_Text_Active");
-$lang_SubCats = language("la_Text_SubCats");
-$lang_SubItems = language("la_Text_Subitems");
-
-// View, Sort, Select, Per Page
-$lang_View = language('la_Text_View');
-$lang_Sort = language('la_Text_Sort');
-$lang_PerPage = language('la_prompt_PerPage');
-$lang_Select = language('la_Text_Select');
-
-$ItemTabs->AddTab(language("la_ItemTab_Categories"),"category",$objCatList->QueryItemCount, $m_tab_Categories_hide, $CatTotal);
-
-print <<<END
-
-<script language="JavaScript">
-// global usage phrases
-var lang_View = '$lang_View';
-var lang_Sort = '$lang_Sort';
-var lang_PerPage = '$lang_PerPage';
-var lang_Select = '$lang_Select';
-
-// local usage phrases
-var default_tab = "$DefaultTab";
-var Category_Sortfield = '$Category_Sortfield';
-var Category_Sortorder = '$Category_Sortorder';
-var Category_Perpage = $Perpage_Category;
-var Category_ShowAll = $Category_ShowAll;
-var CategoryView = $CategoryView;
-
-//JS Language variables
-var lang_New = "$lang_New";
-var lang_Hot = "$lang_Hot";
-var lang_EdPick = "$lang_EdPick";
-
-var lang_Pop = "$lang_Pop";
-var lang_Rating = "$lang_Rating";
-var lang_Hits = "$lang_Hits";
-var lang_Votes = "$lang_Votes";
-var lang_Name = "$lang_Name";
-var lang_Categories = "$lang_Categories";
-var lang_Description = "$lang_Description";
-var lang_MetaKeywords = "$lang_MetaKeywords";
-var lang_SubSearch = "$lang_SubSearch";
-var lang_Within="$lang_Within";
-var lang_Current = "$lang_Current";
-var lang_Active = "$lang_Active";
-var lang_SubCats = "$lang_SubCats";
-var lang_SubItems = "$lang_SubItems";
-
-var hostname = '$rootURL';
-var env = '$envar';
-var actionlist = new Array();
-
-
-
- // K4 code for handling toolbar operations: begin
- var \$TabRegistry = Array();
-
- function InpGrid(tab)
- {
- this.TabId = tab;
- }
-
- InpGrid.prototype.ClearSelection = function(force,called_from)
- {
- unselectAll(this.TabId, 1); //1 means don't upate toolbar
- }
-
- function registerTab(\$tab_id)
- {
- var \$tab = document.getElementById(\$tab_id);
- var \$index = \$TabRegistry.length;
-
- \$TabRegistry[\$index] = new Array();
- \$TabRegistry[\$index]['tab_id'] = \$tab_id;
- \$TabRegistry[\$index]['prefix_special'] = \$tab.getAttribute('PrefixSpecial');
- \$TabRegistry[\$index]['edit_template'] = \$tab.getAttribute('EditURL');
- }
-
- function queryTabRegistry(\$search_key, \$search_value, \$return_key)
- {
- var \$i = 0;
- while(\$i < \$TabRegistry.length)
- {
- if(\$TabRegistry[\$i][\$search_key] == \$search_value)
- {
- return \$TabRegistry[\$i][\$return_key];
- break;
- }
- \$i++;
- }
- return '<'+\$search_key+'='+\$search_value+'>';
- }
-
- function k4_actionHandler(action, prefix_special)
- {
- var k4_action = '';
- switch (action)
- {
- case 'edit':
- k4_action = 'edit_item("'+prefix_special+'")';
- break;
- case 'delete':
- k4_action = 'delete_items("'+prefix_special+'")';
- break;
- case 'unselect':
- k4_action = 'unselect("'+prefix_special+'")';
- break;
- case 'approve':
- k4_action = 'approve_items("'+prefix_special+'")';
- break;
- case 'decline':
- k4_action = 'decine_items("'+prefix_special+'")';
- break;
- }
- if (k4_action != '')
- {
- \$form_name = queryTabRegistry('prefix_special', prefix_special, 'tab_id') + '_form';
- eval(k4_action);
- }
- else alert(action+' not implemented');
-
- }
-
- function approve_items(prefix_special)
- {
- set_hidden_field('remove_specials['+prefix_special+']',1);
- submit_event(prefix_special,'OnMassApprove','')
- }
-
- function decine_items(prefix_special)
- {
- set_hidden_field('remove_specials['+prefix_special+']',1);
- submit_event(prefix_special,'OnMassDecline','')
- }
-
- function edit()
- {
- edit_item( queryTabRegistry('tab_id', activeTab.id, 'prefix_special') );
- }
-
- function edit_item(prefix_special)
- {
- opener_action('d');
- set_hidden_field(prefix_special+'_mode', 't');
- set_hidden_field('remove_specials['+prefix_special+']',1);
-
- submit_event(prefix_special, 'OnEdit', queryTabRegistry('prefix_special', prefix_special, 'edit_template'), '../../admin/index.php');
- }
-
- function delete_items(prefix_special)
- {
- set_hidden_field('remove_specials['+prefix_special+']',1);
- submit_event(prefix_special,'OnMassDelete','')
- }
-
- function unselect(prefix_special)
- {
- Grids[prefix_special].ClearSelection(null,'Inp_AdvancedView.Unselect');
- }
- // K4 code for handling toolbar operations: end
-
-
-
- // Common function for all "Advanced View" page
- function InitPage()
- {
- addCommonActions();
- initToolbar('mainToolBar', actionHandler);
- initCheckBoxes(null, false);
- //toggleMenu();
- }
-
- function AddButtonAction(actionname,actionval)
- {
- var item = new Array(actionname,actionval);
- actionlist[actionlist.length] = item;
- }
-
- function actionHandler(button)
- {
- for(i=0; i<actionlist.length;i++)
- {
- a = actionlist[i];
- if(button.action == a[0])
- {
- eval(a[1]);
- break;
- }
- }
- }
-
- function addCommonActions()
- {
- AddButtonAction('edit',"check_submit('','edit');"); //edit
- AddButtonAction('delete',"check_submit('$admin/advanced_view','delete');"); //delete
- AddButtonAction('approve',"check_submit('$admin/advanced_view','approve');"); //approve
- AddButtonAction('decline',"check_submit('$admin/advanced_view','decline');"); //decline
- AddButtonAction('print',"window.print();"); //print ?
- AddButtonAction('view',"toggleMenu(); window.FW_showMenu(window.cat_menu,getRealLeft(button) - ((document.all) ? 6 : -2),getRealTop(button)+32);");
- }
-
- function check_submit(page,actionValue)
- {
-
- if (actionValue.match(/delete$/))
- if (!theMainScript.Confirm(lang_DeleteConfirm)) return;
-
- var formname = '';
- var action_prefix ='';
-
- if (activeTab)
- {
- form_name = activeTab.id;
- action_prefix = activeTab.getAttribute("ActionPrefix");
- if(page.length == 0) page = activeTab.getAttribute("EditURL");
-
- if ( action_prefix.match("k4:(.*)") )
- {
- act = RegExp.$1;
- act = act.replace('$\$event$$', actionValue);
- act = act.replace('$\$prefix$$', activeTab.getAttribute("PrefixSpecial") );
- eval(act);
- return;
- }
- }
-
- var f = document.getElementsByName(form_name+'_form')[0];
- if(f)
- {
- f.Action.value = action_prefix + actionValue;
- f.action = '$rootURL' + page + '.php?'+ env;
- f.submit();
- }
- }
-
- function flip_current(field_suffix)
- {
- if(activeTab)
- {
- field = activeTab.getAttribute("tabTitle")+field_suffix;
- return flip(eval(field));
- }
- }
-
- function config_current(field_suffix,value)
- {
- if(activeTab)
- {
- field = activeTab.getAttribute("tabTitle")+field_suffix;
- config_val(field,value);
- }
- }
-
- \$fw_menus['c_view_menu'] = function()
- {
- // filtring menu
- \$Menus['c_filtring_menu'] = new Menu(lang_View);
- \$Menus['c_filtring_menu'].addMenuItem(lang_All,"config_val('Category_View', 127);",CategoryView==127);
- \$Menus['c_filtring_menu'].addMenuSeparator();
- \$Menus['c_filtring_menu'].addMenuItem(lang_Active,"FlipBit('Category_View',CategoryView,6);",BitStatus(CategoryView,6));
- \$Menus['c_filtring_menu'].addMenuItem(lang_Pending,"FlipBit('Category_View',CategoryView,5);", BitStatus(CategoryView,5));
- \$Menus['c_filtring_menu'].addMenuItem(lang_Disabled,"FlipBit('Category_View',CategoryView,4);",BitStatus(CategoryView,4));
- \$Menus['c_filtring_menu'].addMenuSeparator();
- \$Menus['c_filtring_menu'].addMenuItem(lang_New,"FlipBit('Category_View',CategoryView,3);",BitStatus(CategoryView,3));
- \$Menus['c_filtring_menu'].addMenuItem(lang_EdPick,"FlipBit('Category_View',CategoryView,0);",BitStatus(CategoryView,0));
-
- // sorting menu
- \$Menus['c_sorting_menu'] = new Menu(lang_Sort);
- \$Menus['c_sorting_menu'].addMenuItem(lang_Asc,"config_val('Category_Sortorder','asc');",RadioIsSelected(Category_Sortorder,'asc'));
- \$Menus['c_sorting_menu'].addMenuItem(lang_Desc,"config_val('Category_Sortorder','desc');",RadioIsSelected(Category_Sortorder,'desc'));
- \$Menus['c_sorting_menu'].addMenuSeparator();
- \$Menus['c_sorting_menu'].addMenuItem(lang_Default,"config_val('Category_Sortfield','Name');","");
- \$Menus['c_sorting_menu'].addMenuItem(lang_Name,"config_val('Category_Sortfield','Name');",RadioIsSelected(Category_Sortfield,'Name'));
- \$Menus['c_sorting_menu'].addMenuItem(lang_Description,"config_val('Category_Sortfield','Description');",RadioIsSelected(Category_Sortfield,'Description'));
- \$Menus['c_sorting_menu'].addMenuItem(lang_CreatedOn,"config_val('Category_Sortfield','CreatedOn');",RadioIsSelected(Category_Sortfield,'CreatedOn'));
- \$Menus['c_sorting_menu'].addMenuItem(lang_SubCats,"config_val('Category_Sortfield','CachedDescendantCatsQty');",RadioIsSelected(Category_Sortfield,'CachedDescendantCatsQty'));
- \$Menus['c_sorting_menu'].addMenuItem(lang_SubItems,"config_val('Category_Sortfield','SubItems');",RadioIsSelected(Category_Sortfield,'SubItems'));
-
- // perpage menu
- \$Menus['c_perpage_menu'] = new Menu(lang_PerPage);
- \$Menus['c_perpage_menu'].addMenuItem("10","config_val('Perpage_Category', '10');",RadioIsSelected(Category_Perpage,10));
- \$Menus['c_perpage_menu'].addMenuItem("20","config_val('Perpage_Category', '20');",RadioIsSelected(Category_Perpage,20));
- \$Menus['c_perpage_menu'].addMenuItem("50","config_val('Perpage_Category', '50');",RadioIsSelected(Category_Perpage,50));
- \$Menus['c_perpage_menu'].addMenuItem("100","config_val('Perpage_Category', '100');",RadioIsSelected(Category_Perpage,100));
- \$Menus['c_perpage_menu'].addMenuItem("500","config_val('Perpage_Category', '500');",RadioIsSelected(Category_Perpage,500));
-
- // select menu
- \$Menus['c_select_menu'] = new Menu(lang_Select);
- \$Menus['c_select_menu'].addMenuItem(lang_All,"javascript:selectAllC('"+activeTab.id+"');","");
- \$Menus['c_select_menu'].addMenuItem(lang_Unselect,"javascript:unselectAll('"+activeTab.id+"');","");
- \$Menus['c_select_menu'].addMenuItem(lang_Invert,"javascript:invert('"+activeTab.id+"');","");
-
- // view menu
- \$Menus['c_view_menu'] = new Menu(lang_Categories);
- \$Menus['c_view_menu'].addMenuItem( \$Menus['c_filtring_menu'] );
- \$Menus['c_view_menu'].addMenuItem( \$Menus['c_sorting_menu'] );
- \$Menus['c_view_menu'].addMenuItem( \$Menus['c_perpage_menu'] );
- \$Menus['c_view_menu'].addMenuItem( \$Menus['c_select_menu'] );
- }
-
- function toggleMenu()
- {
- var prefix_special = activeTab.getAttribute('PrefixSpecial');
- \$fw_menus[prefix_special+'_view_menu']();
- window.cat_menu = \$Menus[prefix_special+'_view_menu'];
- window.triedToWriteMenus = false;
- window.cat_menu.writeMenus();
- }
-
- function toggleTabB(tabId, atm)
- {
- var hl = document.getElementById("hidden_line");
- var activeTabId;
-
- if (activeTab) activeTabId = activeTab.id;
-
-
- if (activeTabId != tabId)
- {
- if (activeTab)
- {
- //alert('switching to tab');
- toggleTab(tabId, true)
- }
- else
- {
- //alert('opening tab');
- toggleTab(tabId, atm)
- }
-
- if (hl) hl.style.display = "none";
- }
- tab_hdr = document.getElementById('tab_headers');
- if (!tab_hdr) return;
-
- // process all module tabs
- var active_str = '';
- for (var i = 0; i < tabIDs.length; i++)
- {
- var tabHeader;
- TDs = tab_hdr.getElementsByTagName("TD");
- // find tab
- for (var j = 0; j < TDs.length; j++)
- if (TDs[j].getAttribute("tabHeaderOf") == tabIDs[i])
- {
- tabHeader = TDs[j];
- break;
- }
- if (!tabHeader) continue;
-
- var tab = document.getElementById(tabIDs[i]);
- if (!tab) continue;
- active_str = (tab.active) ? "tab_active" : "tab_inactive";
- if (TDs[j].getAttribute("tabHeaderOf") == tabId) {
- // module tab is selected
- TabActive = tabId;
- SetBackground('l_' + tabId, "$imagesURL/itemtabs/" + active_str + "_l.gif");
- SetBackground('m_' + tabId, "$imagesURL/itemtabs/" + active_str + ".gif");
- SetBackground('m1_' + tabId, "$imagesURL/itemtabs/" + active_str + ".gif");
- SetBackground('r_' + tabId, "$imagesURL/itemtabs/" + active_str + "_r.gif");
- }
- else
- {
- // module tab is not selected
- SetBackground('l_' +tabIDs[i], "$imagesURL/itemtabs/" + active_str + "_l.gif");
- SetBackground('m_' + tabIDs[i], "$imagesURL/itemtabs/" + active_str + ".gif");
- SetBackground('m1_' + tabIDs[i], "$imagesURL/itemtabs/" + active_str + ".gif");
- SetBackground('r_' + tabIDs[i], "$imagesURL/itemtabs/" + active_str + "_r.gif");
- }
-
- var images = tabHeader.getElementsByTagName("IMG");
- if (images.length < 1) continue;
-
- images[0].src = "$imagesURL/itemtabs/" + ((tab.active) ? "divider_up" : "divider_empty") + ".gif";
- }
- }
-
- function SetBackground(element_id, img_url)
- {
- // set background image of element specified by id
- var el = document.getElementById(element_id);
- el.style.backgroundImage = 'url('+img_url+')';
- }
-
- function initContextMenu()
- {
- window.contextMenu = new Menu("Context");
- contextMenu.addMenuItem("Edit","check_submit('','edit');","");
- contextMenu.addMenuItem("Delete","check_submit('admin/advanced_view','delete');","");
- contextMenu.addMenuSeparator();
- contextMenu.addMenuItem("Approve","check_submit('admin/advanced_view','approve');","");
- contextMenu.addMenuItem("Decline","check_submit('admin/advanced_view','decline');","");
-
- window.triedToWriteMenus = false;
- window.contextMenu.writeMenus();
- return true;
- }
-
- // Event Handling Stuff Cross-Browser
- getEvent = window.Event
- ? function(e){return e}
- : function() {return event}
-
- getEventSrcElement = window.Event
- ? function(e){var targ=e.target;return targ.nodeType==1?targ:targ.parentNode}
- : function() {return event.srcElement}
-
- function getKeyCode(e){return e.charCode||e.keyCode}
-
- function getKey(eMoz)
- {
- var e = getEvent(eMoz)
- var keyCode = getKeyCode(e)
-
- if(keyCode == 13)
- {
- var el = document.getElementById(TabActive+'_imgSearch');
- if(typeof(el) != 'undefined') el.onclick();
- }
-
- }
-</script>
-
-END;
-?>
\ No newline at end of file
Property changes on: trunk/kernel/admin/include/toolbar/advanced_view.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.12
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/kernel/admin/include/toolbar/browse.php
===================================================================
--- trunk/kernel/admin/include/toolbar/browse.php (revision 6427)
+++ trunk/kernel/admin/include/toolbar/browse.php (nonexistent)
@@ -1,942 +0,0 @@
-<?php
-global $objConfig,$objSections,$section, $rootURL,$adminURL, $admin, $imagesURL,$envar,
- $m_var_list_update,$objCatList, $homeURL, $upURL, $objSession,$CatScopeClause,$DefaultTab;
-
-global $CategoryFilter,$TotalItemCount;
-
-global $Bit_All,$Bit_Pending,$Bit_Disabled,$Bit_New,$Bit_Pop,$Bit_Hot,$Bit_Ed;
-
-global $hideSelectAll;
-
-/* bit place holders for category view menu */
-$Bit_Active=64;
-$Bit_Pending=32;
-$Bit_Disabled=16;
-$Bit_New=8;
-$Bit_Pop=4;
-$Bit_Hot=2;
-$Bit_Ed=1;
-
-if( isset($_GET['SetTab']) )
-{
- if($_GET["SetTab"] != "categories")
- {
- $m_tab_CatTab_Hide = 1;
- $DefaultTab = $_GET["SetTab"];
- }
- else
- {
- $DefaultTab="categories";
- $m_tab_CatTab_Hide = 0;
- }
-}
-else
- $m_tab_CatTab_Hide = (int)$objConfig->Get("CatTab_Hide");
-
-$CategoryView = $objConfig->Get("Category_View");
-if(!is_numeric($CategoryView))
-{
- $CategoryView = 127;
-}
-
-$Category_Sortfield = $objConfig->Get("Category_Sortfield");
-if(!strlen($Category_Sortfield))
- $Category_Sortfield = "Name";
-
-$Category_Sortorder = $objConfig->Get("Category_Sortorder");
-if(!strlen($Category_Sortorder))
- $Category_Sortorder = "desc";
-
-$Perpage_Category = (int)$objConfig->Get("Perpage_Category");
-if(!$Perpage_Category)
- $Perpage_Category="'all'";
-
-
-if($CategoryView == 127)
-{
- $Category_ShowAll = 1;
-}
-else
-{
- $Category_ShowAll=0;
- $Status = array();
- $Mod = array();
- if($CategoryView & $Bit_Pending)
- $Status[] = STATUS_PENDING;
-
- if($CategoryView & $Bit_Active)
- $Status[] = STATUS_ACTIVE;
-
-
- if($CategoryView & $Bit_Disabled)
- $Status[] = STATUS_DISABLED;
-
- if(count($Status))
- {
- $CategoryFilter .= " AND (Status IN (".implode(",",$Status).") ";
- }
- else
- $CategoryFilter .= " AND ((Status=-1) ";
-
- if($CategoryView & $Bit_Ed)
- {
- $CategoryFilter .= " OR (EditorsPick=1) ";
- }
-
- if($CategoryView & $Bit_New)
- {
- $cutoff = adodb_date("U") - ($objConfig->Get("Category_DaysNew") * 86400);
- $CategoryFilter .= " OR (CreatedOn > ".$cutoff.") ";
- }
- $CategoryFilter .= ")";
-}
-
-$list = $objSession->GetVariable("SearchWord");
-if(strlen($list))
-{
- $CatScope = $objSession->GetVariable("SearchScope");
- switch($CatScope)
- {
- case 0 :
- $CatScopeClause = "";
- break;
- case 1:
- $cat = $objCatList->CurrentCategoryID();
- if($cat>0)
- {
- $allcats = $objCatList->AllSubCats($cat);
- if(count($allcats)>0)
- {
- $catlist = implode(",",$allcats);
- $CatScopeClause = " CategoryId IN ($catlist) ";
- }
- }
- break;
- case 2:
- $CatScopeClause = "CategoryId=".$objCatList->CurrentCategoryID();
- break;
- }
-}
-else
- $CatScopeClause="";
-
-$Cat_Paste = "false";
-if($objCatList->ItemsOnClipboard()>0)
- $Cat_Paste = "true";
-
-$CurrentCat = $objCatList->CurrentCategoryID();
-if($CurrentCat>0)
-{
- $c = $objCatList->GetItem($CurrentCat);
- $CurrentRes = (int)$c->Get("ResourceId");
-}
-else
- $CurrentRes =0;
-$mnuClearSearch = language("la_SearchMenu_Clear");
-$mnuNewSearch = language("la_SearchMenu_New");
-$mnuSearchCategory = language("la_SearchMenu_Categories");
-
-$lang_New = language("la_Text_New");
-$lang_Hot = language("la_Text_Hot");
-$lang_EdPick = language("la_prompt_EditorsPick");
-$lang_Pop = language("la_Text_Pop");
-
-$lang_Rating = language("la_prompt_Rating");
-$lang_Hits = language("la_prompt_Hits");
-$lang_Votes = language("la_prompt_Votes");
-$lang_Name = language("la_prompt_Name");
-
-$lang_Categories = language("la_ItemTab_Categories");
-$lang_Description = language("la_prompt_Description");
-$lang_MetaKeywords = language("la_prompt_MetaKeywords");
-$lang_SubSearch = language("la_prompt_SubSearch");
-$lang_Within = language("la_Text_Within");
-$lang_Current = language("la_Text_Current");
-$lang_Active = language("la_Text_Active");
-$lang_SubCats = language("la_Text_SubCats");
-$lang_SubItems = language("la_Text_Subitems");
-
-// View, Sort, Select, Per Page
-$lang_View = language('la_Text_View');
-$lang_Sort = language('la_Text_Sort');
-$lang_PerPage = language('la_prompt_PerPage');
-$lang_Select = language('la_Text_Select');
-$lang_InDevelopment = language('la_Text_InDevelopment');
-
-print <<<END
-
-<script language="JavaScript">
-// global usage phrases
-var lang_View = '$lang_View';
-var lang_Sort = '$lang_Sort';
-var lang_PerPage = '$lang_PerPage';
-var lang_Select = '$lang_Select';
-
-// local usage phrases
-var Category_Sortfield = '$Category_Sortfield';
-var Category_Sortorder = '$Category_Sortorder';
-var Category_Perpage = $Perpage_Category;
-var Category_ShowAll = $Category_ShowAll;
-var CategoryView = $CategoryView;
-var default_tab = "$DefaultTab";
-var Categories_Paste = $Cat_Paste;
-var CurrentCat = $CurrentCat;
-var CurrentRes = $CurrentRes;
-
-PasteButton = PasteButton || Categories_Paste;
-
-//JS Language variables
-var lang_New = "$lang_New";
-var lang_Hot = "$lang_Hot";
-var lang_EdPick = "$lang_EdPick";
-
-var lang_Pop = "$lang_Pop";
-var lang_Rating = "$lang_Rating";
-var lang_Hits = "$lang_Hits";
-var lang_Votes = "$lang_Votes";
-var lang_Name = "$lang_Name";
-var lang_Categories = "$lang_Categories";
-var lang_Description = "$lang_Description";
-var lang_MetaKeywords = "$lang_MetaKeywords";
-var lang_SubSearch = "$lang_SubSearch";
-var lang_Within="$lang_Within";
-var lang_Current = "$lang_Current";
-var lang_Active = "$lang_Active";
-var lang_SubCats = "$lang_SubCats";
-var lang_SubItems = "$lang_SubItems";
-var lang_InDevelopment = "$lang_InDevelopment";
-
-var m_tab_CatTab_hide = $m_tab_CatTab_Hide;
-var hostname = '$rootURL';
-var env = '$envar';
-var actionlist = new Array();
-var homeURL = "$homeURL";
-var upURL = "$upURL";
-
-
- // K4 code for handling toolbar operations: begin
- var \$TabRegistry = Array();
-
- function InpGrid(tab)
- {
- this.TabId = tab;
- }
-
- InpGrid.prototype.ClearSelection = function(force,called_from)
- {
- unselectAll(this.TabId, 1); //1 means don't upate toolbar
- }
-
- function registerTab(\$tab_id)
- {
- var \$tab = document.getElementById(\$tab_id);
- var \$index = \$TabRegistry.length;
-
- \$TabRegistry[\$index] = new Array();
- \$TabRegistry[\$index]['tab_id'] = \$tab_id;
- \$TabRegistry[\$index]['prefix_special'] = \$tab.getAttribute('PrefixSpecial');
- \$TabRegistry[\$index]['edit_template'] = \$tab.getAttribute('EditURL');
- }
-
- function queryTabRegistry(\$search_key, \$search_value, \$return_key)
- {
- var \$i = 0;
- while(\$i < \$TabRegistry.length)
- {
- if(\$TabRegistry[\$i][\$search_key] == \$search_value)
- {
- return \$TabRegistry[\$i][\$return_key];
- break;
- }
- \$i++;
- }
- return '<'+\$search_key+'='+\$search_value+'>';
- }
-
- function k4_actionHandler(action, prefix_special)
- {
- var k4_action = '';
- switch (action)
- {
- case 'edit':
- k4_action = 'edit_item("'+prefix_special+'")';
- break;
- case 'delete':
- k4_action = 'delete_items("'+prefix_special+'")';
- break;
- case 'unselect':
- k4_action = 'unselect("'+prefix_special+'")';
- break;
-
- case 'approve':
- k4_action = 'approve_items("'+prefix_special+'")';
- break;
- case 'decline':
- k4_action = 'decine_items("'+prefix_special+'")';
- break;
-
- case 'm_rebuild_cache':
- k4_action = 'rebuild_cache("c")';
- break;
-
-// case 'import':
-// k4_action = 'import_items("'+prefix_special+'")';
-// break;
-
- case 'export':
- k4_action = 'export_items("'+prefix_special+'")';
- break;
-
- case 'copy':
- k4_action = 'copy_items("'+prefix_special+'")';
- break;
- case 'cut':
- k4_action = 'cut_items("'+prefix_special+'")';
- break;
-
- case 'move_up':
- k4_action = 'move_up("'+prefix_special+'")';
- break;
- case 'move_down':
- k4_action = 'move_down("'+prefix_special+'")';
- break;
- }
-
- if (k4_action != '')
- {
- \$form_name = queryTabRegistry('prefix_special', prefix_special, 'tab_id') + '_form';
- eval(k4_action);
- }
- else alert(action+' not implemented');
-
- }
-
- function approve_items(prefix_special)
- {
- set_hidden_field('remove_specials['+prefix_special+']',1);
- submit_event(prefix_special,'OnMassApprove','')
- }
-
- function decine_items(prefix_special)
- {
- set_hidden_field('remove_specials['+prefix_special+']',1);
- submit_event(prefix_special,'OnMassDecline','')
- }
-
-// function import_items(prefix_special)
-// {
-// set_hidden_field('remove_specials['+prefix_special+']',1);
-// submit_event(prefix_special,'OnImport','')
-// }
-
- function export_items(prefix_special)
- {
- set_hidden_field('remove_specials['+prefix_special+']',1);
- submit_event(prefix_special,'OnExport','')
- }
-
- function edit()
- {
- edit_item( queryTabRegistry('tab_id', activeTab.id, 'prefix_special') );
- }
-
- function edit_item(prefix_special)
- {
- opener_action('d');
- set_hidden_field(prefix_special+'_mode', 't');
- submit_event(prefix_special, 'OnEdit', queryTabRegistry('prefix_special', prefix_special, 'edit_template'), '../../admin/index.php');
- }
-
- function delete_items(prefix_special)
- {
- set_hidden_field('remove_specials['+prefix_special+']',1);
- submit_event(prefix_special,'OnMassDelete','')
- }
-
- function copy_items(prefix_special)
- {
- submit_event(prefix_special,'OnCopy','')
- }
-
- function cut_items(prefix_special)
- {
- submit_event(prefix_special,'OnCut','')
- }
-
- function move_up(prefix_special)
- {
- submit_event(prefix_special,'OnMassMoveUp','')
- }
-
- function move_down(prefix_special)
- {
- submit_event(prefix_special,'OnMassMoveDown','')
- }
-
- function unselect(prefix_special)
- {
- Grids[prefix_special].ClearSelection(null,'Inp_AdvancedView.Unselect');
- }
-
- function rebuild_cache(prefix_special)
- {
- submit_event(prefix_special,'OnRebuildCache','')
- }
- // K4 code for handling toolbar operations: end
-
-
-
- function InitPage()
- {
- addCommonActions();
- initToolbar('mainToolBar', actionHandler);
- initCheckBoxes();
- //toggleMenu();
- }
-
- function AddButtonAction(action_name,action_value)
- {
- actionlist[actionlist.length] = new Array(action_name, action_value);
- }
-
- function actionHandler(button)
- {
-// alert('a button has been pressed!');
- for(i=0; i<actionlist.length;i++)
- {
-
- a = actionlist[i];
- if(button.action==a[0])
- {
-// alert('Button action '+a[0]+' is '+a[1]);
- eval(a[1]);
- break;
- }
- }
- }
-
- function addCommonActions()
- {
- AddButtonAction('upcat',"get_to_server(upURL,'');");// UP
- AddButtonAction('homecat',"get_to_server(homeURL,'');"); //home
- AddButtonAction('new_cat',"get_to_server('$adminURL/category/addcategory.php',env+'&new=1');"); //new cat
- AddButtonAction('editcat',"edit_current(); "); //edit current
- AddButtonAction('edit',"check_submit('','edit');"); //edit
- AddButtonAction('delete',"check_submit('$admin/browse','delete');"); //delete
- AddButtonAction('approve',"check_submit('$admin/browse','approve');"); //approve
- AddButtonAction('decline',"check_submit('$admin/browse','decline');"); //decline
-
-// AddButtonAction('import',"check_submit('$admin/browse','import');"); // import
- AddButtonAction('export',"check_submit('$admin/browse','export');"); // export
-
- AddButtonAction('rebuild_cache',"check_submit('$admin/category/category_maint', 'm_rebuild_cache');"); // rebuild_cache
-
- AddButtonAction('cut',"check_submit('$admin/browse','cut');"); //cut
- AddButtonAction('copy',"check_submit('$admin/browse','copy');"); //copy
- AddButtonAction('paste',"get_to_server('$adminURL/browse.php',env+'&Action=m_paste');"); //paste
- AddButtonAction('move_up',"check_submit('$admin/browse','move_up');"); //up
- AddButtonAction('move_down',"check_submit('$admin/browse','move_down');"); //down
- AddButtonAction('print',"window.print();"); //print ?
- AddButtonAction('view',"toggleMenu(); window.FW_showMenu(window.cat_menu,getRealLeft(button) - ((document.all) ? 6 : -2),getRealTop(button)+32);");
- AddButtonAction('search_a',"setSearchMenu(); window.FW_showMenu(window.SearchMenu,getRealLeft(button)-134 - ((document.all) ? 8 : -1),getRealTop(button)+22);");
- AddButtonAction('search_b',"search_submit();");
- AddButtonAction('search_c',"new_search_submit();");
- }
-
- function AdminCatNav(url)
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- f.action = url;
- new_search_submit();
- }
- }
-
- function search_submit()
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- //alert('Setting SearchWord to ' + f.value);
- f.Action.value = "m_SearchWord";
- f.submit();
- }
- }
- function new_search_submit()
- {
- var newSearchInput = document.getElementById("NewSearch");
- if (newSearchInput) newSearchInput.value = 1;
- search_submit();
- }
-
- function ClearSearch()
- {
- //alert('Clearing Search');
- f = document.getElementById("admin_search");
- if(f)
- {
- f.Action.value = "m_ClearSearch";
- f.submit();
- }
- }
-
- function SetSearchType(value)
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- f.SearchType.value = value;
- }
- }
-
- function SetSearchScope(value)
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- f.SearchScope.value = value;
- }
- }
-
- function ToggleNewSearch()
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- value = f.NewSearch.value;
- if(value==1)
- {
- f.NewSearch.value=0;
- }
- else
- f.NewSearch.value=1;
- }
- }
- function isNewSearch()
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- return f.NewSearch.value;
- }
- else return 0;
- }
-
-
- function get_to_server(path,attr)
- {
- if(attr.length>0)
- path = path + '?'+attr;
-
- window.location.href=path;
- return true;
- }
-
- function check_submit(page, actionValue)
- {
- if (actionValue.match(/delete$/))
- {
- if (!theMainScript.Confirm(lang_DeleteConfirm)) return;
- }
-
- var formname = '';
- var action_prefix ='';
-
- var isCategoryExport = activeTab && isAnyChecked('categories') && (actionValue == 'export');
-
- // skip news & topics for export operations (not to raise js errors)
- if ((actionValue == 'export') && (activeTab.getAttribute("PrefixSpecial") == 'n' || activeTab.getAttribute("PrefixSpecial") == 'bb')) {
- alert(lang_InDevelopment);
- return false;
- }
-
- if (activeTab && (!isAnyChecked('categories') || isCategoryExport))
- {
- form_name = activeTab.id;
- action_prefix = activeTab.getAttribute("ActionPrefix");
- if (page.length == 0) page = activeTab.getAttribute("EditURL");
-
- if (actionValue == 'export') {
- save_selected_categories('export_categories');
- }
-
- if ( action_prefix.match("k4:(.*)") )
- {
- act = RegExp.$1;
- act = act.replace('$\$event$$', actionValue);
- act = act.replace('$\$prefix$$', activeTab.getAttribute("PrefixSpecial") );
- eval(act);
- return;
- }
- else if(actionValue == 'export') // || actionValue == 'import'
- {
- return k4_actionHandler(actionValue, activeTab.getAttribute("PrefixSpecial"));
- }
- }
- else
- {
- form_name = 'categories';
- action_prefix = 'm_cat_';
- if (page.length == 0) page = "$admin" + '/category/addcategory';
- }
-
- var f = document.getElementsByName(form_name+'_form')[0];
- if(f)
- {
- if (actionValue.substring(0,2) == 'm_')
- {
- f.Action.value = actionValue;
- }
- else
- {
- f.Action.value = action_prefix + actionValue;
- }
-
- f.action = '$rootURL' + page + '.php?'+ env;
-// alert(f.name+ ' is submitting to '+ f.action + ' action=' + f.Action.value);
- f.submit();
- }
- } // check submit
-
- function save_selected_categories(field_name)
- {
- var result = '';
- var checkboxes = document.getElementsByName('catlist[]');
-
- for (var i = 0; i < checkboxes.length; i++)
- {
- if (checkboxes[i].checked == true)
- {
- result += checkboxes[i].value + ',';
- }
- }
- result = result.replace(/(.*),\$/, '\$1');
- if (activeTab) \$form_name = activeTab.id + '_form';
- set_hidden_field(field_name, result);
- }
-
- function edit_current()
- {
- if(CurrentCat==0)
- {
- get_to_server('$adminURL/category/addcategory_permissions.php',env+'&item=0');
- }
- else
- get_to_server('$adminURL/category/addcategory.php',env+'&item=$CurrentRes');
- }
-
- function flip_current(field_suffix)
- {
- if(activeTab)
- {
- field = activeTab.getAttribute("tabTitle")+field_suffix;
- return flip(eval(field));
- }
- }
-
- function config_current(field_suffix,value)
- {
- if(activeTab)
- {
- field = activeTab.getAttribute("tabTitle")+field_suffix;
- config_val(field,value);
- }
- }
-
- function getSType(type,value)
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- if (f.SearchType.value == type) return 2; else return 0;
- } else return 0;
-
- }
-
- function getSScope(scope)
- {
- f = document.getElementById("admin_search");
- if(f)
- {
- if (f.SearchScope.value == scope) return 2; else return 0;
- } else return 0;
-
- }
-
- function setSearchMenu()
- {
-
- window.SearchMenu = new Menu("search");
- SearchMenu.addMenuItem(lang_All,"SetSearchType('all');",getSType('all'));
- SearchMenu.addMenuSeparator()
-
- SearchMenu.addMenuItem(lang_Categories, "SetSearchType('categories');",getSType('categories'));
- param = "";
-
- for (var i = 0; i < tabIDs.length; i++)
- {
- d = document.getElementById(tabIDs[i]);
- if(d)
- {
- tabname = d.getAttribute("tabTitle");
- param = "SetSearchType('"+tabname+"');";
-
- SearchMenu.addMenuItem(tabname,param,getSType(tabname));
- }
- }
-
- SearchMenu.addMenuSeparator();
- SearchMenu.addMenuItem(lang_All+' '+lang_Categories,"SetSearchScope('0');",getSScope(0));
- SearchMenu.addMenuItem(lang_SubSearch,"ToggleNewSearch();",isNewSearch());
- SearchMenu.addMenuItem(lang_Current+' '+lang_Categories,"SetSearchScope('2');",getSScope(2));
- SearchMenu.addMenuItem(lang_Within+' '+lang_Categories,"SetSearchScope('1');",getSScope(1));
-
- SearchMenu.addMenuSeparator();
-
- window.SearchMenu.addMenuItem('$mnuClearSearch',"ClearSearch();","");
- window.triedToWriteMenus = false;
- window.SearchMenu.writeMenus();
- }
-
- \$fw_menus['c_view_menu'] = function()
- {
- // filtering menu
- \$Menus['c_filtring_menu'] = new Menu(lang_View);
- \$Menus['c_filtring_menu'].addMenuItem(lang_All,"config_val('Category_View', 127);",CategoryView==127);
- \$Menus['c_filtring_menu'].addMenuSeparator();
- \$Menus['c_filtring_menu'].addMenuItem(lang_Active,"FlipBit('Category_View',CategoryView,6);",BitStatus(CategoryView,6));
- \$Menus['c_filtring_menu'].addMenuItem(lang_Pending,"FlipBit('Category_View',CategoryView,5);", BitStatus(CategoryView,5));
- \$Menus['c_filtring_menu'].addMenuItem(lang_Disabled,"FlipBit('Category_View',CategoryView,4);",BitStatus(CategoryView,4));
- \$Menus['c_filtring_menu'].addMenuSeparator();
- \$Menus['c_filtring_menu'].addMenuItem(lang_New,"FlipBit('Category_View',CategoryView,3);",BitStatus(CategoryView,3));
- \$Menus['c_filtring_menu'].addMenuItem(lang_EdPick,"FlipBit('Category_View',CategoryView,0);",BitStatus(CategoryView,0));
-
- // sorting menu
- \$Menus['c_sorting_menu'] = new Menu(lang_Sort);
- \$Menus['c_sorting_menu'].addMenuItem(lang_Asc,"config_val('Category_Sortorder','asc');",RadioIsSelected(Category_Sortorder,'asc'));
- \$Menus['c_sorting_menu'].addMenuItem(lang_Desc,"config_val('Category_Sortorder','desc');",RadioIsSelected(Category_Sortorder,'desc'));
- \$Menus['c_sorting_menu'].addMenuSeparator();
- \$Menus['c_sorting_menu'].addMenuItem(lang_Default,"config_val('Category_Sortfield','Name');","");
- \$Menus['c_sorting_menu'].addMenuItem(lang_Name,"config_val('Category_Sortfield','Name');",RadioIsSelected(Category_Sortfield,'Name'));
- \$Menus['c_sorting_menu'].addMenuItem(lang_Description,"config_val('Category_Sortfield','Description');",RadioIsSelected(Category_Sortfield,'Description'));
- \$Menus['c_sorting_menu'].addMenuItem(lang_CreatedOn,"config_val('Category_Sortfield','CreatedOn');",RadioIsSelected(Category_Sortfield,'CreatedOn'));
- \$Menus['c_sorting_menu'].addMenuItem(lang_SubCats,"config_val('Category_Sortfield','CachedDescendantCatsQty');",RadioIsSelected(Category_Sortfield,'CachedDescendantCatsQty'));
-
- // perpage menu
-
- // select menu
- \$Menus['c_select_menu'] = new Menu(lang_Select);
- \$Menus['c_select_menu'].addMenuItem(lang_All,"javascript:selectAllC('categories');","");
- \$Menus['c_select_menu'].addMenuItem(lang_Unselect,"javascript:unselectAll('categories');","");
- \$Menus['c_select_menu'].addMenuItem(lang_Invert,"javascript:invert('categories');","");
-
- // view menu
- \$Menus['c_view_menu'] = new Menu(lang_Categories);
- \$Menus['c_view_menu'].addMenuItem( \$Menus['c_filtring_menu'] );
- \$Menus['c_view_menu'].addMenuItem( \$Menus['c_sorting_menu'] );
- \$Menus['c_view_menu'].addMenuItem( \$Menus['c_select_menu'] );
- }
-
- function toggleMenu()
- {
- var \$ViewMenus = new Array();
-
- // prepare categories menu
- if (document.getElementById('categories').active)
- {
- \$fw_menus['c_view_menu']();
- \$ViewMenus.push('c');
- }
-
- if (activeTab)
- {
- var prefix_special = activeTab.getAttribute('PrefixSpecial');
- \$fw_menus[prefix_special+'_view_menu']();
- \$ViewMenus.push(prefix_special);
- }
-
- if(\$ViewMenus.length == 1)
- {
- prefix_special = \$ViewMenus[\$ViewMenus.length-1];
- window.cat_menu = \$Menus[prefix_special+'_view_menu'];
- }
- else
- {
- window.cat_menu = new Menu('ViewMenu_mixed');
-
- // merge menus into new one
- for(var i in \$ViewMenus)
- {
- prefix_special = \$ViewMenus[i];
- window.cat_menu.addMenuItem( \$Menus[prefix_special+'_view_menu'] );
- }
- }
-
- window.triedToWriteMenus = false;
- window.cat_menu.writeMenus();
- }
-
-function toggleCategoriesA(tabHeader, instant)
-{
- var categories = document.getElementById('categories');
- if (!categories) return;
- toggleCategories(instant);
-
- tabHeader.setAttribute("background", '$imagesURL'+'/itemtabs/' + ((categories.active) ? "tab_active" : "tab_inactive") + ".gif")
- var images = tabHeader.getElementsByTagName("IMG");
- if (images.length < 1) return;
- images[0].src = '$imagesURL'+'/itemtabs/' + ((categories.active) ? "divider_up" : "divider_dn") + ".gif";
-}
-
-function toggleCategoriesB(tabHeader, instant)
-{
- var categories = document.getElementById('categories');
- if (!categories) return;
- toggleCategories(instant);
- var active_str = '$imagesURL'+'/itemtabs/' + (categories.active ? 'tab_active' : 'tab_inactive');
- SetBackground('l_cat', active_str + '_l.gif');
- SetBackground('m_cat', active_str + '.gif');
- SetBackground('m1_cat', active_str + '.gif');
- SetBackground('r_cat', active_str + '_r.gif');
-
- var images = tabHeader.getElementsByTagName("IMG");
- if (images.length < 1) return;
- images[0].src = '$imagesURL'+'/itemtabs/' + ((categories.active) ? "divider_up" : "divider_dn") + ".gif";
-}
-
-function toggleTabA(tabId, atm)
-{
- var hl = document.getElementById("hidden_line");
- var activeTabId;
-
-
- if (activeTab) activeTabId = activeTab.id;
- if (activeTabId == tabId)
- {
- var devider = document.getElementById("tabsDevider");
- devider.style.display = "";
-
- unselectAll(tabId);
- var tab = document.getElementById(tabId);
- tab.active = false;
- activeTab = null;
- collapseTab = tab;
- toolbar.setTab(null);
- showTab();
- }
-
- else
- {
- if (activeTab) toggleTab(tabId, true)
- else toggleTab(tabId, atm)
-
- if (hl) hl.style.display = "none";
- }
- tab_hdr = document.getElementById('tab_headers');
- if (!tab_hdr) return;
- for (var i = 0; i < tabIDs.length; i++)
- {
- var tabHeader;
- TDs = tab_hdr.getElementsByTagName("TD");
- for (var j = 0; j < TDs.length; j++)
- if (TDs[j].getAttribute("tabHeaderOf") == tabIDs[i])
- {
- tabHeader = TDs[j];
- break;
- }
- if (!tabHeader) continue;
-
- var tab = document.getElementById(tabIDs[i]);
- if (!tab) continue;
-
- tabHeader.setAttribute("background", "$imagesURL/itemtabs/" + ((tab.active) ? "tab_active" : "tab_inactive") + ".gif")
-
- var images = tabHeader.getElementsByTagName("IMG");
- if (images.length < 1) continue;
-
- images[0].src = "$imagesURL/itemtabs/" + ((tab.active) ? "divider_up" : "divider_dn") + ".gif";
- }
-}
-
- function toggleTabB(tabId, atm)
- {
- var hl = document.getElementById("hidden_line");
- var activeTabId;
-
- if (activeTab) activeTabId = activeTab.id;
- if (activeTabId == tabId)
- {
- var devider = document.getElementById("tabsDevider");
- devider.style.display = "";
-
- unselectAll(tabId);
- var tab = document.getElementById(tabId);
- tab.active = false;
- activeTab = null;
- collapseTab = tab;
- toolbar.setTab(null);
- showTab();
- }
- else
- {
- if (activeTab)
- toggleTab(tabId, true)
- else
- toggleTab(tabId, atm)
- if (hl) hl.style.display = "none";
- }
- tab_hdr = document.getElementById('tab_headers');
- if (!tab_hdr) return;
-
- // process all module tabs
- var active_str = '';
- for(var i = 0; i < tabIDs.length; i++)
- {
- var tabHeader;
- TDs = tab_hdr.getElementsByTagName("TD");
- for (var j = 0; j < TDs.length; j++)
- if (TDs[j].getAttribute("tabHeaderOf") == tabIDs[i])
- {
- tabHeader = TDs[j];
- break;
- }
- if (!tabHeader) continue;
-
- var tab = document.getElementById(tabIDs[i]);
- if (!tab) continue;
- active_str = (tab.active) ? "tab_active" : "tab_inactive";
-
- if (TDs[j].getAttribute("tabHeaderOf") == tabId) {
- // module tab is selected
- SetBackground('l_' + tabId, "$imagesURL/itemtabs/" + active_str + "_l.gif");
- SetBackground('m_' + tabId, "$imagesURL/itemtabs/" + active_str + ".gif");
- SetBackground('m1_' + tabId, "$imagesURL/itemtabs/" + active_str + ".gif");
- SetBackground('r_' + tabId, "$imagesURL/itemtabs/" + active_str + "_r.gif");
- }
- else
- {
- // module tab is not selected
- SetBackground('l_' +tabIDs[i], "$imagesURL/itemtabs/" + active_str + "_l.gif");
- SetBackground('m_' + tabIDs[i], "$imagesURL/itemtabs/" + active_str + ".gif");
- SetBackground('m1_' + tabIDs[i], "$imagesURL/itemtabs/" + active_str + ".gif");
- SetBackground('r_' + tabIDs[i], "$imagesURL/itemtabs/" + active_str + "_r.gif");
- }
-
- var images = tabHeader.getElementsByTagName("IMG");
- if (images.length < 1) continue;
-
- images[0].src = "$imagesURL/itemtabs/" + ((tab.active) ? "divider_up" : "divider_dn") + ".gif";
- }
- }
-
- function SetBackground(element_id, img_url)
- {
- // set background image of element specified by id
- var el = document.getElementById(element_id);
- el.style.backgroundImage = 'url('+img_url+')';
- }
-</script>
-
-END;
-?>
Property changes on: trunk/kernel/admin/include/toolbar/browse.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.18
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/kernel/units/categories/categories_tag_processor.php
===================================================================
--- trunk/kernel/units/categories/categories_tag_processor.php (revision 6427)
+++ trunk/kernel/units/categories/categories_tag_processor.php (revision 6428)
@@ -1,485 +1,487 @@
<?php
class CategoriesTagProcessor extends kDBTagProcessor {
function SubCatCount($params)
{
$cat_object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
$sql = ' SELECT COUNT(*) - 1
FROM '.$cat_object->TableName.'
WHERE ParentPath LIKE "'.$cat_object->GetDBField('ParentPath').'%"';
if (isset($params['today'])) {
$sql .= ' AND CreatedOn > '.(adodb_mktime()-86400);
}
return $this->Conn->GetOne($sql);
}
function IsNew($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
$ret = $object->GetDBField('IsNew') ? 1 : 0;
return $ret;
}
function IsPick($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
$ret = $object->GetDBField('EditorsPick') ? 1 : 0;
return $ret;
}
function ItemIcon($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
$status = $object->GetDBField('Status');
if($status == 1)
{
$ret = $object->GetDBField('IsNew') ? 'icon16_cat_new.gif' : 'icon16_cat.gif';
}
else
{
$ret = $status ? 'icon16_cat_pending.gif' : 'icon16_cat_disabled.gif';
}
return $ret;
}
function ItemCount($params)
{
$cat_object =& $this->getObject($params);
$ci_table = $this->Application->getUnitOption('l-ci', 'TableName');
$sql = ' SELECT COUNT(*)
FROM '.$cat_object->TableName.' c
LEFT JOIN '.$ci_table.' ci
ON c.CategoryId=ci.CategoryId
WHERE c.ParentPath LIKE "'.$cat_object->GetDBField('ParentPath').'%"
AND NOT (ci.CategoryId IS NULL)';
return $this->Conn->GetOne($sql);
}
function ListCategories($params)
{
return $this->PrintList2($params);
}
function RootCategoryName($params)
{
return $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params);
}
function CheckModuleRoot($params)
{
$module_name = getArrayValue($params, 'module') ? $params['module'] : 'In-Commerce';
$module =& $this->Application->recallObject('mod.'.$module_name);
$module_root_cat = $module->GetDBField('RootCat');
$additional_cats = $this->SelectParam($params, 'add_cats');
if ($additional_cats) {
$additional_cats = explode(',', $additional_cats);
}
else {
$additional_cats = array();
}
if ($this->Application->GetVar('m_cat_id') == $module_root_cat || in_array($this->Application->GetVar('m_cat_id'), $additional_cats)) {
$home_template = getArrayValue($params, 'home_template');
if (!$home_template) return;
$this->Application->Redirect($home_template, Array('pass'=>'all'));
};
}
function CategoryPath($params)
{
$module_name = getArrayValue($params, 'module') ? $params['module'] : 'In-Commerce';
$module_category_id = $this->Application->findModule('Name', $module_name, 'RootCat');
$module_item_id = $this->Application->GetVar($this->Application->findModule('Name', $module_name, 'Var').'_id');
$block_params['separator'] = $params['separator'];
if (!isset($params['cat_id'])) {
$params['cat_id'] = getArrayValue($params, 'cat_id') ? $params['cat_id'] : $this->Application->GetVar('m_cat_id');
}
if ($params['cat_id'] == 0) {
$block_params['current'] = 1;
$block_params['cat_id'] = 0;
$block_params['cat_name'] = $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params);
$block_params['name'] = $this->SelectParam($params, 'root_cat_render_as,block_root_cat,rootcatblock,render_as');
return $this->Application->ParseBlock($block_params);
}
else {
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$navbar_field = $ml_formatter->LangFieldName('CachedNavBar');
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($this->Prefix, 'TableName');
$sql = 'SELECT '.$navbar_field.', ParentPath
FROM '.$table_name.'
WHERE '.$id_field.' = '.$params['cat_id'];
$category_data = $this->Conn->GetRow($sql);
$ret = '';
if ($category_data) {
$category_names = explode('&|&', $category_data[$navbar_field]);
$category_ids = explode('|', substr($category_data['ParentPath'], 1, -1));
// add "Home" category at beginning of path
array_unshift($category_names, $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params));
array_unshift($category_ids, 0);
foreach ($category_ids as $category_pos => $category_id) {
$block_params['cat_id'] = $category_id;
$block_params['cat_name'] = $category_names[$category_pos];
$block_params['current'] = ($params['cat_id'] == $category_id) && !$module_item_id ? 1 : 0;
$block_params['is_module_root'] = $category_id == $module_category_id ? 1 : 0;
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
// which block to parse as current ?
if ($category_id == 0) {
$block_params['name'] = $this->SelectParam($params, 'root_cat_render_as,block_root_cat,rootcatblock,render_as,block');
}
if ($block_params['is_module_root'] == 1) { // module root
$block_params['name'] = $this->SelectParam($params, 'module_root_render_as,block_module_root,rootmoduleblock,render_as,block');
}
if ($block_params['current'] == 1) { // current cat (label)
$block_params['name'] = $this->SelectParam($params, 'current_render_as,block_current,currentblock,render_as,block');
}
$this->Application->SetVar($this->Prefix.'_id', $category_id);
$ret .= $this->Application->ParseBlock($block_params, 1);
}
}
return $ret;
}
}
function CurrentCategoryName($params)
{
$cat_object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix.'_List');
$sql = 'SELECT '.$this->getTitleField().'
FROM '.$cat_object->TableName.'
WHERE CategoryId = '.$this->Application->GetVar('m_cat_id');
return $this->Conn->GetOne($sql);
}
function getTitleField()
{
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
return $ml_formatter->LangFieldName('Name');
}
function CategoryLink($params)
{
// 'p_id'=>'0', ??
$params = array_merge(array('pass'=>'m'), $params);
$cat_id = getArrayValue($params,'cat_id');
if ($cat_id === false) {
// $cat_id = $this->Application->Parser->GetParam('cat_id');
$cat_id = $this->Application->GetVar($this->getPrefixSpecial().'_id');
}
if($cat_id == 'Root')
{
$object =& $this->Application->recallObject('mod.'.$params['module']);
$params['m_cat_id'] = $object->GetDBField('RootCat');
unset($params['module']);
}
else{
$params['m_cat_id'] = $cat_id;
}
unset($params['cat_id']);
+ $params['pass_category'] = 1;
+
$main_processor =& $this->Application->recallObject('m_TagProcessor');
return $main_processor->T($params);
}
function CategoryList($params)
{
//$object =& $this->Application->recallObject( $this->getPrefixSpecial() , $this->Prefix.'_List', $params );
$object =& $this->GetList($params);
if ($object->RecordsCount == 0)
{
if (isset($params['block_no_cats'])) {
$params['name'] = $params['block_no_cats'];
return $this->Application->ParseBlock($params);
}
else {
return '';
}
}
if (isset($params['block'])) {
return $this->PrintList($params);
}
else {
$params['block'] = $params['block_main'];
if (isset($params['block_row_start'])) {
$params['row_start_block'] = $params['block_row_start'];
}
if (isset($params['block_row_end'])) {
$params['row_end_block'] = $params['block_row_end'];
}
return $this->PrintList2($params);
}
}
function Meta($params)
{
$name = getArrayValue($params, 'name');
$object =& $this->Application->recallObject($this->Prefix.'.-item');
$field = $object->GetField('Meta'.$name);
if ($field) return $field;
switch ($name) {
case 'Description':
$conf = 'Category_MetaDesc';
break;
case 'Keywords':
$conf = 'Category_MetaKey';
break;
}
return $this->Application->ConfigValue($conf);
}
function BuildListSpecial($params)
{
if ( isset($params['parent_cat_id']) ) {
$parent_cat_id = $params['parent_cat_id'];
}
else {
$parent_cat_id = $this->Application->GetVar($this->Prefix.'_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
if (!$parent_cat_id) {
$parent_cat_id = 0;
}
}
$types = $this->SelectParam($params, 'types');
$except = $this->SelectParam($params, 'except');
$no_special = isset($params['no_special']) && $params['no_special'];
if ($no_special) return $this->Special;
if ($types.$except.$parent_cat_id == '') {
return parent::BuildListSpecial($params);
}
$special = crc32($types.$except.$parent_cat_id);
return $special;
}
function IsCurrent($params)
{
return false;
}
/**
* Substitutes category in last template base on current category
*
* @param Array $params
*/
function UpdateLastTemplate($params)
{
$category_id = $this->Application->GetVar('m_cat_id');
list($index_file, $env) = explode('|', $this->Application->RecallVar('last_template'), 2);
$this->Application->SetVar(ENV_VAR_NAME, str_replace('%5C', '\\', $env));
$this->Application->HttpQuery->processQueryString();
// update required fields
$this->Application->SetVar('m_cat_id', $category_id);
$this->Application->Session->SaveLastTemplate($params['template']);
}
function GetParentCategory($params)
{
$parent_id = 0;
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$table = $this->Application->getUnitOption($this->Prefix,'TableName');
$cat_id = $this->Application->GetVar('m_cat_id');
if ($cat_id > 0) {
$sql = 'SELECT ParentId
FROM '.$table.'
WHERE '.$id_field.' = '.$cat_id;
$parent_id = $this->Conn->GetOne($sql);
}
return $parent_id;
}
function InitCacheUpdater($params)
{
safeDefine('CACHE_PERM_CHUNK_SIZE', 30);
$continue = $this->Application->GetVar('continue');
$total_cats = (int) $this->Conn->GetOne('SELECT COUNT(*) FROM '.TABLE_PREFIX.'Category');
if ($continue === false && $total_cats > CACHE_PERM_CHUNK_SIZE) {
// first step, if category count > CACHE_PERM_CHUNK_SIZE, then ask for cache update
return true;
}
if ($continue === false) {
// if we don't have to ask, then assume user selected "Yes" in permcache update dialog
$continue = 1;
}
$updater =& $this->Application->recallObject('kPermCacheUpdater', null, Array('continue' => $continue));
if ($continue === '0') { // No in dialog
$updater->clearData();
$this->Application->Redirect($params['destination_template']);
}
$ret = false; // don't ask for update
if ($continue == 1) { // Initial run
$updater->setData();
}
if ($continue == 2) { // Continuing
// called from AJAX request => returns percent
$needs_more = true;
while ($needs_more && $updater->iteration <= CACHE_PERM_CHUNK_SIZE) {
// until proceeeded in this step category count exceeds category per step limit
$needs_more = $updater->DoTheJob();
}
if ($needs_more) {
// still some categories are left for next step
$updater->setData();
}
else {
// all done -> redirect
$updater->clearData();
$this->Application->RemoveVar('PermCache_UpdateRequired');
$this->Application->Redirect($params['destination_template']);
}
$ret = $updater->getDonePercent();
}
return $ret;
}
function SaveWarning($params)
{
$main_prefix = getArrayValue($params, 'main_prefix');
if ($main_prefix && $main_prefix != '$main_prefix') {
$top_prefix = $main_prefix;
}
else {
$top_prefix = $this->Application->GetTopmostPrefix($this->Prefix);
}
$temp_tables = $this->Application->GetVar($top_prefix.'_mode') == 't';
$modified = $this->Application->RecallVar($top_prefix.'_modified');
if (!$temp_tables) {
$this->Application->RemoveVar($top_prefix.'_modified');
return '';
}
$block_name = $this->SelectParam($params, 'render_as,name');
if ($block_name) {
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $block_name;
$block_params['edit_mode'] = $temp_tables ? 1 : 0;
$block_params['display'] = $temp_tables && $modified ? 1 : 0;
return $this->Application->ParseBlock($block_params);
}
else {
return $temp_tables && $modified ? 1 : 0;
}
return ;
}
/**
* Allows to detect if this prefix has something in clipboard
*
* @param Array $params
* @return bool
*/
function HasClipboard($params)
{
$clipboard = $this->Application->RecallVar('clipboard');
if ($clipboard) {
$clipboard = unserialize($clipboard);
foreach ($clipboard as $prefix => $clipboard_data) {
foreach ($clipboard_data as $mode => $ids) {
if (count($ids)) return 1;
}
}
}
return 0;
}
/**
* Allows to detect if root category being edited
*
* @param Array $params
*/
function IsRootCategory($params)
{
$object =& $this->getObject($params);
return $object->IsRoot();
}
function CatalogItemCount($params)
{
$object =& $this->GetList($params);
if (!$object->Counted) {
$object->CountRecs();
}
return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' / '.$object->NoFilterCount : $object->RecordsCount;
}
/**
* Print grid pagination using
* block names specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintPages($params)
{
if ($this->Application->Parser->GetParam('no_special')) {
$params['no_special'] = $this->Application->Parser->GetParam('no_special');
}
return parent::PrintPages($params);
}
function InitCatalog($params)
{
$tab_prefixes = $this->Application->GetVar('tp'); // {all, <prefixes_list>, none}
if ($tab_prefixes === false) $tab_prefixes = 'all';
$skip_prefixes = isset($params['skip_prefixes']) && $params['skip_prefixes'] ? explode(',', $params['skip_prefixes']) : Array();
// get all prefixes available
$prefixes = Array();
foreach ($this->Application->ModuleInfo as $module_name => $module_data) {
if ($module_data['Var'] == 'm') continue;
$prefixes[] = $module_data['Var'];
}
if ($tab_prefixes == 'none') {
$skip_prefixes = array_unique(array_merge($skip_prefixes, $prefixes));
}
elseif ($tab_prefixes != 'all') {
// prefix list here
$tab_prefixes = explode(',', $tab_prefixes); // list of prefixes that should stay
$skip_prefixes = array_unique(array_merge($skip_prefixes, array_diff($prefixes, $tab_prefixes)));
}
$params['name'] = $params['render_as'];
$params['skip_prefixes'] = implode(',', $skip_prefixes);
return $this->Application->ParseBlock($params, 1);
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/categories/categories_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.29
\ No newline at end of property
+1.30
\ No newline at end of property
Index: trunk/kernel/units/admin/admin_config.php
===================================================================
--- trunk/kernel/units/admin/admin_config.php (revision 6427)
+++ trunk/kernel/units/admin/admin_config.php (revision 6428)
@@ -1,201 +1,205 @@
<?php
$config = Array(
'Prefix' => 'adm',
'EventHandlerClass' => Array('class' => 'AdminEventsHandler', 'file' => 'admin_events_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array('class' => 'AdminTagProcessor', 'file' => 'admin_tag_processor.php', 'build_event' => 'OnBuild'),
'TitlePresets' => Array(
'tree_root' => Array('format' => '!la_section_overview!'),
'tree_reports' => Array('format' => '!la_section_overview!'),
'tree_system' => Array('format' => '!la_section_overview!'),
'tree_tools' => Array('format' => '!la_section_overview!'),
'system_tools' => Array('format' => '!la_section_system!'),
'no_permissions' => Array('format' => '!la_title_NoPermissions!'),
),
'Sections' => Array(
'in-portal:root' => Array(
'parent' => null,
'icon' => 'site',
'label' => $this->Application->ConfigValue('Site_Name'),
'url' => Array('t' => 'sections_list', 'pass' => 'm', 'pass_section' => true, 'no_amp' => 1),
'permissions' => Array('advanced:admin_login', 'advanced:front_login'),
'priority' => 0,
'type' => stTREE,
),
// "Summary & Logs" section
'in-portal:reports' => Array(
'parent' => 'in-portal:root',
'icon' => 'summary_logs',
'label' => 'la_tab_Reports',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:log_summary' => Array(
'parent' => 'in-portal:reports',
'icon' => 'summary',
'label' => 'la_tab_Summary',
'url' => Array('index_file' => 'logs/summary.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:searchlog' => Array(
'parent' => 'in-portal:reports',
'icon' => 'search_log',
'label' => 'la_tab_SearchLog',
'url' => Array('index_file' => 'logs/searchlog.php', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:sessionlog' => Array(
'parent' => 'in-portal:reports',
'icon' => 'sessions_log',
'label' => 'la_tab_SessionLog',
'url' => Array('index_file' => 'logs/session_list.php', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:emaillog' => Array(
'parent' => 'in-portal:reports',
'icon' => 'email_log',
'label' => 'la_tab_EmailLog',
'url' => Array('index_file' => 'logs/email_log.php', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:visits' => Array(
'parent' => 'in-portal:reports',
'icon' => 'visits',
'label' => 'la_tab_Visits',
'url' => Array('t' => 'visits/visits_list', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 5,
'type' => stTREE,
),
// "Configuration" section
'in-portal:system' => Array(
'parent' => 'in-portal:root',
'icon' => 'conf',
'label' => 'la_tab_Sys_Config',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:configure_general' => Array(
'parent' => 'in-portal:system',
'icon' => 'conf_general',
'label' => 'la_tab_General',
'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 1,
'type' => stTREE,
),
// "Tools" section
'in-portal:tools' => Array(
'parent' => 'in-portal:root',
'icon' => 'tools',
'label' => 'la_tab_Tools',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 6,
'type' => stTREE,
),
- /*'in-portal:service' => Array(
- 'parent' => 'in-portal:tools',
- 'icon' => 'conf_general',
- 'label' => 'la_tab_Service',
- 'url' => Array('t' => 'tools/system_tools', 'pass' => 'm'),
- 'permissions' => Array('view'),
- 'priority' => 10,
- 'type' => stTREE,
- ),*/
-
'in-portal:backup' => Array(
'parent' => 'in-portal:tools',
'icon' => 'tool_backup',
'label' => 'la_tab_Backup',
'url' => Array('index_file' => 'backup/backup1.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:restore' => Array(
'parent' => 'in-portal:tools',
'icon' => 'tool_restore',
'label' => 'la_tab_Restore',
'url' => Array('index_file' => 'backup/restore1.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:main_import' => Array(
'parent' => 'in-portal:tools',
'icon' => 'tool_import',
'label' => 'la_tab_ImportData',
'url' => Array('index_file' => 'import/step1.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:sql_query' => Array(
'parent' => 'in-portal:tools',
'icon' => 'tool_import',
'label' => 'la_tab_QueryDB',
'url' => Array('index_file' => 'tools/sql_query.php', 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:server_info' => Array(
'parent' => 'in-portal:tools',
'icon' => 'server_info',
'label' => 'la_tab_ServerInfo',
'url' => Array('index_file' => 'tools/server_info.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 6,
'type' => stTREE,
),
// "Help" section
'in-portal:help' => Array(
'parent' => 'in-portal:root',
'icon' => 'help',
'label' => 'la_tab_Help',
'url' => Array('index_file' => 'help/manual.pdf', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 7,
'type' => stTREE,
),
),
);
+
+ $application =& kApplication::Instance();
+ if ($application->isDebugMode()) {
+ $config['Sections']['in-portal:service'] = Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'conf_general',
+ 'label' => 'la_tab_Service',
+ 'url' => Array('t' => 'tools/system_tools', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 10,
+ 'type' => stTREE,
+ );
+ }
+
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/admin/admin_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.15
\ No newline at end of property
+1.16
\ No newline at end of property
Index: trunk/kernel/units/users/users_event_handler.php
===================================================================
--- trunk/kernel/units/users/users_event_handler.php (revision 6427)
+++ trunk/kernel/units/users/users_event_handler.php (revision 6428)
@@ -1,1033 +1,1035 @@
<?php
class UsersEventHandler extends InpDBEventHandler
{
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
// admin
'OnSetPersistantVariable' => Array('self' => 'view'), // because setting to logged in user only
// front
'OnRefreshForm' => Array('self' => true),
'OnForgotPassword' => Array('self' => true),
'OnResetPassword' => Array('self' => true),
'OnResetPasswordConfirmed' => Array('self' => true),
'OnSubscribeQuery' => Array('self' => true),
'OnSubscribeUser' => Array('self' => true),
'OnRecommend' => Array('self' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if ($event->Name == 'OnLogin' || $event->Name == 'OnLogout') {
// permission is checked in OnLogin event directly
return true;
}
if (!$this->Application->IsAdmin()) {
$user_id = $this->Application->GetVar('u_id');
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
if ($event->Name == 'OnCreate' && $user_id == -2) {
// "Guest" can create new users
return true;
}
if ($event->Name == 'OnUpdate' && $user_id > 0) {
$user_dummy =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true));
foreach ($items_info as $id => $field_values) {
if ($id != $user_id) {
// registered users can update their record only
return false;
}
$user_dummy->Load($id);
$status_field = array_shift($this->Application->getUnitOption($event->Prefix, 'StatusField'));
if ($user_dummy->GetDBField($status_field) != STATUS_ACTIVE) {
// not active user is not allowed to update his record (he could not activate himself manually)
return false;
}
if (isset($field_values[$status_field]) && $user_dummy->GetDBField($status_field) != $field_values[$status_field]) {
// user can't change status by himself
return false;
}
}
return true;
}
if ($event->Name == 'OnUpdate' && $user_id <= 0) {
// guests are not allowed to update their record, because they don't have it :)
return false;
}
}
return parent::CheckPermission($event);
}
function OnSessionExpire()
{
if( $this->Application->IsAdmin() ) {
$this->Application->Redirect('index', Array('expired' => 1), '', 'index.php');
}
else {
$http_query =& $this->Application->recallObject('HTTPQuery');
$get = $http_query->getRedirectParams();
$t = $this->Application->GetVar('t');
$get['js_redirect'] = $this->Application->ConfigValue('UseJSRedirect');
$this->Application->Redirect($t ? $t : 'index', $get);
}
}
/**
* Checks user data and logs it in if allowed
*
* @param kEvent $event
*/
function OnLogin(&$event)
{
$object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true));
$password = $this->Application->GetVar('password');
if(!$password)
{
$object->SetError('ValidateLogin', 'blank_password', 'lu_blank_password');
$event->status = erFAIL;
return false;
}
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
list($login_field, $submit_field) = $email_as_login && !$this->Application->IsAdmin() ? Array('Email', 'email') : Array('Login', 'login');
$login_value = $this->Application->GetVar($submit_field);
if ($this->Application->IsAdmin() && ($login_value == 'root')) {
// logging in "root" (admin only)
$root_password = $this->Application->ConfigValue('RootPass');
- if ($root_password != md5($password)) {
+ $password_formatter =& $this->Application->recallObject('kPasswordFormatter');
+ $test = $password_formatter->EncryptPassword($password, 'b38');
+ if ($root_password != $test) {
$object->SetError('ValidateLogin', 'invalid_password', 'lu_invalid_password');
$event->status = erFAIL;
return false;
}
elseif ($this->checkLoginPermission($login_value)) {
$user_id = -1;
$object->Load($user_id);
$object->SetDBField('Login', $login_value);
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', $user_id);
// $session->SetField('GroupList', implode(',', $groups) );
$this->Application->SetVar('u_id', $user_id);
$this->Application->StoreVar('user_id', $user_id);
$this->processLoginRedirect($event, $password);
return true;
}
else {
$object->SetError('ValidateLogin', 'invalid_license', 'la_invalid_license');
$event->status = erFAIL;
return false;
}
}
/*$sql = 'SELECT PortalUserId FROM '.$object->TableName.' WHERE (%s = %s) AND (Password = MD5(%s))';
$user_id = $this->Conn->GetOne( sprintf($sql, $login_field, $this->Conn->qstr($login_value), $this->Conn->qstr($password) ) );*/
$sql = 'SELECT PortalUserId FROM '.$object->TableName.' WHERE (Email = %1$s OR Login = %1$s) AND (Password = MD5(%2$s))';
$user_id = $this->Conn->GetOne( sprintf($sql, $this->Conn->qstr($login_value), $this->Conn->qstr($password) ) );
if ($user_id) {
$object->Load($user_id);
if ($object->GetDBField('Status') == STATUS_ACTIVE) {
$groups = $object->getMembershipGroups(true);
if(!$groups) $groups = Array();
array_push($groups, $this->Application->ConfigValue('User_LoggedInGroup') );
$this->Application->StoreVar( 'UserGroups', implode(',', $groups) );
if ($this->checkLoginPermission($login_value)) {
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', $user_id);
$session->SetField('GroupList', implode(',', $groups) );
$this->Application->SetVar('u_id', $user_id);
$this->Application->StoreVar('user_id', $user_id);
$this->Application->setVisitField('PortalUserId', $user_id);
$this_login = (int)$object->getPersistantVar('ThisLogin');
$object->setPersistantVar('LastLogin', $this_login);
$object->setPersistantVar('ThisLogin', adodb_mktime());
}
else {
$object->Load(-2);
$object->SetError('ValidateLogin', 'no_permission', 'lu_no_permissions');
$event->status = erFAIL;
}
$this->processLoginRedirect($event, $password);
}
else {
$event->redirect = $this->Application->GetVar('pending_disabled_template');
}
}
else
{
$object->SetID(-2);
$object->SetError('ValidateLogin', 'invalid_password', 'lu_invalid_password');
$event->status = erFAIL;
}
}
/**
* Enter description here...
*
* @param string $user_name
* @return bool
*/
function checkLoginPermission($user_name)
{
$ret = true;
if ($this->Application->IsAdmin()) {
$modules_helper =& $this->Application->recallObject('ModulesHelper');
if ($user_name != 'root') {
// root is virtual user, so allow him to login to admin in any case
$ret = $this->Application->CheckPermission('ADMIN', 1);
}
$ret = $ret && $modules_helper->checkLogin();
}
else {
$ret = $this->Application->CheckPermission('LOGIN', 1);
}
return $ret;
}
/**
* Process all required data and redirect logged-in user
*
* @param kEvent $event
*/
function processLoginRedirect(&$event, $password)
{
$object =& $event->getObject();
$next_template = $this->Application->GetVar('next_template');
if ($next_template == '_ses_redirect') {
$location = $this->Application->BaseURL().$this->Application->RecallVar($next_template);
if( $this->Application->isDebugMode() && constOn('DBG_REDIRECT') )
{
$this->Application->Debugger->appendTrace();
echo "<b>Debug output above!!!</b> Proceed to redirect: <a href=\"$location\">$location</a><br>";
}
else {
header('Location: '.$location);
}
$session =& $this->Application->recallObject('Session');
$session->SaveData();
exit;
}
if ($next_template) {
$event->redirect = $next_template;
}
if ($this->Application->ConfigValue('UseJSRedirect')) {
$event->SetRedirectParam('js_redirect', 1);
}
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LoginUser', $object->GetDBField('Login'), $password);
}
/**
* Called when user logs in using old in-portal
*
* @param kEvent $event
*/
function OnInpLogin(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LoginUser', $event->getEventParam('user'), $event->getEventParam('pass') );
if ($event->redirect && is_string($event->redirect)) {
// some real template specified instead of true
$this->Application->Redirect($event->redirect, $event->redirect_params);
}
}
/**
* Called when user logs in using old in-portal
*
* @param kEvent $event
*/
function OnInpLogout(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LogoutUser');
}
function OnLogout(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LogoutUser');
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', -2);
$this->Application->SetVar('u_id', -2);
$this->Application->StoreVar('user_id', -2);
$object =& $this->Application->recallObject('u');
$object->Load(-2);
$this->Application->DestroySession();
$group_list = $this->Application->ConfigValue('User_GuestGroup').','.$this->Application->ConfigValue('User_LoggedInGroup');
$session->SetField('GroupList', $group_list);
$this->Application->StoreVar('UserGroups', $group_list);
if ($this->Application->ConfigValue('UseJSRedirect')) {
$event->SetRedirectParam('js_redirect', 1);
}
}
/**
* Prefill states dropdown with correct values
*
* @param kEvent $event
* @access public
*/
function OnPrepareStates(&$event)
{
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$cs_helper->PopulateStates($event, 'State', 'Country');
$object =& $event->getObject();
if( $object->isRequired('Country') && $cs_helper->CountryHasStates( $object->GetDBField('Country') ) ) $object->setRequired('State', true);
$object->setLogin();
}
/**
* Redirects user after succesfull registration to confirmation template (on Front only)
*
* @param kEvent $event
*/
function OnAfterItemCreate(&$event)
{
$is_subscriber = $this->Application->GetVar('IsSubscriber');
if(!$is_subscriber)
{
$object =& $event->getObject();
$sql = 'UPDATE '.TABLE_PREFIX.'UserGroup
SET PrimaryGroup = 0
WHERE PortalUserId = '.$object->GetDBField('PortalUserId');
$this->Conn->Query($sql);
$group_id = $this->Application->ConfigValue('User_NewGroup');
$sql = 'REPLACE INTO '.TABLE_PREFIX.'UserGroup(PortalUserId,GroupId,PrimaryGroup) VALUES (%s,%s,1)';
$this->Conn->Query( sprintf($sql, $object->GetID(), $group_id) );
}
}
/**
* Login user if possible, if not then redirect to corresponding template
*
* @param kEvent $event
*/
function autoLoginUser(&$event)
{
$object =& $event->getObject();
$this->Application->SetVar('u_id', $object->GetID() );
if($object->GetDBField('Status') == STATUS_ACTIVE)
{
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
list($login_field, $submit_field) = $email_as_login ? Array('Email', 'email') : Array('Login', 'login');
$this->Application->SetVar($submit_field, $object->GetDBField($login_field) );
$this->Application->SetVar('password', $object->GetDBField('Password_plain') );
$event->CallSubEvent('OnLogin');
}
}
/**
* When creating user & user with such email exists then force to use OnUpdate insted of ?
*
* @param kEvent $event
*/
function OnSubstituteSubscriber(&$event)
{
$ret = false;
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
list($id, $field_values) = each($items_info);
$user_email = $field_values['Email'];
if($user_email)
{
// check if is subscriber
$verify_user =& $this->Application->recallObject('u.verify', null, Array('skup_autoload' => true) );
$verify_user->Load($user_email, 'Email');
if( $verify_user->isLoaded() && $verify_user->isSubscriberOnly() )
{
$items_info = Array( $verify_user->GetDBField('PortalUserId') => $field_values );
$this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
$ret = true;
}
}
}
if( isset($event->MasterEvent) )
{
$event->MasterEvent->setEventParam('is_subscriber_only', $ret);
}
else
{
$event->setEventParam('is_subscriber_only', $ret);
}
}
/**
* Enter description here...
*
* @param kEvent $event
* @return bool
*/
function isSubscriberOnly(&$event)
{
$event->CallSubEvent('OnSubstituteSubscriber');
$is_subscriber = false;
if( $event->getEventParam('is_subscriber_only') )
{
$is_subscriber = true;
$object =& $event->getObject( Array('skip_autoload' => true) );
$this->OnUpdate($event);
if($event->status == erSUCCESS)
{
$this->OnAfterItemCreate($event);
$object->SendEmailEvents();
if( !$this->Application->IsAdmin() && ($event->status == erSUCCESS) && $event->redirect) $this->autoLoginUser($event);
}
}
return $is_subscriber;
}
/**
* Creates new user
*
* @param kEvent $event
*/
function OnCreate(&$event)
{
if( !$this->Application->IsAdmin() ) $this->setUserStatus($event);
if( !$this->isSubscriberOnly($event) )
{
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$cs_helper->CheckStateField($event, 'State', 'Country');
parent::OnCreate($event);
$object =& $event->getObject( Array('skip_autoload' => true) );
$this->Application->SetVar('u_id', $object->getID() );
$this->setNextTemplate($event);
if( !$this->Application->IsAdmin() && ($event->status == erSUCCESS) && $event->redirect)
{
$object->SendEmailEvents();
$this->autoLoginUser($event);
}
}
}
/**
* Set's new user status based on config options
*
* @param kEvent $event
*/
function setUserStatus(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$new_users_allowed = $this->Application->ConfigValue('User_Allow_New');
// 1 - Instant, 2 - Not Allowed, 3 - Pending
switch ($new_users_allowed)
{
case 1: // Instant
$object->SetDBField('Status', 1);
$next_template = $this->Application->GetVar('registration_confirm_template');
if($next_template) $event->redirect = $next_template;
break;
case 3: // Pending
$next_template = $this->Application->GetVar('registration_confirm_pending_template');
if($next_template) $event->redirect = $next_template;
$object->SetDBField('Status', 2);
break;
case 2: // Not Allowed
$object->SetDBField('Status', 0);
break;
}
/*if ($object->GetDBField('PaidMember') == 1) {
$this->Application->HandleEvent($add_to_cart, 'ord:OnAddToCart');
$event->redirect = 'in-commerce/checkout/shop_cart';
} */
}
/**
* Set's new unique resource id to user
*
* @param kEvent $event
*/
function OnBeforeItemCreate(&$event)
{
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
$object =& $event->getObject();
if ($email_as_login) {
$object->Fields['Email']['error_msgs']['unique'] = $this->Application->Phrase('lu_user_and_email_already_exist');
}
}
/**
* Set's new unique resource id to user
*
* @param kEvent $event
*/
function OnAfterItemValidate(&$event)
{
$object =& $event->getObject();
$resource_id = $object->GetDBField('ResourceId');
if (!$resource_id)
{
$object->SetDBField('ResourceId', $this->Application->NextResourceId() );
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnRecommend(&$event){
$friend_email = $this->Application->GetVar('friend_email');
$friend_name = $this->Application->GetVar('friend_email');
if (preg_match("/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/", $friend_email))
{
$send_params = array();
$send_params['to_email']=$friend_email;
$send_params['to_name']=$friend_name;
$user_id = $this->Application->GetVar('u_id');
$email_event = &$this->Application->EmailEventUser('SITE.SUGGEST', $user_id, $send_params);
if ($email_event->status == erSUCCESS){
$event->redirect_params = array('opener' => 's', 'pass' => 'all');
$event->redirect = $this->Application->GetVar('template_success');
}
else {
// $event->redirect_params = array('opener' => 's', 'pass' => 'all');
// $event->redirect = $this->Application->GetVar('template_fail');
$object =& $this->Application->recallObject('u');
$object->ErrorMsgs['send_error'] = $this->Application->Phrase('lu_email_send_error');
$object->FieldErrors['Email']['pseudo'] = 'send_error';
$event->status = erFAIL;
}
}
else {
$object =& $this->Application->recallObject('u');
$object->ErrorMsgs['invalid_email'] = $this->Application->Phrase('lu_InvalidEmail');
$object->FieldErrors['Email']['pseudo'] = 'invalid_email';
$event->status = erFAIL;
}
}
/**
* Saves address changes and mades no redirect
*
* @param kEvent $event
*/
function OnUpdateAddress(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
list($id,$field_values) = each($items_info);
if($id > 0) $object->Load($id);
$object->SetFieldsFromHash($field_values);
$object->setID($id);
$object->Validate();
}
$event->redirect = false;
}
function OnSubscribeQuery(&$event){
$user_email = $this->Application->GetVar('subscriber_email');
if ( preg_match("/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/", $user_email) ){
$object = &$this->Application->recallObject($this->Prefix.'.subscriber', null, Array('skip_autoload' => true));
$this->Application->StoreVar('SubscriberEmail', $user_email);
if( $object->Load(array('Email'=>$user_email)) ){
$group_info = $this->GetGroupInfo($object->GetID());
if($group_info){
$event->redirect = $this->Application->GetVar('unsubscribe_template');
}
else {
$event->redirect = $this->Application->GetVar('subscribe_template');
}
}
else {
$event->redirect = $this->Application->GetVar('subscribe_template');
$this->Application->StoreVar('SubscriberEmail', $user_email);
}
}
else {
$object =& $this->Application->recallObject('u');
$object->ErrorMsgs['invalid_email'] = $this->Application->Phrase('lu_InvalidEmail');
$object->FieldErrors['SubscribeEmail']['pseudo'] = 'invalid_email';
$event->status = erFAIL;
}
//subscribe_query_ok_template
}
function OnSubscribeUser(&$event){
$object = &$this->Application->recallObject($this->Prefix.'.subscriber', Array('skip_autoload' => true));
$user_email = $this->Application->RecallVar('SubscriberEmail');
if (preg_match("/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/", $user_email)){
if($object->Load(array('Email'=>$user_email))){
$group_info = $this->GetGroupInfo($object->GetID());
if ($group_info){
if ($event->getEventParam('no_unsubscribe')) return;
if ($group_info['PrimaryGroup']){
// delete user
$object->Delete();
}
else {
$this->RemoveSubscriberGroup($object->GetID());
}
$event->redirect = $this->Application->GetVar('unsubscribe_ok_template');
}
else {
$this->AddSubscriberGroup($object->GetID(), 0);
$event->redirect = $this->Application->GetVar('subscribe_ok_template');
}
}
else {
$object->SetField('Email', $user_email);
$object->SetField('Login', $user_email);
$object->SetDBField('dob', 1);
$object->SetDBField('dob_date', 1);
$object->SetDBField('dob_time', 1);
$ip = getenv('HTTP_X_FORWARDED_FOR')?getenv('HTTP_X_FORWARDED_FOR'):getenv('REMOTE_ADDR');
$object->SetDBField('ip', $ip);
$this->Application->SetVar('IsSubscriber', 1);
if ($object->Create()) {
$this->AddSubscriberGroup($object->GetID(), 1);
$event->redirect = $this->Application->GetVar('subscribe_ok_template');
}
$this->Application->SetVar('IsSubscriber', 0);
}
}
else {
// error handling here
$event->redirect = $this->Application->GetVar('subscribe_fail_template');
}
}
function AddSubscriberGroup($user_id, $is_primary){
$group_id = $this->Application->ConfigValue('User_SubscriberGroup');
$sql = 'INSERT INTO '.TABLE_PREFIX.'UserGroup(PortalUserId,GroupId,PrimaryGroup) VALUES (%s,%s,'.$is_primary.')';
$this->Conn->Query( sprintf($sql, $user_id, $group_id) );
$this->Application->EmailEventAdmin('USER.SUBSCRIBE', $user_id);
$this->Application->EmailEventUser('USER.SUBSCRIBE', $user_id);
}
function RemoveSubscriberGroup($user_id){
$group_id = $this->Application->ConfigValue('User_SubscriberGroup');
$sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup WHERE PortalUserId='.$user_id.' AND GroupId='.$this->Application->ConfigValue('User_SubscriberGroup');
$this->Conn->Query($sql);
$this->Application->EmailEventAdmin('USER.UNSUBSCRIBE', $user_id);
$this->Application->EmailEventUser('USER.UNSUBSCRIBE', $user_id);
}
function GetGroupInfo($user_id){
$group_info = $this->Conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'UserGroup
WHERE PortalUserId='.$user_id.'
AND GroupId='.$this->Application->ConfigValue('User_SubscriberGroup'));
return $group_info;
}
function OnForgotPassword(&$event){
$user_object = &$this->Application->recallObject('u.forgot', null, Array('skip_autoload' => true));
$user_current_object = &$this->Application->recallObject('u');
$username = $this->Application->GetVar('username');
$email = $this->Application->GetVar('email');
$found = false;
$allow_reset = true;
if( strlen($username) )
{
if( $user_object->Load(array('Login'=>$username)) )
$found = ($user_object->GetDBField("Login")==$username && $user_object->GetDBField("Status")==1) && strlen($user_object->GetDBField("Password"));
}
else if( strlen($email) )
{
if( $user_object->Load(array('Email'=>$email)) )
$found = ($user_object->GetDBField("Email")==$email && $user_object->GetDBField("Status")==1) && strlen($user_object->GetDBField("Password"));
}
if( $user_object->isLoaded() )
{
$PwResetConfirm = $user_object->GetDBField('PwResetConfirm');
$PwRequestTime = $user_object->GetDBField('PwRequestTime');
$PassResetTime = $user_object->GetDBField('PassResetTime');
//$MinPwResetDelay = $user_object->GetDBField('MinPwResetDelay');
$MinPwResetDelay = $this->Application->ConfigValue('Users_AllowReset');
$allow_reset = (strlen($PwResetConfirm) ?
adodb_mktime() > $PwRequestTime + $MinPwResetDelay :
adodb_mktime() > $PassResetTime + $MinPwResetDelay);
}
if($found && $allow_reset)
{
$this->Application->StoreVar('tmp_user_id', $user_object->GetDBField("PortalUserId"));
$this->Application->StoreVar('tmp_email', $user_object->GetDBField("Email"));
$this->Application->EmailEventUser('INCOMMERCEUSER.PSWDC', $user_object->GetDBField("PortalUserId"));
$event->redirect = $this->Application->GetVar('template_success');
}
else
{
if(!strlen($username) && !strlen($email))
{
$user_current_object->ErrorMsgs['forgotpw_nodata'] = $this->Application->Phrase('lu_ferror_forgotpw_nodata');
$user_current_object->FieldErrors['Login']['pseudo'] = 'forgotpw_nodata';
$user_current_object->FieldErrors['Email']['pseudo'] = 'forgotpw_nodata';
}
else
{
if($allow_reset)
{
if( strlen($username) ){
$user_current_object->ErrorMsgs['unknown_username'] = $this->Application->Phrase('lu_ferror_unknown_username');
$user_current_object->FieldErrors['Login']['pseudo']='unknown_username';
}
if( strlen($email) ){
$user_current_object->ErrorMsgs['unknown_email'] = $this->Application->Phrase('lu_ferror_unknown_email');
$user_current_object->FieldErrors['Email']['pseudo']='unknown_email';
}
}
else
{
$user_current_object->ErrorMsgs['reset_denied'] = $this->Application->Phrase('lu_ferror_reset_denied');
if( strlen($username) ){
$user_current_object->FieldErrors['Login']['pseudo']='reset_denied';
}
if( strlen($email) ){
$user_current_object->FieldErrors['Email']['pseudo']='reset_denied';
}
}
}
if($user_current_object->FieldErrors){
$event->redirect = false;
}
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnResetPassword(&$event){
$user_object = &$this->Application->recallObject('u.forgot');
if($user_object->Load($this->Application->RecallVar('tmp_user_id'))){
$this->Application->EmailEventUser('INCOMMERCEUSER.PSWDC', $user_object->GetDBField("PortalUserId"));
$event->redirect = $this->Application->GetVar('template_success');
$mod_object =& $this->Application->recallObject('mod.'.'In-Commerce');
$m_cat_id = $mod_object->GetDBField('RootCat');
$event->SetRedirectParam('pass', 'm');
//$event->SetRedirectParam('m_cat_id', $m_cat_id);
$this->Application->SetVar('m_cat_id', $m_cat_id);
}
}
function OnResetPasswordConfirmed(&$event){
$passed_key = $this->Application->GetVar('user_key');
$user_object = &$this->Application->recallObject('u.forgot');
$user_current_object = &$this->Application->recallObject('u');
if (strlen(trim($passed_key)) == 0) {
$event->redirect_params = array('opener' => 's', 'pass' => 'all');
$event->redirect = false;
$user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
}
if($user_object->Load(array('PwResetConfirm'=>$passed_key)))
{
$exp_time = $user_object->GetDBField('PwRequestTime') + 3600;
$user_object->SetDBField("PwResetConfirm", '');
$user_object->SetDBField("PwRequestTime", 0);
if ( $exp_time > adodb_mktime() )
{
//$m_var_list_update['codevalidationresult'] = 'lu_resetpw_confirm_text';
$newpw = makepassword4();
$this->Application->StoreVar('password', $newpw);
$user_object->SetDBField("Password",$newpw);
$user_object->SetDBField("PassResetTime", adodb_mktime());
$user_object->SetDBField("PwResetConfirm", '');
$user_object->SetDBField("PwRequestTime", 0);
$user_object->Update();
$this->Application->SetVar('ForgottenPassword', $newpw);
$email_event_user = &$this->Application->EmailEventUser('INCOMMERCEUSER.PSWD', $user_object->GetDBField('PortalUserId'));
$email_event_admin = &$this->Application->EmailEventAdmin('INCOMMERCEUSER.PSWD');
$this->Application->DeleteVar('ForgottenPassword');
if ($email_event_user->status == erSUCCESS){
$event->redirect_params = array('opener' => 's', 'pass' => 'all');
$event->redirect = $this->Application->GetVar('template_success');
}
$user_object->SetDBField("Password",md5($newpw));
$user_object->Update();
} else {
$user_current_object->ErrorMsgs['code_expired'] = $this->Application->Phrase('lu_code_expired');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_expired';
$event->redirect = false;
}
} else {
$user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
$event->redirect = false;
}
}
function OnUpdate(&$event)
{
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$cs_helper->CheckStateField($event, 'State', 'Country');
parent::OnUpdate($event);
$this->setNextTemplate($event);
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function setNextTemplate(&$event)
{
if( !$this->Application->IsAdmin() )
{
$event->redirect_params['opener'] = 's';
$object =& $event->getObject();
if($object->GetDBField('Status') == STATUS_ACTIVE)
{
$next_template = $this->Application->GetVar('next_template');
if($next_template) $event->redirect = $next_template;
}
}
}
/**
* Delete users from groups if their membership is expired
*
* @param kEvent $event
*/
function OnCheckExpiredMembership(&$event)
{
// send pre-expiration reminders: begin
$pre_expiration = adodb_mktime() + $this->Application->ConfigValue('User_MembershipExpirationReminder') * 3600 * 24;
$sql = 'SELECT PortalUserId, GroupId
FROM '.TABLE_PREFIX.'UserGroup
WHERE (MembershipExpires IS NOT NULL) AND (ExpirationReminderSent = 0) AND (MembershipExpires < '.$pre_expiration.')';
$skip_clause = $event->getEventParam('skip_clause');
if ($skip_clause) {
$sql .= ' AND !('.implode(') AND !(', $skip_clause).')';
}
$records = $this->Conn->Query($sql);
if ($records) {
$conditions = Array();
foreach ($records as $record) {
$email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRATION.NOTICE', $record['PortalUserId']);
$email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRATION.NOTICE');
$conditions[] = '(PortalUserId = '.$record['PortalUserId'].' AND GroupId = '.$record['GroupId'].')';
}
$sql = 'UPDATE '.TABLE_PREFIX.'UserGroup
SET ExpirationReminderSent = 1
WHERE '.implode(' OR ', $conditions);
$this->Conn->Query($sql);
}
// send pre-expiration reminders: end
// remove users from groups with expired membership: begin
$sql = 'SELECT PortalUserId
FROM '.TABLE_PREFIX.'UserGroup
WHERE (MembershipExpires IS NOT NULL) AND (MembershipExpires < '.adodb_mktime().')';
$user_ids = $this->Conn->GetCol($sql);
if ($user_ids) {
foreach ($user_ids as $id) {
$email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRED', $id);
$email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRED');
}
}
$sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup
WHERE (MembershipExpires IS NOT NULL) AND (MembershipExpires < '.adodb_mktime().')';
$this->Conn->Query($sql);
// remove users from groups with expired membership: end
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnRefreshForm(&$event)
{
$event->redirect = false;
$item_info = $this->Application->GetVar($event->Prefix_Special);
list($id, $fields) = each($item_info);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->setID($id);
$object->IgnoreValidation = true;
$object->SetFieldsFromHash($fields);
}
/**
* Sets persistant variable
*
* @param kEvent $event
*/
function OnSetPersistantVariable(&$event)
{
$object =& $event->getObject();
$field = $this->Application->GetVar('field');
$value = $this->Application->GetVar('value');
$object->setPersistantVar($field, $value);
$force_tab = $this->Application->GetVar('SetTab');
if ($force_tab) {
$this->Application->StoreVar('force_tab', $force_tab);
}
}
/**
* Overwritten to return user from order by special .ord
*
* @param kEvent $event
*/
function getPassedId(&$event)
{
if ($event->Special == 'ord') {
$order =& $this->Application->recallObject('ord');
return $order->GetDBField('PortalUserId');
}
return parent::getPassedID($event);
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/users/users_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.64
\ No newline at end of property
+1.65
\ No newline at end of property
Index: trunk/kernel/units/configuration/configuration_event_handler.php
===================================================================
--- trunk/kernel/units/configuration/configuration_event_handler.php (revision 6427)
+++ trunk/kernel/units/configuration/configuration_event_handler.php (revision 6428)
@@ -1,191 +1,192 @@
<?php
class ConfigurationEventHandler extends InpDBEventHandler {
/**
* Changes permission section to one from REQUEST, not from config
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
$event->setEventParam('PermSection', $this->Application->GetVar('section'));
return parent::CheckPermission($event);
}
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @access protected
* @see OnListBuild
*/
function SetCustomQuery(&$event)
{
$object =& $event->getObject();
$module = $this->Application->GetVar('module');
$section = $this->Application->GetVar('section');
$object->addFilter('module_filter', '%1$s.ModuleOwner = '.$this->Conn->qstr($module));
$object->addFilter('section_filter', '%1$s.Section = '.$this->Conn->qstr($section));
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnBeforeItemUpdate(&$event)
{
$object =& $event->getObject();
// if password field is empty, then don't update
if ($object->GetDBField('element_type') == 'password') {
if (trim($object->GetDBField('VariableValue')) == '') {
$field_options = $object->GetFieldOptions('VariableValue');
$field_options['skip_empty'] = 1;
$object->SetFieldOptions('VariableValue', $field_options);
}else {
- $object->SetDBField('VariableValue', md5($object->GetDBField('VariableValue')));
+ $password_formatter =& $this->Application->recallObject('kPasswordFormatter');
+ $object->SetDBField('VariableValue', $password_formatter->EncryptPassword($object->GetDBField('VariableValue'), 'b38'));
}
}
$field_values = $this->Application->GetVar($event->getPrefixSpecial(true));
$state_country_hash = Array(
'Comm_State' => 'Comm_Country',
'Comm_Shipping_State' => 'Comm_Shipping_Country'
);
$field_name = $object->GetDBField('VariableName');
if (isset($state_country_hash[$field_name])) {
// if this is state field
$check_state = $object->GetDBField('VariableValue');
$check_country = $field_values[ $state_country_hash[$field_name] ]['VariableValue'];
if (!($check_country && $check_state)) {
return true;
}
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$state_iso = $cs_helper->CheckState($check_state, $check_country);
if ($state_iso !== false) {
$object->SetDBField('VariableValue', $state_iso);
}
else
{
$errormsgs = $this->Application->GetVar('errormsgs');
$errors = !$errormsgs || !isset($errormsgs[$event->Prefix_Special]) ? Array() : $errormsgs[$event->Prefix_Special];
$errors[$field_name] = 'la_InvalidState';
$errormsgs[$event->Prefix_Special] = $errors;
$this->Application->SetVar('errormsgs', $errormsgs);
$event->status = erFAIL;
}
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnAfterItemUpdate(&$event)
{
$object =& $event->getObject();
if ($object->GetDBField('element_type') == 'password') {
if (trim($object->GetDBField('VariableValue')) == '') {
$field_options = $object->GetFieldOptions('VariableValue');
unset($field_options['skip_empty']);
$object->SetFieldOptions('VariableValue', $field_options);
}
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnUpdate(&$event)
{
if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
// 1. save user selected module root category
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
$new_category_id = getArrayValue($items_info, 'ModuleRootCategory', 'VariableValue');
if ($new_category_id) {
unset($items_info['ModuleRootCategory']);
$this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
}
parent::OnUpdate($event);
if ($event->status == erSUCCESS && $new_category_id !== false) {
// root category was submitted
$module = $this->Application->GetVar('module');
$root_category_id = $this->Application->findModule('Name', $module, 'RootCat');
if ($root_category_id != $new_category_id) {
// root category differs from one in db
$fields_hash = Array('RootCat' => $new_category_id);
$this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Modules', 'Name = '.$this->Conn->qstr($module));
}
}
if ($event->status == erSUCCESS) { // reset cache
$this->Application->UnitConfigReader->ResetParsedData();
}
}
if ($this->Application->GetVar('errormsgs')) {
// because we have list out there, and this is item
$this->Application->removeObject($event->getPrefixSpecial());
$event->redirect = false;
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
/*function OnChangeCountry(&$event)
{
$event->setPseudoClass('_List');
$object = &$event->getObject( Array('per_page'=>-1) );
$object->Query();
$array_records =& $object->Records;
foreach($array_records as $i=>$record){
if ($record['VariableName']=='Comm_Country'){
$values = $this->Application->GetVar('conf');
$array_records[$i]['VariableValue'] = $values['Comm_Country']['VariableValue'];
}
}
$event->redirect_params = Array('opener' => 's', 'pass'=>'all,conf'); //stay!
$event->redirect = false;
}*/
-
+
/**
* Process items from selector (selected_ids var, key - prefix, value - comma separated ids)
*
* @param kEvent $event
*/
function OnProcessSelected(&$event)
{
$selected_ids = $this->Application->GetVar('selected_ids');
$this->Application->StoreVar('ModuleRootCategory', $selected_ids['c']);
$this->finalizePopup($event);
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/configuration/configuration_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.16
\ No newline at end of property
+1.17
\ No newline at end of property
Index: trunk/kernel/units/email_events/email_events_event_handler.php
===================================================================
--- trunk/kernel/units/email_events/email_events_event_handler.php (revision 6427)
+++ trunk/kernel/units/email_events/email_events_event_handler.php (revision 6428)
@@ -1,269 +1,271 @@
<?php
class EmailEventsEventsHandler extends InpDBEventHandler
{
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnFrontOnly' => Array('self' => 'edit'),
'OnSaveSelected' => Array('self' => 'view'),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Changes permission section to one from REQUEST, not from config
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
$module = $this->Application->GetVar('module');
$module = explode(':', $module, 2);
if (count($module) == 1) {
$main_prefix = $this->Application->findModule('Name', $module[0], 'Var');
}
else {
$exceptions = Array('Category' => 'c', 'Users' => 'u');
$main_prefix = $exceptions[ $module[1] ];
}
$section = $this->Application->getUnitOption($main_prefix.'.email', 'PermSection');
$event->setEventParam('PermSection', $section);
return parent::CheckPermission($event);
}
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @access protected
* @see OnListBuild
*/
function SetCustomQuery(&$event)
{
if ($event->Special == 'module') {
$object =& $event->getObject();
$module = $this->Application->GetVar('module');
$object->addFilter('module_filter', '%1$s.Module = '.$this->Conn->qstr($module));
}
}
/**
* Sets status Front-End Only to selected email events
*
* @param kEvent $event
*/
function OnFrontOnly(&$event)
{
$ids = implode(',', $this->StoreSelectedIDs($event));
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'UPDATE '.$table_name.'
SET Enabled = 2
WHERE EventId IN ('.$ids.')';
$this->Conn->Query($sql);
}
/**
* Sets selected user to email events selected
*
* @param kEvent $event
*/
function OnSelectUser(&$event)
{
$items_info = $this->Application->GetVar('u');
if ($items_info) {
$user_id = array_shift( array_keys($items_info) );
$ids = $this->Application->RecallVar($event->getPrefixSpecial().'_selected_ids');
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'UPDATE '.$table_name.'
SET '.$this->Application->RecallVar('dst_field').' = '.$user_id.'
WHERE '.$id_field.' IN ('.$ids.')';
$this->Conn->Query($sql);
}
$this->finalizePopup($event);
}
/**
* Saves selected ids to session
*
* @param kEvent $event
*/
function OnSaveSelected(&$event)
{
$this->StoreSelectedIDs($event);
}
/**
* Raised when email message shoul be sent
*
* @param kEvent $event
*/
function OnEmailEvent(&$event){
$email_event = $event->getEventParam('EmailEventName');
if( strpos($email_event, '_') !== false )
{
trigger_error('<span class="debug_error">Invalid email event name</span> <b>'.$email_event.'</b>. Use only <b>UPPERCASE characters</b> and <b>dots</b> as email event names', E_USER_ERROR);
}
$to_user_id = $event->getEventParam('EmailEventToUserId');
$email_event_type = $event->getEventParam('EmailEventType');
$message_object = &$this->Application->recallObject('emailmessages', null, Array('skip_autoload' => true));
$event_table = $this->Application->getUnitOption('emailevents', 'TableName');
- $event_object = &$event->getObject();
+ $event_object =& $event->getObject( Array('skip_autoload' => true) );
$event_object->Load(array('Event'=>$email_event, 'Type'=>$email_event_type));
$event_id = $event_object->GetDBField('EventId');
$from_user_id = $event_object->GetDBField('FromUserId');
$type = $event_object->GetDBField('Type');
$enabled = $event_object->GetDBField('Enabled');
$direct_send_params = $event->getEventParam('DirectSendParams');
if ($enabled == 0) return; // disabled event
if ($enabled == 2 && $this->Application->IsAdmin() ) return; // event only for front-end
if ($type == 1){
// For type "Admin" recipient is a user from field FromUserId which means From/To user in Email events list
$to_user_id = $from_user_id;
$from_user_id = -1;
}
/*
if (!($to_user_id > 0) && !$direct_send_params){
// if we can not determine recepient we will not send email
return;
}
*/
//Parse Message Template
$message_object->Load(array('EventId' => $event_id, 'LanguageId' => $this->Application->GetVar('m_lang')));
$message_type = $message_object->GetDBField('MessageType');
$email_object = &$this->Application->recallObject('kEmailMessage');
$email_object->Clear();
// add footer: begin
$sql = 'SELECT em.Template
FROM '.$message_object->TableName.' em
LEFT JOIN '.TABLE_PREFIX.'Events e ON e.EventId = em.EventId
WHERE em.LanguageId = '.$message_object->GetDBField('LanguageId').' AND e.Event = "COMMON.FOOTER"';
$footer = explode("\n\n", $this->Conn->GetOne($sql));
$footer = $message_object->GetDBField('MessageType') == 'text' ? $email_object->convertHTMLtoPlain($footer[1]) : $footer[1];
$message_template = $message_object->GetDBField('Template')."\r\n".$footer;
// add footer: end
- $from_user_object = &$this->Application->recallObject('u.-email'.$from_user_id, null, Array('skip_autoload' => true));
+ $from_user_object = &$this->Application->recallObject('u.email-from', null, Array('skip_autoload' => true));
$from_user_object->Load($from_user_id);
// here if we don't have from_user loaded, it takes a default user from config values
if ( $from_user_object->IsLoaded() ) {
$from_user_email = $from_user_object->GetDBField('Email');
$from_user_name = trim($from_user_object->GetDBField('FirstName').' '.$from_user_object->GetDBField('LastName'));
}
else {
$from_user_email = $this->Application->ConfigValue('Smtp_AdminMailFrom');
}
- $to_user_object = &$this->Application->recallObject('u.-email'.$to_user_id, null, Array('skip_autoload' => true));
+ $to_user_object = &$this->Application->recallObject('u.email-to', null, Array('skip_autoload' => true));
$to_user_object->Load($to_user_id);
$to_user_email = $to_user_object->GetDBField('Email');
$to_user_name = trim($to_user_object->GetDBField('FirstName').' '.$to_user_object->GetDBField('LastName'));
if($direct_send_params){
$to_user_email = ( $direct_send_params['to_email'] ? $direct_send_params['to_email'] : $to_user_email );
$to_user_name = ( $direct_send_params['to_name'] ? $direct_send_params['to_name'] : $to_user_name );
$from_user_email = ( $direct_send_params['from_email'] ? $direct_send_params['from_email'] : $from_user_email);
$from_user_name = ( $direct_send_params['from_name'] ? $direct_send_params['from_name'] : $from_user_name );
$message_body_additional = $direct_send_params['message'];
}
$to_user_email = $to_user_email ? $to_user_email : $this->Application->ConfigValue('Smtp_AdminMailFrom');
$this->Application->makeClass('Template');
$this->Application->InitParser();
$parser_params = $this->Application->Parser->Params;
$direct_send_params['message_text'] = $message_body_additional;
$this->Application->Parser->Params = array_merge_recursive2($this->Application->Parser->Params, $direct_send_params);
$message_template = str_replace('<inp:touser _Field', '<inp2:u_Field name', $message_template);
$message_template = $this->Application->Parser->Parse($message_template, 'email_template', 0);
$this->Application->Parser->Params = $parser_params;
$message_template = str_replace("\r", "", $message_template);
list($message_headers, $message_body) = explode("\n\n", $message_template, 2);
$email_object->setFrom($from_user_email, $from_user_name);
$email_object->setTo($to_user_email, $to_user_name);
$email_object->setSubject('Mail message');
$email_object->setHeaders($message_headers);
if ($message_type == 'html'){
$email_object->setHTMLBody($message_body);
}
else {
$email_object->setTextBody($message_body);
}
$smtp_object = &$this->Application->recallObject('kSmtpClient');
$smtp_object->debug = $this->Application->isDebugMode() && constOn('DBG_SMTP');
$smtp_server = $this->Application->ConfigValue('Smtp_Server');
$smtp_port = $this->Application->ConfigValue('Smtp_Port');
$smtp_authenticate = $this->Application->ConfigValue('Smtp_Authenticate');
if ($smtp_authenticate){
$smtp_user = $this->Application->ConfigValue('Smtp_User');
$smtp_pass = $this->Application->ConfigValue('Smtp_Pass');
}else{
$smtp_user = '';
$smtp_pass = '';
}
if ($smtp_server){
if ($email_object->sendSMTP($smtp_object, $smtp_server, $smtp_user, $smtp_pass, $smtp_authenticate)){
$event->status=erSUCCESS;
}
else {
$event->status=erFAIL;
}
}else{
if($email_object->send()){
$event->status=erSUCCESS;
}
else {
$event->status=erFAIL;
}
}
if ($event->status == erSUCCESS){
if (!$from_user_name) {
$from_user_name = strip_tags( $this->Application->ConfigValue('Site_Name') );
}
$sql = 'INSERT INTO '.TABLE_PREFIX.'EmailLog SET
fromuser = '.$this->Conn->qstr($from_user_name.' ('.$from_user_email.')').',
addressto = '.$this->Conn->qstr($to_user_name.' ('.$to_user_email.')').',
subject = '.$this->Conn->qstr($email_object->Subject).',
timestamp = UNIX_TIMESTAMP(),
event = '.$this->Conn->qstr($email_event);
$this->Conn->Query($sql);
}
+ $this->Application->removeObject('u.email-from');
+ $this->Application->removeObject('u.email-to');
return $event;
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/email_events/email_events_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.25
\ No newline at end of property
+1.26
\ No newline at end of property
Index: trunk/kernel/units/general/cat_tag_processor.php
===================================================================
--- trunk/kernel/units/general/cat_tag_processor.php (revision 6427)
+++ trunk/kernel/units/general/cat_tag_processor.php (revision 6428)
@@ -1,226 +1,236 @@
<?php
class kCatDBTagProcessor extends kDBTagProcessor {
/**
* Permission Helper
*
* @var kPermissionsHelper
*/
var $PermHelper = null;
function kCatDBTagProcessor()
{
parent::kDBTagProcessor();
$this->PermHelper = $this->Application->recallObject('PermissionsHelper');
}
function ItemIcon($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
$grids = $this->Application->getUnitOption($this->Prefix,'Grids');
$icons =& $grids[ $params['grid'] ]['Icons'];
$status_fields = $this->Application->getUnitOption($this->Prefix,'StatusField');
if (!$status_fields) return $icons['default'];
$value = $object->GetDBField($status_fields[0]); // sets base status icon
if ($value == STATUS_ACTIVE) {
if( $object->GetDBField('IsPop') ) $value = 'POP';
if( $object->GetDBField('IsHot') ) $value = 'HOT';
if( $object->GetDBField('IsNew') ) $value = 'NEW';
if( $object->GetDBField('EditorsPick') ) $value = 'PICK';
}
return isset($icons[$value]) ? $icons[$value] : $icons['default'];
}
- function ItemLink($params)
+ /**
+ * Allows to create valid mod-rewrite compatible link to module item
+ *
+ * @param Array $params
+ * @param string $id_prefix
+ * @return string
+ */
+ function ItemLink($params, $id_prefix)
{
- // 'p_id'=>'0', ??
- $params = array_merge($params, array('pass'=>'m,'.$this->Prefix));
- $item_id = getArrayValue($params,$this->Prefix.'_id');
+ $params = array_merge($params, Array('pass' => 'm,'.$this->Prefix) );
+
+ $item_id = isset($params[$id_prefix.'_id']) && $params[$id_prefix.'_id'];
if (!$item_id) {
- $item_id = $this->Application->GetVar($this->Prefix.'_id');
+ $item_id = $this->Application->GetVar($this->getPrefixSpecial().'_id');
+ if (!$item_id) {
+ $item_id = $this->Application->GetVar($this->Prefix.'_id');
+ }
}
$params[$this->Prefix.'_id'] = $item_id;
- $item =& $this->Application->recallObject($this->getPrefixSpecial());
- $params['m_cat_id'] = $item->GetDBField('CategoryId');
+ $object =& $this->getObject($params);
+ $params['m_cat_id'] = $object->GetDBField('CategoryId');
+ $params['pass_category'] = 1;
- $main_processor =& $this->Application->recallObject('m_TagProcessor');
- return $main_processor->T($params);
+ return $this->Application->ProcessParsedTag('m', 't', $params);
}
/**
* Returns path where exported category items should be saved
*
* @param Array $params
*/
function ExportPath($params)
{
$ret = EXPORT_PATH.'/';
if( getArrayValue($params, 'as_url') )
{
$ret = str_replace( FULL_PATH.'/', $this->Application->BaseURL(), $ret);
}
$export_options = unserialize($this->Application->RecallVar($this->getPrefixSpecial().'_options'));
$ret .= $export_options['ExportFilename'].'.'.($export_options['ExportFormat'] == 1 ? 'csv' : 'xml');
return $ret;
}
function CategoryPath($params)
{
if (!isset($params['cat_id'])) {
$params['cat_id'] = $this->Application->RecallVar($params['session_var'], 0);
}
return $this->Application->ProcessParsedTag('c', 'CategoryPath', $params);
}
function BuildListSpecial($params)
{
if ($this->Special != '') return $this->Special;
if ( isset($params['parent_cat_id']) ) {
$parent_cat_id = $params['parent_cat_id'];
}
else {
$parent_cat_id = $this->Application->GetVar('c_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
}
$recursive = isset($params['recursive']);
$types = $this->SelectParam($params, 'types');
$except = $this->SelectParam($params, 'except');
if ($types.$except.$recursive == '') {
return parent::BuildListSpecial($params);
}
$special = crc32($parent_cat_id.$types.$except.$recursive);
return $special;
}
function ExportStatus($params)
{
$export_object =& $this->Application->recallObject('CatItemExportHelper');
$event = new kEvent($this->getPrefixSpecial().':OnDummy');
$action_method = 'perform'.ucfirst($this->Special);
$field_values = $export_object->$action_method($event);
// finish code is done from JS now
if ($field_values['start_from'] == $field_values['total_records'])
{
if ($this->Special == 'import') {
$this->Application->StoreVar('PermCache_UpdateRequired', 1);
$this->Application->Redirect('categories/cache_updater', Array('m_opener' => 'r', 'pass' => 'm', 'continue' => 1, 'no_amp' => 1));
}
elseif ($this->Special == 'export') {
$template = $this->Application->getUnitOption($this->Prefix, 'ModuleFolder').'/'.$this->Special.'_finish';
$this->Application->Redirect($template, Array('pass' => 'all'));
}
}
$export_options = $export_object->loadOptions($event);
return $export_options['start_from'] * 100 / $export_options['total_records'];
}
function CatalogItemCount($params)
{
$object =& $this->GetList($params);
if (!$object->Counted) {
$object->CountRecs();
}
return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' / '.$object->NoFilterCount : $object->RecordsCount;
}
function ListReviews($params)
{
$prefix = $this->Prefix.'-rev';
$review_tag_processor =& $this->Application->recallObject($prefix.'.item_TagProcessor');
return $review_tag_processor->PrintList($params);
}
function ReviewCount($params)
{
$review_tag_processor =& $this->Application->recallObject('rev.item_TagProcessor');
return $review_tag_processor->TotalRecords($params);
}
function InitCatalogTab($params)
{
$tab_params['mode'] = $this->Application->GetVar('tm'); // single/multi selection possible
$tab_params['special'] = $this->Application->GetVar('ts'); // use special for this tab
$tab_params['dependant'] = $this->Application->GetVar('td'); // is grid dependant on categories grid
// set default params (same as in catalog)
if ($tab_params['mode'] === false) $tab_params['mode'] = 'multi';
if ($tab_params['special'] === false) $tab_params['special'] = '';
if ($tab_params['dependant'] === false) $tab_params['dependant'] = 'yes';
// pass params to block with tab content
$params['name'] = $params['render_as'];
$params['prefix'] = trim($this->Prefix.'.'.($tab_params['special'] ? $tab_params['special'] : $this->Special), '.');
$params['cat_prefix'] = trim('c.'.($tab_params['special'] ? $tab_params['special'] : $this->Special), '.');
$params['tab_mode'] = $tab_params['mode'];
$params['tab_dependant'] = $tab_params['dependant'];
$params['show_category'] = $tab_params['special'] == 'showall' ? 1 : 0; // this is advanced view -> show category name
return $this->Application->ParseBlock($params, 1);
}
/**
* Show CachedNavbar of current item primary category
*
* @param Array $params
* @return string
*/
function CategoryName($params)
{
// show category cachednavbar of
$object =& $this->getObject($params);
$category_id = isset($params['cat_id']) ? $params['cat_id'] : $object->GetDBField('CategoryId');
$category_path = $this->Application->getCache('category_paths', $category_id);
if ($category_path === false) {
// not chached
if ($category_id > 0) {
$category_path = trim($this->CategoryName( Array('cat_id' => 0) ).' > '.str_replace('&|&', ' > ', $object->GetDBField('CachedNavbar')), ' > ');
}
else {
$category_path = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') );
}
$this->Application->setCache('category_paths', $category_id, $category_path);
}
return $category_path;
}
/**
* Allows to determine if original value should be shown
*
* @param Array $params
* @return bool
*/
function DisplayOriginal($params)
{
// original id found & greather then zero + show original
$display_original = isset($params['display_original']) && $params['display_original'];
$object =& $this->getObject($params);
$perm_value = $this->PermHelper->ModifyCheckPermission($object->GetDBField('CreatedById'), $object->GetDBField('CategoryId'), $this->Prefix);
return $display_original && ($perm_value == 1) && $this->Application->GetVar($this->Prefix.'.original_id');
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/general/cat_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.12
\ No newline at end of property
+1.13
\ No newline at end of property
Index: trunk/kernel/units/general/cat_event_handler.php
===================================================================
--- trunk/kernel/units/general/cat_event_handler.php (revision 6427)
+++ trunk/kernel/units/general/cat_event_handler.php (revision 6428)
@@ -1,1893 +1,1916 @@
<?php
$application =& kApplication::Instance();
$application->Factory->includeClassFile('kDBEventHandler');
class kCatDBEventHandler extends InpDBEventHandler {
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnExport' => Array('self' => 'view|advanced:export'),
'OnExportBegin' => Array('self' => 'view|advanced:export'),
'OnSaveSettings' => Array('self' => 'add|edit|advanced:import'),
'OnBeforeDeleteOriginal' => Array('self' => 'edit|advanced:approve'),
'OnCancelAction' => Array( 'self' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if (!$this->Application->IsAdmin()) {
if ($event->Name == 'OnSetSortingDirect') {
// allow sorting on front event without view permission
return true;
}
}
if ($event->Name == 'OnExport') {
// save category_id before doing export
$this->Application->LinkVar('m_cat_id');
}
if ($event->Name == 'OnNew' && preg_match('/(.*)\/import$/', $this->Application->GetVar('t'), $rets)) {
// redirect to item import template, where permission (import) category will be chosen)
$root_category = $this->Application->findModule('Path', $rets[1].'/', 'RootCat');
$this->Application->StoreVar('m_cat_id', $root_category);
}
if ($event->Name == 'OnEdit' || $event->Name == 'OnSave') {
// check each id from selected individually and only if all are allowed proceed next
if ($event->Name == 'OnEdit') {
$selected_ids = implode(',', $this->StoreSelectedIDs($event));
}
else {
$selected_ids = $this->Application->RecallVar($event->getPrefixSpecial().'_selected_ids');
}
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'SELECT '.$id_field.', CreatedById, ci.CategoryId
FROM '.$table_name.' item_table
LEFT JOIN '.$this->Application->getUnitOption('ci', 'TableName').' ci ON ci.ItemResourceId = item_table.ResourceId
WHERE '.$id_field.' IN ('.$selected_ids.') AND (ci.PrimaryCat = 1)';
$items = $this->Conn->Query($sql, $id_field);
$perm_value = true;
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
foreach ($items as $item_id => $item_data) {
if ($perm_helper->ModifyCheckPermission($item_data['CreatedById'], $item_data['CategoryId'], $event->Prefix) == 0) {
// one of items selected has no permission
$perm_value = false;
break;
}
}
if (!$perm_value) {
$event->status = erPERM_FAIL;
}
return $perm_value;
}
return parent::CheckPermission($event);
}
/**
* Add selected items to clipboard with mode = COPY (CLONE)
*
* @param kEvent $event
*/
function OnCopy(&$event)
{
$this->Application->RemoveVar('clipboard');
$clipboard_helper =& $this->Application->recallObject('ClipboardHelper');
$clipboard_helper->setClipboard($event, 'copy', $this->StoreSelectedIDs($event));
}
/**
* Add selected items to clipboard with mode = CUT
*
* @param kEvent $event
*/
function OnCut(&$event)
{
$this->Application->RemoveVar('clipboard');
$clipboard_helper =& $this->Application->recallObject('ClipboardHelper');
$clipboard_helper->setClipboard($event, 'cut', $this->StoreSelectedIDs($event));
}
/**
* Performs category item paste
*
* @param kEvent $event
*/
function OnPaste(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$clipboard_data = $event->getEventParam('clipboard_data');
if (!$clipboard_data['cut'] && !$clipboard_data['copy']) {
return false;
}
if ($clipboard_data['copy']) {
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$temp->CloneItems($event->Prefix, $event->Special, $clipboard_data['copy']);
}
if ($clipboard_data['cut']) {
$object =& $this->Application->recallObject($event->getPrefixSpecial().'.item', $event->Prefix, Array('skip_autoload' => true));
foreach ($clipboard_data['cut'] as $id) {
$object->Load($id);
$object->MoveToCat();
}
}
}
/**
* Return type clauses for list bulding on front
*
* @param kEvent $event
* @return Array
*/
function getTypeClauses(&$event)
{
$types = $event->getEventParam('types');
$except_types = $event->getEventParam('except');
$type_clauses = Array();
$type_clauses['pick']['include'] = '%1$s.EditorsPick = 1 AND '.TABLE_PREFIX.'CategoryItems.PrimaryCat = 1';
$type_clauses['pick']['except'] = '%1$s.EditorsPick! = 1 AND '.TABLE_PREFIX.'CategoryItems.PrimaryCat = 1';
$type_clauses['pick']['having_filter'] = false;
$type_clauses['hot']['include'] = '`IsHot` = 1 AND PrimaryCat = 1';
$type_clauses['hot']['except'] = '`IsHot`! = 1 AND PrimaryCat = 1';
$type_clauses['hot']['having_filter'] = true;
$type_clauses['pop']['include'] = '`IsPop` = 1 AND PrimaryCat = 1';
$type_clauses['pop']['except'] = '`IsPop`! = 1 AND PrimaryCat = 1';
$type_clauses['pop']['having_filter'] = true;
$type_clauses['new']['include'] = '`IsNew` = 1 AND PrimaryCat = 1';
$type_clauses['new']['except'] = '`IsNew`! = 1 AND PrimaryCat = 1';
$type_clauses['new']['having_filter'] = true;
$type_clauses['displayed']['include'] = '';
$displayed = $this->Application->GetVar($event->Prefix.'_displayed_ids');
if ($displayed) {
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$type_clauses['displayed']['except'] = '%1$s.'.$id_field.' NOT IN ('.$displayed.')';
}
else {
$type_clauses['displayed']['except'] = '';
}
$type_clauses['displayed']['having_filter'] = false;
if (strpos($types, 'search') !== false || strpos($except_types, 'search') !== false) {
$event_mapping = Array(
'simple' => 'OnSimpleSearch',
'subsearch' => 'OnSubSearch',
'advanced' => 'OnAdvancedSearch');
if($this->Application->GetVar('INPORTAL_ON') && $this->Application->GetVar('Action') == 'm_simple_subsearch')
{
$type = 'subsearch';
}
else
{
$type = $this->Application->GetVar('search_type') ? $this->Application->GetVar('search_type') : 'simple';
}
if($keywords = $event->getEventParam('keyword_string')) // processing keyword_string param of ListProducts tag
{
$this->Application->SetVar('keywords', $keywords);
$type = 'simple';
}
$search_event = $event_mapping[$type];
$this->$search_event($event);
$search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$sql = 'SHOW TABLES LIKE "'.$search_table.'"';
if ( $this->Conn->Query($sql) ) {
$search_res_ids = $this->Conn->GetCol('SELECT ResourceId FROM '.$search_table);
}
if ($search_res_ids) {
$type_clauses['search']['include'] = '%1$s.ResourceId IN ('.implode(',', $search_res_ids).') AND PrimaryCat = 1';
$type_clauses['search']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $search_res_ids).') AND PrimaryCat = 1';
}
else {
$type_clauses['search']['include'] = '0';
$type_clauses['search']['except'] = '1';
}
$type_clauses['search']['having_filter'] = false;
}
if (strpos($types, 'related') !== false || strpos($except_types, 'related') !== false) {
$related_to = $event->getEventParam('related_to');
if (!$related_to) {
$related_prefix = $event->Prefix;
}
else {
$sql = 'SELECT Prefix
FROM '.TABLE_PREFIX.'ItemTypes
WHERE ItemName = '.$this->Conn->qstr($related_to);
$related_prefix = $this->Conn->GetOne($sql);
}
$rel_table = $this->Application->getUnitOption('rel', 'TableName');
$item_type = $this->Application->getUnitOption($event->Prefix, 'ItemType');
$p_item =& $this->Application->recallObject($related_prefix.'.current', null, Array('skip_autoload' => true));
$p_item->Load( $this->Application->GetVar($related_prefix.'_id') );
$p_resource_id = $p_item->GetDBField('ResourceId');
$sql = 'SELECT SourceId, TargetId FROM '.$rel_table.'
WHERE
(Enabled = 1)
AND (
(Type = 0 AND SourceId = '.$p_resource_id.' AND TargetType = '.$item_type.')
OR
(Type = 1
AND (
(SourceId = '.$p_resource_id.' AND TargetType = '.$item_type.')
OR
(TargetId = '.$p_resource_id.' AND SourceType = '.$item_type.')
)
)
)';
$related_ids_array = $this->Conn->Query($sql);
$related_ids = Array();
foreach ($related_ids_array as $key => $record) {
$related_ids[] = $record[ $record['SourceId'] == $p_resource_id ? 'TargetId' : 'SourceId' ];
}
if (count($related_ids) > 0) {
$type_clauses['related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_ids).') AND PrimaryCat = 1';
$type_clauses['related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_ids).') AND PrimaryCat = 1';
}
else {
$type_clauses['related']['include'] = '0';
$type_clauses['related']['except'] = '1';
}
$type_clauses['related']['having_filter'] = false;
}
return $type_clauses;
}
/**
* Apply filters to list
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
parent::SetCustomQuery($event);
$object =& $event->getObject();
// add category filter if needed
if ($event->Special != 'showall') {
if ( $event->getEventParam('parent_cat_id') ) {
$parent_cat_id = $event->getEventParam('parent_cat_id');
}
else {
$parent_cat_id = $this->Application->GetVar('c_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
if (!$parent_cat_id) {
$parent_cat_id = 0;
}
}
if ((string) $parent_cat_id != 'any') {
if ($event->getEventParam('recursive')) {
$current_path = $this->Conn->GetOne('SELECT ParentPath FROM '.TABLE_PREFIX.'Category WHERE CategoryId='.$parent_cat_id);
$subcats = $this->Conn->GetCol('SELECT CategoryId FROM '.TABLE_PREFIX.'Category WHERE ParentPath LIKE "'.$current_path.'%" ');
$object->addFilter('category_filter', TABLE_PREFIX.'CategoryItems.CategoryId IN ('.implode(', ', $subcats).')');
}
else {
$object->addFilter('category_filter', TABLE_PREFIX.'CategoryItems.CategoryId = '.$parent_cat_id );
}
}
}
else {
$object->addFilter('primary_filter', 'PrimaryCat = 1');
}
// add permission filter
if ($this->Application->GetVar('u_id') == -1) {
// for "root" CATEGORY.VIEW permission is checked for items lists too
$view_perm = 1;
}
else {
// for any real user itemlist view permission is checked instead of CATEGORY.VIEW
$sql = 'SELECT PermissionConfigId
FROM '.TABLE_PREFIX.'PermissionConfig
WHERE PermissionName = "'.$this->Application->getUnitOption($event->Prefix, 'PermItemPrefix').'.VIEW"';
$view_perm = $this->Conn->GetOne($sql);
$groups = explode( ',', $this->Application->RecallVar('UserGroups') );
foreach($groups as $group)
{
$view_filters[] = 'FIND_IN_SET('.$group.', perm.acl)';
}
$view_filter = implode(' OR ', $view_filters);
$object->addFilter('perm_filter2', $view_filter);
}
$object->addFilter('perm_filter', 'perm.PermId = '.$view_perm);
if ( !$this->Application->IsAdmin() )
{
$object->addFilter('status_filter', $object->TableName.'.Status = 1');
if ($this->Application->getUnitOption($event->Prefix, 'UsePendingEditing')) {
// if category item uses pending editing abilities, then in no cases show pending copies on front
$object->addFilter('original_filter', '%1$s.OrgId = 0 OR %1$s.OrgId IS NULL');
}
}
else {
if ($this->Application->getUnitOption($event->Prefix, 'UsePendingEditing')) {
$pending_ids = $this->Conn->GetCol(
'SELECT OrgId FROM '.$object->TableName.'
WHERE Status = -2 AND OrgId IS NOT NULL');
if ($pending_ids) {
$object->addFilter('no_original_filter', '%1$s.'.$object->IDField.' NOT IN ('.implode(',', $pending_ids).')');
}
}
}
$types = $event->getEventParam('types');
$except_types = $event->getEventParam('except');
$type_clauses = $this->getTypeClauses($event);
// convert prepared type clauses into list filters
$includes_or_filter =& $this->Application->makeClass('kMultipleFilter');
$includes_or_filter->setType(FLT_TYPE_OR);
$excepts_and_filter =& $this->Application->makeClass('kMultipleFilter');
$excepts_and_filter->setType(FLT_TYPE_AND);
$includes_or_filter_h =& $this->Application->makeClass('kMultipleFilter');
$includes_or_filter_h->setType(FLT_TYPE_OR);
$excepts_and_filter_h =& $this->Application->makeClass('kMultipleFilter');
$excepts_and_filter_h->setType(FLT_TYPE_AND);
- $except_types_array = explode(',', $types);
-
if ($types) {
$types_array = explode(',', $types);
for ($i = 0; $i < sizeof($types_array); $i++) {
$type = trim($types_array[$i]);
if (isset($type_clauses[$type])) {
if ($type_clauses[$type]['having_filter']) {
$includes_or_filter_h->removeFilter('filter_'.$type);
$includes_or_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['include']);
}else {
$includes_or_filter->removeFilter('filter_'.$type);
$includes_or_filter->addFilter('filter_'.$type, $type_clauses[$type]['include']);
}
}
}
}
if ($except_types) {
$except_types_array = explode(',', $except_types);
for ($i = 0; $i < sizeof($except_types_array); $i++) {
$type = trim($except_types_array[$i]);
if (isset($type_clauses[$type])) {
if ($type_clauses[$type]['having_filter']) {
$excepts_and_filter_h->removeFilter('filter_'.$type);
$excepts_and_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['except']);
}else {
$excepts_and_filter->removeFilter('filter_'.$type);
$excepts_and_filter->addFilter('filter_'.$type, $type_clauses[$type]['except']);
}
}
}
}
/*if ( !$this->Application->IsAdmin() ) {
$object->addFilter('expire_filter', '%1$s.Expire IS NULL OR %1$s.Expire > UNIX_TIMESTAMP()');
}*/
/*$list_type = $event->getEventParam('ListType');
switch($list_type)
{
case 'favorites':
$fav_table = $this->Application->getUnitOption('fav','TableName');
$user_id =& $this->Application->GetVar('u_id');
$sql = 'SELECT DISTINCT f.ResourceId
FROM '.$fav_table.' f
LEFT JOIN '.$object->TableName.' p ON p.ResourceId = f.ResourceId
WHERE f.PortalUserId = '.$user_id;
$ids = $this->Conn->GetCol($sql);
if(!$ids) $ids = Array(-1);
$object->addFilter('category_filter', TABLE_PREFIX.'CategoryItems.PrimaryCat = 1');
$object->addFilter('favorites_filter', '%1$s.`ResourceId` IN ('.implode(',',$ids).')');
break;
case 'search':
$search_results_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$sql = ' SELECT DISTINCT ResourceId
FROM '.$search_results_table.'
WHERE ItemType=11';
$ids = $this->Conn->GetCol($sql);
if(!$ids) $ids = Array(-1);
$object->addFilter('search_filter', '%1$s.`ResourceId` IN ('.implode(',',$ids).')');
break;
} */
$object->addFilter('includes_filter', $includes_or_filter);
$object->addFilter('excepts_filter', $excepts_and_filter);
$object->addFilter('includes_filter_h', $includes_or_filter_h, HAVING_FILTER);
$object->addFilter('excepts_filter_h', $excepts_and_filter_h, HAVING_FILTER);
}
/**
* Adds calculates fields for item statuses
*
* @param kCatDBItem $object
* @param kEvent $event
*/
function prepareObject(&$object, &$event)
{
$this->prepareItemStatuses($event);
$object->addCalculatedField('CachedNavbar', 'l'.$this->Application->GetVar('m_lang').'_CachedNavbar');
if ($event->Special == 'export' || $event->Special == 'import')
{
$this->prepareExportColumns($event);
}
}
/**
* Creates calculated fields for all item statuses based on config settings
*
* @param kEvent $event
*/
function prepareItemStatuses(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings');
if (!$property_map) {
return ;
}
// new items
$object->addCalculatedField('IsNew', ' IF(%1$s.NewItem = 2,
IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - '.
$this->Application->ConfigValue($property_map['NewDays']).
'*3600*24), 1, 0),
%1$s.NewItem
)');
// hot items (cache updated every hour)
$sql = 'SELECT Data
FROM '.TABLE_PREFIX.'Cache
WHERE (VarName = "'.$property_map['HotLimit'].'") AND (Cached >'.(adodb_mktime() - 3600).')';
$hot_limit = $this->Conn->GetOne($sql);
if ($hot_limit === false) {
$hot_limit = $this->CalculateHotLimit($event);
}
$object->addCalculatedField('IsHot', ' IF(%1$s.HotItem = 2,
IF(%1$s.'.$property_map['ClickField'].' >= '.$hot_limit.', 1, 0),
%1$s.HotItem
)');
// popular items
$object->addCalculatedField('IsPop', ' IF(%1$s.PopItem = 2,
IF(%1$s.CachedVotesQty >= '.
$this->Application->ConfigValue($property_map['MinPopVotes']).
' AND %1$s.CachedRating >= '.
$this->Application->ConfigValue($property_map['MinPopRating']).
', 1, 0),
%1$s.PopItem)');
}
function CalculateHotLimit(&$event)
{
$property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings');
if (!$property_map) {
return;
}
$click_field = $property_map['ClickField'];
$last_hot = $this->Application->ConfigValue($property_map['MaxHotNumber']) - 1;
$sql = 'SELECT '.$click_field.' FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
ORDER BY '.$click_field.' DESC
LIMIT '.$last_hot.', 1';
$res = $this->Conn->GetCol($sql);
$hot_limit = (double)array_shift($res);
$this->Conn->Query('REPLACE INTO '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("'.$property_map['HotLimit'].'", "'.$hot_limit.'", '.adodb_mktime().')');
return $hot_limit;
return 0;
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnBeforeItemUpdate(&$event)
{
$property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings');
if (!$property_map) {
return;
}
$click_field = $property_map['ClickField'];
$object =& $event->getObject();
if( $this->Application->IsAdmin() && ($this->Application->GetVar($click_field.'_original') !== false) &&
floor($this->Application->GetVar($click_field.'_original')) != $object->GetDBField($click_field) )
{
$sql = 'SELECT MAX('.$click_field.') FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
WHERE FLOOR('.$click_field.') = '.$object->GetDBField($click_field);
$hits = ( $res = $this->Conn->GetOne($sql) ) ? $res + 0.000001 : $object->GetDBField($click_field);
$object->SetDBField($click_field, $hits);
}
}
/**
* Load price from temp table if product mode is temp table
*
* @param kEvent $event
*/
function OnAfterItemLoad(&$event)
{
$special = substr($event->Special, -6);
$object =& $event->getObject();
if ($special == 'import' || $special == 'export') {
$image_data = $object->getPrimaryImageData();
if ($image_data) {
$thumbnail_image = $image_data[$image_data['LocalThumb'] ? 'ThumbPath' : 'ThumbUrl'];
if ($image_data['SameImages']) {
$full_image = '';
}
else {
$full_image = $image_data[$image_data['LocalImage'] ? 'LocalPath' : 'Url'];
}
$object->SetDBField('ThumbnailImage', $thumbnail_image);
$object->SetDBField('FullImage', $full_image);
$object->SetDBField('ImageAlt', $image_data['AltName']);
}
}
//substituiting pending status value for pending editing
if ($object->HasField('OrgId') && $object->GetDBField('OrgId') > 0 && $object->GetDBField('Status') == -2) {
$options = $object->Fields['Status']['options'];
foreach ($options as $key => $val) {
if ($key == 2) $key = -2;
$new_options[$key] = $val;
}
$object->Fields['Status']['options'] = $new_options;
}
}
function OnAfterItemUpdate(&$event)
{
$this->CalculateHotLimit($event);
if ( substr($event->Special, -6) == 'import') {
$this->setCustomExportColumns($event);
}
}
/**
* sets values for import process
*
* @param kEvent $event
*/
function OnAfterItemCreate(&$event)
{
if ( substr($event->Special, -6) == 'import') {
$this->setCustomExportColumns($event);
}
}
/**
* Make record to search log
*
* @param string $keywords
* @param int $search_type 0 - simple search, 1 - advanced search
*/
function saveToSearchLog($keywords, $search_type = 0)
{
$sql = 'UPDATE '.TABLE_PREFIX.'SearchLog
SET Indices = Indices + 1
WHERE Keyword = '.$this->Conn->qstr($keywords).' AND SearchType = '.$search_type; // 0 - simple search, 1 - advanced search
$this->Conn->Query($sql);
if ($this->Conn->getAffectedRows() == 0) {
$fields_hash = Array('Keyword' => $keywords, 'Indices' => 1, 'SearchType' => $search_type);
$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'SearchLog');
}
}
/**
* Makes simple search for products
* based on keywords string
*
* @param kEvent $event
* @todo Change all hardcoded Products table & In-Commerce module usage to dynamic usage from item config !!!
*/
function OnSimpleSearch(&$event)
{
if($this->Application->GetVar('INPORTAL_ON') && !($this->Application->GetVar('Action') == 'm_simple_search'))
{
return;
}
$event->redirect = false;
$search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$keywords = unhtmlentities( trim($this->Application->GetVar('keywords')) );
$query_object =& $this->Application->recallObject('HTTPQuery');
$sql = 'SHOW TABLES LIKE "'.$search_table.'"';
if(!isset($query_object->Get['keywords']) &&
!isset($query_object->Post['keywords']) &&
$this->Conn->Query($sql))
{
return; // used when navigating by pages or changing sorting in search results
}
if(!$keywords || strlen($keywords) < $this->Application->ConfigValue('Search_MinKeyword_Length'))
{
$this->Conn->Query('DROP TABLE IF EXISTS '.$search_table);
$this->Application->SetVar('keywords_too_short', 1);
return; // if no or too short keyword entered, doing nothing
}
$this->Application->StoreVar('keywords', $keywords);
if (!$this->Application->GetVar('INPORTAL_ON')) {
// don't save search log, because in-portal already saved it
$this->saveToSearchLog($keywords, 0); // 0 - simple search, 1 - advanced search
}
$keywords = strtr($keywords, Array('%' => '\\%', '_' => '\\_'));
$event->setPseudoClass('_List');
$object =& $event->getObject();
$this->Application->SetVar($event->getPrefixSpecial().'_Page', 1);
$lang = $this->Application->GetVar('m_lang');
- $product_table = $this->Application->getUnitOption('p', 'TableName');
+ $items_table = $this->Application->getUnitOption($event->Prefix, 'TableName');
+ $module_name = $this->Application->findModule('Var', $event->Prefix, 'Name');
$sql = ' SELECT * FROM '.$this->Application->getUnitOption('confs', 'TableName').'
- WHERE ModuleName="In-Commerce"
+ WHERE ModuleName="'.$module_name.'"
AND SimpleSearch=1';
$search_config = $this->Conn->Query($sql, 'FieldName');
$field_list = array_keys($search_config);
$join_clauses = Array();
// field processing
$weight_sum = 0;
$alias_counter = 0;
$custom_fields = $this->Application->getUnitOption($event->Prefix, 'CustomFields');
if ($custom_fields) {
$custom_table = $this->Application->getUnitOption($event->Prefix.'-cdata', 'TableName');
- $join_clauses[] = ' LEFT JOIN '.$custom_table.' custom_data ON '.$product_table.'.ResourceId = custom_data.ResourceId';
+ $join_clauses[] = ' LEFT JOIN '.$custom_table.' custom_data ON '.$items_table.'.ResourceId = custom_data.ResourceId';
}
// what field in search config becomes what field in sql (key - new field, value - old field (from searchconfig table))
$search_config_map = Array();
foreach ($field_list as $key => $field) {
$options = $object->getFieldOptions($field);
$local_table = TABLE_PREFIX.$search_config[$field]['TableName'];
$weight_sum += $search_config[$field]['Priority']; // counting weight sum; used when making relevance clause
// processing multilingual fields
if (getArrayValue($options, 'formatter') == 'kMultiLanguage') {
$field_list[$key.'_primary'] = 'l'.$this->Application->GetDefaultLanguageId().'_'.$field;
$field_list[$key] = 'l'.$lang.'_'.$field;
if(!isset($search_config[$field]['ForeignField']))
{
$field_list[$key.'_primary'] = $local_table.'.'.$field_list[$key.'_primary'];
$search_config_map[ $field_list[$key.'_primary'] ] = $field;
}
}
// processing fields from other tables
if($foreign_field = $search_config[$field]['ForeignField'])
{
$exploded = explode(':', $foreign_field, 2);
if($exploded[0] == 'CALC')
{
unset($field_list[$key]);
continue; // ignoring having type clauses in simple search
/*$user_object =& $this->Application->recallObject('u');
$user_groups = $this->Application->RecallVar('UserGroups');
$having_list[$key] = str_replace('{PREFIX}', TABLE_PREFIX, $exploded[1]);
$join_clause = str_replace('{PREFIX}', TABLE_PREFIX, $search_config[$field]['JoinClause']);
$join_clause = str_replace('{USER_GROUPS}', $user_groups, $join_clause);
$join_clause = ' LEFT JOIN '.$join_clause;
$join_clauses[] = $join_clause;*/
}
else
{
+ $multi_lingual = false;
+ if ($exploded[0] == 'MULTI')
+ {
+ $multi_lingual = true;
+ $foreign_field = $exploded[1];
+ }
$exploded = explode('.', $foreign_field); // format: table.field_name
$foreign_table = TABLE_PREFIX.$exploded[0];
$alias_counter++;
$alias = 't'.$alias_counter;
- $field_list[$key] = $alias.'.'.$exploded[1];
- $search_config_map[ $field_list[$key] ] = $field;
+ if ($multi_lingual) {
+ $field_list[$key] = $alias.'.'.'l'.$lang.'_'.$exploded[1];
+ $field_list[$key.'_primary'] = 'l'.$this->Application->GetDefaultLanguageId().'_'.$field;
+ $search_config_map[ $field_list[$key] ] = $field;
+ $search_config_map[ $field_list[$key.'_primary'] ] = $field;
+ }
+ else {
+ $field_list[$key] = $alias.'.'.$exploded[1];
+ $search_config_map[ $field_list[$key] ] = $field;
+ }
$join_clause = str_replace('{ForeignTable}', $alias, $search_config[$field]['JoinClause']);
- $join_clause = str_replace('{LocalTable}', $product_table, $join_clause);
+ $join_clause = str_replace('{LocalTable}', $items_table, $join_clause);
$join_clauses[] = ' LEFT JOIN '.$foreign_table.' '.$alias.'
ON '.$join_clause;
}
}
else {
// processing fields from local table
if ($search_config[$field]['CustomFieldId']) {
$local_table = 'custom_data';
$field_list[$key] = 'l'.$lang.'_cust_'.array_search($field_list[$key], $custom_fields);
}
$field_list[$key] = $local_table.'.'.$field_list[$key];
$search_config_map[ $field_list[$key] ] = $field;
}
}
// keyword string processing
$search_helper =& $this->Application->recallObject('SearchHelper');
$where_clause = $search_helper->buildWhereClause($keywords, $field_list);
- $where_clause = $where_clause.' AND '.$product_table.'.Status=1';
+ $where_clause = $where_clause.' AND '.$items_table.'.Status=1';
if($this->Application->GetVar('Action') == 'm_simple_subsearch') // subsearch, In-portal
{
if( $event->getEventParam('ResultIds') )
{
- $where_clause .= ' AND '.$product_table.'.ResourceId IN ('.implode(',', $event->specificParams['ResultIds']).')';
+ $where_clause .= ' AND '.$items_table.'.ResourceId IN ('.implode(',', $event->specificParams['ResultIds']).')';
}
}
if( $event->MasterEvent && $event->MasterEvent->Name == 'OnListBuild' ) // subsearch, k4
{
if( $event->MasterEvent->getEventParam('ResultIds') )
{
- $where_clause .= ' AND '.$product_table.'.ResourceId IN ('.implode(',', $event->MasterEvent->getEventParam('ResultIds')).')';
+ $where_clause .= ' AND '.$items_table.'.ResourceId IN ('.implode(',', $event->MasterEvent->getEventParam('ResultIds')).')';
}
}
// making relevance clause
$positive_words = $search_helper->getPositiveKeywords($keywords);
$this->Application->StoreVar('highlight_keywords', serialize($positive_words));
$revelance_parts = Array();
reset($search_config);
foreach ($field_list as $field) {
$config_elem = $search_config[ $search_config_map[$field] ];
$weight = $config_elem['Priority'];
$revelance_parts[] = 'IF('.$field.' LIKE "%'.implode(' ', $positive_words).'%", '.$weight_sum.', 0)';
foreach ($positive_words as $keyword) {
$revelance_parts[] = 'IF('.$field.' LIKE "%'.$keyword.'%", '.$weight.', 0)';
}
}
- $rel_keywords = $this->Application->ConfigValue('SearchRel_Keyword_products') / 100;
- $rel_pop = $this->Application->ConfigValue('SearchRel_Pop_products') / 100;
- $rel_rating = $this->Application->ConfigValue('SearchRel_Rating_products') / 100;
+ $conf_postfix = $this->Application->getUnitOption($event->Prefix, 'SearchConfigPostfix');
+ $rel_keywords = $this->Application->ConfigValue('SearchRel_Keyword_'.$conf_postfix) / 100;
+ $rel_pop = $this->Application->ConfigValue('SearchRel_Pop_'.$conf_postfix) / 100;
+ $rel_rating = $this->Application->ConfigValue('SearchRel_Rating_'.$conf_postfix) / 100;
$relevance_clause = '('.implode(' + ', $revelance_parts).') / '.$weight_sum.' * '.$rel_keywords;
- $relevance_clause .= ' + (Hits + 1) / (MAX(Hits) + 1) * '.$rel_pop;
- $relevance_clause .= ' + (CachedRating + 1) / (MAX(CachedRating) + 1) * '.$rel_rating;
+ if ($rel_pop && isset($object->Fields['Hits'])) {
+ $relevance_clause .= ' + (Hits + 1) / (MAX(Hits) + 1) * '.$rel_pop;
+ }
+ if ($rel_rating && isset($object->Fields['CachedRating'])) {
+ $relevance_clause .= ' + (CachedRating + 1) / (MAX(CachedRating) + 1) * '.$rel_rating;
+ }
// building final search query
- if (!$this->Application->GetVar('INPORTAL_ON')) {
+ if (!$this->Application->GetVar('do_not_drop_search_table') && !$this->Application->GetVar('INPORTAL_ON')) {
$this->Conn->Query('DROP TABLE IF EXISTS '.$search_table); // erase old search table if clean k4 event
+ $this->Application->SetVar('do_not_drop_search_table', true);
}
- if ($this->Conn->Query('SHOW TABLES LIKE "'.$search_table.'"')) {
+
+ $search_table_exists = $this->Conn->Query('SHOW TABLES LIKE "'.$search_table.'"');
+ if ($search_table_exists) {
$select_intro = 'INSERT INTO '.$search_table.' (Relevance, ItemId, ResourceId, ItemType, EdPick) ';
}
else {
$select_intro = 'CREATE TABLE '.$search_table.' AS ';
}
+ $edpick_clause = $this->Application->getUnitOption($event->Prefix.'.EditorsPick', 'Fields') ? $items_table.'.EditorsPick' : '0';
+
+
$sql = $select_intro.' SELECT '.$relevance_clause.' AS Relevance,
- '.$product_table.'.ProductId AS ItemId,
- '.$product_table.'.ResourceId,
- 11 AS ItemType,
- '.$product_table.'.EditorsPick AS EdPick
+ '.$items_table.'.'.$this->Application->getUnitOption($event->Prefix, 'IDField').' AS ItemId,
+ '.$items_table.'.ResourceId,
+ '.$this->Application->getUnitOption($event->Prefix, 'ItemType').' AS ItemType,
+ '.$edpick_clause.' AS EdPick
FROM '.$object->TableName.'
'.implode(' ', $join_clauses).'
WHERE '.$where_clause.'
- GROUP BY '.$product_table.'.ProductId';
+ GROUP BY '.$items_table.'.'.$this->Application->getUnitOption($event->Prefix, 'IDField');
$res = $this->Conn->Query($sql);
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnSubSearch(&$event)
{
$search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$sql = 'SHOW TABLES LIKE "'.$search_table.'"';
if($this->Conn->Query($sql))
{
$sql = 'SELECT DISTINCT ResourceId FROM '.$search_table;
$ids = $this->Conn->GetCol($sql);
}
$event->setEventParam('ResultIds', $ids);
$event->CallSubEvent('OnSimpleSearch');
}
/**
* Enter description here...
*
* @param kEvent $event
* @todo Change all hardcoded Products table & In-Commerce module usage to dynamic usage from item config !!!
*/
function OnAdvancedSearch(&$event)
{
$query_object =& $this->Application->recallObject('HTTPQuery');
if(!isset($query_object->Post['andor']))
{
return; // used when navigating by pages or changing sorting in search results
}
$this->Application->RemoveVar('keywords');
$this->Application->RemoveVar('Search_Keywords');
$sql = ' SELECT * FROM '.$this->Application->getUnitOption('confs', 'TableName').'
WHERE ModuleName="In-Commerce"
AND AdvancedSearch=1';
$search_config = $this->Conn->Query($sql);
$lang = $this->Application->GetVar('m_lang');
$object =& $event->getObject();
$object->SetPage(1);
$user_object =& $this->Application->recallObject('u');
$product_table = $this->Application->getUnitOption('p', 'TableName');
$search_keywords = $this->Application->GetVar('value'); // will not be changed
$keywords = $this->Application->GetVar('value'); // will be changed down there
$verbs = $this->Application->GetVar('verb');
$glues = $this->Application->GetVar('andor');
$and_conditions = Array();
$or_conditions = Array();
$and_having_conditions = Array();
$or_having_conditions = Array();
$join_clauses = Array();
$highlight_keywords = Array();
$relevance_parts = Array();
$condition_patterns = Array( 'any' => '%s LIKE %s',
'contains' => '%s LIKE %s',
'notcontains' => '(NOT (%1$s LIKE %2$s) OR %1$s IS NULL)',
'is' => '%s = %s',
'isnot' => '(%1$s != %2$s OR %1$s IS NULL)');
$alias_counter = 0;
$custom_fields = $this->Application->getUnitOption($event->Prefix, 'CustomFields');
if ($custom_fields) {
$custom_table = $this->Application->getUnitOption($event->Prefix.'-cdata', 'TableName');
$join_clauses[] = ' LEFT JOIN '.$custom_table.' custom_data ON '.$product_table.'.ResourceId = custom_data.ResourceId';
}
$search_log = '';
$weight_sum = 0;
// processing fields and preparing conditions
foreach($search_config as $record)
{
$field = $record['FieldName'];
$join_clause = '';
$condition_mode = 'WHERE';
// field processing
$options = $object->getFieldOptions($field);
$local_table = TABLE_PREFIX.$record['TableName'];
$weight_sum += $record['Priority']; // counting weight sum; used when making relevance clause
// processing multilingual fields
if (getArrayValue($options, 'formatter') == 'kMultiLanguage') {
$field_name = 'l'.$lang.'_'.$field;
}
else {
$field_name = $field;
}
// processing fields from other tables
if ($foreign_field = $record['ForeignField']) {
$exploded = explode(':', $foreign_field, 2);
if($exploded[0] == 'CALC')
{
$user_groups = $this->Application->RecallVar('UserGroups');
$field_name = str_replace('{PREFIX}', TABLE_PREFIX, $exploded[1]);
$join_clause = str_replace('{PREFIX}', TABLE_PREFIX, $record['JoinClause']);
$join_clause = str_replace('{USER_GROUPS}', $user_groups, $join_clause);
$join_clause = ' LEFT JOIN '.$join_clause;
$condition_mode = 'HAVING';
}
else {
$exploded = explode('.', $foreign_field);
$foreign_table = TABLE_PREFIX.$exploded[0];
if($record['CustomFieldId']) {
$exploded[1] = 'l'.$lang.'_'.$exploded[1];
}
$alias_counter++;
$alias = 't'.$alias_counter;
$field_name = $alias.'.'.$exploded[1];
$join_clause = str_replace('{ForeignTable}', $alias, $record['JoinClause']);
$join_clause = str_replace('{LocalTable}', $product_table, $join_clause);
if($record['CustomFieldId'])
{
$join_clause .= ' AND '.$alias.'.CustomFieldId='.$record['CustomFieldId'];
}
$join_clause = ' LEFT JOIN '.$foreign_table.' '.$alias.'
ON '.$join_clause;
}
}
else
{
// processing fields from local table
if ($record['CustomFieldId']) {
$local_table = 'custom_data';
$field_name = 'l'.$lang.'_cust_'.array_search($field_name, $custom_fields);
}
$field_name = $local_table.'.'.$field_name;
}
$condition = '';
switch($record['FieldType'])
{
case 'text':
$keywords[$field] = unhtmlentities( $keywords[$field] );
if(strlen($keywords[$field]) >= $this->Application->ConfigValue('Search_MinKeyword_Length'))
{
$highlight_keywords[] = $keywords[$field];
if( in_array($verbs[$field], Array('any', 'contains', 'notcontains')) )
{
$keywords[$field] = '%'.strtr($keywords[$field], Array('%' => '\\%', '_' => '\\_')).'%';
}
$condition = sprintf( $condition_patterns[$verbs[$field]],
$field_name,
$this->Conn->qstr( $keywords[$field] ));
}
break;
case 'boolean':
if($keywords[$field] != -1)
{
$property_mappings = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings');
switch($field)
{
case 'HotItem':
$hot_limit_var = getArrayValue($property_mappings, 'HotLimit');
if($hot_limit_var)
{
$sql = 'SELECT Data FROM '.TABLE_PREFIX.'Cache WHERE VarName="'.$hot_limit_var.'"';
$hot_limit = (int)$this->Conn->GetOne($sql);
$condition = 'IF('.$product_table.'.HotItem = 2,
IF('.$product_table.'.Hits >= '.
$hot_limit.
', 1, 0), '.$product_table.'.HotItem) = '.$keywords[$field];
}
break;
case 'PopItem':
$votes2pop_var = getArrayValue($property_mappings, 'VotesToPop');
$rating2pop_var = getArrayValue($property_mappings, 'RatingToPop');
if($votes2pop_var && $rating2pop_var)
{
$condition = 'IF('.$product_table.'.PopItem = 2, IF('.$product_table.'.CachedVotesQty >= '.
$this->Application->ConfigValue($votes2pop_var).
' AND '.$product_table.'.CachedRating >= '.
$this->Application->ConfigValue($rating2pop_var).
', 1, 0), '.$product_table.'.PopItem) = '.$keywords[$field];
}
break;
case 'NewItem':
$new_days_var = getArrayValue($property_mappings, 'NewDays');
if($new_days_var)
{
$condition = 'IF('.$product_table.'.NewItem = 2,
IF('.$product_table.'.CreatedOn >= (UNIX_TIMESTAMP() - '.
$this->Application->ConfigValue($new_days_var).
'*3600*24), 1, 0), '.$product_table.'.NewItem) = '.$keywords[$field];
}
break;
case 'EditorsPick':
$condition = $product_table.'.EditorsPick = '.$keywords[$field];
break;
}
}
break;
case 'range':
$range_conditions = Array();
if($keywords[$field.'_from'] && !preg_match("/[^0-9]/i", $keywords[$field.'_from']))
{
$range_conditions[] = $field_name.' >= '.$keywords[$field.'_from'];
}
if($keywords[$field.'_to'] && !preg_match("/[^0-9]/i", $keywords[$field.'_to']))
{
$range_conditions[] = $field_name.' <= '.$keywords[$field.'_to'];
}
if($range_conditions)
{
$condition = implode(' AND ', $range_conditions);
}
break;
case 'date':
if($keywords[$field])
{
if( in_array($keywords[$field], Array('today', 'yesterday')) )
{
$current_time = getdate();
$day_begin = adodb_mktime(0, 0, 0, $current_time['mon'], $current_time['mday'], $current_time['year']);
$time_mapping = Array('today' => $day_begin, 'yesterday' => ($day_begin - 86400));
$min_time = $time_mapping[$keywords[$field]];
}
else
{
$time_mapping = Array( 'last_week' => 604800, 'last_month' => 2628000,
'last_3_months' => 7884000, 'last_6_months' => 15768000,
'last_year' => 31536000
);
$min_time = adodb_mktime() - $time_mapping[$keywords[$field]];
}
$condition = $field_name.' > '.$min_time;
}
break;
}
if($condition)
{
if($join_clause)
{
$join_clauses[] = $join_clause;
}
$relevance_parts[] = 'IF('.$condition.', '.$record['Priority'].', 0)';
if($glues[$field] == 1) // and
{
if($condition_mode == 'WHERE')
{
$and_conditions[] = $condition;
}
else
{
$and_having_conditions[] = $condition;
}
}
else // or
{
if($condition_mode == 'WHERE')
{
$or_conditions[] = $condition;
}
else
{
$or_having_conditions[] = $condition;
}
}
// create search log record
$search_log_data = Array('search_config' => $record, 'verb' => getArrayValue($verbs, $field), 'value' => ($record['FieldType'] == 'range') ? $search_keywords[$field.'_from'].'|'.$search_keywords[$field.'_to'] : $search_keywords[$field]);
$search_log[] = $this->Application->Phrase('la_Field').' "'.$this->getHuman('Field', $search_log_data).'" '.$this->getHuman('Verb', $search_log_data).' '.$this->Application->Phrase('la_Value').' '.$this->getHuman('Value', $search_log_data).' '.$this->Application->Phrase($glues[$field] == 1 ? 'lu_And' : 'lu_Or');
}
}
$search_log = implode('<br />', $search_log);
$search_log = preg_replace('/(.*) '.preg_quote($this->Application->Phrase('lu_and'), '/').'|'.preg_quote($this->Application->Phrase('lu_or'), '/').'$/is', '\\1', $search_log);
$this->saveToSearchLog($search_log, 1); // advanced search
$this->Application->StoreVar('highlight_keywords', serialize($highlight_keywords));
// making relevance clause
if($relevance_parts)
{
$rel_keywords = $this->Application->ConfigValue('SearchRel_Keyword_products') / 100;
$rel_pop = $this->Application->ConfigValue('SearchRel_Pop_products') / 100;
$rel_rating = $this->Application->ConfigValue('SearchRel_Rating_products') / 100;
$relevance_clause = '('.implode(' + ', $relevance_parts).') / '.$weight_sum.' * '.$rel_keywords;
$relevance_clause .= ' + (Hits + 1) / (MAX(Hits) + 1) * '.$rel_pop;
$relevance_clause .= ' + (CachedRating + 1) / (MAX(CachedRating) + 1) * '.$rel_rating;
}
else
{
$relevance_clause = '0';
}
// building having clause
if($or_having_conditions)
{
$and_having_conditions[] = '('.implode(' OR ', $or_having_conditions).')';
}
$having_clause = implode(' AND ', $and_having_conditions);
$having_clause = $having_clause ? ' HAVING '.$having_clause : '';
// building where clause
if($or_conditions)
{
$and_conditions[] = '('.implode(' OR ', $or_conditions).')';
}
// $and_conditions[] = $product_table.'.Status = 1';
$where_clause = implode(' AND ', $and_conditions);
if(!$where_clause)
{
if($having_clause)
{
$where_clause = '1';
}
else
{
$where_clause = '0';
$this->Application->SetVar('adv_search_error', 1);
}
}
$where_clause .= ' AND '.$product_table.'.Status = 1';
// building final search query
$search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$this->Conn->Query('DROP TABLE IF EXISTS '.$search_table);
$sql = ' CREATE TABLE '.$search_table.'
SELECT '.$relevance_clause.' AS Relevance,
'.$product_table.'.ProductId AS ItemId,
'.$product_table.'.ResourceId AS ResourceId,
11 AS ItemType,
'.$product_table.'.EditorsPick AS EdPick
FROM '.$product_table.'
'.implode(' ', $join_clauses).'
WHERE '.$where_clause.'
GROUP BY '.$product_table.'.ProductId'.
$having_clause;
$res = $this->Conn->Query($sql);
}
function getHuman($type, $search_data)
{
$type = ucfirst(strtolower($type));
extract($search_data);
switch ($type) {
case 'Field':
return $this->Application->Phrase($search_config['DisplayName']);
break;
case 'Verb':
return $verb ? $this->Application->Phrase('lu_advsearch_'.$verb) : '';
break;
case 'Value':
switch ($search_config['FieldType']) {
case 'date':
$values = Array(0 => 'lu_comm_Any', 'today' => 'lu_comm_Today',
'yesterday' => 'lu_comm_Yesterday', 'last_week' => 'lu_comm_LastWeek',
'last_month' => 'lu_comm_LastMonth', 'last_3_months' => 'lu_comm_Last3Months',
'last_6_months' => 'lu_comm_Last6Months', 'last_year' => 'lu_comm_LastYear');
$ret = $this->Application->Phrase($values[$value]);
break;
case 'range':
$value = explode('|', $value);
return $this->Application->Phrase('lu_comm_From').' "'.$value[0].'" '.$this->Application->Phrase('lu_comm_To').' "'.$value[1].'"';
break;
case 'boolean':
$values = Array(1 => 'lu_comm_Yes', 0 => 'lu_comm_No', -1 => 'lu_comm_Both');
$ret = $this->Application->Phrase($values[$value]);
break;
case 'text':
$ret = $value;
break;
}
return '"'.$ret.'"';
break;
}
}
/**
* Set's correct page for list
* based on data provided with event
*
* @param kEvent $event
* @access private
* @see OnListBuild
*/
function SetPagination(&$event)
{
// get PerPage (forced -> session -> config -> 10)
$per_page = $this->getPerPage($event);
$object =& $event->getObject();
$object->SetPerPage($per_page);
$this->Application->StoreVarDefault($event->getPrefixSpecial().'_Page', 1);
$page = $this->Application->GetVar($event->getPrefixSpecial().'_Page');
if (!$page)
{
$page = $this->Application->GetVar($event->getPrefixSpecial(true).'_Page');
}
if (!$page)
{
if( $this->Application->RewriteURLs() )
{
$page = $this->Application->GetVar($event->Prefix.'_Page');
if (!$page)
{
$page = $this->Application->RecallVar($event->Prefix.'_Page');
}
if($page) $this->Application->StoreVar($event->getPrefixSpecial().'_Page', $page);
}
else
{
$page = $this->Application->RecallVar($event->getPrefixSpecial().'_Page');
}
}
else {
$this->Application->StoreVar($event->getPrefixSpecial().'_Page', $page);
}
if( !$event->getEventParam('skip_counting') )
{
$pages = $object->GetTotalPages();
if($page > $pages)
{
$this->Application->StoreVar($event->getPrefixSpecial().'_Page', 1);
$page = 1;
}
}
/*$cur_per_page = $per_page;
$per_page = $event->getEventParam('per_page');
if ($per_page == 'list_next') {
$cur_page = $page;
$object =& $this->Application->recallObject($event->Prefix);
$object->SetPerPage(1);
$cur_item_index = $object->CurrentIndex;
$page = ($cur_page-1) * $cur_per_page + $cur_item_index + 1;
$object->SetPerPage(1);
}*/
$object->SetPage($page);
}
/* === RELATED TO IMPORT/EXPORT: BEGIN === */
/**
* Returns module folder
*
* @param kEvent $event
* @return string
*/
function getModuleFolder(&$event)
{
return $this->Application->getUnitOption($event->Prefix, 'ModuleFolder');
}
/**
* Shows export dialog
*
* @param kEvent $event
*/
function OnExport(&$event)
{
// use old fasion (in-portal) grid
$selector_name = $this->Application->getUnitOption($event->Prefix, 'CatalogSelectorName');
if ($selector_name) {
$selected_ids = $this->Application->GetVar($selector_name);
}
else {
$this->StoreSelectedIDs($event);
$selected_ids = $this->getSelectedIDs($event);
if (implode(',', $selected_ids) == '') {
// K4 fix when no ids found bad selected ids array is formed
$selected_ids = false;
}
}
$selected_cats_ids = $this->Application->GetVar('export_categories');
$this->Application->StoreVar($event->Prefix.'_export_ids', $selected_ids ? implode(',', $selected_ids) : '' );
$this->Application->StoreVar($event->Prefix.'_export_cats_ids', $selected_cats_ids);
$event->redirect = $this->getModuleFolder($event).'/export';
$redirect_params = Array( 'm_opener' => 'd',
$this->Prefix.'.export_event' => 'OnNew',
'pass' => 'all,'.$this->Prefix.'.export');
$event->setRedirectParams($redirect_params);
}
/**
* Export form validation & processing
*
* @param kEvent $event
*/
function OnExportBegin(&$event)
{
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if (!$items_info)
{
$items_info = unserialize( $this->Application->RecallVar($event->getPrefixSpecial().'_ItemsInfo') );
$this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
}
list($item_id, $field_values) = each($items_info);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->SetFieldsFromHash($field_values);
$field_values['ImportFilename'] = $object->GetDBField('ImportFilename'); //if upload formatter has renamed the file during moving !!!
$object->setID($item_id);
$this->setRequiredFields($event);
$export_object =& $this->Application->recallObject('CatItemExportHelper');
// save export/import options
if ($event->Special == 'export')
{
$export_ids = $this->Application->RecallVar($event->Prefix.'_export_ids');
$export_cats_ids = $this->Application->RecallVar($event->Prefix.'_export_cats_ids');
// used for multistep export
$field_values['export_ids'] = $export_ids ? explode(',', $export_ids) : false;
$field_values['export_cats_ids'] = $export_cats_ids ? explode(',', $export_cats_ids) : Array( $this->Application->GetVar('m_cat_id') );
}
$field_values['ExportColumns'] = $field_values['ExportColumns'] ? explode('|', substr($field_values['ExportColumns'], 1, -1) ) : Array();
$field_values['start_from'] = 0;
$export_object->saveOptions($event, $field_values);
if( $export_object->verifyOptions($event) )
{
$event->redirect = $this->getModuleFolder($event).'/'.$event->Special.'_progress';
}
else
{
// make uploaded file local & change source selection
$filename = getArrayValue($field_values, 'ImportFilename');
if ($filename) {
$this->updateImportFiles($event);
$object->SetDBField('ImportSource', 2);
$field_values['ImportSource'] = 2;
$object->SetDBField('ImportLocalFilename', $filename);
$field_values['ImportLocalFilename'] = $filename;
$export_object->saveOptions($event, $field_values);
}
$event->status = erFAIL;
$event->redirect = false;
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnExportCancel(&$event)
{
$this->OnGoBack($event);
}
/**
* Sets correct available & export fields
*
* @param kEvent $event
*/
function prepareExportColumns(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$available_columns = Array();
// category field (mixed)
$available_columns['__CATEGORY__CategoryPath'] = 'CategoryPath';
if ($event->Special == 'import') {
// category field (separated fields)
$max_level = $this->Application->ConfigValue('MaxImportCategoryLevels');
$i = 0;
while ($i < $max_level) {
$available_columns['__CATEGORY__Category'.($i + 1)] = 'Category'.($i + 1);
$i++;
}
}
// db fields
foreach ($object->Fields as $field_name => $field_options)
{
if (!$object->SkipField($field_name))
{
$available_columns[$field_name] = $field_name.(getArrayValue($field_options, 'required') ? '*' : '');
}
}
$available_columns = array_merge_recursive2($available_columns, $this->getCustomExportColumns($event));
// custom fields
foreach ($object->customFields as $custom_id => $custom_name)
{
$available_columns['__CUSTOM__'.$custom_name] = $custom_name;
}
// columns already in use
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info)
{
list($item_id, $field_values) = each($items_info);
$export_keys = $field_values['ExportColumns'];
$export_keys = $export_keys ? explode('|', substr($export_keys, 1, -1) ) : Array();
}
else {
$export_keys = Array();
}
$export_columns = Array();
foreach ($export_keys as $field_key)
{
$field_name = $this->getExportField($field_key);
$export_columns[$field_key] = $field_name;
unset($available_columns[$field_key]);
}
$options = $object->GetFieldOptions('ExportColumns');
$options['options'] = $export_columns;
$object->SetFieldOptions('ExportColumns', $options);
$options = $object->GetFieldOptions('AvailableColumns');
$options['options'] = $available_columns;
$object->SetFieldOptions('AvailableColumns', $options);
$this->updateImportFiles($event);
}
/**
* Updates uploaded files list
*
* @param kEvent $event
*/
function updateImportFiles(&$event)
{
if ($event->Special != 'import') {
return false;
}
$object =& $event->getObject();
$import_filenames = Array();
if ($folder_handle = opendir(EXPORT_PATH)) {
while (false !== ($file = readdir($folder_handle))) {
if (is_dir(EXPORT_PATH.'/'.$file) || substr($file, 0, 1) == '.' || strtolower($file) == 'cvs' || strtolower($file) == 'dummy' || filesize(EXPORT_PATH.'/'.$file) == 0) continue;
$file_size = formatSize( filesize(EXPORT_PATH.'/'.$file) );
$import_filenames[$file] = $file.' ('.$file_size.')';
}
closedir($folder_handle);
}
$options = $object->GetFieldOptions('ImportLocalFilename');
$options['options'] = $import_filenames;
$object->SetFieldOptions('ImportLocalFilename', $options);
}
/**
* Returns specific to each item type columns only
*
* @param kEvent $event
* @return Array
*/
function getCustomExportColumns(&$event)
{
return Array( '__VIRTUAL__ThumbnailImage' => 'ThumbnailImage',
'__VIRTUAL__FullImage' => 'FullImage',
'__VIRTUAL__ImageAlt' => 'ImageAlt');
}
/**
* Sets non standart virtual fields (e.g. to other tables)
*
* @param kEvent $event
*/
function setCustomExportColumns(&$event)
{
$this->restorePrimaryImage($event);
}
/**
* Create/Update primary image record in info found in imported data
*
* @param kEvent $event
*/
function restorePrimaryImage(&$event)
{
$object =& $event->getObject();
$has_image_info = $object->GetDBField('ImageAlt') && ($object->GetDBField('ThumbnailImage') || $object->GetDBField('FullImage'));
if (!$has_image_info) {
return false;
}
$image_data = $object->getPrimaryImageData();
$image =& $this->Application->recallObject('img', null, Array('skip_autoload' => true));
if ($image_data) {
$image->Load($image_data['ImageId']);
}
else {
$image->Clear();
$image->SetDBField('Name', 'main');
$image->SetDBField('DefaultImg', 1);
$image->SetDBField('ResourceId', $object->GetDBField('ResourceId'));
}
$image->SetDBField('AltName', $object->GetDBField('ImageAlt'));
if ($object->GetDBField('ThumbnailImage')) {
$thumbnail_field = $this->isURL( $object->GetDBField('ThumbnailImage') ) ? 'ThumbUrl' : 'ThumbPath';
$image->SetDBField($thumbnail_field, $object->GetDBField('ThumbnailImage') );
$image->SetDBField('LocalThumb', $thumbnail_field == 'ThumbPath' ? 1 : 0);
}
if (!$object->GetDBField('FullImage')) {
$image->SetDBField('SameImages', 1);
}
else {
$image->SetDBField('SameImages', 0);
$full_field = $this->isURL( $object->GetDBField('FullImage') ) ? 'Url' : 'LocalPath';
$image->SetDBField($full_field, $object->GetDBField('FullImage') );
$image->SetDBField('LocalImage', $full_field == 'LocalPath' ? 1 : 0);
}
if ($image->isLoaded()) {
$image->Update();
}
else {
$image->Create();
}
}
function isURL($path)
{
return preg_match('#(http|https)://(.*)#', $path);
}
// ImportLocalFilename
function getExportField($field_key)
{
$prepends = Array('__CUSTOM__', '__CATEGORY__');
foreach ($prepends as $prepend)
{
if (substr($field_key, 0, strlen($prepend) ) == $prepend)
{
$field_key = substr($field_key, strlen($prepend), strlen($field_key) );
break;
}
}
return $field_key;
}
/**
* Prepares item for import/export operations
*
* @param kEvent $event
*/
function OnNew(&$event)
{
parent::OnNew($event);
if ($event->Special != 'import' && $event->Special != 'export') return ;
$this->setRequiredFields($event);
$this->Application->StoreVar('ImportCategory', 0);
}
/**
* set required fields based on import or export params
*
* @param kEvent $event
*/
function setRequiredFields(&$event)
{
$required_fields['common'] = Array('FieldsSeparatedBy', 'LineEndings', 'CategoryFormat');
$required_fields['export'] = Array('ExportFormat', 'ExportFilename','ExportColumns');
$required_fields['import'] = Array('FieldTitles', 'ImportSource', 'CheckDuplicatesMethod'); // ImportFilename, ImportLocalFilename
$object =& $event->getObject();
if ($event->Special == 'import')
{
$import_source = Array(1 => 'ImportFilename', 2 => 'ImportLocalFilename');
$used_field = $import_source[ $object->GetDBField('ImportSource') ];
$required_fields[$event->Special][] = $used_field;
$object->Fields[$used_field]['error_field'] = 'ImportSource';
if ($object->GetDBField('FieldTitles') == 2) $required_fields[$event->Special][] = 'ExportColumns'; // manual field titles
}
$required_fields = array_merge($required_fields['common'], $required_fields[$event->Special]);
foreach ($required_fields as $required_field) {
$object->setRequired($required_field, true);
}
}
/**
* Process items selected in item_selector
*
* @param kEvent $event
*/
function OnProcessSelected(&$event)
{
$selected_ids = $this->Application->GetVar('selected_ids');
$dst_field = $this->Application->RecallVar('dst_field');
if ($dst_field == 'ItemCategory') {
// Item Edit -> Categories Tab -> New Categories
$object =& $event->getObject();
$category_ids = explode(',', $selected_ids['c']);
foreach ($category_ids as $category_id) {
$object->assignToCategory($category_id);
}
}
if ($dst_field == 'ImportCategory') {
// Tools -> Import -> Item Import -> Select Import Category
$this->Application->StoreVar('ImportCategory', $selected_ids['c']);
$this->Application->StoreVar($event->getPrefixSpecial().'_ForceNotValid', 1); // not to loose import/export values on form refresh
$this->Application->SetVar($event->getPrefixSpecial().'_id', 0);
$this->Application->SetVar($event->getPrefixSpecial().'_event', 'OnExportBegin');
$passed = $this->Application->GetVar('passed');
$this->Application->SetVar('passed', $passed.','.$event->getPrefixSpecial());
$event->setEventParam('pass_events', true);
}
$this->finalizePopup($event);
}
/**
* Saves Import/Export settings to session
*
* @param kEvent $event
*/
function OnSaveSettings(&$event)
{
$event->redirect = false;
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info) {
list($id, $field_values) = each($items_info);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->SetFieldsFromHash($field_values);
$field_values['ImportFilename'] = $object->GetDBField('ImportFilename'); //if upload formatter has renamed the file during moving !!!
$field_values['ImportSource'] = 2;
$field_values['ImportLocalFilename'] = $object->GetDBField('ImportFilename');
$items_info[$id] = $field_values;
$this->Application->StoreVar($event->getPrefixSpecial().'_ItemsInfo', serialize($items_info));
}
}
function OnCancelAction(&$event)
{
$event->redirect_params = Array('pass' => 'all,'.$event->GetPrefixSpecial());
$event->redirect = $this->Application->GetVar('cancel_template');
}
/* === RELATED TO IMPORT/EXPORT: END === */
/**
* Stores item's owner login into separate field together with id
*
* @param kEvent $event
* @param string $id_field
* @param string $cached_field
*/
function cacheItemOwner(&$event, $id_field, $cached_field)
{
$object =& $event->getObject();
$user_id = $object->GetDBField($id_field);
$options = $object->GetFieldOptions($id_field);
if (isset($options['options'][$user_id])) {
$object->SetDBField($cached_field, $options['options'][$user_id]);
}
else {
$id_field = $this->Application->getUnitOption('u', 'IDField');
$table_name = $this->Application->getUnitOption('u', 'TableName');
$sql = 'SELECT Login
FROM '.$table_name.'
WHERE '.$id_field.' = '.$user_id;
$object->SetDBField($cached_field, $this->Conn->GetOne($sql));
}
}
/**
* Saves item beeing edited into temp table
*
* @param kEvent $event
*/
function OnPreSave(&$event)
{
parent::OnPreSave($event);
$use_pending_editing = $this->Application->getUnitOption($event->Prefix, 'UsePendingEditing');
if ($event->status == erSUCCESS && $use_pending_editing) {
// decision: clone or not clone
$object =& $event->getObject();
if ($object->GetID() == 0 || $object->GetDBField('OrgId') > 0) {
// new items or cloned items shouldn't be cloned again
return true;
}
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
if ($perm_helper->ModifyCheckPermission($object->GetDBField('CreatedById'), $object->GetDBField('CategoryId'), $event->Prefix) == 2) {
// 1. clone original item
$temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$cloned_ids = $temp_handler->CloneItems($event->Prefix, $event->Special, Array($object->GetID()), null, null, null, true);
$ci_table = $this->Application->GetTempName(TABLE_PREFIX.'CategoryItems');
// 2. delete record from CategoryItems (about cloned item) that was automatically created during call of Create method of kCatDBItem
$sql = 'SELECT ResourceId
FROM '.$object->TableName.'
WHERE '.$object->IDField.' = '.$cloned_ids[0];
$clone_resource_id = $this->Conn->GetOne($sql);
$sql = 'DELETE FROM '.$ci_table.'
WHERE ItemResourceId = '.$clone_resource_id.' AND PrimaryCat = 1';
$this->Conn->Query($sql);
// 3. copy main item categoryitems to cloned item
$sql = ' INSERT INTO '.$ci_table.' (CategoryId, ItemResourceId, PrimaryCat, ItemPrefix, Filename)
SELECT CategoryId, '.$clone_resource_id.' AS ItemResourceId, PrimaryCat, ItemPrefix, Filename
FROM '.$ci_table.'
WHERE ItemResourceId = '.$object->GetDBField('ResourceId');
$this->Conn->Query($sql);
// 4. put cloned id to OrgId field of item being cloned
$sql = 'UPDATE '.$object->TableName.'
SET OrgId = '.$object->GetID().'
WHERE '.$object->IDField.' = '.$cloned_ids[0];
$this->Conn->Query($sql);
// 5. substitute id of item being cloned with clone id
$this->Application->SetVar($event->getPrefixSpecial().'_id', $cloned_ids[0]);
$selected_ids = explode(',', $this->Application->RecallVar($event->getPrefixSpecial().'_selected_ids'));
$selected_ids[ array_search($object->GetID(), $selected_ids) ] = $cloned_ids[0];
$this->Application->StoreVar($event->getPrefixSpecial().'_selected_ids', implode(',', $selected_ids));
// 6. delete original item from temp table
$temp_handler->DeleteItems($event->Prefix, $event->Special, Array($object->GetID()));
}
}
}
/**
* Sets default expiration based on module setting
*
* @param kEvent $event
*/
function OnPreCreate(&$event)
{
parent::OnPreCreate($event);
if ($event->status == erSUCCESS) {
$object =& $event->getObject();
$object->SetDBField('CreatedById', $this->Application->GetVar('u_id'));
}
}
/**
* Occures before original item of item in pending editing got deleted (for hooking only)
*
* @param kEvent $event
*/
function OnBeforeDeleteOriginal(&$event)
{
}
/**
* Apply same processing to each item beeing selected in grid
*
* @param kEvent $event
* @access private
*/
function iterateItems(&$event)
{
if ($event->Name != 'OnMassApprove' && $event->Name != 'OnMassDecline') {
return parent::iterateItems($event);
}
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$object =& $event->getObject( Array('skip_autoload' => true) );
$ids = $this->StoreSelectedIDs($event);
if ($ids) {
foreach ($ids as $id) {
$object->Load($id);
switch ($event->Name) {
case 'OnMassApprove':
$ret = $object->ApproveChanges();
break;
case 'OnMassDecline':
$ret = $object->DeclineChanges();
break;
}
if (!$ret) {
$event->status = erFAIL;
$event->redirect = false;
break;
}
}
}
}
-
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/general/cat_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.65
\ No newline at end of property
+1.66
\ No newline at end of property
Index: trunk/kernel/units/general/helpers/permissions_helper.php
===================================================================
--- trunk/kernel/units/general/helpers/permissions_helper.php (revision 6427)
+++ trunk/kernel/units/general/helpers/permissions_helper.php (revision 6428)
@@ -1,451 +1,467 @@
<?php
class kPermissionsHelper extends kHelper {
/**
* Current set of permissions for group being edited
*
* @var Array
*/
var $Permissions = Array();
function LoadPermissions($group_id, $cat_id, $type = 1)
{
$perm_table = $this->Application->getUnitOption('perm', 'TableName');
$perm_table = $this->Application->GetTempName($perm_table);
$sql = 'SELECT *
FROM '.$perm_table.'
WHERE (GroupId = '.$group_id.') AND (CatId = '.$cat_id.') AND (Type = '.$type.')';
$permissions = $this->Conn->Query($sql, 'Permission');
$this->Permissions = Array();
foreach ($permissions as $perm_name => $perm_options) {
$perm_record['value'] = $perm_options['PermissionValue'];
$perm_record['id'] = $perm_options['PermissionId'];
$this->Permissions[$perm_name] = $perm_record;
}
}
function getPermissionValue($perm_name)
{
return isset($this->Permissions[$perm_name]) ? $this->Permissions[$perm_name]['value'] : 0;
}
function getPermissionID($perm_name)
{
return isset($this->Permissions[$perm_name]) ? $this->Permissions[$perm_name]['id'] : 0;
}
/**
* This is old permission like ADMIN or LOGIN
*
* @param string $section_name
* @param string $perm_name
* @return bool
*/
function isOldPermission($section_name, $perm_name)
{
return $section_name == 'in-portal:root' && $perm_name != 'view';
}
/**
* Returns permission names to check based on event name and item prefix (main item or subitem)
*
* @param kEvent $event
* @return Array
*/
function getPermissionByEvent(&$event, $perm_mapping)
{
$top_prefix = $event->getEventParam('top_prefix');
$pefix_type = ($top_prefix == $event->Prefix) ? 'self' : 'subitem';
$perm_mapping = getArrayValue($perm_mapping, $event->Name);
if (!$perm_mapping[$pefix_type]) {
trigger_error('Permission mappings not defined for event <b>'.$top_prefix.' <- '.$event->Prefix.':'.$event->Name.'</b>', E_USER_ERROR);
}
if ($perm_mapping[$pefix_type] === true) {
// event is defined in mapping but is not checked by permissions
return true;
}
return explode('|', $perm_mapping[$pefix_type]);
}
/**
* Common event permission checking method
*
* @param kEvent $event
*/
function CheckEventPermission(&$event, $perm_mapping)
{
$section = $event->getSection();
if (preg_match('/^CATEGORY:(.*)/', $section)) {
return $this->CheckEventCategoryPermission($event, $perm_mapping);
}
$top_prefix = $event->getEventParam('top_prefix');
$check_perms = $this->getPermissionByEvent($event, $perm_mapping);
if ($check_perms === true) {
// event is defined in mapping but is not checked by permissions
return true;
}
$perm_status = false;
foreach ($check_perms as $perm_name) {
// check if at least one of required permissions is set
$perm_name = $section.'.'.$perm_name;
$perm_status = $this->CheckPermission($perm_name, 1);
if (($perm_name == $section.'.add') && $perm_status && ($top_prefix == $event->Prefix)) {
// main item, add permission allowed, but ID is > 0, then deny permission
// how to get id here
}
if ($perm_status) {
return $perm_status;
}
}
if (!$perm_status) {
if ($this->Application->isDebugMode()) {
// for debugging purposes
$event->SetRedirectParam('section', $section);
$event->SetRedirectParam('main_prefix', $top_prefix);
$event->SetRedirectParam('event_name', $event->Name);
$event->SetRedirectParam('next_template', $this->Application->GetVar('t'));
}
$event->status = erPERM_FAIL;
}
return $perm_status;
}
/**
* Checks non-system permission on event per category basis
*
* @param kEvent $event
*/
function CheckEventCategoryPermission(&$event, $event_perm_mapping)
{
// mapping between specific permissions and common permissions
$perm_mapping = Array('add' => 'ADD', 'add.pending' => 'ADD.PENDING', 'edit' => 'MODIFY', 'edit.pending' => 'MODIFY.PENDING', 'delete' => 'DELETE', 'view' => 'VIEW');
$top_prefix = $event->getEventParam('top_prefix');
$event_handler =& $this->Application->recallObject($event->Prefix.'_EventHandler');
if ($event->Prefix != $top_prefix) {
$top_event = new kEvent($top_prefix.':'.$event->Name);
$id = $event_handler->getPassedID($top_event);
}
else {
$id = $event_handler->getPassedID($event);
}
// 1. get primary category of category item
$id_field = $this->Application->getUnitOption($top_prefix, 'IDField');
$table_name = $this->Application->getUnitOption($top_prefix, 'TableName');
$ci_table = $this->Application->getUnitOption('ci', 'TableName');
if (!$id) {
// item being created -> check by current (before editing started, saved in OnPreCreate event) category permissions
$category_id = $this->Application->RecallVar('m_cat_id');
}
elseif ($top_prefix == 'c') {
$category_id = $id;
}
else {
// item being edited -> check by it's primary category permissions
$sql = 'SELECT ci.CategoryId, main_table.CreatedById
FROM '.$table_name.' main_table
LEFT JOIN '.$ci_table.' ci ON ci.ItemResourceId = main_table.ResourceId
WHERE (main_table.'.$id_field.' = '.$id.') AND (ci.PrimaryCat = 1)';
$item_info = $this->Conn->GetRow($sql);
$category_id = $item_info['CategoryId'];
$owner_id = $item_info['CreatedById'];
}
$item_prefix = $this->Application->getUnitOption($top_prefix, 'PermItemPrefix');
if (substr($event->Name, 0, 9) == 'OnPreSave') {
if ($event_handler->isNewItemCreate($event)) {
return $this->CheckPermission($item_prefix.'.ADD', 0, $category_id) ||
$this->CheckPermission($item_prefix.'.ADD.PENDING', 0, $category_id);
}
else {
return $this->CheckPermission($item_prefix.'.ADD', 0, $category_id) ||
$this->CheckPermission($item_prefix.'.ADD.PENDING', 0, $category_id) ||
$this->ModifyCheckPermission($owner_id, $category_id, $top_prefix);
}
}
$perm_status = false;
$check_perms = $this->getPermissionByEvent($event, $event_perm_mapping);
if ($check_perms === true) {
// event is defined in mapping but is not checked by permissions
return true;
}
foreach ($check_perms as $perm_name) {
// check if at least one of required permissions is set
if (!isset($perm_mapping[$perm_name])) {
// not mapped permission (e.g. advanced:approve) -> skip
continue;
}
$perm_name = $item_prefix.'.'.$perm_mapping[$perm_name];
$this->showDebug('Event <b>'.$event->Name.'</b> permission(-s): <b>'.$perm_name.'</b>', Array());
$perm_status = $this->CheckPermission($perm_name, 0, $category_id);
if ($perm_status) {
return $perm_status;
}
}
if (!$perm_status) {
$event->SetRedirectParam('index_file', 'index.php'); // because called from browse.php
if ($this->Application->isDebugMode()) {
// for debugging purposes
$event->SetRedirectParam('section', $event->getSection());
$event->SetRedirectParam('main_prefix', $top_prefix);
$event->SetRedirectParam('event_name', $event->Name);
$event->SetRedirectParam('next_template', $this->Application->GetVar('t'));
}
$event->status = erPERM_FAIL;
}
return $perm_status;
}
function showDebug($text, $params)
{
$is_ajax = $this->Application->GetVar('ajax') == 'yes' || isset($params['ajax']) || isset($params['tab_init']);
if (!$this->Application->isDebugMode() || $is_ajax) return true;
echo $text.'<br />';
}
function TagPermissionCheck($params, $tag_name)
{
$perm_prefix = getArrayValue($params, 'perm_prefix');
$perm_event = getArrayValue($params, 'perm_event');
$permission_groups = getArrayValue($params, 'permissions');
if ($permission_groups) {
// check permissions by permission names in current category
$this->showDebug('Tag <b>'.$tag_name.'</b> permission(-s): <b>'.$permission_groups.'</b>', $params);
$permission_groups = explode('|', $permission_groups);
$group_has_permission = false;
$perm_category = $this->Application->GetVar('m_cat_id');
if ($perm_prefix) {
// use primary category of item with id from {perm_prefix}_id as base for permission checking
$perm_category = $this->getPrimaryCategory($perm_prefix);
}
foreach ($permission_groups as $permission_group) {
$permissions = explode(',', $permission_group);
$has_permission = true;
foreach ($permissions as $permission) {
$has_permission = $has_permission && $this->CheckPermission($permission, isset($params['system']) && $params['system'] ? 1 : 0, $perm_category);
}
$group_has_permission = $group_has_permission || $has_permission;
if ($group_has_permission) {
return true;
}
}
return false;
}
elseif ($perm_event) {
// check permission by event name
$this->showDebug('Tag <b>'.$tag_name.'</b> permission_event: <b>'.$perm_event.'</b>', $params);
list($prefix, $event) = explode(':', $perm_event);
$event_handler =& $this->Application->recallObject($prefix.'_EventHandler');
return $event_handler->CheckPermission( new kEvent($perm_event) );
}
return true;
}
/**
* Returns item's primary category (get item_id from request)
*
* @param string $prefix
* @return int
*/
function getPrimaryCategory($prefix)
{
$id_field = $this->Application->getUnitOption($prefix, 'IDField');
$table_name = $this->Application->getUnitOption($prefix, 'TableName');
$id = $this->Application->GetVar($prefix.'_id');
if (!$id) return $this->Application->GetVar('m_cat_id');
$sql = 'SELECT ResourceId
FROM '.$table_name.'
WHERE '.$id_field.' = '.$id;
$resource_id = $this->Conn->GetOne($sql);
$sql = 'SELECT CategoryId
FROM '.$this->Application->getUnitOption('ci', 'TableName').'
WHERE ItemResourceId = '.$resource_id.' AND PrimaryCat = 1';
return $this->Conn->GetOne($sql);
}
/**
* Returns no permission template to redirect to
*
* @param Array $params
* @return Array
*/
function getPermissionTemplate($params)
{
$t = $this->Application->GetVar('t');
if ($next_t = getArrayValue($params, 'next_template')) {
$t = $next_t;
}
if (!$this->Application->LoggedIn()) {
$redirect_template = $params['login_template'];
+ if (!$redirect_template && $this->Application->IsAdmin()) $redirect_template = 'login';
$redirect_params = Array('next_template' => $t);
}
else {
if (isset($params['no_permissions_template'])) {
$redirect_template = $params['no_permissions_template'];
}
else {
$redirect_template = $this->Application->IsAdmin() ? 'no_permission' : $this->Application->ConfigValue('NoPermissionTemplate');
}
$redirect_params = $this->Application->isDebugMode() ? Array('from_template' => 1, 'perms' => $params[ isset($params['permissions']) ? 'permissions' : 'perm_event'], 'next_template' => $t) : Array();
}
if (isset($params['index_file']) && $params['index_file']) {
$redirect_params['index_file'] = $params['index_file'];
}
return Array($redirect_template, $redirect_params);
}
/**
* Check current user permissions based on it's group permissions in specified category (for non-system permissions) or just checks if system permission is set
*
* @param string $name permission name
* @param int $cat_id category id, current used if not specified
* @param int $type permission type {1 - system, 0 - per category}
* @return int
*/
function CheckPermission($name, $type = 1, $cat_id = null)
{
- if ($this->Application->GetVar('u_id') == -1) {
+ $user_id = $this->Application->GetVar('u_id');
+ return $this->CheckUserPermission($user_id, $name, $type, $cat_id);
+ }
+
+ function CheckUserPermission($user_id, $name, $type = 1, $cat_id = null)
+ {
+ if ($user_id == -1) {
// "root" is allowed anywhere
return $name == 'SYSTEM_ACCESS.READONLY' ? 0 : 1;
}
if ($type == 1) {
// "system" permission are always checked per "Home" category (ID = 0)
$cat_id = 0;
}
if (!isset($cat_id)) {
$cat_id = $this->Application->GetVar('m_cat_id');
}
$cache_key = $name.'|'.$type.'|'.$cat_id;
$perm_value = $this->Application->getCache('permissions', $cache_key);
if ($perm_value !== false) {
return $perm_value;
}
// perm cache is build only based on records in db, that's why if permission is not explicitly denied, then
// that (perm cache creator) code thinks that it is allowed & adds corresponding record and code below will
// return incorrect results
if (preg_match('/(.*)\.VIEW$/', $name) && ($type == 0)) {
// cached view permission of category: begin
$sql = 'SELECT PermissionConfigId
FROM '.TABLE_PREFIX.'PermissionConfig
WHERE PermissionName = '.$this->Conn->qstr($name);
$perm_id = $this->Conn->GetOne($sql);
$sql = 'SELECT PermId
FROM '.TABLE_PREFIX.'PermCache
WHERE (PermId = '.$perm_id.') AND (CategoryId = '.$cat_id.')';
$view_filters = Array();
- $groups = explode(',', $this->Application->RecallVar('UserGroups'));
+ if ($user_id == $this->Application->GetVar('u_id')) {
+ $groups = explode(',', $this->Application->RecallVar('UserGroups'));
+ }
+ else { // checking not current user
+ $sql = 'SELECT GroupId FROM '.TABLE_PREFIX.'UserGroup
+ WHERE (PortalUserId = '.$user_id.') AND
+ ( (MembershipExpires IS NULL) OR ( MembershipExpires >= UNIX_TIMESTAMP() ) )';
+ $groups = $this->Conn->GetCol($sql);
+ array_push($groups, $this->Application->ConfigValue('User_LoggedInGroup') );
+ }
foreach ($groups as $group) {
$view_filters[] = 'FIND_IN_SET('.$group.', ACL)';
}
$sql .= ' AND ('.implode(' OR ', $view_filters).')';
$perm_value = $this->Conn->GetOne($sql) ? 1 : 0;
$this->Application->setCache('permissions', $cache_key, $perm_value);
return $perm_value;
// cached view permission of category: end
}
if ($cat_id == 0) {
$cat_hierarchy = Array(0);
}
else {
$sql = 'SELECT ParentPath
FROM '.$this->Application->getUnitOption('c', 'TableName').'
WHERE CategoryId = '.$cat_id;
$cat_hierarchy = $this->Conn->GetOne($sql);
$cat_hierarchy = explode('|', substr($cat_hierarchy, 1, -1));
$cat_hierarchy = array_reverse($cat_hierarchy);
array_push($cat_hierarchy, 0);
}
$perm_value = 0;
$groups = $this->Application->RecallVar('UserGroups');
foreach ($cat_hierarchy as $category_id) {
$sql = 'SELECT SUM(PermissionValue)
FROM '.TABLE_PREFIX.'Permissions
WHERE Permission = "'.$name.'" AND CatId = '.$category_id.' AND GroupId IN ('.$groups.') AND Type = '.$type;
$res = $this->Conn->GetOne($sql);
if ($res !== false && !is_null($res)) {
$perm_value = $res ? 1 : 0;
break;
}
}
$this->Application->setCache('permissions', $cache_key, $perm_value);
return $perm_value;
}
/**
* Allows to check MODIFY & OWNER.MODFY +/- PENDING permission combinations on item
*
* @param int $owner_id user_id, that is owner of the item
* @param int $category_id primary category of item
* @param string $prefix prefix of item
* @return int {0 - no MODIFY permission, 1 - has MODIFY permission, 2 - has MODIFY.PENDING permission}
*/
function ModifyCheckPermission($owner_id, $category_id, $prefix)
{
$perm_prefix = $this->Application->getUnitOption($prefix, 'PermItemPrefix');
$live_modify = $this->CheckPermission($perm_prefix.'.MODIFY', ptCATEGORY, $category_id);
if ($live_modify) {
return 1;
}
else if ($this->CheckPermission($perm_prefix.'.MODIFY.PENDING', ptCATEGORY, $category_id)) {
return 2;
}
if ($owner_id == $this->Application->GetVar('u_id')) {
// user is item's OWNER -> check this permissions first
$live_modify = $this->CheckPermission($perm_prefix.'.OWNER.MODIFY', ptCATEGORY, $category_id);
if ($live_modify) {
return 1;
}
else if ($this->CheckPermission($perm_prefix.'.OWNER.MODIFY.PENDING', ptCATEGORY, $category_id)) {
return 2;
}
}
return 0;
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/general/helpers/permissions_helper.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.18
\ No newline at end of property
+1.19
\ No newline at end of property
Index: trunk/kernel/units/general/helpers/mod_rewrite_helper.php
===================================================================
--- trunk/kernel/units/general/helpers/mod_rewrite_helper.php (revision 6427)
+++ trunk/kernel/units/general/helpers/mod_rewrite_helper.php (revision 6428)
@@ -1,466 +1,485 @@
<?php
class kModRewriteHelper extends kHelper {
function kModRewriteHelper()
{
parent::kHelper();
$this->HTTPQuery =& $this->Application->recallObject('HTTPQuery');
}
function SetDefaultValues(&$vars)
{
$defaults = Array('m_cat_id' => 0, 'm_cat_page' => 1, 'm_opener' => 's');
foreach ($defaults as $default_key => $default_value)
{
if ($this->HTTPQuery->Get($default_key) == null) {
$vars[$default_key] = $default_value;
}
}
}
function ProcessLanguage(&$url_parts, &$vars)
{
if (!isset($url_parts[0])) return false;
$res = false;
$url_part = array_shift($url_parts);
$sql = 'SELECT LanguageId FROM '.TABLE_PREFIX.'Language WHERE LOWER(PackName) = '.$this->Conn->qstr($url_part).' AND Enabled = 1';
$language_id = $this->Conn->GetOne($sql);
$this->Application->Phrases = new PhrasesCache();
if($language_id)
{
$vars['m_lang'] = $language_id;
$res = true;
}
- $this->Application->VerifyLanguageId();
+// $this->Application->VerifyLanguageId();
if (!$res) {
array_unshift($url_parts, $url_part);
}
return $res;
}
function ProcessTheme(&$url_parts, &$vars)
{
if (!isset($url_parts[0])) return false;
$res = false;
$url_part = array_shift($url_parts);
$sql = 'SELECT ThemeId FROM '.TABLE_PREFIX.'Theme WHERE LOWER(Name) = '.$this->Conn->qstr($url_part).' AND Enabled = 1';
$theme_id = $this->Conn->GetOne($sql);
if($theme_id)
{
$vars['m_theme'] = $theme_id;
$res = true;
}
- $this->Application->VerifyThemeId(); // verify anyway - will set default if not found!!!
+// $this->Application->VerifyThemeId(); // verify anyway - will set default if not found!!!
if (!$res) {
array_unshift($url_parts, $url_part);
}
return $res;
}
function ProcessCategory(&$url_parts, &$vars)
{
if (!isset($url_parts[0])) return false;
$res = false;
$url_part = array_shift($url_parts);
$category_id = 0;
$last_category_id = 0;
$category_path = '';
do
{
$category_path = trim($category_path.'/'.$url_part, '/');
if( preg_match('/(.*)_([\d]+)$/', $category_path, $rets) )
{
$category_path = $rets[1];
$vars['m_cat_page'] = $rets[2];
}
$category_id = $this->Conn->GetOne(
'SELECT CategoryId
FROM '.TABLE_PREFIX.'Category
WHERE Status = 1 AND NamedParentPath = '.$this->Conn->qstr($category_path));
if ($category_id !== false) {
$last_category_id = $category_id;
$url_part = array_shift($url_parts);
$res = true;
}
} while ($category_id !== false && $url_part);
$vars['m_cat_id'] = $last_category_id;
if ($url_part) {
array_unshift($url_parts, $url_part);
}
return $res;
}
+ function ProcessPage(&$url_parts, &$vars)
+ {
+ if (!is_numeric($url_parts[0]) || count($url_parts) > 1) return false;
+
+ // set module pages for all modules, since we don't know which module will need it
+ foreach ($this->Application->ModuleInfo as $module_name => $module_data)
+ {
+ $vars[ $module_data['Var'].'_id'] = 0;
+ $vars[ $module_data['Var'].'_Page'] = $url_parts[0];
+ $vars[ $module_data['Var'].'_Reviews_Page'] = 0;
+ }
+ return true;
+ }
+
function ProcessModuleIndex(&$url_parts, &$vars)
{
if ( count($url_parts) > 1) return false; // if no more parts or only 1 part left
if ( $url_parts && $url_parts[0] == 'index') { // treat index same as no parts
array_shift($url_parts);
}
if( $url_parts ) { // if parts are left, it can only be module page
if (!is_numeric($url_parts[0])) return false;
-
- // set module pages for all modules, since we don't know which module will need it
- foreach ($this->Application->ModuleInfo as $module_name => $module_data)
- {
- $vars[ $module_data['Var'].'_id'] = 0;
- $vars[ $module_data['Var'].'_Page'] = $url_parts[0];
- $vars[ $module_data['Var'].'_Reviews_Page'] = 0;
- }
+ $this->ProcessPage($url_parts, $vars);
}
// try to find CMS index page of the category
if ($this->Application->isModuleEnabled('In-CMS')) {
$sql = 'SELECT p.Path, ci.CategoryId FROM '.TABLE_PREFIX.'Pages AS p
LEFT JOIN '.TABLE_PREFIX.'CategoryItems AS ci
ON ci.ItemResourceId = p.ResourceId
WHERE
p.IsIndex = 1
AND
p.Status = 1
AND
CategoryId = '.$vars['m_cat_id'].'
AND
ci.PrimaryCat = 1';
$template_found = $this->Conn->GetRow($sql);
if ($template_found !== false) {
$vars['t'] = $template_found['Path'];
return true;
}
}
$sql = 'SELECT CachedCategoryTemplate
FROM '.TABLE_PREFIX.'Category
WHERE CategoryId = '.$vars['m_cat_id'];
$vars['t'] = $this->Conn->GetOne($sql);
if (!$vars['t']) $vars['t'] = 'index';
return true;
}
function ProcessModuleItem(&$url_parts, &$vars, $set_t=true)
{
if (preg_match('/^bb_.*/', $url_parts[0])) {
$cat_item = $this->Conn->GetRow('
SELECT c.ParentPath, c.CategoryId FROM '.TABLE_PREFIX.'Category AS c
WHERE
c.CategoryId = '.$vars['m_cat_id']);
if ($set_t) {
$item_template = $this->GetItemTemplate($cat_item, 'bb');
$vars['t'] = $item_template;
}
$this->Application->HandleEvent($bb_event, 'bb:ParseEnv', Array('url_parts' => $url_parts, 'vars' => $vars));
$vars = $bb_event->getEventParam('vars');
return 'bb';
}
if (!isset($url_parts[0])) return false;
if ( count($url_parts) != 1 ) return false;
$url_part = array_shift($url_parts);
// match module reviews page
$page = 1;
if( preg_match('/(.*)_([\d]+)$/', $url_part, $rets) )
{
$url_part = $rets[1];
$page = $rets[2];
}
// locating the item in CategoryItems by filename to detect its ItemPrefix and its category ParentPath
$cat_item = $this->Conn->GetRow('
SELECT ci.ItemResourceId, ci.ItemPrefix, c.ParentPath, ci.CategoryId FROM '.TABLE_PREFIX.'CategoryItems AS ci
LEFT JOIN '.TABLE_PREFIX.'Category AS c
ON c.CategoryId = ci.CategoryId
WHERE
ci.CategoryId = '.$vars['m_cat_id'].'
AND
ci.Filename = '.$this->Conn->qstr($url_part));
if ($cat_item !== false) { // item found
$module_prefix = $cat_item['ItemPrefix'];
$item_template = $this->GetItemTemplate($cat_item, $module_prefix);
// converting ResourceId to correpsonding Item id
$module_config = $this->Application->getUnitOptions($module_prefix);
$item_id = $this->Conn->GetOne(
'SELECT '.$module_config['IDField'].' FROM '.$module_config['TableName'].'
WHERE ResourceId = '.$cat_item['ItemResourceId']
);
if ((!$set_t || $item_template) && $item_id) {
if ($set_t) {
$vars['t'] = $item_template;
}
$vars[ $module_prefix.'_id' ] = $item_id;
$vars[ $module_prefix.'_Reviews_Page' ] = $page;
return $module_prefix;
}
}
array_unshift($url_parts, $url_part);
return false;
}
function GetItemTemplate($category, $module_prefix)
{
if (!is_array($category)) {
$category = $this->Conn->GetRow('
SELECT c.ParentPath, c.CategoryId FROM '.TABLE_PREFIX.'Category AS c
WHERE
c.CategoryId = '.$category);
}
$parent_path = implode(',',explode('|', substr($category['ParentPath'], 1, -1)));
// item template is stored in module' system custom field - need to get that field Id
$item_template_field_id = $this->Conn->GetOne(
'SELECT CustomFieldId
FROM '.TABLE_PREFIX.'CustomField
WHERE FieldName = '.$this->Conn->qstr($module_prefix.'_ItemTemplate'));
// looking for item template through cats hierarchy sorted by parent path
$query = 'SELECT ccd.l1_cust_'.$item_template_field_id.',
FIND_IN_SET(c.CategoryId, '.$this->Conn->qstr($parent_path).') AS Ord1,
c.CategoryId, c.Name, ccd.l1_cust_'.$item_template_field_id.'
FROM '.TABLE_PREFIX.'Category AS c
LEFT JOIN '.TABLE_PREFIX.'CategoryCustomData AS ccd
ON ccd.ResourceId = c.ResourceId
WHERE c.CategoryId IN ('.$parent_path.') AND ccd.l1_cust_'.$item_template_field_id.' != \'\'
ORDER BY FIND_IN_SET(c.CategoryId, '.$this->Conn->qstr($parent_path).') DESC';
$item_template = $this->Conn->GetOne($query);
return $item_template;
}
function ProcessPhisycalTemplate(&$url_parts, &$vars)
{
if (!isset($url_parts[0])) return false;
$remaining = array();
do
{
$template_path = implode('/', $url_parts);
$t_parts['path'] = dirname($template_path) == '.' ? '' : '/'.dirname($template_path);
$t_parts['file'] = basename($template_path);
$sql = 'SELECT FileId
FROM '.TABLE_PREFIX.'ThemeFiles
WHERE (FilePath = '.$this->Conn->qstr($t_parts['path']).') AND (FileName = '.$this->Conn->qstr($t_parts['file'].'.tpl').')';
// $sql = 'SELECT FileId FROM '.TABLE_PREFIX.'ThemeFiles WHERE CONCAT(FilePath, "/", FileName) = '.$this->Conn->qstr('/'.$template_path.'.tpl');
$template_found = $this->Conn->GetOne($sql);
if(!$template_found)
{
array_unshift($remaining, array_pop($url_parts));
}
} while (!$template_found && $url_parts);
$url_parts = $remaining;
if ($template_found) {
$vars['t'] = $template_path;
return true;
}
return false;
}
/**
* Checks if whole url_parts matches a whole In-CMS page
*
* @param array $url_parts
* @return boolean
*/
function ProcessVirtualTemplate(&$url_parts, &$vars)
{
- if (!isset($url_parts[0]) || !$this->Application->isModuleEnabled('In-CMS')) return false;
+ if (!isset($url_parts[0]) || !$this->Application->isModuleEnabled('In-Edit')) return false;
$template_path = implode('/', $url_parts);
$sql = 'SELECT p.PageId, ci.CategoryId FROM '.TABLE_PREFIX.'Pages AS p
LEFT JOIN '.TABLE_PREFIX.'CategoryItems AS ci
ON ci.ItemResourceId = p.ResourceId
WHERE
Path = '.$this->Conn->qstr($template_path).'
AND
ci.PrimaryCat = 1
AND
p.Status = 1';
$template_found = $this->Conn->GetRow($sql);
if ($template_found) {
$vars['m_cat_id'] = $template_found['CategoryId'];
$vars['t'] = $template_path;
return true;
}
return false;
}
function processRewriteURL()
{
$passed = array();
$url = $this->HTTPQuery->Get('_mod_rw_url_');
if( substr($url, -5) == '.html' ) $url = substr($url, 0, strlen($url) - 5 );
$restored = false;
$cache = $this->Conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "mod_rw_'.md5($url).'"');
if (false && $cache && $cache['Cached'] > 0) {
$cache = unserialize($cache['Data']);
$vars = $cache['vars'];
$passed = $cache['passed'];
$restored = true;
}
else {
$passed = array();
$vars = $this->parseRewriteURL($url,$passed);
$cache = array('vars'=>$vars,'passed'=>$passed);
$this->Conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("mod_rw_'.md5($url).'", '.$this->Conn->qstr(serialize($cache)).', '.adodb_mktime().')');
}
foreach ($vars as $name => $value)
{
$this->HTTPQuery->Set($name,$value);
}
- if ($restored) {
+// if ($restored) {
$this->InitAll();
- }
+// }
$this->HTTPQuery->finalizeParsing($passed);
}
function InitAll()
{
- $this->Application->Phrases = new PhrasesCache();
+// $this->Application->Phrases = new PhrasesCache();
$this->Application->VerifyLanguageId();
$this->Application->Phrases->Init('phrases');
$this->Application->VerifyThemeId();
}
function parseRewriteURL($url, &$passed)
{
$vars = $this->Conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "mod_rw_'.md5($url).'"');
if (false && $vars && $vars['Cached'] > 0) {
$vars = unserialize($menu['Data']);
return $vars;
}
$vars = array();
$url_parts = $url ? explode('/', $url) : Array();
$process_module = true;
if($this->HTTPQuery->Get('rewrite') == 'on' || !$url_parts)
{
$this->SetDefaultValues($vars);
}
if(!$url_parts)
{
$this->InitAll();
$vars['t'] = $this->HTTPQuery->getDefaultTemplate('');
$passed[] = 'm';
return $vars;
}
else
{
$vars['t'] = '';
}
$passed = Array('m');
$this->ProcessLanguage($url_parts, $vars);
$this->ProcessTheme($url_parts, $vars);
if ( $this->ProcessVirtualTemplate($url_parts, $vars) ) {
return $vars;
}
$this->ProcessCategory($url_parts, $vars);
-
-
if ( $this->ProcessModuleIndex($url_parts, $vars) ) {
foreach ($this->Application->ModuleInfo as $module_name => $info) {
$passed[] = $info['Var'];
}
return $vars;
}
if ( $module_prefix = $this->ProcessModuleItem($url_parts, $vars) ) {
$passed[] = $module_prefix;
return $vars;
}
/*// match module
$next_template = $this->HTTPQuery->Get('next_template');
if($url_part || $next_template)
{
if($next_template)
{
$next_template_parts = explode('/', $next_template);
$module_folder = array_shift($next_template_parts);
}
else
{
$module_folder = $url_part;
}
foreach ($this->Application->ModuleInfo as $module_name => $module_data)
{
if( trim($module_data['TemplatePath'], '/') == $module_folder )
{
$module_prefix = $module_data['Var'];
break;
}
}
}*/
if ( $this->ProcessPhisycalTemplate($url_parts, $vars) ) {
if (!$url_parts) {
return $vars;
}
}
+ if ( $this->ProcessPage($url_parts, $vars) ) {
+ return $vars;
+ }
+
if ( $module_prefix = $this->ProcessModuleItem($url_parts, $vars, false) ) {
$passed[] = $module_prefix;
return $vars;
}
+ if ( $this->Application->isModuleEnabled('In-Edit') && $this->Application->GetVar('admin') == 1) {
+ $adm_ses =& $this->Application->recallObject('Session.admin');
+ $user = $adm_ses->RecallVar('user_id');
+ $perm_helper =& $this->Application->recallObject('PermissionsHelper');
+ if ($perm_helper->CheckUserPermission($user, 'PAGE.ADD', 0)) {
+ $vars['t'] = implode('/', $url_parts);
+ return $vars;
+ }
+ }
+
$not_found = $this->Application->ConfigValue('ErrorTemplate');
$vars['t'] = $not_found ? $not_found : 'error_notfound';
header('HTTP/1.0 404 Not Found');
return $vars;
// $this->HTTPQuery->finalizeParsing($passed, $module_params);
// pass params left to module
/*$this->Application->Phrases->Init('phrases');
$passed = Array('m');
$module_params = Array();
if ( isset($module_prefix) ) {
$passed[] = $module_prefix;
$module_event = new kEvent($module_prefix.':ParseEnv', Array('url_parts' => $url_parts) );
if ($process_module) {
$this->Application->HandleEvent($module_event);
}
$item_id = $this->HTTPQuery->Get($module_prefix.'_id');
$module_params = Array($module_prefix.'_id' => $item_id ? $item_id : '0' );
if ($module_event->status == erFAIL) {
$not_found = $this->Application->ConfigValue('ErrorTemplate');
$this->HTTPQuery->Set('t', $not_found ? $not_found : 'error_notfound' );
}
}
$this->HTTPQuery->finalizeParsing($passed, $module_params);*/
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/general/helpers/mod_rewrite_helper.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5
\ No newline at end of property
+1.6
\ No newline at end of property
Index: trunk/kernel/units/general/main_event_handler.php
===================================================================
--- trunk/kernel/units/general/main_event_handler.php (revision 6427)
+++ trunk/kernel/units/general/main_event_handler.php (revision 6428)
@@ -1,125 +1,129 @@
<?php
class MainEventHandler extends kEventHandler {
/**
* Description
*
* @var kDBConnection
* @access public
*/
var $Conn;
/**
* Adds ability to address db connection
*
* @return kDBEventHandler
* @access public
*/
function MainEventHandler()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
/**
* Created url part for this module
*
* @param kEvent $event
*/
function BuildEnv(&$event)
{
$prefix_special = $event->getPrefixSpecial();
$url_params = $event->getEventParam('url_params');
$query_vars = $this->Application->getUnitOption($event->Prefix, 'QueryString');
//if pass events is off and event is not implicity passed
if ( !$event->getEventParam('pass_events') && !isset($url_params[$prefix_special.'_event']) )
{
$url_params[$prefix_special.'_event'] = ''; // remove event from url if requested
//otherwise it will use value from get_var
}
if(!$query_vars) return true;
$processed_params = Array();
foreach($query_vars as $index => $var_name)
{
//if value passed in params use it, otherwise use current from application
$var_name = $prefix_special.'_'.$var_name;
$processed_params[$var_name] = isset( $url_params[$var_name] ) ? $url_params[$var_name] : $this->Application->GetVar($var_name);
if ( isset($url_params[$var_name]) ) unset( $url_params[$var_name] );
}
$ret = '';
$default_language_id = $this->Application->GetDefaultLanguageId();
if( $processed_params['m_lang'] && ($processed_params['m_lang'] != $default_language_id) )
{
$language_name = $this->Application->getCache('language_names', $processed_params['m_lang']);
if ($language_name === false) {
$sql = 'SELECT PackName
FROM '.TABLE_PREFIX.'Language
WHERE LanguageId = '.$processed_params['m_lang'];
$language_name = $this->Conn->GetOne($sql);
$this->Application->setCache('language_names', $processed_params['m_lang'], $language_name);
}
$ret .= $language_name.'/';
}
$default_theme_id = $this->Application->GetDefaultThemeId();
if( $processed_params['m_theme'] && ($processed_params['m_theme'] != $default_theme_id) )
{
$theme_name = $this->Application->getCache('theme_names', $processed_params['m_theme']);
if ($theme_name === false) {
$sql = 'SELECT Name
FROM '.TABLE_PREFIX.'Theme
WHERE ThemeId = '.$processed_params['m_theme'];
$theme_name = $this->Conn->GetOne($sql);
$this->Application->setCache('theme_names', $processed_params['m_theme'], $theme_name);
}
$ret .= $theme_name.'/';
}
- if ($processed_params['m_cat_id'] > 0) {
+ if ($processed_params['m_cat_id'] > 0 && isset($url_params['pass_category']) && $url_params['pass_category']) {
$ret .= $this->Application->getFilename('c', $processed_params['m_cat_id']).'/';
$url_params['category_processed'] = true;
}
+ else {
+// $url_params['no_category'] = 1; // for debugging
+ }
+ unset($url_params['pass_category']); // unset it just in case
$force_page_adding = false;
if (getArrayValue($url_params, 'reset'))
{
unset($url_params['reset']);
if ($processed_params['m_cat_id'])
{
$processed_params['m_cat_page'] = 1;
$force_page_adding = true;
}
}
if( $processed_params['m_cat_page'] > 1 || $force_page_adding )
{
$ret = preg_replace('/(.*)\//', '\\1', $ret).'_'.$processed_params['m_cat_page'].'/';
}
$template = getArrayValue($url_params, 't');
$category_template = $processed_params['m_cat_id'] ? $this->Application->getCache('category_templates', $processed_params['m_cat_id']) : '';
// remove template from url if it is category index cached template
if ($template == $category_template || strtolower($template) == '__default__') {
$template = '';
}
if ($template) {
$ret .= $template.'/';
}
unset($url_params['t']);
$event->setEventParam('url_params', $url_params);
$event->setEventParam('env_string', strtolower($ret) );
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/general/main_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.14
\ No newline at end of property
+1.15
\ No newline at end of property
Index: trunk/kernel/units/general/inp_ses_storage.php
===================================================================
--- trunk/kernel/units/general/inp_ses_storage.php (revision 6427)
+++ trunk/kernel/units/general/inp_ses_storage.php (revision 6428)
@@ -1,118 +1,125 @@
<?php
class InpSession extends Session
{
function Init($prefix,$special)
{
$this->SessionTimeout = $this->Application->ConfigValue('SessionTimeout');
$path = (BASE_PATH == '') ? '/' : BASE_PATH;
- if ( $this->Application->IsAdmin() ) $path = rtrim($path, '/').'/admin';
+// if ( $this->Application->IsAdmin() ) $path = rtrim($path, '/').'/admin';
$this->SetCookiePath($path);
$cookie_name = $this->Application->ConfigValue('SessionCookieName');
- $this->SetCookieName($cookie_name ? $cookie_name : 'sid');
+ if (!$cookie_name) $cookie_name = 'sid';
+ if (($this->Application->IsAdmin() && $special !== 'front') || $special == 'admin' ) { // || $this->Application->GetVar('admin') == 1
+ $cookie_name = 'adm_'.$cookie_name;
+ }
+ $this->SetCookieName($cookie_name);
$this->SetCookieDomain(SERVER_NAME);
- if( $this->Application->IsAdmin() )
+ if( $this->Application->IsAdmin()) // && $this->Application->GetVar('admin') != 1
{
$mode = constOn('IS_INSTALL') ? smCOOKIES_ONLY : smAUTO;
}
+ /*elseif ($this->Application->IsAdmin() && $this->Application->GetVar('admin') == 1) {
+ $mode = smCOOKIES_ONLY;
+ }*/
else
{
$ses_mode = $this->Application->ConfigValue('CookieSessions');
if ($ses_mode == 2) $mode = smAUTO;
if ($ses_mode == 1) $mode = smCOOKIES_ONLY;
if ($ses_mode == 0) $mode = smGET_ONLY;
}
$this->SetMode($mode);
parent::Init($prefix,$special);
if( !$this->Application->IsAdmin() && $this->GetField('PortalUserId') <= 0 )
{
$group_list = $this->Application->ConfigValue('User_GuestGroup').','.$this->Application->ConfigValue('User_LoggedInGroup');
$this->SetField('GroupId', $this->Application->ConfigValue('User_GuestGroup'));
$this->SetField('GroupList', $group_list);
}
}
}
class InpSessionStorage extends SessionStorage {
function Init($prefix,$special)
{
parent::Init($prefix,$special);
$this->setTableName(TABLE_PREFIX.'UserSession');
$this->SessionDataTable = TABLE_PREFIX.'SessionData';
$this->setIDField('SessionKey');
$this->TimestampField = 'LastAccessed';
$this->DataValueField = 'VariableValue';
$this->DataVarField = 'VariableName';
}
function LocateSession($sid)
{
$res = parent::LocateSession($sid);
if ($res) {
$this->Expiration += $this->SessionTimeout;
}
return $res;
}
function UpdateSession(&$session)
{
$time = adodb_mktime();
// Update LastAccessed only if it's newer than 1/10 of session timeout - perfomance optimization to eliminate needless updates on every click
if ($time - $this->DirectVars['LastAccessed'] > $this->SessionTimeout/10) {
$this->SetField($session, $this->TimestampField, $time);
}
}
function StoreSession(&$session, $additional_fields = Array())
{
$fields_hash = Array( 'PortalUserId' => $this->Application->IsAdmin() ? 0 : -2, // Guest
'Language' => $this->Application->GetDefaultLanguageId(),
'Theme' => $this->Application->GetDefaultThemeId(),
'IpAddress' => $_SERVER['REMOTE_ADDR'],
'GroupList' => $this->Application->ConfigValue('User_GuestGroup'),
'CurrentTempKey'=> $session->SID,
);
parent::StoreSession($session, $fields_hash);
}
function GetExpiredSIDs()
{
$query = ' SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE '.$this->TimestampField.' < '.(adodb_mktime()-$this->SessionTimeout);
$ret = $this->Conn->GetCol($query);
if($ret) {
$this->DeleteEditTables();
}
return $ret;
}
function DeleteEditTables()
{
$tables = $this->Conn->GetCol('SHOW TABLES');
$mask_edit_table = '/'.TABLE_PREFIX.'ses_(.*)_edit_(.*)/';
$mask_search_table = '/'.TABLE_PREFIX.'ses_(.*?)_(.*)/';
$sql='SELECT COUNT(*) FROM '.$this->TableName.' WHERE '.$this->IDField.' = \'%s\'';
foreach($tables as $table)
{
if( preg_match($mask_edit_table,$table,$rets) || preg_match($mask_search_table,$table,$rets) )
{
$sid=$rets[1];
$is_alive = $this->Conn->GetOne( sprintf($sql,$sid) );
if(!$is_alive) $this->Conn->Query('DROP TABLE IF EXISTS '.$table);
}
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/general/inp_ses_storage.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.20
\ No newline at end of property
+1.21
\ No newline at end of property
Index: trunk/kernel/admin_templates/incs/script.js
===================================================================
--- trunk/kernel/admin_templates/incs/script.js (revision 6427)
+++ trunk/kernel/admin_templates/incs/script.js (revision 6428)
@@ -1,1035 +1,1035 @@
if ( !( isset($init_made) && $init_made ) ) {
var Grids = new Array();
var Toolbars = new Array();
var $Menus = new Array();
var $ViewMenus = new Array();
var $form_name = 'kernel_form';
if(!$fw_menus) var $fw_menus = new Array();
var $env = '';
var submitted = false;
var $edit_mode = false;
var $init_made = true; // in case of double inclusion of script.js :)
// hook processing
var hBEFORE = 1; // this is const, but including this twice causes errors
var hAFTER = 2; // this is const, but including this twice causes errors
var $hooks = new Array();
}
function getArrayValue()
{
var $value = arguments[0];
var $current_key = 0;
$i = 1;
while ($i < arguments.length) {
$current_key = arguments[$i];
if (isset($value[$current_key])) {
$value = $value[$current_key];
}
else {
return false;
}
$i++;
}
return $value;
}
function setArrayValue()
{
// first argument - array, other arguments - keys (arrays too), last argument - value
var $array = arguments[0];
var $current_key = 0;
$i = 1;
while ($i < arguments.length - 1) {
$current_key = arguments[$i];
if (!isset($array[$current_key])) {
$array[$current_key] = new Array();
}
$array = $array[$current_key];
$i++;
}
$array[$array.length] = arguments[arguments.length - 1];
}
function processHooks($function_name, $hook_type, $prefix_special)
{
var $i = 0;
var $local_hooks = getArrayValue($hooks, $function_name, $hook_type);
while($i < $local_hooks.length) {
$local_hooks[$i]($function_name, $prefix_special);
$i++;
}
}
function registerHook($function_name, $hook_type, $hook_body)
{
setArrayValue($hooks, $function_name, $hook_type, $hook_body);
}
function resort_grid($prefix_special, $field, $ajax)
{
set_form($prefix_special, $ajax);
set_hidden_field($prefix_special + '_Sort1', $field);
submit_event($prefix_special, 'OnSetSorting', null, null, $ajax);
}
function direct_sort_grid($prefix_special, $field, $direction, $field_pos, $ajax)
{
if(!isset($field_pos)) $field_pos = 1;
set_form($prefix_special, $ajax);
set_hidden_field($prefix_special+'_Sort'+$field_pos,$field);
set_hidden_field($prefix_special+'_Sort'+$field_pos+'_Dir',$direction);
set_hidden_field($prefix_special+'_SortPos',$field_pos);
submit_event($prefix_special,'OnSetSortingDirect', null, null, $ajax);
}
function reset_sorting($prefix_special)
{
submit_event($prefix_special,'OnResetSorting');
}
function set_per_page($prefix_special, $per_page, $ajax)
{
set_form($prefix_special, $ajax);
set_hidden_field($prefix_special + '_PerPage', $per_page);
submit_event($prefix_special, 'OnSetPerPage', null, null, $ajax);
}
function submit_event(prefix_special, event, t, form_action, $ajax)
{
if ($ajax) {
return $Catalog.submit_event(prefix_special, event, t);
}
if (event) {
set_hidden_field('events[' + prefix_special + ']', event);
}
if (t) set_hidden_field('t', t);
if (form_action) {
var old_env = '';
if (!form_action.match(/\?/)) {
document.getElementById($form_name).action.match(/.*(\?.*)/);
old_env = RegExp.$1;
}
document.getElementById($form_name).action = form_action + old_env;
}
submit_kernel_form();
}
function submit_action($url, $action)
{
$form = document.getElementById($form_name);
$form.action = $url;
set_hidden_field('Action', $action);
submit_kernel_form();
}
function show_form_data()
{
var $kf = document.getElementById($form_name);
$ret = '';
for(var i in $kf.elements)
{
$elem = $kf.elements[i];
$ret += $elem.id + ' = ' + $elem.value + "\n";
}
alert($ret);
}
function submit_kernel_form()
{
if (submitted) {
return;
}
submitted = true;
var $form = document.getElementById($form_name);
processHooks('SubmitKF', hBEFORE);
if (typeof $form.onsubmit == "function") {
$form.onsubmit();
}
$form.submit();
processHooks('SubmitKF', hAFTER);
$form.target = '';
$form.t.value = t;
window.setTimeout(function() {submitted = false}, 500);
}
function set_event(prefix_special, event)
{
var event_field=document.getElementById('events[' + prefix_special + ']');
if(isset(event_field))
{
event_field.value = event;
}
}
function isset(variable)
{
if(variable==null) return false;
return (typeof(variable)=='undefined')?false:true;
}
function in_array(needle, haystack)
{
return array_search(needle, haystack) != -1;
}
function array_search(needle, haystack)
{
for (var i=0; i<haystack.length; i++)
{
if (haystack[i] == needle) return i;
}
return -1;
}
function print_pre(variable, msg)
{
if (!isset(msg)) msg = '';
var s = msg;
for (prop in variable) {
s += prop+" => "+variable[prop] + "\n";
}
alert(s);
}
function go_to_page($prefix_special, $page, $ajax)
{
set_form($prefix_special, $ajax);
set_hidden_field($prefix_special + '_Page', $page);
submit_event($prefix_special, null, null, null, $ajax);
}
function go_to_list(prefix_special, tab)
{
set_hidden_field(prefix_special+'_GoTab', tab);
submit_event(prefix_special,'OnUpdateAndGoToTab',null);
}
function go_to_tab(prefix_special, tab)
{
set_hidden_field(prefix_special+'_GoTab', tab);
submit_event(prefix_special,'OnPreSaveAndGoToTab',null);
}
function go_to_id(prefix_special, id)
{
set_hidden_field(prefix_special+'_GoId', id);
submit_event(prefix_special,'OnPreSaveAndGo')
}
// in-portal compatibility functions: begin
function getScriptURL($script_name, tpl)
{
tpl = tpl ? '-'+tpl : '';
var $asid = get_hidden_field('sid');
return base_url+$script_name+'?env='+( isset($env)&&$env?$env:$asid )+tpl+'&en=0';
}
function OpenEditor(extra_env,TargetForm,TargetField)
{
// var $url = getScriptURL('admin/editor/editor_new.php');
var $url = getScriptURL('admin/index.php', 'popups/editor');
// alert($url);
$url = $url+'&TargetForm='+TargetForm+'&TargetField='+TargetField+'&destform=popup';
if(extra_env.length>0) $url += extra_env;
openwin($url,'html_edit',800,575);
}
function OpenUserSelector(extra_env,TargetForm,TargetField)
{
var $url = getScriptURL('admin/users/user_select.php');
$url += '&destform='+TargetForm+'&Selector=radio&destfield='+TargetField+'&IdField=Login';
if(extra_env.length>0) $url += extra_env;
openwin($url,'user_select',800,575);
return false;
}
function OpenCatSelector(extra_env)
{
var $url = getScriptURL('admin/cat_select.php');
if(extra_env.length>0) $url += extra_env;
openwin($url,'catselect',750,400);
}
function OpenItemSelector(extra_env,$TargetForm)
{
var $url = getScriptURL('admin/relation_select.php') + '&destform='+$TargetForm;
if(extra_env.length>0) $url += extra_env;
openwin($url,'groupselect',750,400);
}
function OpenUserEdit($user_id, $extra_env)
{
var $url = getScriptURL('admin/users/adduser.php') + '&direct_id=' + $user_id;
if( isset($extra_env) ) $url += $extra_env;
window.location.href = $url;
}
function OpenLinkEdit($link_id, $extra_env)
{
var $url = getScriptURL('in-link/admin/addlink.php') + '&item=' + $link_id;
if( isset($extra_env) ) $url += $extra_env;
window.location.href = $url;
}
function OpenHelp($help_link)
{
// $help_link.match('http://(.*).lv/in-commerce/admin(.*)');
// alert(RegExp.$2);
openwin($help_link,'HelpPopup',750,400);
}
function openEmailSend($url, $type, $prefix_special)
{
var $kf = document.getElementById($form_name);
var $prev_action = $kf.action;
var $prev_opener = get_hidden_field('m_opener');
$kf.action = $url;
set_hidden_field('m_opener', 'p');
$kf.target = 'sendmail';
set_hidden_field('idtype', 'group');
set_hidden_field('idlist', Grids[$prefix_special].GetSelected().join(',') );
openwin('','sendmail',750,400);
submit_kernel_form();
$kf.action = $prev_action;
set_hidden_field('m_opener', $prev_opener);
}
// in-portal compatibility functions: end
function openSelector($prefix, $url, $dst_field, $window_size, $event)
{
var $kf = document.getElementById($form_name);
- var $regex = new RegExp('(.*)\?env=' + document.getElementById('sid').value + '-(.*?):(m[^:]+)');
+ var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)');
$regex = $regex.exec($url);
-
- var $t = $regex[2];
+
+ var $t = $regex[3];
var $window_name = 'select_'+$t.replace(/(\/|-)/g, '_');
- set_hidden_field('return_m', $regex[3]);
-
+ set_hidden_field('return_m', $regex[4]);
+
if (!isset($window_size)) $window_size = '750x400';
$window_size = $window_size.split('x');
if (!isset($event)) $event = '';
processHooks('openSelector', hBEFORE);
var $prev_action = $kf.action;
var $prev_opener = get_hidden_field('m_opener');
set_hidden_field('m_opener', 'p');
set_hidden_field('main_prefix', $prefix);
set_hidden_field('dst_field', $dst_field);
set_hidden_field('return_template', $kf.elements['t'].value); // where should return after popup is done
openwin('', $window_name, $window_size[0], $window_size[1]);
$kf.action = $url;
$kf.target = $window_name;
-
+
submit_event($prefix, $event, $t);
processHooks('openSelector', hAFTER);
$kf.action = $prev_action;
set_hidden_field('m_opener', $prev_opener);
}
function InitTranslator(prefix, field, t, multi_line)
{
var $kf = document.getElementById($form_name);
var $window_name = 'select_'+t.replace(/(\/|-)/g, '_');
- var $regex = new RegExp('(.*)\?env=' + document.getElementById('sid').value + '-(.*?):(m[^:]+)');
-
+ var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)');
+
$regex = $regex.exec($kf.action);
- set_hidden_field('return_m', $regex[3]);
+ set_hidden_field('return_m', $regex[4]);
var $prev_opener = get_hidden_field('m_opener');
if (!isset(multi_line)) multi_line = 0;
openwin('', $window_name, 750, 400);
set_hidden_field('return_template', $kf.elements['t'].value); // where should return after popup is done
set_hidden_field('m_opener', 'p');
-
+
set_hidden_field('translator_wnd_name', $window_name);
set_hidden_field('translator_field', field);
set_hidden_field('translator_t', t);
set_hidden_field('translator_prefixes', prefix);
set_hidden_field('translator_multi_line', multi_line);
$kf.target = $window_name;
-
+
return $prev_opener;
}
function PreSaveAndOpenTranslator(prefix, field, t, multi_line)
{
var $prev_opener = InitTranslator(prefix, field, t, multi_line);
-
+
var split_prefix = prefix.split(',');
submit_event(split_prefix[0], 'OnPreSaveAndOpenTranslator');
-
+
set_hidden_field('m_opener', $prev_opener);
}
function PreSaveAndOpenTranslatorCV(prefix, field, t, resource_id, multi_line)
{
var $prev_opener = InitTranslator(prefix, field, t, multi_line);
set_hidden_field('translator_resource_id', resource_id);
var split_prefix = prefix.split(',');
submit_event(split_prefix[0],'OnPreSaveAndOpenTranslator');
-
+
set_hidden_field('m_opener', $prev_opener);
}
function openTranslator(prefix,field,url,wnd)
{
var $kf = document.getElementById($form_name);
set_hidden_field('trans_prefix', prefix);
set_hidden_field('trans_field', field);
set_hidden_field('events[trans]', 'OnLoad');
- var $regex = new RegExp('(.*)\?env=' + document.getElementById('sid').value + '-(.*?):(.*)');
- var $t = $regex.exec(url)[2];
+ var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(.*)');
+ var $t = $regex.exec(url)[3];
$kf.target = wnd;
submit_event(prefix,'',$t,url);
}
function openwin($url,$name,$width,$height)
{
var $window_params = 'width='+$width+',height='+$height+',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no';
return window.open($url,$name,$window_params);
}
function opener_action(new_action)
{
set_hidden_field('m_opener', new_action);
}
function std_precreate_item(prefix_special, edit_template)
{
opener_action('d');
set_hidden_field(prefix_special+'_mode', 't');
submit_event(prefix_special,'OnPreCreate', edit_template)
}
function std_new_item(prefix_special, edit_template)
{
opener_action('d');
submit_event(prefix_special,'OnNew', edit_template)
}
function std_edit_item(prefix_special, edit_template)
{
opener_action('d');
set_hidden_field(prefix_special+'_mode', 't');
submit_event(prefix_special,'OnEdit',edit_template)
}
function std_edit_temp_item(prefix_special, edit_template)
{
opener_action('d');
submit_event(prefix_special,'',edit_template)
}
function std_delete_items(prefix_special, t, $ajax)
{
if (inpConfirm('Are you sure you want to delete selected items?')) {
submit_event(prefix_special, 'OnMassDelete', t, null, $ajax);
}
}
// set current form base on ajax
function set_form($prefix_special, $ajax)
{
if ($ajax) {
$form_name = $Catalog.queryTabRegistry('prefix', $prefix_special, 'tab_id') + '_form';
}
}
// sets hidden field value
// if the field does not exist - creates it
function set_hidden_field($field_id, $value)
{
var $kf = document.getElementById($form_name);
var $field = $kf.elements[$field_id];
if ($field) {
$field.value = $value;
return true;
}
$field = document.createElement('INPUT');
$field.type = 'hidden';
$field.name = $field_id;
$field.id = $field_id;
$field.value = $value;
$kf.appendChild($field);
return false;
}
// sets hidden field value
// if the field does not exist - creates it
function setInnerHTML($field_id, $value)
{
var $element = document.getElementById($field_id);
if (!$element) return false;
$element.innerHTML = $value;
}
function get_hidden_field($field)
{
var $kf = document.getElementById($form_name);
return $kf.elements[$field] ? $kf.elements[$field].value : false;
}
function search($prefix_special, $grid_name, $ajax)
{
set_form($prefix_special, $ajax);
set_hidden_field('grid_name', $grid_name);
submit_event($prefix_special, 'OnSearch', null, null, $ajax);
}
function search_reset($prefix_special, $grid_name, $ajax)
{
set_form($prefix_special, $ajax);
set_hidden_field('grid_name', $grid_name);
submit_event($prefix_special, 'OnSearchReset', null, null, $ajax);
}
function search_keydown($event)
{
$event = $event ? $event : event;
if ($event.keyCode == 13) {
var $prefix_special = this.getAttribute('PrefixSpecial');
var $grid = this.getAttribute('Grid');
search($prefix_special, $grid, parseInt(this.getAttribute('ajax')));
}
}
function getRealLeft(el)
{
if (typeof(el) == 'string') {
el = document.getElementById(el);
}
xPos = el.offsetLeft;
tempEl = el.offsetParent;
while (tempEl != null)
{
xPos += tempEl.offsetLeft;
tempEl = tempEl.offsetParent;
}
// if (obj.x) return obj.x;
return xPos;
}
function getRealTop(el)
{
if (typeof(el) == 'string') {
el = document.getElementById(el);
}
yPos = el.offsetTop;
tempEl = el.offsetParent;
while (tempEl != null)
{
yPos += tempEl.offsetTop;
tempEl = tempEl.offsetParent;
}
// if (obj.y) return obj.y;
return yPos;
}
function show_viewmenu($toolbar, $button_id)
{
var $img = $toolbar.GetButtonImage($button_id);
var $pos_x = getRealLeft($img) - ((document.all) ? 6 : -2);
var $pos_y = getRealTop($img) + 32;
var $prefix_special = '';
window.triedToWriteMenus = false;
if($ViewMenus.length == 1)
{
$prefix_special = $ViewMenus[$ViewMenus.length-1];
$fw_menus[$prefix_special+'_view_menu']();
$Menus[$prefix_special+'_view_menu'].writeMenus('MenuContainers['+$prefix_special+']');
window.FW_showMenu($Menus[$prefix_special+'_view_menu'], $pos_x, $pos_y);
}
else
{
// prepare menus
for(var $i in $ViewMenus)
{
$prefix_special = $ViewMenus[$i];
$fw_menus[$prefix_special+'_view_menu']();
}
$Menus['mixed'] = new Menu('ViewMenu_mixed');
// merge menus into new one
for(var $i in $ViewMenus)
{
$prefix_special = $ViewMenus[$i];
$Menus['mixed'].addMenuItem( $Menus[$prefix_special+'_view_menu'] );
}
$Menus['mixed'].writeMenus('MenuContainers[mixed]');
window.FW_showMenu($Menus['mixed'], $pos_x, $pos_y);
}
}
function set_window_title($title)
{
var $window = window;
if($window.parent) $window = $window.parent;
$window.document.title = (main_title.length ? main_title + ' - ' : '') + $title;
}
function set_filter($prefix_special, $filter_id, $filter_value, $ajax)
{
set_form($prefix_special, $ajax);
set_hidden_field('filter_id', $filter_id);
set_hidden_field('filter_value', $filter_value);
submit_event($prefix_special, 'OnSetFilter', null, null, $ajax);
}
function filters_remove_all($prefix_special, $ajax)
{
set_form($prefix_special, $ajax);
submit_event($prefix_special,'OnRemoveFilters', null, null, $ajax);
}
function filters_apply_all($prefix_special, $ajax)
{
set_form($prefix_special, $ajax);
submit_event($prefix_special,'OnApplyFilters', null, null, $ajax);
}
function RemoveTranslationLink($string, $escaped)
{
if (!isset($escaped)) $escaped = true;
if ($escaped) {
return $string.match(/&lt;a href=&quot;(.*)&quot;&gt;(.*)&lt;\/a&gt;/) ? RegExp.$2 : $string;
}
else {
return $string.match(/<a href="(.*)">(.*)<\/a>/) ? RegExp.$2 : $string;
}
}
function redirect($url)
{
window.location.href = $url;
}
function update_checkbox_options($cb_mask, $hidden_id)
{
var $kf = document.getElementById($form_name);
var $tmp = '';
for (var i = 0; i < $kf.elements.length; i++)
{
if ( $kf.elements[i].id.match($cb_mask) )
{
if ($kf.elements[i].checked) $tmp += '|'+$kf.elements[i].value;
}
}
if($tmp.length > 0) $tmp += '|';
document.getElementById($hidden_id).value = $tmp.replace(/,$/, '');
}
// related to lists operations (moving)
function move_selected($from_list, $to_list)
{
if (typeof($from_list) != 'object') $from_list = document.getElementById($from_list);
if (typeof($to_list) != 'object') $to_list = document.getElementById($to_list);
if (has_selected_options($from_list))
{
var $from_array = select_to_array($from_list);
var $to_array = select_to_array($to_list);
var $new_from = Array();
var $cur = null;
for (var $i = 0; $i < $from_array.length; $i++)
{
$cur = $from_array[$i];
if ($cur[2]) // If selected - add to To array
{
$to_array[$to_array.length] = $cur;
}
else //Else - keep in new From
{
$new_from[$new_from.length] = $cur;
}
}
$from_list = array_to_select($new_from, $from_list);
$to_list = array_to_select($to_array, $to_list);
}
else
{
alert('Please select items to perform moving!');
}
}
function select_to_array($aSelect)
{
var $an_array = new Array();
var $cur = null;
for (var $i = 0; $i < $aSelect.length; $i++)
{
$cur = $aSelect.options[$i];
$an_array[$an_array.length] = new Array($cur.text, $cur.value, $cur.selected);
}
return $an_array;
}
function array_to_select($anArray, $aSelect)
{
var $initial_length = $aSelect.length;
for (var $i = $initial_length - 1; $i >= 0; $i--)
{
$aSelect.options[$i] = null;
}
for (var $i = 0; $i < $anArray.length; $i++)
{
$cur = $anArray[$i];
$aSelect.options[$aSelect.length] = new Option($cur[0], $cur[1]);
}
}
function select_compare($a, $b)
{
if ($a[0] < $b[0])
return -1;
if ($a[0] > $b[0])
return 1;
return 0;
}
function select_to_string($aSelect)
{
var $result = '';
var $cur = null;
if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
for (var $i = 0; $i < $aSelect.length; $i++)
{
$result += $aSelect.options[$i].value + '|';
}
return $result.length ? '|' + $result : '';
}
function selected_to_string($aSelect)
{
var $result = '';
var $cur = null;
if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
for (var $i = 0; $i < $aSelect.length; $i++)
{
$cur = $aSelect.options[$i];
if ($cur.selected && $cur.value != '')
{
$result += $cur.value + '|';
}
}
return $result.length ? '|' + $result : '';
}
function string_to_selected($str, $aSelect)
{
var $cur = null;
for (var $i = 0; i < $aSelect.length; $i++)
{
$cur = $aSelect.options[$i];
$aSelect.options[$i].selected = $str.match(',' + $cur.value + ',') ? true : false;
}
}
function set_selected($selected_options, $aSelect)
{
if (!$selected_options.length) return false;
for (var $i = 0; $i < $aSelect.length; $i++)
{
for (var $k = 0; $k < $selected_options.length; $k++)
{
if ($aSelect.options[$i].value == $selected_options[$k])
{
$aSelect.options[$i].selected = true;
}
}
}
}
function get_selected_count($theList)
{
var $count = 0;
var $cur = null;
for (var $i = 0; $i < $theList.length; $i++)
{
$cur = $theList.options[$i];
if ($cur.selected) $count++;
}
return $count;
}
function get_selected_index($aSelect, $typeIndex)
{
var $index = 0;
for (var $i = 0; $i < $aSelect.length; $i++)
{
if ($aSelect.options[$i].selected)
{
$index = $i;
if ($typeIndex == 'firstSelected') break;
}
}
return $index;
}
function has_selected_options($theList)
{
var $ret = false;
var $cur = null;
for (var $i = 0; $i < $theList.length; $i++)
{
$cur = $theList.options[$i];
if ($cur.selected) $ret = true;
}
return $ret;
}
function select_sort($aSelect)
{
if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
var $to_array = select_to_array($aSelect);
$to_array.sort(select_compare);
array_to_select($to_array, $aSelect);
}
function move_options_up($aSelect, $interval)
{
if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
if (has_selected_options($aSelect))
{
var $selected_options = Array();
var $first_selected = get_selected_index($aSelect, 'firstSelected');
for (var $i = 0; $i < $aSelect.length; $i++)
{
if ($aSelect.options[$i].selected && ($first_selected > 0) )
{
swap_options($aSelect, $i, $i - $interval);
$selected_options[$selected_options.length] = $aSelect.options[$i - $interval].value;
}
else if ($first_selected == 0)
{
//alert('Begin of list');
break;
}
}
set_selected($selected_options, $aSelect);
}
else
{
//alert('Check items from moving');
}
}
function move_options_down($aSelect, $interval)
{
if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
if (has_selected_options($aSelect))
{
var $last_selected = get_selected_index($aSelect, 'lastSelected');
var $selected_options = Array();
for (var $i = $aSelect.length - 1; $i >= 0; $i--)
{
if ($aSelect.options[$i].selected && ($aSelect.length - ($last_selected + 1) > 0))
{
swap_options($aSelect, $i, $i + $interval);
$selected_options[$selected_options.length] = $aSelect.options[$i + $interval].value;
}
else if ($last_selected + 1 == $aSelect.length)
{
//alert('End of list');
break;
}
}
set_selected($selected_options, $aSelect);
}
else
{
//alert('Check items from moving');
}
}
function swap_options($aSelect, $src_num, $dst_num)
{
var $src_html = $aSelect.options[$src_num].innerHTML;
var $dst_html = $aSelect.options[$dst_num].innerHTML;
var $src_value = $aSelect.options[$src_num].value;
var $dst_value = $aSelect.options[$dst_num].value;
var $src_option = document.createElement('OPTION');
var $dst_option = document.createElement('OPTION');
$aSelect.remove($src_num);
$aSelect.options.add($dst_option, $src_num);
$dst_option.innerText = $dst_html;
$dst_option.value = $dst_value;
$dst_option.innerHTML = $dst_html;
$aSelect.remove($dst_num);
$aSelect.options.add($src_option, $dst_num);
$src_option.innerText = $src_html;
$src_option.value = $src_value;
$src_option.innerHTML = $src_html;
}
function getXMLHTTPObject(content_type)
{
if (!isset(content_type)) content_type = 'text/plain';
var http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType(content_type);
// See note below about this line
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
return http_request;
}
function str_repeat($symbol, $count)
{
var $i = 0;
var $ret = '';
while($i < $count) {
$ret += $symbol;
$i++;
}
return $ret;
}
function getDocumentFromXML(xml)
{
if (window.ActiveXObject) {
var doc = new ActiveXObject("Microsoft.XMLDOM");
doc.async=false;
doc.loadXML(xml);
}
else {
var parser = new DOMParser();
var doc = parser.parseFromString(xml,"text/xml");
}
return doc;
}
function addEvent(el, evname, func) {
if (is.ie) {
el.attachEvent("on" + evname, func);
} else {
el.addEventListener(evname, func, true);
}
};
function set_persistant_var($var_name, $var_value, $t, $form_action)
{
set_hidden_field('field', $var_name);
set_hidden_field('value', $var_value);
submit_event('u', 'OnSetPersistantVariable', $t, $form_action);
}
/*functionremoveEvent(el, evname, func) {
if (Calendar.is_ie) {
el.detachEvent("on" + evname, func);
} else {
el.removeEventListener(evname, func, true);
}
};*/
function setCookie($Name, $Value)
{
// set cookie
if(getCookie($Name) != $Value)
{
document.cookie = $Name+'='+escape($Value)+'; path=' + $base_path + '/';
}
}
function getCookie($Name)
{
// get cookie
var $cookieString = document.cookie;
var $index = $cookieString.indexOf($Name+'=');
if($index == -1) return null;
$index = $cookieString.indexOf('=',$index)+1;
var $endstr = $cookieString.indexOf(';',$index);
if($endstr == -1) $endstr = $cookieString.length;
return unescape($cookieString.substring($index, $endstr));
}
function deleteCookie($Name)
{
// deletes cookie
if (getCookie($Name))
{
document.cookie = $Name+'=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/';
}
}
function addElement($dst_element, $tag_name) {
var $new_element = document.createElement($tag_name.toUpperCase());
$dst_element.appendChild($new_element);
return $new_element;
}
-
+
Math.sum = function($array) {
var $i = 0;
var $total = 0;
while ($i < $array.length) {
$total += $array[$i];
$i++;
}
return $total;
}
-
+
Math.average = function($array) {
return Math.sum($array) / $array.length;
}
Property changes on: trunk/kernel/admin_templates/incs/script.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.41
\ No newline at end of property
+1.42
\ No newline at end of property
Index: trunk/kernel/admin_templates/incs/grid_blocks.tpl
===================================================================
--- trunk/kernel/admin_templates/incs/grid_blocks.tpl (revision 6427)
+++ trunk/kernel/admin_templates/incs/grid_blocks.tpl (revision 6428)
@@ -1,390 +1,390 @@
<inp2:m_block name="current_page"/>
<span class="current_page"><inp2:m_param name="page"/></span>
<inp2:m_blockend/>
<inp2:m_block name="page"/>
<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url"><inp2:m_param name="page"/></a>
<inp2:m_blockend/>
<inp2:m_block name="next_page"/>
<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url">&gt;</a>
<inp2:m_blockend/>
<inp2:m_block name="prev_page"/>
<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url">&lt;</a>
<inp2:m_blockend/>
<inp2:m_block name="next_page_split"/>
<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url">&gt;&gt;</a>
<inp2:m_blockend/>
<inp2:m_block name="prev_page_split"/>
<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url">&lt;&lt;</a>
<inp2:m_blockend/>
<inp2:m_block name="grid_pagination" SearchPrefixSpecial=""/>
<table cellspacing="0" cellpadding="2" width="100%" bgcolor="#E0E0DA" border="0" class="<inp2:m_if prefix="m" function="ParamEquals" name="no_toolbar" value="no_toolbar"/>tableborder_full_kernel<inp2:m_else/>pagination_bar<inp2:m_endif/>">
<tbody>
<tr id="MY_ID">
<td width="100%">
<img height="15" src="img/arrow.gif" width="15" align="absmiddle" border="0">
<b class=text><inp2:m_phrase name="la_Page"/></b>
<inp2:$PrefixSpecial_PrintPages active_block="current_page" split="10" inactive_block="page" prev_page_block="prev_page" next_page_block="next_page" prev_page_split_block="prev_page_split" next_page_split_block="next_page_split" main_special="$main_special" ajax="$ajax"/>
</td>
<inp2:m_if check="m_ParamEquals" param="search" value="on">
<inp2:m_if check="m_ParamEquals" name="SearchPrefixSpecial" value="">
<inp2:m_RenderElement name="grid_search" grid="$grid" PrefixSpecial="$PrefixSpecial" ajax="$ajax"/>
<inp2:m_else />
<inp2:m_RenderElement name="grid_search" grid="$grid" PrefixSpecial="$SearchPrefixSpecial" ajax="$ajax"/>
</inp2:m_if>
</inp2:m_if>
<td>
</tr>
</tbody>
</table>
<inp2:m_blockend/>
<inp2:m_DefineElement name="grid_search" ajax="0">
<td align="right" style="padding-right: 0px;">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td><inp2:m_phrase name="la_Search"/>:&nbsp;</td>
<td>
<input type="text"
id="<inp2:m_param name="PrefixSpecial"/>_search_keyword"
name="<inp2:m_param name="PrefixSpecial"/>_search_keyword"
value="<inp2:m_recall var="{$PrefixSpecial}_search_keyword" no_null="no_null" special="1"/>"
PrefixSpecial="<inp2:m_param name="PrefixSpecial"/>"
Grid="<inp2:m_param name="grid"/>"
ajax="<inp2:m_param name="ajax"/>"
style="border: 1px solid grey;">
<input type="text" style="display: none"; />
</td>
<td id="search_buttons[<inp2:m_param name="PrefixSpecial"/>]">
<script type="text/javascript">
<inp2:m_RenderElement name="grid_search_buttons" pass_params="true"/>
</script>
</td>
</tr>
</table>
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_search_buttons" PrefixSpecial="" grid="" ajax="1">
document.getElementById('<inp2:m_param name="PrefixSpecial"/>_search_keyword').onkeydown = search_keydown;
Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'] = new ToolBar('icon16_');
Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].AddButton(
new ToolBarButton(
'search',
'<inp2:m_phrase name="la_ToolTip_Search" escape="1"/>',
function() { search('<inp2:m_param name="PrefixSpecial"/>','<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>) },
null,
'<inp2:m_param name="PrefixSpecial"/>') );
Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].AddButton(
new ToolBarButton(
'search_reset',
'<inp2:m_phrase name="la_ToolTip_SearchReset" escape="1"/>',
function() { search_reset('<inp2:m_param name="PrefixSpecial"/>','<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>) },
null,
'<inp2:m_param name="PrefixSpecial"/>') );
Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].Render(document.getElementById('search_buttons[<inp2:m_param name="PrefixSpecial"/>]'));
</inp2:m_DefineElement>
<inp2:m_block name="grid_column_title" use_phrases="1"/>
<td nowrap="nowrap">
<a href="javascript:resort_grid('<inp2:m_param name="PrefixSpecial"/>','<inp2:m_param name="sort_field"/>', <inp2:m_param name="ajax"/>);" class="columntitle_small"><IMG alt="" src="img/list_arrow_<inp2:$PrefixSpecial_order field="$sort_field"/>.gif" border="0" align="absmiddle"><inp2:m_if check="m_ParamEquals" name="use_phrases" value="1"><inp2:m_phrase name="$title"/><inp2:m_else/><inp2:m_param name="title"/></inp2:m_if></a>
</td>
<inp2:m_blockend/>
<inp2:m_block name="grid_column_title_no_sorting" use_phrases="1"/>
<td nowrap="nowrap">
<inp2:m_if check="m_ParamEquals" name="use_phrases" value="1"><inp2:m_phrase name="$title"/><inp2:m_else/><inp2:m_param name="title"/></inp2:m_if>
</td>
<inp2:m_blockend/>
<inp2:m_block name="grid_checkbox_td" format="" />
<td valign="top" class="text">
<table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
<tr>
<td><input type="checkbox" name="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>"></td>
<td><img src="<inp2:ModulePath />img/itemicons/<inp2:$PrefixSpecial_ItemIcon grid="$grid"/>"></td>
<td><inp2:Field field="$field" no_special="no_special" format="$format"/></td>
</tr>
</table>
</td>
<inp2:m_blockend />
<inp2:m_block name="grid_checkbox_td_no_icon" format="" />
<td valign="top" class="text">
<table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
<tr>
<td><input type="checkbox" name="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>"></td>
<td><inp2:$PrefixSpecial_field field="$field" no_special="no_special" format="$format"/></td>
</tr>
</table>
</td>
<inp2:m_blockend />
<inp2:m_block name="label_grid_checkbox_td" format="" />
<td valign="top" class="text">
<table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
<tr>
<td><input type="checkbox" name="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>"></td>
<td><img src="<inp2:ModulePath />img/itemicons/<inp2:$PrefixSpecial_ItemIcon grid="$grid"/>"></td>
<td><inp2:$PrefixSpecial_field field="$field" no_special="no_special" as_label="as_label" format="$format"/></td>
</tr>
</table>
</td>
<inp2:m_blockend />
<inp2:m_block name="grid_icon_td" format="" />
<td valign="top" class="text">
<table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
<tr>
<td><img src="<inp2:ModulePath />img/itemicons/<inp2:$PrefixSpecial_ItemIcon grid="$grid"/>"></td>
<td><inp2:$PrefixSpecial_field field="$field" no_special="no_special" format="$format"/></td>
</tr>
</table>
</td>
<inp2:m_blockend />
<inp2:m_block name="grid_radio_td" format="" />
<td valign="top" class="text">
<table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
<tr>
<td><input type="radio" name="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$IdField" IdField="$IdField"/>"></td>
<td><img src="<inp2:ModulePath />img/itemicons/<inp2:$PrefixSpecial_ItemIcon grid="$grid"/>"></td>
<td><inp2:Field field="$field" no_special="no_special" format="$format"/></td>
</tr>
</table>
</td>
<inp2:m_blockend />
<inp2:m_block name="grid_data_td" format="" no_special="" nl2br="" first_chars=""/>
<td valign="top" class="text"><inp2:$PrefixSpecial_field field="$field" first_chars="$first_chars" nl2br="$nl2br" grid="$grid" no_special="$no_special" format="$format"/></td>
<inp2:m_blockend />
<inp2:m_block name="grid_edit_td" format="" />
<td valign="top" class="text"><input type="text" id="<inp2:$PrefixSpecial_InputName field="$field"/>" name="<inp2:$PrefixSpecial_InputName field="$field"/>" value="<inp2:$PrefixSpecial_field field="$field" grid="$grid" format="$format"/>"></td>
<inp2:m_blockend />
<inp2:m_block name="grid_data_label_td" />
- <td valign="top" class="text"><inp2:$PrefixSpecial_field field="$field" grid="$grid" as_label="1" no_special="no_special" format="$format"/></td>
+ <td valign="top" class="text"><inp2:$PrefixSpecial_field field="$field" grid="$grid" plus_or_as_label="1" no_special="no_special" format="$format"/></td>
<inp2:m_blockend />
<inp2:m_block name="grid_data_label_ml_td" format="" />
<td valign="top" class="text">
<inp2:$PrefixSpecial_field field="$field" grid="$grid" as_label="1" no_special="no_special" format="$format"/>:<br />
<inp2:m_if check="FieldEquals" field="$ElementTypeField" value="textarea">
<a href="javascript:PreSaveAndOpenTranslatorCV('<inp2:m_param name="SourcePrefix"/>,<inp2:m_param name="SourcePrefix"/>-cdata', '<inp2:m_param name="SourcePrefix"/>-cdata:cust_<inp2:Field name="CustomFieldId"/>', 'popups/translator', <inp2:$SourcePrefix_Field field="ResourceId"/>, 1);" title="<inp2:m_Phrase label="la_Translate" escape="1"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand;" border="0"></a>
<inp2:m_else/>
<a href="javascript:PreSaveAndOpenTranslatorCV('<inp2:m_param name="SourcePrefix"/>,<inp2:m_param name="SourcePrefix"/>-cdata', '<inp2:m_param name="SourcePrefix"/>-cdata:cust_<inp2:Field name="CustomFieldId"/>', 'popups/translator', <inp2:$SourcePrefix_Field field="ResourceId"/>);" title="<inp2:m_Phrase label="la_Translate" escape="1"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand;" border="0"></a>
</inp2:m_if>
</td>
<inp2:m_blockend />
<inp2:m_DefineElement name="grid_column_filter">
<td>&nbsp;</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_options_filter">
<td>
<select name="<inp2:SearchInputName field="$field"/>">
<inp2:PredefinedSearchOptions field="$field" block="inp_option_item" selected="selected" has_empty="1" empty_value=""/>
</select>
</td>
</inp2:m_DefineElement>
<inp2:m_block name="viewmenu_sort_block"/>
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuItem('<inp2:m_phrase name="$title" escape="1"/>','direct_sort_grid("<inp2:m_param name="PrefixSpecial"/>","<inp2:m_param name="sort_field"/>","<inp2:$PrefixSpecial_OrderInfo type="direction" pos="1"/>", null, <inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="IsOrder" field="$sort_field" pos="1"/>2<inp2:m_endif/>');
<inp2:m_blockend/>
<inp2:m_block name="viewmenu_filter_block"/>
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuItem('<inp2:m_param name="label"/>','<inp2:m_param name="filter_action"/>','<inp2:m_param name="filter_status"/>');
<inp2:m_blockend/>
<inp2:m_block name="viewmenu_filter_separator"/>
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuSeparator();
<inp2:m_blockend/>
<inp2:m_block name="viewmenu_declaration" menu_filters="no" menu_sorting="yes" menu_perpage="yes" menu_select="yes" ajax="0"/>
// define ViewMenu
$fw_menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'] = function()
{
<inp2:m_if check="m_ParamEquals" name="menu_filters" value="yes">
// filtring menu
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'] = new Menu('<inp2:m_phrase name="la_Text_View" escape="1"/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuItem('All','filters_remove_all("<inp2:m_param name="PrefixSpecial"/>", <inp2:m_param name="ajax"/>);');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuItem('None','filters_apply_all("<inp2:m_param name="PrefixSpecial"/>", <inp2:m_param name="ajax"/>);');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuSeparator();
<inp2:$PrefixSpecial_DrawFilterMenu item_block="viewmenu_filter_block" spearator_block="viewmenu_filter_separator" ajax="$ajax"/>
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="menu_sorting" value="yes">
// sorting menu
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'] = new Menu('<inp2:m_phrase name="la_Text_Sort" escape="1"/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuItem('<inp2:m_phrase name="la_common_ascending" escape="1"/>','direct_sort_grid("<inp2:m_param name="PrefixSpecial"/>","<inp2:$PrefixSpecial_OrderInfo type="field" pos="1"/>","asc",null,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="IsOrder" direction="asc" pos="1"/>2<inp2:m_endif/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuItem('<inp2:m_phrase name="la_common_descending" escape="1"/>','direct_sort_grid("<inp2:m_param name="PrefixSpecial"/>","<inp2:$PrefixSpecial_OrderInfo type="field" pos="1"/>","desc",null,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="IsOrder" direction="desc" pos="1"/>2<inp2:m_endif/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuSeparator();
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuItem('<inp2:m_phrase name="la_Text_Default" escape="1"/>','reset_sorting("<inp2:m_param name="PrefixSpecial"/>");');
<inp2:$PrefixSpecial_IterateGridFields grid="$grid" mode="header" block="viewmenu_sort_block" ajax="$ajax"/>
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="menu_perpage" value="yes">
// per page menu
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'] = new Menu('<inp2:m_phrase name="la_prompt_PerPage" escape="1"/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('10','set_per_page("<inp2:m_param name="PrefixSpecial"/>",10,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="10"/>2<inp2:m_endif/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('20','set_per_page("<inp2:m_param name="PrefixSpecial"/>",20,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="20"/>2<inp2:m_endif/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('50','set_per_page("<inp2:m_param name="PrefixSpecial"/>",50,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="50"/>2<inp2:m_endif/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('100','set_per_page("<inp2:m_param name="PrefixSpecial"/>",100,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="100"/>2<inp2:m_endif/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addMenuItem('500','set_per_page("<inp2:m_param name="PrefixSpecial"/>",500,<inp2:m_param name="ajax"/>);','<inp2:m_if prefix="$PrefixSpecial" function="PerPageEquals" value="500"/>2<inp2:m_endif/>');
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="menu_select" value="yes">
// select menu
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'] = new Menu('<inp2:m_phrase name="la_Text_Select" escape="1"/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].addMenuItem('<inp2:m_phrase name="la_Text_All" escape="1"/>','Grids["<inp2:m_param name="PrefixSpecial"/>"].SelectAll();');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].addMenuItem('<inp2:m_phrase name="la_Text_Unselect" escape="1"/>','Grids["<inp2:m_param name="PrefixSpecial"/>"].ClearSelection();');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].addMenuItem('<inp2:m_phrase name="la_Text_Invert" escape="1"/>','Grids["<inp2:m_param name="PrefixSpecial"/>"].InvertSelection();');
</inp2:m_if>
processHooks('ViewMenu', hBEFORE, '<inp2:m_param name="PrefixSpecial"/>');
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'] = new Menu('<inp2:$PrefixSpecial_GetItemName/>');
<inp2:m_if check="m_ParamEquals" name="menu_filters" value="yes">
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addMenuItem( $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'] );
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="menu_sorting" value="yes">
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addMenuItem( $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'] );
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="menu_perpage" value="yes">
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addMenuItem( $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'] );
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="menu_select" value="yes">
$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addMenuItem( $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'] );
</inp2:m_if>
processHooks('ViewMenu', hAFTER, '<inp2:m_param name="PrefixSpecial"/>');
}
<inp2:m_blockend/>
<inp2:m_block name="grid_save_warning" />
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_<inp2:m_if prefix="m" function="ParamEquals" name="no_toolbar" value="no_toolbar"/>nobottom<inp2:m_else/>notop<inp2:m_endif/>">
<tr>
<td valign="top" class="hint_red">
<inp2:m_phrase name="la_Warning_Save_Item"/>
</td>
</tr>
</table>
<script type="text/javascript">
$edit_mode = <inp2:m_if check="m_ParamEquals" name="edit_mode" value="1">true<inp2:m_else />false</inp2:m_if>;
// window.parent.document.title += ' - MODE: ' + ($edit_mode ? 'EDIT' : 'LIVE');
</script>
<inp2:m_blockend/>
<inp2:m_DefineElement name="grid" main_prefix="" per_page="" main_special="" no_toolbar="" grid_filters="" search="on" header_block="grid_column_title" filter_block="grid_column_filter" data_block="grid_data_td" row_block="_row" ajax="0">
<!--
grid_filters - show individual filters for each column
has_filters - draw filter section in "View" menu in toolbar
-->
<inp2:$PrefixSpecial_SaveWarning name="grid_save_warning" main_prefix="$main_prefix" no_toolbar="$no_toolbar"/>
<inp2:m_if check="m_RecallEquals" var="{$PrefixSpecial}_search_keyword" value="" inverse="inverse">
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_<inp2:m_if prefix="m" function="ParamEquals" name="no_toolbar" value="no_toolbar"/>nobottom<inp2:m_else/>notop<inp2:m_endif/>">
<tr>
<td valign="top" class="hint_red">
<inp2:m_phrase name="la_Warning_Filter"/>
</td>
</tr>
</table>
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="per_page" value="-1" inverse="1">
<inp2:m_ParseBlock name="grid_pagination" grid="$grid" PrefixSpecial="$PrefixSpecial" main_special="$main_special" search="$search" no_toolbar="$no_toolbar" ajax="$ajax"/>
</inp2:m_if>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<inp2:m_if check="m_ParamEquals" name="grid_filters" value="1">
<tr class="pagination_bar">
<inp2:$PrefixSpecial_IterateGridFields grid="$grid" mode="filter" block="$filter_block" ajax="$ajax"/>
</tr>
</inp2:m_if>
<tr class="subsectiontitle">
<inp2:$PrefixSpecial_IterateGridFields grid="$grid" mode="header" block="$header_block" ajax="$ajax"/>
</tr>
<inp2:m_DefineElement name="_row">
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>" id="<inp2:m_param name="PrefixSpecial"/>_<inp2:Field field="$IdField"/>" sequence="<inp2:m_get param="{$PrefixSpecial}_sequence"/>"><inp2:m_inc param="{$PrefixSpecial}_sequence" by="1"/>
<inp2:IterateGridFields grid="$grid" mode="data" block="$data_block"/>
</tr>
</inp2:m_DefineElement>
<inp2:m_set {$PrefixSpecial}_sequence="1" odd_even="table_color1"/>
<inp2:$PrefixSpecial_PrintList block="$row_block" per_page="$per_page" main_special="$main_special" />
</table>
<inp2:m_if check="m_ParamEquals" name="ajax" value="0">
<inp2:m_if check="m_GetEquals" name="fw_menu_included" value="">
<script type="text/javascript" src="incs/fw_menu.js"></script>
<inp2:m_set fw_menu_included="1"/>
</inp2:m_if>
<script type="text/javascript">
<inp2:m_RenderElement name="grid_js" selected_class="selected_div" tag_name="tr" pass_params="true"/>
</script>
</inp2:m_if>
<input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1" name="<inp2:m_param name="PrefixSpecial"/>_Sort1" value="">
<input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" name="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" value="asc">
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_js" ajax="1">
<inp2:m_if check="m_ParamEquals" name="no_init" value="no_init" inverse="inverse">
Grids['<inp2:m_param name="PrefixSpecial"/>'] = new Grid('<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="selected_class"/>', ':original', edit, a_toolbar);
Grids['<inp2:m_param name="PrefixSpecial"/>'].AddItemsByIdMask('<inp2:m_param name="tag_name"/>', /^<inp2:m_param name="PrefixSpecial"/>_([\d\w-]+)/, '<inp2:m_param name="PrefixSpecial"/>[$$ID$$][<inp2:m_param name="IdField"/>]');
Grids['<inp2:m_param name="PrefixSpecial"/>'].InitItems();
</inp2:m_if>
<inp2:m_ParseBlock name="viewmenu_declaration" pass_params="true"/>
$ViewMenus = new Array('<inp2:m_param name="PrefixSpecial"/>');
</inp2:m_DefineElement>
<inp2:m_DefineElement name="white_grid" main_prefix="" per_page="" main_special="" no_toolbar="" search="on" render_as="" columns="2" direction="V" empty_cell_render_as="wg_empty_cell" ajax="0">
<inp2:$PrefixSpecial_SaveWarning name="grid_save_warning" main_prefix="$main_prefix" no_toolbar="$no_toolbar"/>
<inp2:m_if check="m_RecallEquals" var="{$PrefixSpecial}_search_keyword" value="" inverse="inverse">
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_<inp2:m_if prefix="m" function="ParamEquals" name="no_toolbar" value="no_toolbar"/>nobottom<inp2:m_else/>notop<inp2:m_endif/>">
<tr>
<td valign="top" class="hint_red">
<inp2:m_phrase name="la_Warning_Filter"/>
</td>
</tr>
</table>
</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="per_page" value="-1" inverse="1">
<inp2:m_ParseBlock name="grid_pagination" grid="$grid" PrefixSpecial="$PrefixSpecial" main_special="$main_special" search="$search" no_toolbar="$no_toolbar" ajax="$ajax"/>
</inp2:m_if>
<br />
<inp2:m_DefineElement name="wg_empty_cell">
<td width="<inp2:m_param name="column_width"/>%">&nbsp;</td>
</inp2:m_DefineElement>
<table width="100%" border="0" cellspacing="2" cellpadding="4">
<inp2:m_set {$PrefixSpecial}_sequence="1" odd_even="table_color1"/>
<inp2:$PrefixSpecial_PrintList2 pass_params="true"/>
</table>
<inp2:m_if check="m_ParamEquals" name="ajax" value="0">
<inp2:m_if check="m_GetEquals" name="fw_menu_included" value="">
<script type="text/javascript" src="incs/fw_menu.js"></script>
<inp2:m_set fw_menu_included="1"/>
</inp2:m_if>
<script type="text/javascript">
<inp2:m_RenderElement name="grid_js" selected_class="table_white_selected" tag_name="td" pass_params="true"/>
</script>
</inp2:m_if>
<input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1" name="<inp2:m_param name="PrefixSpecial"/>_Sort1" value="">
<input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" name="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" value="asc">
</inp2:m_DefineElement>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/incs/grid_blocks.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.37
\ No newline at end of property
+1.38
\ No newline at end of property
Index: trunk/kernel/admin_templates/incs/form_blocks.tpl
===================================================================
--- trunk/kernel/admin_templates/incs/form_blocks.tpl (revision 6427)
+++ trunk/kernel/admin_templates/incs/form_blocks.tpl (revision 6428)
@@ -1,432 +1,432 @@
<inp2:m_block name="section_header"/>
<inp2:m_if check="m_ParamEquals" name="prefix" value="" inverse="inverse">
<inp2:m_RenderElement name="section_header_new" pass_params="true"/>
<inp2:m_else />
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr class="section_header_bg">
<td valign="top" class="admintitle" align="left" style="padding-top: 2px; padding-bottom: 2px;">
<img width="46" height="46" src="img/icons/<inp2:adm_GetSectionIcon icon="$icon"/>.gif" align="absmiddle" title="<inp2:adm_GetSectionTitle phrase="$title"/>">&nbsp;<inp2:adm_GetSectionTitle phrase="$title"/>
</td>
</tr>
</table>
</inp2:m_if>
<inp2:m_blockend/>
<inp2:m_DefineElement name="section_header_new" module="#session#">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr style="background: url(<inp2:ModulePath module="$module"/>img/logo_bg.gif) no-repeat top right;">
<td valign="top" class="admintitle" align="left" style="padding-top: 2px; padding-bottom: 2px;">
<img width="46" height="46" src="<inp2:ModulePath/>img/icons/<inp2:adm_GetSectionIcon icon="$icon"/>.gif" align="absmiddle" title="<inp2:adm_GetSectionTitle phrase="$title"/>">&nbsp;<inp2:adm_GetSectionTitle phrase="$title"/>
</td>
</tr>
</table>
</inp2:m_DefineElement>
<inp2:m_block name="blue_bar" module="" icon=""/>
<table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
<tr>
<td class="header_left_bg" nowrap width="80%" valign="middle">
<span class="tablenav_link" id="blue_bar"><inp2:$prefix_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100"/></span>
</td>
<td align="right" class="tablenav" width="20%" valign="middle">
<script>
var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
$help_url = $help_url.replace(/#/g, '%23');
set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
</script>
<a href="javascript: OpenHelp($help_url);">
<img src="img/blue_bar_help.gif" border="0">
</a>
</td>
</tr>
</table>
<inp2:m_blockend/>
<inp2:m_DefineElement name="inp_original_label">
<td><inp2:$prefix.original_Field field="$field"/></td>
</inp2:m_DefineElement>
<inp2:m_block name="subsection" prefix=""/>
<tr class="subsectiontitle">
<td colspan="3"><inp2:m_phrase label="$title"/></td>
<inp2:m_if check="m_ParamEquals" name="prefix" value="" inverse="inverse">
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<td><inp2:m_phrase name="$original_title"/></td>
</inp2:m_if>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_field_caption" subfield="" NamePrefix=""/>
<inp2:m_inc param="tab_index" by="1"/>
<td class="text">
<label for="<inp2:m_param name="NamePrefix"/><inp2:$prefix_InputName field="$field" subfield="$subfield"/>">
<span class="<inp2:m_if prefix="$prefix" function="HasError" field="$field"/>error<inp2:m_endif/>">
<inp2:m_phrase label="$title"/></span><inp2:m_if prefix="$prefix" function="IsRequired" field="$field"/><span class="error"> *</span><inp2:m_endif/>:
</label>
</td>
<inp2:m_blockend/>
<inp2:m_block name="inp_label" is_last="" as_label="" currency="" is_last=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td valign="top"><span class="text"><inp2:$prefix_Field field="$field" as_label="$as_label" currency="$currency"/></span></td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_id_label"/>
<inp2:m_if check="{$prefix}_FieldEquals" field="$field" value="" inverse="inverse">
<inp2:m_ParseBlock name="inp_label" pass_params="true"/>
</inp2:m_if>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_box" subfield="" class="" is_last="" maxlength="" onblur="" size="" onkeyup=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" subfield="$subfield" title="$title" is_last="$is_last"/>
<td>
<input type="text" name="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" id="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" value="<inp2:$prefix_Field field="$field" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>" onkeyup="<inp2:m_Param name="onkeyup"/>">
<inp2:m_if check="{$prefix}_HasParam" name="hint_label"><span class="small"><inp2:m_phrase label="$hint_label"/></span></inp2:m_if>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_upload" class="" is_last=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<input type="file" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>">
<inp2:m_if check="$prefix_FieldEquals" name="$field" value="" inverse="inverse">
(<inp2:$prefix_Field field="$field"/>)
</inp2:m_if>
<input type="hidden" name="<inp2:$prefix_InputName field="$field"/>[upload]" id="<inp2:$prefix_InputName field="$field"/>[upload]" value="<inp2:$prefix_Field field="$field"/>">
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_box_ml" class="" size="" maxlength=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<td class="text" valign="top">
<span class="<inp2:m_if prefix="$prefix" function="HasError" field="$field"/>error<inp2:m_endif/>">
- <inp2:m_phrase label="$title"/><inp2:m_if prefix="$prefix" function="IsRequired" field="$field"/><span class="error"> *</span><inp2:m_endif/>:</span><br>
+ <inp2:m_phrase label="$title"/><inp2:m_if prefix="$prefix" function="IsRequired" field="$field"/><span class="error"> *</span></inp2:m_if>:</span><br>
<a href="javascript:PreSaveAndOpenTranslator('<inp2:m_param name="prefix"/>', '<inp2:m_param name="field"/>', 'popups/translator');" title="<inp2:m_Phrase label="la_Translate"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand" border="0"></a>
</td>
<td>
<input type="text" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field" format="no_default"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_hidden" db=""/>
<input type="hidden" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field" db="$db"/>">
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_date" class="" is_last=""/>
<inp2:m_if check="m_GetEquals" name="calendar_included" value="1" inverse="inverse">
<script type="text/javascript" src="incs/calendar.js"></script>
<inp2:m_set calendar_included="1"/>
</inp2:m_if>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<input type="text" name="<inp2:$prefix_InputName field="{$field}_date"/>" id="<inp2:$prefix_InputName field="{$field}_date"/>" value="<inp2:$prefix_Field field="{$field}_date" format="_regional_InputDateFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:$prefix_Format field="{$field}_date" input_format="1" edit_size="edit_size"/>" class="<inp2:m_param name="class"/>" datepickerIcon="<inp2:m_ProjectBase/>admin/images/ddarrow.gif">&nbsp;<span class="small">(<inp2:$prefix_Format field="{$field}_date" input_format="1" human="true"/>)</span>
<script type="text/javascript">
initCalendar("<inp2:$prefix_InputName field="{$field}_date"/>", "<inp2:$prefix_Format field="{$field}_date" input_format="1"/>");
</script>
<input type="hidden" name="<inp2:$prefix_InputName field="{$field}_time"/>" id="<inp2:$prefix_InputName field="{$field}_time" input_format="1"/>" value="">
</td>
<td class="error"><inp2:$prefix_Error field="{$field}_date"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_date_time" class="" is_last=""/>
<inp2:m_if check="m_GetEquals" name="calendar_included" value="1" inverse="inverse">
<script type="text/javascript" src="incs/calendar.js"></script>
<inp2:m_set calendar_included="1"/>
</inp2:m_if>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<!-- <input type="hidden" id="<inp2:$prefix_InputName field="$field"/>" name="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field" db="db"/>"> -->
<input type="text" name="<inp2:$prefix_InputName field="{$field}_date"/>" id="<inp2:$prefix_InputName field="{$field}_date"/>" value="<inp2:$prefix_Field field="{$field}_date" format="_regional_InputDateFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:$prefix_Format field="{$field}_date" input_format="1" edit_size="edit_size"/>" class="<inp2:m_param name="class"/>" datepickerIcon="<inp2:m_ProjectBase/>admin/images/ddarrow.gif">
<span class="small">(<inp2:$prefix_Format field="{$field}_date" input_format="1" human="true"/>)</span>
<script type="text/javascript">
initCalendar("<inp2:$prefix_InputName field="{$field}_date"/>", "<inp2:$prefix_Format field="{$field}_date" input_format="1"/>");
</script>
&nbsp;<input type="text" name="<inp2:$prefix_InputName field="{$field}_time"/>" id="<inp2:$prefix_InputName field="{$field}_time"/>" value="<inp2:$prefix_Field field="{$field}_time" format="_regional_InputTimeFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:$prefix_Format field="{$field}_time" input_format="1" edit_size="edit_size"/>" class="<inp2:m_param name="class"/>"><span class="small"> (<inp2:$prefix_Format field="{$field}_time" input_format="1" human="true"/>)</span>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_textarea" class="" allow_html="allow_html"/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<td class="text" valign="top">
<span class="<inp2:m_if prefix="$prefix" function="HasError" field="$field"/>error<inp2:m_endif/>">
<inp2:m_phrase label="$title"/><inp2:m_if prefix="$prefix" function="IsRequired" field="$field"/><span class="error"> *</span><inp2:m_endif/>:</span><br>
<inp2:m_if check="m_ParamEquals" name="allow_html" value="allow_html">
<a href="javascript:OpenEditor('&section=in-link:editlink_general','kernel_form','<inp2:$prefix_InputName field="$field"/>');"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
</inp2:m_if>
</td>
<td>
<textarea tabindex="<inp2:m_get param="tab_index"/>" id="<inp2:$prefix_InputName field="$field"/>" name="<inp2:$prefix_InputName field="$field"/>" cols="<inp2:m_param name="cols"/>" rows="<inp2:m_param name="rows"/>" class="<inp2:m_param name="class"/>"><inp2:$prefix_Field field="$field"/></textarea>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_textarea_ml" class=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<td class="text" valign="top">
<span class="<inp2:m_if prefix="$prefix" function="HasError" field="$field"/>error<inp2:m_endif/>">
<inp2:m_phrase label="$title"/><inp2:m_if prefix="$prefix" function="IsRequired" field="$field"/><span class="error"> *</span><inp2:m_endif/>:</span><br>
<a href="javascript:OpenEditor('&section=in-link:editlink_general','kernel_form','<inp2:$prefix_InputName field="$field"/>');"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
<a href="javascript:PreSaveAndOpenTranslator('<inp2:m_param name="prefix"/>', '<inp2:m_param name="field"/>', 'popups/translator', 1);" title="<inp2:m_Phrase label="la_Translate"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand" border="0"></a>
</td>
<td>
<textarea tabindex="<inp2:m_get param="tab_index"/>" id="<inp2:$prefix_InputName field="$field"/>" name="<inp2:$prefix_InputName field="$field"/>" cols="<inp2:m_param name="cols"/>" rows="<inp2:m_param name="rows"/>" class="<inp2:m_param name="class"/>"><inp2:$prefix_Field field="$field"/></textarea>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_user" class="" is_last="" old_style="0" onkeyup=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<input type="text" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>" onkeyup="<inp2:m_Param name="onkeyup"/>">
<inp2:m_if check="m_ParamEquals" name="old_style" value="1">
<a href="#" onclick="return OpenUserSelector('','kernel_form','<inp2:$prefix_InputName field="$field"/>');">
<inp2:m_else/>
<a href="javascript:openSelector('<inp2:m_param name="prefix"/>', '<inp2:m_t t="user_selector" pass="all,$prefix" escape="1"/>', '<inp2:m_param name="field"/>');">
</inp2:m_if>
<img src="img/icons/icon24_link_user.gif" style="cursor:hand;" border="0">
</a>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_option_item"/>
<option value="<inp2:m_param name="key"/>"<inp2:m_param name="selected"/>><inp2:m_param name="option"/></option>
<inp2:m_blockend/>
<inp2:m_block name="inp_option_phrase"/>
<option value="<inp2:m_param name="key"/>"<inp2:m_param name="selected"/>><inp2:m_phrase label="$option"/></option>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_options" is_last="" has_empty="0" empty_value=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<select tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>" onchange="<inp2:m_Param name="onchange"/>">
<inp2:m_if prefix="m" function="ParamEquals" name="use_phrases" value="1"/>
<inp2:$prefix_PredefinedOptions field="$field" block="inp_option_phrase" selected="selected" has_empty="$has_empty" empty_value="$empty_value"/>
<inp2:m_else/>
<inp2:$prefix_PredefinedOptions field="$field" block="inp_option_item" selected="selected" has_empty="$has_empty" empty_value="$empty_value"/>
<inp2:m_endif/>
</select>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_radio_item"/>
<input type="radio" <inp2:m_param name="checked"/> name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>" onclick="<inp2:m_param name="onclick"/>" onchange="<inp2:m_param name="onchange"/>"><label for="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_param name="option"/></label>&nbsp;
<inp2:m_blockend/>
<inp2:m_block name="inp_radio_phrase"/>
<input type="radio" <inp2:m_param name="checked"/> name="<inp2:$prefix_InputName field="$field"/>" id="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>" onclick="<inp2:m_param name="onclick"/>" onchange="<inp2:m_param name="onchange"/>"><label for="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_phrase label="$option"/></label>&nbsp;
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_radio" is_last="" pass_tabindex="" onclick="" onchange="" use_phrases="1"/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<inp2:m_if check="m_ParamEquals" name="use_phrases" value="1">
<inp2:$prefix_PredefinedOptions field="$field" tabindex="$pass_tabindex" block="inp_radio_phrase" selected="checked" onclick="$onclick" onchange="$onchange" />
<inp2:m_else />
<inp2:$prefix_PredefinedOptions field="$field" tabindex="$pass_tabindex" block="inp_radio_item" selected="checked" onclick="$onclick" onchange="$onchange" />
</inp2:m_if>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_checkbox" is_last="" field_class="" onchange=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last" NamePrefix="_cb_"/>
<td>
<input type="hidden" id="<inp2:$prefix_InputName field="$field"/>" name="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field" db="db"/>">
<!--<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:$prefix_InputName field="$field"/>" name="_cb_<inp2:$prefix_InputName field="$field"/>" <inp2:$prefix_Field field="$field" checked="checked" db="db"/> class="<inp2:m_param name="field_class"/>" onclick="update_checkbox(this, document.getElementById('<inp2:$prefix_InputName field="$field"/>'));" onchange="<inp2:m_param name="onchange"/>">-->
<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:$prefix_InputName field="$field"/>" name="_cb_<inp2:$prefix_InputName field="$field"/>" <inp2:$prefix_Field field="$field" checked="checked" db="db"/> class="<inp2:m_param name="field_class"/>" onchange="update_checkbox(this, document.getElementById('<inp2:$prefix_InputName field="$field"/>'));<inp2:m_param name="onchange"/>">
<inp2:m_if check="{$prefix}_HasParam" name="hint_label"><inp2:m_phrase label="$hint_label"/></inp2:m_if>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_checkbox_item"/>
<input type="checkbox" <inp2:m_param name="checked"/> id="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>" onclick="update_checkbox_options(/^<inp2:$prefix_InputName field="$field" as_preg="1"/>_([0-9A-Za-z-]+)/, '<inp2:$prefix_InputName field="$field"/>');"><label for="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_param name="option"/></label>&nbsp;
<inp2:m_blockend/>
<inp2:m_block name="inp_checkbox_phrase"/>
<input type="checkbox" <inp2:m_param name="checked"/> id="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>" onclick="update_checkbox_options(/^<inp2:$prefix_InputName field="$field" as_preg="1"/>_([0-9A-Za-z-]+)/, '<inp2:$prefix_InputName field="$field"/>');"><label for="<inp2:$prefix_InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_phrase label="$option"/></label>&nbsp;
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_checkboxes" is_last=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" is_last="$is_last"/>
<td>
<inp2:m_if check="m_ParamEquals" name="use_phrases" value="1">
<inp2:$prefix_PredefinedOptions field="$field" no_empty="$no_empty" tabindex="$pass_tabindex" hint_label="$hint_label" block="inp_checkbox_phrase" selected="checked"/>
<inp2:m_else/>
<inp2:$prefix_PredefinedOptions field="$field" no_empty="$no_empty" tabindex="$pass_tabindex" hint_label="$hint_label" block="inp_checkbox_item" selected="checked"/>
</inp2:m_if>
<inp2:m_ParseBlock prefix="$prefix" name="inp_edit_hidden" field="$field"/>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_checkbox_allow_html"/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<td colspan="2">
<label for="_cb_<inp2:m_param name="field"/>"><inp2:m_phrase label="la_enable_html"/></label>
<input type="hidden" id="<inp2:$prefix_InputName field="$field"/>" name="<inp2:$prefix_InputName field="$field"/>" value="<inp2:$prefix_Field field="$field"/>">
<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:m_param name="field"/>" name="_cb_<inp2:m_param name="field"/>" <inp2:$prefix_Field field="$field" checked="checked"/> class="<inp2:m_param name="field_class"/>" onclick="update_checkbox(this, document.getElementById('<inp2:$prefix_InputName field="$field"/>'))">
<br>
<span class="hint"><img src="img/smicon7.gif" width="14" height="14" align="absmiddle"><inp2:m_phrase label="la_Warning_Enable_HTML"/></span>
</td>
<td>&nbsp;</td>
</tr>
<inp2:m_blockend/>
<inp2:m_block name="inp_edit_weight" subfield="" class="" is_last="" maxlength=""/>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" subfield="$subfield" title="$title" is_last="$is_last"/>
<td>
<inp2:m_if check="lang.current_FieldEquals" field="UnitSystem" value="1">
<input type="text" name="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" id="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" value="<inp2:$prefix_Field field="$field" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
<inp2:m_phrase label="la_kg" />
</inp2:m_if>
<inp2:m_if check="lang.current_FieldEquals" field="UnitSystem" value="2">
<input type="text" name="<inp2:$prefix_InputName field="{$field}_a" subfield="$subfield"/>" id="<inp2:$prefix_InputName field="{$field}_a" subfield="$subfield"/>" value="<inp2:$prefix_Field field="{$field}_a" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
<inp2:m_phrase label="la_lbs" />
<input type="text" name="<inp2:$prefix_InputName field="{$field}_b" subfield="$subfield"/>" id="<inp2:$prefix_InputName field="{$field}_b" subfield="$subfield"/>" value="<inp2:$prefix_Field field="{$field}_b" subfield="$subfield"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>" class="<inp2:m_param name="class"/>" onblur="<inp2:m_Param name="onblur"/>">
<inp2:m_phrase label="la_oz" />
</inp2:m_if>
</td>
<td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
<inp2:m_if check="{$prefix}_DisplayOriginal" pass_params="1">
<inp2:m_RenderElement prefix="$prefix" field="$field" name="inp_original_label"/>
</inp2:m_if>
</tr>
<inp2:m_blockend />
<inp2:m_DefineElement name="ajax_progress_bar">
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<tr class="table_color1">
<td colspan="2">
<img src="img/spacer.gif" height="10" width="1" alt="" /><br />
<!-- progress bar paddings: begin -->
<table width="90%" cellpadding="2" cellspacing="0" border="0" align="center">
<tr>
<td class="progress-text">0%</td>
<td width="100%">
<!-- progress bar: begin -->
<table cellspacing="0" cellpadding="0" width="100%" border="0" align="center" style="background-color: #FFFFFF; border: 1px solid #E6E6E6;">
<tr>
<td colspan="3"><img src="img/spacer.gif" height="2" width="1" alt="" /></td>
</tr>
<tr>
<td width="2"><img src="img/spacer.gif" height="13" width="3" alt="" /></td>
<td align="center" width="100%">
<table cellspacing="0" cellpadding="0" width="100%" border="0" style="background: url(img/progress_left.gif) repeat-x;">
<tr>
<td id="progress_bar[done]" style="background: url(img/progress_done.gif);" align="left"></td>
<td id="progress_bar[left]" align="right"><img src="img/spacer.gif" height="9" width="1" alt="" /></td>
</tr>
</table>
</td>
<td width="1"><img src="img/spacer.gif" height="13" width="3" alt="" /></td>
</tr>
<tr>
<td colspan="3"><img src="img/spacer.gif" height="2" width="1" alt="" /></td>
</tr>
</table>
<!-- progress bar: end -->
</td>
<td class="progress-text">100%</td>
</tr>
</table>
<!-- progress bar paddings: end -->
<img src="img/spacer.gif" height="10" width="1" alt="" /><br />
</td>
</tr>
<tr class="table_color2">
<td width="50%" align="right"><inp2:m_phrase name="la_fld_PercentsCompleted"/>:</td>
<td id="progress_display[percents_completed]">0%</td>
</tr>
<tr class="table_color1">
<td align="right"><inp2:m_phrase name="la_fld_ElapsedTime"/>:</td>
<td id="progress_display[elapsed_time]">00:00</td>
</tr>
<tr class="table_color2">
<td align="right"><inp2:m_phrase name="la_fld_EstimatedTime"/>:</td>
<td id="progress_display[Estimated_time]">00:00</td>
</tr>
<tr class="table_color1">
<td align="center" colspan="2">
<input type="button" class="button" onclick="<inp2:m_param name="cancel_action"/>" value="<inp2:m_phrase name="la_Cancel"/>" />
</td>
</tr>
</table>
</inp2:m_DefineElement>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/incs/form_blocks.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.45
\ No newline at end of property
+1.46
\ No newline at end of property
Index: trunk/kernel/admin_templates/incs/config_blocks.tpl
===================================================================
--- trunk/kernel/admin_templates/incs/config_blocks.tpl (revision 6427)
+++ trunk/kernel/admin_templates/incs/config_blocks.tpl (revision 6428)
@@ -1,95 +1,95 @@
<inp2:m_DefineElement name="config_edit_text">
- <input type="text" tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:InputName field="$field"/>" value="<inp2:Field field="$field" />" />
+ <input type="text" tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:InputName field="$field"/>" value="<inp2:Field field="$field" />" <inp2:m_param name="field_params" />/>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="config_edit_password">
<input type="password" tabindex="<inp2:m_get param="tab_index"/>" primarytype="password" name="<inp2:InputName field="$field"/>" id="<inp2:InputName field="$field"/>" value="" />
<input type="password" name="verify_<inp2:InputName field="$field"/>" id="verify_<inp2:InputName field="$field"/>" value="" />
&nbsp;<span class="error" id="error_<inp2:InputName field="$field"/>"></span>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="config_edit_option">
<option value="<inp2:m_param name="key"/>"<inp2:m_param name="selected"/>><inp2:m_param name="option"/></option>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="config_edit_select">
<select name="<inp2:InputName field="$field"/>" tabindex="<inp2:m_get param="tab_index"/>">
<inp2:PredefinedOptions field="$field" block="config_edit_option" selected="selected"/>
</select>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="config_edit_checkbox" field_class="">
<input type="hidden" id="<inp2:InputName field="$field"/>" name="<inp2:InputName field="$field"/>" value="<inp2:Field field="$field" db="db"/>">
<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:m_param name="field"/>" name="_cb_<inp2:InputName field="$field"/>" <inp2:Field field="$field" checked="checked" db="db"/> class="<inp2:m_param name="field_class"/>" onclick="update_checkbox(this, document.getElementById('<inp2:InputName field="$field"/>'))">
</inp2:m_DefineElement>
<inp2:m_DefineElement name="config_edit_textarea">
<textarea tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:InputName field="$field"/>" <inp2:m_param name="field_params" />><inp2:Field field="$field" /></textarea>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="config_radio_item">
<input type="radio" <inp2:m_param name="checked"/> name="<inp2:InputName field="$field"/>" id="<inp2:InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>"><label for="<inp2:InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_param name="option"/></label>&nbsp;
</inp2:m_DefineElement>
<inp2:m_DefineElement name="config_edit_radio">
- <inp2:PredefinedOptions field="$field" tabindex="$pass_tabindex" block="config_radio_item" selected="checked"/>
+ <inp2:PredefinedOptions field="$field" block="config_radio_item" selected="checked"/>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="config_block">
<inp2:m_inc param="tab_index" by="1"/>
<inp2:m_if check="m_ParamEquals" name="show_heading" value="1">
<tr class="subsectiontitle">
<td colspan="2">
<inp2:Field name="heading" as_label="1"/>
</td>
<td align="right">
<a class="config-header" href="javascript:toggle_section('<inp2:Field name="heading"/>');" id="toggle_mark[<inp2:Field name="heading"/>]" title="Collapse/Expand Section">[-]</a>
</td>
</tr>
</inp2:m_if>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>" id="<inp2:m_param name="PrefixSpecial"/>_<inp2:field field="$IdField"/>" header_label="<inp2:Field name="heading"/>">
<td>
<inp2:Field field="prompt" as_label="1" />
<inp2:m_if check="m_IsDebugMode">
<br><small>[<inp2:Field field="DisplayOrder"/>] <inp2:Field field="VariableName"/></small>
</inp2:m_if>
</td>
<td>
<inp2:ConfigFormElement PrefixSpecial="$PrefixSpecial" field="VariableValue" blocks_prefix="config_edit_" element_type_field="element_type" value_list_field="ValueList"/>
</td>
<td class="error"><inp2:Error id_field="VariableName"/>&nbsp;</td>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="config_block1">
<inp2:m_inc param="tab_index" by="1"/>
<inp2:m_if check="m_ParamEquals" name="show_heading" value="1">
<tr class="subsectiontitle">
<td colspan="2">
<inp2:Field name="heading" as_label="1"/>
</td>
<td align="right">
<a class="config-header" href="javascript:toggle_section('<inp2:Field name="heading"/>');" id="toggle_mark[<inp2:Field name="heading"/>]" title="Collapse/Expand Section">[-]</a>
</td>
</tr>
</inp2:m_if>
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>" id="<inp2:m_param name="PrefixSpecial"/>_<inp2:Field field="$IdField"/>" header_label="<inp2:Field name="heading"/>">
<td>
<inp2:Field field="prompt" as_label="1" />
<inp2:m_if check="m_IsDebugMode">
<br><small>[<inp2:Field field="DisplayOrder"/>] <inp2:Field field="VariableName"/></small>
</inp2:m_if>
</td>
<td>
<nobr><inp2:ConfigFormElement PrefixSpecial="$PrefixSpecial" field="VariableValue" blocks_prefix="config_edit_" element_type_field="element_type" value_list_field="ValueList"/>&nbsp;&nbsp;
</inp2:m_DefineElement>
<inp2:m_DefineElement name="config_block2">
<inp2:ConfigFormElement PrefixSpecial="$PrefixSpecial" field="VariableValue" blocks_prefix="config_edit_" element_type_field="element_type" value_list_field="ValueList"/></nobr>
</td>
<td class="error"><inp2:Error id_field="VariableName"/>&nbsp;</td>
</tr>
</inp2:m_DefineElement>
Property changes on: trunk/kernel/admin_templates/incs/config_blocks.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property
Index: trunk/kernel/admin_templates/regional/phrases_edit.tpl
===================================================================
--- trunk/kernel/admin_templates/regional/phrases_edit.tpl (revision 6427)
+++ trunk/kernel/admin_templates/regional/phrases_edit.tpl (revision 6428)
@@ -1,57 +1,56 @@
<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
<inp2:m_include t="incs/header" nobody="yes"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
<inp2:m_ParseBlock name="section_header" icon="icon46_conf_regional" title="!la_title_RegionalSettings!"/>
<inp2:m_ParseBlock name="blue_bar" prefix="phrases" title_preset="phrase_edit" module="in-portal" icon="icon46_conf_regional"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('phrases','<inp2:phrases_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('phrases','OnCancel');
}
) );
-
+
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:phrases_SaveWarning name="grid_save_warning"/>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<input type="hidden" id="phrases_label" name="phrases_label" value="<inp2:m_get name="phrases_label"/>">
<inp2:m_DefineElement name="phrase_element">
- <tr class="subsectiontitle">
- <td colspan="3"><inp2:phrases_Field name="Phrase"/></td>
- </tr>
-
- <inp2:m_ParseBlock name="inp_edit_hidden" prefix="phrases" field="LanguageId"/>
- <inp2:m_ParseBlock name="inp_label" prefix="phrases" field="PrimaryTranslation" title="!la_fld_PrimaryTranslation!"/>
- <inp2:m_ParseBlock name="inp_edit_box" prefix="phrases" field="Phrase" title="!la_fld_Phrase!" size="60"/>
- <inp2:m_ParseBlock name="inp_edit_textarea" prefix="phrases" field="Translation" title="!la_fld_Translation!" rows="7" cols="90" allow_html="0"/>
-
- <inp2:m_ParseBlock name="inp_edit_radio" prefix="phrases" field="PhraseType" title="!la_fld_PhraseType!"/>
- <inp2:m_ParseBlock name="inp_edit_options" prefix="phrases" field="Module" title="!la_fld_Module!"/>
+ <tr class="subsectiontitle">
+ <td colspan="3"><inp2:phrases_Field name="Phrase"/></td>
+ </tr>
+
+ <inp2:m_ParseBlock name="inp_edit_hidden" prefix="phrases" field="LanguageId"/>
+ <inp2:m_ParseBlock name="inp_label" prefix="phrases" field="PrimaryTranslation" title="!la_fld_PrimaryTranslation!"/>
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="phrases" field="Phrase" title="!la_fld_Phrase!" size="60"/>
+ <inp2:m_ParseBlock name="inp_edit_textarea" prefix="phrases" field="Translation" title="!la_fld_Translation!" rows="7" cols="90" allow_html="0"/>
+
+ <inp2:m_ParseBlock name="inp_edit_radio" prefix="phrases" field="PhraseType" title="!la_fld_PhraseType!"/>
+ <inp2:m_ParseBlock name="inp_edit_options" prefix="phrases" field="Module" title="!la_fld_Module!"/>
</inp2:m_DefineElement>
-
- <inp2:m_if check="m_GetEquals" name="phrases_label" value="">
+
+ <inp2:m_if check="m_GetEquals" name="phrases_label" value="ALEX, FIX IT!">
<inp2:phrases_MultipleEditing render_as="phrase_element"/>
<inp2:m_else/>
<inp2:m_RenderElement name="phrase_element"/>
</inp2:m_if>
-</table>
+</table>
<inp2:m_include t="incs/footer"/>
-
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/regional/phrases_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.8
\ No newline at end of property
+1.9
\ No newline at end of property
Index: trunk/kernel/admin_templates/tools/system_tools.tpl
===================================================================
--- trunk/kernel/admin_templates/tools/system_tools.tpl (revision 6427)
+++ trunk/kernel/admin_templates/tools/system_tools.tpl (revision 6428)
@@ -1,48 +1,29 @@
<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
<inp2:m_include t="incs/header" nobody="yes"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
<inp2:m_ParseBlock name="section_header" icon="icon46_modules" title="!la_title_SystemTools!"/>
<inp2:m_ParseBlock name="blue_bar" prefix="adm" title_preset="system_tools" module="in-portal" icon="icon46_modules"/>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder" id="config_table">
- <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
- <inp2:m_inc param="tab_index" by="1"/>
- <td class="text" style="width: 300px">
- <inp2:m_phrase label="la_Service_ResetModRwCache"/>:
- </td>
- <td valign="top" width="100"><input class="button" type="submit" name="events[adm][OnResetModRwCache]" value="Go"></td>
- <td class="error">&nbsp;</td>
- </tr>
-
- <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
- <inp2:m_inc param="tab_index" by="1"/>
- <td class="text" style="width: 300px">
- <inp2:m_phrase label="la_Service_ResetCMSMenuCache"/>:
- </td>
- <td valign="top" width="100"><input class="button" type="submit" name="events[adm][OnResetCMSMenuCache]" value="Go"></td>
- <td class="error">&nbsp;</td>
- </tr>
-
+<inp2:m_DefineElement name="service_elem">
<tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
- <td class="text" style="width: 300px">
- <inp2:m_phrase label="la_Service_ResetSections"/>:
+ <td class="text" style="width: 300px;">
+ <inp2:m_phrase label="$title"/>:
</td>
- <td valign="top" width="100"><input class="button" type="submit" name="events[adm][OnResetSections]" value="Go"></td>
- <td class="error">&nbsp;</td>
- </tr>
-
- <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
- <inp2:m_inc param="tab_index" by="1"/>
- <td class="text" style="width: 300px">
- <inp2:m_phrase label="la_Service_ConfigCache"/>:
+ <td valign="top" width="100">
+ <input class="button" type="submit" name="events[adm][<inp2:m_param name="event_name"/>]" value="Go">
</td>
- <td valign="top" width="100"><input class="button" type="submit" name="events[adm][OnResetConfigsCache]" value="Go"></td>
- <td class="error">&nbsp;</td>
+ <td class="error">&nbsp;</td>
</tr>
+</inp2:m_DefineElement>
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder" id="config_table">
+ <inp2:m_RenderElement name="service_elem" title="la_Service_ResetModRwCache" event_name="OnResetModRwCache"/>
+ <inp2:m_RenderElement name="service_elem" title="la_Service_ResetCMSMenuCache" event_name="OnResetCMSMenuCache"/>
+ <inp2:m_RenderElement name="service_elem" title="la_Service_ResetSections" event_name="OnResetSections"/>
+ <inp2:m_RenderElement name="service_elem" title="la_Service_ConfigCache" event_name="OnResetConfigsCache"/>
</table>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/tools/system_tools.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/themes/default/search_results.tpl
===================================================================
--- trunk/themes/default/search_results.tpl (revision 6427)
+++ trunk/themes/default/search_results.tpl (revision 6428)
@@ -1,194 +1,194 @@
<inp:include _template="common/head.tpl" />
<BODY>
<inp:include _Template="common/pagetop.tpl" />
<table width="770" border="0" cellspacing="0" cellpadding="0">
<!-- start content -->
<tr>
<td valign="top" height="100%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10000"><img src="img/s.gif" width="1" height="1" alt="" /><br /></td>
<td><img src="img/s.gif" width="1" height="1" alt="" /><br /></td>
<td><img src="img/s.gif" width="200" height="1" alt="" /><br /></td>
</tr>
<tr>
<td valign="top" class="bott-line">
<!-- path //-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="bgr-path"><img src="img/s.gif" width="549" height="1" alt="" /><br /></td>
<!--<td bgcolor="#61b0ec"><img src="img/s.gif" width="1" height="1" alt="" /><br /></td>-->
</tr>
<tr>
<td class="bgr-path">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" width="17"><img src="img/ic_homepath.gif" width="17" height="24" alt="" /><br /></td>
<td class="path"><a href="<inp:m_template_link _Template="index" _Category=0 />"><inp:m_language _Phrase="lu_home" /></a> > <inp:m_language _Phrase="lu_search_results" /></td>
<td align="right">
<table border="0" cellspacing="0" cellpadding="0" align="right">
<tr>
<td><img src="<inp:m_lang_field _Field="icon" _default="img/ic_flag.gif"/>" width="18" height="12" alt="" /><br /></td>
<td>&nbsp;</td>
<td class="post-action"><span onclick="showSeg('langmenu',true); "><inp:m_lang_field _Field="LocalName" /></span></td>
<td>&nbsp;&nbsp;</td>
</tr>
</table>
</td>
</tr>
- </table>
+ </table>
<inp:include _Template="lang_select/lang_menu.tpl" />
</td>
<!--<td class="bgr-path"><img src="img/s.gif" width="1" height="1" alt="" /><br /></td>-->
</tr>
<tr><td><img src="img/s.gif" width="1" height="1" alt="" /><br /></td></tr>
</table>
<!-- path \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="img/s.gif" width="20" height="1" alt="" /><br /></td>
<td valign="top" width="10000" class="bgr-myaccount">
<img src="img/s.gif" width="1" height="5" alt="" /><br />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<!-- page title -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50"><img src="img/ic_search_big.gif" width="46" height="46" alt="" /><br /></td>
<td><h1><inp:m_language _Phrase="lu_search_results" /></h1></td>
<td>&nbsp;</td>
</tr>
</table>
<!-- end page title -->
<!-- results in brief -->
<br />
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<h2><inp:m_language _Phrase="lu_searched_for" /></h2>
</td>
<td>
- <FORM method="POST" NAME="search" ACTION="<inp:m_form_action _form="m_simple_subsearch" _Template="search_results" />">
+ <FORM method="POST" NAME="search" ACTION="<inp:m_form_action _form="m_simple_subsearch" _Template="search_results" />">
<INPUT type="text" name="keywords" value="<inp:m_form_value _form="m_simple_subsearch" _field="keywords" />" class="input" style="width: 235px;">&nbsp;
<INPUT type="submit" name="search" value="<inp:m_language _Phrase="lu_search_within" />" class="button"></td>
</FORM>
</TD>
</tr>
<tr>
<td colspan="2" class="tips">
<a href="<inp:m_template_link _Template="advanced_search.tpl" />"><inp:m_language _Phrase="lu_advanced_search_link" /></a>
<img src="img/arr_more.gif" width="16" height="7" alt="" />
</td>
</tr>
<tr>
<td colspan="2"><img src="img/s.gif" width="1" height="10" alt="" /><br /></td>
</tr>
<tr>
<td colspan="2" class="bgr-updatefill"><img src="img/s.gif" width="1" height="1" alt="" /><br /></td>
</tr>
</table>
</td>
</tr>
<tr><td><img src="img/s.gif" width="1" height="15" alt="" /><br /></td></tr>
<tr>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="reviewer" valign="top"><inp:m_language _Phrase="lu_found" /></td>
<td><img src="img/s.gif" width="5" height="1" alt="" /><br /></td>
<td>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<inp:mod_include _Template="search_results/search_count.tpl" />
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3" class="error"><inp:m_list_form_errors _Form="m_simplesearch" _ItemTemplate="misc/form_error.tpl" /></td>
</tr>
</table>
</td>
</tr>
<tr><td><img src="img/s.gif" width="1" height="10" alt="" /><br /></td></tr>
<tr><td class="bgr-dark"><img src="img/s.gif" width="1" height="15" alt="" /><br /></td></tr>
<tr><td align="right" valign="top"><img src="img/corn_dark.gif" width="32" height="18" alt="" /><br /></td></tr>
</table>
<!-- end results in brief -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><a name="cats"></a>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<h2><inp:m_language _Phrase="lu_categories" /> <span>(<inp:m_search_cat_count _ItemType="Category" />)</span></h2>
</td>
</tr>
<tr>
<td class="bgr-updatefill"><img src="img/s.gif" width="1" height="1" alt="" /><br /></td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="img/s.gif" width="5" height="1" alt="" /><br /></td>
<td valign="top">
<inp:m_search_list_cats _ShortList="1" _NoTable="1" _ItemTemplate="search_results/category_search_results_element.tpl" _DataExists=1 />
</TD>
</TR>
<TR>
<TD COLSPAN=2 CLASS="pagination" ALIGN="RIGHT">
<inp:m_search_cat_more _ShortList="1" _Template="search_results/cat_search_results.tpl" _text="lu_more" _Image="img/arr_more.gif" />
</TD>
</TR>
</TABLE>
</td>
</tr>
<tr>
<td colspan="2"><img src="img/s.gif" width="1" height="20" alt="" /><br /></td>
</tr>
</table>
- <inp:mod_include _Template="search_results/short_results.tpl" _DataExists=1 />
+ <inp:mod_include _Template="search_results/short_results.tpl" _DataExists=1 />
</td>
</tr>
<tr>
<td colspan="2"><img src="img/s.gif" width="1" height="20" alt="" /><br /></td>
</tr>
</table>
<!-- end articles -->
</td>
</tr>
<tr>
<td colspan="2"><img src="img/s.gif" width="1" height="5" alt="" /><br /></td>
</tr>
</table></td>
<!-- white line content/right column //-->
<td height="100%"><img src="img/s.gif" width="1" height="1" alt="" /><br /></td>
<!-- white line content/right column \\-->
-
+
<!-- right column //-->
<td valign="top" height="100%" class="open-box"><inp:include _template="index/right.tpl" /></td>
<!-- right column \\-->
</tr>
</table>
</td>
</tr>
<!-- end content -->
<inp:include _Template="common/footer.tpl" />
</table>
</body>
</html>
Property changes on: trunk/themes/default/search_results.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/themes/default/common/head.tpl
===================================================================
--- trunk/themes/default/common/head.tpl (revision 6427)
+++ trunk/themes/default/common/head.tpl (revision 6428)
@@ -1,156 +1,162 @@
<inp2:m_CheckSSL/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<!-- start meta tags -->
<meta http-equiv="content-type" content="text/html; charset=<inp:m_regional_option _name="Charset" />" />
<meta name="keywords" content="<inp:m_meta_keywords />" />
<meta name="description" content="<inp:m_meta_description />" />
<meta name="robots" content="all" />
<meta name="copyright" content="Copyright &#174; 1997-2003 Intechnic" />
<meta name="author" content="Intechnic Corporation." />
<!-- end meta tags -->
<base href="<inp:m_theme_url/>" />
<!-- start AddToFavorites icon -->
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<!-- end AddToFavorites icon -->
<SCRIPT language="JavaScript" SRC="incs/sniffer2.js" type="text/javascript"></SCRIPT>
<script language="JavaScript" src="incs/scripts.js" type="text/javascript"></script>
<SCRIPT language="JavaScript1.2" type="text/javascript">
function showSeg(el,on)
{
if(is_getElementById)
{
d = document.getElementById(el);
if (is_nav4up) {d.visibility = (on) ? "show" : "hide"}
else {d.style.visibility = (on) ? "visible" : "hidden"}
}
else
{
if (is_ie)
document.alldivs[el].style.visibility = (on) ? "visible" : "hidden";
else if(is_nav)
document.layers[el].bgColor = (on) ? "show" : "hide";
}
//alert(d.id);
}
function hideSeg(el)
{
tid=setTimeout('showSeg("'+el+'",false)',2000);
}
function moveSeg()
{
if(tid)
clearTimeout(tid);
tid=0;
}
tid = 0;
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? 1 : 0;
ver4 = true; //DEBUG!
//alert("nav4: "+is_nav4up+" IE4:"+is_ie4up);
if (is_nav4up || is_ie4up || is_getElementById) {
leftPos = 520; // if option 1 or 3, above, assign null
topPos = 143; // if option 1 or 3, above, assign null
margRight = 0; // for NO right margin, assign 0
padding = 0; // for NO padding, assign 0
backCol = null; // for transparent, assign null
borWid = null; // for no border, assign null
borCol = "#993366"; // overlooked if borWid is null
borSty = "solid"; // overlooked if borWid is null
if(is_ie4up || is_opera)
{
width=200;
}
else
width = 185;
}
semi = ";";
styStr = "<STYLE TYPE='text/css'>"
styStr += ".segment{";
styStr += "cursor: hand;";
styStr += "position:absolute;";
styStr += "visibility:hidden;";
styStr += "left:"+leftPos+"px;";
styStr += "top:"+topPos+"px;";
styStr += "width:" + width + "px" + semi;
if (borWid > 0) {
styStr += "border-width:" + borWid + semi;
styStr += "border-color:" + borCol + semi;
styStr += "border-style:" + borSty + semi;
}
if (is_nav4up) {
if (borWid > 0 && padding <= 3) styStr += "padding: 0;";
if (borWid > 0 && padding > 3) styStr += "padding:" + (padding-3) + semi;
if (borWid == 0) styStr += "padding:" + padding + semi;
}
else {
styStr += "padding:" + padding + semi;
}
if (backCol != null) {
if (is_nav4up) {
if (borWid > 0 && padding <= 3) {
styStr += "layer-background-color:" + backCol + semi;
}
if (borWid > 0 && padding > 3) {
styStr += "background-color:" + backCol + semi;
}
if (borWid == 0) {
styStr += "layer-background-color:" + backCol + semi;
}
}
else {
styStr += "background-color:" + backCol + semi;
}
}
styStr += "}";
styStr += ".last{position:absolute;visibility:hidden}";
styStr += "</STYLE>";
document.write(styStr);
</SCRIPT>
<SCRIPT Languge="JavaScript1.2">
function highlight_link(elementId,highlight_color)
{
d = document.getElementById(elementId);
if(d)
{
d.style.color = highlight_color;
}
- }
+ }
</SCRIPT>
<title><inp:m_page_title /></title>
<!-- start CSS linked -->
<inp2:theme.current_StylesheetFile/>
<inp:m_module_stylesheets _Modules="In-Portal,In-News,In-Bulletin,In-Link,In-Commerce" _In-PortalCss="incs/inportal_main.css" />
<!-- end CSS linked -->
+
<!-- start name.js code -->
<!--<script src="incs/js/name.js" type="text/javascript" language="JavaScript1.2" charset="utf-8"></script>-->
<!-- end name.js code -->
+
+<inp2:m_if check="m_ModuleEnabled" module="In-Edit"/>
+ <inp2:m_include template="in-edit/blocks/dmenu_head"/>
+</inp2:m_if>
+
</head>
Property changes on: trunk/themes/default/common/head.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.7
\ No newline at end of property
+1.8
\ No newline at end of property
Index: trunk/themes/default/common/pagetop.tpl
===================================================================
--- trunk/themes/default/common/pagetop.tpl (revision 6427)
+++ trunk/themes/default/common/pagetop.tpl (revision 6428)
@@ -1,41 +1,44 @@
+<inp2:m_if check="m_ModuleEnabled" module="In-Edit"/>
+ <inp2:cms_EditPage />
+</inp2:m_if>
<!-- template: pagetop.tpl -->
<table width="770" border="0" cellspacing="0" cellpadding="0">
<!-- header //-->
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="<inp:m_template_link _Template="index" _Category="0" />"><img src="img/logo_inportal_top.gif" width="234" height="84" alt="In-Portal Logo (Home)" border="0" /></a></td>
<td valign="top" align="right" class="bgr-topsquares"><img src="img/top_squares.gif" width="285" height="90" alt="" /><br /></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
- <td align="right" valign="bottom"><img src="img/corn.gif" width="44" height="12" alt="" /><br /></td>
+ <td align="right" valign="bottom" style="vertical-align: bottom"><img src="img/corn.gif" width="44" height="12" alt="" /><br /></td>
<td rowspan="2" width="10000" class="bgr-headnav" align="right">
<table border="0" cellspacing="0" cellpadding="0">
<tr class="head-nav">
<td><a onmouseover="highlight_link('homelink','#ffffff');" onmouseout="highlight_link('homelink','');" href="<inp:m_template_link _Template="index" _Category=0 />"><img src="img/ic_head_home.gif" width="24" height="24" alt="" /></a><br /></td>
- <td><a id="homelink" href="<inp:m_template_link _Template="index" _Category=0 />"><inp:m_language _Phrase="lu_home" /></a></td>
+ <td nowrap="nowrap"><a id="homelink" href="<inp:m_template_link _Template="index" _Category=0 />"><inp:m_language _Phrase="lu_home" /></a></td>
<td><img src="img/ic_head_separ.gif" width="11" height="24" alt="" /><br /></td>
<inp:mod_include _Template="menubar_element" />
<td><a onmouseover="highlight_link('accountlink','#ffffff');" onmouseout="highlight_link('accountlink','');" href="<inp:m_access_template_link _Template="my_account" _System="1" _DeniedTemplate="login" _Perm="login" />"><img src="img/ic_head_myaccount.gif" width="24" height="24" alt="" /></a><br /></td>
- <td><a id="accountlink" href="<inp:m_access_template_link _Template="my_account" _System="1" _DeniedTemplate="login" _Perm="login" _Category=0/>"><inp:m_language _Phrase="lu_myaccount" /></a></td>
+ <td nowrap="nowrap"><a id="accountlink" href="<inp:m_access_template_link _Template="my_account" _System="1" _DeniedTemplate="login" _Perm="login" _Category=0/>"><inp:m_language _Phrase="lu_myaccount" /></a></td>
<td><img src="img/s.gif" width="10" height="1" alt="" /><br /></td>
</tr>
</table>
</td>
</tr>
<tr>
- <td class="bgr-logounder"><img src="img/s.gif" width="1" height="12" alt="" /><img src="img/s.gif" width="279" height="1" alt="" /><br /></td>
+ <td class="bgr-logounder" width="100000"><img src="img/s.gif" width="1" height="12" alt="" /><br /></td>
</tr>
</table>
</td>
</tr>
<!-- header \\-->
</table>
Property changes on: trunk/themes/default/common/pagetop.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/admin/advanced_view.php
===================================================================
--- trunk/admin/advanced_view.php (revision 6427)
+++ trunk/admin/advanced_view.php (nonexistent)
@@ -1,311 +0,0 @@
-<?php
-##############################################################
-##In-portal ##
-##############################################################
-## In-portal ##
-## Intechnic Corporation ##
-## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
-## otherwise redistributed without proper written ##
-## consent of Intechnic Corporation. Violation will ##
-## result in revocation of the license and support ##
-## privileges along maximum prosecution allowed by law. ##
-##############################################################
-
-function k4getmicrotime()
-{
- list($usec, $sec) = explode(" ", microtime());
- return ((float)$usec + (float)$sec);
-}
-
-$start = k4getmicrotime();
-define('ADVANCED_VIEW', 1);
-
-// new startup: begin
-define('REL_PATH', 'admin');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-checkViewPermission('in-portal:advanced_view');
-define('REQUIRE_LAYER_HEADER', 1);
-$b_topmargin = "0";
-//$b_header_addon = "<DIV style='position:relative; z-Index: 1; background-color: #ffffff; padding-top:1px;'><div style='position:absolute; width:100%;top:0px;' align='right'><img src='images/logo_bg.gif'></div><img src='images/spacer.gif' width=1 height=15><br><div style='z-Index:1; position:relative'>";
-
-require_login();
-
-$indexURL = $rootURL."index.php";
-$homeURL = "javascript:AdminCatNav('".$_SERVER["PHP_SELF"]."?env=".BuildEnv()."');";
-
-$m_var_list_update["cat"] = 0;
-unset($m_var_list_update["cat"]);
-
-$pathtolocal = $pathtoroot."kernel/";
-require_once ($pathtoroot.$admin."/include/elements.php");
-//require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/browse/toolbar.php");
-
-$mod_prefixes = Array();
-$m = GetModuleArray();
-foreach($m as $key=>$value)
-{
- $path = $pathtoroot.$value."admin/include/parser.php";
- if(file_exists($path))
- {
- //echo "<!-- $path -->";
- $mod_prefixes[] = $key;
- @include_once($path);
- }
-}
-
-$application->InitParser();
-
-$cat_templates = $objModules->ExecuteFunction('GetModuleInfo', 'advanced_view_template');
-foreach ($cat_templates as $a_mod => $a_template) {
- if (!$a_template) continue;
- $a_var = $a_mod.'_TAB_HTML';
- $$a_var = $application->ParseBlock(Array('name'=>$a_template), 0, true);
-}
-
-if (!defined('IS_INSTALL') ) define('IS_INSTALL', 0);
-if( !IS_INSTALL ) require_login();
-
-//Set Section
-$section = 'in-portal:advanced_view';
-
-//Set Environment Variable
-
-// save last category visited
-$objSession->SetVariable('prev_category', $objSession->GetVariable('last_category') );
-$objSession->SetVariable('last_category', $objCatList->CurrentCategoryID() );
-
-$objSession->SetVariable("HasChanges", 0);
-// where should all edit popups submit changes
-$objSession->SetVariable("ReturnScript", basename($_SERVER['PHP_SELF']) );
-
-
-// common "Advanced View" tab php functions: begin
-function GetAdvView_SearchWord($prefix)
-{
- global $objSession;
- return $objSession->GetVariable($prefix.'_adv_view_search');
-}
-
-function SaveAdvView_SearchWord($prefix)
-{
- global $objSession;
- $SearchWord = $objSession->GetVariable($prefix.'_adv_view_search');
- if( isset($_REQUEST['SearchWord']) )
- {
- $SearchWord = $_REQUEST['SearchWord'];
- $objSession->SetVariable($prefix.'_adv_view_search', $SearchWord);
- }
-}
-
-function ResetAdvView_SearchWord($prefix)
-{
- global $objSession;
- $objSession->SetVariable($prefix.'_adv_view_search', '');
-}
-
-function ShowSearchForm($prefix, $envar, $TabID)
-{
- global $imagesURL;
- $btn_prefix = $imagesURL.'/toolbar/icon16_search';
- $SearchWord = GetAdvView_SearchWord($prefix);
- echo '<form method="post" action="'.$_SERVER["PHP_SELF"].'?'.$envar.'" name="'.$prefix.'_adv_view_search" id="'.$prefix.'_adv_view_search">
- <input type="hidden" name="Action" value="">
- <table cellspacing="0" cellpadding="0">
- <tr>
- <td>'.admin_language('la_SearchLabel').'&nbsp;</td>
- <td><input id="'.$prefix.'_SearchWord" type="text" value="'.inp_htmlize($SearchWord,1).'" name="SearchWord" size="10" style="border-width: 1; border-style: solid; border-color: 999999"></td>
- <td>
- <img
- id="'.$TabID.'_imgSearch"
- src="'.$btn_prefix.'.gif"
- title="'.admin_language("la_ToolTip_Search").'"
- align="absMiddle"
- onclick="SubmitSearch(\''.$prefix.'_adv_view_search\',\''.$prefix.'_adv_view_search\');"
- onmouseover="this.src=\''.$btn_prefix.'_f2.gif\'"
- onmouseout="this.src=\''.$btn_prefix.'.gif\'"
- style="cursor:hand"
- width="22"
- height="22"
- >
- <img
- id="imgSearchReset"
- src="'.$btn_prefix.'_reset.gif"
- title="'.admin_language("la_ToolTip_Search").'"
- align="absMiddle"
- onclick="SubmitSearch(\''.$prefix.'_adv_view_search\',\''.$prefix.'_adv_view_search_reset\');"
- onmouseover="this.src=\''.$btn_prefix.'_reset_f2.gif\'"
- onmouseout="this.src=\''.$btn_prefix.'_reset.gif\'"
- style="cursor:hand"
- width="22"
- height="22"
- >&nbsp;
-
-
- </td>
- </tr>
- </table>
- </form>
- <script language="javascript">
- document.getElementById("'.$prefix.'_SearchWord").onkeydown = getKey;
- </script>
-
- ';
-}
-// common "Advanced View" tab php functions: end
-
-/* page header */
-$charset = GetRegionalOption('Charset');
-print <<<END
-<html>
-<head>
- <title>In-portal</title>
- <meta http-equiv="content-type" content="text/html;charset=$charset">
- <meta http-equiv="Pragma" content="no-cache">
- <script language="JavaScript">
- imagesPath='$imagesURL'+'/';
- </script>
-
-END;
-
- require_once($pathtoroot.$admin."/include/mainscript.php");
-
-print <<<END
-<script type="text/javascript">
- if (window.opener != null) {
- theMainScript.CloseAndRefreshParent();
- }
-</script>
-END;
-
-print <<<END
- <script src="$browseURL/toolbar.js"></script>
- <script src="$browseURL/checkboxes_new.js"></script>
- <!-- <script language="JavaScript1.2" src="$browseURL/fw_menu.js"></script> -->
- <link rel="stylesheet" type="text/css" href="$browseURL/checkboxes.css">
- <link rel="stylesheet" type="text/css" href="$cssURL/style.css">
- <link rel="stylesheet" type="text/css" href="$browseURL/toolbar.css">
-END;
-load_module_styles();
-if( !isset($list) ) $list = '';
-
-int_SectionHeader();
-
- $filter = false;
- $bit_combo = $objModules->ExecuteFunction('GetModuleInfo', 'all_bitmask');
- $bit_combo = $objModules->MergeReturn($bit_combo);
- foreach($bit_combo['VarName'] as $mod_name => $VarName)
- {
- //echo "VarName: [$VarName] = [".$objConfig->Get($VarName)."], ALL = [".$bit_combo['Bits'][$mod_name]."]<br>";
- if( $objConfig->Get($VarName) )
- if( $objConfig->Get($VarName) != $bit_combo['Bits'][$mod_name] )
- {
- $filter = true;
- break;
- }
- }
-
-?>
-</div>
-<!-- alex mark -->
-<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
- <tbody>
- <tr>
- <td>
- <div name="toolBar" id="mainToolBar">
- <tb:button action="edit" title="<?php echo admin_language("la_ToolTip_Edit"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="delete" title="<?php echo admin_language("la_ToolTip_Delete"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:separator ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="approve" title="<?php echo admin_language("la_ToolTip_Approve"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="decline" title="<?php echo admin_language("la_ToolTip_Decline"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:separator ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="print" title="<?php echo admin_language("la_ToolTip_Print"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="view" title="<?php echo admin_language("la_ToolTip_View"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- </div>
- </td>
- </tr>
- </tbody>
-</table>
-
-<?php if ($filter) { ?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
- <tr>
- <td valign="top">
- <?php int_hint_red(admin_language("la_Warning_Filter")); ?>
- </td>
- </tr>
-</table>
-<?php } ?>
-<br>
- <!-- CATEGORY DIVIDER -->
-
-</DIV>
-</div>
-<DIV style="background-color: #ffffff; position: relative; padding-top: 1px; top: -1px; z-Index:0" id="firstContainer">
- <DIV style="background-color: #ffffff; position: relative; padding-top: 1px; top: -1px; z-Index:2" id="secondContainer">
-
-
-
- <?php
-
- print $ItemTabs->TabRow();
-
- if(count($ItemTabs->Tabs))
- {
- ?>
- <div class="divider" id="tabsDevider"><img width=1 height=1 src="images/spacer.gif"></div>
- <?php
- }
- ?>
- </DIV>
-
- <?php
- unset($m);
- $m = GetModuleArray("admin");
-
-
- foreach($m as $key=>$value)
- {
- $path = $pathtoroot.$value."admin/advanced_view.php";
- //echo "Including File: $path<br>";
- if(file_exists($path))
- {
- //echo "\n<!-- $path -->\n";
- include_once($path);
- }
- }
- $admin = $objConfig->Get("AdminDirectory");
- if(!strlen($admin)) $admin = "admin";
- ?>
- <form method="post" action="<?php echo $rootURL.$admin; ?>/advanced_view.php?env=<?php echo BuildEnv(); ?>" name="viewmenu">
- <input type="hidden" name="fieldname" value="">
- <input type="hidden" name="varvalue" value="">
- <input type="hidden" name="varvalue2" value="">
- <input type="hidden" name="Action" value="">
- </form>
-</DIV>
-<!-- END CODE-->
-<script language="JavaScript">
- InitPage();
- if(default_tab.length == 0)
- {
- cookie_start = theMainScript.GetCookie('active_tab');
- if (cookie_start != null) start_tab = cookie_start;
- if(start_tab!=null) toggleTabB(start_tab, true);
- }
- else
- {
- toggleTabB(default_tab,true);
- }
-</script>
-<?php
- $objSession->SetVariable("HasChanges", 0);
- int_footer();
-?>
\ No newline at end of file
Property changes on: trunk/admin/advanced_view.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.25
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/browse.php
===================================================================
--- trunk/admin/browse.php (revision 6427)
+++ trunk/admin/browse.php (nonexistent)
@@ -1,450 +0,0 @@
-<?php
-##############################################################
-##In-portal ##
-##############################################################
-## In-portal ##
-## Intechnic Corporation ##
-## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
-## otherwise redistributed without proper written ##
-## consent of Intechnic Corporation. Violation will ##
-## result in revocation of the license and support ##
-## privileges along maximum prosecution allowed by law. ##
-##############################################################
-
-function k4getmicrotime()
-{
- list($usec, $sec) = explode(" ", microtime());
- return ((float)$usec + (float)$sec);
-}
-
-$start = k4getmicrotime();
-
-// new startup: begin
-define('REL_PATH', 'admin');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-checkViewPermission('in-portal:browse');
-if($application->GetVar('Action') == 'm_paste') define('REDIRECT_REQUIRED',1); // this script can issue redirect header
-
-define('REQUIRE_LAYER_HEADER', 1);
-$b_topmargin = "0";
-//$b_header_addon = "<DIV style='position:relative; z-Index: 1; background-color: #ffffff; padding-top:1px;'><div style='position:absolute; width:100%;top:0px;' align='right'><img src='images/logo_bg.gif'></div><img src='images/spacer.gif' width=1 height=15><br><div style='z-Index:1; position:relative'>";
-
-require_login();
-
-$indexURL = $rootURL."index.php";
-$homeURL = "javascript:AdminCatNav('".$_SERVER["PHP_SELF"]."?env=".BuildEnv()."');";
-
-$m_var_list_update["cat"] = 0;
-unset($m_var_list_update["cat"]);
-
-$envar = "env=" . BuildEnv();
-
-if($objCatList->CurrentCategoryID()>0)
-{
- $c = $objCatList->CurrentCat();
- $upURL = "javascript:AdminCatNav('".$c->Admin_Parent_Link()."');";
-}
-else
- $upURL = $_SERVER["PHP_SELF"]."?".$envar;
-
-//admin only util
-
-$pathtolocal = $pathtoroot."kernel/";
-require_once ($pathtoroot.$admin."/include/elements.php");
-//require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/browse/toolbar.php");
-
-$m = GetModuleArray();
-foreach($m as $key=>$value)
-{
- $path = $pathtoroot.$value."admin/include/parser.php";
- if(file_exists($path))
- {
- //echo "<!-- $path -->";
- @include_once($path);
- }
-}
-
-$cat_templates = $objModules->ExecuteFunction('GetModuleInfo', 'catalog_template');
-foreach ($cat_templates as $a_mod => $a_template) {
- if (!$a_template) continue;
-
- $module_prefix = $application->findModule('Name', $a_mod, 'Var');
- $view_perm = $application->getUnitOption($module_prefix, 'PermItemPrefix').'.VIEW';
- if ($application->CheckPermission($view_perm, 0)) {
- $a_var = $a_mod.'_TAB_HTML';
- $$a_var = $application->ParseBlock(Array('name'=>$a_template), 0, true);
- }
-}
-
-//$application->SetVar('t', 'in-commerce/products/products_catalog');
-
-
-if( !defined('IS_INSTALL') ) define('IS_INSTALL', 0);
-if( !IS_INSTALL ) require_login();
-
-//Set Section
-$section = 'in-portal:browse';
-
-//Set Environment Variable
-
-//echo $objCatList->ItemsOnClipboard()." Categories on the clipboard<br>\n";
-//echo $objTopicList->ItemsOnClipboard()." Topics on the clipboard<br>\n";
-//echo $objLinkList->ItemsOnClipboard()." Links on the clipboard<br>\n";
-//echo $objArticleList->ItemsOnClipboard()." Articles on the clipboard<br>\n";
-
-// save last category visited
-$objSession->SetVariable('prev_category', $objSession->GetVariable('last_category') );
-$objSession->SetVariable('last_category', $objCatList->CurrentCategoryID() );
-
-/* // for testing
-$last_cat = $objSession->GetVariable('last_category');
-$prev_cat = $objSession->GetVariable('prev_category');
-echo "Last CAT: [$last_cat]<br>";
-echo "Prev CAT: [$prev_cat]<br>";
-*/
-$SearchType = $objSession->GetVariable("SearchType");
-if(!strlen($SearchType))
- $SearchType = "all";
-$SearchLabel = "la_SearchLabel";
-if( GetVar('SearchWord') !== false ) $objSession->SetVariable('admin_seach_words', GetVar('SearchWord') );
-$SearchWord = $objSession->GetVariable('admin_seach_words');
-
-// where should all edit popups submit changes
-$objSession->SetVariable("ReturnScript", basename($_SERVER['PHP_SELF']) );
-$charset = GetRegionalOption('Charset');
-
-$base_href = $application->ProcessParsedTag('m', 'Base_Ref', Array());
-
-/* page header */
-print <<<END
-<html>
-<head>
- <title>In-portal</title>
- $base_href
- <meta http-equiv="content-type" content="text/html;charset=$charset">
- <meta http-equiv="Pragma" content="no-cache">
- <script language="JavaScript">
- imagesPath='$imagesURL'+'/';
- </script>
-
-END;
-
- require_once($pathtoroot.$admin."/include/mainscript.php");
-
-print <<<END
-<script type="text/javascript">
- if (window.opener != null) {
- theMainScript.CloseAndRefreshParent();
- }
-</script>
-END;
-
-print <<<END
- <script src="$browseURL/toolbar.js"></script>
- <script src="$browseURL/checkboxes_new.js"></script>
- <script language="JavaScript1.2" src="$browseURL/fw_menu.js"></script>
- <script language="javascript" src="incs/script.js"></script>
- <link rel="stylesheet" type="text/css" href="$browseURL/checkboxes.css">
- <link rel="stylesheet" type="text/css" href="$cssURL/style.css">
- <link rel="stylesheet" type="text/css" href="$browseURL/toolbar.css">
-END;
-load_module_styles();
-if( !isset($list) ) $list = '';
-if(($SearchType=="categories" || $SearchType="all") && strlen($list))
-{
- int_SectionHeader(NULL,NULL,NULL,admin_language("la_Title_SearchResults"));
-}
-else
- int_SectionHeader();
-
-$filter = false; // always initialize variables before use
-
-if($objSession->GetVariable("SearchWord") != '') {
- $filter = true;
-}
-else {
- $bit_combo = $objModules->ExecuteFunction('GetModuleInfo', 'all_bitmask');
- $bit_combo = $objModules->MergeReturn($bit_combo);
- foreach($bit_combo['VarName'] as $mod_name => $VarName)
- {
- //echo "VarName: [$VarName] = [".$objConfig->Get($VarName)."], ALL = [".$bit_combo['Bits'][$mod_name]."]<br>";
- if( $objConfig->Get($VarName) )
- if( $objConfig->Get($VarName) != $bit_combo['Bits'][$mod_name] )
- {
- $filter = true;
- break;
- }
- }
-}
-?>
-</div>
-<!-- alex mark -->
-<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
- <tbody>
- <tr>
- <td>
- <div name="toolBar" id="mainToolBar">
- <tb:button action="upcat" title="<?php echo admin_language("la_ToolTip_Up"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="homecat" title="<?php echo admin_language("la_ToolTip_Home"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:separator ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="new_cat" title="<?php echo admin_language("la_ToolTip_New_Category"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="editcat" title="<?php echo admin_language("la_ToolTip_Edit_Current_Category"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
-
- <?php
- foreach($NewButtons as $btn)
- {
- print '<tb:button action="'.$btn['Action'].'" title="'.$btn['Alt'].'" ImagePath="'.$btn['ImagePath'].'" ';
- if (getArrayValue($btn, 'Tab')) print 'tab="'.$btn['Tab'].'"';
- print ">\n";
- }
- ?>
-
- <tb:button action="edit" title="<?php echo admin_language("la_ToolTip_Edit"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="delete" title="<?php echo admin_language("la_ToolTip_Delete"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:separator ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="approve" title="<?php echo admin_language("la_ToolTip_Approve"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="decline" title="<?php echo admin_language("la_ToolTip_Decline"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:separator ImagePath="<?php echo $imagesURL."/toolbar/";?>">
-
- <tb:button action="export" title="<?php echo admin_language("la_ToolTip_Export"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:separator ImagePath="<?php echo $imagesURL."/toolbar/";?>">
-
- <tb:button action="rebuild_cache" title="<?php echo admin_language("la_ToolTip_RebuildCategoryCache"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:separator ImagePath="<?php echo $imagesURL."/toolbar/";?>">
-
- <tb:button action="cut" title="<?php echo admin_language("la_ToolTip_Cut"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="copy" title="<?php echo admin_language("la_ToolTip_Copy"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="paste" title="<?php echo admin_language("la_ToolTip_Paste"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:separator ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="move_up" title="<?php echo admin_language("la_ToolTip_Move_Up"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="move_down" title="<?php echo admin_language("la_ToolTip_Move_Down"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:separator ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="print" title="<?php echo admin_language("la_ToolTip_Print"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="view" title="<?php echo admin_language("la_ToolTip_View"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- </div>
- </td>
- </tr>
- </tbody>
-</table>
-
-<table cellspacing="0" cellpadding="0" width="100%" bgcolor="#e0e0da" border="0" class="tableborder_full_a">
- <tbody>
- <tr>
- <td><img height="15" src="<?php echo $imagesURL; ?>/arrow.gif" width="15" align="middle" border="0">
- <span class="navbar"><?php $attribs["admin"]=1; print m_navbar($attribs); ?></span>
- </td>
- <td align="right">
- <FORM METHOD="POST" ACTION="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>" NAME="admin_search" ID="admin_search"><INPUT ID="SearchScope" NAME="SearchScope" type="hidden" VALUE="<?php echo $objSession->GetVariable("SearchScope"); ?>"><INPUT ID="SearchType" NAME="SearchType" TYPE="hidden" VALUE="<?php echo $objSession->GetVariable("SearchType"); ?>"><INPUT ID="NewSearch" NAME="NewSearch" TYPE="hidden" VALUE="0"><INPUT TYPE="HIDDEN" NAME="Action" value="m_Exec_Search">
- <table cellspacing="0" cellpadding="0"><tr>
- <td><?php echo admin_language($SearchLabel); ?>&nbsp;</td>
- <td><input ID="SearchWord" type="text" value="<?php echo inp_htmlize($SearchWord,1); ?>" name="SearchWord" size="10" style="border-width: 1; border-style: solid; border-color: 999999"></td>
- <td><img id="imgSearch" action="search_b" src="<?php echo $imagesURL."/toolbar/";?>/icon16_search.gif" title="<?php echo admin_language("la_ToolTip_Search"); ?>" align="absMiddle" onclick="this.action = this.getAttribute('action'); actionHandler(this);" src="<?php echo $imagesURL."/toolbar/";?>/arrow16.gif" onmouseover="this.src='<?php echo $imagesURL."/toolbar/";?>/icon16_search_f2.gif'" onmouseout="this.src='<?php echo $imagesURL."/toolbar/";?>/icon16_search.gif'" style="cursor:hand" width="22" width="22"><!--<img action="search_a" title="<?php echo admin_language("la_ToolTip_Search"); ?>" align="absMiddle" onclick="this.action = this.getAttribute('action'); actionHandler(this);" src="<?php echo $imagesURL."/toolbar/";?>/arrow16.gif" onmouseover="this.src='<?php echo $imagesURL."/toolbar/";?>/arrow16_f2.gif'" onmouseout="this.src='<?php echo $imagesURL."/toolbar/";?>/arrow16.gif'" style="cursor:hand">-->
- <img action="search_c" src="<?php echo $imagesURL."/toolbar/";?>/icon16_search_reset.gif" title="<?php echo admin_language("la_ToolTip_Search"); ?>" align="absMiddle" onclick="document.all.SearchWord.value = ''; this.action = this.getAttribute('action'); actionHandler(this);" onmouseover="this.src='<?php echo $imagesURL."/toolbar/";?>/icon16_search_reset_f2.gif'" onmouseout="this.src='<?php echo $imagesURL."/toolbar/";?>/icon16_search_reset.gif'" style="cursor:hand" width="22" width="22">&nbsp;
- </td>
- </tr></table>
- </FORM>
- <!--tb:button action="search_b" title="<?php echo admin_language("la_ToolTip_Search"); ?>" align="right" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
- <tb:button action="search_a" title="<?php echo admin_language("la_ToolTip_Search"); ?>" align="right" ImagePath="<?php echo $imagesURL."/toolbar/";?>"-->
- </td>
- </tr>
- </tbody>
-</table>
-<?php if ($filter) { ?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
- <tr>
- <td valign="top">
- <?php int_hint_red(admin_language("la_Warning_Filter")); ?>
- </td>
- </tr>
-</table>
-<?php } ?>
-<br>
- <!-- CATEGORY DIVIDER -->
-<?php
-
- $OrderBy = $objCatList->QueryOrderByClause(TRUE,TRUE,TRUE);
- $objCatList->Clear();
- $IsSearch = FALSE;
- if($SearchType == 'categories' || $SearchType == 'all')
- {
- $list = $objSession->GetVariable("SearchWord");
- $SearchQuery = $objCatList->AdminSearchWhereClause($list);
- if(strlen($SearchQuery))
- {
- $SearchQuery = " (".$SearchQuery.") ";
- if( strlen($CatScopeClause) ) {
- $SearchQuery .= " AND ParentId = ".$objCatList->CurrentCategoryID();//" AND ".$CatScopeClause;
- }
- $objCatList->LoadCategories($SearchQuery.$CategoryFilter,$OrderBy);
- $IsSearch = TRUE;
- }
- else
- $objCatList->LoadCategories("ParentId=".$objCatList->CurrentCategoryID()." ".$CategoryFilter,$OrderBy);
- }
- else
- $objCatList->LoadCategories("ParentId=".$objCatList->CurrentCategoryID()." ".$CategoryFilter, $OrderBy);
-
- $TotalItemCount += $objCatList->QueryItemCount;
-
-?>
-<?php
- $e = $Errors->GetAdminUserErrors();
- if(count($e)>0)
- {
- echo "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" border=\"0\">";
- for($ex = 0; $ex<count($e);$ex++)
- {
- echo "<tr><td width=\100%\" class=\"error\">".prompt_language($e[$ex])."</td></tr>";
- }
- echo "</TABLE><br>";
- }
-?>
-<table cellspacing="0" cellpadding="0" width="100%" border="0">
- <tbody>
- <tr>
- <td width="138" height="20" nowrap="nowrap" class="active_tab" onclick="toggleCategoriesB(this)" id="cats_tab">
- <table cellspacing="0" cellpadding="0" width="100%" border="0">
- <tr>
- <td id="l_cat" background="<?php echo $imagesURL; ?>/itemtabs/tab_active_l.gif" class="left_tab">
- <img src="<?php echo $imagesURL; ?>/itemtabs/divider_up.gif" width="20" height="20" border="0" align="absmiddle">
- </td>
- <td id="m_cat" nowrap background="<?php echo $imagesURL; ?>/itemtabs/tab_active.gif" class="tab_class">
- <?php echo admin_language("la_ItemTab_Categories"); ?>:&nbsp;
- </td>
- <td id="m1_cat" align="right" valign="top" background="<?php echo $imagesURL; ?>/itemtabs/tab_active.gif" class="tab_class">
- <span class="cats_stats">(<?php echo $objCatList->QueryItemCount; ?>)</span>&nbsp;
- </td>
- <td id="r_cat" background="<?php echo $imagesURL; ?>/itemtabs/tab_active_r.gif" class="right_tab">
- <img src="<?php echo $imagesURL; ?>/spacer.gif" width="21" height="20">
- </td>
- </tr>
- </table>
- </td>
- <td>&nbsp;</td>
- </tr>
- </tbody>
-</table>
-<div class="divider" style="" id="categoriesDevider"><img width="1" height="1" src="<?php echo $imagesURL; ?>/spacer.gif"></div>
-</DIV>
-</div>
-<DIV style="background-color: #ffffff; position: relative; padding-top: 1px; top: -1px; z-Index:0" id="firstContainer">
- <DIV style="background-color: #ffffff; position: relative; padding-top: 1px; top: -1px; z-Index:2" id="secondContainer">
- <!-- CATEGORY OUTPUT START -->
- <div id="categories" tabtitle="Categories">
- <form id="categories_form" name="categories_form" action="" method="post">
- <input type="hidden" name="Action">
- <?php
- if($IsSearch)
- {
- $template = "cat_search_element.tpl";
- }
- else {
- $template = "cat_element.tpl";
- }
- print adListSubCats($objCatList->CurrentCategoryID(),$template);
- ?>
- </form>
- </div>
- <BR>
- <!-- CATEGORY OUTPUT END -->
- <?php
- print $ItemTabs->TabRow();
- if(count($ItemTabs->Tabs))
- {
- ?>
- <div class="divider" id="tabsDevider"><img width=1 height=1 src="images/spacer.gif"></div>
- <?php
- }
- ?>
- </DIV>
- <?php
- unset($m);
-
- //echo $application->ParseBlock(Array('name'=>'kernel_form_start'), 0, true);
-
- $m = GetModuleArray("admin");
- foreach($m as $key=>$value)
- {
- $path = $pathtoroot.$value."admin/browse.php";
- if(file_exists($path))
- {
- //echo "\n<!-- $path -->\n";
- include_once($path);
- }
- }
-
- //echo $application->ParseBlock(Array('name'=>'kernel_form_end'), 0, true);
-
-
- $admin = $objConfig->Get("AdminDirectory");
- if(!strlen($admin)) $admin = "admin";
- ?>
- <form method="post" action="<?php echo $rootURL.$admin; ?>/browse.php?env=<?php echo BuildEnv(); ?>" name="viewmenu">
- <input type="hidden" name="fieldname" value="">
- <input type="hidden" name="varvalue" value="">
- <input type="hidden" name="varvalue2" value="">
- <input type="hidden" name="Action" value="">
- </form>
-</DIV>
-<!-- END CODE-->
-<script language="JavaScript">
- InitPage();
-
-
- cats_on = theMainScript.GetCookie('cats_tab_on');
- if (cats_on == 0) {
- toggleCategoriesB(document.getElementById('cats_tab'), true);
- }
-
- tabs_on = theMainScript.GetCookie('tabs_on');
- if (tabs_on == '1' || tabs_on == null) {
- if(default_tab.length == 0 || default_tab == 'categories' )
- {
- cookie_start = theMainScript.GetCookie('active_tab');
- if (cookie_start != null) start_tab = cookie_start;
- if(start_tab!=null) {
- //alert('ok');
- toggleTabB(start_tab, true);
- }
- }
- else
- {
- //alert('ok');
- toggleTabB(default_tab,true);
- }
- }
-
- d = document.getElementById('SearchWord');
- if(d)
- {
- d.onkeyup = function(event) {
- if(window.event.keyCode==13)
- {
- var el = document.getElementById('imgSearch');
- el.onclick();
- }
- }
- }
-
- <?php
- if ($application->RecallVar('refresh_tree')) {
- $application->RemoveVar('refresh_tree');
- echo 'var $tree_frame = window.parent.getFrame("menu");';
- echo '$tree_frame.location = $tree_frame.location;';
- }
-
- ?>
-</script>
-
-<?php
- $objSession->SetVariable("HasChanges", 0);
- int_footer();
-?>
\ No newline at end of file
Property changes on: trunk/admin/browse.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.35
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/addrelation.php
===================================================================
--- trunk/admin/category/addrelation.php (revision 6427)
+++ trunk/admin/category/addrelation.php (nonexistent)
@@ -1,212 +0,0 @@
-<?php
-##############################################################
-##In-portal ##
-##############################################################
-## In-portal ##
-## Intechnic Corporation ##
-## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
-## otherwise redistributed without proper written ##
-## consent of Intechnic Corporation. Violation will ##
-## result in revocation of the license and support ##
-## privileges along maximum prosecution allowed by law. ##
-##############################################################
-
-// new startup: begin
-define('REL_PATH', 'admin/category');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-//require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/browse/toolbar.php");
-require_once($pathtoroot.$admin."/listview/listview.php");
-
-$m = GetModuleArray();
-foreach($m as $key=>$value)
-{
- $path = $pathtoroot. $value."admin/include/parser.php";
- if(file_exists($path))
- {
- include_once($path);
- }
-}
-
-unset($objEditCat);
-
-$objEditCat = new clsCatList();
-$objEditCat->SourceTable = $objSession->GetEditTable("Category");
-
-//Multiedit init
-$en = (int)$_GET["en"];
-$objEditCat->Query_Item("SELECT * FROM ".$objEditCat->SourceTable);
-$itemcount=$objEditCat->NumItems();
-$c = $objEditCat->GetItemByIndex($en);
-
-unset($objEditItems);
-
-$objEditItems = new clsRelationshipList();
-$objEditItems->SourceTable = $objSession->GetEditTable("Relationship");
-
-if(isset($_POST["itemlist"]))
-{
- if(is_array($_POST["itemlist"]))
- {
- $RelationId = $_POST["itemlist"][0];
- }
- else
- {
- $RelationId = $_POST["itemlist"];
- }
-
-
- $Rel = new clsRelationship();
- $Rel->tablename = $objEditItems->SourceTable;
- $Rel->LoadExpanded($RelationId);
- $action = "m_edit_relation";
-}
-else
-{
- $Rel = new clsRelationship();
- $Rel->Set("SourceType","1");
- $Rel->Set("SourceId",$c->Get("ResourceId"));
- $Rel->Set("TargetId",$_POST["TargetId"]);
- $Rel->Set("TargetType",$_POST["TargetType"]);
- $Rel->Set("Type","0");
- $Rel->Set("Enabled","1");
- $action = "m_add_relation";
-}
-
-$item = $Rel->GetTargetItemData();
-$envar = "env=" . BuildEnv() . "&en=$en";
-
-$section = 'in-portal:editcategory_relation';
-
-$ado = &GetADODBConnection();
-
-/* page header */
-$charset = GetRegionalOption('Charset');
-print <<<END
-<html>
-<head>
- <title>In-portal</title>
- <meta http-equiv="content-type" content="text/html;charset=$charset">
- <meta http-equiv="Pragma" content="no-cache">
- <script language="JavaScript">
- imagesPath='$imagesURL'+'/';
- </script>
- <script src="$browseURL/common.js"></script>
- <script src="$browseURL/toolbar.js"></script>
- <script src="$browseURL/utility.js"></script>
- <script src="$browseURL/checkboxes.js"></script>
- <script language="JavaScript1.2" src="$browseURL/fw_menu.js"></script>
- <link rel="stylesheet" type="text/css" href="$browseURL/checkboxes.css">
- <link rel="stylesheet" type="text/css" href="$cssURL/style.css">
- <link rel="stylesheet" type="text/css" href="$browseURL/toolbar.css">
-END;
-
-
-$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Category")." '".$c->Get("Name")."' - ".prompt_language("la_Text_Relation");
-$title .= " ".prompt_language("la_Text_to")." '".$item["TitleField"]."'";
-
-
-$objCatToolBar = new clsToolBar();
-$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('category','CatEditStatus','".$admin."/category/addcategory_relations.php',0);",$imagesURL."/toolbar/tool_select.gif");
-$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('category','CatEditStatus','".$admin."/category/addcategory_relations.php',-1);",$imagesURL."/toolbar/tool_cancel.gif");
-
-int_header($objCatToolBar,NULL,$title);
-if ($objSession->GetVariable("HasChanges") == 1) {
-?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
- <tr>
- <td valign="top">
- <?php int_hint_red(admin_language("la_Warning_Save_Item")); ?>
- </td>
- </tr>
-</table>
-<?php } ?>
-<TABLE cellSpacing="0" cellPadding="2" width="100%" class="tableborder">
-<FORM ID="category" NAME="category" method="POST" ACTION="">
-<?php int_subsection_title("Relation"); ?>
-<TR <?php int_table_color(); ?> >
- <TD>
- <span class="text"><?php echo prompt_language("la_prompt_RelationId"). ":</span></TD><TD>".$Rel->Get("RelationshipId"); ?>
- </TD>
- <TD>&nbsp;</TD>
-</TR>
-
-<TR <?php int_table_color(); ?> >
- <TD><span class="text"><?php echo prompt_language("la_prompt_Item"); ?></SPAN></TD>
- <TD>
- <IMG src="<?php echo $Rel->Admin_Icon(); ?>" align="absmiddle"><SPAN id="TargetName"><?php echo $item["TitleField"]; ?></SPAN> <SPAN ID="TargetTypeName">(<?php echo prompt_language("la_Text_".$item["SourceTable"]); ?>)</SPAN>
- </TD>
- <TD>&nbsp;</TD>
-</TR>
-<TR <?php int_table_color(); ?> >
- <TD><span class="text"><?php echo prompt_language("la_prompt_Type"); ?></SPAN></TD>
- <TD>
-<?php
- $Recip = "";
- $OneWay = "";
- if($Rel->Get("Type")=="1")
- {
- $Recip = " CHECKED";
- }
- else
- $OneWay = " CHECKED";
-?>
- <input type="radio" name="RelType" VALUE=1 <?php echo $Recip; ?>><?php echo prompt_language("la_Text_Reciprocal"); ?>
- <input type="radio" name="RelType" VALUE=0 <?php echo $OneWay; ?>><?php echo prompt_language("la_Text_OneWay"); ?>
- </TD>
- <TD>&nbsp;</TD>
-</TR>
-<TR <?php int_table_color(); ?> >
- <TD><span class="text"><?php echo prompt_language("la_prompt_Enabled"); ?></SPAN></TD>
- <TD>
- <?php
- $checked = "";
- if($Rel->Get("Enabled")=="1")
- {
- $checked = " CHECKED";
- }
- ?>
- <input type="checkbox" VALUE="1" name="Enabled" <?php echo $checked; ?>>
- </TD>
- <TD>&nbsp;</TD>
-</TR>
-<TR <?php int_table_color(); ?> >
- <TD><span class="text"><?php echo prompt_language("la_prompt_Priority"); ?></SPAN></TD>
- <TD>
- <INPUT TYPE="TEXT" SIZE="5" NAME="priority" VALUE="<?php echo $Rel->Get("Priority"); ?>">
- </TD>
- <TD>&nbsp;</TD>
-</TR>
- <input type="hidden" name="TargetId" value ="<?php echo $Rel->Get("TargetId"); ?>">
- <input type="hidden" name="TargetType" value ="<?php echo $Rel->Get("TargetType"); ?>">
- <input type="hidden" name="SourceType" value ="<?php echo $Rel->Get("SourceType"); ?>">
- <input type="hidden" name="SourceId" value ="<?php echo $c->Get("ResourceId"); ?>">
- <INPUT TYPE="hidden" NAME="RelationshipId" VALUE="<?php echo $Rel->Get("RelationshipId"); ?>">
- <input type="hidden" name="Action" value="<?php echo $action; ?>">
- <input type="hidden" name="CatEditStatus" VALUE="0">
-</FORM>
-</TABLE>
-<FORM NAME="save_edit_buttons" ID="save_edit_buttons" method="POST" ACTION="">
- <tr <?php int_table_color(); ?>>
- <td colspan="3">
- <input type=hidden NAME="Action" VALUE="save_cat_edit">
- </td>
- </tr>
-</FORM>
-<!-- CODE FOR VIEW MENU -->
-<form method="post" action="user_groups.php?<?php echo $envar; ?>" name="viewmenu">
-<input type="hidden" name="fieldname" value="">
-<input type="hidden" name="varvalue" value="">
-<input type="hidden" name="varvalue2" value="">
-<input type="hidden" name="Action" value="">
-</form>
-<!-- END CODE-->
-<?php int_footer(); ?>
Property changes on: trunk/admin/category/addrelation.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.8
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/images/ddarrow_over.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/category/images/ddarrow_over.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/category/images/ddarrow.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/category/images/ddarrow.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/category/images/ddarrow_active.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/category/images/ddarrow_active.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/category/category_items.php
===================================================================
--- trunk/admin/category/category_items.php (revision 6427)
+++ trunk/admin/category/category_items.php (nonexistent)
@@ -1,54 +0,0 @@
-<?php
- require_once (FULL_PATH.'/admin/include/elements.php');
- require_once (FULL_PATH.'/kernel/admin/include/navmenu.php');
- require_once(FULL_PATH.'/admin/toolbar.php');
- require_once(FULL_PATH.'/admin/listview/listview.php');
-
- $objEditItems = new clsCatList();
- $objEditItems->SourceTable = $objSession->GetEditTable("Category");
-
- $application->SetVar('c_mode', 't');
-
- // Multiedit init
- $en = (int)$_GET['en'];
- $objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable);
-
- $itemcount=$objEditItems->NumItems();
- $c = $objEditItems->GetItemByIndex($en);
-
- if ($itemcount > 1) {
- $en_next = ($en + 1 == $itemcount) ? -1 : $en + 1;
- $en_prev = ($en == 0) ? -1 : $en - 1;
- }
-
- $TitleVerb = prompt_language('la_Text_Editing');
-
- $envar = 'env='.BuildEnv().'&en='.$en;
- $section = 'in-portal:editcategory_items';
-
- $editing_category_title = $c->Get('Name') ? "'".$c->Get('Name')."'" : '';
- $title = $TitleVerb.' '.prompt_language('la_Text_Category').' '.$editing_category_title.' - '.prompt_language('la_tab_General');
-
- //$saveURL = $admin."/browse.php";
- $saveURL = $admin.'/category/category_maint.php';
- $cancelURL = $admin.'/'.$objSession->GetVariable('ReturnScript');
-
- //Display header
- $sec = $objSections->GetSection($section);
-
- $additional_env = '&t=category/category_items&prefix=c';
-
- $objCatToolBar = new clsToolBar();
- $objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('category','CatEditStatus','$saveURL',1,'$additional_env');","tool_select.gif");
- $objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('category','CatEditStatus','$cancelURL',2,'$additional_env');","tool_cancel.gif");
-
- if (isset($en_prev) || isset($en_next)) {
- $url = 'admin/index4_direct.php';
- $StatusField = 'CatEditStatus';
- $form = 'category';
- MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"), $additional_env,'la_PrevCategory','la_NextCategory');
- }
-
- define('REQUIRED_BASE_HREF', 1);
- int_header($objCatToolBar,NULL,$title);
-?>
\ No newline at end of file
Property changes on: trunk/admin/category/category_items.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.4
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/addimage.php
===================================================================
--- trunk/admin/category/addimage.php (revision 6427)
+++ trunk/admin/category/addimage.php (nonexistent)
@@ -1,289 +0,0 @@
-<?php
-##############################################################
-##In-portal ##
-##############################################################
-## In-portal ##
-## Intechnic Corporation ##
-## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
-## otherwise redistributed without proper written ##
-## consent of Intechnic Corporation. Violation will ##
-## result in revocation of the license and support ##
-## privileges along maximum prosecution allowed by law. ##
-##############################################################
-
-// new startup: begin
-define('REL_PATH', 'admin/category');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-/* set the destination of the image upload, relative to the root path */
-$DestDir = 'kernel/images/';
-
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-//require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/browse/toolbar.php");
-require_once($pathtoroot.$admin."/listview/listview.php");
-
-$m = GetModuleArray();
-foreach($m as $key=>$value)
-{
- $path = $pathtoroot. $value."admin/include/parser.php";
- if(file_exists($path))
- {
- include_once($path);
- }
-}
-
-unset($objEditCat);
-
-$objEditCat = new clsCatList();
-$objEditCat->SourceTable = $objSession->GetEditTable("Category");
-
-//Multiedit init
-$en = (int)$_GET["en"];
-$objEditCat->Query_Item("SELECT * FROM ".$objEditCat->SourceTable);
-$itemcount=$objEditCat->NumItems();
-$c = $objEditCat->GetItemByIndex($en);
-
-unset($objEditItems);
-
-$objEditItems = new clsImageList();
-$objEditItems->SourceTable = $objSession->GetEditTable("Images");
-
-if(isset($_POST["itemlist"]))
-{
- if(is_array($_POST["itemlist"]))
- {
- $ImageId = $_POST["itemlist"][0];
- }
- else
- {
- $ImageId = $_POST["itemlist"];
- }
- $img = $objEditItems->GetItem($ImageId);
- $img->Pending=TRUE;
- $action = "m_img_edit";
- $name = $img->Get("Name");
-}
-else
-{
- $img = new clsImage();
- $img->Set("ResourceId",$c->Get("ResourceId"));
- $img->Set("ImageId",$img->FieldMin("ImageId")-1);
- $img->Pending=TRUE;
- $img->tablename = $objEditItems->SourceTable;
- $action = "m_img_add";
- $name = "'New Image'";
-
-}
-
-$envar = "env=" . BuildEnv() . "&en=$en";
-$section = 'in-portal:cat_imageedit';
-$ado = &GetADODBConnection();
-
-/* page header */
-$charset = GetRegionalOption('Charset');
-print <<<END
-<html>
-<head>
- <title>In-portal</title>
- <meta http-equiv="content-type" content="text/html;charset=$charset">
- <meta http-equiv="Pragma" content="no-cache">
- <script language="JavaScript">
- imagesPath='$imagesURL'+'/';
- </script>
- <script src="$browseURL/common.js"></script>
- <script src="$browseURL/toolbar.js"></script>
- <script src="$browseURL/utility.js"></script>
- <script src="$browseURL/checkboxes.js"></script>
- <script language="JavaScript1.2" src="$browseURL/fw_menu.js"></script>
- <link rel="stylesheet" type="text/css" href="$browseURL/checkboxes.css">
- <link rel="stylesheet" type="text/css" href="$cssURL/style.css">
- <link rel="stylesheet" type="text/css" href="$browseURL/toolbar.css">
-END;
-
-$objListToolBar = new clsToolBar();
-
-$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('category','CatEditStatus','".$admin."/category/addcategory_images.php',0);",$imagesURL."/toolbar/tool_select.gif");
-$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('category','CatEditStatus','".$admin."/category/addcategory_images.php',-1);", $imagesURL."/toolbar/tool_cancel.gif");
-
-$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Category")." '".$c->Get("Name")."' - ".prompt_language("la_Text_Image");
-$title .= " '".$name."'";
-int_header($objListToolBar,NULL,$title);
-if ($objSession->GetVariable("HasChanges") == 1) {
-?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
- <tr>
- <td valign="top">
- <?php int_hint_red(admin_language("la_Warning_Save_Item")); ?>
- </td>
- </tr>
-</table>
-<?php } ?>
-<TABLE cellSpacing="0" cellPadding="2" width="100%" class="tableborder">
-<FORM enctype="multipart/form-data" ID="category" NAME="category" method="POST" ACTION="">
-<?php int_subsection_title(prompt_language("la_Text_Image")); ?>
-
-<TR <?php int_table_color(); ?> >
- <TD><?php echo prompt_language("la_prompt_ImageId"); ?></TD>
- <TD><?php if ($img->Get("ImageId") != -1) echo $img->Get("ImageId"); ?></TD>
- <TD></TD>
-</TR>
-
-<TR <?php int_table_color(); ?> >
- <TD><SPAN class="text" id="prompt_imgName"><?php echo prompt_language("la_prompt_Name"); ?></SPAN></TD>
- <TD><input type=text tabindex="1" ValidationType="exists" NAME="imgName" size="30" VALUE="<?php echo inp_htmlize($img->parsetag("image_name")); ?>"></TD>
- <TD></TD>
-</TR>
-
-<TR <?php int_table_color(); ?> >
- <TD><SPAN class="text" id="prompt_imgAlt"><?php echo prompt_language("la_prompt_AltName"); ?></SPAN></TD>
- <TD><input type=text ValidationType="exists" tabindex="2" NAME="imgAlt" size="30" VALUE="<?php echo inp_htmlize($img->parsetag("image_alt")); ?>"></TD>
- <TD></TD>
-</TR>
-
-<TR <?php int_table_color(); ?> >
- <TD><?php echo prompt_language("la_prompt_Status"); ?></TD>
- <TD>
- <input type=RADIO NAME="imgEnabled" tabindex="3" <?php if($img->Get("Enabled")==1) echo "CHECKED"; ?> VALUE="1"><?php echo prompt_language("la_Text_Enabled"); ?>
- <input type=RADIO NAME="imgEnabled" tabindex="3" <?php if($img->Get("Enabled")==0) echo "CHECKED"; ?> VALUE="0"><?php echo prompt_language("la_Text_Disabled"); ?>
- </TD>
- <TD></TD>
-</TR>
-
-<TR <?php int_table_color(); ?> >
- <TD><?php echo prompt_language("la_prompt_Primary"); ?></TD>
- <TD><input type=checkbox NAME="imgDefault" tabindex="4" <?php if($img->Get("DefaultImg")==1) echo "CHECKED"; ?> VALUE="1"></TD>
- <TD></TD>
-</TR>
-
-<TR <?php int_table_color(); ?> >
- <TD><?php echo prompt_language("la_prompt_Priority"); ?></TD>
- <TD><input type=text SIZE="5" NAME="imgPriority" tabindex="5" VALUE="<?php echo $img->Get("Priority"); ?>"></TD>
- <TD></TD>
-</TR>
-
-
-<?php int_subsection_title(prompt_language("la_text_Thumbnail_Image")); ?>
-
-<TR <?php int_table_color(); ?> >
- <TD><?php echo prompt_language("la_prompt_Location"); ?></TD>
- <?php
- if($img->Get("LocalThumb")==1 || strlen($img->Get("LocalThumb"))==0)
- {
- $local="checked";
- $remote = "";
- }
- else
- {
- $remote="checked";
- $local = "";
- }
- ?>
- <TD>
- <TABLE border=0>
- <tr>
- <TD>
- <input type="radio" name="imgLocalThumb" tabindex="6" <?php echo $local; ?> VALUE="1"><?php echo prompt_language("la_prompt_upload"); ?>:
- </td>
- <td>
- <input type=FILE NAME="imgThumbFile" tabindex="7" VALUE=""> <br />
- </td>
- </tr>
- <tr>
- <td>
- <input type="radio" name="imgLocalThumb" tabindex="6" <?php echo $remote; ?> VALUE="0"> <?php echo prompt_language("la_prompt_remote_url"); ?>:
- </td>
- <td>
- <input type=text size=32 NAME="imgThumbUrl" tabindex="8" VALUE=""> <br />
- </td>
- </tr>
- </table>
- </TD>
-
-
- <TD ALIGN="RIGHT">
- <IMG SRC="<?php echo $img->ThumbURL(); ?>">
- </TD>
-</TR>
-
-<?php int_subsection_title(prompt_language("la_Text_Full_Size_Image")); ?>
-
-<TR <?php int_table_color(); ?>>
- <TD><?php echo prompt_language("la_text_Same_As_Thumbnail"); ?></TD>
- <?php
- if(($img->Get("SameImages")=="1") || !$img->Get("ImageId") || ($img->Get("ImageId") == "-1"))
- {
-
- $checked = "CHECKED";
- $disabled = "DISABLED=\"true\"";
- }
- ?>
- <TD><input type=checkbox id="imgSameImages" NAME="imgSameImages" tabindex="9" VALUE="1" <?php echo $checked; ?> ONCLICK="enableFullImage(this);"></TD>
- <TD></TD>
-</TR>
-<TR <?php int_table_color(); ?>>
- <TD><?php echo prompt_language("la_prompt_Location"); ?></TD>
- <?php
- if($img->Get("LocalImage")==1 || strlen($img->Get("LocalImage"))==0)
- {
- $local="checked";
- $remote = "";
- }
- else
- {
- $remote="checked";
- $local = "";
- }
- ?>
- <TD>
- <TABLE border=0>
- <tr>
- <TD>
- <input id="full1" type="radio" name="imgLocalFull" tabindex="10" <?php echo $local; ?> VALUE="1"><?php echo prompt_language("la_prompt_upload"); ?>:
- </td>
- <td>
- <input type=FILE ID="imgFullFile" NAME="imgFullFile" tabindex="11" VALUE=""> <br />
- </td>
- </tr>
- <tr>
- <td>
- <input id="full2" type="radio" name="imgLocalFull" tabindex="10" <?php echo $remote; ?> VALUE="0"> <?php echo prompt_language("la_prompt_remote_url"); ?>:
- </td>
- <td>
- <input type=text size=32 ID="imgFullUrl" NAME="imgFullUrl" tabindex="12" VALUE=""> <br />
- </td>
- </tr>
- </table>
- </td>
- <TD ALIGN="RIGHT">
- <IMG SRC="<?php echo $img->FullURL(); ?>">
- </TD>
-</TR>
- <input type=hidden NAME="Action" VALUE="<?php echo $action; ?>">
- <input type="hidden" name="CatEditStatus" VALUE="0">
- <input type="hidden" name="DestDir" VALUE="<?php echo $DestDir; ?>">
- <INPUT TYPE="hidden" NAME="ImageId" VALUE="<?php echo $img->Get("ImageId"); ?>">
- <input TYPE="HIDDEN" NAME="ResourceId" VALUE="<?php echo $c->Get("ResourceId"); ?>">
-</FORM>
-</TABLE>
-
-<!-- CODE FOR VIEW MENU -->
-<form method="post" action="user_groups.php?<?php echo $envar; ?>" name="viewmenu">
-<input type="hidden" name="fieldname" value="">
-<input type="hidden" name="varvalue" value="">
-<input type="hidden" name="varvalue2" value="">
-<input type="hidden" name="Action" value="">
-</form>
-<script language="JavaScript">
- enableFullImage(document.getElementById('imgSameImages'));
- MarkAsRequired(document.getElementById("category"));
-</script>
-<!-- END CODE-->
-<?php int_footer(); ?>
-
Property changes on: trunk/admin/category/addimage.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.9
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/permcacheupdate.php
===================================================================
--- trunk/admin/category/permcacheupdate.php (revision 6427)
+++ trunk/admin/category/permcacheupdate.php (nonexistent)
@@ -1,383 +0,0 @@
-<?php
-class clsRecursionStack
-{
- var $Stack;
-
- function clsRecursionStack()
- {
- $this->Stack = Array();
- }
-
- function Push($values)
- {
- array_push($this->Stack, $values);
- }
-
- function Pop()
- {
- if ($this->Count() > 0) {
- return array_pop($this->Stack);
- }
- else {
- return false;
- }
- }
-
- function Get()
- {
- if ($this->Count() > 0) {
-// return end($this->Stack);
- return $this->Stack[count($this->Stack)-1];
- }
- else {
- return false;
- }
- }
-
- function Update($values)
- {
- $this->Stack[count($this->Stack)-1] = $values;
- }
-
- function Count()
- {
- return count($this->Stack);
- }
-}
-
-
-class clsCachedPermissions
-{
- var $Allow = Array();
- var $Deny = Array();
- var $CatId;
-
- function clsCachedPermissions($CatId)
- {
- $this->CatId = $CatId;
- }
-
- function SetCatId($CatId)
- {
- $this->CatId = $CatId;
- }
-
- function CheckPermArray($Perm)
- {
- if (!isset($this->Allow[$Perm])) {
- $this->Allow[$Perm] = array();
- $this->Deny[$Perm] = array();
- }
- }
-
- function AddAllow($Perm, $GroupId)
- {
- $this->CheckPermArray($Perm);
- if (!in_array($GroupId, $this->Allow[$Perm])) {
- array_push($this->Allow[$Perm], $GroupId);
- $this->RemoveDeny($Perm, $GroupId);
- }
- }
-
- function AddDeny($Perm, $GroupId)
- {
- $this->CheckPermArray($Perm);
- if (!in_array($GroupId, $this->Deny[$Perm])) {
- array_push($this->Deny[$Perm], $GroupId);
- $this->RemoveAllow($Perm, $GroupId);
- }
- }
-
- function RemoveDeny($Perm, $GroupId)
- {
- if (in_array($GroupId, $this->Deny[$Perm])) {
- array_splice($this->Deny[$Perm], array_search($GroupId, $this->Deny[$Perm]), 1);
- }
- }
-
- function RemoveAllow($Perm, $GroupId)
- {
- if (in_array($GroupId, $this->Allow[$Perm])) {
- array_splice($this->Allow[$Perm], array_search($GroupId, $this->Allow[$Perm]), 1);
- }
- }
-
- function GetInsertSQL()
- {
- $values = array();
-
- $has_deny = array();
-
- /*foreach ($this->Deny as $perm => $groups) {
- if (count($groups) > 0) {
- $values[] = '('.$this->CatId.', '.$perm.', "", "'.join(',', $groups).'")';
- $has_deny[] = $perm;
- }
- }*/
-
- foreach ($this->Allow as $perm => $groups) {
-// if (in_array($perm, $has_deny)) continue;
- if (count($groups) > 0) {
- $values[] = '(' .$this->CatId. ', ' .$perm. ', "' .join(',', $groups). '", "")';
- }
- }
- if (!$values) return '';
- $sql = 'INSERT INTO '.GetTablePrefix().'PermCache (CategoryId, PermId, ACL, DACL) VALUES '.join(',', $values);
- return $sql;
- }
-}
-
-class clsCacheUpdater
-{
- var $Stack;
- var $iteration;
- var $totalCats;
- var $doneCats;
- var $table;
-
- var $root_prefixes = Array();
-
- /**
- * Kernel Application
- *
- * @var kApplication
- */
- var $Application = null;
- /**
- * Enter description here...
- *
- * @var kDBConnection
- */
- var $Conn = null;
-
- function clsCacheUpdater($continuing=false)
- {
- $this->Application =& kApplication::Instance();
- $this->Conn =& $this->Application->GetADODBConnection();
-
- foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
- $this->root_prefixes[ $module_info['RootCat'] ] = $module_info['Var'];
- }
-
- $this->conn =& GetADODBConnection();
- $this->iteration = 0;
- $this->table=$GLOBALS['objSession']->GetEditTable('permCacheUpdate');
-
- if (!$continuing) {
- $this->Stack =& new clsRecursionStack();
- $sql = 'DELETE FROM '.GetTablePrefix().'PermCache';
- $this->conn->Execute($sql);
- $this->initData();
- }
- else {
- $this->getData();
-// $this->SetStack($data);
- }
- }
-
- function getDonePercent()
- {
- if(!$this->totalCats)return 0;
- return intval( round( $this->doneCats / $this->totalCats * 100 ) );
- }
-
- function getData()
- {
- $sql='SELECT data FROM '.$this->table;
- if( $rs = $this->conn->Execute($sql) )
- $tmp = unserialize($rs->fields['data']);
-
- $this->totalCats = isset($tmp['totalCats']) ? $tmp['totalCats'] : 0;
- $this->doneCats = isset($tmp['doneCats']) ? $tmp['doneCats'] : 0;
- if(isset($tmp['stack']))
- $this->Stack = $tmp['stack'];
- else
- $this->Stack = & new clsRecursionStack();
-
- }
-
- function setData()
- {
- $tmp=Array
- (
- 'totalCats' =>$this->totalCats,
- 'doneCats' =>$this->doneCats,
- 'stack' =>$this->Stack,
-
- );
- $sql='DELETE FROM '.$this->table;
- $this->conn->Execute($sql);
- $sql='INSERT '.$this->table.' SET data="'.addslashes(serialize($tmp)).'"';
- $this->conn->Execute($sql);
- }
-
- function initData()
- {
- $this->clearData(); // drop table before starting anyway
-
- $sql = 'CREATE TABLE '.$this->table.'(data LONGTEXT)';
- $this->conn->Execute($sql);
-
- $sql='SELECT COUNT(*) as count FROM '.GetTablePrefix().'Category';
- if( $rs = $this->conn->Execute($sql) )
- $this->totalCats=$rs->fields['count'];
-
- $this->doneCats=0;
- }
-
- function clearData()
- {
- $sql='DROP TABLE IF EXISTS '.$this->table;
- $this->conn->Execute($sql);
- }
-
- function DoTheJob()
- {
- $data = $this->Stack->Get();
- if ($data === false) { //If Stack is empty
- $data['current_id'] = 0;
- $data['title'] = Array();
- $data['named_path'] = Array();
- $data['category_template'] = '';
- $data['item_template'] = '';
- $this->Stack->Push($data);
- }
-
- if (!isset($data['queried'])) {
-
- $this->QueryTitle($data);
- $this->QueryChildren($data);
- $this->QueryPermissions($data);
- $data['queried'] = 1;
-
- if($sql = $data['perms']->GetInsertSQL())
- {
- $this->conn->Execute($sql);
- $this->doneCats++;
- }
- $this->iteration++;
- }
-
- // start with first child if we haven't started yet
- if (!isset($data['current_child'])) $data['current_child'] = 0;
-
- // if we have more children
- if (isset($data['children'][$data['current_child']]))
- {
- $next_data = Array();
- $next_data['title'] = $data['title'];
- $next_data['named_path'] = $data['named_path'];
- $next_data['category_template'] = $data['category_template'];
- $next_data['item_template'] = $data['item_template'];
- $next_data['current_id'] = $data['children'][$data['current_child']]; //next iteration should process child
- $next_data['perms'] = $data['perms']; //we should copy our permissions to child - inheritance
- $next_data['perms']->SetCatId($next_data['current_id']);
- $data['current_child']++;
- $this->Stack->Update($data); //we need to update ourself for the iteration after the next (or further) return to next child
- $this->Stack->Push($next_data); //next iteration should process this child
- return true;
- }
- else {
- $this->UpdateCachedPath($data);
- $this->Stack->Pop(); //remove ourself from stack if we have finished all the childs (or there are none)
- // we are getting here if we finished with current level, so check if it's first level - then bail out.
- return $this->Stack->Count() > 0;
- }
- }
-
- function UpdateCachedPath(&$data)
- {
- $fields_hash = Array( 'CachedNavbar' => implode('>', $data['title']),
- 'NamedParentPath' => implode('/', $data['named_path'] ),
- 'CachedCategoryTemplate'=> $data['category_template'],
- 'CachedItemTemplate' => $data['item_template'],
- );
-
- $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Category', 'CategoryId = '.$data['current_id']);
- }
-
- function QueryTitle(&$data)
- {
- $category_id = $data['current_id'];
-
- $sql = 'SELECT Name, Filename, CategoryTemplate, ItemTemplate
- FROM '.GetTablePrefix().'Category
- WHERE CategoryId = '.$category_id;
-
- $rs = $this->conn->Execute($sql);
-
- if ($rs && !$rs->EOF)
- {
- $data['title'][] = $rs->fields['Name'];
- $data['named_path'][] = $rs->fields['Filename'];
-
- // it is one of the modules root category
- $root_prefix = isset($this->root_prefixes[$category_id]) ? $this->root_prefixes[$category_id] : false;
- if ($root_prefix) {
- $fields_hash = Array();
- if (!$rs->fields['CategoryTemplate']) {
- $rs->fields['CategoryTemplate'] = $this->Application->ConfigValue($root_prefix.'_CategoryTemplate');
- $fields_hash['CategoryTemplate'] = $rs->fields['CategoryTemplate'];
- }
-
- if (!$rs->fields['ItemTemplate']) {
- $rs->fields['ItemTemplate'] = $this->Application->ConfigValue($root_prefix.'_ItemTemplate');
- $fields_hash['ItemTemplate'] = $rs->fields['ItemTemplate'];
- }
-
- $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Category', 'CategoryId = '.$category_id);
- }
-
- // if explicitly set, then use it; use parent template otherwise
- if ($rs->fields['CategoryTemplate']) {
- $data['category_template'] = $rs->fields['CategoryTemplate'];
- }
-
- if ($rs->fields['ItemTemplate']) {
- $data['item_template'] = $rs->fields['ItemTemplate'];
- }
- }
- }
-
- function QueryChildren(&$data)
- {
- $sql = sprintf('SELECT CategoryId FROM '.GetTablePrefix().'Category WHERE ParentId = %s',
- $data['current_id']);
- $rs = $this->conn->Execute($sql);
-
- $data['children'] = Array();
- while ($rs && !$rs->EOF)
- {
- $data['children'][] = $rs->fields['CategoryId'];
- $rs->MoveNext();
- }
- }
-
- function QueryPermissions(&$data)
- {
- // don't search for section "view" permissions here :)
- $sql = sprintf('SELECT ipc.PermissionConfigId, ip.GroupId, ip.PermissionValue FROM '.GetTablePrefix().'Permissions AS ip
- LEFT JOIN '.GetTablePrefix().'PermissionConfig AS ipc
- ON ipc.PermissionName = ip.Permission
- WHERE (CatId = %s) AND (Permission LIKE "%%.VIEW") AND (ipc.PermissionConfigId IS NOT NULL)',
- $data['current_id']);
- $rs = $this->conn->Execute($sql);
-
- //create permissions array only if we don't have it yet (set by parent)
- if (!isset($data['perms'])) {
- $data['perms'] = new clsCachedPermissions($data['current_id']);
- }
-
- while ($rs && !$rs->EOF)
- {
- if ($rs->fields['PermissionValue'] == 1) {
- $data['perms']->AddAllow($rs->fields['PermissionConfigId'], $rs->fields['GroupId']);
- }
- else {
- $data['perms']->AddDeny($rs->fields['PermissionConfigId'], $rs->fields['GroupId']);
- }
- $rs->MoveNext();
- }
- }
-}
-?>
\ No newline at end of file
Property changes on: trunk/admin/category/permcacheupdate.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.10
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/addcategory_customfields.php
===================================================================
--- trunk/admin/category/addcategory_customfields.php (revision 6427)
+++ trunk/admin/category/addcategory_customfields.php (nonexistent)
@@ -1,161 +0,0 @@
-<?php
-##############################################################
-##In-portal ##
-##############################################################
-## In-portal ##
-## Intechnic Corporation ##
-## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
-## otherwise redistributed without proper written ##
-## consent of Intechnic Corporation. Violation will ##
-## result in revocation of the license and support ##
-## privileges along maximum prosecution allowed by law. ##
-##############################################################
-
-// new startup: begin
-define('REL_PATH', 'admin/category');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-//require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/toolbar.php");
-
-$m = GetModuleArray();
-foreach($m as $key=>$value)
-{
- $path = $pathtoroot. $value."admin/include/parser.php";
- if(file_exists($path))
- {
- include_once($path);
- }
-}
-unset($objEditItems);
-
-$objEditItems = new clsCatList();
-$objEditItems->SourceTable = $objSession->GetEditTable("Category");
-$objCustomFields = new clsCustomFieldList(TYPE_CATEGORY,$objSession->GetEditTable("CustomField"));
-
-//Multiedit init
-$en = (int)$_GET["en"];
-$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable);
-$itemcount=$objEditItems->NumItems();
-echo $itemcount . " items loaded..<br>\n";
-$c = $objEditItems->GetItemByIndex($en);
-
-if($itemcount>1)
-{
- if ($en+1 == $itemcount)
- $en_next = -1;
- else
- $en_next = $en+1;
-
- if ($en == 0)
- $en_prev = -1;
- else
- $en_prev = $en-1;
-}
-$action = "m_edit_category";
-
-$envar = "env=" . BuildEnv() . "&en=$en";
-
-$section = 'in-portal:editcategory_custom';
-
-$formaction = $adminURL."/category/addcategory_custom.php?".$envar;
-
-//echo $envar."<br>\n";
-
-//Display header
-$sec = $objSections->GetSection($section);
-
- $objCatToolBar = new clsToolBar();
- $objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('save_edit_buttons','".$admin."/browse.php',1);","tool_select.gif");
- $objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('save_edit_buttons','".$admin."/browse.php',2);","tool_cancel.gif");
-
-if($en_prev or $en_next)
-{
- if($en_prev>-1)
- {
- $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');";
- $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');";
- $onClick= $sec->Get("onclick");
- $var="?env=".BuildEnv()."&en=$en_prev";
- $link=$_SERVER["PHP_SELF"].$var;
- $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Category"),$link,$MouseOver,$MouseOut,"","tool_prev.gif");
- }
- else
- {
- $MouseOver="";
- $MouseOut="";
- $onClick="";
- $link="#";
- $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Category"),"#","","","","tool_prev_f3.gif");
-
- }
- if($en_next>-1)
- {
- $MouseOver="swap('moveright','toolbar/tool_next_f2.gif');";
- $MouseOut="swap('moveright', 'toolbar/tool_next.gif');";
- $onClick=$sec->Get("onclick");
- $var="?env=".BuildEnv()."&en=$en_next";
- $link=$_SERVER["PHP_SELF"].$var;
- $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Category"),$link,$MouseOver,$MouseOut,"","tool_next.gif");
- }
- else
- {
- $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Category"),$link,$MouseOver,$MouseOut,"","tool_next_f3.gif");
- }
-
-
- int_header($objCatToolBar,NULL,$title);
-}
-else
- int_header($objCatToolBar,NULL,$title);
-
-
-?>
-
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
-<?php
- foreach($objCustomFields->Items as $f)
- {
- $o .= "<TR ". int_table_color_ret().">";
- $o .= "<TD valign=\"top\"><span class=\"text\"><input type=checkbox NAME=\"dellist[]\" VALUE=\"".$f->Get("CustomFieldId")."\">";
- $o .= $f->Get("FieldName")."</TD>";
- $o .= "<td valign=\"top\"><span class=\"text\">".$f->Get("FieldLabel")."</TD>";
- $o .= "</TR>";
- }
-?>
-<?php if(strlen($o)) { ?>
-<FORM method=POST action="<?php echo $formaction; ?>" NAME="delcustom">
-<?php int_subsection_title("Custom Defined Fields"); ?>
-
- <?php print $o; ?>
-<tr <?php int_table_color(); ?>>
-<TD COLSPAN=3>
- <input TYPE="SUBMIT" VALUE="Delete Checked Fields">
- <INPUT TYPE="HIDDEN" NAME="Action" VALUE="m_del_custom_field">
-</TD></TR>
-<?php } ?>
-</FORM>
-<?php int_subsection_title("New Custom Field"); ?>
- <tr <?php int_table_color(); ?>>
-<td COLSPAN=3>
-<FORM method=POST action="<?php echo $formaction; ?>" NAME="addcustom">
- <INPUT TYPE="HIDDEN" NAME="Action" VALUE="m_add_custom_field">
- <INPUT TYPE="HIDDEN" NAME="DataType" VALUE="<?php echo TYPE_CATEGORY; ?>">
- New Custom Field Name:<INPUT TYPE="TEXT" NAME="FieldName">
- Label: <INPUT TYPE="TEXT" NAME="FieldLabel">
- <INPUT TYPE="SUBMIT" VALUE="Add Field" CLASS="buttton">
-</FORM>
-</TD></TR>
-</table>
-<FORM NAME="save_edit_buttons" ID="save_edit_buttons" method="POST" ACTION="">
- <input type=hidden NAME="Action" VALUE="save_cat_edit">
- <input type="hidden" name="CatEditStatus" VALUE="0">
-</FORM>
-<?php int_footer(); ?>
\ No newline at end of file
Property changes on: trunk/admin/category/addcategory_customfields.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/addcategory.php
===================================================================
--- trunk/admin/category/addcategory.php (revision 6427)
+++ trunk/admin/category/addcategory.php (nonexistent)
@@ -1,351 +0,0 @@
-<?php
-
-// new startup: begin
-define('REL_PATH', 'admin/category');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-$objSession->SetVariable('IsHomeCategory', 0);
-
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-//require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/toolbar.php");
-
-unset($objEditItems);
-
-if($_REQUEST['item'])
-{
- // smulate like normal edit button pressed
- $tmp_cat =& $objCatList->GetItemByField('ResourceId', $_REQUEST['item']);
- $_POST['catlist'][] = $tmp_cat->UniqueId();
-}
-
-$objEditItems = new clsCatList();
-$objEditItems->SourceTable = $objSession->GetEditTable("Category");
-$objCustomFields = new clsCustomFieldList(1);
-$application->SetVar('c_mode', 't');
-$objCustomDataList = new clsCustomDataList();
-$objRelList = new clsRelationshipList();
-$objImages = new clsImageList();
-
-//Multiedit init
-if ($_GET["new"] == 1)
-{
- $c = new clsCategory(NULL);
- $c->Set("CreatedOn", adodb_mktime());
- $c->Set("EndOn", adodb_mktime());
- $c->Set("ParentId",$objCatList->CurrentCategoryID());
- $c->Set("NewItem",2); //auto
- $c->Set("Status",2); //pending
- $c->Set('AutomaticFilename', 1);
- $en = 0;
- $action = "m_add_category";
- $objCatList->CreateEmptyEditTable("CategoryId");
- $objRelList->CreateEmptyEditTable("RelationshipId");
- $objCustomDataList->CreateEmptyEditTable('c');
- $objImages->CreateEmptyEditTable("ResourceId");
-
- $TitleVerb = prompt_language("la_Text_Adding");
-}
-else
-{
- if(isset($_POST["catlist"]))
- {
- $cats = $_POST["catlist"];
- $objCatList->CopyToEditTable("CategoryId",$cats);
- $objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable);
- /* make a copy of the relationship records */
- $ids = $objEditItems->GetResourceIDList();
- $objRelList->CopyToEditTable("SourceId", $ids);
- $objCustomDataList->CopyToEditTable('c', $ids);
- $objImages->CopyToEditTable("ResourceId", $ids);
- $c = $objEditItems->GetItemByIndex(0);
- $itemcount=$objEditItems->NumItems();
- $en = 0;
- }
- else
- {
- if($_GET["item"])
- {
- /*shortcut to edit link */
- $objCatList->CopyToEditTable("ResourceId",$_GET["item"]);
- $backurl = $_GET["return"];
- }
-
- //Multiedit init
- $en = (int)$_GET["en"];
- $objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable);
-
- //$ids = $objEditItems->GetResourceIDList();
- //$objRelList->CopyToEditTable("SourceId", $ids);
- //$objCustomDataList->CopyToEditTable("ResourceId",$ids);
- //$objImages->CopyToEditTable("ResourceId", $ids);
-
- $itemcount=$objEditItems->NumItems();
- $c = $objEditItems->GetItemByIndex($en);
- }
-
- if($itemcount>1)
- {
- if ($en+1 == $itemcount)
- $en_next = -1;
- else
- $en_next = $en+1;
-
- if ($en == 0)
- $en_prev = -1;
- else
- $en_prev = $en-1;
- }
-
- $action = "m_edit_category";
- $TitleVerb = prompt_language("la_Text_Editing");
-}
-
-$envar = "env=" . BuildEnv() . "&en=$en";
-$section = 'in-portal:editcategory_general';
-
-if (strlen($c->Get("Name")))
- $editing_category_title = "'".$c->Get("Name")."' ";
-else
- $editing_category_title = "";
-
-$title = $TitleVerb." ".prompt_language("la_Text_Category")." $editing_category_title- ".prompt_language("la_tab_General");
-
-//$saveURL = $admin."/browse.php";
-$saveURL = $admin."/category/category_maint.php";
-$cancelURL = $admin."/".$objSession->GetVariable('ReturnScript');
-
-//Display header
-$sec = $objSections->GetSection($section);
-
-$objCatToolBar = new clsToolBar();
-$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('category','CatEditStatus','$saveURL',1,'');","tool_select.gif");
-$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('category','CatEditStatus','$cancelURL',2,'');","tool_cancel.gif");
-
-if ( isset($en_prev) || isset($en_next) )
-{
- $url = $RootUrl.$admin."/category/addcategory.php";
- $StatusField = "CatEditStatus";
- $form = "category";
- MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevCategory','la_NextCategory');
-}
-
-int_header($objCatToolBar,NULL,$title);
-$c->Data=inp_htmlize($c->Data);
-if ($objSession->GetVariable("HasChanges") == 1) {
-?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
- <tr>
- <td valign="top">
- <?php int_hint_red(admin_language("la_Warning_Save_Item")); ?>
- </td>
- </tr>
-</table>
-<?php } ?>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
-<form ID="category" name="category" action="" method=POST>
- <tr <?php int_table_color(1); ?>>
- <td valign="top" colspan="3"><?php echo prompt_language("la_prompt_Enable_HTML"); ?>
- <input type="checkbox" name="html_enable" value="1" checked>
- <br>
- <?php int_hint(prompt_language("la_Warning_Enable_HTML")); ?>
- </td>
- </tr>
- <?php int_subsection_title(prompt_language("la_Text_Category")); ?>
- <?php if( $c->Get("CategoryId") > 0 ) { ?>
- <tr <?php int_table_color(); ?>>
- <td valign="top"><span class="text"><?php echo prompt_language("la_prompt_CategoryId"); ?></span></td>
- <td valign="top"><span class="text"><?php echo $c->Get("CategoryId"); ?></span></td>
- <td class="text">
- <?php
- if (IsDebugMode()) {
- echo '<b>DBG:</b> ResourceId = '.$c->Get('ResourceId');
- }
- else {
- echo '&nbsp;';
- }
- ?>
- </td>
- </tr>
- <?php } ?>
- <tr <?php int_table_color(); ?>>
- <td valign="top"><span ID="prompt_cat_name" class="text"><?php echo prompt_language("la_prompt_Name"); ?></span></td>
- <td>
- <input type="text" name="cat_name" ValidationType="exists" tabindex="1" class="text" size="30" value="<?php echo $c->parsetag("cat_name"); ?>">
- </td>
- <td></td>
- </tr>
- <tr <?php int_table_color(); ?>>
- <td valign="top"><span ID="prompt_cat_desc" class="text"><?php echo prompt_language("la_prompt_Description"); ?></span>
- <br />
- <a href="#">
- <img src="<?php echo $rootURL; ?>admin/icons/icon24_link_editor.gif" style="cursor:hand" border="0"
- ONCLICK="document.forms[0].elements[0].checked=true; OpenEditor('&section=<?php echo $section; ?>','category','cat_desc');">
- </a>
- </td>
- <td>
- <textarea name="cat_desc" id="cat_desc" tabindex="2" ValidationType="exists" cols="60" rows="5" class="text"><?php echo inp_textarea_unescape($c->parsetag("cat_desc")); ?></textarea>
- </td>
- <td></td>
- </tr>
-
- <tr <?php int_table_color(); ?>>
- <td valign="top"><span id="prompt_auto_filename" class="text"><?php echo prompt_language('la_prompt_AutomaticDirectoryName'); ?></span></td>
- <td>
- <input type="checkbox" tabindex="3" name="auto_filename" id="auto_filename" class="text" value="1"<?php if( $c->Get('AutomaticFilename') == 1) echo ' checked'; ?> onchange="reflect_filename();">
- </td>
- <td class="text">&nbsp;</td>
- </tr>
- <tr <?php int_table_color(); ?>>
- <td valign="top"><span ID="prompt_filename" class="text"><?php echo prompt_language('la_prompt_DirectoryName'); ?></span></td>
- <td>
- <input type="text" name="filename" id="filename" tabindex="4" class="text" size="63" value="<?php echo $c->Get('Filename'); ?>">
- </td>
- <td>&nbsp;</td>
- </tr>
-
- <tr <?php int_table_color(); ?>>
- <td valign="top"><span ID="prompt_category_template" class="text"><?php echo prompt_language('la_fld_CategoryTemplate'); ?></span></td>
- <td>
- <input type="text" name="category_template" tabindex="5" class="text" size="40" value="<?php echo $c->Get('CategoryTemplate'); ?>">
- </td>
- <td>&nbsp;</td>
- </tr>
- <tr <?php int_table_color(); ?>>
- <td valign="top"><span ID="prompt_item_template" class="text"><?php echo prompt_language('la_fld_ItemTemplate'); ?></span></td>
- <td>
- <input type="text" name="item_template" tabindex="6" class="text" size="40" value="<?php echo $c->Get('ItemTemplate'); ?>">
- </td>
- <td>&nbsp;</td>
- </tr>
-
- <?php int_subsection_title(prompt_language("la_tab_Properties")); ?>
- <tr <?php int_table_color(); ?>>
- <td valign="top"><span id="prompt_status" class="text"><?php echo prompt_language("la_prompt_Status"); ?></span></td>
- <td>
- <input type="radio" tabindex="7" name="status" class="text" value="1" <?php if($c->Get("Status") == 1) echo "checked"; ?>><?php echo prompt_language("la_val_Active"); ?>
- <input type="radio" tabindex="7" name="status" class="text" value="2" <?php if($c->Get("Status") == 2) echo "checked"; ?>><?php echo prompt_language("la_val_Pending"); ?>
- <input type="radio" tabindex="7" name="status" class="text" value="0" <?php if($c->Get("Status") == 0) echo "checked"; ?>><?php echo prompt_language("la_val_Disabled"); ?>
- </td>
- <td class="text">&nbsp;</td>
- </tr>
- <tr <?php int_table_color(); ?>>
- <td valign="top"><span id="prompt_itemnew" class="text"><?php echo prompt_language("la_prompt_New"); ?></span></td>
- <td>
- <input type="radio" tabindex="8" name="itemnew" class="text" value="2" <?php if($c->Get("NewItem") == 2) echo "checked"; ?>><?php echo prompt_language("la_val_Auto"); ?>
- <input type="radio" tabindex="8" name="itemnew" class="text" value="1" <?php if($c->Get("NewItem") == 1) echo "checked"; ?>><?php echo prompt_language("la_val_Always"); ?>
- <input type="radio" tabindex="8" name="itemnew" class="text" value="0" <?php if($c->Get("NewItem") == 0) echo "checked"; ?>><?php echo prompt_language("la_val_Never"); ?>
-
- </td>
- <td class="text">&nbsp;</td>
- </tr>
- <tr <?php int_table_color(); ?>>
- <td valign="top"><span id="prompt_cat_pick" class="text"><?php echo prompt_language("la_prompt_EditorsPick"); ?></span></td>
- <td>
- <input type="checkbox" tabindex="9" name="cat_pick" class="text" value="1" <?php if($c->Get("EditorsPick") == 1) echo "checked"; ?>>
- </td>
- <td class="text">&nbsp;</td>
- </tr>
- <TR <?php int_table_color(); ?> >
- <TD><span id="prompt_Priority" class="text"><?php echo prompt_language("la_prompt_Priority"); ?></span></TD>
- <TD><input type=text SIZE="5" tabindex="10" NAME="Priority" VALUE="<?php echo $c->Get("Priority"); ?>"></TD>
- <TD>&nbsp;</TD>
- </TR>
- <tr <?php int_table_color(); ?>>
- <td valign="top" ID="prompt_cat_date" class="text"> <?php echo prompt_language("la_prompt_CreatedOn"); ?> </td>
- <td>
- <input type="text" ValidationType="date,exists" tabindex="11" name="cat_date" id="cat_date_selector" datepickerIcon="../images/ddarrow.gif" class="text" size="20" value="<?php echo $c->parsetag("cat_date"); ?>">
- <span class="small"><?php echo prompt_language("la_prompt_DateFormat"); ?></span>
- </td>
- <td>
- <?php if( IsDebugMode() ) echo '<b>DBG:</b> '.adodb_date('M d. Y H:i:s', $c->get('Modified') ); ?>
- </td>
- </tr>
- <?php int_subsection_title(prompt_language("la_Sectionheader_MetaInformation")); ?>
- <tr <?php int_table_color(); ?>>
- <td valign="top"><span id="prompt_meta_keywords" class="text"><?php echo prompt_language("la_prompt_MetaKeywords"); ?></span></td>
- <td>
- <input type="text" name="meta_keywords" tabindex="12" class="text" size="30" value="<?php echo $c->parsetag("cat_metakeywords"); ?>">
- </td>
- <td class="text">&nbsp;</td>
- </tr>
- <tr <?php int_table_color(); ?>>
- <td valign="top"><span id="prompt_meta_desc" class="text"><?php echo prompt_language("la_prompt_MetaDescription"); ?></span></td>
- <td>
- <textarea name="meta_desc" tabindex="13" cols="60" rows="2" class="text"><?php echo inp_textarea_unescape($c->parsetag("cat_metadesc")); ?></textarea>
- </td>
- <td class="text">&nbsp;</td>
- </tr>
-<?php
-
-$CustomFieldUI = $objCustomFields->GetFieldUIList(TRUE);
-if($CustomFieldUI->NumItems()>0)
-{
- $objCustomDataList->SourceTable = $objSession->GetEditTable("CustomMetaData");
- if((int)$c->Get("ResourceId")>0)
- {
- $objCustomDataList->LoadResource($c->Get("ResourceId"));
- }
- $headings = $CustomFieldUI->GetHeadingList();
- //echo "<PRE>";print_r($objCustomFields); echo "</PRE>";
- $tab_index = 14;
- for($i=0;$i<=count($headings);$i++)
- {
- $h = $headings[$i];
- if(strlen($h))
- {
- int_subsection_title(prompt_language($h));
- $Items = $CustomFieldUI->GetHeadingItems($h);
- foreach($Items as $f)
- {
- $n = substr($f->name,1);
-
- $cfield = $objCustomFields->GetItemByField("FieldName",$n,FALSE);
- if (is_object($cfield)) {
- $f->default_value = $c->GetCustomFieldValue($n, '', 0, true);
- }
- print "<tr ".int_table_color_ret().">\n";
- print " <td valign=\"top\" class=\"text\">".$f->GetPrompt()."</td>\n";
- print " <td nowrap>".$f->ItemFormElement($tab_index++)."</TD>";
- if(is_object($f->NextItem))
- {
- $n = $f->NextItem;
- print " <td>".$n->ItemFormElement($tab_index++)."</TD>";
- }
- else
- print " <td><span class=\"text\">&nbsp;</span></td>\n";
- print "</tr>\n";
- }
- }
- }
-}
-?>
- <input type="hidden" name="ParentId" value="<?php echo $c->Get("ParentId"); ?>">
- <input type="hidden" name="CategoryId" value="<?php echo $c->parsetag("cat_id"); ?>">
- <input type="hidden" name="Action" value="<?php echo $action; ?>">
- <input type="hidden" name="CatEditStatus" VALUE="0">
-</FORM>
-
-</table>
-<script src="<?php echo $adminURL; ?>/include/calendar.js"></script>
-
-<SCRIPT language="JavaScript">
- initCalendar("cat_date_selector", CalDateFormat);
- function reflect_filename()
- {
- var $checked = document.getElementById('auto_filename').checked;
- document.getElementById('filename').readOnly = $checked;
- }
- reflect_filename();
-</SCRIPT>
-<FORM method="POST" NAME="save_edit" ID="save_edit">
- <input type="hidden" name="CatEditStatus" VALUE="0">
-</FORM>
-<?php
- MarkFields('category');
- int_footer();
-?>
\ No newline at end of file
Property changes on: trunk/admin/category/addcategory.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.20
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/category_maint.php
===================================================================
--- trunk/admin/category/category_maint.php (revision 6427)
+++ trunk/admin/category/category_maint.php (nonexistent)
@@ -1,128 +0,0 @@
-<?php
-##############################################################
-##In-portal ##
-##############################################################
-## In-portal ##
-## Intechnic Corporation ##
-## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
-## otherwise redistributed without proper written ##
-## consent of Intechnic Corporation. Violation will ##
-## result in revocation of the license and support ##
-## privileges along maximum prosecution allowed by law. ##
-##############################################################
-if(!defined('CACHE_PERM_CHUNK_SIZE'))define('CACHE_PERM_CHUNK_SIZE',30);
-define('REDIRECT_REQUIRED',1); // this script can issue redirect header
-
-// new startup: begin
-define('REL_PATH', 'admin/category');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-//require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/toolbar.php");
-require_once($pathtoroot.$admin."/listview/listview.php");
-$section = "in-portal:category_maint";
-
-$application =& kApplication::Instance();
-require_once($pathtoroot.$admin."/category/permcacheupdate.php");
-if(!$objSession->GetVariable('PermCache_UpdateRequired'))
-{
-
- $application->ApplicationDie(header('Location: '.$adminURL.'/'.$objSession->GetVariable('ReturnScript').'?env='.BuildEnv()));
-}
-if(isset($_GET['continue']))
-{
- $updater =& new clsCacheUpdater(1);
- if(!intval($_GET['continue']))
- {
- $updater->clearData();
- $application->ApplicationDie(header('Location: '.$adminURL.'/'.$objSession->GetVariable('ReturnScript').'?env='.BuildEnv()));
- }
-}
-else
-{
- $updater =& new clsCacheUpdater();
- $no_url = $_SERVER['PHP_SELF'].'?env='.BuildEnv().'&continue=0';
- $yes_url = $_SERVER['PHP_SELF'].'?env='.BuildEnv().'&continue=1';
-
-
- if(!isset($_GET['force']))
- if($updater->totalCats > CACHE_PERM_CHUNK_SIZE)
- {
- $updater->setData();
- $title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories");
- int_header(NULL,NULL,$title);
- flush();
-?>
-<script language="javascript">
- function goto_url(url)
- {
- document.location = url;
- }
-</script>
-<table cellspacing="0" cellpadding="2" width="100%" border="0" class="tableborder">
- <tr>
- <td align="center" colspan="3" bgcolor="#FFFFFF"><?php echo prompt_language('la_confirm_maintenance'); ?></td>
- </tr>
- <tr>
- <td align="center" colspan="3" bgcolor="#FFFFFF"><?php echo prompt_language('la_prompt_perform_now'); ?></td>
- </tr>
- <tr>
- <td align="right" width="50%">
- <input type="button" name="yes_btn" value="<?php echo admin_language("lu_yes"); ?>" onclick="javascript:goto_url('<?php echo $yes_url; ?>');" class="button">
- </td>
- <td><img src="<?php echo $imagesURL; ?>/spacer.gif" width="10"></td>
- <td align="left" width="50%">
- <input type="button" name="yes_btn" value="<?php echo admin_language("lu_no"); ?>" onclick="javascript:goto_url('<?php echo $no_url; ?>');" class="button">
- </td>
- </tr>
-</table>
-<?php
- int_footer();
- $application->ApplicationDie();
- }
-}
-$title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories");
-int_header(NULL,NULL,$title);
-flush();
-$percent=$updater->getDonePercent();
-echo '<TABLE cellspacing="0" cellpadding="2" width="100%" border="0" class="tableborder">';
-if ($percent == 0)
- echo '<TR><TD BGCOLOR="#FFFFFF" width="100%" >'.$percent.'%</td></TR>';
-else if ($percent < 60)
- echo '<TR><TD BGCOLOR="#4682B2" width="'.$percent.'%"></td><TD BGCOLOR="#FFFFFF" width="'.(100-$percent).'%">'.$percent.'%</td></TR>';
-else if ($percent == 100)
- echo '<TR><TD BGCOLOR="#4682B2" align="right" width="100%"><FONT COLOR="#FFFFFF">'.$percent.'%</FONT></td>';
-else
- echo '<TR><TD BGCOLOR="#4682B2" align="right" width="'.$percent.'%"><FONT COLOR="#FFFFFF">'.$percent.'%</FONT></td><TD BGCOLOR="#FFFFFF" width="'.(100-$percent).'%"></td></TR>';
-echo '</TABLE>';
-flush();
-
-$needs_more = TRUE;
-while ($needs_more && $updater->iteration < CACHE_PERM_CHUNK_SIZE) {
- $needs_more = $updater->DoTheJob();
-}
-
-if ($needs_more)
-{
- $updater->setData();
- $url=$adminURL.'/category/category_maint.php?env='.BuildEnv().'&continue=1';
-}
-else
-{
- $updater->clearData();
- $url = $adminURL.'/'.$objSession->GetVariable('ReturnScript').'?env='.BuildEnv();
- $objSession->SetVariable('PermCache_UpdateRequired', 0);
-}
-print "<script language=\"javascript\">" ;
-print "setTimeout(\"document.location='$url';\",400);";
-print "</script>";
-int_footer();
-exit;
-?>
\ No newline at end of file
Property changes on: trunk/admin/category/category_maint.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.24
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/addcategory_custom.php
===================================================================
--- trunk/admin/category/addcategory_custom.php (revision 6427)
+++ trunk/admin/category/addcategory_custom.php (nonexistent)
@@ -1,209 +0,0 @@
-<?php
-##############################################################
-##In-portal ##
-##############################################################
-## In-portal ##
-## Intechnic Corporation ##
-## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
-## otherwise redistributed without proper written ##
-## consent of Intechnic Corporation. Violation will ##
-## result in revocation of the license and support ##
-## privileges along maximum prosecution allowed by law. ##
-##############################################################
-
-// new startup: begin
-define('REL_PATH', 'admin/category');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-//require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/toolbar.php");
-require_once($pathtoroot.$admin."/listview/listview.php");
-
-$m = GetModuleArray();
-foreach($m as $key=>$value)
-
-{
- $path = $pathtoroot. $value."admin/include/parser.php";
- if(file_exists($path))
- {
- include_once($path);
- }
-}
-unset($objEditItems);
-
-$application->SetVar('c_mode', 't');
-$objEditItems = new clsCatList();
-$objEditItems->SourceTable = $objSession->GetEditTable("Category");
-
-//Multiedit init
-$en = (int)$_GET["en"];
-$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable);
-$itemcount=$objEditItems->NumItems();
-
-$c = $objEditItems->GetItemByIndex($en);
-
-if($itemcount>1)
-{
- if ($en+1 == $itemcount)
- $en_next = -1;
- else
- $en_next = $en+1;
-
- if ($en == 0)
- $en_prev = -1;
- else
- $en_prev = $en-1;
-}
-$action = "m_edit_category";
-
-$envar = "env=" . BuildEnv() . "&en=$en";
-
-$section = 'in-portal:editcategory_custom';
-
-$title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Category")." '".$c->Get("Name")."' - ".admin_language("la_tab_Custom");
-
-$formaction = $rootURL.$admin."/category/addcategory_custom.php?".$envar;
-
-//echo $envar."<br>\n";
-
-//Display header
-$sec = $objSections->GetSection($section);
-$objCatToolBar = new clsToolBar();
-
-$ListForm = "permlistform";
-$CheckClass = "PermChecks";
-$objCatToolBar->Set("CheckClass",$CheckClass);
-$objCatToolBar->Set("CheckForm",$ListForm);
-
-$saveURL = $admin."/category/category_maint.php";
-$cancelURL = $admin."/".$objSession->GetVariable('ReturnScript');
-$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('category','CatEditStatus','$saveURL',1);","tool_select.gif");
-$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('category','CatEditStatus','".$cancelURL."',2);","tool_cancel.gif");
-
-if ( isset($en_prev) || isset($en_next) )
-{
- $url = $RootUrl.$admin."/category/addcategory_custom.php";
- $StatusField = "CatEditStatus";
- $form = "category";
- MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevCategory','la_NextCategory');
-}
-
- int_header($objCatToolBar,NULL,$title);
-
-if ($objSession->GetVariable("HasChanges") == 1) {
-?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
- <tr>
- <td valign="top">
- <?php int_hint_red(admin_language("la_Warning_Save_Item")); ?>
- </td>
- </tr>
-</table>
-<?php } ?>
-<form id="category" name="category" action="" method=POST>
-<?php
-
- $objCustomFields = new clsCustomFieldList(1);
-
- $objCustomDataList->SourceTable = $objSession->GetEditTable("CustomMetaData");
- $objCustomDataList->LoadResource($c->Get("ResourceId"));
-
- for($i=0;$i<$objCustomFields->NumItems(); $i++)
- {
- $field =& $objCustomFields->GetItemRefByIndex($i);
- $fieldid = $field->Get("CustomFieldId");
-
- $CF=$field->GetAdminUI();
- if(is_object($cfield = $objCustomFields->GetItemByField("FieldName",substr($CF->name,1),FALSE))) {
- $CF->default_value = $c->GetCustomFieldValue(substr($CF->name,1), '', 0, true);
- }
-
- $f = $objCustomDataList->GetDataItem($fieldid);
- $fieldname = "CustomData[$fieldid]";
-
- if(is_object($f))
- {
-// $val_field = "<input type=\"text\" tabindex=\"".($i+1)."\" VALUE=\"".inp_htmlize($f->Get("Value"))."\" name=\"$fieldname\">";
- $field->Set("Value", $CF->ItemFormElement());
- if ($field->Get('Prompt') != '') {
- $field->Set("FieldLabel", admin_language($field->Get('Prompt')));
- }
- else {
- $field->Set("FieldLabel", admin_language('lu_fieldcustom__'.strtolower($field->Get('FieldName'))));
- }
- $field->Set("DataId",$f->Get("CustomDataId"));
- }
- else
- {
- $val_field = "<input type=text tabindex=\"".($i+1)."\" VALUE=\"\" name=\"$fieldname\">";
- $field->Set("Value", $CF->ItemFormElement());
- if ($field->Get('Prompt') != '') {
- $field->Set("FieldLabel", admin_language($field->Get('Prompt')));
- }
- else {
- $field->Set("FieldLabel", admin_language('lu_fieldcustom__'.strtolower($field->Get('FieldName'))));
- }
- $field->Set("DataId",0);
- }
- }
- $objCustomFields->SortField = $objConfig->Get("CustomData_LV_Sortfield");;
- $objCustomFields->SortItems($objConfig->Get("CustomData_LV_Sortorder")!="desc");
-
- $objListView = new clsListView($objCatToolBar,$objCustomFields);
- $objListView->IdField = "DataId";
-
- $order = $objConfig->Get("CustomData_LV_Sortfield");
- $SortOrder=0;
- if($objConfig->Get("CustomData_LV_Sortorder")=="asc")
- $SortOrder=1;
-
- $objListView->ColumnHeaders->Add("FieldName",admin_language("la_ColHeader_FieldName"),1,0,$order,"width=\"30%\"","CustomData_LV_Sortfield","CustomData_LV_Sortorder","FieldName");
- $objListView->ColumnHeaders->Add("FieldLabel",admin_language("la_ColHeader_FieldLabel"),1,0,$order,"width=\"30%\"","CustomData_LV_Sortfield","CustomData_LV_Sortorder","FieldLabel");
- $objListView->ColumnHeaders->Add("Value",admin_language("la_ColHeader_Value"),1,0,$order,"width=\"40%\"","CustomData_LV_Sortfield","CustomData_LV_Sortorder","Value");
-
- $objListView->ColumnHeaders->SetSort($objConfig->Get("CustomData_LV_Sortfield"), $objConfig->Get("CustomData_LV_Sortorder"));
-
- $objListView->PrintToolBar = FALSE;
- $objListView->checkboxes = FALSE;
-
- $objListView->CurrentPageVar = "Page_CustomData";
- $objListView->PerPageVar = "Perpage_CustomData";
- //$objListView->CheckboxName = "itemlist[]";
-
- for($i=0;$i<count($objCustomFields->Items);$i++)
- {
- $objListView->RowIcons[] = $imagesURL."/itemicons/icon16_custom.gif";
- }
- $objListView->PageLinks = $objListView->PrintPageLinks();
-
- $objListView->SliceItems();
- print $objListView->PrintList();
-?>
- <input type="hidden" name="ItemId" value="<?php echo $c->Get("ResourceId"); ?>">
- <input type="hidden" name="Action" value="m_edit_custom_data">
- <input type="hidden" name="CatEditStatus" VALUE="0">
- <input type="hidden" name="CustomType" VALUE="1">
-</FORM>
-
-
-<FORM id="save_edit" method="POST" NAME="save_edit" ID="save_edit">
- <input type="hidden" name="CatEditStatus" VALUE="0">
- <input type="hidden" name="CustomType" VALUE="1">
-</FORM>
-<!-- CODE FOR VIEW MENU -->
-<form ID="viewmenu" method="post" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>" name="viewmenu">
-<input type="hidden" name="fieldname" value="">
-<input type="hidden" name="varvalue" value="">
-<input type="hidden" name="varvalue2" value="">
-<input type="hidden" name="Action" value="">
-</form>
-
-<?php int_footer(); ?>
Property changes on: trunk/admin/category/addcategory_custom.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.14
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/addpermission.php
===================================================================
--- trunk/admin/category/addpermission.php (revision 6427)
+++ trunk/admin/category/addpermission.php (nonexistent)
@@ -1,344 +0,0 @@
-<?php
-##############################################################
-##In-portal ##
-##############################################################
-## In-portal ##
-## Intechnic Corporation ##
-## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
-## otherwise redistributed without proper written ##
-## consent of Intechnic Corporation. Violation will ##
-## result in revocation of the license and support ##
-## privileges along maximum prosecution allowed by law. ##
-##############################################################
-
-// new startup: begin
-define('REL_PATH', 'admin/category');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-//require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/browse/toolbar.php");
-require_once($pathtoroot.$admin."/listview/listview.php");
-
-$m = GetModuleArray();
-foreach($m as $key=>$value)
-{
- $path = $pathtoroot. $value."admin/include/parser.php";
- if(file_exists($path))
- {
- include_once($path);
- }
-}
-
-unset($objEditItems);
-
-$objEditItems = new clsCatList();
-$objEditItems->SourceTable = $objSession->GetEditTable('Category');
-
-$live_editing = $objSession->GetVariable('IsHomeCategory');
-if ($live_editing) {
- $objEditItems->SourceTable = TABLE_PREFIX.'Category';
-}
-
-//Multiedit init
-$en = (int)$_GET["en"];
-$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable.($objEditItems->isLiveTable() ? ' WHERE CategoryId = 0' : ''));
-$itemcount=$objEditItems->NumItems();
-
-$c = $objEditItems->GetItemByIndex($en);
-
-if(!is_object($c))
-{
- $c = new clsCategory();
- $c->Set("CategoryId",0);
-}
-if($itemcount>1)
-{
- if ($en+1 == $itemcount)
- $en_next = -1;
- else
- $en_next = $en+1;
-
- if ($en == 0)
- $en_prev = -1;
- else
- $en_prev = $en-1;
-}
-$action = "m_edit_permissions";
-
-$envar = "env=" . BuildEnv() . "&en=$en";
-
-$section = 'in-portal:catperm_setperm';
-$Module = $_GET["module"];
-$GroupId = $_GET["GroupId"];
-
-$g = $objGroups->GetItem($GroupId);
-
-$objPermList = new clsPermList($c->Get("CategoryId"),$GroupId);
-$objPermList->LoadPermTree($c);
-
-$objParentPerms = new clsPermList($c->Get("ParentId"),$GroupId);
-$p = $objCatList->GetCategory($c->Get("ParentId"));
-$objParentPerms->LoadPermTree($p);
-
-$ado = &GetADODBConnection();
-
-/* page header */
-$charset = GetRegionalOption('Charset');
-print <<<END
-<html>
-<head>
- <title>In-portal</title>
- <meta http-equiv="content-type" content="text/html;charset=$charset">
- <meta http-equiv="Pragma" content="no-cache">
- <script language="JavaScript">
- imagesPath='$imagesURL'+'/';
- </script>
- <script src="$browseURL/common.js"></script>
- <script src="$browseURL/toolbar.js"></script>
- <script src="$browseURL/utility.js"></script>
- <script src="$browseURL/checkboxes.js"></script>
- <script language="JavaScript1.2" src="$browseURL/fw_menu.js"></script>
- <link rel="stylesheet" type="text/css" href="$browseURL/checkboxes.css">
- <link rel="stylesheet" type="text/css" href="$cssURL/style.css">
- <link rel="stylesheet" type="text/css" href="$browseURL/toolbar.css">
-END;
-
-//int_SectionHeader();
-//$back_url = $rootURL."admin/category/addpermission_modules.php?env=".BuildEnv()."&GroupId=$GroupId";
-$back_url = "javascript:do_edit_save('category','CatEditStatus','".$admin."/category/addpermission_modules.php',0);";
-
-if($c->Get("CategoryId")>0)
-{
- $title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Category")." '".$c->Get("Name")."' - ".prompt_language("la_tab_Permissions");
- $title .= " ".prompt_language("la_text_for")." '".$g->parsetag("group_name")."'";
-}
-else
-{
- $title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Root")." ".prompt_language("la_Text_Category")." - "."' - ".prompt_language("la_tab_Permissions");
- $title .= " ".prompt_language("la_text_for")." '".$g->parsetag("group_name")."'";
-}
-
-$objListToolBar = new clsToolBar();
-
-$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('category','CatEditStatus','".$admin."/category/addpermission_modules.php',0);",$imagesURL."/toolbar/tool_select.gif");
-//$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('category','admin/category/addpermission_modules.php',-1);", $imagesURL."/toolbar/tool_cancel.gif");
-$objListToolBar->Add("img_cancel", "la_Cancel",$back_url,"swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","", $imagesURL."/toolbar/tool_cancel.gif");
-$sec = $objSections->GetSection($section);
-
-if($c->Get("CategoryId")==0)
-{
- $sec->Set("left",NULL);
- $sec->Set("right",NULL);
-
-}
-int_header($objListToolBar,NULL,$title);
-if ($objSession->GetVariable("HasChanges") == 1) {
-?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
- <tr>
- <td valign="top">
- <?php int_hint_red(admin_language("la_Warning_Save_Item")); ?>
- </td>
- </tr>
-</table>
-<?php } ?>
-<TABLE CELLPADDING=0 CELLSPACING=0 class="tableborder" width="100%">
-<TBODY>
- <tr BGCOLOR="#e0e0da">
- <td WIDTH="100%" CLASS="navar">
- <img height="15" src="<?php echo $imagesURL; ?>/arrow.gif" width="15" align="middle" border="0">
- <span class="navbar"><A CLASS="control_link" HREF="<?php echo $back_url; ?>">
- <?php echo prompt_language("la_Prompt_CategoryPermissions")."</A>&gt;"; ?></span>
- <SPAN CLASS="NAV_CURRENT_ITEM"><?php echo $Module; ?></SPAN>
- </td>
- </TR>
-</TBODY>
-</TABLE>
-<TABLE CELLPADDING=0 CELLSPACING=0 class="tableborder" width="100%">
-
-<FORM ID="category" NAME="category" method="POST" ACTION="">
-<TBODY>
- <TR class="subsectiontitle">
- <?php
- echo "<TD>".prompt_language("la_prompt_Description")."</TD>";
- if($c->Get("CategoryId")!=0)
- {
- echo "<TD>".prompt_language("la_ColHeader_PermInherited")."</TD>";
- }
- echo "<TD>".prompt_language("la_ColHeader_PermAccess")."</TD>\n";
- if($c->Get("CategoryId")!=0)
- {
- echo "<td>".prompt_language("la_ColHeader_InheritFrom")."</TD>";
- }
- ?>
- </TR>
-<?php
- if($c->Get("CategoryId")>0)
- {
- $ParentCatList = "0".$c->Get("ParentPath");
- }
- else
- $ParentCatList = "0".$c->GetParentField("ParentPath","","");
- $ParentCats = explode("|",$ParentCatList);
- $ParentCats = array_reverse($ParentCats);
-
- $sql = "SELECT * FROM ".GetTablePrefix()."PermissionConfig WHERE ModuleId='$Module'";
- $rs = $ado->Execute($sql);
- while($rs && !$rs->EOF)
- {
- $perm = $rs->fields;
- $Permission = $perm["PermissionName"];
- $Desc = $perm["Description"];
- echo "<TR ".int_table_color_ret().">\n";
- echo "<TD>".prompt_language("$Desc")." [$Permission]</TD>";
- $p = $objPermList->GetPermByName($Permission);
- $checked = "";
- $MatchCatPath = "";
- if(is_object($p))
- {
- //echo $p->Get("Permission")." Found<br>\n";
- if($p->Inherited)
- {
- $checked = " CHECKED";
- $MatchCatPath = "";
- if($c->Get("CategoryId")>0)
- {
- $MatchedCat = $objPermList->GetDefinedCategory($Permission,$GroupId);
- }
- else
- $MatchedCat = $objParentPerms->GetDefinedCategory($Permission,$GroupId);
-
- if(is_numeric($MatchedCat))
- {
- if($MatchedCat!=0)
- {
- $mcat = $objCatList->GetCategory($MatchedCat);
- $MatchCatPath = language($objConfig->Get("Root_Name")).">".$mcat->Get("CachedNavbar");
- }
- else
- $MatchCatPath = language($objConfig->Get("Root_Name"));
- }
- else
- $MatchCatPath = "";
- }
- }
- else
- $checked = " CHECKED";
- if($c->Get("CategoryId")!=0)
- {
- echo " <TD><INPUT access=\"chk".$Permission."\" ONCLICK=\"SetAccessEnabled(this); \" TYPE=CHECKBOX name=\"inherit[]\" VALUE=\"".$Permission."\" $checked></TD>\n";
- }
- else
- {
- if(is_object($p))
- $p->Inherited = FALSE;
- }
- $checked = "";
- $imgsrc="red";
- if(is_object($p))
- {
- if($p->Get("PermissionValue"))
- {
- $checked = " CHECKED";
- $imgsrc = "green";
- $current = "true";
- }
- else
- {
- $imgsrc = "red";
- $current = "false";
- }
- $disabled = "";
- if($p->Inherited)
- {
- if($c->Get("CategoryId")!=0)
- {
- $InheritValue = $current;
- $UnInheritValue = "false";
- $disabled = "DISABLED=\"true\"";
- }
- else
- {
- $disabled = "";
- $UnInheritValue = "false";
- $InheritValue="false";
-
- }
- }
- else
- {
- $disabled = "";
- if($p->Get("PermissionValue"))
- {
- $InheritValue = "false"; //need to look this up!
- }
- else
- $InheritValue = "false";
- $UnInheritValue = $current;
- }
-
- }
- else
- {
- if($c->Get("CategoryId")!=0)
- {
- $disabled = "DISABLED=\"true\"";
- $InheritValue = "false";
- $UnInheritValue = "false";
- $Matched = FALSE;
- $MatchCatPath = "";
- $MatchedCat = $objPermList->GetDefinedCategory($Permission,$GroupId);
- if(is_numeric($MatchedCat))
- {
- if($MatchedCat>0)
- {
- $mcat = $objCatList->GetCategory($MatchedCat);
- $MatchCatPath =language($objConfig->Get("Root_Name")).">".$mcat->Get("CachedNavbar");
- }
- else
- $MatchCatPath = language($objConfig->Get("Root_Name"));
- }
- else
- $MatchCatPath = "";
- }
- else
- {
- $disabled = "";
- $UnInheritValue = "false";
- $InheritValue="false";
- }
- }
- echo " <TD><INPUT $disabled InheritValue=\"$InheritValue\" UnInheritValue=\"$UnInheritValue\" ID=\"chk".$Permission."\" ONCLICK=\"SetPermImage(this); \" permimg=\"img".$Permission."\" TYPE=CHECKBOX name=\"permvalue[]\" VALUE=\"".$Permission."\" $checked>";
-
- echo " <img ID=\"img".$Permission."\" SRC=\"$imagesURL/perm_".$imgsrc.".gif\">";
- echo " </TD>\n";
- if($c->Get("CategoryId")!=0)
- echo "<TD>$MatchCatPath</TD>";
- echo "</TR>\n";
- $rs->MoveNext();
- }
-?>
-</TBODY>
- <INPUT TYPE="HIDDEN" NAME="Action" VALUE="m_edit_permissions">
- <input type="hidden" NAME="GroupId" VALUE="<?php echo $GroupId; ?>">
- <input TYPE="HIDDEN" NAME="CategoryId" VALUE="<?php echo $c->Get("CategoryId"); ?>">
- <input type="hidden" name="CatEditStatus" VALUE="0">
- <input TYPE="HIDDEN" NAME="Module" VALUE="<?php echo $Module; ?>">
-</FORM>
-</TABLE>
-<!-- CODE FOR VIEW MENU -->
-<form method="post" action="user_groups.php?<?php echo $envar; ?>" name="viewmenu">
-<input type="hidden" name="fieldname" value="">
-<input type="hidden" name="varvalue" value="">
-<input type="hidden" name="varvalue2" value="">
-<input type="hidden" name="Action" value="">
-</form>
-<!-- END CODE-->
-<?php int_footer(); ?>
Property changes on: trunk/admin/category/addpermission.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.9
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/addcategory_permissions.php
===================================================================
--- trunk/admin/category/addcategory_permissions.php (revision 6427)
+++ trunk/admin/category/addcategory_permissions.php (nonexistent)
@@ -1,226 +0,0 @@
-<?php
-##############################################################
-##In-portal ##
-##############################################################
-## In-portal ##
-## Intechnic Corporation ##
-## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
-## otherwise redistributed without proper written ##
-## consent of Intechnic Corporation. Violation will ##
-## result in revocation of the license and support ##
-## privileges along maximum prosecution allowed by law. ##
-##############################################################
-
-// new startup: begin
-define('REL_PATH', 'admin/category');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-// Permissions tab is opened first -> Home category live permissions editing
-$item_resource_id = $application->GetVar('item');
-if (($item_resource_id !== false) && ((int)$item_resource_id === 0)) {
- $objSession->SetVariable('IsHomeCategory', 1);
-}
-
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-//require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/toolbar.php");
-require_once($pathtoroot.$admin."/listview/listview.php");
-
-$m = GetModuleArray();
-foreach($m as $key=>$value)
-{
- $path = $pathtoroot. $value."admin/include/parser.php";
- if(file_exists($path))
- {
- include_once($path);
- }
-}
-
-unset($objEditItems);
-
-$objEditItems = new clsCatList();
-$objEditItems->SourceTable = $objSession->GetEditTable("Category");
-
-$live_editing = $objSession->GetVariable('IsHomeCategory');
-if ($live_editing) {
- $objEditItems->SourceTable = TABLE_PREFIX.'Category';
-}
-
-//Multiedit init
-$en = (int)$_GET["en"];
-$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable.($objEditItems->isLiveTable() ? ' WHERE CategoryId = 0' : ''));
-$itemcount = $objEditItems->NumItems();
-if(isset($_GET["en"]))
-{
- $c = $objEditItems->GetItemByIndex($en);
-}
-
-if(!is_object($c))
-{
- $c = new clsCategory($m_var_list["cat"]);
- $c->Set("CategoryId",$m_var_list["cat"]);
-}
-if($itemcount>1)
-{
- if ($en+1 == $itemcount)
- $en_next = -1;
- else
- $en_next = $en+1;
-
- if ($en == 0)
- $en_prev = -1;
- else
- $en_prev = $en-1;
-}
-
-$action = "m_edit_category";
-
-/* -------------------------------------- Section configuration ------------------------------------------- */
-$envar = "env=" . BuildEnv() . "&en=$en";
-$section = 'in-portal:editcategory_permissions';
-
-$sec = $objSections->GetSection($section);
-if($c->Get("CategoryId")==0)
-{
- $sec->Set("left",NULL);
- $sec->Set("right",NULL);
-
-}
-if($c->Get("CategoryId")!=0)
-{
- $title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Category")." '".$c->Get("Name")."' - ".admin_language("la_tab_Permissions");
-}
-else
- $title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Root")." ".admin_language("la_Text_Category")." - ".admin_language("la_tab_Permissions");
-
-$SortFieldVar = "GroupPerm_SortField";
-$SortOrderVar = "GroupPerm_SortOrder";
-$DefaultSortField = "FullName";
-$PerPageVar = "Perpage_Grouplist";
-$CurrentPageVar = "Page_Grouplist";
-$CurrentFilterVar = "CatImg_View";
-
-$ListForm = "permlistform";
-$CheckClass = "PermChecks";
-/* ------------------------------------- Configure the toolbar ------------------------------------------- */
-$saveURL = $admin."/category/category_maint.php";
-$cancelURL = $admin."/".$objSession->GetVariable('ReturnScript');
-$objListToolBar = new clsToolBar();
-$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('save_edit_buttons','CatEditStatus','$saveURL',1);","tool_select.gif");
-$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('save_edit_buttons','CatEditStatus','".$cancelURL."',2);","tool_cancel.gif");
-if($itemcount == 1) $objListToolBar->Add("divider");
-
-$objListToolBar->Set("section",$section);
-$objListToolBar->Set("load_menu_func","");
-$objListToolBar->Set("CheckClass",$CheckClass);
-$objListToolBar->Set("CheckForm",$ListForm);
-
-if ( isset($en_prev) || isset($en_next) )
-{
- $url = $RootUrl.$admin."/category/addcategory_permissions.php";
- $StatusField = "CatEditStatus";
- $form = "category";
- MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevCategory','la_NextCategory');
- $objListToolBar->Add("divider");
-}
-
-$listImages = array();
- //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick
-
-$objListToolBar->Add("new_perm", "la_ToolTip_New_Permission","#","swap('new_perm','toolbar/tool_new_permission_f2.gif');",
- "swap('new_perm', 'toolbar/tool_new_permission.gif');",
- "OpenGroupSelector('$envar&source=addcategory_permissions&CatId=".$c->Get("CategoryId")."&destform=popup&destfield=itemlist');",
- "tool_new_permission.gif");
-
-$objListToolBar->Add("perm_edit","Edit","#", "if (PermChecks.itemChecked()) swap('perm_edit','toolbar/tool_edit_f2.gif');",
- "if (PermChecks.itemChecked()) swap('perm_edit', 'toolbar/tool_edit.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addpermission_modules', '');",
- "tool_edit.gif",TRUE,TRUE);
-$listImages[] = "PermChecks.addImage('perm_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); ";
-
-$objListToolBar->Add("perm_del","Delete","#", "if (PermChecks.itemChecked()) swap('perm_del','toolbar/tool_delete_f2.gif');",
- "if (PermChecks.itemChecked()) swap('perm_del', 'toolbar/tool_delete.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addcategory_permissions', 'm_perm_delete_group');",
- "tool_delete.gif",FALSE,TRUE);
-$listImages[] = "PermChecks.addImage('perm_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); ";
-
-$objListToolBar->Add("divider");
-$objListToolBar->AddToInitScript($listImages);
-
-/* ------------------------------------ Build the SQL statement to populate the list ---------------------------*/
-$objGroupList = new clsGroupList();
-$order = $objConfig->Get("Group_SortOrder");
-$objGroupList->Clear();
-
-$sql = 'SELECT ResourceId, g.name AS Name, ELT(g.Personal + 1,"Group ","User ") AS UserGroup
- FROM '.TABLE_PREFIX.'Permissions p
- LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON p.GroupId = g.GroupId
- WHERE (p.CatId = '.(int)$c->Get('CategoryId').') AND (g.Personal = 0) AND (p.Type = 0)
- GROUP BY Name';
-//$sql = "SELECT GroupId, count(*) as PermCount FROM ".GetTablePrefix()."Permissions WHERE CatId=".$c->Get("CategoryId")." GROUP BY GroupId";
-$objGroupList->Query_Item($sql);
-
-if($objSession->HasSystemPermission("DEBUG.LIST"))
- echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
-
-/* ---------------------------------------- Configure the list view ---------------------------------------- */
-$objListView = new clsListView($objListToolBar,$objGroupList);
-$objListView->IdField = "ResourceId";
-$objListView->PageLinkTemplate = $pathtoroot. "admin/templates/user_page_link.tpl";
-
-$objListView->ColumnHeaders->Add("Name",admin_language("la_prompt_Name"),1,0,$order,"width=\"20%\"",$SortFieldVar,$SortOrderVar,"Name");
-$objListView->ColumnHeaders->Add("UserGroup",admin_language("la_Colheader_GroupType"),1,0,$order,"width=\"30%\"",$SortFieldVar,$SortOrderVar,"UserGroup");
-
-$objListView->ColumnHeaders->SetSort($objConfig->Get($SortFieldVar),$order);
-
-$objListView->PrintToolBar = FALSE;
-$objListView->CurrentPageVar = $CurrentPageVar;
-$objListView->PerPageVar = $PerPageVar;
-$objListView->CheckboxName = "itemlist[]";
-
-int_header($objListToolBar,NULL,$title);
-if ($objSession->GetVariable("HasChanges") == 1) {
-?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
- <tr>
- <td valign="top">
- <?php int_hint_red(admin_language("la_Warning_Save_Item")); ?>
- </td>
- </tr>
-</table>
-<?php } ?>
-<FORM method="POST" ACTION="" NAME="<?php echo $ListForm; ?>" ID="<?php echo $ListForm; ?>">
-<?php
-print $objListView->PrintList();
-?>
-<input type="hidden" name="Action" value="">
-<INPUT TYPE="hidden" NAME="CategoryId" VALUE="<?php echo $c->Get("CategoryId"); ?>">
-</FORM>
-<FORM NAME="save_edit_buttons" ID="save_edit_buttons" method="POST" ACTION="">
- <input type="hidden" NAME="Action" VALUE="save_category_edit">
- <INPUT TYPE="hidden" NAME="CategoryId" VALUE="<?php echo $c->Get("CategoryId"); ?>">
- <input type="hidden" name="CatEditStatus" VALUE="0">
-</FORM>
-
-<FORM NAME="popup" ID="popup" METHOD="POST" ACTION="addpermission_modules.php?<?php echo $envar; ?>">
-<INPUT TYPE="hidden" NAME="itemlist">
-</FORM>
-<!-- CODE FOR VIEW MENU -->
-<form ID="viewmenu" method="post" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>" name="viewmenu">
-<input type="hidden" name="fieldname" value="">
-<input type="hidden" name="varvalue" value="">
-<input type="hidden" name="varvalue2" value="">
-<input type="hidden" name="Action" value="">
-</form>
-
-<script src="<?php echo $adminURL; ?>/listview/listview.js"></script>
-<script>
-initSelectiorContainers();
-<?php echo $objListToolBar->Get("CheckClass").".setImages();"; ?>
-</script>
-<!-- END CODE-->
-<?php int_footer(); ?>
Property changes on: trunk/admin/category/addcategory_permissions.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.11
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/js/core.js
===================================================================
--- trunk/admin/category/js/core.js (revision 6427)
+++ trunk/admin/category/js/core.js (nonexistent)
@@ -1,1097 +0,0 @@
-/* Copyright Mihai Bazon, 2002
- * http://students.infoiasi.ro/~mishoo
- *
- * Version: 0.9.1
- *
- * Feel free to use this script under the terms of the GNU General Public
- * License, as long as you do not remove or alter this notice.
- */
-
-/** The Calendar object constructor. */
-Calendar = function (mondayFirst, dateStr, onSelected, onClose) {
- // member variables
- this.activeDiv = null;
- this.currentDateEl = null;
- this.checkDisabled = null;
- this.timeout = null;
- this.onSelected = onSelected || null;
- this.onClose = onClose || null;
- this.dragging = false;
- this.minYear = 1970;
- this.maxYear = 2050;
- this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"];
- this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"];
- this.isPopup = true;
- this.mondayFirst = mondayFirst;
- this.dateStr = dateStr;
- // HTML elements
- this.table = null;
- this.element = null;
- this.tbody = null;
- this.daynames = null;
- // Combo boxes
- this.monthsCombo = null;
- this.yearsCombo = null;
- this.hilitedMonth = null;
- this.activeMonth = null;
- this.hilitedYear = null;
- this.activeYear = null;
-
- // one-time initializations
- if (!Calendar._DN3) {
- // table of short day names
- var ar = new Array();
- for (var i = 8; i > 0;) {
- ar[--i] = Calendar._DN[i].substr(0, 3);
- }
- Calendar._DN3 = ar;
- // table of short month names
- ar = new Array();
- for (var i = 12; i > 0;) {
- ar[--i] = Calendar._MN[i].substr(0, 3);
- }
- Calendar._MN3 = ar;
- }
-};
-
-// ** constants
-
-/// "static", needed for event handlers.
-Calendar._C = null;
-
-/// detect a special case of "web browser"
-Calendar.is_ie = ( (navigator.userAgent.toLowerCase().indexOf("msie") != -1) &&
- (navigator.userAgent.toLowerCase().indexOf("opera") == -1) );
-
-// short day names array (initialized at first constructor call)
-Calendar._DN3 = null;
-
-// short month names array (initialized at first constructor call)
-Calendar._MN3 = null;
-
-// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate
-// library, at some point.
-
-Calendar.getAbsolutePos = function(el) {
- var r = { x: el.offsetLeft, y: el.offsetTop };
- if (el.offsetParent) {
- var tmp = Calendar.getAbsolutePos(el.offsetParent);
- r.x += tmp.x;
- r.y += tmp.y;
- }
- return r;
-};
-
-Calendar.isRelated = function (el, evt) {
- var related = evt.relatedTarget;
- if (!related) {
- var type = evt.type;
- if (type == "mouseover") {
- related = evt.fromElement;
- } else if (type == "mouseout") {
- related = evt.toElement;
- }
- }
- while (related) {
- if (related == el) {
- return true;
- }
- related = related.parentNode;
- }
- return false;
-};
-
-Calendar.removeClass = function(el, className) {
- if (!(el && el.className)) {
- return;
- }
- var cls = el.className.split(" ");
- var ar = new Array();
- for (var i = cls.length; i > 0;) {
- if (cls[--i] != className) {
- ar[ar.length] = cls[i];
- }
- }
- el.className = ar.join(" ");
-};
-
-Calendar.addClass = function(el, className) {
- el.className += " " + className;
-};
-
-Calendar.getElement = function(ev) {
- if (Calendar.is_ie) {
- return window.event.srcElement;
- } else {
- return ev.currentTarget;
- }
-};
-
-Calendar.getTargetElement = function(ev) {
- if (Calendar.is_ie) {
- return window.event.srcElement;
- } else {
- return ev.target;
- }
-};
-
-Calendar.stopEvent = function(ev) {
- if (Calendar.is_ie) {
- window.event.cancelBubble = true;
- window.event.returnValue = false;
- } else {
- ev.preventDefault();
- ev.stopPropagation();
- }
-};
-
-Calendar.addEvent = function(el, evname, func) {
- if (Calendar.is_ie) {
- el.attachEvent("on" + evname, func);
- } else {
- el.addEventListener(evname, func, true);
- }
-};
-
-Calendar.removeEvent = function(el, evname, func) {
- if (Calendar.is_ie) {
- el.detachEvent("on" + evname, func);
- } else {
- el.removeEventListener(evname, func, true);
- }
-};
-
-Calendar.createElement = function(type, parent) {
- var el = null;
- if (document.createElementNS) {
- // use the XHTML namespace; IE won't normally get here unless
- // _they_ "fix" the DOM2 implementation.
- el = document.createElementNS("http://www.w3.org/1999/xhtml", type);
- } else {
- el = document.createElement(type);
- }
- if (typeof parent != "undefined") {
- parent.appendChild(el);
- }
- return el;
-};
-
-// END: UTILITY FUNCTIONS
-
-// BEGIN: CALENDAR STATIC FUNCTIONS
-
-/** Internal -- adds a set of events to make some element behave like a button. */
-Calendar._add_evs = function(el) {
- with (Calendar) {
- addEvent(el, "mouseover", dayMouseOver);
- addEvent(el, "mousedown", dayMouseDown);
- addEvent(el, "mouseout", dayMouseOut);
- if (is_ie) {
- addEvent(el, "dblclick", dayMouseDblClick);
- el.setAttribute("unselectable", true);
- }
- }
-};
-
-Calendar.findMonth = function(el) {
- if (typeof el.month != "undefined") {
- return el;
- } else if (typeof el.parentNode.month != "undefined") {
- return el.parentNode;
- }
- return null;
-};
-
-Calendar.findYear = function(el) {
- if (typeof el.year != "undefined") {
- return el;
- } else if (typeof el.parentNode.year != "undefined") {
- return el.parentNode;
- }
- return null;
-};
-
-Calendar.showMonthsCombo = function () {
- var cal = Calendar._C;
- if (!cal) {
- return false;
- }
- var cal = cal;
- var cd = cal.activeDiv;
- var mc = cal.monthsCombo;
- if (cal.hilitedMonth) {
- Calendar.removeClass(cal.hilitedMonth, "hilite");
- }
- if (cal.activeMonth) {
- Calendar.removeClass(cal.activeMonth, "active");
- }
- var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];
- Calendar.addClass(mon, "active");
- cal.activeMonth = mon;
- mc.style.left = cd.offsetLeft;
- mc.style.top = cd.offsetTop + cd.offsetHeight;
- mc.style.display = "block";
-};
-
-Calendar.showYearsCombo = function (fwd) {
- var cal = Calendar._C;
- if (!cal) {
- return false;
- }
- var cal = cal;
- var cd = cal.activeDiv;
- var yc = cal.yearsCombo;
- if (cal.hilitedYear) {
- Calendar.removeClass(cal.hilitedYear, "hilite");
- }
- if (cal.activeYear) {
- Calendar.removeClass(cal.activeYear, "active");
- }
- cal.activeYear = null;
- var Y = cal.date.getFullYear() + (fwd ? 1 : -1);
- var yr = yc.firstChild;
- var show = false;
- for (var i = 12; i > 0; --i) {
- if (Y >= cal.minYear && Y <= cal.maxYear) {
- yr.firstChild.data = Y;
- yr.year = Y;
- yr.style.display = "block";
- show = true;
- } else {
- yr.style.display = "none";
- }
- yr = yr.nextSibling;
- Y += fwd ? 2 : -2;
- }
- if (show) {
- yc.style.left = cd.offsetLeft;
- yc.style.top = cd.offsetTop + cd.offsetHeight;
- yc.style.display = "block";
- }
-};
-
-// event handlers
-
-Calendar.tableMouseUp = function(ev) {
- var cal = Calendar._C;
- if (!cal) {
- return false;
- }
- if (cal.timeout) {
- clearTimeout(cal.timeout);
- }
- var el = cal.activeDiv;
- if (!el) {
- return false;
- }
- var target = Calendar.getTargetElement(ev);
- Calendar.removeClass(el, "active");
- if (target == el || target.parentNode == el) {
- Calendar.cellClick(el);
- }
- var mon = Calendar.findMonth(target);
- var date = null;
- if (mon) {
- date = new Date(cal.date);
- if (mon.month != date.getMonth()) {
- date.setMonth(mon.month);
- cal.setDate(date);
- }
- } else {
- var year = Calendar.findYear(target);
- if (year) {
- date = new Date(cal.date);
- if (year.year != date.getFullYear()) {
- date.setFullYear(year.year);
- cal.setDate(date);
- }
- }
- }
- with (Calendar) {
- removeEvent(document, "mouseup", tableMouseUp);
- removeEvent(document, "mouseover", tableMouseOver);
- removeEvent(document, "mousemove", tableMouseOver);
- cal._hideCombos();
- stopEvent(ev);
- _C = null;
- }
-};
-
-Calendar.tableMouseOver = function (ev) {
- var cal = Calendar._C;
- if (!cal) {
- return;
- }
- var el = cal.activeDiv;
- var target = Calendar.getTargetElement(ev);
- if (target == el || target.parentNode == el) {
- Calendar.addClass(el, "hilite active");
- } else {
- Calendar.removeClass(el, "active");
- Calendar.removeClass(el, "hilite");
- }
- var mon = Calendar.findMonth(target);
- if (mon) {
- if (mon.month != cal.date.getMonth()) {
- if (cal.hilitedMonth) {
- Calendar.removeClass(cal.hilitedMonth, "hilite");
- }
- Calendar.addClass(mon, "hilite");
- cal.hilitedMonth = mon;
- } else if (cal.hilitedMonth) {
- Calendar.removeClass(cal.hilitedMonth, "hilite");
- }
- } else {
- var year = Calendar.findYear(target);
- if (year) {
- if (year.year != cal.date.getFullYear()) {
- if (cal.hilitedYear) {
- Calendar.removeClass(cal.hilitedYear, "hilite");
- }
- Calendar.addClass(year, "hilite");
- cal.hilitedYear = year;
- } else if (cal.hilitedYear) {
- Calendar.removeClass(cal.hilitedYear, "hilite");
- }
- }
- }
- Calendar.stopEvent(ev);
-};
-
-Calendar.tableMouseDown = function (ev) {
- if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) {
- Calendar.stopEvent(ev);
- }
-};
-
-Calendar.calDragIt = function (ev) {
- var cal = Calendar._C;
- if (!(cal && cal.dragging)) {
- return false;
- }
- var posX;
- var posY;
- if (Calendar.is_ie) {
- posY = window.event.clientY + document.body.scrollTop;
- posX = window.event.clientX + document.body.scrollLeft;
- } else {
- posX = ev.pageX;
- posY = ev.pageY;
- }
- cal.hideShowCovered();
- var st = cal.element.style;
- st.left = (posX - cal.xOffs) + "px";
- st.top = (posY - cal.yOffs) + "px";
- Calendar.stopEvent(ev);
-};
-
-Calendar.calDragEnd = function (ev) {
- var cal = Calendar._C;
- if (!cal) {
- return false;
- }
- cal.dragging = false;
- with (Calendar) {
- removeEvent(document, "mousemove", calDragIt);
- removeEvent(document, "mouseover", stopEvent);
- removeEvent(document, "mouseup", calDragEnd);
- tableMouseUp(ev);
- }
- cal.hideShowCovered();
-};
-
-Calendar.dayMouseDown = function(ev) {
- var el = Calendar.getElement(ev);
- if (el.disabled) {
- return false;
- }
- var cal = el.calendar;
- cal.activeDiv = el;
- Calendar._C = cal;
- if (el.navtype != 300) with (Calendar) {
- addClass(el, "hilite active");
- addEvent(document, "mouseover", tableMouseOver);
- addEvent(document, "mousemove", tableMouseOver);
- addEvent(document, "mouseup", tableMouseUp);
- } else if (cal.isPopup) {
- cal._dragStart(ev);
- }
- Calendar.stopEvent(ev);
- if (el.navtype == -1 || el.navtype == 1) {
- cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250);
- } else if (el.navtype == -2 || el.navtype == 2) {
- cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250);
- } else {
- cal.timeout = null;
- }
-};
-
-Calendar.dayMouseDblClick = function(ev) {
- Calendar.cellClick(Calendar.getElement(ev));
- if (Calendar.is_ie) {
- document.selection.empty();
- }
-};
-
-Calendar.dayMouseOver = function(ev) {
- var el = Calendar.getElement(ev);
- if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) {
- return false;
- }
- if (el.ttip) {
- if (el.ttip.substr(0, 1) == "_") {
- var date = null;
- with (el.calendar.date) {
- date = new Date(getFullYear(), getMonth(), el.caldate);
- }
- el.ttip = date.print(el.calendar.ttDateFormat) + el.ttip.substr(1);
- }
- el.calendar.tooltips.firstChild.data = el.ttip;
- }
- if (el.navtype != 300) {
- Calendar.addClass(el, "hilite");
- }
- Calendar.stopEvent(ev);
-};
-
-Calendar.dayMouseOut = function(ev) {
- with (Calendar) {
- var el = getElement(ev);
- if (isRelated(el, ev) || _C || el.disabled) {
- return false;
- }
- removeClass(el, "hilite");
- el.calendar.tooltips.firstChild.data = _TT["SEL_DATE"];
- stopEvent(ev);
- }
-};
-
-/**
- * A generic "click" handler :) handles all types of buttons defined in this
- * calendar.
- */
-Calendar.cellClick = function(el) {
- var cal = el.calendar;
- var closing = false;
- var newdate = false;
- var date = null;
- if (typeof el.navtype == "undefined") {
- Calendar.removeClass(cal.currentDateEl, "selected");
- Calendar.addClass(el, "selected");
- closing = (cal.currentDateEl == el);
- if (!closing) {
- cal.currentDateEl = el;
- }
- cal.date.setDate(el.caldate);
- date = cal.date;
- newdate = true;
- } else {
- if (el.navtype == 200) {
- Calendar.removeClass(el, "hilite");
- cal.callCloseHandler();
- return;
- }
- date = (el.navtype == 0) ? new Date() : new Date(cal.date);
- var year = date.getFullYear();
- var mon = date.getMonth();
- var setMonth = function (mon) {
- var day = date.getDate();
- var max = date.getMonthDays();
- if (day > max) {
- date.setDate(max);
- }
- date.setMonth(mon);
- };
- switch (el.navtype) {
- case -2:
- if (year > cal.minYear) {
- date.setFullYear(year - 1);
- }
- break;
- case -1:
- if (mon > 0) {
- setMonth(mon - 1);
- } else if (year-- > cal.minYear) {
- date.setFullYear(year);
- setMonth(11);
- }
- break;
- case 1:
- if (mon < 11) {
- setMonth(mon + 1);
- } else if (year < cal.maxYear) {
- date.setFullYear(year + 1);
- setMonth(0);
- }
- break;
- case 2:
- if (year < cal.maxYear) {
- date.setFullYear(year + 1);
- }
- break;
- case 100:
- cal.setMondayFirst(!cal.mondayFirst);
- return;
- }
- if (!date.equalsTo(cal.date)) {
- cal.setDate(date);
- newdate = el.navtype == 0;
- }
- }
- if (newdate) {
- cal.callHandler();
- }
- if (closing) {
- Calendar.removeClass(el, "hilite");
- cal.callCloseHandler();
- }
-};
-
-// END: CALENDAR STATIC FUNCTIONS
-
-// BEGIN: CALENDAR OBJECT FUNCTIONS
-
-/**
- * This function creates the calendar inside the given parent. If _par is
- * null than it creates a popup calendar inside the BODY element. If _par is
- * an element, be it BODY, then it creates a non-popup calendar (still
- * hidden). Some properties need to be set before calling this function.
- */
-Calendar.prototype.create = function (_par) {
- var parent = null;
- if (! _par) {
- // default parent is the document body, in which case we create
- // a popup calendar.
- parent = document.getElementsByTagName("body")[0];
- this.isPopup = true;
- } else {
- parent = _par;
- this.isPopup = false;
- }
- this.date = this.dateStr ? new Date(this.dateStr) : new Date();
-
- var table = Calendar.createElement("table");
- this.table = table;
- table.cellSpacing = 0;
- table.cellPadding = 0;
- table.calendar = this;
- Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown);
-
- var div = Calendar.createElement("div");
- this.element = div;
- div.className = "calendar";
- if (this.isPopup) {
- div.style.position = "absolute";
- div.style.display = "none";
- }
- div.appendChild(table);
-
- var thead = Calendar.createElement("thead", table);
- var cell = null;
- var row = null;
-
- var cal = this;
- var hh = function (text, cs, navtype) {
- cell = Calendar.createElement("td", row);
- cell.colSpan = cs;
- cell.className = "button";
- Calendar._add_evs(cell);
- cell.calendar = cal;
- cell.navtype = navtype;
- if (text.substr(0, 1) != "&") {
- cell.appendChild(document.createTextNode(text));
- }
- else {
- // FIXME: dirty hack for entities
- cell.innerHTML = text;
- }
- return cell;
- };
-
- row = Calendar.createElement("tr", thead);
- row.className = "headrow";
-
- hh("-", 1, 100).ttip = Calendar._TT["TOGGLE"];
- this.title = hh("", this.isPopup ? 5 : 6, 300);
- this.title.className = "title";
- if (this.isPopup) {
- this.title.ttip = Calendar._TT["DRAG_TO_MOVE"];
- this.title.style.cursor = "move";
- hh("X", 1, 200).ttip = Calendar._TT["CLOSE"];
- }
-
- row = Calendar.createElement("tr", thead);
- row.className = "headrow";
-
- hh("&#x00ab;", 1, -2).ttip = Calendar._TT["PREV_YEAR"];
- hh("&#x2039;", 1, -1).ttip = Calendar._TT["PREV_MONTH"];
- hh(Calendar._TT["TODAY"], 3, 0).ttip = Calendar._TT["GO_TODAY"];
- hh("&#x203a;", 1, 1).ttip = Calendar._TT["NEXT_MONTH"];
- hh("&#x00bb;", 1, 2).ttip = Calendar._TT["NEXT_YEAR"];
-
- // day names
- row = Calendar.createElement("tr", thead);
- row.className = "daynames";
- this.daynames = row;
- for (var i = 7; i > 0; --i) {
- cell = Calendar.createElement("td", row);
- cell.appendChild(document.createTextNode(""));
- if (!i) {
- cell.navtype = 100;
- cell.calendar = this;
- Calendar._add_evs(cell);
- }
- }
- this._displayWeekdays();
-
- var tbody = Calendar.createElement("tbody", table);
- this.tbody = tbody;
-
- for (i = 6; i > 0; --i) {
- row = Calendar.createElement("tr", tbody);
- for (var j = 7; j > 0; --j) {
- cell = Calendar.createElement("td", row);
- cell.appendChild(document.createTextNode(""));
- cell.calendar = this;
- Calendar._add_evs(cell);
- }
- }
-
- var tfoot = Calendar.createElement("tfoot", table);
-
- row = Calendar.createElement("tr", tfoot);
- row.className = "footrow";
-
- cell = hh(Calendar._TT["SEL_DATE"], 7, 300);
- cell.className = "ttip";
- if (this.isPopup) {
- cell.ttip = Calendar._TT["DRAG_TO_MOVE"];
- cell.style.cursor = "move";
- }
- this.tooltips = cell;
-
- div = Calendar.createElement("div", this.element);
- this.monthsCombo = div;
- div.className = "combo";
- for (i = 0; i < Calendar._MN.length; ++i) {
- var mn = Calendar.createElement("div");
- mn.className = "label";
- mn.month = i;
- mn.appendChild(document.createTextNode(Calendar._MN3[i]));
- div.appendChild(mn);
- }
-
- div = Calendar.createElement("div", this.element);
- this.yearsCombo = div;
- div.className = "combo";
- for (i = 12; i > 0; --i) {
- var yr = Calendar.createElement("div");
- yr.className = "label";
- yr.appendChild(document.createTextNode(""));
- div.appendChild(yr);
- }
-
- this._init(this.mondayFirst, this.date);
- parent.appendChild(this.element);
-};
-
-/**
- * (RE)Initializes the calendar to the given date and style (if mondayFirst is
- * true it makes Monday the first day of week, otherwise the weeks start on
- * Sunday.
- */
-Calendar.prototype._init = function (mondayFirst, date) {
- var today = new Date();
- var year = date.getFullYear();
- if (year < this.minYear) {
- year = this.minYear;
- date.setFullYear(year);
- } else if (year > this.maxYear) {
- year = this.maxYear;
- date.setFullYear(year);
- }
- this.mondayFirst = mondayFirst;
- this.date = new Date(date);
- var month = date.getMonth();
- var mday = date.getDate();
- var no_days = date.getMonthDays();
- date.setDate(1);
- var wday = date.getDay();
- var MON = mondayFirst ? 1 : 0;
- var SAT = mondayFirst ? 5 : 6;
- var SUN = mondayFirst ? 6 : 0;
- if (mondayFirst) {
- wday = (wday > 0) ? (wday - 1) : 6;
- }
- var iday = 1;
- var row = this.tbody.firstChild;
- var MN = Calendar._MN3[month];
- var hasToday = ((today.getFullYear() == year) && (today.getMonth() == month));
- var todayDate = today.getDate();
- for (var i = 0; i < 6; ++i) {
- if (iday > no_days) {
- row.className = "emptyrow";
- row = row.nextSibling;
- continue;
- }
- var cell = row.firstChild;
- row.className = "daysrow";
- for (var j = 0; j < 7; ++j) {
- if ((!i && j < wday) || iday > no_days) {
- cell.className = "emptycell";
- cell = cell.nextSibling;
- continue;
- }
- cell.firstChild.data = iday;
- cell.className = "day";
- cell.disabled = false;
- if (typeof this.checkDisabled == "function") {
- date.setDate(iday);
- if (this.checkDisabled(date)) {
- cell.className += " disabled";
- cell.disabled = true;
- }
- }
- if (!cell.disabled) {
- cell.caldate = iday;
- cell.ttip = "_";
- if (iday == mday) {
- cell.className += " selected";
- this.currentDateEl = cell;
- }
- if (hasToday && (iday == todayDate)) {
- cell.className += " today";
- cell.ttip += Calendar._TT["PART_TODAY"];
- }
- if (wday == SAT || wday == SUN) {
- cell.className += " weekend";
- }
- }
- ++iday;
- ((++wday) ^ 7) || (wday = 0);
- cell = cell.nextSibling;
- }
- row = row.nextSibling;
- }
- this.title.firstChild.data = Calendar._MN[month] + ", " + year;
- // PROFILE
- // this.tooltips.firstChild.data = "Generated in " + ((new Date()) - today) + " ms";
-};
-
-/**
- * Calls _init function above for going to a certain date (but only if the
- * date is different than the currently selected one).
- */
-Calendar.prototype.setDate = function (date) {
- if (!date.equalsTo(this.date)) {
- this._init(this.mondayFirst, date);
- }
-};
-
-/** Modifies the "mondayFirst" parameter (EU/US style). */
-Calendar.prototype.setMondayFirst = function (mondayFirst) {
- this._init(mondayFirst, this.date);
- this._displayWeekdays();
-};
-
-/**
- * Allows customization of what dates are enabled. The "unaryFunction"
- * parameter must be a function object that receives the date (as a JS Date
- * object) and returns a boolean value. If the returned value is true then
- * the passed date will be marked as disabled.
- */
-Calendar.prototype.setDisabledHandler = function (unaryFunction) {
- this.checkDisabled = unaryFunction;
-};
-
-/** Customization of allowed year range for the calendar. */
-Calendar.prototype.setRange = function (a, z) {
- this.minYear = a;
- this.maxYear = z;
-};
-
-/** Calls the first user handler (selectedHandler). */
-Calendar.prototype.callHandler = function () {
- if (this.onSelected) {
- this.onSelected(this, this.date.print(this.dateFormat));
- }
-};
-
-/** Calls the second user handler (closeHandler). */
-Calendar.prototype.callCloseHandler = function () {
- if (this.onClose) {
- this.onClose(this);
- }
- this.hideShowCovered();
-};
-
-/** Removes the calendar object from the DOM tree and destroys it. */
-Calendar.prototype.destroy = function () {
- var el = this.element.parentNode;
- el.removeChild(this.element);
- Calendar._C = null;
- delete el;
-};
-
-/**
- * Moves the calendar element to a different section in the DOM tree (changes
- * its parent).
- */
-Calendar.prototype.reparent = function (new_parent) {
- var el = this.element;
- el.parentNode.removeChild(el);
- new_parent.appendChild(el);
-};
-
-/** Shows the calendar. */
-Calendar.prototype.show = function () {
- this.element.style.display = "block";
- this.hideShowCovered();
-};
-
-/**
- * Hides the calendar. Also removes any "hilite" from the class of any TD
- * element.
- */
-Calendar.prototype.hide = function () {
- var trs = this.table.getElementsByTagName("td");
- for (var i = trs.length; i > 0; ) {
- Calendar.removeClass(trs[--i], "hilite");
- }
- this.element.style.display = "none";
-};
-
-/**
- * Shows the calendar at a given absolute position (beware that, depending on
- * the calendar element style -- position property -- this might be relative
- * to the parent's containing rectangle).
- */
-Calendar.prototype.showAt = function (x, y) {
- var s = this.element.style;
- s.left = x + "px";
- s.top = y + "px";
- this.show();
-};
-
-/** Shows the calendar near a given element. */
-Calendar.prototype.showAtElement = function (el) {
- var p = Calendar.getAbsolutePos(el);
- this.showAt(p.x, p.y + el.offsetHeight);
-};
-
-/** Customizes the date format. */
-Calendar.prototype.setDateFormat = function (str) {
- this.dateFormat = str;
-};
-
-/** Customizes the tooltip date format. */
-Calendar.prototype.setTtDateFormat = function (str) {
- this.ttDateFormat = str;
-};
-
-/**
- * Tries to identify the date represented in a string. If successful it also
- * calls this.setDate which moves the calendar to the given date.
- */
-Calendar.prototype.parseDate = function (str, fmt) {
- var y = 0;
- var m = -1;
- var d = 0;
- var a = str.split(/\W+/);
- if (!fmt) {
- fmt = this.dateFormat;
- }
- var b = fmt.split(/\W+/);
- var i = 0, j = 0;
- for (i = 0; i < a.length; ++i) {
- if (b[i] == "D" || b[i] == "DD") {
- continue;
- }
- if (b[i] == "d" || b[i] == "dd") {
- d = a[i];
- }
- if (b[i] == "m" || b[i] == "mm") {
- m = a[i]-1;
- }
- if (b[i] == "y") {
- y = a[i];
- }
- if (b[i] == "yy") {
- y = parseInt(a[i]) + 1900;
- }
- if (b[i] == "M" || b[i] == "MM") {
- for (j = 0; j < 12; ++j) {
- if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; }
- }
- }
- }
- if (y != 0 && m != -1 && d != 0) {
- this.setDate(new Date(y, m, d));
- return;
- }
- y = 0; m = -1; d = 0;
- for (i = 0; i < a.length; ++i) {
- if (a[i].search(/[a-zA-Z]+/) != -1) {
- var t = -1;
- for (j = 0; j < 12; ++j) {
- if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; }
- }
- if (t != -1) {
- if (m != -1) {
- d = m+1;
- }
- m = t;
- }
- } else if (parseInt(a[i]) <= 12 && m == -1) {
- m = a[i]-1;
- } else if (parseInt(a[i]) > 31 && y == 0) {
- y = a[i];
- } else if (d == 0) {
- d = a[i];
- }
- }
- if (y == 0) {
- var today = new Date();
- y = today.getFullYear();
- }
- if (m != -1 && d != 0) {
- this.setDate(new Date(y, m, d));
- }
-};
-
-Calendar.prototype.hideShowCovered = function () {
- var tags = new Array("applet", "iframe", "select");
- var el = this.element;
-
- var p = Calendar.getAbsolutePos(el);
- var EX1 = p.x;
- var EX2 = el.offsetWidth + EX1;
- var EY1 = p.y;
- var EY2 = el.offsetHeight + EY1;
-
- for (var k = tags.length; k > 0; ) {
- var ar = document.getElementsByTagName(tags[--k]);
- var cc = null;
-
- for (var i = ar.length; i > 0;) {
- cc = ar[--i];
-
- p = Calendar.getAbsolutePos(cc);
- var CX1 = p.x;
- var CX2 = cc.offsetWidth + CX1;
- var CY1 = p.y;
- var CY2 = cc.offsetHeight + CY1;
-
- if ((CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
- cc.style.visibility = "visible";
- } else {
- cc.style.visibility = "hidden";
- }
- }
- }
-};
-
-/** Internal function; it displays the bar with the names of the weekday. */
-Calendar.prototype._displayWeekdays = function () {
- var MON = this.mondayFirst ? 0 : 1;
- var SUN = this.mondayFirst ? 6 : 0;
- var SAT = this.mondayFirst ? 5 : 6;
- var cell = this.daynames.firstChild;
- for (var i = 0; i < 7; ++i) {
- cell.className = "day name";
- if (!i) {
- cell.ttip = this.mondayFirst ? Calendar._TT["SUN_FIRST"] : Calendar._TT["MON_FIRST"];
- cell.navtype = 100;
- cell.calendar = this;
- Calendar._add_evs(cell);
- }
- if (i == SUN || i == SAT) {
- Calendar.addClass(cell, "weekend");
- }
- cell.firstChild.data = Calendar._DN3[i + 1 - MON];
- cell = cell.nextSibling;
- }
-};
-
-/** Internal function. Hides all combo boxes that might be displayed. */
-Calendar.prototype._hideCombos = function () {
- this.monthsCombo.style.display = "none";
- this.yearsCombo.style.display = "none";
-};
-
-/** Internal function. Starts dragging the element. */
-Calendar.prototype._dragStart = function (ev) {
- if (this.dragging) {
- return;
- }
- this.dragging = true;
- var posX;
- var posY;
- if (Calendar.is_ie) {
- posY = window.event.clientY + document.body.scrollTop;
- posX = window.event.clientX + document.body.scrollLeft;
- } else {
- posY = ev.clientY + window.scrollY;
- posX = ev.clientX + window.scrollX;
- }
- var st = this.element.style;
- this.xOffs = posX - parseInt(st.left);
- this.yOffs = posY - parseInt(st.top);
- with (Calendar) {
- addEvent(document, "mousemove", calDragIt);
- addEvent(document, "mouseover", stopEvent);
- addEvent(document, "mouseup", calDragEnd);
- }
-};
-
-// BEGIN: DATE OBJECT PATCHES
-
-/** Adds the number of days array to the Date object. */
-Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
-
-/** Returns the number of days in the current month */
-Date.prototype.getMonthDays = function() {
- var year = this.getFullYear();
- var month = this.getMonth();
- if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
- return 29;
- } else {
- return Date._MD[month];
- }
-};
-
-/** Checks dates equality (ignores time) */
-Date.prototype.equalsTo = function(date) {
- return ((this.getFullYear() == date.getFullYear()) &&
- (this.getMonth() == date.getMonth()) &&
- (this.getDate() == date.getDate()));
-};
-
-/** Prints the date in a string according to the given format. */
-Date.prototype.print = function (frm) {
- var str = new String(frm);
- var m = this.getMonth();
- var d = this.getDate();
- var y = this.getFullYear();
- var w = this.getDay();
- var s = new Array();
- s["d"] = d;
- s["dd"] = (d < 10) ? ("0" + d) : d;
- s["m"] = 1+m;
- s["mm"] = (m < 9) ? ("0" + (1+m)) : (1+m);
- s["y"] = y;
- s["yy"] = new String(y).substr(2, 2);
- with (Calendar) {
- s["D"] = _DN3[w];
- s["DD"] = _DN[w];
- s["M"] = _MN3[m];
- s["MM"] = _MN[m];
- }
- var re = /(.*)(\W|^)(d|dd|m|mm|y|yy|MM|M|DD|D)(\W|$)(.*)/;
- while (re.exec(str) != null) {
- str = RegExp.$1 + RegExp.$2 + s[RegExp.$3] + RegExp.$4 + RegExp.$5;
- }
- return str;
-};
-
-// END: DATE OBJECT PATCHES
Property changes on: trunk/admin/category/js/core.js
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/js/main.js
===================================================================
--- trunk/admin/category/js/main.js (revision 6427)
+++ trunk/admin/category/js/main.js (nonexistent)
@@ -1,134 +0,0 @@
-var jsPath = "js/";
-var cssPath = "css/";
-var imgPath = "images/";
-
-var preloadImages = new Array();
-cbPath = imgPath + "ddarrow.gif";
-cbPathO = imgPath + "ddarrow_over.gif";
-cbPathA = imgPath + "ddarrow_active.gif";
-
-preloadImage(cbPath);
-preloadImage(cbPathO);
-preloadImage(cbPathA);
-
-addScript("core.js");
-addScript("lang.js");
-
-addCss("wnd.css");
-addCss("calendar.css");
-
-function initCalendar(id, dateFormat)
-{
- var input = document.getElementById(id);
- if (!input) return;
- input.dateFormat = dateFormat;
-
- var inputContainer = document.createElement("DIV");
- inputContainer.className = "dpContainer";
- inputContainer.noWrap = true;
- var pNode = input.parentNode;
- pNode.insertBefore(inputContainer, input);
- inputContainer.appendChild(pNode.removeChild(input));
-
- var calendarButton = document.createElement("IMG");
- calendarButton.setAttribute("width", "24");
- calendarButton.setAttribute("height", "24");
- calendarButton.style.width=24
- calendarButton.style.height=24
- calendarButton.style.cursor = "hand";
-
- calendarButton.setAttribute("hspace", 2);
- calendarButton.src = cbPath;
- calendarButton.onmouseover = cbMouseOver;
- calendarButton.onmouseout = cbMouseOut;
- calendarButton.onmouseup = calendarButton.onmouseout;
- calendarButton.onmousedown = cbMouseDown;
- calendarButton.showCalendar = wnd_showCalendar;
- inputContainer.appendChild(calendarButton);
-}
-
-var calendar;
-
-function cbMouseOver(e)
-{
- this.src = cbPathO;
- var evt = (e) ? e : event; if (evt) evt.cancelBubble = true;
-}
-
-function cbMouseOut(e)
-{
- this.src = cbPath;
- var evt = (e) ? e : event; if (evt) evt.cancelBubble = true;
-}
-
-function cbMouseDown(e)
-{
- this.src = cbPathA;
- var evt = (e) ? e : event; if (evt) evt.cancelBubble = true;
- this.showCalendar();
-}
-
-function wnd_showCalendar()
-{
- var el = this.parentNode.firstChild;
- if (calendar != null) calendar.hide();
- else
- {
- var calendarObject = new Calendar(false, null, dateSelected, closeHandler);
- calendar = calendarObject;
- calendarObject.setRange(1900, 2070);
- calendarObject.create();
- }
- calendar.setDateFormat(this.parentNode.firstChild.dateFormat);
- calendar.parseDate(el.value);
- calendar.sel = el;
- calendar.showAtElement(el);
-
- Calendar.addEvent(document, "mousedown", checkCalendar);
- return false;
-}
-
-function dateSelected(calendarObject, date)
-{
- calendarObject.sel.value = date;
- calendarObject.callCloseHandler();
-}
-
-function closeHandler(calendarObject)
-{
- calendarObject.hide();
- Calendar.removeEvent(document, "mousedown", checkCalendar);
-}
-
-function checkCalendar(ev)
-{
- var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
-
- for (; el != null; el = el.parentNode)
- if (el == calendar.element || el.tagName == "A") break;
-
- if (el == null)
- {
- calendar.callCloseHandler();
- Calendar.stopEvent(ev);
- }
-}
-
-function preloadImage(path)
-{
- var img = new Image();
- img.src = path;
- preloadImages[preloadImages.length] = img;
-}
-
-function addScript(path)
-{
- path = jsPath + path;
- document.write("<script src='" + path + "'></script>");
-}
-
-function addCss(path)
-{
- path = cssPath + path;
- document.write("<link rel='stylesheet' href='" + path + "' type='text/css'/>");
-}
Property changes on: trunk/admin/category/js/main.js
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/js/lang.js
===================================================================
--- trunk/admin/category/js/lang.js (revision 6427)
+++ trunk/admin/category/js/lang.js (nonexistent)
@@ -1,42 +0,0 @@
-Calendar._DN = new Array
-("Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday",
- "Sunday");
-Calendar._MN = new Array
-("January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December");
-
-// tooltips
-Calendar._TT = {};
-Calendar._TT["TOGGLE"] = "Toggle first day of week";
-Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)";
-Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)";
-Calendar._TT["GO_TODAY"] = "Go Today";
-Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)";
-Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)";
-Calendar._TT["SEL_DATE"] = "Select date";
-Calendar._TT["DRAG_TO_MOVE"] = "Drag to move";
-Calendar._TT["PART_TODAY"] = " (today)";
-Calendar._TT["MON_FIRST"] = "Display Monday first";
-Calendar._TT["SUN_FIRST"] = "Display Sunday first";
-Calendar._TT["CLOSE"] = "Close";
-Calendar._TT["TODAY"] = "Today";
-
-// date formats
-Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd";
-Calendar._TT["TT_DATE_FORMAT"] = "D, M d";
Property changes on: trunk/admin/category/js/lang.js
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/addcategory_images.php
===================================================================
--- trunk/admin/category/addcategory_images.php (revision 6427)
+++ trunk/admin/category/addcategory_images.php (nonexistent)
@@ -1,299 +0,0 @@
-<?php
-##############################################################
-##In-portal ##
-##############################################################
-## In-portal ##
-## Intechnic Corporation ##
-## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
-## otherwise redistributed without proper written ##
-## consent of Intechnic Corporation. Violation will ##
-## result in revocation of the license and support ##
-## privileges along maximum prosecution allowed by law. ##
-##############################################################
-
-// new startup: begin
-define('REL_PATH', 'admin/category');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/toolbar.php");
-require_once($pathtoroot.$admin."/listview/listview.php");
-
-$m = GetModuleArray();
-foreach($m as $key=>$value)
-{
- $path = $pathtoroot. $value."admin/include/parser.php";
- if(file_exists($path))
- {
- include_once($path);
- }
-}
-
-/* ------------------------------------- Edit Table --------------------------------------------------- */
-unset($objEditItems);
-
-$objEditItems = new clsCatList();
-$objEditItems->SourceTable = $objSession->GetEditTable("Category");
-
-$en = (int)$_GET["en"];
-$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable);
-$itemcount=$objEditItems->NumItems();
-$c = $objEditItems->GetItemByIndex($en);
-
-if($itemcount>1)
-{
- if ($en+1 == $itemcount)
- $en_next = -1;
- else
- $en_next = $en+1;
-
- if ($en == 0)
- $en_prev = -1;
- else
- $en_prev = $en-1;
-}
-$action = "m_item_image";
-/* -------------------------------------- Section configuration ------------------------------------------- */
-$envar = "env=" . BuildEnv() . "&en=$en";
-$section = 'in-portal:editcategory_images';
-$sec = $objSections->GetSection($section);
-$title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Category")." '".$c->Get("Name")."' - ".admin_language("la_tab_Images");
-
-$SortFieldVar = "Image_LV_Sortfield";
-$SortOrderVar = "Image_LV_Sortorder";
-$DefaultSortField = "FullName";
-$PerPageVar = "Perpage_Images";
-$CurrentPageVar = "Page_Images";
-$CurrentFilterVar = "CatImg_View";
-
-$ListForm = "imagelistform";
-$CheckClass = "PermChecks";
-/* ------------------------------------- Configure the toolbar ------------------------------------------- */
-$objListToolBar = new clsToolBar();
-$saveURL = $admin."/category/category_maint.php";
-$cancelURL = $admin."/".$objSession->GetVariable('ReturnScript');
-$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('save_edit_buttons','CatEditStatus','$saveURL',1);","tool_select.gif");
-$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('save_edit_buttons','CatEditStatus','".$cancelURL."',2);","tool_cancel.gif");
-if($itemcount == 1) $objListToolBar->Add("divider");
-$objListToolBar->Set("section",$section);
-$objListToolBar->Set("load_menu_func","");
-$objListToolBar->Set("CheckClass",$CheckClass);
-$objListToolBar->Set("CheckForm",$ListForm);
-
-if ( isset($en_prev) || isset($en_next) )
-{
- $url = $RootUrl.$admin."/category/addcategory_images.php";
- $StatusField = "CatEditStatus";
- $form = "category";
- MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevCategory','la_NextCategory');
- $objListToolBar->Add("divider");
-}
-
-$listImages = array();
-$objListToolBar->Add("new_img", "la_ToolTip_New_Image",$adminURL."/category/addimage.php?".$envar,"swap('new_img','toolbar/tool_new_image_f2.gif');",
- "swap('new_img', 'toolbar/tool_new_image.gif');",
- "","tool_new_image.gif");
-
-$objListToolBar->Add("img_edit","la_ToolTip_Edit","#", "if (PermChecks.itemChecked()) swap('img_edit','toolbar/tool_edit_f2.gif');",
- "if (PermChecks.itemChecked()) swap('img_edit', 'toolbar/tool_edit.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addimage', '');",
- "tool_edit.gif",TRUE,TRUE);
-$listImages[] = "PermChecks.addImage('img_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1);\n";
-
-$objListToolBar->Add("img_del","la_ToolTip_Delete","#", "if (PermChecks.itemChecked()) swap('img_del','toolbar/tool_delete_f2.gif');",
- "if (PermChecks.itemChecked()) swap('img_del', 'toolbar/tool_delete.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addcategory_images', 'm_img_delete');",
- "tool_delete.gif",FALSE,TRUE);
-$listImages[] = "PermChecks.addImage('img_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1);\n ";
-
-$objListToolBar->Add("divider");
-
-$objListToolBar->Add("img_move_up","la_ToolTip_Move_Up","#", "if (PermChecks.itemChecked()) swap('img_move_up','toolbar/tool_move_up_f2.gif');",
- "if (PermChecks.itemChecked()) swap('img_move_up', 'toolbar/tool_move_up.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addcategory_images', 'm_img_move_up');",
- "tool_move_up.gif",FALSE,TRUE);
-$listImages[] = "PermChecks.addImage('img_move_up','$imagesURL/toolbar/tool_move_up.gif','$imagesURL/toolbar/tool_move_up_f3.gif',1);\n ";
-
-$objListToolBar->Add("img_move_down","la_ToolTip_Move_Down","#", "if (PermChecks.itemChecked()) swap('img_move_down','toolbar/tool_move_down_f2.gif');",
- "if (PermChecks.itemChecked()) swap('img_move_down', 'toolbar/tool_move_down.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addcategory_images', 'm_img_move_down');",
- "tool_move_down.gif",FALSE,TRUE);
-$listImages[] = "PermChecks.addImage('img_move_down','$imagesURL/toolbar/tool_move_down.gif','$imagesURL/toolbar/tool_move_down_f3.gif',1);\n ";
-
-$objListToolBar->Add("divider");
-
-$objListToolBar->Add("viewmenubutton", "la_ToolTip_View","#","swap('viewmenubutton','toolbar/tool_view_f2.gif'); ",
- "swap('viewmenubutton', 'toolbar/tool_view.gif');",
- "ShowViewMenu();","tool_view.gif");
-
-$objListToolBar->AddToInitScript($listImages);
-
-/* ----------------------------------------- Set the View Filter ---------------------------------------- */
-$Img_AllValue = 3;
-$Bit_Enabled=1;
-$Bit_Disabled=2;
-$FilterLabels = array();
-
-$FilterLabels[0] = admin_language("la_Text_Enabled");
-$FilterLabels[1] = admin_language("la_Text_Disabled");
-
-$ImgView = $objConfig->Get($CurrentFilterVar);
-
-if(!is_numeric($ImgView))
-{
- $ImgView = $Img_AllValue;
-}
-else
-{
- if($ImgView & $Bit_Enabled)
- $Filters[] = "img.Enabled=1";
-
- if($ImgView & $Bit_Disabled)
- $Filters[] = "img.Enabled=0";
-
- if(count($Filters))
- {
- $imgFilter = implode(" OR ",$Filters);
- }
- else
- $imgFilter = "ImageId = -1";
-}
-
-/* ------------------------------------ Build the SQL statement to populate the list ---------------------------*/
-$objImageList = new clsImageList();
-$objImageList->SourceTable = $objSession->GetEditTable("Images");
-
-$sql = "SELECT ELT(img.Enabled+1,'".admin_language("la_Text_Disabled")." ','".admin_language("la_Text_Enabled")." ') as Status, ";
-$sql .="img.AltName as AltName, img.ImageId as ImageId, img.Enabled as Enabled, img.Priority as Priority, ";
-$sql .="concat(img.Name,ELT(img.DefaultImg+1,'','<br>(".admin_language("la_prompt_Primary").") ')) as FullName, ";
-$sql .="if(img.LocalImage=1,'(".admin_language("la_Text_Local").") ',img.Url) as ShowURL, concat( '<IMG src=\"',";
-$sql .="IF (img.LocalThumb=1, CASE WHEN ( LENGTH( img.ThumbPath ) >0 AND img.LocalThumb =1 ) ";
-$sql .="THEN concat('".$rootURL."',img.ThumbPath,'?".adodb_mktime()."') END , img.ThumbUrl), '\">') AS Preview ";
-
-$sql .="FROM ".$objImageList->SourceTable." as img WHERE img.ResourceId=".$c->Get("ResourceId");
-
-if(strlen($imgFilter))
- $sql .= " AND ($imgFilter)";
-
-$order = trim($objConfig->Get($SortFieldVar)." ".$objConfig->Get($SortOrderVar));
-
-$sql .=" ORDER BY Priority DESC";
-if(strlen($order))
- $sql .= ", ".$order;
-
-$sql .=" ".GetLimitSQL($objSession->GetVariable($CurrentPageVar),$objConfig->Get($PerPageVar));
-
-$objImageList->Query_Item($sql);
-if($objSession->HasSystemPermission("DEBUG.LIST"))
- echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
-
-for($i=0;$i<count($objImageList->Items);$i++)
-{
- $img =& $objImageList->GetItemRefByIndex($i);
- $icon = $imagesURL."/itemicons/icon16_image_disabled.gif";
-
- if($img->Get("Enabled")=="1")
- {
- $icon = $imagesURL."/itemicons/icon16_image.gif";
- }
- $img->Set("Icon",$icon);
-}
-
-/* ---------------------------------------- Configure the list view ---------------------------------------- */
- $objListView = new clsListView($objListToolBar,$objImageList);
- $objListView->IdField = "ImageId";
- $SortOrder=0;
-
- if($objConfig->Get($SortOrderVar)=="asc")
- $SortOrder=1;
-
- $objListView->ColumnHeaders->Add("FullName",language("la_ColHeader_Image"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"FullName");
- $objListView->ColumnHeaders->Add("AltName",language("la_ColHeader_AltValue"),1,0,$order,"width=\"20%\"",$SortFieldVar,$SortOrderVar,"AltName");
- $objListView->ColumnHeaders->Add("ShowURL",language("la_ColHeader_Url"),1,0,$order,"width=\"20%\"",$SortFieldVar,$SortOrderVar,"ShowURL");
- $objListView->ColumnHeaders->Add("Status",language("la_ColHeader_Enabled"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"Status");
- $objListView->ColumnHeaders->Add("Preview",language("la_ColHeader_Preview"),1,0,$order,"width=\"40%\"",$SortFieldVar,$SortOrderVar,"Preview");
- $objListView->ColumnHeaders->SetSort($objConfig->Get($SortFieldVar), $objConfig->Get($SortOrderVar));
-
- $objListView->PrintToolBar = FALSE;
- $objListView->CurrentPageVar = "Page_Images";
- $objListView->PerPageVar = "Perpage_Images";
- $objListView->CheckboxName = "itemlist[]";
-
- $objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField,
- $CurrentFilterVar,$ImgView,$Img_AllValue);
-
- foreach($FilterLabels as $Bit=>$Label)
- {
- $objListView->AddViewMenuFilter($Label,$Bit);
- }
- for($i=0;$i<count($objImageList->Items);$i++)
- {
- $img =& $objImageList->GetItemRefByIndex($i);
- $objListView->RowIcons[] = $img->Get("Icon");
- }
-
-$objListToolBar->AddToInitScript("fwLoadMenus();\n");
-
-$filter = false; // always initialize variables before use
-if ($ImgView != $Img_AllValue) {
- $filter = true;
-}
-
-$h = "\n\n<SCRIPT Language=\"JavaScript1.2\">\n".$objListView->GetViewMenu($imagesURL)."\n</SCRIPT>\n";
-int_header($objListToolBar,NULL, $title,NULL,$h);
-if ($objSession->GetVariable("HasChanges") == 1) {
-?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
- <tr>
- <td valign="top">
- <?php int_hint_red(admin_language("la_Warning_Save_Item")); ?>
- </td>
- </tr>
-</table>
-<?php } ?>
-<?php if ($filter) { ?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
- <tr>
- <td valign="top">
- <?php int_hint_red(admin_language("la_Warning_Filter")); ?>
- </td>
- </tr>
-</table>
-<?php } ?>
-<form name="imagelistform" ID="imagelistform" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar;?>" method=POST>
-<table cellSpacing="0" cellPadding="2" width="100%" class="tableborder">
-<tbody>
-<?php
- print $objListView->PrintList();
-?>
- <input TYPE="hidden" NAME="ResourceId" VALUE="<?php echo $c->Get("ResourceId"); ?>">
- <input type="hidden" name="Action" value="m_item_image">
-</FORM>
-</TBODY>
-</table>
-<FORM NAME="save_edit_buttons" ID="save_edit_buttons" method="POST" ACTION="">
- <input type=hidden NAME="Action" VALUE="save_category_edit">
- <INPUT TYPE="hidden" NAME="CategoryId" VALUE="<?php echo $c->Get("CategoryId"); ?>">
- <input type="hidden" name="CatEditStatus" VALUE="0">
-</FORM>
-<FORM ID="ListSearchForm" NAME="ListSearchForm" method="POST" action="<?php echo $_SERVER["PHP_SELF"]."?env=".BuildEnv(); ?>">
- <INPUT TYPE="HIDDEN" NAME="Action" VALUE="">
- <INPUT TYPE="HIDDEN" NAME="list_search">
-</FORM>
-<!-- CODE FOR VIEW MENU -->
-<form ID="viewmenu" method="post" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>" name="viewmenu">
-<input type="hidden" name="fieldname" value="">
-<input type="hidden" name="varvalue" value="">
-<input type="hidden" name="varvalue2" value="">
-<input type="hidden" name="Action" value="">
-</form>
-<script language="JavaScript1.2" src="<?php echo $adminURL; ?>/listview/listview.js"></script>
-
-<script language="JavaScript1.2">
-initSelectiorContainers();
-<?php echo $objListToolBar->Get("CheckClass").".setImages();"; ?>
-</script>
-<!-- END CODE-->
-<?php int_footer(); ?>
\ No newline at end of file
Property changes on: trunk/admin/category/addcategory_images.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.9
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/addpermission_modules.php
===================================================================
--- trunk/admin/category/addpermission_modules.php (revision 6427)
+++ trunk/admin/category/addpermission_modules.php (nonexistent)
@@ -1,233 +0,0 @@
-<?php
-##############################################################
-##In-portal ##
-##############################################################
-## In-portal ##
-## Intechnic Corporation ##
-## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
-## otherwise redistributed without proper written ##
-## consent of Intechnic Corporation. Violation will ##
-## result in revocation of the license and support ##
-## privileges along maximum prosecution allowed by law. ##
-##############################################################
-
-// new startup: begin
-define('REL_PATH', 'admin/category');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-//require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/browse/toolbar.php");
-require_once($pathtoroot.$admin."/listview/listview.php");
-
-$m = GetModuleArray();
-foreach($m as $key=>$value)
-{
- $path = $pathtoroot. $value."admin/include/parser.php";
- if(file_exists($path))
- {
- include_once($path);
- }
-}
-
-unset($objEditItems);
-
-$objEditItems = new clsCatList();
-$objEditItems->SourceTable = $objSession->GetEditTable("Category");
-
-$live_editing = $objSession->GetVariable('IsHomeCategory');
-if ($live_editing) {
- $objEditItems->SourceTable = TABLE_PREFIX.'Category';
-}
-
-//Multiedit init
-$en = (int)$_GET["en"];
-$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable.($objEditItems->isLiveTable() ? ' WHERE CategoryId = 0' : ''));
-$itemcount=$objEditItems->NumItems();
-
-if(isset($_GET["en"]))
-{
- $c = $objEditItems->GetItemByIndex($en);
-}
-else
-{
- $c = new clsCategory($m_var_list["cat"]);
-}
-
-if(!is_object($c))
-{
- $c = new clsCategory();
- $c->Set("CategoryId",0);
-}
-if($itemcount>1)
-{
- if ($en+1 == $itemcount)
- $en_next = -1;
- else
- $en_next = $en+1;
-
- if ($en == 0)
- $en_prev = -1;
- else
- $en_prev = $en-1;
-}
-$action = "m_edit_permissions";
-
-$envar = "env=" . BuildEnv() . "&en=$en";
-
-//$section = 'in-portal:editcategory_permissions';
-$section = 'in-portal:catperm_modules';
-
-if(count($_POST))
-{
- if($_POST["Action"]=="m_edit_permissions")
- {
- $GroupId = $_POST["GroupId"];
- $g = $objGroups->GetItem($GroupId);
- }
- else
- {
- if(!is_array($_POST["itemlist"]))
- {
- $g = $objGroups->GetItemByField("ResourceId", $_POST["itemlist"]);
- if(is_object($g))
- $GroupId = $g->Get("GroupId");
- }
- else
- {
- $g = $objGroups->GetItemByField("ResourceId", $_POST["itemlist"][0]);
- $GroupId = $g->Get("GroupId");
- }
- }
-}
-else
-{
- $GroupId = $_GET["GroupId"];
- $g = $objGroups->GetItem($GroupId);
-}
-
-$objPermList = new clsPermList($c->Get("CategoryId"),$GroupId);
-
-$ado = &GetADODBConnection();
-$sql = "SELECT DISTINCT(ModuleId) FROM ".GetTablePrefix()."PermissionConfig";
-$rs = $ado->Execute($sql);
-$Modules = array();
-
-while($rs && !$rs->EOF)
-{
- $data = $rs->fields;
- $Modules[] = $data["ModuleId"];
- $rs->MoveNext();
-}
-/* page header */
-$charset = GetRegionalOption('Charset');
-print <<<END
-<html>
-<head>
- <title>In-portal</title>
- <meta http-equiv="content-type" content="text/html;charset=$charset">
- <meta http-equiv="Pragma" content="no-cache">
- <script language="JavaScript">
- imagesPath='$imagesURL'+'/';
- </script>
- <script src="$browseURL/common.js"></script>
- <script src="$browseURL/toolbar.js"></script>
- <script src="$browseURL/utility.js"></script>
- <script src="$browseURL/checkboxes.js"></script>
- <script language="JavaScript1.2" src="$browseURL/fw_menu.js"></script>
- <link rel="stylesheet" type="text/css" href="$browseURL/checkboxes.css">
- <link rel="stylesheet" type="text/css" href="$cssURL/style.css">
- <link rel="stylesheet" type="text/css" href="$browseURL/toolbar.css">
-END;
-
-//int_SectionHeader();
-if($c->Get("CategoryId")!=0)
-{
- $title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Category")." '".$c->Get("Name")."' - ".admin_language("la_tab_Permissions");
- $title .= " ".admin_language("la_text_for")." '".$g->parsetag("group_name")."'";
-}
-else
-{
- $title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Root")." ".admin_language("la_Text_Category")." - "."' - ".admin_language("la_tab_Permissions");
- $title .= " ".admin_language("la_text_for")." '".$g->parsetag("group_name")."'";
-}
-
-$objListToolBar = new clsToolBar();
-$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('category','CatEditStatus','$admin/category/addcategory_permissions.php',0);",$imagesURL."/toolbar/tool_select.gif");
-$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('category','CatEditStatus','".$admin."/category/addcategory_permissions.php',-1);", $imagesURL."/toolbar/tool_cancel.gif");
-
-$sec = $objSections->GetSection($section);
-if($c->Get("CategoryId")==0)
-{
- $sec->Set("left",NULL);
- $sec->Set("right",NULL);
-}
-
-int_header($objListToolBar,NULL,$title);
-if ($objSession->GetVariable("HasChanges") == 1) {
-?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
- <tr>
- <td valign="top">
- <?php int_hint_red(admin_language("la_Warning_Save_Item")); ?>
- </td>
- </tr>
-</table>
-<?php } ?>
-<TABLE CELLPADDING=0 CELLSPACING=0 class="tableborder" width="100%">
-<TBODY>
- <tr BGCOLOR="#e0e0da">
- <td WIDTH="100%" CLASS="navar">
- <img height="15" src="<?php echo $imagesURL; ?>/arrow.gif" width="15" align="middle" border="0">
- <span class="NAV_CURRENT_ITEM"><?php echo admin_language("la_Prompt_CategoryPermissions"); ?></span>
- </td>
- </TR>
-</TBODY>
-</TABLE>
-<TABLE CELLPADDING=0 CELLSPACING=0 class="tableborder" width="100%">
-<TBODY>
-<FORM ID="category" NAME="category" method="POST" ACTION="">
-<?php
- for($i=0;$i<count($Modules);$i++)
- {
- $module = $Modules[$i];
- if($module != "Admin" && $module != "Front")
- {
- echo "<TR ".int_table_color_ret().">";
- echo "<TD><IMG src=\"".$imagesURL."/itemicons/icon16_permission.gif\"> ";
- $getvar = "?env=".BuildEnv()."&module=$module&GroupId=$GroupId&en=".GetVar('en');
- echo "<A class=\"NAV_URL\" HREF=\"".$adminURL."/category/addpermission.php$getvar\">$module</A></TD>";
- echo "</TR>";
- }
- }
-?>
-</TBODY>
-</TABLE>
- <input type="hidden" name="ParentId" value="<?php echo $c->Get("ParentId"); ?>">
- <input type="hidden" name="CategoryId" value="<?php echo $c->parsetag("cat_id"); ?>">
- <input type="hidden" name="GroupId" value ="<?php echo $GroupId; ?>">
- <input type="hidden" name="Action" value="<?php echo $action; ?>">
- <input type="hidden" name="CatEditStatus" VALUE="0">
-</FORM>
-<FORM NAME="save_edit_buttons" ID="save_edit_buttons" method="POST" ACTION="">
- <tr <?php int_table_color(); ?>>
- <td colspan="3">
- <input type=hidden NAME="Action" VALUE="save_cat_edit">
- </td>
- </tr>
-</FORM>
-<!-- CODE FOR VIEW MENU -->
-<form method="post" action="user_groups.php?<?php echo $envar; ?>" name="viewmenu">
-<input type="hidden" name="fieldname" value="">
-<input type="hidden" name="varvalue" value="">
-<input type="hidden" name="varvalue2" value="">
-<input type="hidden" name="Action" value="">
-</form>
-<!-- END CODE-->
-<?php int_footer(); ?>
Property changes on: trunk/admin/category/addpermission_modules.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.10
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/category/addcategory_relations.php
===================================================================
--- trunk/admin/category/addcategory_relations.php (revision 6427)
+++ trunk/admin/category/addcategory_relations.php (nonexistent)
@@ -1,392 +0,0 @@
-<?php
-##############################################################
-##In-portal ##
-##############################################################
-## In-portal ##
-## Intechnic Corporation ##
-## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
-## otherwise redistributed without proper written ##
-## consent of Intechnic Corporation. Violation will ##
-## result in revocation of the license and support ##
-## privileges along maximum prosecution allowed by law. ##
-##############################################################
-
-// new startup: begin
-define('REL_PATH', 'admin/category');
-$relation_level = count( explode('/', REL_PATH) );
-define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-require_once FULL_PATH.'/kernel/startup.php';
-// new startup: end
-
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-//require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/toolbar.php");
-require_once($pathtoroot.$admin."/listview/listview.php");
-
-$m = GetModuleArray();
-foreach($m as $key => $value)
-{
- $path = $pathtoroot.$value."admin/include/parser.php";
- if( file_exists($path) ) include_once($path);
-}
-
-/* ------------------------------------- Edit Table --------------------------------------------------- */
-unset($objEditItems);
-
-$objEditItems = new clsCatList();
-$objEditItems->SourceTable = $objSession->GetEditTable("Category");
-
-//Multiedit init
-$en = (int)$_GET["en"];
-$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable);
-$itemcount=$objEditItems->NumItems();
-
-$c = $objEditItems->GetItemByIndex($en);
-
-if($itemcount>1)
-{
- if ($en+1 == $itemcount)
- $en_next = -1;
- else
- $en_next = $en+1;
-
- if ($en == 0)
- $en_prev = -1;
- else
- $en_prev = $en-1;
-}
-
-$action = "m_edit_category";
-
-/* -------------------------------------- Section configuration ------------------------------------------- */
-$envar = "env=" . BuildEnv() . "&en=$en";
-$section = 'in-portal:editcategory_relations';
-$title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Category")." '".$c->Get("Name")."' - ".admin_language("la_tab_Relations");
-
-$SortFieldVar = "Relation_LV_Sortfield";
-$SortOrderVar = "Relation_LV_Sortorder";
-$DefaultSortField = "ItemName";
-$PerPageVar = "Perpage_Relations";
-$CurrentPageVar = "Page_Relations";
-$CurrentFilterVar = "CatRel_View";
-
-$ListForm = "permlistform";
-$CheckClass = "PermChecks";
-
-$saveURL = $admin."/category/category_maint.php";
-$cancelURL = $admin."/".$objSession->GetVariable('ReturnScript');
-//echo $envar."<br>\n";
-/* ------------------------------------- Configure the toolbar ------------------------------------------- */
-$objListToolBar = new clsToolBar();
-$objListToolBar->Add("img_save", "la_Save","","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('save_edit_buttons','CatEditStatus','$saveURL',1);","tool_select.gif");
-$objListToolBar->Add("img_cancel", "la_Cancel","","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('save_edit_buttons','CatEditStatus','".$cancelURL."',2);","tool_cancel.gif");
-if($itemcount == 1) $objListToolBar->Add("divider");
-$objListToolBar->Set("section",$section);
-$objListToolBar->Set("load_menu_func","");
-$objListToolBar->Set("CheckClass",$CheckClass);
-$objListToolBar->Set("CheckForm",$ListForm);
-
-//Display header
-$sec = $objSections->GetSection($section);
-
-if ( isset($en_prev) || isset($en_next) )
-{
- $url = $RootUrl.$admin."/category/addcategory_relations.php";
- $StatusField = "CatEditStatus";
- $form = "category";
- MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevCategory','la_NextCategory');
- $objListToolBar->Add("divider");
-}
-
-$listImages = array();
- //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick
-
-$objListToolBar->Add("new_rel", "la_ToolTip_New_Relation","#".$envar,"swap('new_rel','toolbar/tool_new_relation_f2.gif');",
- "swap('new_rel', 'toolbar/tool_new_relation.gif');",
- "OpenItemSelector('$envar&source=addcategory_relations&CatId=".$c->Get("CategoryId")."&destform=popup&destfield=itemlist&Selector=radio');",
- "tool_new_relation.gif",FALSE,FALSE);
-
-$objListToolBar->Add("rel_edit","la_ToolTip_Edit","#", "if (PermChecks.itemChecked()) swap('rel_edit','toolbar/tool_edit_f2.gif');",
- "if (PermChecks.itemChecked()) swap('rel_edit', 'toolbar/tool_edit.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addrelation', '');",
- "tool_edit.gif",TRUE,TRUE);
-$listImages[] = "PermChecks.addImage('rel_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); ";
-
-$objListToolBar->Add("rel_del","la_ToolTip_Delete","#", "if (PermChecks.itemChecked()) swap('rel_del','toolbar/tool_delete_f2.gif');",
- "if (PermChecks.itemChecked()) swap('rel_del', 'toolbar/tool_delete.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addcategory_relations', 'm_rel_delete');",
- "tool_delete.gif",FALSE,TRUE);
-$listImages[] = "PermChecks.addImage('rel_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); ";
-
-$objListToolBar->Add("divider");
-
-$objListToolBar->Add("rel_move_up","la_ToolTip_Move_Up","#", "if (PermChecks.itemChecked()) swap('rel_move_up','toolbar/tool_move_up_f2.gif');",
- "if (PermChecks.itemChecked()) swap('rel_move_up', 'toolbar/tool_move_up.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addcategory_relations', 'm_rel_move_up');",
- "tool_move_up.gif",FALSE,TRUE);
-$listImages[] = "PermChecks.addImage('rel_move_up','$imagesURL/toolbar/tool_move_up.gif','$imagesURL/toolbar/tool_move_up_f3.gif',1); ";
-
-$objListToolBar->Add("rel_move_down","la_ToolTip_Move_Down","#", "if (PermChecks.itemChecked()) swap('rel_move_down','toolbar/tool_move_down_f2.gif');",
- "if (PermChecks.itemChecked()) swap('rel_move_down', 'toolbar/tool_move_down.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addcategory_relations', 'm_rel_move_down');",
- "tool_move_down.gif",FALSE,TRUE);
-$listImages[] = "PermChecks.addImage('rel_move_down','$imagesURL/toolbar/tool_move_down.gif','$imagesURL/toolbar/tool_move_down_f3.gif',1); ";
-
-$objListToolBar->Add("divider");
-
-$objListToolBar->Add("viewmenubutton", "la_ToolTip_View","#","swap('viewmenubutton','toolbar/tool_view_f2.gif'); ",
- "swap('viewmenubutton', 'toolbar/tool_view.gif');",
- "ShowViewMenu();","tool_view.gif");
-
-$objListToolBar->AddToInitScript($listImages);
-
-/* ----------------------------------------- Set the View Filter ---------------------------------------- */
-$Rel_AllValue = 255;
-
-$Bit_Categories = 1;
-$Bit_Links = 2;
-$Bit_News = 4;
-$Bit_Topics = 8;
-
-$Bit_OneWay = 16;
-$Bit_Recip = 32;
-
-$Bit_Enabled=64;
-$Bit_Disabled=128;
-
-$FilterLabels[0] = admin_language("la_Text_Category");
-$FilterLabels[1] = admin_language("la_Text_Links");
-$FilterLabels[2] = admin_language("la_Text_Articles");
-$FilterLabels[3] = admin_language("la_Text_Topics");
-$FilterLabels[4] = admin_language("la_Text_OneWay");
-$FilterLabels[5] = admin_language("la_Text_Reciprocal");
-$FilterLabels[6] = admin_language("la_Text_Enabled");
-$FilterLabels[7] = admin_language("la_Text_Disabled");
-
-$RelView = $objConfig->Get($CurrentFilterVar);
-
-if(!is_numeric($RelView))
-{
- $RelView = $Rel_AllValue;
-}
-else
-{
- $RelTypes = array();
- if($RelView & $Bit_Categories)
- $RelTypes[] = 1;
- if($RelView & $Bit_Links)
- $RelTypes[] = 4;
- if($RelView & $Bit_News)
- $RelTypes[] = 2;
- if($RelView & $Bit_Topics)
- $RelTypes[] = 3;
-
- $RelFilters = array();
-
- if(count($RelTypes))
- {
- $TypeFilter = "rel.TargetType IN (".implode(",",$RelTypes).")";
- }
-
- $RelTypes = array();
- if($RelView & $Bit_OneWay)
- $RelTypes[] = 0;
-
- if($RelView & $Bit_Recip)
- $RelTypes[] = 1;
-
- if(count($RelTypes))
- $RelFilters[] = "rel.Type IN (".implode(",",$RelTypes).")";
-
- if($RelView & $Bit_Enabled)
- $RelFilters[] = "rel.Enabled=1";
-
- if($RelView & $Bit_Disabled)
- $RelFilters[] = "rel.Enabled=0";
-
- if(count($RelFilters))
- {
- $RelFilter = $TypeFilter." AND (". implode(" OR ",$RelFilters).")";
- }
- else
- $RelFilter = $TypeFilter;
-}
-
-//$r =& $c->RelationObject();
-$objRelList = new clsRelationshipList();
-$objRelList->SourceTable = $objSession->GetEditTable("Relationship");
-$reltable = $objRelList->SourceTable;
-
-// ==== build sql depending on modules installed: begin ====
-$prefix = GetTablePrefix();
-$modules = $objModules->GetModuleList();
-$sql_source = $objModules->ExecuteFunction('GetModuleInfo', 'rel_list');
-
-$sql_templates['ItemName'] = 'IFNULL('.$prefix."%s.%s,' ')";
-$sql_templates['TableJoin'] = 'LEFT JOIN '.$prefix."%1\$s ON ".$prefix."%1\$s.ResourceId = rel.TargetId";
-$sql_templates['TargetName'] = "IF(rel.TargetType = %s, '%s', %s)";
-
-$sql = "SELECT TRIM(CONCAT(%s)) AS ItemName, %s AS ItemType,".
- GetELT('rel.Type+1', Array('la_Text_OneWay','la_Text_Reciprocal')).' AS RelationType,'.
- "RelationshipId, rel.Priority AS Priority, rel.Type as Type, rel.Enabled as Enabled,".
- GetELT('rel.Enabled+1', Array('la_Text_Disabled','la_Text_Enabled')).' AS Status '.
- 'FROM '.$reltable.' AS rel %s WHERE rel.SourceId = '.$c->Get('ResourceId');
-
-$sql_parts = Array();
-$sql_parts['TargetName'] = "''";
-foreach($modules as $module)
-{
- $sql_parts['ItemName'][] = sprintf($sql_templates['ItemName'], $sql_source[$module]['MainTable'], $sql_source[$module]['ItemNameField']);
- $sql_parts['TableJoin'][] = sprintf($sql_templates['TableJoin'], $sql_source[$module]['MainTable']);
-
- $sql_parts['TargetName'] = sprintf( $sql_templates['TargetName'],
- $sql_source[$module]['TargetType'],
- admin_language($sql_source[$module]['ItemNamePhrase']),
- $sql_parts['TargetName']);
-}
-$sql = sprintf($sql, implode(', ',$sql_parts['ItemName']), $sql_parts['TargetName'], implode(' ',$sql_parts['TableJoin']));
-// ==== build sql depending on modules installed: end ====
-
-if(strlen($RelFilter))
-{
- $sql .= " AND (".$RelFilter.")";
-}
-
-$SearchWords = $objSession->GetVariable("CatRelSearchWord");
-if(strlen($SearchWords))
-{
- $having = $objRelList->AdminSearchWhereClause($SearchWords);
-}
-else
- $having = "";
-
-if(strlen($having))
- $sql .= " HAVING ($having)";
-
-if(strlen(trim($objConfig->Get($SortFieldVar))))
-{
- $order = " ORDER BY rel.Priority DESC, ".$objConfig->Get($SortFieldVar)." ".$objConfig->Get($SortOrderVar);
-}
-else
- $order = " ORDER BY rel.Priority DESC";
-
-if($objConfig->Get($CurrentPageVar)>0)
-{
- $objRelList->Page = $objConfig->Get($CurrentPageVar);
-}
-if($objConfig->Get($PerPageVar)>0)
-{
- $objListView->PerPage = $objConfig->Get($PerPageVar);
-}
-
-$sql .= $order." ".$objRelList->GetLimitSQL();
-if($objSession->HasSystemPermission("DEBUG.LIST"))
- echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
-
-$objRelList->Query_Item($sql);
-
-/* ---------------------------------------- Configure the list view ---------------------------------------- */
-
-$objListView = new clsListView($objListToolBar,$objRelList);
-$objListView->IdField = "RelationshipId";
-
-$objListView->ColumnHeaders->Add("ItemName",admin_language("la_ColHeader_Item"),1,0,$order,"width=\"30%\"",$SortFieldVar,$SortOrderVar,"ItemName");
-$objListView->ColumnHeaders->Add("ItemType",admin_language("la_ColHeader_ItemType"),1,0,$order,"width=\"20%\"",$SortFieldVar,$SortOrderVar,"ItemType");
-$objListView->ColumnHeaders->Add("RelationType",admin_language("la_prompt_RelationType"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"RelationType");
-$objListView->ColumnHeaders->Add("Status",admin_language("la_prompt_Status"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"Status");
-$objListView->ColumnHeaders->SetSort($objConfig->Get($SortFieldVar), $objConfig->Get($SortOrderVar));
-
-$objListView->PrintToolBar = FALSE;
-$objListView->SearchBar = TRUE;
-$objListView->SearchKeywords = $SearchWords;
-$objListView->SearchAction="m_rel_search";
-$objListView->CurrentPageVar = $CurrentPageVar;
-$objListView->PerPageVar = $PerPageVar;
-$objListView->CheckboxName = "itemlist[]";
-
-$objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField,
- $CurrentFilterVar,$RelView,$Rel_AllValue);
-
-foreach($FilterLabels as $Bit=>$Label)
-{
- $objListView->AddViewMenuFilter($Label,$Bit);
-}
-
-for($i=0;$i<count($objRelList->Items);$i++)
-{
- $rel =& $objRelList->GetItemRefByIndex($i);
-
- $objListView->RowIcons[] = $rel->Admin_Icon();
-}
-
-$objListToolBar->AddToInitScript("fwLoadMenus();\n");
-
-
-$filter = false; // always initialize variables before use
-if($objSession->GetVariable("CatRelSearchWord") != '') {
- $filter = true;
-}
-else {
- if ($RelView != $Rel_AllValue) {
- $filter = true;
- }
-}
-
-$h = "\n\n<SCRIPT Language=\"JavaScript1.2\">\n".$objListView->GetViewMenu($imagesURL)."\n</SCRIPT>\n";
-int_header($objListToolBar,NULL, $title,NULL,$h);
-if ($objSession->GetVariable("HasChanges") == 1) {
-?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
- <tr>
- <td valign="top">
- <?php int_hint_red(admin_language("la_Warning_Save_Item")); ?>
- </td>
- </tr>
-</table>
-<?php } ?>
-<?php if ($filter) { ?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
- <tr>
- <td valign="top">
- <?php int_hint_red(admin_language("la_Warning_Filter")); ?>
- </td>
- </tr>
-</table>
-<?php } ?>
-<FORM method="POST" ACTION="" NAME="<?php echo $ListForm; ?>" ID="<?php echo $ListForm; ?>">
-<?php
- print $objListView->PrintList();
-?>
-<input type="hidden" name="Action" value="">
-<INPUT TYPE="hidden" NAME="CategoryId" VALUE="<?php echo $c->Get("CategoryId"); ?>">
-<INPUT TYPE="hidden" NAME="SourceId" VALUE = "<?php echo $c->Get("ResourceId"); ?>">
-</FORM>
-<FORM NAME="popup" ID="popup" METHOD="POST" ACTION="addrelation.php?<?php echo $envar; ?>">
- <INPUT TYPE="hidden" NAME="TargetId"><INPUT TYPE="hidden" NAME="TargetType">
- <INPUT TYPE="hidden" NAME="Action" value="m_add_relation_form">
-</FORM>
-<!-- CODE FOR VIEW MENU -->
-<form ID="viewmenu" method="post" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>" name="viewmenu">
-<input type="hidden" name="fieldname" value="">
-<input type="hidden" name="varvalue" value="">
-<input type="hidden" name="varvalue2" value="">
-<input type="hidden" name="Action" value="">
-</form>
-<FORM NAME="save_edit_buttons" ID="save_edit_buttons" method="POST" ACTION="">
- <tr <?php int_table_color(); ?>>
- <td colspan="3">
- <input type=hidden NAME="Action" VALUE="save_category_edit">
- <input type="hidden" name="CatEditStatus" VALUE="0">
- </td>
- </tr>
-</FORM>
-<FORM ID="ListSearchForm" NAME="ListSearchForm" method="POST" action="<?php echo $_SERVER["PHP_SELF"]."?env=".BuildEnv(); ?>">
- <INPUT TYPE="HIDDEN" NAME="Action" VALUE="">
- <INPUT TYPE="HIDDEN" NAME="list_search">
-</FORM>
-<script src="<?php echo $adminURL; ?>/listview/listview.js"></script>
-<script>
-initSelectiorContainers();
-<?php echo $objListToolBar->Get("CheckClass").".setImages();"; ?>
-</script>
-<!-- END CODE-->
-<?php int_footer(); ?>
\ No newline at end of file
Property changes on: trunk/admin/category/addcategory_relations.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.8
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/help/manual.pdf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/help/manual.pdf
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.24
\ No newline at end of property
+1.25
\ No newline at end of property
Index: trunk/admin/install.php
===================================================================
--- trunk/admin/install.php (revision 6427)
+++ trunk/admin/install.php (revision 6428)
@@ -1,2067 +1,2090 @@
<?php
error_reporting(E_ALL);
set_time_limit(0);
ini_set('memory_limit', -1);
define('BACKUP_NAME', 'dump(.*).txt'); // how backup dump files are named
$general_error = '';
$pathtoroot = "";
if( !(isset($pathtoroot) && $pathtoroot) )
{
$path=dirname(realpath(__FILE__));
//$path=dirname(realpath(__FILE__));
if(strlen($path))
{
/* determine the OS type for path parsing */
$pos = strpos($path,":");
if ($pos === false)
{
$gOS_TYPE="unix";
$pathchar = "/";
}
else
{
$gOS_TYPE="win";
$pathchar="\\";
}
$p = $path.$pathchar;
/*Start looking for the root flag file */
if( !isset($pathtoroot) ) $pathtoroot = '';
while(!strlen($pathtoroot) && strlen($p))
{
$sub = substr($p,strlen($pathchar)*-1);
if($sub==$pathchar)
{
$filename = $p."root.flg";
}
else
$filename = $p.$pathchar."root.flg";
if(file_exists($filename))
{
$pathtoroot = $p;
}
else
{
$parent = realpath($p.$pathchar."..".$pathchar);
if($parent!=$p)
{
$p = $parent;
}
else
$p = "";
}
}
if( !(isset($pathtoroot) && $pathtoroot) )
$pathtoroot = ".".$pathchar;
}
else
{
$pathtoroot = ".".$pathchar;
}
}
$path_char = GetPathChar();
//phpinfo(INFO_VARIABLES);
$sub = substr($pathtoroot,strlen($pathchar)*-1);
if($sub!=$pathchar)
{
$pathtoroot = $pathtoroot.$pathchar;
}
ini_set('include_path', '.');
if (!defined('IS_INSTALL')) define('IS_INSTALL',1);
if( file_exists($pathtoroot.'debug.php') && !(defined('DEBUG_MODE') && DEBUG_MODE) ) include_once($pathtoroot.'debug.php');
$admin = substr($path,strlen($pathtoroot));
$state = isset($_GET["state"]) ? $_GET["state"] : '';
if(!strlen($state))
{
$state = isset($_POST['state']) ? $_POST['state'] : '';
}
if (!defined("GET_LICENSE_URL")) {
define("GET_LICENSE_URL", "http://www.intechnic.com/myaccount/license.php");
}
require_once $pathtoroot.$admin.'/install/install_lib.php';
$install_type = GetVar('install_type', true);
$force_finish = isset($_REQUEST['ff']) ? true : false;
$ini_file = $pathtoroot."config.php";
if(file_exists($ini_file))
{
$write_access = is_writable($ini_file);
$ini_vars = inst_parse_portal_ini($ini_file,TRUE);
foreach($ini_vars as $secname => $section)
{
foreach($section as $key => $value)
{
$key = "g_".str_replace('-', '', $key);
global $$key;
$$key = $value;
}
}
}
else
{
$state="";
$write_access = is_writable($pathtoroot);
if($write_access)
{
set_ini_value("Database", "DBType", "");
set_ini_value("Database", "DBHost", "");
set_ini_value("Database", "DBUser", "");
set_ini_value("Database", "DBUserPassword", "");
set_ini_value("Database", "DBName", "");
set_ini_value("Module Versions", "In-Portal", "");
save_values();
}
}
$titles[1] = "General Site Setup";
$configs[1] = "in-portal:configure_general";
$mods[1] = "In-Portal";
$titles[2] = "User Setup";
$configs[2] = "in-portal:configure_users";
$mods[2] = "In-Portal:Users";
$titles[3] = "Category Display Setup";
$configs[3] = "in-portal:configure_categories";
$mods[3] = "In-Portal";
// simulate rootURL variable: begin
$rootURL = 'http://'.dirname($_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']);
$tmp = explode('/', $rootURL);
if( $tmp[ count($tmp) - 1 ] == $admin) unset( $tmp[ count($tmp) - 1 ] );
$rootURL = implode('/', $tmp).'/';
unset($tmp);
//echo "RU: $rootURL<br>";
// simulate rootURL variable: end
$db_savings = Array('dbinfo', 'db_config_save', 'db_reconfig_save'); //, 'reinstall_process'
if( isset($g_DBType) && $g_DBType && strlen($state)>0 && !in_array($state, $db_savings) )
{
define('REL_PATH', 'admin');
require_once($pathtoroot."kernel/startup.php");
$localURL=$rootURL."kernel/";
$adminURL = $rootURL.$admin;
$imagesURL = $adminURL."/images";
//admin only util
$pathtolocal = $pathtoroot."kernel/";
require_once ($pathtoroot.$admin."/include/elements.php");
//require_once ($pathtoroot."kernel/admin/include/navmenu.php");
require_once ($pathtolocal."admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
set_cookie(SESSION_COOKIE_NAME, '', adodb_mktime() - 3600, rtrim(BASE_PATH, '/') );
}
function GetPathChar($path = null)
{
if( !isset($path) ) $path = $GLOBALS['pathtoroot'];
$pos = strpos($path, ':');
return ($pos === false) ? "/" : "\\";
}
function SuperStrip($str, $inverse = false)
{
$str = $inverse ? str_replace("%5C","\\",$str) : str_replace("\\","%5C",$str);
return stripslashes($str);
}
$skip_step = false;
require_once($pathtoroot.$admin."/install/inst_ado.php");
$helpURL = $rootURL.$admin.'/help/install_help.php?destform=popup&help_usage=install';
?>
<html>
<head>
<title>In-Portal Installation</title>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Notepad">
<link rel="stylesheet" type="text/css" href="include/style.css">
<LINK REL="stylesheet" TYPE="text/css" href="install/2col.css">
<SCRIPT LANGUAGE="JavaScript1.2">
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function swap(imgid, src){
var ob = document.getElementById(imgid);
ob.src = 'images/' + src;
}
function Continue() {
document.iform1.submit();
}
function CreatePopup(window_name, url, width, height)
{
// creates a popup window & returns it
if(url == null && typeof(url) == 'undefined' ) url = '';
if(width == null && typeof(width) == 'undefined' ) width = 750;
if(height == null && typeof(height) == 'undefined' ) height = 400;
return window.open(url,window_name,'width='+width+',height='+height+',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no');
}
function ShowHelp(section)
{
var frm = document.getElementById('help_form');
frm.section.value = section;
frm.method = 'POST';
CreatePopup('HelpPopup','<?php echo $rootURL.$admin; ?>/help/blank.html'); // , null, 600);
frm.target = 'HelpPopup';
frm.submit();
}
</SCRIPT>
</head>
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" style="height: 100%">
<form name="help_form" id="help_form" action="<?php echo $helpURL; ?>" method="post"><input type="hidden" id="section" name="section" value=""></form>
<form enctype="multipart/form-data" name="iform1" id="iform1" method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
<tr>
<td height="90">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="90">
<tr>
<td rowspan="3" valign="top"><a href="http://www.in-portal.net" target="_top"><img title="In-portal" src="images/globe.gif" width="84" height="91" border="0"></a></td>
<td rowspan="3" valign="top"><a href="http://www.in-portal.net" target="_top"><img title="In-portal" src="images/logo.gif" width="150" height="91" border="0"></a></td>
<td rowspan="3" width="100000" align="right">&nbsp;</td>
<td width="400"><img title="" src="images/blocks.gif" width="400" height="73"></td>
</tr>
<tr><td align="right" background="images/version_bg.gif" class="head_version" valign="top"><img title="" src="images/spacer.gif" width="1" height="14">In-Portal Version <?php echo GetMaxPortalVersion($pathtoroot.$admin)?>: English US</td></tr>
<tr><td><img title="" src="images/blocks2.gif" width="400" height="2"><br></td></tr>
<tr><td bgcolor="black" colspan="4"><img title="" src="images/spacer.gif" width="1" height="1"><br></td></tr>
</table>
</td>
</tr>
<?php
require_once($pathtoroot."kernel/include/adodb/adodb.inc.php");
if(!strlen($state))
$state = @$_POST["state"];
//echo $state;
if(strlen($state)==0)
{
$ado =& inst_GetADODBConnection();
$installed = $ado ? TableExists($ado,"ConfigurationAdmin,Category,Permissions") : false;
if(!minimum_php_version("4.1.2"))
{
$general_error = "You have version ".phpversion()." - please upgrade!";
//die();
}
if(!$write_access)
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "Install cannot write to config.php in the root directory of your in-portal installation ($pathtoroot).";
//die();
}
if(!is_writable($pathtoroot."themes/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's Theme directory must be writable (".$pathtoroot."themes/).";
//die();
}
if(!is_writable($pathtoroot."kernel/images/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's Image Upload directory must be writable (".$pathtoroot."kernel/images/).";
//die();
}
if(!is_writable($pathtoroot."kernel/images/pending"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's Pending Image Upload directory must be writable (".$pathtoroot."kernel/images/pending).";
//die();
}
if(!is_writable($pathtoroot."admin/backupdata/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's Backup directory must be writable (".$pathtoroot."admin/backupdata/).";
//die();
}
if(!is_writable($pathtoroot."admin/export/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's Export directory must be writable (".$pathtoroot."admin/export/).";
//die();
}
if(!is_writable($pathtoroot."kernel/stylesheets/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's stylesheets directory must be writable (".$pathtoroot."kernel/stylesheets/).";
//die();
}
if(!is_writable($pathtoroot."kernel/user_files/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's CMS images directory must be writable (".$pathtoroot."kernel/user_files/).";
//die();
}
if(!is_writable($pathtoroot."kernel/cache/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's templates cache directory must be writable (".$pathtoroot."kernel/cache/).";
//die();
}
if($installed)
{
$state="reinstall";
}
else {
$state="dbinfo";
}
}
if($state=="reinstall_process")
{
$login_err_mesg = ''; // always init vars before use
if( !isset($g_License) ) $g_License = '';
$lic = base64_decode($g_License);
if(strlen($lic))
{
a83570933e44bc66b31dd7127cf3f23a($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
$LoggedIn = FALSE;
if($_POST["UserName"]=="root")
{
$ado =& inst_GetADODBConnection();
$sql = "SELECT * FROM ".$g_TablePrefix."ConfigurationValues WHERE VariableName='RootPass'";
$rs = $ado->Execute($sql);
if($rs && !$rs->EOF)
{
$RootPass = $rs->fields["VariableValue"];
- if(strlen($RootPass)>0)
- $LoggedIn = ($RootPass==md5($_POST["UserPass"]));
+ if(strlen($RootPass)>0) {
+ if (ConvertVersion($g_InPortal) >= ConvertVersion("1.3.0")) {
+ $LoggedIn = ($RootPass==md5(md5($_POST["UserPass"]).'b38'));
+ }
+ else {
+ $LoggedIn = ($RootPass==md5($_POST["UserPass"]));
+ }
+ }
}
else {
$login_err_mesg = 'Invalid username or password';
}
}
else
{
$act = '';
if (ConvertVersion($g_InPortal) >= ConvertVersion("1.0.5")) {
$act = 'check';
}
$rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['UserName'])."&password=".md5($_POST['UserPass'])."&action=$act&license_code=".base64_encode($g_LicenseCode)."&version=".GetMaxPortalVersion($pathtoroot.$admin)."&domain=".base64_encode($_SERVER['HTTP_HOST']), "r");
if (!$rfile) {
$login_err_mesg = "Unable to connect to the Intechnic server!";
$LoggedIn = false;
}
else {
$rcontents = '';
while (!feof($rfile)) {
$line = fgets($rfile, 10000);
$rcontents .= $line;
}
@fclose($rfile);
if (substr($rcontents, 0, 5) == 'Error') {
$login_err_mesg = substr($rcontents, 6);
$LoggedIn = false;
}
else {
$LoggedIn = true;
}
}
//$LoggedIn = ($i_User == $_POST["UserName"] && ($i_Pswd == $_POST["UserPass"]) && strlen($i_User)>0) || strlen($i_User)==0;
}
if($LoggedIn)
{
if (!(int)$_POST["inp_opt"]) {
$state="reinstall";
$inst_error = "Please select one of the options above!";
}
else {
switch((int)$_POST["inp_opt"])
{
case 0:
$inst_error = "Please select an option above";
break;
case 1:
/* clean out all tables */
$install_type = 4;
$ado =& inst_GetADODBConnection();
$filename = $pathtoroot.$admin."/install/inportal_remove.sql";
RunSchemaFile($ado,$filename);
// removing other tables
$tables = $ado->MetaTables();
foreach($tables as $tab_name) {
if (stristr($tab_name, $g_TablePrefix."ses_")) {
$sql = "DROP TABLE IF EXISTS $tab_name";
$ado->Execute($sql);
}
}
/* run install again */
$state="license";
break;
case 2:
$install_type = 3;
$state="dbinfo";
break;
case 3:
$install_type = 5;
$state="license";
break;
case 4:
$install_type = 6;
/* clean out all tables */
$ado =& inst_GetADODBConnection();
//$filename = $pathtoroot.$admin."/install/inportal_remove.sql";
//RunSchemaFile($ado,$filename);
/* run install again */
$state="restore_select";
break;
case 5:
$install_type = 7;
/* change DB config */
$state="db_reconfig";
break;
case 6:
$install_type = 8;
$state = "upgrade";
break;
case 7:
$install_type = 9;
$state = "fix_paths";
break;
}
}
}
else
{
$state="reinstall";
$login_error = $login_err_mesg;//"Invalid Username or Password - Try Again";
}
}
if ($state == "upgrade") {
$ado =& inst_GetADODBConnection();
$Modules = array();
$Texts = array();
if (ConvertVersion(GetMaxPortalVersion($pathtoroot.$admin)) >= ConvertVersion("1.0.5") && ($g_LicenseCode == '' && $g_License != '')) {
$state = 'reinstall';
$inst_error = "Your license must be updated before you can upgrade. Please don't use 'Existing License' option, instead either Download from Intechnic or Upload a new license file!";
}
else {
$sql = "SELECT Name, Version, Path FROM ".$g_TablePrefix."Modules ORDER BY LoadOrder asc";
$rs = $ado->Execute($sql);
$i = 0;
while ($rs && !$rs->EOF) {
$p = $rs->fields['Path'];
if ($rs->fields['Name'] == 'In-Portal') {
$p = '';
}
$dir_name = $pathtoroot.$p."admin";///install/upgrades/";
if($rs->fields['Version'] != $newver = GetMaxPortalVersion($dir_name))
{
////////////////////
$mod_path = $rs->fields['Path'];
$current_version = $rs->fields['Version'];
if ($rs->fields['Name'] == 'In-Portal') $mod_path = '';
$dir_name = $pathtoroot.$mod_path."/admin/install/upgrades/";
$dir = @dir($dir_name);
if (!$dir) {
$rs->MoveNext();
continue;
}
$upgrades_arr = Array();
$new_version = '';
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) {
if (strstr($file, 'inportal_check_v')) {
$upgrades_arr[] = $file;
}
}
}
usort($upgrades_arr, "VersionSort");
$result=0;
$failCheck=1;
$stopCheck=2;
$CheckErrors = Array();
foreach($upgrades_arr as $file)
{
$file_tmp = str_replace("inportal_check_v", "", $file);
$file_tmp = str_replace(".php", "", $file_tmp);
if (ConvertVersion($file_tmp) > ConvertVersion($current_version)) {
$filename = $pathtoroot.$mod_path."/admin/install/upgrades/$file";
if(file_exists($filename))
{
include($filename);
if( $result & 2 ) break;
}
}
}
////////////////////
$Modules[] = Array('module'=>$rs->fields['Name'],'curver'=>$rs->fields['Version'],'newver'=>$newver,'error'=>$result!='pass');
// $Texts[] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".GetMaxPortalVersion($dir_name).")";
}
/*$dir = @dir($dir_name);
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file))
{
if (strstr($file, 'inportal_upgrade_v')) {
$file = str_replace("inportal_upgrade_v", "", $file);
$file = str_replace(".sql", "", $file);
//$sql = "SELECT count(*) AS count FROM ".$g_TablePrefix."Modules WHERE Name = '".$rs->fields['Name']."' AND Version = '$file'";
//$rs1 = $ado->Execute($sql);
if ($rs1->fields['count'] == 0 && ConvertVersion($file) > ConvertVersion($rs->fields['Version'])) {
if ($Modules[$i-1] == $rs->fields['Name']) {
$Texts[$i-1] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".$file.")";
$i--;
}
else {
$Texts[$i] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".$file.")";
$Modules[$i] = $rs->fields['Name'];
}
$i++;
}
}
}
}*/
$rs->MoveNext();
}
$sql = 'DELETE FROM '.$g_TablePrefix.'Cache WHERE VarName IN ("config_files","configs_parsed","sections_parsed")';
$ado->Execute($sql);
$include_file = $pathtoroot.$admin."/install/upgrade.php";
}
}
if ($state == "upgrade_process") {
// K4 applition is now always available during upgrade process
if (!defined('FULL_PATH')) {
define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
define('APPLICATION_CLASS', 'MyApplication');
}
include_once(FULL_PATH.'/kernel/kernel4/startup.php');
$application =& kApplication::Instance();
$application->Init();
// force rereading of configs
$unit_config_reader =& $application->recallObject('kUnitConfigReader');
$unit_config_reader->scanModules(MODULES_PATH);
$ado =& inst_GetADODBConnection();
$mod_arr = $_POST['modules'];
$mod_str = '';
foreach ($mod_arr as $tmp_mod) {
$mod_str .= "'$tmp_mod',";
}
$mod_str = substr($mod_str, 0, strlen($mod_str) - 1);
$sql = "SELECT Name FROM ".$g_TablePrefix."Modules WHERE Name IN ($mod_str) ORDER BY LoadOrder";
$rs = $ado->Execute($sql);
$mod_arr = array();
while ($rs && !$rs->EOF) {
$mod_arr[] = $rs->fields['Name'];
$rs->MoveNext();
}
foreach($mod_arr as $p)
{
$mod_name = strtolower($p);
$sql = "SELECT Version, Path FROM ".$g_TablePrefix."Modules WHERE Name = '$p'";
$rs = $ado->Execute($sql);
$current_version = $rs->fields['Version'];
if ($mod_name == 'in-portal') {
$mod_path = '';
}
else {
$mod_path = $rs->fields['Path'];
}
$dir_name = $pathtoroot.$mod_path."/admin/install/upgrades/";
$dir = @dir($dir_name);
$upgrades_arr = Array();
$new_version = '';
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) {
if (strstr($file, 'inportal_upgrade_v')) {
$upgrades_arr[] = $file;
}
}
}
usort($upgrades_arr, "VersionSort");
foreach($upgrades_arr as $file)
{
preg_match('/inportal_upgrade_v(.*).(php|sql)$/', $file, $rets);
$tmp_version = $rets[1];
$tmp_extension = $rets[2];
if (ConvertVersion($tmp_version) > ConvertVersion($current_version) )
{
$filename = $pathtoroot.$mod_path."/admin/install/upgrades/$file";
//echo "Running: $filename<br>";
// SQL is processed FIRST (before corresponding PHP according to the sorting order in VersionSort()
if( file_exists($filename) )
{
if($tmp_extension == 'sql')
{
RunSQLFile($ado, $filename);
}
else
{
include_once $filename;
}
}
}
}
set_ini_value("Module Versions", $p, GetMaxPortalVersion($pathtoroot.$mod_path."/admin/"));
save_values();
}
// compile stylesheets: begin
define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
define('APPLICATION_CLASS', 'MyApplication');
include_once(FULL_PATH.'/kernel/kernel4/startup.php');
$application =& kApplication::Instance();
$application->Init();
$objThemes->CreateMissingThemes(false);
$css_hash = $application->Conn->GetCol('SELECT LOWER(Name) AS Name, StylesheetId FROM '.TABLE_PREFIX.'Stylesheets', 'StylesheetId');
$css_table = $application->getUnitOption('css','TableName');
$css_idfield = $application->getUnitOption('css','IDField');
$theme_table = $application->getUnitOption('theme', 'TableName');
$theme_idfield = $application->getUnitOption('theme', 'IDField');
$theme_update_sql = 'UPDATE '.$theme_table.' SET '.$css_idfield.' = %s WHERE LOWER(Name) = %s';
foreach($css_hash as $stylesheet_id => $theme_name)
{
$css_item =& $application->recallObject('css', null, Array('skip_autoload' => true));
$css_item->Load($stylesheet_id);
$css_item->Compile();
$application->Conn->Query( sprintf($theme_update_sql, $stylesheet_id, $application->Conn->qstr( getArrayValue($css_hash,$stylesheet_id) ) ) );
}
// do redirect, because upgrade scripts can eat a lot or memory used for language pack upgrade operation
$application->Redirect('install', Array('state' => 'languagepack_upgrade'), '', 'install.php');
// compile stylesheets: end
$state = 'languagepack_upgrade';
}
// upgrade language pack
if($state=='languagepack_upgrade')
{
$state = 'lang_install_init';
if( is_object($application) ) $application->SetVar('lang', Array('english.lang') );
$force_finish = true;
}
if ($state == 'fix_paths') {
$ado = inst_GetADODBConnection();
$sql = "SELECT * FROM ".$g_TablePrefix."ConfigurationValues WHERE VariableName = 'Site_Name' OR VariableName LIKE '%Path%'";
$path_rs = $ado->Execute($sql);
$include_file = $pathtoroot.$admin."/install/fix_paths.php";
}
if ($state == 'fix_paths_process') {
$ado = inst_GetADODBConnection();
//$state = 'fix_paths';
//$include_file = $pathtoroot.$admin."/install/fix_paths.php";
foreach($_POST["values"] as $key => $value) {
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '".$value."' WHERE VariableName = '".$key."'";
$ado->Execute($sql);
}
$state = "finish";
}
if($state=="db_reconfig_save")
{
$ini_vars = inst_parse_portal_ini($ini_file,TRUE);
foreach($ini_vars as $secname => $section)
{
foreach($section as $key => $value)
{
$key = "g_".str_replace("-", "", $key);
global $$key;
$$key = $value;
}
}
unset($ado);
$ado = VerifyDB('db_reconfig', 'finish', 'SaveDBConfig', true);
}
if($state=="db_reconfig")
{
$include_file = $pathtoroot.$admin."/install/db_reconfig.php";
}
if($state=="restore_file")
{
if($_POST["submit"]=="Update")
{
$filepath = $_POST["backupdir"];
$state="restore_select";
}
else
{
$filepath = stripslashes($_POST['backupdir']);
$backupfile = $filepath.$path_char.str_replace('(.*)', $_POST['backupdate'], BACKUP_NAME);
if(file_exists($backupfile) && is_readable($backupfile))
{
$ado =& inst_GetADODBConnection();
$show_warning = false;
if (!$_POST['warning_ok']) {
// Here we comapre versions between backup and config
$file_contents = file_get_contents($backupfile);
$file_tmp_cont = explode("#------------------------------------------", $file_contents);
$tmp_vers = $file_tmp_cont[0];
$vers_arr = explode(";", $tmp_vers);
$ini_values = inst_parse_portal_ini($ini_file);
foreach ($ini_values as $key => $value) {
foreach ($vers_arr as $k) {
if (strstr($k, $key)) {
if (!strstr($k, $value)) {
$show_warning = true;
}
}
}
}
//$show_warning = true;
}
if (!$show_warning) {
$filename = $pathtoroot.$admin.$path_char.'install'.$path_char.'inportal_remove.sql';
RunSchemaFile($ado,$filename);
$state="restore_run";
}
else {
$state = "warning";
$include_file = $pathtoroot.$admin."/install/warning.php";
}
}
else {
if ($_POST['backupdate'] != '') {
$include_file = $pathtoroot.$admin."/install/restore_select.php";
$restore_error = "$backupfile not found or could not be read";
}
else {
$include_file = $pathtoroot.$admin."/install/restore_select.php";
$restore_error = "No backup selected!!!";
}
}
}
//echo $restore_error;
}
if($state=="restore_select")
{
if( isset($_POST['backupdir']) ) $filepath = stripslashes($_POST['backupdir']);
$include_file = $pathtoroot.$admin."/install/restore_select.php";
}
if($state=="restore_run")
{
$ado =& inst_GetADODBConnection();
$FileOffset = (int)$_GET["Offset"];
if(!strlen($backupfile))
$backupfile = SuperStrip($_GET['File'], true);
$include_file = $pathtoroot.$admin."/install/restore_run.php";
}
if($state=="db_config_save")
{
set_ini_value("Database", "DBType",$_POST["ServerType"]);
set_ini_value("Database", "DBHost",$_POST["ServerHost"]);
set_ini_value("Database", "DBName",$_POST["ServerDB"]);
set_ini_value("Database", "DBUser",$_POST["ServerUser"]);
set_ini_value("Database", "DBUserPassword",$_POST["ServerPass"]);
set_ini_value("Database","TablePrefix",$_POST["TablePrefix"]);
save_values();
$ini_vars = inst_parse_portal_ini($ini_file,TRUE);
foreach($ini_vars as $secname => $section)
{
foreach($section as $key => $value)
{
$key = "g_".str_replace("-", "", $key);
global $$key;
$$key = $value;
}
}
unset($ado);
$ado = VerifyDB('dbinfo', 'license');
}
if($state=="dbinfo")
{
if ($install_type == '') {
$install_type = 1;
}
$include_file = $pathtoroot.$admin."/install/dbinfo.php";
}
if ($state == "download_license") {
$ValidLicense = FALSE;
$lic_login = isset($_POST['login']) ? $_POST['login'] : '';
$lic_password = isset($_POST['password']) ? $_POST['password'] : '';
if ($lic_login != '' && $lic_password != '') {
// Here we determine weather login is ok & check available licenses
$rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['login'])."&password=".md5($_POST['password'])."&version=".GetMaxPortalVersion($pathtoroot.$admin)."&domain=".base64_encode($_SERVER['HTTP_HOST']), "r");
if (!$rfile) {
$get_license_error = "Unable to connect to the Intechnic server! Please try again later!";
$state = "get_license";
$include_file = $pathtoroot.$admin."/install/get_license.php";
}
else {
$rcontents = '';
while (!feof($rfile)) {
$line = fgets($rfile, 10000);
$rcontents .= $line;
}
@fclose($rfile);
if (substr($rcontents, 0, 5) == 'Error') {
$get_license_error = substr($rcontents, 6);
$state = "get_license";
$include_file = $pathtoroot.$admin."/install/get_license.php";
}
else {
if (substr($rcontents, 0, 3) == "SEL") {
$state = "download_license";
$license_select = substr($rcontents, 4);
$include_file = $pathtoroot.$admin."/install/download_license.php";
}
else {
// Here we get one license
$tmp_data = explode('Code==:', $rcontents);
$data = base64_decode(str_replace("In-Portal License File - do not edit!\n", "", $tmp_data[0]));
a83570933e44bc66b31dd7127cf3f23a($data);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
{
set_ini_value("Intechnic","License",base64_encode($data));
set_ini_value("Intechnic","LicenseCode",$tmp_data[1]);
save_values();
$state="domain_select";
$got_license = 1;
}
else {
$license_error="Invalid License File";
}
if(!$ValidLicense)
{
$state="license";
}
}
}
}
}
else if ($_POST['licenses'] == '') {
$state = "get_license";
$get_license_error = "Username and / or password not specified!!!";
$include_file = $pathtoroot.$admin."/install/get_license.php";
}
else {
// Here we download license
$rfile = @fopen(GET_LICENSE_URL."?license_id=".md5($_POST['licenses'])."&dlog=".md5($_POST['dlog'])."&dpass=".md5($_POST['dpass'])."&version=".GetMaxPortalVersion($pathtoroot.$admin)."&domain=".base64_encode($_POST['domain']), "r");
if (!$rfile) {
$get_license_error = "Unable to connect to the Intechnic server! Please try again later!";
$state = "get_license";
$include_file = $pathtoroot.$admin."/install/get_license.php";
}
else {
$rcontents = '';
while (!feof($rfile)) {
$line = fgets($rfile, 10000);
$rcontents .= $line;
}
@fclose($rfile);
if (substr($rcontents, 0, 5) == 'Error') {
$download_license_error = substr($rcontents, 6);
$state = "download_license";
$include_file = $pathtoroot.$admin."/install/download_license.php";
}
else {
$tmp_data = explode('Code==:', $rcontents);
$data = base64_decode(str_replace("In-Portal License File - do not edit!\n", "", $tmp_data[0]));
a83570933e44bc66b31dd7127cf3f23a($data);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
{
set_ini_value("Intechnic","License",base64_encode($data));
// old licensing script doen't return 2nd parameter (licanse code)
if( isset($tmp_data[1]) ) set_ini_value("Intechnic","LicenseCode",$tmp_data[1]);
save_values();
$state="domain_select";
}
else {
$license_error="Invalid License File";
}
if(!$ValidLicense)
{
$state="license";
}
}
}
}
}
if($state=="license_process")
{
$ValidLicense = FALSE;
$tmp_lic_opt = GetVar('lic_opt', true);
switch($tmp_lic_opt)
{
case 1: /* download from intechnic */
$include_file = $pathtoroot.$admin."/install/get_license.php";
$state = "get_license";
//if(!$ValidLicense)
//{
// $state="license";
//}
break;
case 2: /* upload file */
$file = $_FILES["licfile"];
if(is_array($file))
{
move_uploaded_file($file["tmp_name"],$pathtoroot."themes/tmp.lic");
@chmod($pathtoroot."themes/tmp.lic", 0666);
$fp = @fopen($pathtoroot."themes/tmp.lic","rb");
if($fp)
{
$lic = fread($fp,filesize($pathtoroot."themes/tmp.lic"));
fclose($fp);
}
$tmp_data = ae666b1b8279502f4c4b570f133d513e(FALSE,$pathtoroot."themes/tmp.lic");
$data = $tmp_data[0];
@unlink($pathtoroot."themes/tmp.lic");
a83570933e44bc66b31dd7127cf3f23a($data);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
{
set_ini_value("Intechnic","License",base64_encode($data));
set_ini_value("Intechnic","LicenseCode",$tmp_data[1]);
save_values();
$state="domain_select";
}
else
$license_error="Invalid License File";
}
if(!$ValidLicense)
{
$state="license";
}
break;
case 3: /* existing */
if(strlen($g_License))
{
$lic = base64_decode($g_License);
a83570933e44bc66b31dd7127cf3f23a($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
{
$state="domain_select";
}
else
{
$state="license";
$license_error="Invalid or corrupt license detected";
}
}
else
{
$state="license";
$license_error="Missing License File";
}
if(!$ValidLicense)
{
$state="license";
}
break;
case 4:
//set_ini_value("Intechnic","License",base64_encode("local"));
//set_ini_value("Intechnic","LicenseCode",base64_encode("local"));
//save_values();
$state="domain_select";
break;
}
if($ValidLicense)
$state="domain_select";
}
if($state=="license")
{
$include_file = $pathtoroot.$admin."/install/sel_license.php";
}
if($state=="reinstall")
{
$ado =& inst_GetADODBConnection();
$show_upgrade = false;
$sql = "SELECT Name FROM ".$g_TablePrefix."Modules";
$rs = $ado->Execute($sql);
$modules = '';
while ($rs && !$rs->EOF) {
$modules .= strtolower($rs->fields['Name']).',';
$rs->MoveNext();
}
$mod_arr = explode(",", substr($modules, 0, strlen($modules) - 1));
foreach($mod_arr as $p)
{
if ($p == 'in-portal') {
$p = '';
}
$dir_name = $pathtoroot.$p."/admin/install/upgrades/";
$dir = @dir($dir_name);
//echo "<pre>"; print_r($dir); echo "</pre>";
if ($dir === false) continue;
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file))
{
if( preg_match('/inportal_upgrade_v(.*).(php|sql)$/', $file, $rets) )
{
if($p == '') $p = 'in-portal';
$sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = '".$p."'";
$rs = $ado->Execute($sql);
if( ConvertVersion($rs->fields['Version']) < ConvertVersion( $rets[1] ) )
{
$show_upgrade = true;
}
}
}
}
}
if ( !isset($install_type) || $install_type == '') {
$install_type = 2;
}
$include_file = $pathtoroot.$admin."/install/reinstall.php";
}
if($state=="login")
{
$lic = base64_decode($g_License);
if(strlen($lic))
{
a83570933e44bc66b31dd7127cf3f23a($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
if(!$ValidLicense)
{
$state="license";
}
else
if($i_User == $_POST["UserName"] || $i_Pswd == $_POST["UserPass"])
{
$state = "domain_select";
}
else
{
$state="getuser";
$login_error = "Invalid User Name or Password. If you don't know your username or password, contact Intechnic Support";
}
//die();
}
if($state=="getuser")
{
$include_file = $pathtoroot.$admin."/install/login.php";
}
if($state=="set_domain")
{
if( !is_array($i_Keys) || !count($i_Keys) )
{
$lic = base64_decode($g_License);
if(strlen($lic))
{
a83570933e44bc66b31dd7127cf3f23a($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
}
if($_POST["domain"]==1)
{
$domain = $_SERVER['HTTP_HOST'];
if (strstr($domain, $i_Keys[0]['domain']) || de3ec1b7a142cccd0d51f03d24280744($domain)) {
set_ini_value("Intechnic","Domain",$domain);
save_values();
$state="runsql";
}
else {
$DomainError = 'Domain name selected does not match domain name in the license!';
$state = "domain_select";
}
}
else
{
$domain = str_replace(" ", "", $_POST["other"]);
if ($domain != '') {
if (strstr($domain, $i_Keys[0]['domain']) || de3ec1b7a142cccd0d51f03d24280744($domain)) {
set_ini_value("Intechnic","Domain",$domain);
save_values();
$state="runsql";
}
else {
$DomainError = 'Domain name entered does not match domain name in the license!';
$state = "domain_select";
}
}
else {
$DomainError = 'Please enter valid domain!';
$state = "domain_select";
}
}
}
if($state=="domain_select")
{
if(!is_array($i_Keys))
{
$lic = base64_decode($g_License);
if(strlen($lic))
{
a83570933e44bc66b31dd7127cf3f23a($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
}
$include_file = $pathtoroot.$admin."/install/domain.php";
}
if($state=="runsql")
{
$ado =& inst_GetADODBConnection();
$installed = TableExists($ado,"ConfigurationAdmin,Category,Permissions");
if(!$installed)
{
// create tables
$filename = $pathtoroot.$admin."/install/inportal_schema.sql";
RunSchemaFile($ado,$filename);
// insert default info
$filename = $pathtoroot.$admin."/install/inportal_data.sql";
RunSQLFile($ado,$filename);
$sql = 'UPDATE '.$g_TablePrefix.'ConfigurationValues SET VariableValue = %s WHERE VariableName = %s';
$ado->Execute( sprintf($sql, $ado->qstr('portal@'.$ini_vars['Intechnic']['Domain']), $ado->qstr('Smtp_AdminMailFrom') ) );
$sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = 'In-Portal'";
$rs = $ado->Execute($sql);
set_ini_value("Module Versions", "In-Portal", $rs->fields['Version']);
save_values();
require_once $pathtoroot.'kernel/include/tag-class.php';
if( !is_object($objTagList) ) $objTagList = new clsTagList();
// install kernel specific tags
$objTagList->DeleteTags(); // delete all existing tags in db
// create 3 predifined tags (because there no functions with such names
$t = new clsTagFunction();
$t->Set("name","include");
$t->Set("description","insert template output into the current template");
$t->Create();
$t->AddAttribute("_template","tpl","Template to insert","",TRUE);
$t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE);
$t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE);
$t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
unset($t);
$t = new clsTagFunction();
$t->Set("name","perm_include");
$t->Set("description","insert template output into the current template if permissions are set");
$t->Create();
$t->AddAttribute("_template","tpl","Template to insert","",TRUE);
$t->AddAttribute("_noaccess","tpl","Template to insert if access is denied","",FALSE);
$t->AddAttribute("_permission","","Comma-separated list of permissions, any of which will grant access","",FALSE);
$t->AddAttribute("_module","","Used in place of the _permission attribute, this attribute verifies the module listed is enabled","",FALSE);
$t->AddAttribute("_system","bool","Must be set to true if any permissions in _permission list is a system permission","",FALSE);
$t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE);
$t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE);
$t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
unset($t);
$t = new clsTagFunction();
$t->Set("name","mod_include");
$t->Set("description","insert templates from all enabled modules. No error occurs if the template does not exist.");
$t->Create();
$t->AddAttribute("_template","tpl","Template to insert. This template path should be relative to the module template root directory","",TRUE);
$t->AddAttribute("_modules","","Comma-separated list of modules. Defaults to all enabled modules if not set","",FALSE);
$t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE);
$t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE);
$t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
$objTagList->ParseFile($pathtoroot.'kernel/parser.php'); // insert module tags
if( is_array($ItemTagFiles) )
foreach($ItemTagFiles as $file)
$objTagList->ParseItemFile($pathtoroot.$file);
$state="RootPass";
}
else {
$include_file = $pathtoroot.$admin."/install/install_finish.php";
$state="finish";
}
}
if ($state == "finish") {
$ado =& inst_GetADODBConnection();
$PhraseTable = $g_TablePrefix."ImportPhrases";
$EventTable = $g_TablePrefix."ImportEvents";
$ado->Execute("DROP TABLE IF EXISTS $PhraseTable");
$ado->Execute("DROP TABLE IF EXISTS $EventTable");
$include_file = $pathtoroot.$admin."/install/install_finish.php";
}
if($state=="RootSetPass")
{
$pass = $_POST["RootPass"];
if(strlen($pass)<4)
{
$PassError = "Root Password must be at least 4 characters";
$state = "RootPass";
}
else if ($pass != $_POST["RootPassConfirm"]) {
$PassError = "Passwords does not match";
$state = "RootPass";
}
else
{
- $pass = md5($pass);
+ $pass = md5(md5($pass).'b38');
$sql = ' UPDATE '.$g_TablePrefix.'ConfigurationValues
SET VariableValue = '.$ado->qstr($pass).'
WHERE VariableName = "RootPass";';
$ado =& inst_GetADODBConnection();
$ado->Execute($sql);
$state="modselect";
}
}
if($state=="RootPass")
{
$include_file = $pathtoroot.$admin."/install/rootpass.php";
}
if($state=="lang_install_init")
{
- $ado =& inst_GetADODBConnection();
+ $ado =& inst_GetADODBConnection();
- if( TableExists($ado, 'Language,Phrase') )
- {
+ if( TableExists($ado, 'Language,Phrase') )
+ {
// KERNEL 4 INIT: BEGIN
define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
define('APPLICATION_CLASS', 'MyApplication');
include_once(FULL_PATH.'/kernel/kernel4/startup.php');
$application =& kApplication::Instance();
$application->Init();
// KERNEL 4 INIT: END
- $lang_xml =& $application->recallObject('LangXML');
+ $lang_xml =& $application->recallObject('LangXML');
- $lang_xml->renameTable('phrases', TABLE_PREFIX.'ImportPhrases');
- $lang_xml->renameTable('emailmessages', TABLE_PREFIX.'ImportEvents');
+ if (defined('DBG_FAST_INSTALL') && DBG_FAST_INSTALL) {
+ $lang_xml->tables['phrases'] = TABLE_PREFIX.'Phrase';
+ $lang_xml->tables['emailmessages'] = TABLE_PREFIX.'EmailMessage';
+ }
+ else {
+ $lang_xml->renameTable('phrases', TABLE_PREFIX.'ImportPhrases');
+ $lang_xml->renameTable('emailmessages', TABLE_PREFIX.'ImportEvents');
+ }
- $lang_xml->lang_object->TableName = $application->getUnitOption('lang','TableName');
+ $lang_xml->lang_object->TableName = $application->getUnitOption('lang','TableName');
$languages = $application->GetVar('lang');
if($languages)
{
$kernel_db =& $application->GetADODBConnection();
$modules_table = $application->getUnitOption('mod','TableName');
$modules = $kernel_db->GetCol('SELECT Path, Name FROM '.$modules_table, 'Name');
$modules['In-Portal'] = '';
foreach($languages as $lang_file)
{
foreach($modules as $module_name => $module_folder)
{
$lang_path = MODULES_PATH.'/'.$module_folder.'admin/install/langpacks';
$lang_xml->Parse($lang_path.'/'.$lang_file, '|0|1|2|', '');
if($force_finish) $lang_xml->lang_object->Update();
}
}
- $state = 'lang_install';
- }
- else
- {
- $state = 'lang_select';
- }
+ if (defined('DBG_FAST_INSTALL') && DBG_FAST_INSTALL) {
+ $state = 'lang_default';
+ }
+ else {
+ $state = 'lang_install';
+ }
+ }
+ else
+ {
+ $state = 'lang_select';
+ }
- $application->Done();
- }
- else
- {
- $general_error = 'Database error! No language tables found!';
- }
+ $application->Done();
+ }
+ else
+ {
+ $general_error = 'Database error! No language tables found!';
+ }
}
if($state=="lang_install")
{
define('FORCE_CONFIG_CACHE', 1);
/* do pack install */
$Offset = (int)$_GET["Offset"];
$Status = (int)$_GET["Status"];
$PhraseTable = $g_TablePrefix."ImportPhrases";
$EventTable = $g_TablePrefix."ImportEvents";
$Total = TableCount($Status == 0 ? $PhraseTable : $EventTable, '', 0);
if($Status == 0)
{
$Offset = $objLanguages->ReadImportTable($PhraseTable, 1,"0,1,2", $force_finish ? false : true, 200,$Offset);
if($Offset >= $Total)
{
$Offset=0;
$Status=1;
}
$next_step = GetVar('next_step', true);
if($force_finish == true) $next_step = 3;
$NextUrl = $_SERVER['PHP_SELF']."?Offset=$Offset&Status=$Status&state=lang_install&next_step=$next_step&install_type=$install_type";
if($force_finish == true) $NextUrl .= '&ff=1';
$include_file = $pathtoroot.$admin."/install/lang_run.php";
}
else
{
if(!is_object($objMessageList))
$objMessageList = new clsEmailMessageList();
$Offset = $objMessageList->ReadImportTable($EventTable, $force_finish ? false : true,100,$Offset);
if($Offset > $Total)
{
$next_step = GetVar('next_step', true);
if($force_finish == true) $next_step = 3;
$NextUrl = $_SERVER['PHP_SELF']."?Offset=$Offset&Status=$Status&State=lang_install&next_step=$next_step&install_type=$install_type";
if($force_finish == true) $NextUrl .= '&ff=1';
$include_file = $pathtoroot.$admin."/install/lang_run.php";
}
else
{
$db =& GetADODBConnection();
$prefix = $g_TablePrefix;
$db->Execute('DROP TABLE IF EXISTS '.$PhraseTable);
$db->Execute('DROP TABLE IF EXISTS '.$EventTable);
if(!$force_finish)
{
$state = 'lang_default';
}
else
{
$_POST['next_step'] = 4;
$state = 'finish';
$include_file = $pathtoroot.$admin."/install/install_finish.php";
}
}
}
}
if($state=="lang_default_set")
{
// phpinfo(INFO_VARIABLES);
/*$ado =& inst_GetADODBConnection();
$PhraseTable = GetTablePrefix()."ImportPhrases";
$EventTable = GetTablePrefix()."ImportEvents";
$ado->Execute("DROP TABLE IF EXISTS $PhraseTable");
$ado->Execute("DROP TABLE IF EXISTS $EventTable");*/
$Id = $_POST["lang"];
$objLanguages->SetPrimary($Id);
- $state="postconfig_1";
+ if (defined('DBG_FAST_INSTALL')) {
+ $state = 'theme_sel';
+ }
+ else {
+ $state="postconfig_1";
+ }
}
if($state=="lang_default")
{
$Packs = Array();
$objLanguages->Clear();
$objLanguages->LoadAllLanguages();
foreach($objLanguages->Items as $l)
{
$Packs[$l->Get("LanguageId")] = $l->Get("PackName");
}
$include_file = $pathtoroot.$admin."/install/lang_default.php";
}
if($state=="modinstall")
{
$doms = $_POST["domain"];
if(is_array($doms))
{
$ado =& inst_GetADODBConnection();
require_once $pathtoroot.'kernel/include/tag-class.php';
if( !isset($objTagList) || !is_object($objTagList) ) $objTagList = new clsTagList();
foreach($doms as $p)
{
$filename = $pathtoroot.$p.'/admin/install.php';
if(file_exists($filename) )
{
include($filename);
}
}
}
/* $sql = "SELECT Name FROM ".GetTablePrefix()."Modules";
$rs = $ado->Execute($sql);
while($rs && !$rs->EOF)
{
$p = $rs->fields['Name'];
$mod_name = strtolower($p);
if ($mod_name == 'in-portal') {
$mod_name = '';
}
$dir_name = $pathtoroot.$mod_name."/admin/install/upgrades/";
$dir = @dir($dir_name);
$new_version = '';
$tmp1 = 0;
$tmp2 = 0;
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file))
{
$file = str_replace("inportal_upgrade_v", "", $file);
$file = str_replace(".sql", "", $file);
if ($file != '' && !strstr($file, 'changelog') && !strstr($file, 'readme')) {
$tmp1 = str_replace(".", "", $file);
if ($tmp1 > $tmp2) {
$new_version = $file;
}
}
}
$tmp2 = $tmp1;
}
$version_nrs = explode(".", $new_version);
for ($i = 0; $i < $version_nrs[0] + 1; $i++) {
for ($j = 0; $j < $version_nrs[1] + 1; $j++) {
for ($k = 0; $k < $version_nrs[2] + 1; $k++) {
$try_version = "$i.$j.$k";
$filename = $pathtoroot.$mod_name."/admin/install/upgrades/inportal_upgrade_v$try_version.sql";
if(file_exists($filename))
{
RunSQLFile($ado, $filename);
set_ini_value("Module Versions", $p, $try_version);
save_values();
}
}
}
}
$rs->MoveNext();
}
*/
$state="lang_select";
}
if($state=="modselect")
{
/* /admin/install.php */
$UrlLen = (strlen($admin) + 12)*-1;
$pathguess =substr($_SERVER["SCRIPT_NAME"],0,$UrlLen);
$sitepath = $pathguess;
$esc_path = str_replace("\\","/",$pathtoroot);
$esc_path = str_replace("/","\\",$esc_path);
//set_ini_value("Site","DomainName",$_SERVER["HTTP_HOST"]);
//$g_DomainName= $_SERVER["HTTP_HOST"];
save_values();
$ado =& inst_GetADODBConnection();
if(substr($sitepath,0,1)!="/")
$sitepath="/".$sitepath;
if(substr($sitepath,-1)!="/")
$sitepath .= "/";
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$sitepath' WHERE VariableName='Site_Path'";
$ado->Execute($sql);
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$g_Domain' WHERE VariableName='Server_Name'";
$ado->Execute($sql);
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '".$_SERVER['DOCUMENT_ROOT'].$sitepath."admin/backupdata' WHERE VariableName='Backup_Path'";
$ado->Execute($sql);
$Modules = a48d819089308a9aeb447e7248b2587f();
if (count($Modules) > 0) {
$include_file = $pathtoroot.$admin."/install/modselect.php";
}
else {
$state = "lang_select";
$skip_step = true;
}
}
if($state=="lang_select")
{
$Packs = GetLanguageList();
$include_file = $pathtoroot.$admin."/install/lang_select.php";
}
if(substr($state,0,10)=="postconfig")
{
$p = explode("_",$state);
$step = $p[1];
if ($_POST['Site_Path'] != '') {
$sql = "SELECT Name, Version FROM ".$g_TablePrefix."Modules";
$rs = $ado->Execute($sql);
$modules_str = '';
while ($rs && !$rs->EOF) {
$modules_str .= $rs->fields['Name'].' ('.$rs->fields['Version'].'),';
$rs->MoveNext();
}
$modules_str = substr($modules_str, 0, strlen($modules_str) - 1);
$rfile = @fopen(GET_LICENSE_URL."?url=".base64_encode($_SERVER['HTTP_HOST'].$_POST['Site_Path'])."&modules=".base64_encode($modules_str)."&license_code=".base64_encode($g_LicenseCode)."&version=".GetMaxPortalVersion($pathtoroot.$admin)."&domain=".md5($_SERVER['HTTP_HOST']), "r");
if (!$rfile) {
//$get_license_error = "Unable to connect to the Intechnic server! Please try again later!";
//$state = "postconfig_1";
//$include_file = $pathtoroot.$admin."/install/postconfig.php";
}
else {
$rcontents = '';
while (!feof($rfile)) {
$line = fgets($rfile, 10000);
$rcontents .= $line;
}
@fclose($rfile);
}
}
if(strlen($_POST["oldstate"])>0)
{
$s = explode("_",$_POST["oldstate"]);
$oldstep = $s[1];
if($oldstep<count($configs))
{
$section = $configs[$oldstep];
$module = $mods[$oldstep];
$title = $titles[$oldstep];
$objAdmin = new clsConfigAdmin($module,$section,TRUE);
$objAdmin->SaveItems($_POST,TRUE);
}
}
$section = $configs[$step];
$module = $mods[$step];
$title = $titles[$step];
$step++;
if($step <= count($configs)+1)
{
$include_file = $pathtoroot.$admin."/install/postconfig.php";
}
else
$state = "theme_sel";
}
if($state=="theme_sel")
{
$objThemes->CreateMissingThemes(true);
$include_file = $pathtoroot.$admin."/install/theme_select.php";
}
if($state=="theme_set")
{
## get & define Non-Blocking & Blocking versions ##
$blocking_sockets = minimum_php_version("4.3.0")? 0 : 1;
$ado =& inst_GetADODBConnection();
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$blocking_sockets' WHERE VariableName='SocketBlockingMode'";
$ado->Execute($sql);
## get & define Non-Blocking & Blocking versions ##
$theme_id = $_POST["theme"];
$pathchar="/";
//$objThemes->SetPrimaryTheme($theme_id);
$t = $objThemes->GetItem($theme_id);
$t->Set("Enabled",1);
$t->Set("PrimaryTheme",1);
$t->Update();
$t->VerifyTemplates();
$include_file = $pathtoroot.$admin."/install/install_finish.php";
$state="finish";
}
if ($state == "adm_login") {
echo "<script>window.location='index.php';</script>";
}
// init variables
$vars = Array('db_error','restore_error','PassError','DomainError','login_error','inst_error');
foreach($vars as $var_name) ReSetVar($var_name);
switch($state)
{
case "modselect":
$title = "Select Modules";
$help = "<p>Select the In-Portal modules you wish to install. The modules listed to the right ";
$help .="are all modules included in this installation that are licensed to run on this server. </p>";
break;
case "reinstall":
$title = "Installation Maintenance";
$help = "<p>A Configuration file has been detected on your system and it appears In-Portal is correctly installed. ";
$help .="In order to work with the maintenance functions provided to the left you must provide the Intechnic ";
$help .="Username and Password you used when obtaining the license file residing on the server, or your admin Root password. ";
$help .=" <i>(Use Username 'root' if using your root password)</i></p>";
$help .= "<p>To removing your existing database and start with a fresh installation, select the first option ";
$help .= "provided. Note that this operation cannot be undone and no backups are made! Use at your own risk.</p>";
$help .="<p>If you wish to scrap your current installation and install to a new location, choose the second option. ";
$help .="If this option is selected you will be prompted for new database configuration information.</p>";
$help .="<p>The <i>Update License Information</i> option is used to update your In-Portal license data. Select this option if you have ";
$help .="modified your licensing status with Intechnic, or you have received new license data via email</p>";
$help .="<p>The <i>Fix Paths</i> option should be used when the location of the In-portal files has changed. For example, if you moved them from one folder to another. It will update all settings and ensure the program is operational at the new location.</p>";
break;
case "fix_paths":
$title = "Fix Paths";
$help = "<p>The <i>Fix Paths</i> option should be used when the location of the In-portal files has changed. For example, if you moved them from one folder to another. It will update all settings and ensure the program is operational at the new location.<p>";
break;
case "RootPass":
$title = "Set Admin Root Password";
$help = "<p>The Root Password is initially required to access the admin sections of In-Portal. ";
$help .="The root user cannot be used to access the front-end of the system, so it is recommended that you ";
$help .="create additional users with admin privlidges.</p>";
break;
case "finish":
$title = "Thank You!";
$help ="<P>Thanks for using In-Portal! Be sure to visit <A TARGET=\"_new\" HREF=\"http://www.in-portal.net\">www.in-portal.net</A> ";
$help.=" for the latest news, module releases and support. </p>";
+ $help.="<p>*Make sure to clean your browser' cache after upgrading In-portal version</p>";
break;
case "license":
$title = "License Configuration";
$help ="<p>A License is required to run In-Portal on a server connected to the Internet. You ";
$help.="can run In-Portal on localhost, non-routable IP addresses, or other computers on your LAN. ";
$help.="If Intechnic has provided you with a license file, upload it here. Otherwise select the first ";
$help.="option to allow Install to download your license for you.</p>";
$help.="<p>If a valid license has been detected on your server, you can choose the <i>Use Existing License</i> ";
$help.="and continue the installation process</p>";
break;
case "domain_select":
$title="Select Licensed Domain";
$help ="<p>Select the domain you wish to configure In-Portal for. The <i>Other</i> option ";
$help.=" can be used to configure In-Portal for use on a local domain.</p>";
$help.="<p>For local domains, enter the hostname or LAN IP Address of the machine running In-Portal.</p>";
break;
case "db_reconfig":
case "dbinfo":
$title="Database Configuration";
$help = "<p>In-Portal needs to connect to your Database Server. Please provide the database server type*, ";
$help .="host name (<i>normally \"localhost\"</i>), Database user name, and database Password. ";
$help .="These fields are required to connect to the database.</p><p>If you would like In-Portal ";
$help .="to use a table prefix, enter it in the field provided. This prefix can be any ";
$help .=" text which can be used in the names of tables on your system. The characters entered in this field ";
$help .=" are placed <i>before</i> the names of the tables used by In-Portal. For example, if you enter \"inp_\"";
$help .=" into the prefix field, the table named Category will be named inp_Category.</p>";
break;
case "lang_select":
$title="Language Pack Installation";
$help = "<p>Select the language packs you wish to install. Each language pack contains all the phrases ";
$help .="used by the In-Portal administration and the default template set. Note that at least one ";
$help .="pack <b>must</b> be installed.</p>";
break;
case "lang_default":
$title="Select Default Language";
$help = "<p>Select which language should be considered the \"default\" language. This is the language ";
$help .="used by In-Portal when a language has not been selected by the user. This selection is applicable ";
$help .="to both the administration and front-end.</p>";
break;
case "lang_install":
$title="Installing Language Packs";
$help = "<p>The language packs you have selected are being installed. You may install more languages at a ";
$help.="later time from the Regional admin section.</p>";
break;
case "postconfig_1":
$help = "<P>These options define the general operation of In-Portal. Items listed here are ";
$help .="required for In-Portal's operation.</p><p>When you have finished, click <i>save</i> to continue.</p>";
break;
case "postconfig_2":
$help = "<P>User Management configuration options determine how In-Portal manages your user base.</p>";
$help .="<p>The groups listed to the right are pre-defined by the installation process and may be changed ";
$help .="through the Groups section of admin.</p>";
break;
case "postconfig_3":
$help = "<P>The options listed here are used to control the category list display functions of In-Portal. </p>";
break;
case "theme_sel":
$title="Select Default Theme";
$help = "<P>This theme will be used whenever a front-end session is started. ";
$help .="If you intend to upload a new theme and use that as default, you can do so through the ";
$help .="admin at a later date. A default theme is required for session management.</p>";
break;
case "get_license":
$title="Download License from Intechnic";
$help ="<p>A License is required to run In-Portal on a server connected to the Internet. You ";
$help.="can run In-Portal on localhost, non-routable IP addresses, or other computers on your LAN.</p>";
$help.="<p>Here as you have selected download license from Intechnic you have to input your username and ";
$help.="password of your In-Business account in order to download all your available licenses.</p>";
break;
case "download_license":
$title="Download License from Intechnic";
$help ="<p>A License is required to run In-Portal on a server connected to the Internet. You ";
$help.="can run In-Portal on localhost, non-routable IP addresses, or other computers on your LAN.</p>";
$help.="<p>Please choose the license from the drop down for this site! </p> ";
break;
case "restore_select":
$title="Select Restore File";
$help = "<P>Select the restore file to use to reinstall In-Portal. If your backups are not performed ";
$help .= "in the default location, you can enter the location of the backup directory and click the ";
$help .="<i>Update</i> button.</p>";
case "restore_run":
$title= "Restore in Progress";
$help = "<P>Restoration of your system is in progress. When the restore has completed, the installation ";
$help .="will continue as normal. Hitting the <i>Cancel</i> button will restart the entire installation process. ";
break;
case "warning":
$title = "Restore in Progress";
$help = "<p>Please approve that you understand that you are restoring your In-Portal data base from other version of In-Portal.</p>";
break;
case "update":
$title = "Update In-Portal";
$help = "<p>Select modules from the list, you need to update to the last downloaded version of In-Portal</p>";
break;
}
$tmp_step = GetVar('next_step', true);
if (!$tmp_step) {
$tmp_step = 1;
}
if ( isset($got_license) && $got_license == 1) {
$tmp_step++;
}
$next_step = $tmp_step + 1;
if ($general_error != '') {
$state = '';
$title = '';
$help = '';
$general_error = $general_error.'<br /><br />Installation cannot continue!';
}
if ($include_file == '' && $general_error == '' && $state == '') {
$state = '';
$title = '';
$help = '';
$filename = $pathtoroot.$admin."/install/inportal_remove.sql";
RunSQLFile($ado,$filename);
$general_error = 'Unexpected installation error! <br /><br />Installation has been stopped!';
}
if ($restore_error != '') {
$next_step = 3;
$tmp_step = 2;
}
if ($PassError != '') {
$tmp_step = 4;
$next_step = 5;
}
if ($DomainError != '') {
$tmp_step--;
$next_step = $tmp_step + 1;
}
if ($db_error != '') {
$tmp_step--;
$next_step = $tmp_step + 1;
}
if ($state == "warning") {
$tmp_step--;
$next_step = $tmp_step + 1;
}
if ($skip_step) {
$tmp_step++;
$next_step = $tmp_step + 1;
}
?>
<tr height="100%">
<td valign="top">
<table cellpadding=10 cellspacing=0 border=0 width="100%" height="100%">
<tr valign="top">
<td style="width: 200px; background: #009ff0 url(images/bg_install_menu.gif) no-repeat bottom right; border-right: 1px solid #000">
<img src="images/spacer.gif" width="180" height="1" border="0" title=""><br>
<span class="admintitle-white">Installation</span>
<!--<ol class="install">
<li class="current">Licence Verification
<li>Configuration
<li>File Permissions
<li>Security
<li>Integrity Check
</ol>
</td>-->
<?php
$lic_opt = isset($_POST['lic_opt']) ? $_POST['lic_opt'] : false;
if ($general_error == '') {
?>
<?php if ($install_type == 1) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1) { ?>class="current"<?php } ?>>Database Configuration
<li <?php if ($tmp_step == 2 || $lic_opt == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 3 && $lic_opt != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 4 ) { ?>class="current"<?php } ?>>Set Root Password
<li <?php if ($tmp_step == 5) { ?>class="current"<?php } ?>>Select Modules to Install
<li <?php if ($tmp_step == 6) { ?>class="current"<?php } ?>>Install Language Packs
<li <?php if ($tmp_step == 7) { ?>class="current"<?php } ?>>Post-Install Configuration
<li <?php if ($tmp_step == 8) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 2) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<!--<li <?php if (($tmp_step == 2 && $login_error == '' && $inst_error == '') || $_POST['lic_opt'] == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 3 && $_POST['lic_opt'] != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 4) { ?>class="current"<?php } ?>>Set Root Password
<li <?php if ($tmp_step == 5) { ?>class="current"<?php } ?>>Select Modules to Install
<li <?php if ($tmp_step == 6) { ?>class="current"<?php } ?>>Install Language Packs
<li <?php if ($tmp_step == 7) { ?>class="current"<?php } ?>>Post-Install Configuration
<li <?php if ($tmp_step == 8) { ?>class="current"<?php } ?>>Finish-->
</ol>
<?php } else if ($install_type == 3) { ?>
<ol class="install">
<li>License Verification
<li <?php if ($tmp_step == 2) { ?>class="current"<?php } ?>>Database Configuration
<li <?php if ($tmp_step == 3 || $_POST['lic_opt'] == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 4 && $_POST['lic_opt'] != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 5) { ?>class="current"<?php } ?>>Set Root Password
<li <?php if ($tmp_step == 6) { ?>class="current"<?php } ?>>Select Modules to Install
<li <?php if ($tmp_step == 7) { ?>class="current"<?php } ?>>Install Language Packs
<li <?php if ($tmp_step == 8) { ?>class="current"<?php } ?>>Post-Install Configuration
<li <?php if ($tmp_step == 9) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 4) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if (($tmp_step == 2 && $login_error == '' && $inst_error == '') || $lic_opt == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 3 && $_POST['lic_opt'] != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 4) { ?>class="current"<?php } ?>>Set Root Password
<li <?php if ($tmp_step == 5) { ?>class="current"<?php } ?>>Select Modules to Install
<li <?php if ($tmp_step == 6) { ?>class="current"<?php } ?>>Install Language Packs
<li <?php if ($tmp_step == 7) { ?>class="current"<?php } ?>>Post-Install Configuration
<li <?php if ($tmp_step == 8) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 5) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if (($tmp_step == 2 && $login_error == '' && $inst_error == '') || $lic_opt == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 3 && $lic_opt != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 4) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 6) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if (($tmp_step == 2 && $login_error == '' && $inst_error == '') || $_GET['show_prev'] == 1 || $_POST['backupdir']) { ?>class="current"<?php } ?>>Select Backup File
<li <?php if ($tmp_step == 3 && $_POST['lic_opt'] != 1 && $_GET['show_prev'] != 1 && !$_POST['backupdir']) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 7) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if ($tmp_step == 2 && $login_error == '' && $inst_error == '') { ?>class="current"<?php } ?>>Database Configuration
<li <?php if ($tmp_step == 3) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 8) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if ($tmp_step == 2 && $login_error == '' && $inst_error == '') { ?>class="current"<?php } ?>>Select Modules to Upgrade
<li <?php if ($tmp_step == 3) { ?>class="current"<?php } ?>>Language Pack Upgrade
<li <?php if ($tmp_step == 4) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 9) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if ($tmp_step == 2 && $login_error == '' && $inst_error == '') { ?>class="current"<?php } ?>>Fix Paths
<li <?php if ($tmp_step == 3) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } ?>
<?php include($include_file); ?>
<?php } else { ?>
<?php include("install/general_error.php"); ?>
<?php } ?>
<td width="40%" style="border-left: 1px solid #000; background: #f0f0f0">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td class="subsectiontitle" style="border-bottom: 1px solid #000000; background-color:#999"><?php if( isset($title) ) echo $title;?></td>
</tr>
<tr>
<td class="text"><?php if( isset($help) ) echo $help;?></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="footer">
Powered by In-portal &copy; 1997-2006, Intechnic Corporation. All rights reserved.
<br><img src="images/spacer.gif" width="1" height="10" title="">
</td>
</tr>
</table>
</form>
</body>
</html>
\ No newline at end of file
Property changes on: trunk/admin/install.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.107
\ No newline at end of property
+1.108
\ No newline at end of property
Index: trunk/admin/install/install_lib.php
===================================================================
--- trunk/admin/install/install_lib.php (revision 6427)
+++ trunk/admin/install/install_lib.php (revision 6428)
@@ -1,1077 +1,1076 @@
<?php
function minimum_php_version( $vercheck )
{
$minver = explode(".", $vercheck);
$curver = explode(".", phpversion());
if (($curver[0] < $minver[0])
|| (($curver[0] == $minver[0])
&& ($curver[1] < $minver[1]))
|| (($curver[0] == $minver[0]) && ($curver[1] == $minver[1])
&& ($curver[2][0] < $minver[2][0])))
return false;
else
return true;
}
function VersionSort($a, $b)
{
if( preg_match('/inportal_upgrade_v(.*).(php|sql)$/', $a, $rets) )
{
$a_version = $rets[1];
$a_extension = $rets[2];
}
if( preg_match('/inportal_upgrade_v(.*).(php|sql)$/', $b, $rets) )
{
$b_version = $rets[1];
$b_extension = $rets[2];
}
if( !isset($a_version) || !isset($b_version) ) return 0; // not php or sql file
if($a_version == $b_version) // got PHP and SQL file for one version
{
if($a_extension == $b_extension)
{
return 0;
}
else
{
return ($a_extension == 'php') ? 1 : -1; // this makes .php extension go AFTER .sql in the sorting
}
}
else
{
return (ConvertVersion($a_version) < ConvertVersion($b_version)) ? -1 : 1;
}
}
function GetMaxPortalVersion($admindirname)
{
$dir = @dir($admindirname.'/install/upgrades');
if (!$dir) return '';
$upgrades_arr = Array();
$version = '';
while($file = $dir->read())
{
if ($file != "." && $file != ".." && !is_dir($admindirname.$file))
{
if (strstr($file, 'inportal_upgrade_v')) $upgrades_arr[] = $file;
}
}
usort($upgrades_arr, "VersionSort");
foreach($upgrades_arr as $file)
{
if( preg_match('/inportal_upgrade_v(.*).(php|sql)$/', $file, $rets) )
{
$a_version = $rets[1];
if (ConvertVersion($a_version) > ConvertVersion($version)) {
$version = $a_version;
}
}
}
return $version;
}
function ConvertVersion($version)
{
$parts = explode('.', $version);
$bin = '';
foreach ($parts as $part) {
$bin .= str_pad(decbin($part), 8, '0', STR_PAD_LEFT);
}
$dec = bindec($bin);
return $dec;
}
function TableExists(&$ado, $tables)
{
global $g_TablePrefix;
$t = explode(",",$tables);
$i = $ado->MetaTables();
for($x=0;$x<count($i);$x++)
$i[$x] = strtolower($i[$x]);
$AllFound = TRUE;
for($tIndex=0;$tIndex<count($t);$tIndex++)
{
$table = $g_TablePrefix.$t[$tIndex];
$table = strtolower($table);
if(!in_array($table,$i))
{
$AllFound = FALSE;
}
}
return $AllFound;
}
function set_ini_value($section, $key, $newvalue)
{
global $ini_vars;
$ini_vars[$section][$key] = $newvalue;
}
function save_values()
{
// Should write something to somwere, but it doesn't :(
global $ini_file,$ini_vars;
//if( file_exists($ini_file) )
//{
$fp = fopen($ini_file, "w");
fwrite($fp,'<'.'?'.'php die() ?'.">\n\n");
foreach($ini_vars as $secname => $section)
{
fwrite($fp,"[".$secname."]\n");
foreach($section as $key => $value) fwrite($fp,"$key = \"$value\"\n");
fwrite($fp,"\n");
}
fclose($fp);
//}
}
function getConnectionInterface($action, $dbo_type='adodb')
{
if($dbo_type == 'adodb')
{
switch($action)
{
case 'query': return 'Execute'; break;
case 'errorno': return 'ErrorNo'; break;
case 'errormsg': return 'ErrorMsg'; break;
}
}
if($dbo_type == 'dbconnection')
{
switch($action)
{
case 'query': return 'Query'; break;
case 'errorno': return 'getErrorCode'; break;
case 'errormsg': return 'getErrorMsg'; break;
}
}
}
function RunSchemaFile(&$ado, $filename, $dbo_type='adodb')
{
if( file_exists($filename) )
{
$sql = file_get_contents($filename);
if($sql) RunSchemaText($ado,$sql,$dbo_type);
}
}
function RunSchemaText(&$ado, $sql, $dbo_type='adodb')
{
global $g_TablePrefix;
if(strlen($g_TablePrefix))
{
$what = "CREATE TABLE ";
$replace = "CREATE TABLE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "DROP TABLE ";
$replace = "DROP TABLE IF EXISTS ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "INSERT INTO ";
$replace = "INSERT INTO ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "UPDATE ";
$replace = "UPDATE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "ALTER TABLE ";
$replace = "ALTER TABLE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
}
$commands = explode("# --------------------------------------------------------",$sql);
if(count($commands)>0)
{
$query_func = getConnectionInterface('query',$dbo_type);
$errorno_func = getConnectionInterface('errorno',$dbo_type);
$errormsg_func = getConnectionInterface('errormsg',$dbo_type);
for($i = 0; $i < count($commands); $i++)
{
$cmd = $commands[$i];
$cmd = trim($cmd);
if(strlen($cmd)>0)
{
$ado->$query_func($cmd);
if($ado->$errorno_func() != 0)
{
$db_error = $ado->$errormsg_func()." COMMAND:<PRE>$cmd</PRE>";
}
}
}
}
}
function RunSQLText(&$ado, $allsql, $dbo_type='adodb')
{
global $g_TablePrefix;
$line = 0;
$query_func = getConnectionInterface('query',$dbo_type);
$errorno_func = getConnectionInterface('errorno',$dbo_type);
$errormsg_func = getConnectionInterface('errormsg',$dbo_type);
while($line<count($allsql))
{
$sql = $allsql[$line];
if(strlen(trim($sql))>0 && substr($sql,0,1)!="#")
{
if(strlen($g_TablePrefix))
{
$what = "CREATE TABLE ";
$replace = "CREATE TABLE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "DELETE FROM ";
$replace = "DELETE FROM ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "DROP TABLE ";
$replace = "DROP TABLE IF EXISTS ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "DROP TABLE IF EXISTS ";
$replace = "DROP TABLE IF EXISTS ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "INSERT INTO ";
$replace = "INSERT INTO ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "UPDATE ";
$replace = "UPDATE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "ALTER TABLE ";
$replace = "ALTER TABLE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
}
$sql = trim($sql);
if(strlen($sql)>0)
{
$ado->$query_func($sql);
if($ado->$errorno_func()!=0)
{
$db_error = $ado->$errormsg_func()." COMMAND:<PRE>$sql</PRE>";
$error = TRUE;
}
}
}
$line++;
}
}
function RunSQLFile(&$ado, $filename, $dbo_type='adodb')
{
if(file_exists($filename))
{
$allsql = file($filename);
RunSQLText($ado,$allsql,$dbo_type);
}
}
function RunRestoreFile($ado,$filename,$FileOffset,$MaxLines)
{
$size = filesize($filename);
if($FileOffset > $size)
return -2;
$fp = fopen($filename,"r");
if(!$fp)
return -1;
if($FileOffset>0)
{
fseek($fp,$FileOffset);
}
else
{
$EndOfSQL = FALSE;
$sql = "";
while(!feof($fp) && !$EndOfSQL)
{
$l = fgets($fp,16384);
if(substr($l,0,11)=="INSERT INTO")
{
$EndOfSQL = TRUE;
}
else
{
$sql .= $l;
$FileOffset = ftell($fp) - strlen($l);
}
}
if(strlen($sql))
{
RunSchemaText($ado,$sql);
}
fseek($fp,$FileOffset);
}
$LinesRead = 0;
$sql = "";
$AllSql = array();
while($LinesRead < $MaxLines && !feof($fp))
{
$sql = fgets($fp, 16384);
if(strlen($sql))
{
$AllSql[] = $sql;
$LinesRead++;
}
}
if(!feof($fp))
{
$FileOffset = ftell($fp);
}
else
{
$FileOffset = $TotalSize;
}
fclose($fp);
if(count($AllSql)>0)
RunSQLText($ado,$AllSql);
return (int)$FileOffset;
}
function _inst_keyED($txt,$encrypt_key)
{
$encrypt_key = md5($encrypt_key);
$ctr=0;
$tmp = "";
for ($i=0;$i<strlen($txt);$i++)
{
if ($ctr==strlen($encrypt_key)) $ctr=0;
$tmp.= substr($txt,$i,1) ^ substr($encrypt_key,$ctr,1);
$ctr++;
}
return $tmp;
}
function _inst_decrypt($txt,$key)
{
$txt = _inst_keyED($txt,$key);
$tmp = "";
for ($i=0;$i<strlen($txt);$i++)
{
$md5 = substr($txt,$i,1);
$i++;
$tmp.= (substr($txt,$i,1) ^ $md5);
}
return $tmp;
}
function inst_LoadFromRemote()
{
return "";
}
function mod_DLid()
{
global $DownloadId;
echo $DownloadId."\n";
die();
}
function ae666b1b8279502f4c4b570f133d513e($LoadRemote=FALSE,$file="")
{
return _inst_LoadLicense($LoadRemote,$file);
}
function _inst_LoadLicense($LoadRemote=FALSE,$file="")
{
global $path,$admin;
$data = Array();
if(!strlen($file))
{
$f = $path.$admin."/include/inportal.dat";
}
else
$f = $file;
if(file_exists($f))
{
$contents = file($f);
$data[0] = base64_decode($contents[1]);
$data[1] = $contents[2];
}
else
if($LoadRemote)
return $LoadFromRemote;
return $data;
}
function inst_SaveLicense($data)
{
}
function _inst_VerifyKey($domain,$k)
{
$key = md5($domain);
$lkey = substr($key,0,strlen($key)/2);
$rkey = substr($key,strlen($key)/2);
$r = $rkey.$lkey;
if($k==$r)
return TRUE;
return FALSE;
}
function a83570933e44bc66b31dd7127cf3f23a($txt)
{
return _inst_ParseLicense($txt);
}
function _inst_ParseLicense($txt)
{
global $i_User, $i_Pswd, $i_Keys;
$data = _inst_decrypt($txt,"beagle");
$i_Keys = array();
$lines = explode("\n",$data);
for($x=0;$x<count($lines);$x++)
{
$l = $lines[$x];
$p = explode("=",$l,2);
switch($p[0])
{
case "Username":
$i_User = $p[1];
break;
case "UserPass":
$i_Pswd = $p[1];
break;
default:
if(substr($p[0],0,3)=="key")
{
$parts = explode("|",$p[1]);
if(_inst_VerifyKey($parts[0],$parts[1]))
{
unset($K);
$k["domain"]=$parts[0];
$k["key"]=$parts[1];
$k["desc"]=$parts[2];
$k["mod"]=$parts[3];
$i_Keys[] = $k;
}
}
break;
}
}
}
function de3ec1b7a142cccd0d51f03d24280744($domain)
{
_inst_falseIsLocalSite($domain);
return _inst_IsLocalSite($domain);
}
function _inst_GetObscureValue($i)
{
$z = null;
if ($i == 'x') return 0254;
if ($i == 'z') return 0x7F.'.';
if ($i >= 5 && $i < 7) return _inst_GetObscureValue($z)*_inst_GetObscureValue('e');
if ($i > 30) return Array(0x6c,0x6f,0x63,0x61,0x6c,0x68,0x6f,0x73,0x74);
if ($i > 20) return 99;
if ($i > 10) return '.'.(_inst_GetObscureValue(6.5)+1);
if ($i == 'a') return 0xa;
}
function _inst_Chr($val)
{
$x = _inst_GetObscureValue(25);
$f = chr($x).chr($x+5).chr($x+15);
return $f($val);
}
function _inst_IsLocalSite($domain)
{
$yy = '';
$ee = _inst_GetObscureValue(35);
foreach ($ee as $e) {
$yy .= _inst_Chr($e);
}
$localb = FALSE;
if(substr($domain,0,3)==_inst_GetObscureValue('x'))
{
$b = substr($domain,0,6);
$p = explode(".",$domain);
$subnet = $p[1];
if($p[1]>15 && $p[1]<32)
$localb=TRUE;
}
$zz = _inst_GetObscureValue('z')._inst_GetObscureValue(5).'.'.(int)_inst_GetObscureValue(7)._inst_GetObscureValue(12);
$ff = _inst_GetObscureValue('z')+65;
$hh = $ff-0x18;
if($domain==$yy || $domain==$zz || substr($domain,0,7)==$ff._inst_Chr(46).$hh ||
substr($domain,0,3)==_inst_GetObscureValue('a')._inst_Chr(46) || $localb || strpos($domain,".")==0)
{
return TRUE;
}
return FALSE;
}
function _inst_falseIsLocalSite($domain)
{
$localb = FALSE;
if(substr($domain,0,3)=="172" || $domain == '##code##')
{
$b = substr($domain,0,6);
$p = explode(".",$domain);
$subnet = $p[1];
if($p[1]>15 && $p[1]<32)
$localb=TRUE;
}
if($domain=="localhost" || $domain=="127.0.0.1" || substr($domain,0,7)=="192.168" ||
substr($domain,0,3)=="10." || $localb || strpos($domain,".")==0)
{
return TRUE;
}
return FALSE;
}
function ed592fe427e1ce60e32ffcb0c82d8557($name)
{
return _inst_ModuleLicensed($name);
}
function _inst_ModuleLicensed($name)
{
global $i_Keys, $objConfig, $g_License, $g_Domain;
$lic = base64_decode($g_License);
_inst_ParseLicense($lic);
$modules = array();
if(!_inst_IsLocalSite($g_Domain))
{
for($x=0;$x<count($i_Keys);$x++)
{
$key = $i_Keys[$x];
if (strlen(stristr($g_Domain,$key["domain"])))
{
$modules = explode(",",strtolower($key["mod"]));
}
}
if(in_array(strtolower($name),$modules))
{
return TRUE;
}
else
{
return FALSE;
}
}
else
return TRUE;
return FALSE;
}
function inst_parse_portal_ini($file, $parse_section = false) {
if(!file_exists($file) && !is_readable($file))
die("Could Not Open Ini File $file");
$contents = file($file);
$retval = array();
$section = '';
$ln = 1;
$resave = false;
foreach($contents as $line) {
if ($ln == 1 && $line != '<'.'?'.'php die() ?'.">\n") {
$resave = true;
}
$ln++;
$line = trim($line);
$line = eregi_replace(';[.]*','',$line);
if(strlen($line) > 0) {
if(eregi('^[[a-z]+]$',str_replace(' ', '', $line))) {
$section = substr($line,1,(strlen($line)-2));
if ($parse_section) {
$retval[$section] = array();
}
continue;
} elseif(eregi('=',$line)) {
list($key,$val) = explode(' = ',$line);
if (!$parse_section) {
$retval[trim($key)] = str_replace('"', '', $val);
}
else {
$retval[$section][trim($key)] = str_replace('"', '', $val);
}
} //end if
} //end if
} //end foreach
if ($resave) {
$fp = fopen($file, "w");
reset($contents);
fwrite($fp,'<'.'?'.'php die() ?'.">\n\n");
foreach($contents as $line) fwrite($fp,"$line");
fclose($fp);
}
return $retval;
}
function a48d819089308a9aeb447e7248b2587f()
{
return _inst_GetModuleList();
}
function _inst_GetModuleList()
{
global $rootpath,$pathchar,$admin, $pathtoroot;
$path = $pathtoroot;
$new = array();
if ($dir = @opendir($path))
{
while (($file = readdir($dir)) !== false)
{
if($file !="." && $file !=".." && substr($file,0,1)!="_")
{
if(is_dir($path."/".$file))
{
$ModuleAdminDir = $path.$file.'/admin/';
$inst_file = $ModuleAdminDir.'install.php';
if( file_exists($inst_file) && file_exists($ModuleAdminDir.'install/inportal_schema.sql') )
{
if(_inst_ModuleLicensed($file)) {
$new[$file] = $inst_file;
}
}
}
}
}
closedir($dir);
}
return array_keys($new);
}
function GetDirList ($dirName)
{
$filedates = array();
$d = dir($dirName);
while($entry = $d->read())
{
if ($entry != "." && $entry != "..")
{
if (!is_dir($dirName."/".$entry))
{
$filedate[]=$entry;
}
}
}
$d->close();
return $filedate;
}
function GetLanguageList()
{
global $pathtoroot, $admin;
$packs = array();
$dir = $pathtoroot.$admin."/install/langpacks";
$files = GetDirList($dir);
if(is_array($files))
{
foreach($files as $f)
{
$p = pathinfo($f);
if($p["extension"]=="lang")
{
$packs[] = $f;
}
}
}
return $packs;
}
function section_header($title, $return_result = false)
{
$ret = '<table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">'.
'<tr><td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;'.$title.'</span>'.
'</td><td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%">'.
"<a class=\"link\" onclick=\"ShowHelp('in-portal:install');\"><img src=\"images/blue_bar_help.gif\" border=\"0\"></A>".
'</td></tr></table>';
if( $return_result )
return $ret;
else
echo $ret;
}
function &VerifyDB($error_state, $next_state, $success_func = null, $db_must_exist = false)
{
// perform various check type to database specified
// 1. user is allowed to connect to database
// 2. user has all types of permissions in database
global $state, $db_error;
// enshure we use data from post & not from config
$GLOBALS['g_DBType'] = $_POST["ServerType"];
$GLOBALS['g_DBHost'] = $_POST["ServerHost"];
$GLOBALS['g_DBName'] = $_POST["ServerDB"];
$GLOBALS['g_DBUser'] = $_POST["ServerUser"];
$GLOBALS['g_DBUserPassword'] = $_POST["ServerPass"];
if (strlen($_POST['TablePrefix']) > 7) {
$db_error = 'Table prefix should not be longer than 7 characters';
$state = $error_state;
return false;
}
// connect to database
$ado =& inst_GetADODBConnection();
if($ado->ErrorNo() != 0)
{
// was error while connecting
$db_error = "Connection Error: (".$ado->ErrorNo().") ".$ado->ErrorMsg();
$state = $error_state;
}
elseif( $ado->ErrorNo() == 0 )
{
// if connected, then check if all sql statements work
$test_result = 1;
$sql_tests[] = 'DROP TABLE IF EXISTS test_table';
$sql_tests[] = 'CREATE TABLE test_table(test_col mediumint(6))';
$sql_tests[] = 'LOCK TABLES test_table WRITE';
$sql_tests[] = 'INSERT INTO test_table(test_col) VALUES (5)';
$sql_tests[] = 'UPDATE test_table SET test_col = 12';
$sql_tests[] = 'UNLOCK TABLES';
$sql_tests[] = 'ALTER TABLE test_table ADD COLUMN new_col varchar(10)';
$sql_tests[] = 'SELECT * FROM test_table';
$sql_tests[] = 'DELETE FROM test_table';
$sql_tests[] = 'DROP TABLE IF EXISTS test_table';
foreach($sql_tests as $sql_test)
{
$ado->Execute($sql_test);
if( $ado->ErrorNo()!=0 )
{
$test_result = 0;
break;
}
}
if($test_result == 1)
{
// if statements work & connection made, then check table existance
$db_exists = TableExists($ado,"ConfigurationAdmin,Category,Permissions");
if($db_exists != $db_must_exist)
{
$state = $error_state;
$db_error = $db_must_exist ? 'An In-Portal Database already exists at this location' : 'An In-Portal Database was not found at this location';
}
else
{
$state = $next_state;
if( isset($success_func) ) $success_func();
}
}
else
{
// user has insufficient permissions in database specified
$db_error = "Permission Error: (".$ado->ErrorNo().") ".$ado->ErrorMsg();
$state = $error_state;
}
}
return $ado;
}
function SaveDBConfig()
{
// save new database configuration
set_ini_value("Database", "DBType",$_POST["ServerType"]);
set_ini_value("Database", "DBHost",$_POST["ServerHost"]);
set_ini_value("Database", "DBName",$_POST["ServerDB"]);
set_ini_value("Database", "DBUser",$_POST["ServerUser"]);
set_ini_value("Database", "DBUserPassword",$_POST["ServerPass"]);
set_ini_value("Database","TablePrefix",$_POST["TablePrefix"]);
save_values();
$GLOBALS['include_file'] = 'install/install_finish.php';
}
function ReSetVar($var)
{
// define varible if not defined before
if( !isset($GLOBALS[$var]) ) $GLOBALS[$var] = '';
}
// if globals.php not yet included (1st steps of install),
// then define GetVar function
if( !function_exists('GetVar') )
{
function GetVar($name, $post_priority = false)
{
if(!$post_priority) // follow gpc_order in php.ini
return isset($_REQUEST[$name]) ? $_REQUEST[$name] : false;
else // get variable from post 1stly if not found then from get
return isset($_POST[$name]) && $_POST[$name] ? $_POST[$name] : ( isset($_GET[$name]) && $_GET[$name] ? $_GET[$name] : false );
}
}
function RadioChecked($name, $value)
{
// return " checked" word in case if radio is checked
$submit_value = GetVar($name);
return $submit_value == $value ? ' checked' : '';
}
function StripDisallowed($string, $item_info)
{
$not_allowed = Array( ' ', '\\', '/', ':', '*', '?', '"', '<', '>', '|',
'~', '!', '@', '#', '$', '%', '^', '&', '(', ')',
'+', '=', '-', '{', '}', ']', '[', "'", ';', '.', ',');
$string = str_replace($not_allowed, '_', $string);
$string = preg_replace('/(_+)/', '_', $string);
$string = checkAutoFilename($string, $item_info);
return $string;
}
function checkAutoFilename($filename, $item_info)
{
// 'table' => 'Category', 'id_field' => 'CategoryId', 'title_field' => 'Name'
$item_id = $item_info['item_id'];
$prefix = GetTablePrefix();
$db =& inst_GetADODBConnection();
$sql = 'SELECT '.$item_info['id_field'].' FROM '.$prefix.$item_info['table'].' WHERE Filename = '.$db->qstr($filename);
$found_item_id = $db->GetOne($sql);
$has_page = preg_match('/(.*)_([\d]+)([a-z]*)$/', $filename, $rets);
if( ($found_item_id != $item_id) || $has_page ) // other category has same filename as ours OR we have filename, that ends with _number
{
$append = $found_item_id ? 'a' : '';
if($has_page)
{
$filename = $rets[1].'_'.$rets[2];
$append = $rets[3] ? $rets[3] : 'a';
}
$sql = 'SELECT '.$item_info['id_field'].' FROM '.$prefix.$item_info['table'].' WHERE (Filename = %s) AND ('.$item_info['id_field'].' != '.$item_id.')';
while ( $db->GetOne( sprintf($sql, $db->qstr($filename.$append)) ) > 0 )
{
if (substr($append, -1) == 'z') $append .= 'a';
$append = substr($append, 0, strlen($append) - 1) . chr( ord( substr($append, -1) ) + 1 );
}
return $filename.$append;
}
return $filename;
}
/**
* [INSTALL] Perform operations required for each module separate install (from admin)
*
* @param string $module_name
* @param bool $has_theme
* @return bool
*/
function finalizeModuleInstall($module_name, $has_theme = true)
{
global $objThemes;
$app =& kApplication::Instance();
if (!$app->GetVar('redirect')) return false;
if ($has_theme)
{
$objThemes->CreateMissingThemes(true);
}
// 2. import languagepack in case of separate install
$lang_xml =& $app->recallObject('LangXML');
$lang_xml->tables['phrases'] = TABLE_PREFIX.'Phrase';
$lang_xml->tables['emailmessages'] = TABLE_PREFIX.'EmailMessage';
$lang_path = FULL_PATH.'/'.$module_name.'/admin/install/langpacks';
$lang_xml->Parse($lang_path.'/english.lang', '|0|1|2|', '');
- $app->Redirect('', Array('pass' => 'all', 'admin' => 1, 'Refresh' => 1), '', 'modules/mod_status.php');
-
+ $app->Redirect('modules/modules_list', Array('pass' => 'all', 'admin' => 1, 'RefreshTree' => 1), '', 'index.php');
}
/**
* [UPGRADE] Initializes [cached] category/item templates with default values for each module
*
* @param string $module
* @param string $category_template
* @param string $item_template
*/
function updateItemCategoryTemplate($module, $category_template, $item_template)
{
$table_prefix = GetTablePrefix();
$inst_ado =& inst_GetADODBConnection();
// get module root category by module name
$sql = 'SELECT RootCat
FROM '.$table_prefix.'Modules
WHERE Name = '.$inst_ado->qstr($module);
$module_root = $inst_ado->GetOne($sql);
// set category & item template to module root category
$sql = 'UPDATE '.$table_prefix.'Category
SET CategoryTemplate = '.$inst_ado->qstr($category_template).'
WHERE CategoryId = '.$module_root;
$inst_ado->Execute($sql);
// set cached category & item templates to all sub-categories of module root category
$sql = 'UPDATE '.$table_prefix.'Category
SET CachedCategoryTemplate = '.$inst_ado->qstr($category_template).'
WHERE ParentPath LIKE "|'.$module_root.'|%';
$inst_ado->Execute($sql);
}
/**
* [UPGRADE] Moves custom field values for prefix specified from CustomMetaData table to prefix dependant separate table
*
* @param string $prefix
*/
function convertCustomFields($prefix)
{
$application =& kApplication::Instance();
$ml_helper =& $application->recallObject('kMultiLanguageHelper');
$ml_helper->createFields($prefix.'-cdata', true);
$db =& $application->GetADODBConnection();
$custom_fields = $application->getUnitOption($prefix, 'CustomFields');
if (!$custom_fields) {
return true;
}
$custom_table = $application->getUnitOption($prefix.'-cdata', 'TableName');
// copy value from Value field to l<lang_id>_Value field, where destination field is empty
$m_lang = $application->GetVar('m_lang');
$sql = 'UPDATE '.TABLE_PREFIX.'CustomMetaData
SET l'.$m_lang.'_Value = Value
WHERE LENGTH(l'.$m_lang.'_Value) = 0';
$db->Query($sql);
$i = 1;
$field_mask = '';
$language_count = $ml_helper->getLanguageCount();
while ($i <= $language_count) {
$field_mask .= 'cdata%1$s.l'.$i.'_Value AS l'.$i.'_cust_%1$s, ';
$i++;
}
$field_mask = preg_replace('/(.*), $/', '\\1', $field_mask);
$join_mask = 'LEFT JOIN '.TABLE_PREFIX.'CustomMetaData cdata%1$s ON main_table.ResourceId = cdata%1$s.ResourceId AND cdata%1$s.CustomFieldId = %1$s';
$fields_sql = Array();
$joins_sql = Array();
foreach ($custom_fields as $custom_id => $custom_name) {
array_push($fields_sql, sprintf($field_mask, $custom_id) );
array_push($joins_sql, sprintf($join_mask, $custom_id));
}
$sql = 'INSERT INTO '.$custom_table.'
SELECT 0 AS CustomDataId, main_table.ResourceId, '.implode(', ', $fields_sql).'
FROM '.$application->getUnitOption($prefix, 'TableName').' main_table '.implode(' ', $joins_sql);
$db->Query($sql);
}
/**
* [INSTALL] Link custom field records with search config records + create custom field columns
*
* @param string $module_name
* @param int $item_type
*/
function linkCustomFields($module_name, $prefix, $item_type)
{
$application =& kApplication::Instance();
$db =& $application->GetADODBConnection();
$sql = 'SELECT FieldName, CustomFieldId
FROM '.TABLE_PREFIX.'CustomField
WHERE Type = '.$item_type.' AND IsSystem = 0'; // config is not read here yet :( $application->getUnitOption('p', 'ItemType');
$custom_fields = $db->GetCol($sql, 'CustomFieldId');
foreach ($custom_fields as $cf_id => $cf_name) {
$sql = 'UPDATE '.TABLE_PREFIX.'SearchConfig
SET CustomFieldId = '.$cf_id.'
WHERE (TableName = "CustomField") AND (LOWER(ModuleName) = "'.strtolower($module_name).'") AND (FieldName = '.$db->qstr($cf_name).')';
$db->Query($sql);
}
$application->refreshModuleInfo(); // this module configs are now processed
// because of configs was read only from installed before modules (in-portal), then reread configs
$unit_config_reader =& $application->recallObject('kUnitConfigReader');
$unit_config_reader->scanModules(MODULES_PATH.'/'.strtolower($module_name));
// create correct columns in ProductsCustomData table
$ml_helper =& $application->recallObject('kMultiLanguageHelper');
$ml_helper->createFields($prefix.'-cdata', true);
}
function moveItemTemplatesToCustom($module_name, $prefix)
{
$application =& kApplication::Instance();
$root_parent_path = $application->Conn->GetOne(
'SELECT ParentPath FROM '.TABLE_PREFIX.'Category
WHERE CategoryId = '.$application->ModuleInfo[$module_name]['RootCat']);
$item_t_customfield = $application->Conn->GetOne('SELECT CustomFieldId FROM '.TABLE_PREFIX.'CustomField WHERE FieldName = \''.$prefix.'_ItemTemplate\'');
$item_t_customfield = 'l1_cust_'.$item_t_customfield;
$current_item_tpls = $application->Conn->Query(
'SELECT ResourceId, ItemTemplate FROM '.TABLE_PREFIX.'Category
WHERE ParentPath LIKE "'.$root_parent_path.'%" AND ItemTemplate != "" AND ItemTemplate IS NOT NULL');
foreach ($current_item_tpls as $a_cat) {
$has_cdata = $application->Conn->GetOne(
'SELECT CustomDataId FROM '.TABLE_PREFIX.'CategoryCustomData
WHERE ResourceId = '.$a_cat['ResourceId']);
if (!$has_cdata) {
$query = 'INSERT INTO '.TABLE_PREFIX.'CategoryCustomData (ResourceId) VALUES ('.$a_cat['ResourceId'].')';
$application->Conn->Query($query);
}
$query = 'UPDATE '.TABLE_PREFIX.'CategoryCustomData
SET '.$item_t_customfield.' = '.$application->Conn->qstr($a_cat['ItemTemplate']).'
WHERE ResourceId = '.$a_cat['ResourceId'];
$application->Conn->Query($query);
}
}
?>
Property changes on: trunk/admin/install/install_lib.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.44
\ No newline at end of property
+1.45
\ No newline at end of property
Index: trunk/admin/install/upgrades/changelog_1_3_0.txt
===================================================================
--- trunk/admin/install/upgrades/changelog_1_3_0.txt (nonexistent)
+++ trunk/admin/install/upgrades/changelog_1_3_0.txt (revision 6428)
@@ -0,0 +1,82 @@
+File in-portal/index.php changed
+File in-portal/admin/advanced_view.php is removed; release_1_2_1 revision 1.25
+File in-portal/admin/browse.php is removed; release_1_2_1 revision 1.35
+File in-portal/admin/install.php changed
+File in-portal/admin/category/addcategory.php is removed; release_1_2_1 revision 1.20
+File in-portal/admin/category/addcategory_custom.php is removed; release_1_2_1 revision 1.14
+File in-portal/admin/category/addcategory_customfields.php is removed; release_1_2_1 revision 1.5
+File in-portal/admin/category/addcategory_images.php is removed; release_1_2_1 revision 1.9
+File in-portal/admin/category/addcategory_permissions.php is removed; release_1_2_1 revision 1.11
+File in-portal/admin/category/addcategory_relations.php is removed; release_1_2_1 revision 1.8
+File in-portal/admin/category/addimage.php is removed; release_1_2_1 revision 1.9
+File in-portal/admin/category/addpermission.php is removed; release_1_2_1 revision 1.9
+File in-portal/admin/category/addpermission_modules.php is removed; release_1_2_1 revision 1.10
+File in-portal/admin/category/addrelation.php is removed; release_1_2_1 revision 1.8
+File in-portal/admin/category/category_items.php is removed; release_1_2_1 revision 1.4
+File in-portal/admin/category/category_maint.php is removed; release_1_2_1 revision 1.23.32.1
+File in-portal/admin/category/permcacheupdate.php is removed; release_1_2_1 revision 1.10
+File in-portal/admin/category/images/ddarrow.gif is removed; release_1_2_1 revision 1.1
+File in-portal/admin/category/images/ddarrow_active.gif is removed; release_1_2_1 revision 1.1
+File in-portal/admin/category/images/ddarrow_over.gif is removed; release_1_2_1 revision 1.1
+File in-portal/admin/category/js/core.js is removed; release_1_2_1 revision 1.1
+File in-portal/admin/category/js/lang.js is removed; release_1_2_1 revision 1.1
+File in-portal/admin/category/js/main.js is removed; release_1_2_1 revision 1.1
+File in-portal/admin/help/manual.pdf changed
+File in-portal/admin/install/inportal_data.sql changed
+File in-portal/admin/install/inportal_remove.sql changed
+File in-portal/admin/install/install_lib.php changed
+File in-portal/admin/install/langpacks/english.lang changed
+File in-portal/admin/install/upgrades/changelog_1_3_0.txt is new; release_1_3_0 revision 1.1.2.12
+File in-portal/admin/install/upgrades/inportal_upgrade_v1.3.0.sql is new; release_1_3_0 revision 1.1.2.1
+File in-portal/admin/install/upgrades/readme_1_3_0.txt is new; release_1_3_0 revision 1.1.2.2
+File in-portal/kernel/parser.php changed
+File in-portal/kernel/admin/advanced_view.php is removed; release_1_2_1 revision 1.4
+File in-portal/kernel/admin/include/toolbar/advanced_view.php is removed; release_1_2_1 revision 1.11.2.1
+File in-portal/kernel/admin/include/toolbar/browse.php is removed; release_1_2_1 revision 1.17.2.1
+File in-portal/kernel/admin/include/toolbar/editcategory_permissions.php is removed; release_1_2_1 revision 1.1
+File in-portal/kernel/admin/include/toolbar/editcategory_relations.php is removed; release_1_2_1 revision 1.2
+File in-portal/kernel/admin/include/toolbar/editcategory_relationselect.php is removed; release_1_2_1 revision 1.6.2.1
+File in-portal/kernel/admin/include/toolbar/editgroup_permissions.php is removed; release_1_2_1 revision 1.1
+File in-portal/kernel/admin/include/toolbar/editgroup_users.php is removed; release_1_2_1 revision 1.1
+File in-portal/kernel/admin_templates/incs/config_blocks.tpl changed
+File in-portal/kernel/admin_templates/incs/form_blocks.tpl changed
+File in-portal/kernel/admin_templates/incs/grid_blocks.tpl changed
+File in-portal/kernel/admin_templates/incs/script.js changed
+File in-portal/kernel/admin_templates/regional/phrases_edit.tpl changed
+File in-portal/kernel/admin_templates/tools/system_tools.tpl changed
+File in-portal/kernel/include/emailmessage.php changed
+File in-portal/kernel/include/image.php changed
+File in-portal/kernel/include/modules.php changed
+File in-portal/kernel/units/admin/admin_config.php changed
+File in-portal/kernel/units/categories/categories_tag_processor.php changed
+File in-portal/kernel/units/configuration/configuration_event_handler.php changed
+File in-portal/kernel/units/email_events/email_events_event_handler.php changed
+File in-portal/kernel/units/general/cat_event_handler.php changed
+File in-portal/kernel/units/general/cat_tag_processor.php changed
+File in-portal/kernel/units/general/inp_ses_storage.php changed
+File in-portal/kernel/units/general/main_event_handler.php changed
+File in-portal/kernel/units/general/helpers/mod_rewrite_helper.php changed
+File in-portal/kernel/units/general/helpers/permissions_helper.php changed
+File in-portal/kernel/units/users/users_event_handler.php changed
+File in-portal/themes/default/search_results.tpl changed
+File in-portal/themes/default/common/head.tpl changed
+File in-portal/themes/default/common/pagetop.tpl changed
+File kernel4_dev/kernel4/application.php changed
+File kernel4_dev/kernel4/event_manager.php changed
+File kernel4_dev/kernel4/startup.php changed
+File kernel4_dev/kernel4/db/db_event_handler.php changed
+File kernel4_dev/kernel4/db/db_tag_processor.php changed
+File kernel4_dev/kernel4/db/dblist.php changed
+File kernel4_dev/kernel4/parser/template_parser.php changed
+File kernel4_dev/kernel4/processors/main_processor.php changed
+File kernel4_dev/kernel4/session/session.php changed
+File kernel4_dev/kernel4/utility/debugger.php changed
+File kernel4_dev/kernel4/utility/email.php changed
+File kernel4_dev/kernel4/utility/formatters/password_formatter.php changed
+File cmseditor/fckeditor.js changed
+File cmseditor/editor/filemanager/browser/default/connectors/php/commands.php changed
+
+
+Changes in phrases and events:
+
+
Property changes on: trunk/admin/install/upgrades/changelog_1_3_0.txt
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/admin/install/upgrades/readme_1_3_0.txt
===================================================================
--- trunk/admin/install/upgrades/readme_1_3_0.txt (nonexistent)
+++ trunk/admin/install/upgrades/readme_1_3_0.txt (revision 6428)
@@ -0,0 +1,4 @@
+Readme notes for In-Portal 1.3.0
+Intechnic Corporation, Sep 26, 2006
+
+This release is a maintenance release to support the newly released In-edit module.
\ No newline at end of file
Property changes on: trunk/admin/install/upgrades/readme_1_3_0.txt
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/admin/install/upgrades/inportal_upgrade_v1.3.0.sql
===================================================================
--- trunk/admin/install/upgrades/inportal_upgrade_v1.3.0.sql (nonexistent)
+++ trunk/admin/install/upgrades/inportal_upgrade_v1.3.0.sql (revision 6428)
@@ -0,0 +1,3 @@
+UPDATE ConfigurationValues SET VariableValue = MD5(CONCAT(VariableValue, 'b38')) WHERE VariableName = 'RootPass';
+
+UPDATE Modules SET Version = '1.3.0' WHERE Name = 'In-Portal';
\ No newline at end of file
Property changes on: trunk/admin/install/upgrades/inportal_upgrade_v1.3.0.sql
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/admin/install/inportal_data.sql
===================================================================
--- trunk/admin/install/inportal_data.sql (revision 6427)
+++ trunk/admin/install/inportal_data.sql (revision 6428)
@@ -1,789 +1,789 @@
INSERT INTO ConfigurationAdmin VALUES ('Site_Name', 'la_Text_Website', 'la_config_website_name', 'text', '', '', 10.02, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Site_Path', 'la_Text_Website', 'la_config_web_address', 'text', '', '', 10.01, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Backup_Path', 'la_Text_BackupPath', 'la_config_backup_path', 'text', '', '', 40.01, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Domain_Detect', 'la_Text_Website', 'la_config_detect_domain', 'text', '', '', 8, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_Sortfield', 'la_Text_General', 'la_category_sortfield_prompt', 'select', '', 'Name=la_Category_Name,Description=la_Category_Description,CreatedOn=la_Category_Date,EditorsPick=la_Category_Pick,<SQL>SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM <PREFIX>CustomField WHERE (Type = 1) AND (IsSystem = 0)</SQL>', 10.01, 1, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_Sortorder', 'la_Text_General', 'la_category_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.01, 2, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_Sortfield2', 'la_Text_General', 'la_category_sortfield2_prompt', 'select', '', 'Name=la_Category_Name,Description=la_Category_Description,CreatedOn=la_Category_Date,EditorsPick=la_Category_Pick,<SQL>SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM <PREFIX>CustomField WHERE (Type = 1) AND (IsSystem = 0)</SQL>', 10.02, 1, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_Sortorder2', 'la_Text_General', 'la_category_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.02, 2, 1);
INSERT INTO ConfigurationAdmin VALUES ('Perpage_Category', 'la_Text_General', 'la_category_perpage_prompt', 'text', '', '', 10.03, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_DaysNew', 'la_Text_General', 'la_category_daysnew_prompt', 'text', '', '', 10.05, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_ShowPick', 'la_Text_General', 'la_category_showpick_prompt', 'checkbox', '', '', 10.06, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_MetaKey', 'la_Text_MetaInfo', 'la_category_metakey', 'text', '', '', 20.01, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Category_MetaDesc', 'la_Text_MetaInfo', 'la_category_metadesc', 'text', '', '', 20.02, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('User_NewGroup', 'la_Text_General', 'la_users_new_group', 'select', NULL, '0=lu_none,<SQL+>SELECT GroupId as OptionValue, Name as OptionName FROM <PREFIX>PortalGroup WHERE Enabled=1 AND Personal=0</SQL>', 10.08, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('User_GuestGroup', 'la_Text_General', 'la_users_guest_group', 'select', NULL, '0=lu_none,<SQL+>SELECT GroupId as OptionValue, Name as OptionName FROM <PREFIX>PortalGroup WHERE Enabled=1 AND Personal=0</SQL>', 10.1, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('RootPass', 'la_Text_General', 'la_prompt_root_pass', 'password', NULL, NULL, 10.12, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('Users_AllowReset', 'la_Text_General', 'la_prompt_allow_reset', 'text', NULL, NULL, 10.05, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('User_Allow_New', 'la_Text_General', 'la_users_allow_new', 'radio', '', '1=la_User_Instant,2=la_User_Not_Allowed,3=la_User_Upon_Approval', 10.01, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('User_Password_Auto', 'la_Text_General', 'la_users_password_auto', 'checkbox', '', '', 10.06, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('User_Votes_Deny', 'la_Text_Restrictions', 'la_users_votes_deny', 'text', '', '', 20.01, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('User_MembershipExpirationReminder', 'la_Text_General', 'la_MembershipExpirationReminder', 'text', NULL, '', 10.07, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('User_Review_Deny', 'la_Text_Restrictions', 'la_users_review_deny', 'text', '', '', 20.02, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Server_Name', 'la_Text_Website', 'la_config_server_name', 'text', '', '', 4, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('Config_Server_Time', 'la_Text_Date_Time_Settings', 'la_config_time_server', 'select', '', '1=la_m12,2=la_m11,3=la_m10,5=la_m9,6=la_m8,7=la_m7,8=la_m6,9=la_m5,10=la_m4,11=la_m3,12=la_m2,13=la_m1,14=la_m0,15=la_p1,16=la_p2,17=la_p3,18=la_p4,19=la_p5,20=la_p6,21=la_p7,22=la_p8,23=la_p9,24=la_p10,25=la_p11,26=la_p12,27=la_p13', 20.01, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Config_Site_Time', 'la_Text_Date_Time_Settings', 'la_config_site_zone', 'select', '', '1=la_m12,2=la_m11,3=la_m10,5=la_m9,6=la_m8,7=la_m7,8=la_m6,9=la_m5,10=la_m4,11=la_m3,12=la_m2,13=la_m1,14=la_m0,15=la_p1,16=la_p2,17=la_p3,18=la_p4,19=la_p5,20=la_p6,21=la_p7,22=la_p8,23=la_p9,24=la_p10,25=la_p11,26=la_p12,27=la_p13', 20.02, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Smtp_Server', 'la_Text_smtp_server', 'la_prompt_mailserver', 'text', NULL, NULL, 30.01, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Smtp_Port', 'la_Text_smtp_server', 'la_prompt_mailport', 'text', NULL, NULL, 30.02, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Smtp_Authenticate', 'la_Text_smtp_server', 'la_prompt_mailauthenticate', 'checkbox', NULL, NULL, 30.03, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Smtp_User', 'la_Text_smtp_server', 'la_prompt_smtp_user', 'text', NULL, NULL, 30.04, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Smtp_Pass', 'la_Text_smtp_server', 'la_prompt_smtp_pass', 'text', NULL, NULL, 30.05, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Smtp_DefaultHeaders', 'la_Text_smtp_server', 'la_prompt_smtpheaders', 'textarea', NULL, 'COLS=40 ROWS=5', 30.06, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('Smtp_AdminMailFrom', 'la_Text_smtp_server', 'la_prompt_AdminMailFrom', 'text', NULL, NULL, 30.07, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Perpage_Category_Short', 'la_Text_General', 'la_category_perpage__short_prompt', 'text', '', '', 10.04, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('CookieSessions', 'la_Text_Website', 'la_prompt_session_management', 'select', NULL, '0=lu_query_string,1=lu_cookies,2=lu_auto', 10.03, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_category', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_category', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_category', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_category', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SessionTimeout', 'la_Text_Website', 'la_prompt_session_timeout', 'text', '', '', 10.05, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SystemTagCache', 'la_Text_Website', 'la_prompt_syscache_enable', 'checkbox', NULL, NULL, 10.07, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('User_SubscriberGroup', 'la_Text_General', 'la_users_subscriber_group', 'select', NULL, '0=lu_none,<SQL+>SELECT GroupId as OptionValue, Name as OptionName FROM <PREFIX>PortalGroup WHERE Enabled=1 AND Personal=0</SQL>', 10.11, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Root_Name', 'la_Text_General', 'la_prompt_root_name', 'text', '', '', 10.07, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SocketBlockingMode', 'la_Text_Website', 'la_prompt_socket_blocking_mode', 'checkbox', NULL, NULL, 10.08, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('Min_UserName', 'la_Text_General', 'la_text_min_username', 'text', '', '', 10.03, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('Min_Password', 'la_Text_General', 'la_text_min_password', 'text', '', '', 10.04, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('Email_As_Login', 'la_Text_General', 'la_use_emails_as_login', 'checkbox', NULL, NULL, 10.02, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('User_LoggedInGroup', 'la_Text_General', 'la_users_assign_all_to', 'select', NULL, '0=lu_none,<SQL+>SELECT GroupId as OptionValue, Name as OptionName FROM <PREFIX>PortalGroup WHERE Enabled=1 AND Personal=0</SQL>', 10.09, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('FirstDayOfWeek', 'la_Text_Date_Time_Settings', 'la_config_first_day_of_week', 'select', '', '0=la_sunday,1=la_monday', 20.03, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SSL_URL', 'la_Text_Website', 'la_config_ssl_url', 'text', '', '', 10.09, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Require_SSL', 'la_Text_Website', 'la_config_require_ssl', 'checkbox', '', '', 10.1, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('Force_HTTP_When_SSL_Not_Required', 'la_Text_Website', 'la_config_force_http', 'checkbox', '', '', 10.11, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SessionCookieName', 'la_Text_Website', 'la_prompt_session_cookie_name', 'text', '', '', 10.04, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('SessionReferrerCheck', 'la_Text_Website', 'la_promt_ReferrerCheck', 'checkbox', NULL, NULL, 10.06, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('UseModRewrite', 'la_Text_Website', 'la_config_use_modrewrite', 'checkbox', '', '', 10.12, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('UseModRewriteWithSSL', 'la_Text_Website', 'la_config_use_modrewrite_with_ssl', 'checkbox', '', '', 10.13, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('ErrorTemplate', 'la_Text_Website', 'la_config_error_template', 'text', '', '', 10.16, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('UseJSRedirect', 'la_Text_Website', 'la_config_use_js_redirect', 'checkbox', '', '', 10.14, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('MaxImportCategoryLevels', 'la_Text_General', 'la_prompt_max_import_category_levels', 'text', '', '', 10.08, 0, 1);
INSERT INTO ConfigurationAdmin VALUES ('UseCronForRegularEvent', 'la_Text_Website', 'la_UseCronForRegularEvent', 'checkbox', NULL, NULL, 10.15, 0, 0);
INSERT INTO ConfigurationAdmin VALUES ('NoPermissionTemplate', 'la_Text_Website', 'la_config_nopermission_template', 'text', '', '', 10.17, 0, 0);
INSERT INTO ConfigurationAdmin (VariableName, heading, prompt, element_type, validation, ValueList, DisplayOrder, GroupDisplayOrder, Install) VALUES ('UseOutputCompression', 'la_Text_Website', 'la_config_UseOutputCompression', 'checkbox', '', '', 10.18, 0, 1);
INSERT INTO ConfigurationAdmin (VariableName, heading, prompt, element_type, validation, ValueList, DisplayOrder, GroupDisplayOrder, Install) VALUES ('OutputCompressionLevel', 'la_Text_Website', 'la_config_OutputCompressionLevel', 'text', '', '', 10.19, 0, 1);
INSERT INTO ConfigurationValues VALUES (NULL, 'Columns_Category', '2', 'In-Portal', 'Categories')
INSERT INTO ConfigurationValues VALUES (NULL, 'DomainSelect','1','In-Portal','in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Site_Path', '/', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Archive', '25', 'inportal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'debug', '1', 'inportal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_User', '100', 'inportal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LangEmail', '20', 'inportal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Default_FromAddr', '', 'inportal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'email_replyto', '', 'inportal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'email_footer', 'message footer goes here', 'inportal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Default_Theme', 'default', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Default_Language', 'English', 'inportal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'SessionTimeout', '3600', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'User_SortOrder', 'asc', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Suggest_MinInterval', '3600', 'inportal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'SubCat_ListCount', '3', 'inportal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Timeout_Rating', '3600', 'In-Portal', 'System')
INSERT INTO ConfigurationValues VALUES (NULL, 'User_SortField', 'u.CreatedOn', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Relations', '10', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Group_SortField', 'GroupName', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Group_SortOrder', 'asc', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Default_FromName', 'Webmaster', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Category', '10', 'In-Portal', 'in-portal:configure_categories')
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_Sortfield', 'Name', 'In-Portal', 'in-portal:configure_categories')
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_Sortorder', 'asc', 'In-Portal', 'in-portal:configure_categories')
INSERT INTO ConfigurationValues VALUES (NULL, 'MetaKeywords', NULL, 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Relation_LV_Sortfield', 'ItemType', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'ampm_time', '1', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Template', '10', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Phrase', '40', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Sessionlist', '20', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_Sortfield2', 'Description', 'In-Portal', 'in-portal:configure_categories')
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_Sortorder2', 'asc', 'In-Portal', 'in-portal:configure_categories')
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_DaysNew', '8', 'In-Portal', 'in-portal:configure_categories')
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_ShowPick', '', 'In-Portal', 'in-portal:configure_categories')
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_MetaKey', '', 'In-Portal', 'in-portal:configure_categories')
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_MetaDesc', '', 'In-Portal', 'in-portal:configure_categories')
INSERT INTO ConfigurationValues VALUES (NULL, 'MetaDescription', NULL, 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'User_NewGroup', '13', 'In-Portal:Users', 'in-portal:configure_users')
INSERT INTO ConfigurationValues VALUES (NULL, 'User_Allow_New', '3', 'In-Portal:Users', 'in-portal:configure_users')
INSERT INTO ConfigurationValues VALUES (NULL, 'User_Password_Auto', '0', 'In-Portal:Users', 'in-portal:configure_users')
INSERT INTO ConfigurationValues VALUES (NULL, 'User_Votes_Deny', '5', 'In-Portal:Users', 'in-portal:configure_users')
INSERT INTO ConfigurationValues VALUES (NULL, 'User_Review_Deny', '5', 'In-Portal:Users', 'in-portal:configure_users')
INSERT INTO ConfigurationValues VALUES (NULL, 'Config_Name', '', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Config_Company', '', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Config_Reg_Number', '', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Config_Website_Name', '', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Config_Web_Address', '', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Config_Server_Time', '14', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Config_Site_Time', '14', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Site_Name', 'In-Portal', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Backup_Path', '', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Items', '20', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'GuestSessions', '1', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_Server', NULL, 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_Port', NULL, 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_User', NULL, 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_Pass', NULL, 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_SendHTML', '1', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_Authenticate', '0', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Email', '10', 'In-Portal', '')
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_DefaultHeaders', 'X-Priority: 1\r\nX-MSMail-Priority: High\r\nX-Mailer: In-Portal', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Smtp_AdminMailFrom', 'portal@user.domain.name', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_Highlight_OpenTag', '<span class="match">', 'In-Portal', 'in-portal:configure_categories')
INSERT INTO ConfigurationValues VALUES (NULL, 'Category_Highlight_CloseTag', '</span>', 'In-Portal', 'in-portal:configure_categories')
INSERT INTO ConfigurationValues VALUES (NULL, 'User_GuestGroup', '14', 'In-Portal:Users', 'in-portal:configure_users')
INSERT INTO ConfigurationValues VALUES (NULL, 'RootPass', '', 'In-Portal:Users', 'in-portal:configure_users')
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Category_Short', '3', 'In-Portal', 'in-portal:configure_categories')
INSERT INTO ConfigurationValues VALUES (NULL, 'CookieSessions', '2', 'In-Portal', 'in-portal:configure_general')
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_category', '30', 'In-Portal', 'in-portal:configuration_search');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_category', '90', 'In-Portal', 'in-portal:configuration_search');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_category', '5', 'In-Portal', 'in-portal:configuration_search');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_category', '5', 'In-Portal', 'in-portal:configuration_search');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_DefaultIncrease', '30', 'In-Portal', 'inportal:configure_searchdefault');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_DefaultKeyword', '80', 'In-Portal', 'SearchRel_DefaultKeyword');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_DefaultPop', '10', 'In-Portal', 'inportal:configuration_searchdefault');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_DefaultRating', '10', 'In-Portal', 'inportal:configure_searchdefault');
INSERT INTO ConfigurationValues VALUES (NULL, 'SystemTagCache', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Root_Name', 'lu_rootcategory_name', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'User_SubscriberGroup', '12', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'SocketBlockingMode', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Min_UserName', '3', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'Min_Password', '5', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'LinksValidation_LV_Sortfield', 'ValidationTime', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'CustomConfig_LV_Sortfield', 'FieldName', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Event_LV_SortField', 'Description', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Theme_LV_SortField', 'Name', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Template_LV_SortField', 'FileName', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Lang_LV_SortField', 'PackName', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Phrase_LV_SortField', 'Phrase', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'LangEmail_LV_SortField', 'Description', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'CustomData_LV_SortField', 'FieldName', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Summary_SortField', 'Module', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Session_SortField', 'UserName', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'SearchLog_SortField', 'Keyword', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_StatItem', '10', 'inportal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Groups', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Event', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_BanRules', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_SearchLog', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LV_lang', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LV_Themes', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LV_Catlist', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Reviews', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Modules', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Grouplist', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Images', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'EmailsL_SortField', 'time_sent', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_EmailsL', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_CustomData', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Review', '10', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Search_MinKeyword_Length', '3', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES (NULL, 'Users_AllowReset', '180', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'Email_As_Login', '0', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'User_LoggedInGroup', '15', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'User_MembershipExpirationReminder', '10', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (NULL, 'FirstDayOfWeek', '1', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'SSL_URL', '', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Require_SSL', '', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'Force_HTTP_When_SSL_Not_Required', '1', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'SessionCookieName', 'sid', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'UseModRewrite', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'UseModRewriteWithSSL', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'SessionReferrerCheck', '1', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'ErrorTemplate', 'error_notfound', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'UseJSRedirect', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'MaxImportCategoryLevels', '10', 'In-Portal', 'in-portal:configure_categories');
INSERT INTO ConfigurationValues VALUES (NULL, 'UseCronForRegularEvent', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues VALUES (NULL, 'NoPermissionTemplate', 'no_permission', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues (VariableName, VariableValue, ModuleOwner, Section) VALUES ('UseOutputCompression', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationValues (VariableName, VariableValue, ModuleOwner, Section) VALUES ('OutputCompressionLevel', '7', 'In-Portal', 'in-portal:configure_general');
INSERT INTO Events VALUES (30, 'USER.ADD', 1, 0, 'In-Portal:Users', 'la_event_user.add', 0)
INSERT INTO Events VALUES (32, 'USER.ADD', 2, 0, 'In-Portal:Users', 'la_event_user.add', 1)
INSERT INTO Events VALUES (31, 'USER.APPROVE', 1, 0, 'In-Portal:Users', 'la_event_user.approve', 0)
INSERT INTO Events VALUES (33, 'USER.APPROVE', 2, 0, 'In-Portal:Users', 'la_event_user.approve', 1)
INSERT INTO Events VALUES (34, 'USER.VALIDATE', 1, 0, 'In-Portal:Users', 'la_event_user.validate', 0)
INSERT INTO Events VALUES (35, 'USER.VALIDATE', 2, 0, 'In-Portal:Users', 'la_event_user.validate', 1)
INSERT INTO Events VALUES (36, 'USER.DENY', 1, 0, 'In-Portal:Users', 'la_event_user.deny', 0)
INSERT INTO Events VALUES (37, 'USER.DENY', 2, 0, 'In-Portal:Users', 'la_event_user.deny', 1)
INSERT INTO Events VALUES (38, 'USER.PSWD', 2, 0, 'In-Portal:Users', 'la_event_user.forgotpw', 1)
INSERT INTO Events VALUES (39, 'USER.PSWD', 1, 0, 'In-Portal:Users', 'la_event_user.forgotpw', 0)
INSERT INTO Events VALUES (45, 'USER.ADD.PENDING', 1, 0, 'In-Portal:Users', 'la_event_user.add.pending', 0)
INSERT INTO Events VALUES (68, 'USER.ADD.PENDING', 2, 0, 'In-Portal:Users', 'la_event_user.add.pending', 1)
INSERT INTO Events VALUES (47, 'CATEGORY.ADD', 1, 0, 'In-Portal:Category', 'la_event_category.add', 0)
INSERT INTO Events VALUES (48, 'CATEGORY.ADD.PENDING', 1, 0, 'In-Portal:Category', 'la_event_category.add.pending', 0)
INSERT INTO Events VALUES (49, 'CATEGORY.ADD.PENDING', 2, 0, 'In-Portal:Category', 'la_event_category.add.pending', 1)
INSERT INTO Events VALUES (50, 'CATEGORY.ADD', 2, 0, 'In-Portal:Category', 'la_event_category.add', 1)
INSERT INTO Events VALUES (51, 'CATEGORY.DELETE', 1, 0, 'In-Portal:Category', 'la_event_category_delete', 0)
INSERT INTO Events VALUES (52, 'CATEGORY.DELETE', 2, 0, 'In-Portal:Category', 'la_event_category_delete', 1)
INSERT INTO Events VALUES (53, 'CATEGORY.MODIFY', 1, 0, 'In-Portal:Category', 'la_event_category.modify', 0)
INSERT INTO Events VALUES (54, 'CATEGORY.MODIFY', 2, 0, 'In-Portal:Category', 'la_event_category.modify', 1)
INSERT INTO Events VALUES (56, 'CATEGORY.APPROVE', 1, 0, 'In-Portal:Category', 'la_event_category.approve', 0)
INSERT INTO Events VALUES (57, 'CATEGORY.APPROVE', 2, 0, 'In-Portal:Category', 'la_event_category.approve', 1)
INSERT INTO Events VALUES (58, 'CATEGORY.DENY', 1, 0, 'In-Portal:Category', 'la_event_category.deny', 0)
INSERT INTO Events VALUES (59, 'CATEGORY.DENY', 2, 0, 'In-Portal:Category', 'la_event_category.deny', 1)
INSERT INTO Events VALUES (60, 'USER.SUBSCRIBE', 1, 0, 'In-Portal:Users', 'la_event_user.subscribe', 0);
INSERT INTO Events VALUES (61, 'USER.SUBSCRIBE', 2, 0, 'In-Portal:Users', 'la_event_user.subscribe', 1);
INSERT INTO Events VALUES (62, 'USER.UNSUBSCRIBE', 1, 0, 'In-Portal:Users', 'la_event_user.unsubscribe', 0);
INSERT INTO Events VALUES (63, 'USER.UNSUBSCRIBE', 2, 0, 'In-Portal:Users', 'la_event_user.unsubscribe', 1);
INSERT INTO Events VALUES (64, 'USER.SUGGEST', '1', '0', 'In-Portal:Users', 'la_event_user.suggest', '0');
INSERT INTO Events VALUES (65, 'USER.SUGGEST', '2', '0', 'In-Portal:Users', 'la_event_user.suggest', '1');
INSERT INTO Events VALUES (67, 'USER.PSWDC', '1', '0', 'In-Portal:Users', 'la_event_user.pswd_confirm', '0');
INSERT INTO Events VALUES ('', 'USER.MEMBERSHIP.EXPIRED', '1', '0', 'In-Portal:Users', 'la_event_user.membership_expired', '0');
INSERT INTO Events VALUES ('', 'USER.MEMBERSHIP.EXPIRED', '1', '0', 'In-Portal:Users', 'la_event_user.membership_expired', '1');
INSERT INTO Events VALUES ('', 'USER.MEMBERSHIP.EXPIRATION.NOTICE', '1', '0', 'In-Portal:Users', 'la_event_user.membership_expiration_notice', '0');
INSERT INTO Events VALUES ('', 'USER.MEMBERSHIP.EXPIRATION.NOTICE', '1', '0', 'In-Portal:Users', 'la_event_user.membership_expiration_notice', '1');
INSERT INTO Events (Event, Enabled, FromUserId, Module, Description, Type) VALUES ('COMMON.FOOTER', 1, 0, 'In-Portal', 'la_event_common.footer', 1);
INSERT INTO IdGenerator VALUES ('100');
INSERT INTO ItemTypes VALUES (1, 'In-Portal', 'c', 'Category', 'Name', 'CreatedById', NULL, NULL, 'la_ItemTab_Categories', 1, 'admin/category/addcategory.php', 'clsCategory', 'Category');
INSERT INTO ItemTypes VALUES (6, 'In-Portal', 'u', 'PortalUser', 'Login', 'PortalUserId', NULL, NULL, '', 0, '', 'clsPortalUser', 'User');
-INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Portal', 'kernel/', 'm', '1.2.1', 1, 0, '', 0, '1054738405');
+INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Portal', 'kernel/', 'm', '1.3.0', 1, 0, '', 0, '1054738405');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('CATEGORY.VIEW', 'lu_PermName_Category.View_desc', 'lu_PermName_Category.View_error', 'In-Portal');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('CATEGORY.ADD', 'lu_PermName_Category.Add_desc', 'lu_PermName_Category.Add_error', 'In-Portal');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('CATEGORY.DELETE', 'lu_PermName_Category.Delete_desc', 'lu_PermName_Category.Delete_error', 'In-Portal');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('CATEGORY.ADD.PENDING', 'lu_PermName_Category.AddPending_desc', 'lu_PermName_Category.AddPending_error', 'In-Portal');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('CATEGORY.MODIFY', 'lu_PermName_Category.Modify_desc', 'lu_PermName_Category.Modify_error', 'In-Portal');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('ADMIN', 'lu_PermName_Admin_desc', 'lu_PermName_Admin_error', 'Admin');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LOGIN', 'lu_PermName_Login_desc', 'lu_PermName_Admin_error', 'Front');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('DEBUG.ITEM', 'lu_PermName_Debug.Item_desc', '', 'Admin');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('DEBUG.LIST', 'lu_PermName_Debug.List_desc', '', 'Admin');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('DEBUG.INFO', 'lu_PermName_Debug.Info_desc', '', 'Admin');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('PROFILE.MODIFY', 'lu_PermName_Profile.Modify_desc', '', 'Admin');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('SHOWLANG', 'lu_PermName_ShowLang_desc', '', 'Admin');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('FAVORITES', 'lu_PermName_favorites_desc', 'lu_PermName_favorites_error', 'In-Portal');
INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('SYSTEM_ACCESS.READONLY', 'la_PermName_SystemAccess.ReadOnly_desc', 'la_PermName_SystemAccess.ReadOnly_error', 'Admin');
INSERT INTO PortalGroup VALUES (15, 'Everyone', 'Everyone', 0, 1, 0, 1, 15);
INSERT INTO PortalGroup VALUES (13, 'Member', '', '1054738682', 0, 0, 1, 13);
INSERT INTO PortalGroup VALUES (12, 'Subscribers', '', '1054738670', 0, 0, 1, 12);
INSERT INTO PortalGroup VALUES (14, 'Guest', 'Guest User', '0', 1, 0, 1, 14);
INSERT INTO PortalGroup VALUES (11, 'admin', '', '1054738405', 0, 0, 1, 11);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LOGIN', 13, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LOGIN', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LOGIN', 12, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('ADMIN', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:root.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:site.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:browse.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:advanced_view.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:reviews.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_categories.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_categories.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_search.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_search.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_email.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_email.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_custom.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_custom.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_custom.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_custom.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:users.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_list.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_list.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_list.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_list.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_list.advanced:ban', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_list.advanced:send_email', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_groups.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_groups.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_groups.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_groups.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_groups.advanced:send_email', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_groups.advanced:manage_permissions', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_users.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_users.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_email.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_email.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_custom.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_custom.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_custom.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_custom.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_banlist.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_banlist.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_banlist.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_banlist.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:reports.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:log_summary.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:searchlog.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:searchlog.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:sessionlog.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:sessionlog.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:emaillog.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:emaillog.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:visits.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:visits.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:system.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_general.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_general.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:modules.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:mod_status.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:mod_status.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:mod_status.advanced:approve', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:mod_status.advanced:decline', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:addmodule.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:addmodule.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:addmodule.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:tag_library.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_themes.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_themes.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_themes.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_themes.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_styles.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_styles.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_styles.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_styles.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_lang.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_lang.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_lang.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_lang.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_lang.advanced:set_primary', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_lang.advanced:import', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_lang.advanced:export', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:tools.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:backup.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:restore.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:export.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:main_import.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:sql_query.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:sql_query.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:server_info.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:help.view', 11, 1, 1, 0);
INSERT INTO SearchConfig VALUES ('Category', 'NewItem', 0, 1, 'lu_fielddesc_category_newitem', 'lu_field_newitem', 'In-Portal', 'la_text_category', 18, 80, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'PopItem', 0, 1, 'lu_fielddesc_category_popitem', 'lu_field_popitem', 'In-Portal', 'la_text_category', 19, 81, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'HotItem', 0, 1, 'lu_fielddesc_category_hotitem', 'lu_field_hotitem', 'In-Portal', 'la_text_category', 17, 79, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'MetaDescription', 0, 1, 'lu_fielddesc_category_metadescription', 'lu_field_metadescription', 'In-Portal', 'la_text_category', 16, 78, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'ParentPath', 0, 1, 'lu_fielddesc_category_parentpath', 'lu_field_parentpath', 'In-Portal', 'la_text_category', 15, 77, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'ResourceId', 0, 1, 'lu_fielddesc_category_resourceid', 'lu_field_resourceid', 'In-Portal', 'la_text_category', 14, 76, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'CreatedById', 0, 1, 'lu_fielddesc_category_createdbyid', 'lu_field_createdbyid', 'In-Portal', 'la_text_category', 13, 75, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'CachedNavbar', 0, 1, 'lu_fielddesc_category_cachednavbar', 'lu_field_cachednavbar', 'In-Portal', 'la_text_category', 12, 74, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'CachedDescendantCatsQty', 0, 1, 'lu_fielddesc_category_cacheddescendantcatsqty', 'lu_field_cacheddescendantcatsqty', 'In-Portal', 'la_text_category', 11, 73, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'MetaKeywords', 0, 1, 'lu_fielddesc_category_metakeywords', 'lu_field_metakeywords', 'In-Portal', 'la_text_category', 10, 72, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'Priority', 0, 1, 'lu_fielddesc_category_priority', 'lu_field_priority', 'In-Portal', 'la_text_category', 9, 71, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'Status', 0, 1, 'lu_fielddesc_category_status', 'lu_field_status', 'In-Portal', 'la_text_category', 7, 69, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'EditorsPick', 0, 1, 'lu_fielddesc_category_editorspick', 'lu_field_editorspick', 'In-Portal', 'la_text_category', 6, 68, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'CreatedOn', 0, 1, 'lu_fielddesc_category_createdon', 'lu_field_createdon', 'In-Portal', 'la_text_category', 5, 67, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'Description', 1, 1, 'lu_fielddesc_category_description', 'lu_field_description', 'In-Portal', 'la_text_category', 4, 66, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'Name', 1, 1, 'lu_fielddesc_category_name', 'lu_field_name', 'In-Portal', 'la_text_category', 3, 65, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'ParentId', 0, 1, 'lu_fielddesc_category_parentid', 'lu_field_parentid', 'In-Portal', 'la_text_category', 2, 64, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'CategoryId', 0, 1, 'lu_fielddesc_category_categoryid', 'lu_field_categoryid', 'In-Portal', 'la_text_category', 0, 62, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'Modified', 0, 1, 'lu_fielddesc_category_modified', 'lu_field_modified', 'In-Portal', 'la_text_category', 20, 82, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Category', 'ModifiedById', 0, 1, 'lu_fielddesc_category_modifiedbyid', 'lu_field_modifiedbyid', 'In-Portal', 'la_text_category', 21, 83, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'PortalUserId', -1, 0, 'lu_fielddesc_user_portaluserid', 'lu_field_portaluserid', 'In-Portal', 'la_text_user', 0, 173, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'Login', -1, 0, 'lu_fielddesc_user_login', 'lu_field_login', 'In-Portal', 'la_text_user', 1, 174, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'Password', -1, 0, 'lu_fielddesc_user_password', 'lu_field_password', 'In-Portal', 'la_text_user', 2, 175, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'tz', -1, 0, 'lu_fielddesc_user_tz', 'lu_field_tz', 'In-Portal', 'la_text_user', 17, 190, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'dob', -1, 0, 'lu_fielddesc_user_dob', 'lu_field_dob', 'In-Portal', 'la_text_user', 16, 189, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'Modified', -1, 0, 'lu_fielddesc_user_modified', 'lu_field_modified', 'In-Portal', 'la_text_user', 15, 188, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'Status', -1, 0, 'lu_fielddesc_user_status', 'lu_field_status', 'In-Portal', 'la_text_user', 14, 187, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'ResourceId', -1, 0, 'lu_fielddesc_user_resourceid', 'lu_field_resourceid', 'In-Portal', 'la_text_user', 13, 186, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'Country', -1, 0, 'lu_fielddesc_user_country', 'lu_field_country', 'In-Portal', 'la_text_user', 12, 185, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'Zip', -1, 0, 'lu_fielddesc_user_zip', 'lu_field_zip', 'In-Portal', 'la_text_user', 11, 184, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'State', -1, 0, 'lu_fielddesc_user_state', 'lu_field_state', 'In-Portal', 'la_text_user', 10, 183, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'City', -1, 0, 'lu_fielddesc_user_city', 'lu_field_city', 'In-Portal', 'la_text_user', 9, 182, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'Street', -1, 0, 'lu_fielddesc_user_street', 'lu_field_street', 'In-Portal', 'la_text_user', 8, 181, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'Phone', -1, 0, 'lu_fielddesc_user_phone', 'lu_field_phone', 'In-Portal', 'la_text_user', 7, 180, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'CreatedOn', -1, 0, 'lu_fielddesc_user_createdon', 'lu_field_createdon', 'In-Portal', 'la_text_user', 6, 179, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'Email', -1, 0, 'lu_fielddesc_user_email', 'lu_field_email', 'In-Portal', 'la_text_user', 5, 178, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'LastName', -1, 0, 'lu_fielddesc_user_lastname', 'lu_field_lastname', 'In-Portal', 'la_text_user', 4, 177, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('PortalUser', 'FirstName', -1, 0, 'lu_fielddesc_user_firstname', 'lu_field_firstname', 'In-Portal', 'la_text_user', 3, 176, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT count(*) FROM <%prefix%>Category WHERE Status=1 ', NULL, 'la_prompt_ActiveCategories', '0', '1');
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT count(*) FROM <%prefix%>PortalUser WHERE Status=1 ', NULL, 'la_prompt_ActiveUsers', '0', '1');
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT count(*) FROM <%prefix%>UserSession', NULL, 'la_prompt_CurrentSessions', '0', '1');
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) as CategoryCount FROM <%prefix%>Category', NULL, 'la_prompt_TotalCategories', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS ActiveCategories FROM <%prefix%>Category WHERE Status = 1', NULL, 'la_prompt_ActiveCategories', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS PendingCategories FROM <%prefix%>Category WHERE Status = 2', NULL, 'la_prompt_PendingCategories', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS DisabledCategories FROM <%prefix%>Category WHERE Status = 0', NULL, 'la_prompt_DisabledCategories', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS NewCategories FROM <%prefix%>Category WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Category_DaysNew"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewCategories', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) FROM <%prefix%>Category WHERE EditorsPick = 1', NULL, 'la_prompt_CategoryEditorsPick', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Category', NULL, 'la_prompt_NewestCategoryDate', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Category', NULL, 'la_prompt_LastCategoryUpdate', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS TotalUsers FROM <%prefix%>PortalUser', NULL, 'la_prompt_TopicsUsers', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS ActiveUsers FROM <%prefix%>PortalUser WHERE Status = 1', NULL, 'la_prompt_UsersActive', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS PendingUsers FROM <%prefix%>PortalUser WHERE Status = 2', NULL, 'la_prompt_UsersPending', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS DisabledUsers FROM <%prefix%>PortalUser WHERE Status = 0', NULL, 'la_prompt_UsersDisabled', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>PortalUser', NULL, 'la_prompt_NewestUserDate', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT( DISTINCT LOWER( Country ) ) FROM <%prefix%>PortalUser WHERE LENGTH(Country) > 0', NULL, 'la_prompt_UsersUniqueCountries', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT( DISTINCT LOWER( State ) ) FROM <%prefix%>PortalUser WHERE LENGTH(State) > 0', NULL, 'la_prompt_UsersUniqueStates', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS TotalUserGroups FROM <%prefix%>PortalGroup', NULL, 'la_prompt_TotalUserGroups', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS BannedUsers FROM <%prefix%>PortalUser WHERE IsBanned = 1', NULL, 'la_prompt_BannedUsers', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS NonExipedSessions FROM <%prefix%>UserSession WHERE Status = 1', NULL, 'la_prompt_NonExpiredSessions', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS ThemeCount FROM <%prefix%>Theme', NULL, 'la_prompt_ThemeCount', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS RegionsCount FROM <%prefix%>Language', NULL, 'la_prompt_RegionsCount', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', '<%m:sql_action sql="SHOW+TABLES" action="COUNT" field="*"%>', NULL, 'la_prompt_TablesCount', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', '<%m:sql_action sql="SHOW+TABLE+STATUS" action="SUM" field="Rows"%>', NULL, 'la_prompt_RecordsCount', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', '<%m:custom_action sql="empty" action="SysFileSize"%>', NULL, 'la_prompt_SystemFileSize', 0, 2);
INSERT INTO StatItem VALUES (0, 'In-Portal', '<%m:sql_action sql="SHOW+TABLE+STATUS" action="SUM" format_as="file" field="Data_length"%>', NULL, 'la_prompt_DataSize', 0, 2);
INSERT INTO StdDestinations VALUES (1, 1, NULL, 'la_country_AFG', 'AFG', 'AF');
INSERT INTO StdDestinations VALUES (2, 1, NULL, 'la_country_ALB', 'ALB', 'AL');
INSERT INTO StdDestinations VALUES (3, 1, NULL, 'la_country_DZA', 'DZA', 'DZ');
INSERT INTO StdDestinations VALUES (4, 1, NULL, 'la_country_ASM', 'ASM', 'AS');
INSERT INTO StdDestinations VALUES (5, 1, NULL, 'la_country_AND', 'AND', 'AD');
INSERT INTO StdDestinations VALUES (6, 1, NULL, 'la_country_AGO', 'AGO', 'AO');
INSERT INTO StdDestinations VALUES (7, 1, NULL, 'la_country_AIA', 'AIA', 'AI');
INSERT INTO StdDestinations VALUES (8, 1, NULL, 'la_country_ATA', 'ATA', 'AQ');
INSERT INTO StdDestinations VALUES (9, 1, NULL, 'la_country_ATG', 'ATG', 'AG');
INSERT INTO StdDestinations VALUES (10, 1, NULL, 'la_country_ARG', 'ARG', 'AR');
INSERT INTO StdDestinations VALUES (11, 1, NULL, 'la_country_ARM', 'ARM', 'AM');
INSERT INTO StdDestinations VALUES (12, 1, NULL, 'la_country_ABW', 'ABW', 'AW');
INSERT INTO StdDestinations VALUES (13, 1, NULL, 'la_country_AUS', 'AUS', 'AU');
INSERT INTO StdDestinations VALUES (14, 1, NULL, 'la_country_AUT', 'AUT', 'AT');
INSERT INTO StdDestinations VALUES (15, 1, NULL, 'la_country_AZE', 'AZE', 'AZ');
INSERT INTO StdDestinations VALUES (16, 1, NULL, 'la_country_BHS', 'BHS', 'BS');
INSERT INTO StdDestinations VALUES (17, 1, NULL, 'la_country_BHR', 'BHR', 'BH');
INSERT INTO StdDestinations VALUES (18, 1, NULL, 'la_country_BGD', 'BGD', 'BD');
INSERT INTO StdDestinations VALUES (19, 1, NULL, 'la_country_BRB', 'BRB', 'BB');
INSERT INTO StdDestinations VALUES (20, 1, NULL, 'la_country_BLR', 'BLR', 'BY');
INSERT INTO StdDestinations VALUES (21, 1, NULL, 'la_country_BEL', 'BEL', 'BE');
INSERT INTO StdDestinations VALUES (22, 1, NULL, 'la_country_BLZ', 'BLZ', 'BZ');
INSERT INTO StdDestinations VALUES (23, 1, NULL, 'la_country_BEN', 'BEN', 'BJ');
INSERT INTO StdDestinations VALUES (24, 1, NULL, 'la_country_BMU', 'BMU', 'BM');
INSERT INTO StdDestinations VALUES (25, 1, NULL, 'la_country_BTN', 'BTN', 'BT');
INSERT INTO StdDestinations VALUES (26, 1, NULL, 'la_country_BOL', 'BOL', 'BO');
INSERT INTO StdDestinations VALUES (27, 1, NULL, 'la_country_BIH', 'BIH', 'BA');
INSERT INTO StdDestinations VALUES (28, 1, NULL, 'la_country_BWA', 'BWA', 'BW');
INSERT INTO StdDestinations VALUES (29, 1, NULL, 'la_country_BVT', 'BVT', 'BV');
INSERT INTO StdDestinations VALUES (30, 1, NULL, 'la_country_BRA', 'BRA', 'BR');
INSERT INTO StdDestinations VALUES (31, 1, NULL, 'la_country_IOT', 'IOT', 'IO');
INSERT INTO StdDestinations VALUES (32, 1, NULL, 'la_country_BRN', 'BRN', 'BN');
INSERT INTO StdDestinations VALUES (33, 1, NULL, 'la_country_BGR', 'BGR', 'BG');
INSERT INTO StdDestinations VALUES (34, 1, NULL, 'la_country_BFA', 'BFA', 'BF');
INSERT INTO StdDestinations VALUES (35, 1, NULL, 'la_country_BDI', 'BDI', 'BI');
INSERT INTO StdDestinations VALUES (36, 1, NULL, 'la_country_KHM', 'KHM', 'KH');
INSERT INTO StdDestinations VALUES (37, 1, NULL, 'la_country_CMR', 'CMR', 'CM');
INSERT INTO StdDestinations VALUES (38, 1, NULL, 'la_country_CAN', 'CAN', 'CA');
INSERT INTO StdDestinations VALUES (39, 1, NULL, 'la_country_CPV', 'CPV', 'CV');
INSERT INTO StdDestinations VALUES (40, 1, NULL, 'la_country_CYM', 'CYM', 'KY');
INSERT INTO StdDestinations VALUES (41, 1, NULL, 'la_country_CAF', 'CAF', 'CF');
INSERT INTO StdDestinations VALUES (42, 1, NULL, 'la_country_TCD', 'TCD', 'TD');
INSERT INTO StdDestinations VALUES (43, 1, NULL, 'la_country_CHL', 'CHL', 'CL');
INSERT INTO StdDestinations VALUES (44, 1, NULL, 'la_country_CHN', 'CHN', 'CN');
INSERT INTO StdDestinations VALUES (45, 1, NULL, 'la_country_CXR', 'CXR', 'CX');
INSERT INTO StdDestinations VALUES (46, 1, NULL, 'la_country_CCK', 'CCK', 'CC');
INSERT INTO StdDestinations VALUES (47, 1, NULL, 'la_country_COL', 'COL', 'CO');
INSERT INTO StdDestinations VALUES (48, 1, NULL, 'la_country_COM', 'COM', 'KM');
INSERT INTO StdDestinations VALUES (49, 1, NULL, 'la_country_COD', 'COD', 'CD');
INSERT INTO StdDestinations VALUES (50, 1, NULL, 'la_country_COG', 'COG', 'CG');
INSERT INTO StdDestinations VALUES (51, 1, NULL, 'la_country_COK', 'COK', 'CK');
INSERT INTO StdDestinations VALUES (52, 1, NULL, 'la_country_CRI', 'CRI', 'CR');
INSERT INTO StdDestinations VALUES (53, 1, NULL, 'la_country_CIV', 'CIV', 'CI');
INSERT INTO StdDestinations VALUES (54, 1, NULL, 'la_country_HRV', 'HRV', 'HR');
INSERT INTO StdDestinations VALUES (55, 1, NULL, 'la_country_CUB', 'CUB', 'CU');
INSERT INTO StdDestinations VALUES (56, 1, NULL, 'la_country_CYP', 'CYP', 'CY');
INSERT INTO StdDestinations VALUES (57, 1, NULL, 'la_country_CZE', 'CZE', 'CZ');
INSERT INTO StdDestinations VALUES (58, 1, NULL, 'la_country_DNK', 'DNK', 'DK');
INSERT INTO StdDestinations VALUES (59, 1, NULL, 'la_country_DJI', 'DJI', 'DJ');
INSERT INTO StdDestinations VALUES (60, 1, NULL, 'la_country_DMA', 'DMA', 'DM');
INSERT INTO StdDestinations VALUES (61, 1, NULL, 'la_country_DOM', 'DOM', 'DO');
INSERT INTO StdDestinations VALUES (62, 1, NULL, 'la_country_TLS', 'TLS', 'TL');
INSERT INTO StdDestinations VALUES (63, 1, NULL, 'la_country_ECU', 'ECU', 'EC');
INSERT INTO StdDestinations VALUES (64, 1, NULL, 'la_country_EGY', 'EGY', 'EG');
INSERT INTO StdDestinations VALUES (65, 1, NULL, 'la_country_SLV', 'SLV', 'SV');
INSERT INTO StdDestinations VALUES (66, 1, NULL, 'la_country_GNQ', 'GNQ', 'GQ');
INSERT INTO StdDestinations VALUES (67, 1, NULL, 'la_country_ERI', 'ERI', 'ER');
INSERT INTO StdDestinations VALUES (68, 1, NULL, 'la_country_EST', 'EST', 'EE');
INSERT INTO StdDestinations VALUES (69, 1, NULL, 'la_country_ETH', 'ETH', 'ET');
INSERT INTO StdDestinations VALUES (70, 1, NULL, 'la_country_FLK', 'FLK', 'FK');
INSERT INTO StdDestinations VALUES (71, 1, NULL, 'la_country_FRO', 'FRO', 'FO');
INSERT INTO StdDestinations VALUES (72, 1, NULL, 'la_country_FJI', 'FJI', 'FJ');
INSERT INTO StdDestinations VALUES (73, 1, NULL, 'la_country_FIN', 'FIN', 'FI');
INSERT INTO StdDestinations VALUES (74, 1, NULL, 'la_country_FRA', 'FRA', 'FR');
INSERT INTO StdDestinations VALUES (75, 1, NULL, 'la_country_FXX', 'FXX', 'FX');
INSERT INTO StdDestinations VALUES (76, 1, NULL, 'la_country_GUF', 'GUF', 'GF');
INSERT INTO StdDestinations VALUES (77, 1, NULL, 'la_country_PYF', 'PYF', 'PF');
INSERT INTO StdDestinations VALUES (78, 1, NULL, 'la_country_ATF', 'ATF', 'TF');
INSERT INTO StdDestinations VALUES (79, 1, NULL, 'la_country_GAB', 'GAB', 'GA');
INSERT INTO StdDestinations VALUES (80, 1, NULL, 'la_country_GMB', 'GMB', 'GM');
INSERT INTO StdDestinations VALUES (81, 1, NULL, 'la_country_GEO', 'GEO', 'GE');
INSERT INTO StdDestinations VALUES (82, 1, NULL, 'la_country_DEU', 'DEU', 'DE');
INSERT INTO StdDestinations VALUES (83, 1, NULL, 'la_country_GHA', 'GHA', 'GH');
INSERT INTO StdDestinations VALUES (84, 1, NULL, 'la_country_GIB', 'GIB', 'GI');
INSERT INTO StdDestinations VALUES (85, 1, NULL, 'la_country_GRC', 'GRC', 'GR');
INSERT INTO StdDestinations VALUES (86, 1, NULL, 'la_country_GRL', 'GRL', 'GL');
INSERT INTO StdDestinations VALUES (87, 1, NULL, 'la_country_GRD', 'GRD', 'GD');
INSERT INTO StdDestinations VALUES (88, 1, NULL, 'la_country_GLP', 'GLP', 'GP');
INSERT INTO StdDestinations VALUES (89, 1, NULL, 'la_country_GUM', 'GUM', 'GU');
INSERT INTO StdDestinations VALUES (90, 1, NULL, 'la_country_GTM', 'GTM', 'GT');
INSERT INTO StdDestinations VALUES (91, 1, NULL, 'la_country_GIN', 'GIN', 'GN');
INSERT INTO StdDestinations VALUES (92, 1, NULL, 'la_country_GNB', 'GNB', 'GW');
INSERT INTO StdDestinations VALUES (93, 1, NULL, 'la_country_GUY', 'GUY', 'GY');
INSERT INTO StdDestinations VALUES (94, 1, NULL, 'la_country_HTI', 'HTI', 'HT');
INSERT INTO StdDestinations VALUES (95, 1, NULL, 'la_country_HMD', 'HMD', 'HM');
INSERT INTO StdDestinations VALUES (96, 1, NULL, 'la_country_HND', 'HND', 'HN');
INSERT INTO StdDestinations VALUES (97, 1, NULL, 'la_country_HKG', 'HKG', 'HK');
INSERT INTO StdDestinations VALUES (98, 1, NULL, 'la_country_HUN', 'HUN', 'HU');
INSERT INTO StdDestinations VALUES (99, 1, NULL, 'la_country_ISL', 'ISL', 'IS');
INSERT INTO StdDestinations VALUES (100, 1, NULL, 'la_country_IND', 'IND', 'IN');
INSERT INTO StdDestinations VALUES (101, 1, NULL, 'la_country_IDN', 'IDN', 'ID');
INSERT INTO StdDestinations VALUES (102, 1, NULL, 'la_country_IRN', 'IRN', 'IR');
INSERT INTO StdDestinations VALUES (103, 1, NULL, 'la_country_IRQ', 'IRQ', 'IQ');
INSERT INTO StdDestinations VALUES (104, 1, NULL, 'la_country_IRL', 'IRL', 'IE');
INSERT INTO StdDestinations VALUES (105, 1, NULL, 'la_country_ISR', 'ISR', 'IL');
INSERT INTO StdDestinations VALUES (106, 1, NULL, 'la_country_ITA', 'ITA', 'IT');
INSERT INTO StdDestinations VALUES (107, 1, NULL, 'la_country_JAM', 'JAM', 'JM');
INSERT INTO StdDestinations VALUES (108, 1, NULL, 'la_country_JPN', 'JPN', 'JP');
INSERT INTO StdDestinations VALUES (109, 1, NULL, 'la_country_JOR', 'JOR', 'JO');
INSERT INTO StdDestinations VALUES (110, 1, NULL, 'la_country_KAZ', 'KAZ', 'KZ');
INSERT INTO StdDestinations VALUES (111, 1, NULL, 'la_country_KEN', 'KEN', 'KE');
INSERT INTO StdDestinations VALUES (112, 1, NULL, 'la_country_KIR', 'KIR', 'KI');
INSERT INTO StdDestinations VALUES (113, 1, NULL, 'la_country_PRK', 'PRK', 'KP');
INSERT INTO StdDestinations VALUES (114, 1, NULL, 'la_country_KOR', 'KOR', 'KR');
INSERT INTO StdDestinations VALUES (115, 1, NULL, 'la_country_KWT', 'KWT', 'KW');
INSERT INTO StdDestinations VALUES (116, 1, NULL, 'la_country_KGZ', 'KGZ', 'KG');
INSERT INTO StdDestinations VALUES (117, 1, NULL, 'la_country_LAO', 'LAO', 'LA');
INSERT INTO StdDestinations VALUES (118, 1, NULL, 'la_country_LVA', 'LVA', 'LV');
INSERT INTO StdDestinations VALUES (119, 1, NULL, 'la_country_LBN', 'LBN', 'LB');
INSERT INTO StdDestinations VALUES (120, 1, NULL, 'la_country_LSO', 'LSO', 'LS');
INSERT INTO StdDestinations VALUES (121, 1, NULL, 'la_country_LBR', 'LBR', 'LR');
INSERT INTO StdDestinations VALUES (122, 1, NULL, 'la_country_LBY', 'LBY', 'LY');
INSERT INTO StdDestinations VALUES (123, 1, NULL, 'la_country_LIE', 'LIE', 'LI');
INSERT INTO StdDestinations VALUES (124, 1, NULL, 'la_country_LTU', 'LTU', 'LT');
INSERT INTO StdDestinations VALUES (125, 1, NULL, 'la_country_LUX', 'LUX', 'LU');
INSERT INTO StdDestinations VALUES (126, 1, NULL, 'la_country_MAC', 'MAC', 'MO');
INSERT INTO StdDestinations VALUES (127, 1, NULL, 'la_country_MKD', 'MKD', 'MK');
INSERT INTO StdDestinations VALUES (128, 1, NULL, 'la_country_MDG', 'MDG', 'MG');
INSERT INTO StdDestinations VALUES (129, 1, NULL, 'la_country_MWI', 'MWI', 'MW');
INSERT INTO StdDestinations VALUES (130, 1, NULL, 'la_country_MYS', 'MYS', 'MY');
INSERT INTO StdDestinations VALUES (131, 1, NULL, 'la_country_MDV', 'MDV', 'MV');
INSERT INTO StdDestinations VALUES (132, 1, NULL, 'la_country_MLI', 'MLI', 'ML');
INSERT INTO StdDestinations VALUES (133, 1, NULL, 'la_country_MLT', 'MLT', 'MT');
INSERT INTO StdDestinations VALUES (134, 1, NULL, 'la_country_MHL', 'MHL', 'MH');
INSERT INTO StdDestinations VALUES (135, 1, NULL, 'la_country_MTQ', 'MTQ', 'MQ');
INSERT INTO StdDestinations VALUES (136, 1, NULL, 'la_country_MRT', 'MRT', 'MR');
INSERT INTO StdDestinations VALUES (137, 1, NULL, 'la_country_MUS', 'MUS', 'MU');
INSERT INTO StdDestinations VALUES (138, 1, NULL, 'la_country_MYT', 'MYT', 'YT');
INSERT INTO StdDestinations VALUES (139, 1, NULL, 'la_country_MEX', 'MEX', 'MX');
INSERT INTO StdDestinations VALUES (140, 1, NULL, 'la_country_FSM', 'FSM', 'FM');
INSERT INTO StdDestinations VALUES (141, 1, NULL, 'la_country_MDA', 'MDA', 'MD');
INSERT INTO StdDestinations VALUES (142, 1, NULL, 'la_country_MCO', 'MCO', 'MC');
INSERT INTO StdDestinations VALUES (143, 1, NULL, 'la_country_MNG', 'MNG', 'MN');
INSERT INTO StdDestinations VALUES (144, 1, NULL, 'la_country_MSR', 'MSR', 'MS');
INSERT INTO StdDestinations VALUES (145, 1, NULL, 'la_country_MAR', 'MAR', 'MA');
INSERT INTO StdDestinations VALUES (146, 1, NULL, 'la_country_MOZ', 'MOZ', 'MZ');
INSERT INTO StdDestinations VALUES (147, 1, NULL, 'la_country_MMR', 'MMR', 'MM');
INSERT INTO StdDestinations VALUES (148, 1, NULL, 'la_country_NAM', 'NAM', 'NA');
INSERT INTO StdDestinations VALUES (149, 1, NULL, 'la_country_NRU', 'NRU', 'NR');
INSERT INTO StdDestinations VALUES (150, 1, NULL, 'la_country_NPL', 'NPL', 'NP');
INSERT INTO StdDestinations VALUES (151, 1, NULL, 'la_country_NLD', 'NLD', 'NL');
INSERT INTO StdDestinations VALUES (152, 1, NULL, 'la_country_ANT', 'ANT', 'AN');
INSERT INTO StdDestinations VALUES (153, 1, NULL, 'la_country_NCL', 'NCL', 'NC');
INSERT INTO StdDestinations VALUES (154, 1, NULL, 'la_country_NZL', 'NZL', 'NZ');
INSERT INTO StdDestinations VALUES (155, 1, NULL, 'la_country_NIC', 'NIC', 'NI');
INSERT INTO StdDestinations VALUES (156, 1, NULL, 'la_country_NER', 'NER', 'NE');
INSERT INTO StdDestinations VALUES (157, 1, NULL, 'la_country_NGA', 'NGA', 'NG');
INSERT INTO StdDestinations VALUES (158, 1, NULL, 'la_country_NIU', 'NIU', 'NU');
INSERT INTO StdDestinations VALUES (159, 1, NULL, 'la_country_NFK', 'NFK', 'NF');
INSERT INTO StdDestinations VALUES (160, 1, NULL, 'la_country_MNP', 'MNP', 'MP');
INSERT INTO StdDestinations VALUES (161, 1, NULL, 'la_country_NOR', 'NOR', 'NO');
INSERT INTO StdDestinations VALUES (162, 1, NULL, 'la_country_OMN', 'OMN', 'OM');
INSERT INTO StdDestinations VALUES (163, 1, NULL, 'la_country_PAK', 'PAK', 'PK');
INSERT INTO StdDestinations VALUES (164, 1, NULL, 'la_country_PLW', 'PLW', 'PW');
INSERT INTO StdDestinations VALUES (165, 1, NULL, 'la_country_PSE', 'PSE', 'PS');
INSERT INTO StdDestinations VALUES (166, 1, NULL, 'la_country_PAN', 'PAN', 'PA');
INSERT INTO StdDestinations VALUES (167, 1, NULL, 'la_country_PNG', 'PNG', 'PG');
INSERT INTO StdDestinations VALUES (168, 1, NULL, 'la_country_PRY', 'PRY', 'PY');
INSERT INTO StdDestinations VALUES (169, 1, NULL, 'la_country_PER', 'PER', 'PE');
INSERT INTO StdDestinations VALUES (170, 1, NULL, 'la_country_PHL', 'PHL', 'PH');
INSERT INTO StdDestinations VALUES (171, 1, NULL, 'la_country_PCN', 'PCN', 'PN');
INSERT INTO StdDestinations VALUES (172, 1, NULL, 'la_country_POL', 'POL', 'PL');
INSERT INTO StdDestinations VALUES (173, 1, NULL, 'la_country_PRT', 'PRT', 'PT');
INSERT INTO StdDestinations VALUES (174, 1, NULL, 'la_country_PRI', 'PRI', 'PR');
INSERT INTO StdDestinations VALUES (175, 1, NULL, 'la_country_QAT', 'QAT', 'QA');
INSERT INTO StdDestinations VALUES (176, 1, NULL, 'la_country_REU', 'REU', 'RE');
INSERT INTO StdDestinations VALUES (177, 1, NULL, 'la_country_ROU', 'ROU', 'RO');
INSERT INTO StdDestinations VALUES (178, 1, NULL, 'la_country_RUS', 'RUS', 'RU');
INSERT INTO StdDestinations VALUES (179, 1, NULL, 'la_country_RWA', 'RWA', 'RW');
INSERT INTO StdDestinations VALUES (180, 1, NULL, 'la_country_KNA', 'KNA', 'KN');
INSERT INTO StdDestinations VALUES (181, 1, NULL, 'la_country_LCA', 'LCA', 'LC');
INSERT INTO StdDestinations VALUES (182, 1, NULL, 'la_country_VCT', 'VCT', 'VC');
INSERT INTO StdDestinations VALUES (183, 1, NULL, 'la_country_WSM', 'WSM', 'WS');
INSERT INTO StdDestinations VALUES (184, 1, NULL, 'la_country_SMR', 'SMR', 'SM');
INSERT INTO StdDestinations VALUES (185, 1, NULL, 'la_country_STP', 'STP', 'ST');
INSERT INTO StdDestinations VALUES (186, 1, NULL, 'la_country_SAU', 'SAU', 'SA');
INSERT INTO StdDestinations VALUES (187, 1, NULL, 'la_country_SEN', 'SEN', 'SN');
INSERT INTO StdDestinations VALUES (188, 1, NULL, 'la_country_SYC', 'SYC', 'SC');
INSERT INTO StdDestinations VALUES (189, 1, NULL, 'la_country_SLE', 'SLE', 'SL');
INSERT INTO StdDestinations VALUES (190, 1, NULL, 'la_country_SGP', 'SGP', 'SG');
INSERT INTO StdDestinations VALUES (191, 1, NULL, 'la_country_SVK', 'SVK', 'SK');
INSERT INTO StdDestinations VALUES (192, 1, NULL, 'la_country_SVN', 'SVN', 'SI');
INSERT INTO StdDestinations VALUES (193, 1, NULL, 'la_country_SLB', 'SLB', 'SB');
INSERT INTO StdDestinations VALUES (194, 1, NULL, 'la_country_SOM', 'SOM', 'SO');
INSERT INTO StdDestinations VALUES (195, 1, NULL, 'la_country_ZAF', 'ZAF', 'ZA');
INSERT INTO StdDestinations VALUES (196, 1, NULL, 'la_country_SGS', 'SGS', 'GS');
INSERT INTO StdDestinations VALUES (197, 1, NULL, 'la_country_ESP', 'ESP', 'ES');
INSERT INTO StdDestinations VALUES (198, 1, NULL, 'la_country_LKA', 'LKA', 'LK');
INSERT INTO StdDestinations VALUES (199, 1, NULL, 'la_country_SHN', 'SHN', 'SH');
INSERT INTO StdDestinations VALUES (200, 1, NULL, 'la_country_SPM', 'SPM', 'PM');
INSERT INTO StdDestinations VALUES (201, 1, NULL, 'la_country_SDN', 'SDN', 'SD');
INSERT INTO StdDestinations VALUES (202, 1, NULL, 'la_country_SUR', 'SUR', 'SR');
INSERT INTO StdDestinations VALUES (203, 1, NULL, 'la_country_SJM', 'SJM', 'SJ');
INSERT INTO StdDestinations VALUES (204, 1, NULL, 'la_country_SWZ', 'SWZ', 'SZ');
INSERT INTO StdDestinations VALUES (205, 1, NULL, 'la_country_SWE', 'SWE', 'SE');
INSERT INTO StdDestinations VALUES (206, 1, NULL, 'la_country_CHE', 'CHE', 'CH');
INSERT INTO StdDestinations VALUES (207, 1, NULL, 'la_country_SYR', 'SYR', 'SY');
INSERT INTO StdDestinations VALUES (208, 1, NULL, 'la_country_TWN', 'TWN', 'TW');
INSERT INTO StdDestinations VALUES (209, 1, NULL, 'la_country_TJK', 'TJK', 'TJ');
INSERT INTO StdDestinations VALUES (210, 1, NULL, 'la_country_TZA', 'TZA', 'TZ');
INSERT INTO StdDestinations VALUES (211, 1, NULL, 'la_country_THA', 'THA', 'TH');
INSERT INTO StdDestinations VALUES (212, 1, NULL, 'la_country_TGO', 'TGO', 'TG');
INSERT INTO StdDestinations VALUES (213, 1, NULL, 'la_country_TKL', 'TKL', 'TK');
INSERT INTO StdDestinations VALUES (214, 1, NULL, 'la_country_TON', 'TON', 'TO');
INSERT INTO StdDestinations VALUES (215, 1, NULL, 'la_country_TTO', 'TTO', 'TT');
INSERT INTO StdDestinations VALUES (216, 1, NULL, 'la_country_TUN', 'TUN', 'TN');
INSERT INTO StdDestinations VALUES (217, 1, NULL, 'la_country_TUR', 'TUR', 'TR');
INSERT INTO StdDestinations VALUES (218, 1, NULL, 'la_country_TKM', 'TKM', 'TM');
INSERT INTO StdDestinations VALUES (219, 1, NULL, 'la_country_TCA', 'TCA', 'TC');
INSERT INTO StdDestinations VALUES (220, 1, NULL, 'la_country_TUV', 'TUV', 'TV');
INSERT INTO StdDestinations VALUES (221, 1, NULL, 'la_country_UGA', 'UGA', 'UG');
INSERT INTO StdDestinations VALUES (222, 1, NULL, 'la_country_UKR', 'UKR', 'UA');
INSERT INTO StdDestinations VALUES (223, 1, NULL, 'la_country_ARE', 'ARE', 'AE');
INSERT INTO StdDestinations VALUES (224, 1, NULL, 'la_country_GBR', 'GBR', 'GB');
INSERT INTO StdDestinations VALUES (225, 1, NULL, 'la_country_USA', 'USA', 'US');
INSERT INTO StdDestinations VALUES (226, 1, NULL, 'la_country_UMI', 'UMI', 'UM');
INSERT INTO StdDestinations VALUES (227, 1, NULL, 'la_country_URY', 'URY', 'UY');
INSERT INTO StdDestinations VALUES (228, 1, NULL, 'la_country_UZB', 'UZB', 'UZ');
INSERT INTO StdDestinations VALUES (229, 1, NULL, 'la_country_VUT', 'VUT', 'VU');
INSERT INTO StdDestinations VALUES (230, 1, NULL, 'la_country_VAT', 'VAT', 'VA');
INSERT INTO StdDestinations VALUES (231, 1, NULL, 'la_country_VEN', 'VEN', 'VE');
INSERT INTO StdDestinations VALUES (232, 1, NULL, 'la_country_VNM', 'VNM', 'VN');
INSERT INTO StdDestinations VALUES (233, 1, NULL, 'la_country_VGB', 'VGB', 'VG');
INSERT INTO StdDestinations VALUES (234, 1, NULL, 'la_country_VIR', 'VIR', 'VI');
INSERT INTO StdDestinations VALUES (235, 1, NULL, 'la_country_WLF', 'WLF', 'WF');
INSERT INTO StdDestinations VALUES (236, 1, NULL, 'la_country_ESH', 'ESH', 'EH');
INSERT INTO StdDestinations VALUES (237, 1, NULL, 'la_country_YEM', 'YEM', 'YE');
INSERT INTO StdDestinations VALUES (238, 1, NULL, 'la_country_YUG', 'YUG', 'YU');
INSERT INTO StdDestinations VALUES (239, 1, NULL, 'la_country_ZMB', 'ZMB', 'ZM');
INSERT INTO StdDestinations VALUES (240, 1, NULL, 'la_country_ZWE', 'ZWE', 'ZW');
INSERT INTO StdDestinations VALUES (370, 2, 38, 'la_state_YT', 'YT', NULL);
INSERT INTO StdDestinations VALUES (369, 2, 38, 'la_state_SK', 'SK', NULL);
INSERT INTO StdDestinations VALUES (368, 2, 38, 'la_state_QC', 'QC', NULL);
INSERT INTO StdDestinations VALUES (367, 2, 38, 'la_state_PE', 'PE', NULL);
INSERT INTO StdDestinations VALUES (366, 2, 38, 'la_state_ON', 'ON', NULL);
INSERT INTO StdDestinations VALUES (365, 2, 38, 'la_state_NU', 'NU', NULL);
INSERT INTO StdDestinations VALUES (364, 2, 38, 'la_state_NS', 'NS', NULL);
INSERT INTO StdDestinations VALUES (363, 2, 38, 'la_state_NT', 'NT', NULL);
INSERT INTO StdDestinations VALUES (362, 2, 38, 'la_state_NL', 'NL', NULL);
INSERT INTO StdDestinations VALUES (361, 2, 38, 'la_state_NB', 'NB', NULL);
INSERT INTO StdDestinations VALUES (360, 2, 38, 'la_state_MB', 'MB', NULL);
INSERT INTO StdDestinations VALUES (359, 2, 38, 'la_state_BC', 'BC', NULL);
INSERT INTO StdDestinations VALUES (358, 2, 38, 'la_state_AB', 'AB', NULL);
INSERT INTO StdDestinations VALUES (357, 2, 225, 'la_state_DC', 'DC', NULL);
INSERT INTO StdDestinations VALUES (356, 2, 225, 'la_state_WY', 'WY', NULL);
INSERT INTO StdDestinations VALUES (355, 2, 225, 'la_state_WI', 'WI', NULL);
INSERT INTO StdDestinations VALUES (354, 2, 225, 'la_state_WV', 'WV', NULL);
INSERT INTO StdDestinations VALUES (353, 2, 225, 'la_state_WA', 'WA', NULL);
INSERT INTO StdDestinations VALUES (352, 2, 225, 'la_state_VA', 'VA', NULL);
INSERT INTO StdDestinations VALUES (351, 2, 225, 'la_state_VT', 'VT', NULL);
INSERT INTO StdDestinations VALUES (350, 2, 225, 'la_state_UT', 'UT', NULL);
INSERT INTO StdDestinations VALUES (349, 2, 225, 'la_state_TX', 'TX', NULL);
INSERT INTO StdDestinations VALUES (348, 2, 225, 'la_state_TN', 'TN', NULL);
INSERT INTO StdDestinations VALUES (347, 2, 225, 'la_state_SD', 'SD', NULL);
INSERT INTO StdDestinations VALUES (346, 2, 225, 'la_state_SC', 'SC', NULL);
INSERT INTO StdDestinations VALUES (345, 2, 225, 'la_state_RI', 'RI', NULL);
INSERT INTO StdDestinations VALUES (344, 2, 225, 'la_state_PR', 'PR', NULL);
INSERT INTO StdDestinations VALUES (343, 2, 225, 'la_state_PA', 'PA', NULL);
INSERT INTO StdDestinations VALUES (342, 2, 225, 'la_state_OR', 'OR', NULL);
INSERT INTO StdDestinations VALUES (341, 2, 225, 'la_state_OK', 'OK', NULL);
INSERT INTO StdDestinations VALUES (340, 2, 225, 'la_state_OH', 'OH', NULL);
INSERT INTO StdDestinations VALUES (339, 2, 225, 'la_state_ND', 'ND', NULL);
INSERT INTO StdDestinations VALUES (338, 2, 225, 'la_state_NC', 'NC', NULL);
INSERT INTO StdDestinations VALUES (337, 2, 225, 'la_state_NY', 'NY', NULL);
INSERT INTO StdDestinations VALUES (336, 2, 225, 'la_state_NM', 'NM', NULL);
INSERT INTO StdDestinations VALUES (335, 2, 225, 'la_state_NJ', 'NJ', NULL);
INSERT INTO StdDestinations VALUES (334, 2, 225, 'la_state_NH', 'NH', NULL);
INSERT INTO StdDestinations VALUES (333, 2, 225, 'la_state_NV', 'NV', NULL);
INSERT INTO StdDestinations VALUES (332, 2, 225, 'la_state_NE', 'NE', NULL);
INSERT INTO StdDestinations VALUES (331, 2, 225, 'la_state_MT', 'MT', NULL);
INSERT INTO StdDestinations VALUES (330, 2, 225, 'la_state_MO', 'MO', NULL);
INSERT INTO StdDestinations VALUES (329, 2, 225, 'la_state_MS', 'MS', NULL);
INSERT INTO StdDestinations VALUES (328, 2, 225, 'la_state_MN', 'MN', NULL);
INSERT INTO StdDestinations VALUES (327, 2, 225, 'la_state_MI', 'MI', NULL);
INSERT INTO StdDestinations VALUES (326, 2, 225, 'la_state_MA', 'MA', NULL);
INSERT INTO StdDestinations VALUES (325, 2, 225, 'la_state_MD', 'MD', NULL);
INSERT INTO StdDestinations VALUES (324, 2, 225, 'la_state_ME', 'ME', NULL);
INSERT INTO StdDestinations VALUES (323, 2, 225, 'la_state_LA', 'LA', NULL);
INSERT INTO StdDestinations VALUES (322, 2, 225, 'la_state_KY', 'KY', NULL);
INSERT INTO StdDestinations VALUES (321, 2, 225, 'la_state_KS', 'KS', NULL);
INSERT INTO StdDestinations VALUES (320, 2, 225, 'la_state_IA', 'IA', NULL);
INSERT INTO StdDestinations VALUES (319, 2, 225, 'la_state_IN', 'IN', NULL);
INSERT INTO StdDestinations VALUES (318, 2, 225, 'la_state_IL', 'IL', NULL);
INSERT INTO StdDestinations VALUES (317, 2, 225, 'la_state_ID', 'ID', NULL);
INSERT INTO StdDestinations VALUES (316, 2, 225, 'la_state_HI', 'HI', NULL);
INSERT INTO StdDestinations VALUES (315, 2, 225, 'la_state_GA', 'GA', NULL);
INSERT INTO StdDestinations VALUES (314, 2, 225, 'la_state_FL', 'FL', NULL);
INSERT INTO StdDestinations VALUES (313, 2, 225, 'la_state_DE', 'DE', NULL);
INSERT INTO StdDestinations VALUES (312, 2, 225, 'la_state_CT', 'CT', NULL);
INSERT INTO StdDestinations VALUES (311, 2, 225, 'la_state_CO', 'CO', NULL);
INSERT INTO StdDestinations VALUES (310, 2, 225, 'la_state_CA', 'CA', NULL);
INSERT INTO StdDestinations VALUES (309, 2, 225, 'la_state_AR', 'AR', NULL);
INSERT INTO StdDestinations VALUES (308, 2, 225, 'la_state_AZ', 'AZ', NULL);
INSERT INTO StdDestinations VALUES (307, 2, 225, 'la_state_AK', 'AK', NULL);
INSERT INTO StdDestinations VALUES (306, 2, 225, 'la_state_AL', 'AL', NULL);
INSERT INTO StylesheetSelectors VALUES (169, 8, 'Calendar''s selected days', '.calendar tbody .selected', 'a:0:{}', '', 1, 'font-weight: bold;\r\nbackground-color: #9ED7ED;\r\nborder: 1px solid #83B2C5;', 0);
INSERT INTO StylesheetSelectors VALUES (118, 8, 'Data grid row', 'td.block-data-row', 'a:0:{}', '', 2, 'border-bottom: 1px solid #cccccc;', 48);
INSERT INTO StylesheetSelectors VALUES (81, 8, '"More" link', 'a.link-more', 'a:0:{}', '', 2, 'text-decoration: underline;', 64);
INSERT INTO StylesheetSelectors VALUES (88, 8, 'Block data, separated rows', 'td.block-data-grid', 'a:0:{}', '', 2, 'border: 1px solid #cccccc;', 48);
INSERT INTO StylesheetSelectors VALUES (42, 8, 'Block Header', 'td.block-header', 'a:4:{s:5:"color";s:16:"rgb(0, 159, 240)";s:9:"font-size";s:4:"20px";s:11:"font-weight";s:6:"normal";s:7:"padding";s:3:"5px";}', 'Block Header', 1, 'font-family: Verdana, Helvetica, sans-serif;', 0);
INSERT INTO StylesheetSelectors VALUES (76, 8, 'Navigation bar menu', 'tr.head-nav td', 'a:0:{}', '', 1, 'vertical-align: middle;', 0);
INSERT INTO StylesheetSelectors VALUES (48, 8, 'Block data', 'td.block-data', 'a:2:{s:9:"font-size";s:5:"12px;";s:7:"padding";s:3:"5px";}', '', 1, '', 0);
INSERT INTO StylesheetSelectors VALUES (78, 8, 'Body main style', 'body', 'a:0:{}', '', 1, 'padding: 0px; \r\nbackground-color: #ffffff; \r\nfont-family: arial, verdana, helvetica; \r\nfont-size: small;\r\nwidth: auto;\r\nmargin: 0px;', 0);
INSERT INTO StylesheetSelectors VALUES (58, 8, 'Main table', 'table.main-table', 'a:0:{}', '', 1, 'width: 770px;\r\nmargin: 0px;\r\n/*table-layout: fixed;*/', 0);
INSERT INTO StylesheetSelectors VALUES (79, 8, 'Block: header of data block', 'span.block-data-grid-header', 'a:0:{}', '', 1, 'font-family: Arial, Helvetica, sans-serif;\r\ncolor: #009DF6;\r\nfont-size: 12px;\r\nfont-weight: bold;\r\nbackground-color: #E6EEFF;\r\npadding: 6px;\r\nwhite-space: nowrap;', 0);
INSERT INTO StylesheetSelectors VALUES (64, 8, 'Link', 'a', 'a:0:{}', '', 1, '', 0);
INSERT INTO StylesheetSelectors VALUES (46, 8, 'Product title link', 'a.link-product1', 'a:0:{}', 'Product title link', 1, 'color: #62A1DE;\r\nfont-size: 14px;\r\nfont-weight: bold;\r\nline-height: 20px;\r\npadding-bottom: 10px;', 0);
INSERT INTO StylesheetSelectors VALUES (75, 8, 'Copy of Main path link', 'table.main-path td a:hover', 'a:0:{}', '', 1, 'color: #ffffff;', 0);
INSERT INTO StylesheetSelectors VALUES (160, 8, 'Current item in navigation bar', '.checkout-step-current', 'a:0:{}', '', 1, 'color: #A20303;\r\nfont-weight: bold;', 0);
INSERT INTO StylesheetSelectors VALUES (51, 8, 'Right block data', 'td.right-block-data', 'a:1:{s:9:"font-size";s:4:"11px";}', '', 2, 'padding: 7px;\r\nbackground: #e3edf6 url("/in-commerce4/themes/default/img/bgr_login.jpg") repeat-y scroll left top;\r\nborder-bottom: 1px solid #64a1df;', 48);
INSERT INTO StylesheetSelectors VALUES (67, 8, 'Pagination bar: text', 'table.block-pagination td', 'a:3:{s:5:"color";s:7:"#8B898B";s:9:"font-size";s:4:"12px";s:11:"font-weight";s:6:"normal";}', '', 1, '', 0);
INSERT INTO StylesheetSelectors VALUES (45, 8, 'Category link', 'a.subcat', 'a:0:{}', 'Category link', 1, 'color: #2069A4', 0);
INSERT INTO StylesheetSelectors VALUES (68, 8, 'Pagination bar: link', 'table.block-pagination td a', 'a:3:{s:5:"color";s:7:"#8B898B";s:9:"font-size";s:5:"12px;";s:11:"font-weight";s:6:"normal";}', '', 1, '', 0);
INSERT INTO StylesheetSelectors VALUES (69, 8, 'Product description in product list', '.product-list-description', 'a:2:{s:5:"color";s:7:"#8B898B";s:9:"font-size";s:4:"12px";}', '', 1, '', 0);
INSERT INTO StylesheetSelectors VALUES (73, 8, 'Main path link', 'table.main-path td a', 'a:0:{}', '', 1, 'color: #d5e231;', 0);
INSERT INTO StylesheetSelectors VALUES (83, 8, 'Product title link in list (shopping cart)', 'a.link-product-cart', 'a:0:{}', 'Product title link', 1, 'color: #18559C;\r\nfont-size: 12px;\r\nfont-weight: bold;\r\ntext-decoration: none;\r\n\r\n', 0);
INSERT INTO StylesheetSelectors VALUES (72, 8, 'Main path block text', 'table.main-path td', 'a:0:{}', '', 1, 'color: #ffffff;\r\nfont-size: 10px;\r\nfont-weight: normal;\r\npadding: 1px;\r\n', 0);
INSERT INTO StylesheetSelectors VALUES (61, 8, 'Block: header of data table', 'td.block-data-grid-header', 'a:6:{s:4:"font";s:28:"Arial, Helvetica, sans-serif";s:5:"color";s:7:"#009DF6";s:9:"font-size";s:4:"12px";s:11:"font-weight";s:4:"bold";s:16:"background-color";s:7:"#E6EEFF";s:7:"padding";s:3:"6px";}', '', 1, 'white-space: nowrap;\r\npadding-left: 10px;\r\n/*\r\nbackground-image: url(/in-commerce4/themes/default/img/bullet1.gif);\r\nbackground-position: 10px 12px;\r\nbackground-repeat: no-repeat;\r\n*/', 0);
INSERT INTO StylesheetSelectors VALUES (65, 8, 'Link in product list additional row', 'td.product-list-additional a', 'a:1:{s:5:"color";s:7:"#8B898B";}', '', 2, '', 64);
INSERT INTO StylesheetSelectors VALUES (55, 8, 'Main table, left column', 'td.main-column-left', 'a:0:{}', '', 1, 'width:180px;\r\nborder: 1px solid #62A1DE;\r\nborder-top: 0px;', 0);
INSERT INTO StylesheetSelectors VALUES (70, 8, 'Product title link in list (category)', 'a.link-product-category', 'a:0:{}', 'Product title link', 1, 'color: #18559C;\r\nfont-size: 12px;\r\nfont-weight: bold;\r\ntext-decoration: none;\r\n\r\n', 0);
INSERT INTO StylesheetSelectors VALUES (66, 8, 'Pagination bar block', 'table.block-pagination', 'a:0:{}', '', 1, '', 0);
INSERT INTO StylesheetSelectors VALUES (49, 8, 'Bulleted list inside block', 'td.block-data ul li', 'a:0:{}', '', 1, ' list-style-image: url(/in-commerce4/themes/default/img/bullet2.gif);\r\n margin-bottom: 10px;\r\n font-size: 11px;', 0);
INSERT INTO StylesheetSelectors VALUES (87, 8, 'Cart item input form element', 'td.cart-item-atributes input', 'a:0:{}', '', 1, 'border: 1px solid #7BB2E6;', 0);
INSERT INTO StylesheetSelectors VALUES (119, 8, 'Data grid row header', 'td.block-data-row-hdr', 'a:0:{}', 'Used in order preview', 2, 'background-color: #eeeeee;\r\nborder-bottom: 1px solid #dddddd;\r\nborder-top: 1px solid #cccccc;\r\nfont-weight: bold;', 48);
INSERT INTO StylesheetSelectors VALUES (82, 8, '"More" link image', 'a.link-more img', 'a:0:{}', '', 2, 'text-decoration: none;\r\npadding-left: 5px;', 64);
INSERT INTO StylesheetSelectors VALUES (63, 8, 'Additional info under product description in list', 'td.product-list-additional', 'a:5:{s:5:"color";s:7:"#8B898B";s:9:"font-size";s:4:"11px";s:11:"font-weight";s:6:"normal";s:10:"border-top";s:18:"1px dashed #8B898B";s:13:"border-bottom";s:18:"1px dashed #8B898B";}', '', 2, '', 48);
INSERT INTO StylesheetSelectors VALUES (43, 8, 'Block', 'table.block', 'a:2:{s:16:"background-color";s:7:"#E3EEF9";s:6:"border";s:17:"1px solid #64A1DF";}', 'Block', 1, 'border: 0; \r\nmargin-bottom: 1px;\r\nwidth: 100%;', 0);
INSERT INTO StylesheetSelectors VALUES (84, 8, 'Cart item cell', 'td.cart-item', 'a:0:{}', '', 1, 'background-color: #F6FAFF;\r\nborder-left: 1px solid #ffffff;\r\nborder-bottom: 1px solid #ffffff;\r\npadding: 4px;', 0);
INSERT INTO StylesheetSelectors VALUES (57, 8, 'Main table, right column', 'td.main-column-right', 'a:0:{}', '', 1, 'width:220px;\r\nborder: 1px solid #62A1DE;\r\nborder-top: 0px;', 0);
INSERT INTO StylesheetSelectors VALUES (161, 8, 'Block for sub categories', 'td.block-data-subcats', 'a:0:{}', '', 2, ' background: #FFFFFF\r\nurl(/in-commerce4/themes/default/in-commerce/img/bgr_categories.jpg);\r\n background-repeat: no-repeat;\r\n background-position: top right;\r\nborder-bottom: 5px solid #DEEAFF;\r\npadding-left: 10px;', 48);
INSERT INTO StylesheetSelectors VALUES (77, 8, 'Left block header', 'td.left-block-header', 'a:0:{}', '', 2, 'font-family : verdana, helvetica, sans-serif;\r\ncolor : #ffffff;\r\nfont-size : 12px;\r\nfont-weight : bold;\r\ntext-decoration : none;\r\nbackground-color: #64a1df;\r\npadding: 5px;\r\npadding-left: 7px;', 42);
INSERT INTO StylesheetSelectors VALUES (80, 8, 'Right block data - text', 'td.right-block-data td', 'a:1:{s:9:"font-size";s:5:"11px;";}', '', 2, '', 48);
INSERT INTO StylesheetSelectors VALUES (53, 8, 'Right block header', 'td.right-block-header', 'a:0:{}', '', 2, 'font-family : verdana, helvetica, sans-serif;\r\ncolor : #ffffff;\r\nfont-size : 12px;\r\nfont-weight : bold;\r\ntext-decoration : none;\r\nbackground-color: #64a1df;\r\npadding: 5px;\r\npadding-left: 7px;', 42);
INSERT INTO StylesheetSelectors VALUES (85, 8, 'Cart item cell with attributes', 'td.cart-item-attributes', 'a:0:{}', '', 1, 'background-color: #E6EEFF;\r\nborder-left: 1px solid #ffffff;\r\nborder-bottom: 1px solid #ffffff;\r\npadding: 4px;\r\ntext-align: center;\r\nvertical-align: middle;\r\nfont-size: 12px;\r\nfont-weight: normal;', 0);
INSERT INTO StylesheetSelectors VALUES (86, 8, 'Cart item cell with name', 'td.cart-item-name', 'a:0:{}', '', 1, 'background-color: #F6FAFF;\r\nborder-left: 1px solid #ffffff;\r\nborder-bottom: 1px solid #ffffff;\r\npadding: 3px;', 0);
INSERT INTO StylesheetSelectors VALUES (47, 8, 'Block content of featured product', 'td.featured-block-data', 'a:0:{}', '', 1, 'font-family: Arial,Helvetica,sans-serif;\r\nfont-size: 12px;', 0);
INSERT INTO StylesheetSelectors VALUES (56, 8, 'Main table, middle column', 'td.main-column-center', 'a:0:{}', '', 1, '\r\n', 0);
INSERT INTO StylesheetSelectors VALUES (50, 8, 'Product title link in list', 'a.link-product2', 'a:0:{}', 'Product title link', 1, 'color: #62A1DE;\r\nfont-size: 12px;\r\nfont-weight: bold;\r\ntext-decoration: none;\r\n\r\n', 0);
INSERT INTO StylesheetSelectors VALUES (71, 8, 'Main path block', 'table.main-path', 'a:0:{}', '', 1, 'background: #61b0ec url("/in-commerce4/themes/default/img/bgr_path.jpg") repeat-y scroll left top;\r\nwidth: 100%;\r\nmargin-bottom: 1px;\r\nmargin-right: 1px; \r\nmargin-left: 1px;', 0);
INSERT INTO StylesheetSelectors VALUES (62, 8, 'Block: columns header for data table', 'table.block-no-border th', 'a:6:{s:4:"font";s:28:"Arial, Helvetica, sans-serif";s:5:"color";s:7:"#18559C";s:9:"font-size";s:4:"11px";s:11:"font-weight";s:4:"bold";s:16:"background-color";s:7:"#B4D2EE";s:7:"padding";s:3:"6px";}', '', 1, 'text-align: left;', 0);
INSERT INTO StylesheetSelectors VALUES (59, 8, 'Block without border', 'table.block-no-border', 'a:0:{}', '', 1, 'border: 0px; \r\nmargin-bottom: 10px;\r\nwidth: 100%;', 0);
INSERT INTO StylesheetSelectors VALUES (74, 8, 'Main path language selector cell', 'td.main-path-language', 'a:0:{}', '', 1, 'vertical-align: middle;\r\ntext-align: right;\r\npadding-right: 6px;', 0);
INSERT INTO StylesheetSelectors VALUES (171, 8, 'Calendar''s highlighted day', '.calendar tbody .hilite', 'a:0:{}', '', 1, 'background-color: #f6f6f6;\r\nborder: 1px solid #83B2C5 !important;', 0);
INSERT INTO StylesheetSelectors VALUES (175, 8, 'Calendar''s days', '.calendar tbody .day', 'a:0:{}', '', 1, 'text-align: right;\r\npadding: 2px 4px 2px 2px;\r\nwidth: 2em;\r\nborder: 1px solid #fefefe;', 0);
INSERT INTO StylesheetSelectors VALUES (170, 8, 'Calendar''s weekends', '.calendar .weekend', 'a:0:{}', '', 1, 'color: #990000;', 0);
INSERT INTO StylesheetSelectors VALUES (173, 8, 'Calendar''s control buttons', '.calendar .calendar_button', 'a:0:{}', '', 1, 'color: black;\r\nfont-size: 12px;\r\nbackground-color: #eeeeee;', 0);
INSERT INTO StylesheetSelectors VALUES (174, 8, 'Calendar''s day names', '.calendar thead .name', 'a:0:{}', '', 1, 'background-color: #DEEEF6;\r\nborder-bottom: 1px solid #000000;', 0);
INSERT INTO StylesheetSelectors VALUES (172, 8, 'Calendar''s top and bottom titles', '.calendar .title', 'a:0:{}', '', 1, 'color: #FFFFFF;\r\nbackground-color: #62A1DE;\r\nborder: 1px solid #107DC5;\r\nborder-top: 0px;\r\npadding: 1px;', 0);
INSERT INTO StylesheetSelectors VALUES (60, 8, 'Block header for featured product', 'td.featured-block-header', 'a:0:{}', '', 2, '\r\n', 42);
INSERT INTO StylesheetSelectors VALUES (54, 8, 'Right block', 'table.right-block', 'a:0:{}', '', 2, 'background-color: #E3EEF9;\r\nborder: 0px;\r\nwidth: 100%;', 43);
INSERT INTO StylesheetSelectors VALUES (44, 8, 'Block content', 'td.block-data-big', 'a:0:{}', 'Block content', 1, ' background: #DEEEF6\r\nurl(/in-commerce4/themes/default/img/menu_bg.gif);\r\n background-repeat: no-repeat;\r\n background-position: top right;\r\n', 0);
INSERT INTO Stylesheets VALUES (8, 'Default', 'In-Portal Default Theme', '', 1124952555, 1);
\ No newline at end of file
Property changes on: trunk/admin/install/inportal_data.sql
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.71
\ No newline at end of property
+1.72
\ No newline at end of property
Index: trunk/admin/install/langpacks/english.lang
===================================================================
--- trunk/admin/install/langpacks/english.lang (revision 6427)
+++ trunk/admin/install/langpacks/english.lang (revision 6428)
@@ -1,2270 +1,2272 @@
<LANGUAGES>
<LANGUAGE PackName="English" Encoding="base64"><DATEFORMAT>m/d/Y</DATEFORMAT><TIMEFORMAT>g:i:s A</TIMEFORMAT><INPUTDATEFORMAT>m/d/Y</INPUTDATEFORMAT><INPUTTIMEFORMAT>g:i:s A</INPUTTIMEFORMAT><DECIMAL>.</DECIMAL><THOUSANDS>,</THOUSANDS><CHARSET>iso-8859-1</CHARSET><UNITSYSTEM>2</UNITSYSTEM>
<PHRASES>
<PHRASE Label=" lu_resetpw_confirm_text" Module="In-Portal" Type="0">WW91ciBwYXNzd29yZCBoYXMgYmVlbiByZXNldC4gWW91IHdpbGwgcmVjZWl2ZSB5b3VyIG5ldyBwYXNzd29yZCBpbiB0aGUgZW1haWwgc2hvcnRseS4=</PHRASE>
<PHRASE Label="la_Active" Module="In-Portal" Type="1">QWN0aXZl</PHRASE>
<PHRASE Label="la_added" Module="In-Portal" Type="1">QWRkZWQ=</PHRASE>
<PHRASE Label="la_AddTo" Module="In-Portal" Type="1">QWRkIFRv</PHRASE>
<PHRASE Label="la_and" Module="In-Portal" Type="1">YW5k</PHRASE>
<PHRASE Label="la_approve_description" Module="In-Portal" Type="1">QWN0aXZl</PHRASE>
<PHRASE Label="la_Article_Author" Module="In-Portal" Type="1">QXV0aG9y</PHRASE>
<PHRASE Label="la_Article_Date" Module="In-Portal" Type="1">RGF0ZQ==</PHRASE>
<PHRASE Label="la_Article_Excerpt" Module="In-Portal" Type="1">QXJ0aWNsZSBFeGNlcnB0</PHRASE>
<PHRASE Label="la_Article_Hits" Module="In-Portal" Type="1">SGl0cw==</PHRASE>
<PHRASE Label="la_Article_Rating" Module="In-Portal" Type="1">UmF0aW5n</PHRASE>
<PHRASE Label="la_article_reviewed" Module="In-Portal" Type="1">QXJ0aWNsZSByZXZpZXdlZA==</PHRASE>
<PHRASE Label="la_Article_Title" Module="In-Portal" Type="1">QXJ0aWNsZSBUaXRsZQ==</PHRASE>
<PHRASE Label="la_Auto" Module="In-Portal" Type="1">QXV0bw==</PHRASE>
<PHRASE Label="la_Automatic" Module="In-Portal" Type="1">QXV0b21hdGlj</PHRASE>
<PHRASE Label="la_Background" Module="In-Portal" Type="1">QmFja2dyb3VuZA==</PHRASE>
<PHRASE Label="la_ban_email" Module="In-Portal" Type="1">QmFuIGVtYWlsIGFkZHJlc3M=</PHRASE>
<PHRASE Label="la_ban_ip" Module="In-Portal" Type="1">QmFuIElQIGFkZHJlc3M=</PHRASE>
<PHRASE Label="la_ban_login" Module="In-Portal" Type="1">QmFuIHVzZXIgbmFtZQ==</PHRASE>
<PHRASE Label="la_bb" Module="In-Portal" Type="1">SW1wb3J0ZWQ=</PHRASE>
<PHRASE Label="la_Borders" Module="In-Portal" Type="1">Qm9yZGVycw==</PHRASE>
<PHRASE Label="la_btn_Change" Module="In-Portal" Type="1">Q2hhbmdl</PHRASE>
<PHRASE Label="la_btn_Down" Module="In-Portal" Type="1">RG93bg==</PHRASE>
<PHRASE Label="la_btn_Up" Module="In-Portal" Type="1">VXA=</PHRASE>
<PHRASE Label="la_button_ok" Module="In-Portal" Type="1">T0s=</PHRASE>
<PHRASE Label="la_bytes" Module="In-Portal" Type="1">Ynl0ZXM=</PHRASE>
<PHRASE Label="la_by_theme" Module="In-Portal" Type="1">QnkgdGhlbWU=</PHRASE>
<PHRASE Label="la_Cancel" Module="In-Portal" Type="1">Q2FuY2Vs</PHRASE>
<PHRASE Label="la_category" Module="In-Portal" Type="1">Q2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_Category_Date" Module="In-Portal" Type="1">RGF0ZQ==</PHRASE>
<PHRASE Label="la_category_daysnew_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGRheXMgZm9yIGEgY2F0LiB0byBiZSBORVc=</PHRASE>
<PHRASE Label="la_Category_Description" Module="In-Portal" Type="1">Q2F0ZWdvcnkgRGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="la_category_metadesc" Module="In-Portal" Type="1">RGVmYXVsdCBNRVRBIGRlc2NyaXB0aW9u</PHRASE>
<PHRASE Label="la_category_metakey" Module="In-Portal" Type="1">RGVmYXVsdCBNRVRBIEtleXdvcmRz</PHRASE>
<PHRASE Label="la_Category_Name" Module="In-Portal" Type="1">Q2F0ZWdvcnkgTmFtZQ==</PHRASE>
<PHRASE Label="la_category_perpage_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGNhdGVnb3JpZXMgcGVyIHBhZ2U=</PHRASE>
<PHRASE Label="la_category_perpage__short_prompt" Module="In-Portal" Type="1">Q2F0ZWdvcmllcyBQZXIgUGFnZSAoU2hvcnRsaXN0KQ==</PHRASE>
<PHRASE Label="la_Category_Pick" Module="In-Portal" Type="1">UGljaw==</PHRASE>
<PHRASE Label="la_Category_Pop" Module="In-Portal" Type="1">UG9wdWxhcml0eQ==</PHRASE>
<PHRASE Label="la_category_showpick_prompt" Module="In-Portal" Type="1">RGlzcGxheSBlZGl0b3IgUElDS3MgYWJvdmUgcmVndWxhciBjYXRlZ29yaWVz</PHRASE>
<PHRASE Label="la_category_sortfield2_prompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_category_sortfield_prompt" Module="In-Portal" Type="1">T3JkZXIgY2F0ZWdvcmllcyBieQ==</PHRASE>
<PHRASE Label="la_Close" Module="In-Portal" Type="1">Q2xvc2U=</PHRASE>
<PHRASE Label="la_ColHeader_AltValue" Module="In-Portal" Type="1">QWx0IFZhbHVl</PHRASE>
<PHRASE Label="la_ColHeader_BadWord" Module="In-Portal" Type="1">Q2Vuc29yZWQgV29yZA==</PHRASE>
<PHRASE Label="la_ColHeader_CreatedOn" Module="In-Portal" Type="2">Q3JlYXRlZCBPbg==</PHRASE>
<PHRASE Label="la_ColHeader_Date" Module="In-Portal" Type="1">RGF0ZS9UaW1l</PHRASE>
<PHRASE Label="la_ColHeader_Enabled" Module="In-Portal" Type="1">U3RhdHVz</PHRASE>
<PHRASE Label="la_ColHeader_FieldLabel" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_ColHeader_FieldName" Module="In-Portal" Type="1">RmllbGQgTmFtZQ==</PHRASE>
<PHRASE Label="la_Colheader_GroupType" Module="In-Portal" Type="1">VHlwZQ==</PHRASE>
<PHRASE Label="la_ColHeader_Image" Module="In-Portal" Type="1">SW1hZ2U=</PHRASE>
<PHRASE Label="la_ColHeader_InheritFrom" Module="In-Portal" Type="1">SW5oZXJpdGVkIEZyb20=</PHRASE>
<PHRASE Label="la_ColHeader_Item" Module="In-Portal" Type="1">SXRlbQ==</PHRASE>
<PHRASE Label="la_Colheader_ItemField" Module="In-Portal" Type="1">SXRlbSBGaWVsZA==</PHRASE>
<PHRASE Label="la_ColHeader_ItemType" Module="In-Portal" Type="1">SXRlbSBUeXBl</PHRASE>
<PHRASE Label="la_Colheader_ItemValue" Module="In-Portal" Type="1">SXRlbSBWYWx1ZQ==</PHRASE>
<PHRASE Label="la_ColHeader_ItemVerb" Module="In-Portal" Type="1">Q29tcGFyaXNvbiBPcGVyYXRvcg==</PHRASE>
<PHRASE Label="la_ColHeader_Name" Module="In-Portal" Type="2">TGluayBOYW1l</PHRASE>
<PHRASE Label="la_ColHeader_PermAccess" Module="In-Portal" Type="1">QWNjZXNz</PHRASE>
<PHRASE Label="la_ColHeader_PermInherited" Module="In-Portal" Type="1">SW5oZXJpdGVk</PHRASE>
<PHRASE Label="la_ColHeader_Poster" Module="In-Portal" Type="1">UG9zdGVy</PHRASE>
<PHRASE Label="la_ColHeader_Preview" Module="In-Portal" Type="1">UHJldmlldw==</PHRASE>
<PHRASE Label="la_ColHeader_Replacement" Module="In-Portal" Type="1">UmVwbGFjZW1lbnQ=</PHRASE>
<PHRASE Label="la_ColHeader_Reply" Module="In-Portal" Type="1">UmVwbGllcw==</PHRASE>
<PHRASE Label="la_ColHeader_RuleType" Module="In-Portal" Type="1">UnVsZSBUeXBl</PHRASE>
<PHRASE Label="la_ColHeader_Status" Module="In-Portal" Type="1">U3RhdHVz</PHRASE>
<PHRASE Label="la_ColHeader_Topic" Module="In-Portal" Type="1">VG9waWM=</PHRASE>
<PHRASE Label="la_ColHeader_Url" Module="In-Portal" Type="1">VVJM</PHRASE>
<PHRASE Label="la_ColHeader_ValidationStatus" Module="In-Portal" Type="2">U3RhdHVz</PHRASE>
<PHRASE Label="la_ColHeader_ValidationTime" Module="In-Portal" Type="2">VmFsaWRhdGVkIE9u</PHRASE>
<PHRASE Label="la_ColHeader_Value" Module="In-Portal" Type="1">VmFsdWU=</PHRASE>
<PHRASE Label="la_ColHeader_Views" Module="In-Portal" Type="1">Vmlld3M=</PHRASE>
<PHRASE Label="la_col_Access" Module="In-Portal" Type="1">QWNjZXNz</PHRASE>
<PHRASE Label="la_col_AdditionalPermissions" Module="In-Portal" Type="1">QWRkaXRpb25hbA==</PHRASE>
<PHRASE Label="la_col_Basedon" Module="In-Portal" Type="1">QmFzZWQgT24=</PHRASE>
<PHRASE Label="la_col_Description" Module="In-Portal" Type="1">RGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="la_col_Duration" Module="In-Portal" Type="1">RHVyYXRpb24=</PHRASE>
<PHRASE Label="la_col_DurationType" Module="In-Portal" Type="1">RHVyYXRpb24gVHlwZQ==</PHRASE>
<PHRASE Label="la_col_Effective" Module="In-Portal" Type="1">RWZmZWN0aXZl</PHRASE>
<PHRASE Label="la_col_Email" Module="In-Portal" Type="1">RW1haWw=</PHRASE>
<PHRASE Label="la_col_Event" Module="In-Portal" Type="1">RXZlbnQ=</PHRASE>
<PHRASE Label="la_col_FirstName" Module="In-Portal" Type="1">Rmlyc3QgTmFtZQ==</PHRASE>
<PHRASE Label="la_col_GroupName" Module="In-Portal" Type="1">R3JvdXAgTmFtZQ==</PHRASE>
<PHRASE Label="la_col_Id" Module="In-Portal" Type="1">SUQ=</PHRASE>
<PHRASE Label="la_col_Inherited" Module="In-Portal" Type="1">SW5oZXJpdGVk</PHRASE>
<PHRASE Label="la_col_InheritedFrom" Module="In-Portal" Type="1">SW5oZXJpdGVkIEZyb20=</PHRASE>
<PHRASE Label="la_col_IsSystem" Module="In-Portal" Type="1">U3lzdGVt</PHRASE>
<PHRASE Label="la_col_Label" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_col_LastChanged" Module="In-Portal" Type="1">TGFzdCBDaGFuZ2Vk</PHRASE>
<PHRASE Label="la_col_LastCompiled" Module="In-Portal" Type="1">TGFzdCBDb21waWxlZA==</PHRASE>
<PHRASE Label="la_col_LastName" Module="In-Portal" Type="1">TGFzdCBOYW1l</PHRASE>
<PHRASE Label="la_col_LinkUrl" Module="In-Portal" Type="1">TGluayBVUkw=</PHRASE>
<PHRASE Label="la_col_LocalName" Module="In-Portal" Type="1">TmFtZQ==</PHRASE>
<PHRASE Label="la_col_Module" Module="In-Portal" Type="1">TW9kdWxl</PHRASE>
<PHRASE Label="la_col_Name" Module="In-Portal" Type="1">TmFtZQ==</PHRASE>
<PHRASE Label="la_col_PackName" Module="In-Portal" Type="1">UGFjayBOYW1l</PHRASE>
<PHRASE Label="la_col_PermAdd" Module="In-Portal" Type="1">QWRk</PHRASE>
<PHRASE Label="la_col_PermDelete" Module="In-Portal" Type="1">RGVsZXRl</PHRASE>
<PHRASE Label="la_col_PermEdit" Module="In-Portal" Type="1">RWRpdA==</PHRASE>
<PHRASE Label="la_col_PermissionName" Module="In-Portal" Type="1">UGVybWlzc2lvbiBOYW1l</PHRASE>
<PHRASE Label="la_col_PermissionValue" Module="In-Portal" Type="1">QWNjZXNz</PHRASE>
<PHRASE Label="la_col_PermView" Module="In-Portal" Type="1">Vmlldw==</PHRASE>
<PHRASE Label="la_col_PhraseType" Module="In-Portal" Type="1">VHlwZQ==</PHRASE>
<PHRASE Label="la_col_PrimaryGroup" Module="In-Portal" Type="1">UHJpbWFyeSBHcm91cA==</PHRASE>
<PHRASE Label="la_col_PrimaryValue" Module="In-Portal" Type="1">UHJpbWFyeSBWYWx1ZQ==</PHRASE>
<PHRASE Label="la_col_SelectorName" Module="In-Portal" Type="1">U2VsZWN0b3I=</PHRASE>
<PHRASE Label="la_col_Status" Module="In-Portal" Type="1">U3RhdHVz</PHRASE>
<PHRASE Label="la_col_Translation" Module="In-Portal" Type="1">VmFsdWU=</PHRASE>
<PHRASE Label="la_col_Type" Module="In-Portal" Type="1">VHlwZQ==</PHRASE>
<PHRASE Label="la_col_UserCount" Module="In-Portal" Type="1">VXNlciBDb3VudA==</PHRASE>
<PHRASE Label="la_col_VisitDate" Module="In-Portal" Type="1">VmlzaXQgRGF0ZQ==</PHRASE>
<PHRASE Label="la_common_ascending" Module="In-Portal" Type="1">QXNjZW5kaW5n</PHRASE>
<PHRASE Label="la_common_CreatedOn" Module="In-Portal" Type="1">RGF0ZQ==</PHRASE>
<PHRASE Label="la_common_descending" Module="In-Portal" Type="1">RGVzY2VuZGluZw==</PHRASE>
<PHRASE Label="la_common_ReviewText" Module="In-Portal" Type="1">UmV2aWV3IFRleHQ=</PHRASE>
<PHRASE Label="la_configerror_review" Module="In-Portal" Type="1">UmV2aWV3IG5vdCBhZGRlZCBkdWUgdG8gYSBzeXN0ZW0gZXJyb3I=</PHRASE>
<PHRASE Label="la_config_backup_path" Module="In-Portal" Type="1">QmFja3VwIFBhdGg=</PHRASE>
<PHRASE Label="la_config_company" Module="In-Portal" Type="1">Q29tcGFueQ==</PHRASE>
<PHRASE Label="la_config_error_template" Module="In-Portal" Type="1">RmlsZSBub3QgZm91bmQgKDQwNCkgdGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_config_first_day_of_week" Module="In-Portal" Type="1">Rmlyc3QgRGF5IE9mIFdlZWs=</PHRASE>
<PHRASE Label="la_config_force_http" Module="In-Portal" Type="1">UmVkaXJlY3QgdG8gSFRUUCB3aGVuIFNTTCBpcyBub3QgcmVxdWlyZWQ=</PHRASE>
<PHRASE Label="la_config_name" Module="In-Portal" Type="1">TmFtZQ==</PHRASE>
<PHRASE Label="la_config_nopermission_template" Module="In-Portal" Type="1">SW5zdWZmaWNlbnQgcGVybWlzc2lvbnMgdGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_config_OutputCompressionLevel" Module="In-Portal" Type="1">R1pJUCBjb21wcmVzc2lvbiBsZXZlbCAwLTk=</PHRASE>
<PHRASE Label="la_config_reg_number" Module="In-Portal" Type="1">UmVnaXN0cmF0aW9uIE51bWJlcg==</PHRASE>
<PHRASE Label="la_config_require_ssl" Module="In-Portal" Type="1">UmVxdWlyZSBTU0wgZm9yIGxvZ2luICYgY2hlY2tvdXQ=</PHRASE>
<PHRASE Label="la_config_server_name" Module="In-Portal" Type="1">U2VydmVyIE5hbWU=</PHRASE>
<PHRASE Label="la_config_server_path" Module="In-Portal" Type="1">U2VydmVyIFBhdGg=</PHRASE>
<PHRASE Label="la_config_site_zone" Module="In-Portal" Type="1">VGltZSB6b25lIG9mIHRoZSBzaXRl</PHRASE>
<PHRASE Label="la_config_ssl_url" Module="In-Portal" Type="1">U1NMIEZ1bGwgVVJMIChodHRwczovL3d3dy5kb21haW4uY29tL3BhdGgp</PHRASE>
<PHRASE Label="la_config_time_server" Module="In-Portal" Type="1">VGltZSB6b25lIG9mIHRoZSBzZXJ2ZXI=</PHRASE>
<PHRASE Label="la_config_UseOutputCompression" Module="In-Portal" Type="1">RW5hYmxlIEhUTUwgR1pJUCBjb21wcmVzc2lvbg==</PHRASE>
<PHRASE Label="la_config_use_js_redirect" Module="In-Portal" Type="1">VXNlIEphdmFTY3JpcHQgcmVkaXJlY3Rpb24gYWZ0ZXIgbG9naW4vbG9nb3V0IChmb3IgSUlTKQ==</PHRASE>
<PHRASE Label="la_config_use_modrewrite" Module="In-Portal" Type="1">VXNlIE1PRCBSRVdSSVRF</PHRASE>
<PHRASE Label="la_config_use_modrewrite_with_ssl" Module="In-Portal" Type="1">RW5hYmxlIE1PRF9SRVdSSVRFIGZvciBTU0w=</PHRASE>
<PHRASE Label="la_config_website_address" Module="In-Portal" Type="1">V2Vic2l0ZSBhZGRyZXNz</PHRASE>
<PHRASE Label="la_config_website_name" Module="In-Portal" Type="1">V2Vic2l0ZSBuYW1l</PHRASE>
<PHRASE Label="la_config_web_address" Module="In-Portal" Type="1">V2ViIGFkZHJlc3M=</PHRASE>
<PHRASE Label="la_confirm_maintenance" Module="In-Portal" Type="1">VGhlIGNhdGVnb3J5IHRyZWUgbXVzdCBiZSB1cGRhdGVkIHRvIHJlZmxlY3QgdGhlIGxhdGVzdCBjaGFuZ2Vz</PHRASE>
<PHRASE Label="la_Continue" Module="In-Portal" Type="1">Q29udGludWU=</PHRASE>
<PHRASE Label="la_CreatedOn" Module="In-Portal" Type="1">Q3JlYXRlZCBPbg==</PHRASE>
<PHRASE Label="la_Credits_Title" Module="In-Portal" Type="1">Q3JlZGl0cw==</PHRASE>
<PHRASE Label="la_days" Module="In-Portal" Type="1">ZGF5cw==</PHRASE>
<PHRASE Label="la_Delete_Confirm" Module="In-Portal" Type="1">QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGUgaXRlbShzKT8gVGhpcyBhY3Rpb24gY2Fubm90IGJlIHVuZG9uZS4=</PHRASE>
<PHRASE Label="la_Description_in-bulletin" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tQnVsbGV0aW4gc2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_Description_in-bulletin:configuration_censorship" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgY2Vuc29yZWQgd29yZHMgYW5kIHRoZWlyIHJlcGxhY2VtZW50cw==</PHRASE>
<PHRASE Label="la_Description_in-bulletin:configuration_custom" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgY3VzdG9tIGZpZWxkcw==</PHRASE>
<PHRASE Label="la_Description_in-bulletin:configuration_email" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tYnVsbHRlaW4gZW1haWwgc2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_Description_in-bulletin:configuration_emoticon" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2Ugc2ltbGV5cw==</PHRASE>
<PHRASE Label="la_Description_in-bulletin:configuration_output" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tYnVsbHRlaW4gb3V0cHV0IHNldHRpbmdz</PHRASE>
<PHRASE Label="la_Description_in-bulletin:configuration_search" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tYnVsbHRlaW4gZGVmYXVsdCBzZWFyY2ggc2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_Description_in-bulletin:inbulletin_general" Module="In-Portal" Type="2">SW4tYnVsbGV0aW4gZ2VuZXJhbCBjb25maWd1cmF0aW9uIG9wdGlvbnM=</PHRASE>
<PHRASE Label="la_Description_in-link" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbGluayBzZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_Description_in-link:configuration_custom" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgY3VzdG9tIGZpZWxkcw==</PHRASE>
<PHRASE Label="la_Description_in-link:configuration_email" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgZW1haWwgZXZlbnRz</PHRASE>
<PHRASE Label="la_Description_in-link:configuration_output" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbGluayBvdXRwdXQgc2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_Description_in-link:configuration_search" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2Ugc2VhcmNoIHNldHRpbmdzIGFuZCBmaWVsZHM=</PHRASE>
<PHRASE Label="la_Description_in-link:inlink_general" Module="In-Portal" Type="2">SW4tTGluayBHZW5lcmFsIENvbmZpZ3VyYXRpb24gT3B0aW9ucw==</PHRASE>
<PHRASE Label="la_Description_in-link:validation_list" Module="In-Portal" Type="2">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBydW4gdmFsaWRhdGlvbiBvbiB0aGUgbGlua3M=</PHRASE>
<PHRASE Label="la_Description_in-news" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBzZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_Description_in-news:configuration_custom" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBjdXN0b20gZmllbGRz</PHRASE>
<PHRASE Label="la_Description_in-news:configuration_email" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBlbWFpbCBjb25maWd1cmF0aW9u</PHRASE>
<PHRASE Label="la_Description_in-news:configuration_output" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBvdXRwdXQgc2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_Description_in-news:configuration_search" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBkZWZhdWx0IHNlYXJjaCBjb25maWd1cmF0aW9u</PHRASE>
<PHRASE Label="la_Description_in-news:innews_general" Module="In-Portal" Type="2">SW4tTmV3eiBnZW5lcmFsIGNvbmZpZ3VyYXRpb24gb3B0aW9ucw==</PHRASE>
<PHRASE Label="la_Description_in-portal:addmodule" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBpbnN0YWxsIG5ldyBtb2R1bGVz</PHRASE>
<PHRASE Label="la_Description_in-portal:advanced_view" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gbWFuYWdlIGNhdGVnb3JpZXMgYW5kIGl0ZW1zIGFjcm9zcyBhbGwgY2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_Description_in-portal:backup" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBwZXJmb3JtIHN5c3RlbSBiYWNrdXBz</PHRASE>
<PHRASE Label="la_Description_in-portal:browse" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gYnJvd3NlIHRoZSBjYXRhbG9nIGFuZCBtYW5hZ2UgY2F0ZWdvcmllcyBhbmQgaXRlbXM=</PHRASE>
<PHRASE Label="la_Description_in-portal:configuration_custom" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gY29uZmlndXJlIGNhdGVnb3J5IGN1c3RvbSBmaWVsZHM=</PHRASE>
<PHRASE Label="la_Description_in-portal:configuration_email" Module="In-Portal" Type="2">Q29uZmlndXJlIENhdGVnb3J5IEVtYWlsIEV2ZW50cw==</PHRASE>
<PHRASE Label="la_Description_in-portal:configuration_search" Module="In-Portal" Type="2">Q29uZmlndXJlIENhdGVnb3J5IHNlYXJjaCBvcHRpb25z</PHRASE>
<PHRASE Label="la_Description_in-portal:configure_categories" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gY29uZmlndXJlIGdlbmVyYWwgY2F0ZWdvcnkgc2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_Description_in-portal:configure_general" Module="In-Portal" Type="1">VGhpcyBpcyBhIGdlbmVyYWwgY29uZmd1cmF0aW9uIHNlY3Rpb24=</PHRASE>
<PHRASE Label="la_Description_in-portal:configure_lang" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgcmVnaW9uYWwgc2V0dGluZ3MsIG1hbmFnZSBhbmQgZWRpdCBsYW5ndWFnZXM=</PHRASE>
<PHRASE Label="la_Description_in-portal:configure_styles" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgQ1NTIHN0eWxlc2hlZXRzIGZvciB0aGVtZXMu</PHRASE>
<PHRASE Label="la_Description_in-portal:configure_themes" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgdGhlbWVzIGFuZCBlZGl0IHRoZSBpbmRpdmlkdWFsIHRlbXBsYXRlcw==</PHRASE>
<PHRASE Label="la_Description_in-portal:configure_users" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gY29uZmlndXJlIGdlbmVyYWwgdXNlciBzZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_Description_in-portal:emaillog" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIHNob3dzIGFsbCBlLW1haWxzIHNlbnQgYnkgSW4tUG9ydGFs</PHRASE>
<PHRASE Label="la_Description_in-portal:export" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBleHBvcnQgSW4tcG9ydGFsIGRhdGE=</PHRASE>
<PHRASE Label="la_Description_in-portal:help" Module="In-Portal" Type="1">SGVscCBzZWN0aW9uIGZvciBJbi1wb3J0YWwgYW5kIGFsbCBvZiBpdHMgbW9kdWxlcy4gQWxzbyBhY2Nlc3NpYmxlIHZpYSB0aGUgc2VjdGlvbi1zcGVjaWZpYyBpbnRlcmFjdGl2ZSBoZWxwIGZlYXR1cmUu</PHRASE>
<PHRASE Label="la_Description_in-portal:inlink_inport" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBpbXBvcnQgZGF0YSBmcm9tIG90aGVyIHByb2dyYW1zIGludG8gSW4tcG9ydGFs</PHRASE>
<PHRASE Label="la_Description_in-portal:log_summary" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIHNob3dzIHN1bW1hcnkgc3RhdGlzdGljcw==</PHRASE>
<PHRASE Label="la_Description_in-portal:main_import" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBwZXJmb3JtIGRhdGEgaW1wb3J0IGZyb20gb3RoZXIgc3lzdGVtcw==</PHRASE>
<PHRASE Label="la_Description_in-portal:modules" Module="In-Portal" Type="1">TWFuYWdlIHN0YXR1cyBvZiBhbGwgbW9kdWxlcyB3aGljaCBhcmUgaW5zdGFsbGVkIG9uIHlvdXIgSW4tcG9ydGFsIHN5c3RlbS4=</PHRASE>
<PHRASE Label="la_Description_in-portal:mod_status" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBlbmFibGVkIGFuZCBkaXNhYmxlIG1vZHVsZXM=</PHRASE>
<PHRASE Label="la_Description_in-portal:reports" Module="In-Portal" Type="1">VmlldyBzeXN0ZW0gc3RhdGlzdGljcywgbG9ncyBhbmQgcmVwb3J0cw==</PHRASE>
<PHRASE Label="la_Description_in-portal:restore" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBwZXJmb3JtIGRhdGFiYXNlIHJlc3RvcmVz</PHRASE>
<PHRASE Label="la_Description_in-portal:reviews" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGRpc3BsYXlzIGEgbGlzdCBvZiBhbGwgcmV2aWV3cyBpbiB0aGUgc3lzdGVtLg==</PHRASE>
<PHRASE Label="la_Description_in-portal:searchlog" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIHNob3dzIHRoZSBzZWFyY2ggbG9nIGFuZCBhbGxvd3MgdG8gbWFuYWdlIGl0</PHRASE>
<PHRASE Label="la_Description_in-portal:server_info" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byB2aWV3IFBIUCBjb25maWd1cmF0aW9u</PHRASE>
<PHRASE Label="la_Description_in-portal:sessionlog" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIHNob3dzIGFsbCBhY3RpdmUgc2Vzc2lvbnMgYW5kIGFsbG93cyB0byBtYW5hZ2UgdGhlbQ==</PHRASE>
<PHRASE Label="la_Description_in-portal:site" Module="In-Portal" Type="1">TWFuYWdlIHRoZSBzdHJ1Y3R1cmUgb2YgeW91ciBzaXRlLCBpbmNsdWRpbmcgY2F0ZWdvcmllcywgaXRlbXMgYW5kIGNhdGVnb3J5IHNldHRpbmdzLg==</PHRASE>
<PHRASE Label="la_Description_in-portal:sql_query" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBwZXJmb3JtIGRpcmVjdCBTUUwgcXVlcmllcyBvbiBJbi1wb3J0YWwgZGF0YWJhc2U=</PHRASE>
<PHRASE Label="la_Description_in-portal:system" Module="In-Portal" Type="1">TWFuYWdlIHN5c3RlbS13aWRlIHNldHRpbmdzLCBlZGl0IHRoZW1lcyBhbmQgbGFuZ3VhZ2Vz</PHRASE>
<PHRASE Label="la_Description_in-portal:tag_library" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIHNob3dzIGF2YWlsYWJsZSB0YWdzIGZvciB1c2luZyBpbiB0ZW1wbGF0ZXM=</PHRASE>
<PHRASE Label="la_Description_in-portal:tools" Module="In-Portal" Type="1">VXNlIHZhcmlvdXMgSW4tcG9ydGFsIGRhdGEgbWFuYWdlbWVudCB0b29scywgaW5jbHVkaW5nIGJhY2t1cCwgcmVzdG9yZSwgaW1wb3J0IGFuZCBleHBvcnQ=</PHRASE>
<PHRASE Label="la_Description_in-portal:users" Module="In-Portal" Type="1">TWFuYWdlIHVzZXJzIGFuZCBncm91cHMsIHNldCB1c2VyICYgZ3JvdXAgcGVybWlzc2lvbnMgYW5kIGRlZmluZSB1c2VyIHNldHRpbmdzLg==</PHRASE>
<PHRASE Label="la_Description_in-portal:user_banlist" Module="In-Portal" Type="2">TWFuYWdlIFVzZXIgQmFuIFJ1bGVz</PHRASE>
<PHRASE Label="la_Description_in-portal:user_custom" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gY29uZmlndXJlIHVzZXIgY3VzdG9tIGZpZWxkcw==</PHRASE>
<PHRASE Label="la_Description_in-portal:user_email" Module="In-Portal" Type="2">Q29uZmlndXJlIFVzZXIgZW1haWwgZXZlbnRz</PHRASE>
<PHRASE Label="la_Description_in-portal:user_groups" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYWdhbmUgZ3JvdXBzLCBhc3NpZ24gdXNlcnMgdG8gZ3JvdXBzIGFuZCBwZXJmb3JtIG1hc3MgZW1haWwgc2VuZGluZw==</PHRASE>
<PHRASE Label="la_Description_in-portal:user_list" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9ucyBhbGxvd3MgdG8gbWFuYWdlIHVzZXJzLCB0aGVpciBwZXJtaXNzaW9ucyBhbmQgcGVyZm9ybSBtYXNzIGVtYWls</PHRASE>
<PHRASE Label="la_Description_in-portal:visits" Module="In-Portal" Type="1">VGhpcyBzZWN0aW9uIHNob3dzIHRoZSBzaXRlIHZpc2l0b3JzIGxvZw==</PHRASE>
<PHRASE Label="la_Disabled" Module="In-Portal" Type="1">RGlzYWJsZWQ=</PHRASE>
<PHRASE Label="la_DownloadExportFile" Module="In-Portal" Type="1">RG93bmxvYWQgRXhwb3J0IEZpbGU=</PHRASE>
<PHRASE Label="la_DownloadLanguageExport" Module="In-Portal" Type="1">RG93bmxvYWQgTGFuZ3VhZ2UgRXhwb3J0</PHRASE>
<PHRASE Label="la_EditingInProgress" Module="In-Portal" Type="1">WW91IGhhdmUgbm90IHNhdmVkIGNoYW5nZXMgdG8gdGhlIGl0ZW0geW91IGFyZSBlZGl0aW5nITxiciAvPkNsaWNrIE9LIHRvIGxvb3NlIGNoYW5nZXMgYW5kIGdvIHRvIHRoZSBzZWxlY3RlZCBzZWN0aW9uPGJyIC8+b3IgQ2FuY2VsIHRvIHN0YXkgaW4gdGhlIGN1cnJlbnQgc2VjdGlvbi4=</PHRASE>
<PHRASE Label="la_EmptyFile" Module="In-Portal" Type="1">RmlsZSBpcyBlbXB0eQ==</PHRASE>
<PHRASE Label="la_EmptyValue" Module="In-Portal" Type="1">IA==</PHRASE>
<PHRASE Label="la_Enabled" Module="In-Portal" Type="1">RW5hYmxlZA==</PHRASE>
<PHRASE Label="la_error_cant_save_file" Module="In-Portal" Type="1">Q2FuJ3Qgc2F2ZSBhIGZpbGU=</PHRASE>
<PHRASE Label="la_error_copy_subcategory" Module="In-Portal" Type="1">RXJyb3IgY29weWluZyBzdWJjYXRlZ29yaWVz</PHRASE>
<PHRASE Label="la_error_CustomExists" Module="In-Portal" Type="1">Q3VzdG9tIGZpZWxkIHdpdGggaWRlbnRpY2FsIG5hbWUgYWxyZWFkeSBleGlzdHM=</PHRASE>
<PHRASE Label="la_error_duplicate_username" Module="In-Portal" Type="1">VXNlcm5hbWUgeW91IGhhdmUgZW50ZXJlZCBhbHJlYWR5IGV4aXN0cyBpbiB0aGUgc3lzdGVtLCBwbGVhc2UgY2hvb3NlIGFub3RoZXIgdXNlcm5hbWUu</PHRASE>
<PHRASE Label="la_error_FileTooLarge" Module="In-Portal" Type="1">RmlsZSBpcyB0b28gbGFyZ2U=</PHRASE>
<PHRASE Label="la_error_InvalidFileFormat" Module="In-Portal" Type="1">SW52YWxpZCBGaWxlIEZvcm1hdA==</PHRASE>
<PHRASE Label="la_error_move_subcategory" Module="In-Portal" Type="1">RXJyb3IgbW92aW5nIHN1YmNhdGVnb3J5</PHRASE>
<PHRASE Label="la_error_RequiredColumnsMissing" Module="In-Portal" Type="1">cmVxdWlyZWQgY29sdW1ucyBtaXNzaW5n</PHRASE>
<PHRASE Label="la_error_unique_category_field" Module="In-Portal" Type="1">Q2F0ZWdvcnkgZmllbGQgbm90IHVuaXF1ZQ==</PHRASE>
<PHRASE Label="la_error_unknown_category" Module="In-Portal" Type="1">VW5rbm93biBjYXRlZ29yeQ==</PHRASE>
<PHRASE Label="la_err_bad_date_format" Module="In-Portal" Type="1">SW5jb3JyZWN0IGRhdGUgZm9ybWF0LCBwbGVhc2UgdXNlICglcykgZXguICglcyk=</PHRASE>
<PHRASE Label="la_err_bad_type" Module="In-Portal" Type="1">SW5jb3JyZWN0IGRhdGEgZm9ybWF0LCBwbGVhc2UgdXNlICVz</PHRASE>
+ <PHRASE Label="la_err_invalid_format" Module="In-Portal" Type="1">SW52YWxpZCBGb3JtYXQ=</PHRASE>
<PHRASE Label="la_err_length_out_of_range" Module="In-Portal" Type="1">RmllbGQgaXMgb3V0IG9mIHJhbmdl</PHRASE>
<PHRASE Label="la_err_required" Module="In-Portal" Type="1">RmllbGQgaXMgcmVxdWlyZWQ=</PHRASE>
<PHRASE Label="la_err_unique" Module="In-Portal" Type="1">RmllbGQgdmFsdWUgbXVzdCBiZSB1bmlxdWU=</PHRASE>
<PHRASE Label="la_err_value_out_of_range" Module="In-Portal" Type="1">RmllbGQgaXMgb3V0IG9mIHJhbmdlLCBwb3NzaWJsZSB2YWx1ZXMgZnJvbSAlcyB0byAlcw==</PHRASE>
<PHRASE Label="la_event_article.add" Module="In-Portal" Type="1">QWRkIEFydGljbGU=</PHRASE>
<PHRASE Label="la_event_article.approve" Module="In-Portal" Type="1">QXBwcm92ZSBBcnRpY2xl</PHRASE>
<PHRASE Label="la_event_article.deny" Module="In-Portal" Type="1">RGVjbGluZSBBcnRpY2xl</PHRASE>
<PHRASE Label="la_event_article.modify" Module="In-Portal" Type="1">TW9kaWZ5IEFydGljbGU=</PHRASE>
<PHRASE Label="la_event_article.modify.approve" Module="In-Portal" Type="1">QXBwcm92ZSBBcnRpY2xlIE1vZGlmaWNhdGlvbg==</PHRASE>
<PHRASE Label="la_event_article.modify.deny" Module="In-Portal" Type="1">RGVjbGluZSBBcnRpY2xlIE1vZGlmaWNhdGlvbg==</PHRASE>
<PHRASE Label="la_event_article.review.add" Module="In-Portal" Type="1">QXJ0aWNsZSBSZXZpZXcgQWRkZWQ=</PHRASE>
<PHRASE Label="la_event_article.review.add.pending" Module="In-Portal" Type="1">UGVuZGluZyBBcnRpY2xlIFJldmlldyBBZGRlZA==</PHRASE>
<PHRASE Label="la_event_article.review.approve" Module="In-Portal" Type="1">QXBwcm92ZSBBcnRpY2xlIFJldmlldw==</PHRASE>
<PHRASE Label="la_event_article.review.deny" Module="In-Portal" Type="1">RGVjbGluZSBBcnRpY2xlIFJldmlldw==</PHRASE>
<PHRASE Label="la_event_category.add" Module="In-Portal" Type="1">QWRkIENhdGVnb3J5</PHRASE>
<PHRASE Label="la_event_category.add.pending" Module="In-Portal" Type="1">QWRkIFBlbmRpbmcgQ2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_event_category.approve" Module="In-Portal" Type="1">QXBwcm92ZSBDYXRlZ29yeQ==</PHRASE>
<PHRASE Label="la_event_category.deny" Module="In-Portal" Type="1">RGVueSBDYXRlZ29yeQ==</PHRASE>
<PHRASE Label="la_event_category.modify" Module="In-Portal" Type="1">TW9kaWZ5IENhdGVnb3J5</PHRASE>
<PHRASE Label="la_event_category_delete" Module="In-Portal" Type="1">RGVsZXRlIENhdGVnb3J5</PHRASE>
<PHRASE Label="la_event_common.footer" Module="In-Portal" Type="1">Q29tbW9uIEZvb3RlciBUZW1wbGF0ZQ==</PHRASE>
<PHRASE Label="la_event_import_progress" Module="In-Portal" Type="1">RW1haWwgZXZlbnRzIGltcG9ydCBwcm9ncmVzcw==</PHRASE>
<PHRASE Label="la_event_link.add" Module="In-Portal" Type="1">QWRkIExpbms=</PHRASE>
<PHRASE Label="la_event_link.add.pending" Module="In-Portal" Type="1">QWRkIFBlbmRpbmcgTGluaw==</PHRASE>
<PHRASE Label="la_event_link.approve" Module="In-Portal" Type="1">QXBwcm92ZSBQZW5kaW5nIExpbms=</PHRASE>
<PHRASE Label="la_event_link.deny" Module="In-Portal" Type="1">RGVueSBMaW5r</PHRASE>
<PHRASE Label="la_event_link.modify" Module="In-Portal" Type="1">TW9kaWZ5IExpbms=</PHRASE>
<PHRASE Label="la_event_link.modify.approve" Module="In-Portal" Type="1">QXBwcm92ZSBMaW5rIE1vZGlmaWNhdGlvbg==</PHRASE>
<PHRASE Label="la_event_link.modify.deny" Module="In-Portal" Type="1">RGVjbGluZSBsaW5rIG1vZGlmaWNhdGlvbg==</PHRASE>
<PHRASE Label="la_event_link.modify.pending" Module="In-Portal" Type="1">TGluayBNb2RpZmljYXRpb24gUGVuZGluZw==</PHRASE>
<PHRASE Label="la_event_link.review.add" Module="In-Portal" Type="1">TGluayBSZXZpZXcgQWRkZWQ=</PHRASE>
<PHRASE Label="la_event_link.review.add.pending" Module="In-Portal" Type="1">UGVuZGluZyBSZXZpZXcgQWRkZWQ=</PHRASE>
<PHRASE Label="la_event_link.review.approve" Module="In-Portal" Type="1">QXBwcm92ZSBMaW5rIFJldmlldw==</PHRASE>
<PHRASE Label="la_event_link.review.deny" Module="In-Portal" Type="1">RGVjbGluZSBMaW5rIFJldmlldw==</PHRASE>
<PHRASE Label="la_event_pm.add" Module="In-Portal" Type="1">TmV3IFByaXZhdGUgTWVzc2FnZQ==</PHRASE>
<PHRASE Label="la_event_post.add" Module="In-Portal" Type="1">UG9zdCBBZGRlZA==</PHRASE>
<PHRASE Label="la_event_post.modify" Module="In-Portal" Type="1">UG9zdCBNb2RpZmllZA==</PHRASE>
<PHRASE Label="la_event_topic.add" Module="In-Portal" Type="1">VG9waWMgQWRkZWQ=</PHRASE>
<PHRASE Label="la_event_user.add" Module="In-Portal" Type="1">QWRkIFVzZXI=</PHRASE>
<PHRASE Label="la_event_user.add.pending" Module="In-Portal" Type="1">QWRkIFBlbmRpbmcgVXNlcg==</PHRASE>
<PHRASE Label="la_event_user.approve" Module="In-Portal" Type="1">QXBwcm92ZSBVc2Vy</PHRASE>
<PHRASE Label="la_event_user.deny" Module="In-Portal" Type="1">RGVueSBVc2Vy</PHRASE>
<PHRASE Label="la_event_user.forgotpw" Module="In-Portal" Type="1">Rm9yZ290IFBhc3N3b3Jk</PHRASE>
<PHRASE Label="la_event_user.membership_expiration_notice" Module="In-Portal" Type="1">TWVtYmVyc2hpcCBleHBpcmF0aW9uIG5vdGljZQ==</PHRASE>
<PHRASE Label="la_event_user.membership_expired" Module="In-Portal" Type="1">TWVtYmVyc2hpcCBleHBpcmVk</PHRASE>
<PHRASE Label="la_event_user.pswd_confirm" Module="In-Portal" Type="1">UGFzc3dvcmQgQ29uZmlybWF0aW9u</PHRASE>
<PHRASE Label="la_event_user.subscribe" Module="In-Portal" Type="1">VXNlciBzdWJzY3JpYmVk</PHRASE>
<PHRASE Label="la_event_user.suggest" Module="In-Portal" Type="1">U3VnZ2VzdCB0byBhIGZyaWVuZA==</PHRASE>
<PHRASE Label="la_event_user.unsubscribe" Module="In-Portal" Type="1">VXNlciB1bnN1YnNjcmliZWQ=</PHRASE>
<PHRASE Label="la_event_user.validate" Module="In-Portal" Type="1">VmFsaWRhdGUgVXNlcg==</PHRASE>
<PHRASE Label="la_Field" Module="In-Portal" Type="1">RmllbGQ=</PHRASE>
<PHRASE Label="la_field_displayorder" Module="In-Portal" Type="1">RGlzcGxheSBPcmRlcg==</PHRASE>
<PHRASE Label="la_fld_AddressLine" Module="In-Portal" Type="1">QWRkcmVzcyBMaW5l</PHRASE>
<PHRASE Label="la_fld_AdvancedCSS" Module="In-Portal" Type="1">QWR2YW5jZWQgQ1NT</PHRASE>
<PHRASE Label="la_fld_AutomaticFilename" Module="In-Portal" Type="1">QXV0b21hdGljIEZpbGVuYW1l</PHRASE>
<PHRASE Label="la_fld_AvailableColumns" Module="In-Portal" Type="1">QXZhaWxhYmxlIENvbHVtbnM=</PHRASE>
<PHRASE Label="la_fld_Background" Module="In-Portal" Type="1">QmFja2dyb3VuZA==</PHRASE>
<PHRASE Label="la_fld_BackgroundAttachment" Module="In-Portal" Type="1">QmFja2dyb3VuZCBBdHRhY2htZW50</PHRASE>
<PHRASE Label="la_fld_BackgroundColor" Module="In-Portal" Type="1">QmFja2dyb3VuZCBDb2xvcg==</PHRASE>
<PHRASE Label="la_fld_BackgroundImage" Module="In-Portal" Type="1">QmFja2dyb3VuZCBJbWFnZQ==</PHRASE>
<PHRASE Label="la_fld_BackgroundPosition" Module="In-Portal" Type="1">QmFja2dyb3VuZCBQb3NpdGlvbg==</PHRASE>
<PHRASE Label="la_fld_BackgroundRepeat" Module="In-Portal" Type="1">QmFja2dyb3VuZCBSZXBlYXQ=</PHRASE>
<PHRASE Label="la_fld_BorderBottom" Module="In-Portal" Type="1">Qm9yZGVyIEJvdHRvbQ==</PHRASE>
<PHRASE Label="la_fld_BorderLeft" Module="In-Portal" Type="1">Qm9yZGVyIExlZnQ=</PHRASE>
<PHRASE Label="la_fld_BorderRight" Module="In-Portal" Type="1">Qm9yZGVyIFJpZ2h0</PHRASE>
<PHRASE Label="la_fld_Borders" Module="In-Portal" Type="1">Qm9yZGVycw==</PHRASE>
<PHRASE Label="la_fld_BorderTop" Module="In-Portal" Type="1">Qm9yZGVyIFRvcA==</PHRASE>
<PHRASE Label="la_fld_Category" Module="In-Portal" Type="1">Q2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_fld_CategoryAutomaticFilename" Module="In-Portal" Type="1">QXV0b21hdGljIERpcmVjdG9yeSBOYW1l</PHRASE>
<PHRASE Label="la_fld_CategoryFilename" Module="In-Portal" Type="1">RGlyZWN0b3J5IE5hbWU=</PHRASE>
<PHRASE Label="la_fld_CategoryFormat" Module="In-Portal" Type="1">Q2F0ZWdvcnkgRm9ybWF0</PHRASE>
<PHRASE Label="la_fld_CategoryId" Module="In-Portal" Type="1">Q2F0ZWdvcnkgSUQ=</PHRASE>
<PHRASE Label="la_fld_CategorySeparator" Module="In-Portal" Type="1">Q2F0ZWdvcnkgc2VwYXJhdG9y</PHRASE>
<PHRASE Label="la_fld_CategoryTemplate" Module="In-Portal" Type="1">Q2F0ZWdvcnkgVGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_fld_Charset" Module="In-Portal" Type="1">Q2hhcnNldA==</PHRASE>
<PHRASE Label="la_fld_CheckDuplicatesMethod" Module="In-Portal" Type="1">Q2hlY2sgRHVwbGljYXRlcyBieQ==</PHRASE>
<PHRASE Label="la_fld_Company" Module="In-Portal" Type="1">Q29tcGFueQ==</PHRASE>
<PHRASE Label="la_fld_CopyLabels" Module="In-Portal" Type="1">Q29weSBMYWJlbHMgZnJvbSB0aGlzIExhbmd1YWdl</PHRASE>
<PHRASE Label="la_fld_Cursor" Module="In-Portal" Type="1">Q3Vyc29y</PHRASE>
<PHRASE Label="la_fld_DateFormat" Module="In-Portal" Type="1">RGF0ZSBGb3JtYXQ=</PHRASE>
<PHRASE Label="la_fld_DecimalPoint" Module="In-Portal" Type="1">RGVjaW1hbCBQb2ludA==</PHRASE>
<PHRASE Label="la_fld_Description" Module="In-Portal" Type="1">RGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="la_fld_Display" Module="In-Portal" Type="1">RGlzcGxheQ==</PHRASE>
<PHRASE Label="la_fld_DoNotEncode" Module="In-Portal" Type="1">QXMgUGxhaW4gVGV4dA==</PHRASE>
<PHRASE Label="la_fld_Duration" Module="In-Portal" Type="1">RHVyYXRpb24=</PHRASE>
<PHRASE Label="la_fld_EditorsPick" Module="In-Portal" Type="1">RWRpdG9ycyBQaWNr</PHRASE>
<PHRASE Label="la_fld_ElapsedTime" Module="In-Portal" Type="1">RWxhcHNlZCBUaW1l</PHRASE>
<PHRASE Label="la_fld_Enabled" Module="In-Portal" Type="1">RW5hYmxlZA==</PHRASE>
<PHRASE Label="la_fld_EstimatedTime" Module="In-Portal" Type="1">RXN0aW1hdGVkIFRpbWU=</PHRASE>
<PHRASE Label="la_fld_ExportColumns" Module="In-Portal" Type="1">RXhwb3J0IGNvbHVtbnM=</PHRASE>
<PHRASE Label="la_fld_ExportFileName" Module="In-Portal" Type="1">RXhwb3J0IEZpbGVuYW1l</PHRASE>
<PHRASE Label="la_fld_ExportFormat" Module="In-Portal" Type="1">RXhwb3J0IGZvcm1hdA==</PHRASE>
<PHRASE Label="la_fld_ExportModules" Module="In-Portal" Type="1">RXhwb3J0IE1vZHVsZXM=</PHRASE>
<PHRASE Label="la_fld_ExportPhraseTypes" Module="In-Portal" Type="1">RXhwb3J0IFBocmFzZSBUeXBlcw==</PHRASE>
<PHRASE Label="la_fld_ExtraHeaders" Module="In-Portal" Type="1">RXh0cmEgSGVhZGVycw==</PHRASE>
<PHRASE Label="la_fld_Fax" Module="In-Portal" Type="1">RmF4</PHRASE>
<PHRASE Label="la_fld_FieldsEnclosedBy" Module="In-Portal" Type="1">RmllbGRzIGVuY2xvc2VkIGJ5</PHRASE>
<PHRASE Label="la_fld_FieldsSeparatedBy" Module="In-Portal" Type="1">RmllbGRzIHNlcGFyYXRlZCBieQ==</PHRASE>
<PHRASE Label="la_fld_FieldTitles" Module="In-Portal" Type="1">RmllbGQgVGl0bGVz</PHRASE>
<PHRASE Label="la_fld_Filename" Module="In-Portal" Type="1">RmlsZW5hbWU=</PHRASE>
<PHRASE Label="la_fld_Font" Module="In-Portal" Type="1">Rm9udA==</PHRASE>
<PHRASE Label="la_fld_FontColor" Module="In-Portal" Type="1">Rm9udCBDb2xvcg==</PHRASE>
<PHRASE Label="la_fld_FontFamily" Module="In-Portal" Type="1">Rm9udCBGYW1pbHk=</PHRASE>
<PHRASE Label="la_fld_FontSize" Module="In-Portal" Type="1">Rm9udCBTaXpl</PHRASE>
<PHRASE Label="la_fld_FontStyle" Module="In-Portal" Type="1">Rm9udCBTdHlsZQ==</PHRASE>
<PHRASE Label="la_fld_FontWeight" Module="In-Portal" Type="1">Rm9udCBXZWlnaHQ=</PHRASE>
<PHRASE Label="la_fld_GroupId" Module="In-Portal" Type="1">SUQ=</PHRASE>
<PHRASE Label="la_fld_GroupName" Module="In-Portal" Type="1">R3JvdXAgTmFtZQ==</PHRASE>
<PHRASE Label="la_fld_Height" Module="In-Portal" Type="1">SGVpZ2h0</PHRASE>
<PHRASE Label="la_fld_Hot" Module="In-Portal" Type="1">SG90</PHRASE>
<PHRASE Label="la_fld_IconURL" Module="In-Portal" Type="1">SWNvbiBVUkw=</PHRASE>
<PHRASE Label="la_fld_Id" Module="In-Portal" Type="1">SUQ=</PHRASE>
<PHRASE Label="la_fld_ImportCategory" Module="In-Portal" Type="1">SW1wb3J0IENhdGVnb3J5</PHRASE>
<PHRASE Label="la_fld_ImportFilename" Module="In-Portal" Type="1">SW1wb3J0IEZpbGVuYW1l</PHRASE>
<PHRASE Label="la_fld_IncludeFieldTitles" Module="In-Portal" Type="1">SW5jbHVkZSBmaWVsZCB0aXRsZXM=</PHRASE>
<PHRASE Label="la_fld_InputDateFormat" Module="In-Portal" Type="1">SW5wdXQgRGF0ZSBGb3JtYXQ=</PHRASE>
<PHRASE Label="la_fld_InputTimeFormat" Module="In-Portal" Type="1">SW5wdXQgVGltZSBGb3JtYXQ=</PHRASE>
<PHRASE Label="la_fld_InstallModules" Module="In-Portal" Type="1">SW5zdGFsbCBNb2R1bGVz</PHRASE>
<PHRASE Label="la_fld_InstallPhraseTypes" Module="In-Portal" Type="1">SW5zdGFsbCBQaHJhc2UgVHlwZXM=</PHRASE>
<PHRASE Label="la_fld_IsBaseCategory" Module="In-Portal" Type="1">VXNlIGN1cnJlbnQgY2F0ZWdvcnkgYXMgcm9vdCBmb3IgdGhlIGV4cG9ydA==</PHRASE>
<PHRASE Label="la_fld_IsSystem" Module="In-Portal" Type="1">SXMgU3lzdGVt</PHRASE>
<PHRASE Label="la_fld_ItemTemplate" Module="In-Portal" Type="1">SXRlbSBUZW1wbGF0ZQ==</PHRASE>
<PHRASE Label="la_fld_LanguageFile" Module="In-Portal" Type="1">TGFuZ3VhZ2UgRmlsZQ==</PHRASE>
<PHRASE Label="la_fld_LanguageId" Module="In-Portal" Type="1">TGFuZ3VhZ2UgSUQ=</PHRASE>
<PHRASE Label="la_fld_Left" Module="In-Portal" Type="1">TGVmdA==</PHRASE>
<PHRASE Label="la_fld_LineEndings" Module="In-Portal" Type="1">TGluZSBlbmRpbmdz</PHRASE>
<PHRASE Label="la_fld_LineEndingsInside" Module="In-Portal" Type="1">TGluZSBFbmRpbmdzIEluc2lkZSBGaWVsZHM=</PHRASE>
<PHRASE Label="la_fld_LocalName" Module="In-Portal" Type="1">TG9jYWwgTmFtZQ==</PHRASE>
<PHRASE Label="la_fld_MarginBottom" Module="In-Portal" Type="1">TWFyZ2luIEJvdHRvbQ==</PHRASE>
<PHRASE Label="la_fld_MarginLeft" Module="In-Portal" Type="1">TWFyZ2luIExlZnQ=</PHRASE>
<PHRASE Label="la_fld_MarginRight" Module="In-Portal" Type="1">TWFyZ2luIFJpZ2h0</PHRASE>
<PHRASE Label="la_fld_Margins" Module="In-Portal" Type="1">TWFyZ2lucw==</PHRASE>
<PHRASE Label="la_fld_MarginTop" Module="In-Portal" Type="1">TWFyZ2luIFRvcA==</PHRASE>
<PHRASE Label="la_fld_MessageBody" Module="In-Portal" Type="1">TWVzc2FnZSBCb2R5</PHRASE>
<PHRASE Label="la_fld_MessageType" Module="In-Portal" Type="1">TWVzc2FnZSBUeXBl</PHRASE>
<PHRASE Label="la_fld_MetaDescription" Module="In-Portal" Type="1">TWV0YSBEZXNjcmlwdGlvbg==</PHRASE>
<PHRASE Label="la_fld_MetaKeywords" Module="In-Portal" Type="1">TWV0YSBLZXl3b3Jkcw==</PHRASE>
<PHRASE Label="la_fld_Modified" Module="In-Portal" Type="1">TW9kaWZpZWQ=</PHRASE>
<PHRASE Label="la_fld_Module" Module="In-Portal" Type="1">TW9kdWxl</PHRASE>
<PHRASE Label="la_fld_Name" Module="In-Portal" Type="1">TmFtZQ==</PHRASE>
<PHRASE Label="la_fld_New" Module="In-Portal" Type="1">TmV3</PHRASE>
<PHRASE Label="la_fld_PackName" Module="In-Portal" Type="1">UGFjayBOYW1l</PHRASE>
<PHRASE Label="la_fld_PaddingBottom" Module="In-Portal" Type="1">UGFkZGluZyBCb3R0b20=</PHRASE>
<PHRASE Label="la_fld_PaddingLeft" Module="In-Portal" Type="1">UGFkZGluZyBMZWZ0</PHRASE>
<PHRASE Label="la_fld_PaddingRight" Module="In-Portal" Type="1">UGFkZGluZyBSaWdodA==</PHRASE>
<PHRASE Label="la_fld_Paddings" Module="In-Portal" Type="1">UGFkZGluZ3M=</PHRASE>
<PHRASE Label="la_fld_PaddingTop" Module="In-Portal" Type="1">UGFkZGluZyBUb3A=</PHRASE>
<PHRASE Label="la_fld_PercentsCompleted" Module="In-Portal" Type="1">UGVyY2VudHMgQ29tcGxldGVk</PHRASE>
<PHRASE Label="la_fld_Phrase" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_fld_PhraseType" Module="In-Portal" Type="1">UGhyYXNlIFR5cGU=</PHRASE>
<PHRASE Label="la_fld_Pop" Module="In-Portal" Type="1">UG9w</PHRASE>
<PHRASE Label="la_fld_Position" Module="In-Portal" Type="1">UG9zaXRpb24=</PHRASE>
<PHRASE Label="la_fld_PrimaryLang" Module="In-Portal" Type="1">UHJpbWFyeQ==</PHRASE>
<PHRASE Label="la_fld_PrimaryTranslation" Module="In-Portal" Type="1">UHJpbWFyeSBUcmFuc2xhdGlvbg==</PHRASE>
<PHRASE Label="la_fld_Priority" Module="In-Portal" Type="1">UHJpb3JpdHk=</PHRASE>
<PHRASE Label="la_fld_ReplaceDuplicates" Module="In-Portal" Type="1">UmVwbGFjZSBEdXBsaWNhdGVz</PHRASE>
<PHRASE Label="la_fld_SelectorBase" Module="In-Portal" Type="1">QmFzZWQgT24=</PHRASE>
<PHRASE Label="la_fld_SelectorData" Module="In-Portal" Type="1">U3R5bGU=</PHRASE>
<PHRASE Label="la_fld_SelectorId" Module="In-Portal" Type="1">U2VsZWN0b3IgSUQ=</PHRASE>
<PHRASE Label="la_fld_SelectorName" Module="In-Portal" Type="1">U2VsZWN0b3IgTmFtZQ==</PHRASE>
<PHRASE Label="la_fld_SkipFirstRow" Module="In-Portal" Type="1">U2tpcCBGaXJzdCBSb3c=</PHRASE>
<PHRASE Label="la_fld_Status" Module="In-Portal" Type="1">U3RhdHVz</PHRASE>
<PHRASE Label="la_fld_StylesheetId" Module="In-Portal" Type="1">U3R5bGVzaGVldCBJRA==</PHRASE>
<PHRASE Label="la_fld_Subject" Module="In-Portal" Type="1">U3ViamVjdA==</PHRASE>
<PHRASE Label="la_fld_TextAlign" Module="In-Portal" Type="1">VGV4dCBBbGlnbg==</PHRASE>
<PHRASE Label="la_fld_TextDecoration" Module="In-Portal" Type="1">VGV4dCBEZWNvcmF0aW9u</PHRASE>
<PHRASE Label="la_fld_ThousandSep" Module="In-Portal" Type="1">VGhvdXNhbmRzIFNlcGFyYXRvcg==</PHRASE>
<PHRASE Label="la_fld_TimeFormat" Module="In-Portal" Type="1">VGltZSBGb3JtYXQ=</PHRASE>
<PHRASE Label="la_fld_Top" Module="In-Portal" Type="1">VG9w</PHRASE>
<PHRASE Label="la_fld_Translation" Module="In-Portal" Type="1">VmFsdWU=</PHRASE>
<PHRASE Label="la_fld_UnitSystem" Module="In-Portal" Type="1">TWVhc3VyZXMgU3lzdGVt</PHRASE>
<PHRASE Label="la_fld_Visibility" Module="In-Portal" Type="1">VmlzaWJpbGl0eQ==</PHRASE>
<PHRASE Label="la_fld_Width" Module="In-Portal" Type="1">V2lkdGg=</PHRASE>
<PHRASE Label="la_fld_Z-Index" Module="In-Portal" Type="1">Wi1JbmRleA==</PHRASE>
<PHRASE Label="la_Font" Module="In-Portal" Type="1">Rm9udCBQcm9wZXJ0aWVz</PHRASE>
<PHRASE Label="la_from_date" Module="In-Portal" Type="1">RnJvbSBEYXRl</PHRASE>
<PHRASE Label="la_front_end" Module="In-Portal" Type="1">RnJvbnQgZW5k</PHRASE>
<PHRASE Label="la_gigabytes" Module="In-Portal" Type="1">Z2lnYWJ5dGUocyk=</PHRASE>
<PHRASE Label="la_help_in_progress" Module="In-Portal" Type="1">VGhpcyBoZWxwIHNlY3Rpb24gZG9lcyBub3QgeWV0IGV4aXN0LCBpdCdzIGNvbWluZyBzb29uIQ==</PHRASE>
<PHRASE Label="la_Html" Module="In-Portal" Type="1">aHRtbA==</PHRASE>
<PHRASE Label="la_IDField" Module="In-Portal" Type="1">SUQgRmllbGQ=</PHRASE>
<PHRASE Label="la_ImportingEmailEvents" Module="In-Portal" Type="1">SW1wb3J0aW5nIEVtYWlsIEV2ZW50cyAuLi4=</PHRASE>
<PHRASE Label="la_ImportingLanguages" Module="In-Portal" Type="1">SW1wb3J0aW5nIExhbmd1YWdlcyAuLi4=</PHRASE>
<PHRASE Label="la_ImportingPhrases" Module="In-Portal" Type="1">SW1wb3J0aW5nIFBocmFzZXMgLi4u</PHRASE>
<PHRASE Label="la_importlang_phrasewarning" Module="In-Portal" Type="2">RW5hYmxpbmcgdGhpcyBvcHRpb24gd2lsbCB1bmRvIGFueSBjaGFuZ2VzIHlvdSBoYXZlIG1hZGUgdG8gZXhpc3RpbmcgcGhyYXNlcw==</PHRASE>
<PHRASE Label="la_importPhrases" Module="In-Portal" Type="1">SW1wb3J0aW5nIFBocmFzZXM=</PHRASE>
<PHRASE Label="la_inlink" Module="In-Portal" Type="1">SW4tbGluaw==</PHRASE>
<PHRASE Label="la_invalid_integer" Module="In-Portal" Type="1">SW5jb3JyZWN0IGRhdGEgZm9ybWF0LCBwbGVhc2UgdXNlIGludGVnZXI=</PHRASE>
<PHRASE Label="la_invalid_license" Module="In-Portal" Type="1">TWlzc2luZyBvciBpbnZhbGlkIEluLVBvcnRhbCBMaWNlbnNl</PHRASE>
<PHRASE Label="la_invalid_state" Module="In-Portal" Type="0">SW52YWxpZCBzdGF0ZQ==</PHRASE>
<PHRASE Label="la_ItemTab_Categories" Module="In-Portal" Type="1">Q2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_ItemTab_Links" Module="In-Portal" Type="1">TGlua3M=</PHRASE>
<PHRASE Label="la_ItemTab_News" Module="In-Portal" Type="1">QXJ0aWNsZXM=</PHRASE>
<PHRASE Label="la_ItemTab_Topics" Module="In-Portal" Type="1">VG9waWNz</PHRASE>
<PHRASE Label="la_K4_AdvancedView" Module="In-Portal" Type="1">SzQgQWR2YW5jZWQgVmlldw==</PHRASE>
<PHRASE Label="la_K4_Catalog" Module="In-Portal" Type="1">SzQgQ2F0YWxvZw==</PHRASE>
<PHRASE Label="la_kilobytes" Module="In-Portal" Type="1">S0I=</PHRASE>
<PHRASE Label="la_language" Module="In-Portal" Type="1">TGFuZ3VhZ2U=</PHRASE>
<PHRASE Label="la_lang_import_progress" Module="In-Portal" Type="1">SW1wb3J0IHByb2dyZXNz</PHRASE>
<PHRASE Label="la_LastUpdate" Module="In-Portal" Type="1">TGFzdCBVcGRhdGVk</PHRASE>
<PHRASE Label="la_Link_Date" Module="In-Portal" Type="1">RGF0ZQ==</PHRASE>
<PHRASE Label="la_Link_Description" Module="In-Portal" Type="1">TGluayBEZXNjcmlwdGlvbg==</PHRASE>
<PHRASE Label="la_link_editorspick_prompt" Module="In-Portal" Type="1">RGlzcGxheSBlZGl0b3IgUElDS3MgYWJvdmUgcmVndWxhciBsaW5rcw==</PHRASE>
<PHRASE Label="la_Link_Hits" Module="In-Portal" Type="1">SGl0cw==</PHRASE>
<PHRASE Label="la_Link_Name" Module="In-Portal" Type="1">TGluayBOYW1l</PHRASE>
<PHRASE Label="la_link_newdays_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGRheXMgZm9yIGEgbGluayB0byBiZSBORVc=</PHRASE>
<PHRASE Label="la_link_perpage_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGxpbmtzIHBlciBwYWdl</PHRASE>
<PHRASE Label="la_link_perpage_short_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGxpbmtzIHBlciBwYWdlIG9uIGEgc2hvcnQgbGlzdGluZw==</PHRASE>
<PHRASE Label="la_Link_Rating" Module="In-Portal" Type="1">UmF0aW5n</PHRASE>
<PHRASE Label="la_link_reviewed" Module="In-Portal" Type="1">TGluayByZXZpZXdlZA==</PHRASE>
<PHRASE Label="la_link_sortfield2_prompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_link_sortfield_prompt" Module="In-Portal" Type="1">T3JkZXIgbGlua3MgYnk=</PHRASE>
<PHRASE Label="la_link_sortreviews2_prompt" Module="In-Portal" Type="1">YW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_link_sortreviews_prompt" Module="In-Portal" Type="1">U29ydCByZXZpZXdzIGJ5</PHRASE>
<PHRASE Label="la_Link_URL" Module="In-Portal" Type="1">VVJM</PHRASE>
<PHRASE Label="la_link_urlstatus_prompt" Module="In-Portal" Type="1">RGlzcGxheSBsaW5rIFVSTCBpbiBzdGF0dXMgYmFy</PHRASE>
<PHRASE Label="la_Logged_in_as" Module="In-Portal" Type="1">TG9nZ2VkIGluIGFz</PHRASE>
<PHRASE Label="la_login" Module="In-Portal" Type="1">TG9naW4=</PHRASE>
<PHRASE Label="la_m0" Module="In-Portal" Type="1">KEdNVCk=</PHRASE>
<PHRASE Label="la_m1" Module="In-Portal" Type="1">KEdNVCAtMDE6MDAp</PHRASE>
<PHRASE Label="la_m10" Module="In-Portal" Type="1">KEdNVCAtMTA6MDAp</PHRASE>
<PHRASE Label="la_m11" Module="In-Portal" Type="1">KEdNVCAtMTE6MDAp</PHRASE>
<PHRASE Label="la_m12" Module="In-Portal" Type="1">KEdNVCAtMTI6MDAp</PHRASE>
<PHRASE Label="la_m2" Module="In-Portal" Type="1">KEdNVCAtMDI6MDAp</PHRASE>
<PHRASE Label="la_m3" Module="In-Portal" Type="1">KEdNVCAtMDM6MDAp</PHRASE>
<PHRASE Label="la_m4" Module="In-Portal" Type="1">KEdNVCAtMDQ6MDAp</PHRASE>
<PHRASE Label="la_m5" Module="In-Portal" Type="1">KEdNVCAtMDU6MDAp</PHRASE>
<PHRASE Label="la_m6" Module="In-Portal" Type="1">KEdNVCAtMDY6MDAp</PHRASE>
<PHRASE Label="la_m7" Module="In-Portal" Type="1">KEdNVCAtMDc6MDAp</PHRASE>
<PHRASE Label="la_m8" Module="In-Portal" Type="1">KEdNVCAtMDg6MDAp</PHRASE>
<PHRASE Label="la_m9" Module="In-Portal" Type="1">KEdNVCAtMDk6MDAp</PHRASE>
<PHRASE Label="la_Margins" Module="In-Portal" Type="1">TWFyZ2lucw==</PHRASE>
<PHRASE Label="la_megabytes" Module="In-Portal" Type="1">TUI=</PHRASE>
<PHRASE Label="la_MembershipExpirationReminder" Module="In-Portal" Type="1">R3JvdXAgTWVtYmVyc2hpcCBFeHBpcmF0aW9uIFJlbWluZGVyIChkYXlzKQ==</PHRASE>
<PHRASE Label="la_MenuTreeTitle" Module="In-Portal" Type="1">TWFpbiBNZW51</PHRASE>
<PHRASE Label="la_Metric" Module="In-Portal" Type="1">TWV0cmlj</PHRASE>
<PHRASE Label="la_missing_theme" Module="In-Portal" Type="1">TWlzc2luZyBJbiBUaGVtZQ==</PHRASE>
<PHRASE Label="la_MixedCategoryPath" Module="In-Portal" Type="1">Q2F0ZWdvcnkgcGF0aCBpbiBvbmUgZmllbGQ=</PHRASE>
<PHRASE Label="la_module_not_licensed" Module="In-Portal" Type="1">TW9kdWxlIG5vdCBsaWNlbnNlZA==</PHRASE>
<PHRASE Label="la_monday" Module="In-Portal" Type="1">TW9uZGF5</PHRASE>
<PHRASE Label="la_NeverExpires" Module="In-Portal" Type="1">TmV2ZXIgRXhwaXJlcw==</PHRASE>
<PHRASE Label="la_New" Module="In-Portal" Type="1">TmV3</PHRASE>
<PHRASE Label="la_news_daysarchive_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGRheXMgdG8gYXJjaGl2ZSBhcnRpY2xlcyBhdXRvbWF0aWNhbGx5</PHRASE>
<PHRASE Label="la_news_editorpicksabove_prompt" Module="In-Portal" Type="1">RGlzcGxheSBlZGl0b3IgUElDS3MgYWJvdmUgcmVndWxhciBhcnRpY2xlcw==</PHRASE>
<PHRASE Label="la_news_newdays_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGRheXMgZm9yIGEgYXJ0aWNsZSB0byBiZSBORVc=</PHRASE>
<PHRASE Label="la_news_perpage_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIGFydGljbGVzIHBlciBwYWdl</PHRASE>
<PHRASE Label="la_news_perpage_short_prompt" Module="In-Portal" Type="1">QXJ0aWNsZXMgUGVyIFBhZ2UgKFNob3J0bGlzdCk=</PHRASE>
<PHRASE Label="la_news_sortfield2_pompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_news_sortfield_pompt" Module="In-Portal" Type="1">T3JkZXIgYXJ0aWNsZXMgYnk=</PHRASE>
<PHRASE Label="la_news_sortreviews2_prompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_news_sortreviews_prompt" Module="In-Portal" Type="1">U29ydCByZXZpZXdzIGJ5</PHRASE>
<PHRASE Label="la_nextcategory" Module="In-Portal" Type="1">TmV4dCBjYXRlZ29yeQ==</PHRASE>
<PHRASE Label="la_nextgroup" Module="In-Portal" Type="1">TmV4dCBncm91cA==</PHRASE>
<PHRASE Label="la_NextUser" Module="In-Portal" Type="1">TmV4dCBVc2Vy</PHRASE>
<PHRASE Label="la_No" Module="In-Portal" Type="1">Tm8=</PHRASE>
<PHRASE Label="la_none" Module="In-Portal" Type="1">Tm9uZQ==</PHRASE>
<PHRASE Label="la_NoSubject" Module="In-Portal" Type="1">Tm8gU3ViamVjdA==</PHRASE>
<PHRASE Label="la_no_topics" Module="In-Portal" Type="1">Tm8gdG9waWNz</PHRASE>
<PHRASE Label="la_Number_of_Posts" Module="In-Portal" Type="1">TnVtYmVyIG9mIFBvc3Rz</PHRASE>
<PHRASE Label="la_of" Module="In-Portal" Type="1">b2Y=</PHRASE>
<PHRASE Label="la_Off" Module="In-Portal" Type="1">T2Zm</PHRASE>
<PHRASE Label="la_On" Module="In-Portal" Type="1">T24=</PHRASE>
<PHRASE Label="la_opt_day" Module="In-Portal" Type="1">ZGF5KHMp</PHRASE>
<PHRASE Label="la_opt_hour" Module="In-Portal" Type="1">aG91cihzKQ==</PHRASE>
<PHRASE Label="la_opt_min" Module="In-Portal" Type="1">bWludXRlKHMp</PHRASE>
<PHRASE Label="la_opt_month" Module="In-Portal" Type="1">bW9udGgocyk=</PHRASE>
<PHRASE Label="la_opt_sec" Module="In-Portal" Type="1">c2Vjb25kKHMp</PHRASE>
<PHRASE Label="la_opt_week" Module="In-Portal" Type="1">d2VlayhzKQ==</PHRASE>
<PHRASE Label="la_opt_year" Module="In-Portal" Type="1">eWVhcihzKQ==</PHRASE>
<PHRASE Label="la_original_values" Module="In-Portal" Type="1">T3JpZ2luYWwgVmFsdWVz</PHRASE>
<PHRASE Label="la_origional_value" Module="In-Portal" Type="1">T3JpZ2luYWwgVmFsdWU=</PHRASE>
<PHRASE Label="la_origional_values" Module="In-Portal" Type="1">T3JpZ2luYWwgVmFsdWVz</PHRASE>
<PHRASE Label="la_OtherFields" Module="In-Portal" Type="1">T3RoZXIgRmllbGRz</PHRASE>
<PHRASE Label="la_p1" Module="In-Portal" Type="1">KEdNVCArMDE6MDAp</PHRASE>
<PHRASE Label="la_p10" Module="In-Portal" Type="1">KEdNVCArMTA6MDAp</PHRASE>
<PHRASE Label="la_p11" Module="In-Portal" Type="1">KEdNVCArMTE6MDAp</PHRASE>
<PHRASE Label="la_p12" Module="In-Portal" Type="1">KEdNVCArMTI6MDAp</PHRASE>
<PHRASE Label="la_p13" Module="In-Portal" Type="1">KEdNVCArMTM6MDAp</PHRASE>
<PHRASE Label="la_p2" Module="In-Portal" Type="1">KEdNVCArMDI6MDAp</PHRASE>
<PHRASE Label="la_p3" Module="In-Portal" Type="1">KEdNVCArMDM6MDAp</PHRASE>
<PHRASE Label="la_p4" Module="In-Portal" Type="1">KEdNVCArMDQ6MDAp</PHRASE>
<PHRASE Label="la_p5" Module="In-Portal" Type="1">KEdNVCArMDU6MDAp</PHRASE>
<PHRASE Label="la_p6" Module="In-Portal" Type="1">KEdNVCArMDY6MDAp</PHRASE>
<PHRASE Label="la_p7" Module="In-Portal" Type="1">KEdNVCArMDc6MDAp</PHRASE>
<PHRASE Label="la_p8" Module="In-Portal" Type="1">KEdNVCArMDg6MDAp</PHRASE>
<PHRASE Label="la_p9" Module="In-Portal" Type="1">KEdNVCArMDk6MDAp</PHRASE>
<PHRASE Label="la_Paddings" Module="In-Portal" Type="1">UGFkZGluZ3M=</PHRASE>
<PHRASE Label="la_Page" Module="In-Portal" Type="1">UGFnZQ==</PHRASE>
<PHRASE Label="la_password_info" Module="In-Portal" Type="2">VG8gY2hhbmdlIHRoZSBwYXNzd29yZCwgZW50ZXIgdGhlIHBhc3N3b3JkIGhlcmUgYW5kIGluIHRoZSBib3ggYmVsb3c=</PHRASE>
<PHRASE Label="la_Pending" Module="In-Portal" Type="0">UGVuZGluZw==</PHRASE>
<PHRASE Label="la_performing_backup" Module="In-Portal" Type="1">UGVyZm9ybWluZyBCYWNrdXA=</PHRASE>
<PHRASE Label="la_performing_export" Module="In-Portal" Type="1">UGVyZm9ybWluZyBFeHBvcnQ=</PHRASE>
<PHRASE Label="la_performing_import" Module="In-Portal" Type="1">UGVyZm9ybWluZyBJbXBvcnQ=</PHRASE>
<PHRASE Label="la_performing_restore" Module="In-Portal" Type="1">UGVyZm9ybWluZyBSZXN0b3Jl</PHRASE>
<PHRASE Label="la_PermName_Admin_desc" Module="In-Portal" Type="1">QWxsb3dzIGFjY2VzcyB0byB0aGUgQWRtaW5pc3RyYXRpb24gdXRpbGl0eQ==</PHRASE>
<PHRASE Label="la_PermName_SystemAccess.ReadOnly_desc" Module="In-Portal" Type="1">UmVhZC1Pbmx5IEFjY2VzcyBUbyBEYXRhYmFzZQ==</PHRASE>
<PHRASE Label="la_PermTab_category" Module="In-Portal" Type="1">Q2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_PermTab_link" Module="In-Portal" Type="1">TGlua3M=</PHRASE>
<PHRASE Label="la_PermTab_news" Module="In-Portal" Type="1">QXJ0aWNsZXM=</PHRASE>
<PHRASE Label="la_PermTab_topic" Module="In-Portal" Type="1">VG9waWNz</PHRASE>
<PHRASE Label="la_PermType_Admin" Module="In-Portal" Type="1">UGVybWlzc2lvbiBUeXBlIEFkbWlu</PHRASE>
<PHRASE Label="la_PermType_AdminSection" Module="In-Portal" Type="1">QWRtaW5pc3RyYXRpb24=</PHRASE>
<PHRASE Label="la_PermType_Front" Module="In-Portal" Type="1">UGVybWlzc2lvbiBUeXBlIEZyb250IEVuZA==</PHRASE>
<PHRASE Label="la_PermType_FrontEnd" Module="In-Portal" Type="1">RnJvbnQgRW5k</PHRASE>
<PHRASE Label="la_PhraseNotTranslated" Module="In-Portal" Type="1">Tm90IFRyYW5zbGF0ZWQ=</PHRASE>
<PHRASE Label="la_PhraseTranslated" Module="In-Portal" Type="1">VHJhbnNsYXRlZA==</PHRASE>
<PHRASE Label="la_PhraseType_Admin" Module="In-Portal" Type="1">QWRtaW4=</PHRASE>
<PHRASE Label="la_PhraseType_Both" Module="In-Portal" Type="2">Qm90aA==</PHRASE>
<PHRASE Label="la_PhraseType_Front" Module="In-Portal" Type="1">RnJvbnQ=</PHRASE>
<PHRASE Label="la_Pick" Module="In-Portal" Type="1">RWRpdG9yJ3MgcGljaw==</PHRASE>
<PHRASE Label="la_Pop" Module="In-Portal" Type="1">UG9w</PHRASE>
<PHRASE Label="la_PositionAndVisibility" Module="In-Portal" Type="1">UG9zaXRpb24gQW5kIFZpc2liaWxpdHk=</PHRASE>
<PHRASE Label="la_posts_newdays_prompt" Module="In-Portal" Type="1">TmV3IHBvc3RzIChkYXlzKQ==</PHRASE>
<PHRASE Label="la_posts_perpage_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIHBvc3RzIHBlciBwYWdl</PHRASE>
<PHRASE Label="la_posts_subheading" Module="In-Portal" Type="1">UG9zdHM=</PHRASE>
<PHRASE Label="la_prevcategory" Module="In-Portal" Type="1">UHJldmlvdXMgY2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_prevgroup" Module="In-Portal" Type="1">UHJldmlvdXMgZ3JvdXA=</PHRASE>
<PHRASE Label="la_PrevUser" Module="In-Portal" Type="1">UHJldmlvdXMgVXNlcg==</PHRASE>
<PHRASE Label="la_prompt_ActiveArticles" Module="In-Portal" Type="1">QWN0aXZlIEFydGljbGVz</PHRASE>
<PHRASE Label="la_prompt_ActiveCategories" Module="In-Portal" Type="1">QWN0aXZlIENhdGVnb3JpZXM=</PHRASE>
<PHRASE Label="la_prompt_ActiveLinks" Module="In-Portal" Type="1">QWN0aXZlIExpbmtz</PHRASE>
<PHRASE Label="la_prompt_ActiveTopics" Module="In-Portal" Type="1">QWN0aXZlIFRvcGljcw==</PHRASE>
<PHRASE Label="la_prompt_ActiveUsers" Module="In-Portal" Type="1">QWN0aXZlIFVzZXJz</PHRASE>
<PHRASE Label="la_prompt_addmodule" Module="In-Portal" Type="1">QWRkIE1vZHVsZQ==</PHRASE>
<PHRASE Label="la_prompt_AddressTo" Module="In-Portal" Type="1">U2VudCBUbw==</PHRASE>
<PHRASE Label="la_prompt_AdminId" Module="In-Portal" Type="1">QWRtaW4gZ3JvdXA=</PHRASE>
<PHRASE Label="la_prompt_AdminMailFrom" Module="In-Portal" Type="1">TWVzc2FnZXMgZnJvbSBTaXRlIEFkbWluIGFyZSBmcm9t</PHRASE>
<PHRASE Label="la_prompt_AdvancedSearch" Module="In-Portal" Type="1">QWR2YW5jZWQgU2VhcmNo</PHRASE>
<PHRASE Label="la_prompt_allow_reset" Module="In-Portal" Type="1">QWxsb3cgcGFzc3dvcmQgcmVzZXQgYWZ0ZXI=</PHRASE>
<PHRASE Label="la_prompt_all_templates" Module="In-Portal" Type="1">QWxsIHRlbXBsYXRlcw==</PHRASE>
<PHRASE Label="la_prompt_AltName" Module="In-Portal" Type="1">QWx0IHZhbHVl</PHRASE>
<PHRASE Label="la_prompt_applyingbanlist" Module="In-Portal" Type="2">QXBwbHlpbmcgQmFuIExpc3QgdG8gRXhpc3RpbmcgVXNlcnMuLg==</PHRASE>
<PHRASE Label="la_prompt_approve_warning" Module="In-Portal" Type="1">Q29udGludWUgdG8gcmVzdG9yZSBhdCBteSBvd24gcmlzaz8=</PHRASE>
<PHRASE Label="la_prompt_Archived" Module="In-Portal" Type="1">QXJjaGl2ZWQ=</PHRASE>
<PHRASE Label="la_prompt_ArchiveDate" Module="In-Portal" Type="1">QXJjaGl2YXRpb24gRGF0ZQ==</PHRASE>
<PHRASE Label="la_prompt_ArticleAverageRating" Module="In-Portal" Type="1">QXZlcmFnZSBSYXRpbmcgb2YgQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="la_prompt_ArticleBody" Module="In-Portal" Type="1">QXJ0aWNsZSBCb2R5</PHRASE>
<PHRASE Label="la_prompt_ArticleExcerpt" Module="In-Portal" Type="1">QXJ0aWNsZSBFeGNlcnB0</PHRASE>
<PHRASE Label="la_prompt_ArticleExcerpt!" Module="In-Portal" Type="1">QXJ0aWNsZSBFeGNlcnB0</PHRASE>
<PHRASE Label="la_prompt_ArticleReviews" Module="In-Portal" Type="1">VG90YWwgQXJ0aWNsZSBSZXZpZXdz</PHRASE>
<PHRASE Label="la_prompt_ArticlesActive" Module="In-Portal" Type="1">QWN0aXZlIEFydGljbGVz</PHRASE>
<PHRASE Label="la_prompt_ArticlesArchived" Module="In-Portal" Type="1">QXJjaGl2ZWQgQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="la_prompt_ArticlesPending" Module="In-Portal" Type="1">UGVuZGluZyBBcnRpY2xlcw==</PHRASE>
<PHRASE Label="la_prompt_ArticlesTotal" Module="In-Portal" Type="1">VG90YWwgQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="la_prompt_Attatchment" Module="In-Portal" Type="1">QXR0YWNobWVudA==</PHRASE>
<PHRASE Label="la_Prompt_Attention" Module="In-Portal" Type="1">QXR0ZW50aW9uIQ==</PHRASE>
<PHRASE Label="la_prompt_Author" Module="In-Portal" Type="1">QXV0aG9y</PHRASE>
<PHRASE Label="la_prompt_AutoGen_Excerpt" Module="In-Portal" Type="1">R2VuZXJhdGUgZnJvbSB0aGUgYXJ0aWNsZSBib2R5</PHRASE>
<PHRASE Label="la_prompt_AutomaticDirectoryName" Module="In-Portal" Type="1">QXV0b21hdGljIERpcmVjdG9yeSBOYW1l</PHRASE>
<PHRASE Label="la_prompt_AutomaticFilename" Module="In-Portal" Type="1">QXV0b21hdGljIEZpbGVuYW1l</PHRASE>
<PHRASE Label="la_prompt_Available_Modules" Module="In-Portal" Type="1">TW9kdWxlcw==</PHRASE>
<PHRASE Label="la_Prompt_Backup_Date" Module="In-Portal" Type="1">QmFjayBVcCBEYXRl</PHRASE>
<PHRASE Label="la_prompt_Backup_Path" Module="In-Portal" Type="1">QmFja3VwIFBhdGg=</PHRASE>
<PHRASE Label="la_Prompt_Backup_Status" Module="In-Portal" Type="1">QmFja3VwIHN0YXR1cw==</PHRASE>
<PHRASE Label="la_prompt_BannedUsers" Module="In-Portal" Type="1">QmFubmVkIFVzZXJz</PHRASE>
<PHRASE Label="la_prompt_birthday" Module="In-Portal" Type="1">RGF0ZSBvZiBCaXJ0aA==</PHRASE>
<PHRASE Label="la_prompt_CacheTimeout" Module="In-Portal" Type="1">Q2FjaGUgVGltZW91dCAoc2Vjb25kcyk=</PHRASE>
<PHRASE Label="la_prompt_CategoryEditorsPick" Module="In-Portal" Type="1">RWRpdG9yJ3MgUGljayBDYXRlZ29yaWVz</PHRASE>
<PHRASE Label="la_prompt_CategoryId" Module="In-Portal" Type="1">Q2F0ZWdvcnkgSUQ=</PHRASE>
<PHRASE Label="la_prompt_CategoryLeadStoryArticles" Module="In-Portal" Type="1">Q2F0ZWdvcnkgTGVhZCBTdG9yeSBBcnRpY2xlcw==</PHRASE>
<PHRASE Label="la_Prompt_CategoryPermissions" Module="In-Portal" Type="1">Q2F0ZWdvcnkgUGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_prompt_CatLead" Module="In-Portal" Type="1">Q2F0ZWdvcnkgTGVhZCBTdG9yeQ==</PHRASE>
<PHRASE Label="la_prompt_CensorhipId" Module="In-Portal" Type="1">Q2Vuc29yc2hpcCBJZA==</PHRASE>
<PHRASE Label="la_prompt_CensorWord" Module="In-Portal" Type="1">Q2Vuc29yc2hpcCBXb3Jk</PHRASE>
<PHRASE Label="la_prompt_charset" Module="In-Portal" Type="1">Q2hhcnNldA==</PHRASE>
<PHRASE Label="la_prompt_City" Module="In-Portal" Type="1">Q2l0eQ==</PHRASE>
<PHRASE Label="la_prompt_Comments" Module="In-Portal" Type="1">Q29tbWVudHM=</PHRASE>
<PHRASE Label="la_prompt_continue" Module="In-Portal" Type="1">Q29udGludWU=</PHRASE>
<PHRASE Label="la_prompt_CopyLabels" Module="In-Portal" Type="1">Q29weSBMYWJlbHMgZnJvbSB0aGlzIExhbmd1YWdl</PHRASE>
<PHRASE Label="la_prompt_Country" Module="In-Portal" Type="1">Q291bnRyeQ==</PHRASE>
<PHRASE Label="la_prompt_CreatedBy" Module="In-Portal" Type="1">Q3JlYXRlZCBieQ==</PHRASE>
<PHRASE Label="la_prompt_CreatedOn" Module="In-Portal" Type="1">Q3JlYXRlZCBvbg==</PHRASE>
<PHRASE Label="la_prompt_CreatedOn_Time" Module="In-Portal" Type="1">Q3JlYXRlZCBhdA==</PHRASE>
<PHRASE Label="la_prompt_CurrentSessions" Module="In-Portal" Type="1">Q3VycmVudCBTZXNzaW9ucw==</PHRASE>
<PHRASE Label="la_prompt_CustomFilename" Module="In-Portal" Type="1">Q3VzdG9tIEZpbGVuYW1l</PHRASE>
<PHRASE Label="la_prompt_DatabaseSettings" Module="In-Portal" Type="1">RGF0YWJhc2UgU2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_prompt_DataSize" Module="In-Portal" Type="1">VG90YWwgU2l6ZSBvZiB0aGUgRGF0YWJhc2U=</PHRASE>
<PHRASE Label="la_prompt_DateFormat" Module="In-Portal" Type="1">KG1tLWRkLXl5eXkp</PHRASE>
<PHRASE Label="la_prompt_DbName" Module="In-Portal" Type="1">U2VydmVyIERhdGFiYXNl</PHRASE>
<PHRASE Label="la_prompt_DbPass" Module="In-Portal" Type="1">U2VydmVyIFBhc3N3b3Jk</PHRASE>
<PHRASE Label="la_prompt_DbUsername" Module="In-Portal" Type="1">RGF0YWJhc2UgVXNlciBOYW1l</PHRASE>
<PHRASE Label="la_prompt_decimal" Module="In-Portal" Type="2">RGVjaW1hbCBQb2ludA==</PHRASE>
<PHRASE Label="la_prompt_Default" Module="In-Portal" Type="1">RGVmYXVsdA==</PHRASE>
<PHRASE Label="la_prompt_delete" Module="In-Portal" Type="1">RGVsZXRl</PHRASE>
<PHRASE Label="la_prompt_Description" Module="In-Portal" Type="1">RGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="la_prompt_DirectoryName" Module="In-Portal" Type="1">RGlyZWN0b3J5IE5hbWU=</PHRASE>
<PHRASE Label="la_prompt_DisabledArticles" Module="In-Portal" Type="1">RGlzYWJsZWQgQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="la_prompt_DisabledCategories" Module="In-Portal" Type="1">RGlzYWJsZWQgQ2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_prompt_DisabledLinks" Module="In-Portal" Type="1">RGlzYWJsZWQgTGlua3M=</PHRASE>
<PHRASE Label="la_prompt_DisplayOrder" Module="In-Portal" Type="1">RGlzcGxheSBPcmRlcg==</PHRASE>
<PHRASE Label="la_prompt_download_export" Module="In-Portal" Type="2">RG93bmxvYWQgTGFuZ3VhZ2UgRXhwb3J0Og==</PHRASE>
<PHRASE Label="la_prompt_DupRating" Module="In-Portal" Type="2">QWxsb3cgRHVwbGljYXRlIFJhdGluZyBWb3Rlcw==</PHRASE>
<PHRASE Label="la_prompt_DupReviews" Module="In-Portal" Type="2">QWxsb3cgRHVwbGljYXRlIFJldmlld3M=</PHRASE>
<PHRASE Label="la_prompt_edit" Module="In-Portal" Type="1">RWRpdA==</PHRASE>
<PHRASE Label="la_prompt_EditorsPick" Module="In-Portal" Type="1">RWRpdG9yJ3MgUGljaw==</PHRASE>
<PHRASE Label="la_prompt_EditorsPickArticles" Module="In-Portal" Type="1">RWRpdG9yJ3MgUGljayBBcnRpY2xlcw==</PHRASE>
<PHRASE Label="la_prompt_EditorsPickLinks" Module="In-Portal" Type="1">RWRpdG9yJ3MgUGljayBMaW5rcw==</PHRASE>
<PHRASE Label="la_prompt_EditorsPickTopics" Module="In-Portal" Type="1">RWRpdG9yIFBpY2sgVG9waWNz</PHRASE>
<PHRASE Label="la_prompt_edit_query" Module="In-Portal" Type="1">RWRpdCBRdWVyeQ==</PHRASE>
<PHRASE Label="la_prompt_Email" Module="In-Portal" Type="1">RW1haWw=</PHRASE>
<PHRASE Label="la_prompt_EmailBody" Module="In-Portal" Type="1">RW1haWwgQm9keQ==</PHRASE>
<PHRASE Label="la_prompt_EmailCancelMessage" Module="In-Portal" Type="1">RW1haWwgZGVsaXZlcnkgYWJvcnRlZA==</PHRASE>
<PHRASE Label="la_prompt_EmailCompleteMessage" Module="In-Portal" Type="1">VGhlIEVtYWlsIE1lc3NhZ2UgaGFzIGJlZW4gc2VudA==</PHRASE>
<PHRASE Label="la_prompt_EmailInitMessage" Module="In-Portal" Type="1">UGxlYXNlIFdhaXQgd2hpbGUgSW4tUG9ydGFsIHByZXBhcmVzIHRvIHNlbmQgdGhlIG1lc3NhZ2UuLg==</PHRASE>
<PHRASE Label="la_prompt_EmailSubject" Module="In-Portal" Type="1">RW1haWwgU3ViamVjdA==</PHRASE>
<PHRASE Label="la_prompt_EmoticonId" Module="In-Portal" Type="1">RW1vdGlvbiBJZA==</PHRASE>
<PHRASE Label="la_prompt_EnableCache" Module="In-Portal" Type="1">RW5hYmxlIFRlbXBsYXRlIENhY2hpbmc=</PHRASE>
<PHRASE Label="la_prompt_Enabled" Module="In-Portal" Type="1">RW5hYmxlZA==</PHRASE>
<PHRASE Label="la_prompt_Enable_HTML" Module="In-Portal" Type="1">RW5hYmxlIEhUTUw/</PHRASE>
<PHRASE Label="la_prompt_ErrorTag" Module="In-Portal" Type="2">RXJyb3IgVGFn</PHRASE>
<PHRASE Label="la_prompt_Event" Module="In-Portal" Type="1">RXZlbnQ=</PHRASE>
<PHRASE Label="la_prompt_Expired" Module="In-Portal" Type="0">RXhwaXJhdGlvbiBEYXRl</PHRASE>
<PHRASE Label="la_prompt_ExportFileName" Module="In-Portal" Type="2">RXhwb3J0IEZpbGVuYW1l</PHRASE>
<PHRASE Label="la_prompt_export_error" Module="In-Portal" Type="1">R2VuZXJhbCBlcnJvcjogdW5hYmxlIHRvIGV4cG9ydA==</PHRASE>
<PHRASE Label="la_prompt_FieldId" Module="In-Portal" Type="1">RmllbGQgSWQ=</PHRASE>
<PHRASE Label="la_prompt_FieldLabel" Module="In-Portal" Type="1">RmllbGQgTGFiZWw=</PHRASE>
<PHRASE Label="la_prompt_FieldName" Module="In-Portal" Type="1">RmllbGQgTmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_FieldPrompt" Module="In-Portal" Type="1">RmllbGQgUHJvbXB0</PHRASE>
<PHRASE Label="la_prompt_FileId" Module="In-Portal" Type="1">RmlsZSBJZA==</PHRASE>
<PHRASE Label="la_prompt_FileName" Module="In-Portal" Type="1">RmlsZSBuYW1l</PHRASE>
<PHRASE Label="la_prompt_FirstName" Module="In-Portal" Type="1">Rmlyc3QgTmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_First_Name" Module="In-Portal" Type="1">Rmlyc3QgTmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_Frequency" Module="In-Portal" Type="1">RnJlcXVlbmN5</PHRASE>
<PHRASE Label="la_prompt_FromUser" Module="In-Portal" Type="1">RnJvbS9UbyBVc2Vy</PHRASE>
<PHRASE Label="la_prompt_FromUsername" Module="In-Portal" Type="1">RnJvbQ==</PHRASE>
<PHRASE Label="la_prompt_FrontLead" Module="In-Portal" Type="1">RnJvbnQgcGFnZSBsZWFkIGFydGljbGU=</PHRASE>
<PHRASE Label="la_Prompt_GeneralPermissions" Module="In-Portal" Type="1">R2VuZXJhbCBQZXJtaXNzaW9ucw==</PHRASE>
<PHRASE Label="la_prompt_GroupName" Module="In-Portal" Type="1">R3JvdXAgTmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_headers" Module="In-Portal" Type="1">RXh0cmEgTWFpbCBIZWFkZXJz</PHRASE>
<PHRASE Label="la_prompt_heading" Module="In-Portal" Type="1">SGVhZGluZw==</PHRASE>
<PHRASE Label="la_prompt_HitLimits" Module="In-Portal" Type="1">KE1pbmltdW0gNCk=</PHRASE>
<PHRASE Label="la_prompt_Hits" Module="In-Portal" Type="1">SGl0cw==</PHRASE>
<PHRASE Label="la_prompt_Hot" Module="In-Portal" Type="1">SG90</PHRASE>
<PHRASE Label="la_prompt_HotArticles" Module="In-Portal" Type="1">SG90IEFydGljbGVz</PHRASE>
<PHRASE Label="la_prompt_HotLinks" Module="In-Portal" Type="1">SG90IExpbmtz</PHRASE>
<PHRASE Label="la_prompt_HotTopics" Module="In-Portal" Type="1">SG90IFRvcGljcw==</PHRASE>
<PHRASE Label="la_prompt_html" Module="In-Portal" Type="1">SFRNTA==</PHRASE>
<PHRASE Label="la_prompt_html_version" Module="In-Portal" Type="1">SFRNTCBWZXJzaW9u</PHRASE>
<PHRASE Label="la_prompt_icon_url" Module="In-Portal" Type="1">SWNvbiBVUkw=</PHRASE>
<PHRASE Label="la_prompt_Image" Module="In-Portal" Type="1">SW1hZ2U=</PHRASE>
<PHRASE Label="la_prompt_ImageId" Module="In-Portal" Type="1">SW1hZ2UgSUQ=</PHRASE>
<PHRASE Label="la_prompt_import_error" Module="In-Portal" Type="1">SW1wb3J0IGVuY291bnRlcmVkIGFuIGVycm9yIGFuZCBkaWQgbm90IGNvbXBsZXRlLg==</PHRASE>
<PHRASE Label="la_prompt_Import_ImageName" Module="In-Portal" Type="1">TGluayBJbWFnZSBOYW1l</PHRASE>
<PHRASE Label="la_prompt_Import_Prefix" Module="In-Portal" Type="1">VGFibGUgTmFtZSBQcmVmaXg=</PHRASE>
<PHRASE Label="la_prompt_InitImportCat" Module="In-Portal" Type="1">SW5pdGlhbCBJbXBvcnQgQ2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_prompt_InlinkDbName" Module="In-Portal" Type="1">SW4tTGluayBEYXRhYmFzZSBOYW1l</PHRASE>
<PHRASE Label="la_prompt_InlinkDbPass" Module="In-Portal" Type="1">SW4tTGluayBEYXRhYmFzZSBQYXNzd29yZA==</PHRASE>
<PHRASE Label="la_prompt_InlinkDbUsername" Module="In-Portal" Type="1">SW4tTGluayBEYXRhYmFzZSBVc2VybmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_InlinkServer" Module="In-Portal" Type="1">SW4tTGluayBTZXJ2ZXIgTmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_InlinkSqlType" Module="In-Portal" Type="1">SW4tTGluayBTUUwgVHlwZQ==</PHRASE>
<PHRASE Label="la_prompt_InputType" Module="In-Portal" Type="1">SW5wdXQgVHlwZQ==</PHRASE>
<PHRASE Label="la_prompt_Install_Status" Module="In-Portal" Type="1">SW5zdGFsbGF0aW9uIFN0YXR1cw==</PHRASE>
<PHRASE Label="la_prompt_ip" Module="In-Portal" Type="1">SVAgQWRkcmVzcw==</PHRASE>
<PHRASE Label="la_prompt_IPAddress" Module="In-Portal" Type="1">SVAgQWRkcmVzcw==</PHRASE>
<PHRASE Label="la_prompt_Item" Module="In-Portal" Type="1">SXRlbQ==</PHRASE>
<PHRASE Label="la_prompt_ItemField" Module="In-Portal" Type="2">SXRlbSBGaWVsZA==</PHRASE>
<PHRASE Label="la_prompt_ItemValue" Module="In-Portal" Type="2">RmllbGQgVmFsdWU=</PHRASE>
<PHRASE Label="la_prompt_ItemVerb" Module="In-Portal" Type="2">RmllbGQgQ29tcGFyaXNvbg==</PHRASE>
<PHRASE Label="la_prompt_KeyStroke" Module="In-Portal" Type="1">S2V5IFN0cm9rZQ==</PHRASE>
<PHRASE Label="la_prompt_Keyword" Module="In-Portal" Type="1">S2V5d29yZA==</PHRASE>
<PHRASE Label="la_prompt_Label" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_prompt_LanguageFile" Module="In-Portal" Type="1">TGFuZ3VhZ2UgRmlsZQ==</PHRASE>
<PHRASE Label="la_prompt_LanguageId" Module="In-Portal" Type="1">TGFuZ3VhZ2UgSWQ=</PHRASE>
<PHRASE Label="la_prompt_lang_cache_timeout" Module="In-Portal" Type="1">TGFuZ3VhZ2UgQ2FjaGUgVGltZW91dA==</PHRASE>
<PHRASE Label="la_prompt_lang_dateformat" Module="In-Portal" Type="2">RGF0ZSBGb3JtYXQ=</PHRASE>
<PHRASE Label="la_prompt_lang_timeformat" Module="In-Portal" Type="0">VGltZSBGb3JtYXQ=</PHRASE>
<PHRASE Label="la_prompt_LastArticleUpdate" Module="In-Portal" Type="1">TGFzdCBVcGRhdGVkIEFydGljbGU=</PHRASE>
<PHRASE Label="la_prompt_LastCategoryUpdate" Module="In-Portal" Type="1">TGFzdCBDYXRlZ29yeSBVcGRhdGU=</PHRASE>
<PHRASE Label="la_prompt_LastLinkUpdate" Module="In-Portal" Type="1">TGFzdCBVcGRhdGVkIExpbms=</PHRASE>
<PHRASE Label="la_prompt_LastName" Module="In-Portal" Type="1">TGFzdCBOYW1l</PHRASE>
<PHRASE Label="la_prompt_LastUpdatedPostDate" Module="In-Portal" Type="1">TGFzdCBVcGRhdGVkIFBvc3QgRGF0ZQ==</PHRASE>
<PHRASE Label="la_prompt_LastUpdatedPostTime" Module="In-Portal" Type="1">TGFzdCBVcGRhdGVkIFBvc3QgVGltZQ==</PHRASE>
<PHRASE Label="la_prompt_LastUpdatedTopicDate" Module="In-Portal" Type="1">TGFzdCBVcGRhdGVkIFRvcGljIERhdGU=</PHRASE>
<PHRASE Label="la_prompt_LastUpdatedTopicTime" Module="In-Portal" Type="1">TGFzdCBVcGRhdGVkIFRvcGljIFRpbWU=</PHRASE>
<PHRASE Label="la_prompt_Last_Name" Module="In-Portal" Type="1">TGFzdCBOYW1l</PHRASE>
<PHRASE Label="la_prompt_LeadArticle" Module="In-Portal" Type="1">U2l0ZSBMZWFkIFN0b3J5</PHRASE>
<PHRASE Label="la_prompt_LeadCat" Module="In-Portal" Type="1">Q2F0ZWdvcnkgbGVhZCBhcnRpY2xl</PHRASE>
<PHRASE Label="la_prompt_LeadStoryArticles" Module="In-Portal" Type="1">TGVhZCBTdG9yeSBBcnRpY2xlcw==</PHRASE>
<PHRASE Label="la_prompt_LinkId" Module="In-Portal" Type="1">TGluayBJZA==</PHRASE>
<PHRASE Label="la_prompt_LinkReviews" Module="In-Portal" Type="1">VG90YWwgTGluayBSZXZpZXdz</PHRASE>
<PHRASE Label="la_prompt_LinksAverageRating" Module="In-Portal" Type="1">QXZlcmFnZSBSYXRpbmcgb2YgTGlua3M=</PHRASE>
<PHRASE Label="la_prompt_link_owner" Module="In-Portal" Type="1">TGluayBPd25lcg==</PHRASE>
<PHRASE Label="la_prompt_LoadLangTypes" Module="In-Portal" Type="1">SW5zdGFsbCBQaHJhc2UgVHlwZXM6</PHRASE>
<PHRASE Label="la_prompt_LocalName" Module="In-Portal" Type="1">TG9jYWwgTmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_Location" Module="In-Portal" Type="1">TG9jYXRpb24=</PHRASE>
<PHRASE Label="la_prompt_mailauthenticate" Module="In-Portal" Type="1">U2VydmVyIFJlcXVpcmVzIEF1dGhlbnRpY2F0aW9u</PHRASE>
<PHRASE Label="la_prompt_mailhtml" Module="In-Portal" Type="1">U2VuZCBIVE1MIGVtYWls</PHRASE>
<PHRASE Label="la_prompt_mailport" Module="In-Portal" Type="1">UG9ydCAoZS5nLiBwb3J0IDI1KQ==</PHRASE>
<PHRASE Label="la_prompt_mailserver" Module="In-Portal" Type="1">TWFpbCBTZXJ2ZXIgQWRkcmVzcw==</PHRASE>
<PHRASE Label="la_prompt_MaxHitsArticles" Module="In-Portal" Type="1">TWF4aW11bSBIaXRzIG9mIGFuIEFydGljbGU=</PHRASE>
<PHRASE Label="la_prompt_MaxLinksHits" Module="In-Portal" Type="1">TWF4aW11bSBIaXRzIG9mIGEgTGluaw==</PHRASE>
<PHRASE Label="la_prompt_MaxLinksVotes" Module="In-Portal" Type="1">TWF4aW11bSBWb3RlcyBvZiBhIExpbms=</PHRASE>
<PHRASE Label="la_prompt_MaxTopicHits" Module="In-Portal" Type="1">VG9waWMgTWF4aW11bSBIaXRz</PHRASE>
<PHRASE Label="la_prompt_MaxTopicVotes" Module="In-Portal" Type="1">VG9waWMgTWF4aW11bSBWb3Rlcw==</PHRASE>
<PHRASE Label="la_prompt_MaxVotesArticles" Module="In-Portal" Type="1">TWF4aW11bSBWb3RlcyBvZiBhbiBBcnRpY2xl</PHRASE>
<PHRASE Label="la_prompt_max_import_category_levels" Module="In-Portal" Type="1">TWF4aW1hbCBpbXBvcnRlZCBjYXRlZ29yeSBsZXZlbA==</PHRASE>
<PHRASE Label="la_prompt_MembershipExpires" Module="In-Portal" Type="1">TWVtYmVyc2hpcCBFeHBpcmVz</PHRASE>
<PHRASE Label="la_prompt_MessageType" Module="In-Portal" Type="1">Rm9ybWF0</PHRASE>
<PHRASE Label="la_prompt_MetaDescription" Module="In-Portal" Type="1">TWV0YSBEZXNjcmlwdGlvbg==</PHRASE>
<PHRASE Label="la_prompt_MetaKeywords" Module="In-Portal" Type="1">TWV0YSBLZXl3b3Jkcw==</PHRASE>
<PHRASE Label="la_prompt_minkeywordlength" Module="In-Portal" Type="1">TWluaW11bSBrZXl3b3JkIGxlbmd0aA==</PHRASE>
<PHRASE Label="la_prompt_ModifedOn" Module="In-Portal" Type="1">TW9kaWZpZWQgT24=</PHRASE>
<PHRASE Label="la_prompt_ModifedOn_Time" Module="In-Portal" Type="1">TW9kaWZpZWQgYXQ=</PHRASE>
<PHRASE Label="la_prompt_Module" Module="In-Portal" Type="1">TW9kdWxl</PHRASE>
<PHRASE Label="la_prompt_movedown" Module="In-Portal" Type="1">TW92ZSBkb3du</PHRASE>
<PHRASE Label="la_prompt_moveup" Module="In-Portal" Type="1">TW92ZSB1cA==</PHRASE>
<PHRASE Label="la_prompt_multipleshow" Module="In-Portal" Type="1">U2hvdyBtdWx0aXBsZQ==</PHRASE>
<PHRASE Label="la_prompt_Name" Module="In-Portal" Type="1">TmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_New" Module="In-Portal" Type="1">TmV3</PHRASE>
<PHRASE Label="la_prompt_NewArticles" Module="In-Portal" Type="1">TmV3IEFydGljbGVz</PHRASE>
<PHRASE Label="la_prompt_NewCategories" Module="In-Portal" Type="1">TmV3IENhdGVnb3JpZXM=</PHRASE>
<PHRASE Label="la_prompt_NewestArticleDate" Module="In-Portal" Type="1">TmV3ZXN0IEFydGljbGUgRGF0ZQ==</PHRASE>
<PHRASE Label="la_prompt_NewestCategoryDate" Module="In-Portal" Type="1">TmV3ZXN0IENhdGVnb3J5IERhdGU=</PHRASE>
<PHRASE Label="la_prompt_NewestLinkDate" Module="In-Portal" Type="1">TmV3ZXN0IExpbmsgRGF0ZQ==</PHRASE>
<PHRASE Label="la_prompt_NewestPostDate" Module="In-Portal" Type="1">TmV3ZXN0IFBvc3QgRGF0ZQ==</PHRASE>
<PHRASE Label="la_prompt_NewestPostTime" Module="In-Portal" Type="1">TmV3ZXN0IFBvc3QgVGltZQ==</PHRASE>
<PHRASE Label="la_prompt_NewestTopicDate" Module="In-Portal" Type="1">TmV3ZXN0IFRvcGljIERhdGU=</PHRASE>
<PHRASE Label="la_prompt_NewestTopicTime" Module="In-Portal" Type="1">TmV3ZXN0IFRvcGljIFRpbWU=</PHRASE>
<PHRASE Label="la_prompt_NewestUserDate" Module="In-Portal" Type="1">TmV3ZXN0IFVzZXIgRGF0ZQ==</PHRASE>
<PHRASE Label="la_prompt_NewLinks" Module="In-Portal" Type="1">TmV3IExpbmtz</PHRASE>
<PHRASE Label="la_prompt_NewsId" Module="In-Portal" Type="1">TmV3cyBBcnRpY2xlIElE</PHRASE>
<PHRASE Label="la_prompt_NewTopics" Module="In-Portal" Type="1">TmV3IFRvcGljcw==</PHRASE>
<PHRASE Label="la_prompt_NonExpiredSessions" Module="In-Portal" Type="1">Q3VycmVudGx5IEFjdGl2ZSBVc2VyIFNlc3Npb25z</PHRASE>
<PHRASE Label="la_prompt_NotifyOwner" Module="In-Portal" Type="1">Tm90aWZ5IE93bmVy</PHRASE>
<PHRASE Label="la_prompt_NotRegUsers" Module="In-Portal" Type="1">TGluayBwZXJtaXNzaW9uIElEIGZvciBhbGwgdW5yZWdpc3RlcmVkIHVzZXJzIHRvIHZpZXcgaXQ=</PHRASE>
<PHRASE Label="la_prompt_overwritephrases" Module="In-Portal" Type="2">T3ZlcndyaXRlIEV4aXN0aW5nIFBocmFzZXM=</PHRASE>
<PHRASE Label="la_prompt_PackName" Module="In-Portal" Type="1">UGFjayBOYW1l</PHRASE>
<PHRASE Label="la_prompt_Parameter" Module="In-Portal" Type="1">UGFyYW1ldGVy</PHRASE>
<PHRASE Label="la_prompt_parent_templates" Module="In-Portal" Type="1">UGFyZW50IHRlbXBsYXRlcw==</PHRASE>
<PHRASE Label="la_prompt_Password" Module="In-Portal" Type="1">UGFzc3dvcmQ=</PHRASE>
<PHRASE Label="la_prompt_PasswordRepeat" Module="In-Portal" Type="1">UmVwZWF0IFBhc3N3b3Jk</PHRASE>
<PHRASE Label="la_prompt_Pending" Module="In-Portal" Type="1">UGVuZGluZw==</PHRASE>
<PHRASE Label="la_prompt_PendingCategories" Module="In-Portal" Type="1">UGVuZGluZyBDYXRlZ29yaWVz</PHRASE>
<PHRASE Label="la_prompt_PendingItems" Module="In-Portal" Type="1">UGVuZGluZyBJdGVtcw==</PHRASE>
<PHRASE Label="la_prompt_PendingLinks" Module="In-Portal" Type="1">UGVuZGluZyBMaW5rcw==</PHRASE>
<PHRASE Label="la_prompt_perform_now" Module="In-Portal" Type="1">UGVyZm9ybSB0aGlzIG9wZXJhdGlvbiBub3c/</PHRASE>
<PHRASE Label="la_prompt_PerPage" Module="In-Portal" Type="1">UGVyIFBhZ2U=</PHRASE>
<PHRASE Label="la_prompt_PersonalInfo" Module="In-Portal" Type="1">UGVyc29uYWwgSW5mb3JtYXRpb24=</PHRASE>
<PHRASE Label="la_prompt_Phone" Module="In-Portal" Type="1">UGhvbmU=</PHRASE>
<PHRASE Label="la_prompt_PhraseId" Module="In-Portal" Type="1">UGhyYXNlIElk</PHRASE>
<PHRASE Label="la_prompt_Phrases" Module="In-Portal" Type="1">UGhyYXNlcw==</PHRASE>
<PHRASE Label="la_prompt_PhraseType" Module="In-Portal" Type="1">UGhyYXNlIFR5cGU=</PHRASE>
<PHRASE Label="la_prompt_plaintext" Module="In-Portal" Type="1">UGxhaW4gVGV4dA==</PHRASE>
<PHRASE Label="la_prompt_Pop" Module="In-Portal" Type="1">UG9wdWxhcml0eQ==</PHRASE>
<PHRASE Label="la_prompt_PopularArticles" Module="In-Portal" Type="1">UG9wdWxhciBBcnRpY2xlcw==</PHRASE>
<PHRASE Label="la_prompt_PopularLinks" Module="In-Portal" Type="1">UG9wdWxhciBMaW5rcw==</PHRASE>
<PHRASE Label="la_prompt_PopularTopics" Module="In-Portal" Type="1">UG9wdWxhciBUb3BpY3M=</PHRASE>
<PHRASE Label="la_prompt_PostedBy" Module="In-Portal" Type="1">UG9zdGVkIGJ5</PHRASE>
<PHRASE Label="la_prompt_PostsToLock" Module="In-Portal" Type="1">UG9zdHMgdG8gbG9jaw==</PHRASE>
<PHRASE Label="la_prompt_PostsTotal" Module="In-Portal" Type="1">VG90YWwgUG9zdHM=</PHRASE>
<PHRASE Label="la_prompt_Primary" Module="In-Portal" Type="1">UHJpbWFyeQ==</PHRASE>
<PHRASE Label="la_prompt_PrimaryGroup" Module="In-Portal" Type="1">UHJpbWFyeSBHcm91cA==</PHRASE>
<PHRASE Label="la_prompt_PrimaryValue" Module="In-Portal" Type="1">UHJpbWFyeSBWYWx1ZQ==</PHRASE>
<PHRASE Label="la_prompt_Priority" Module="In-Portal" Type="1">UHJpb3JpdHk=</PHRASE>
<PHRASE Label="la_prompt_Properties" Module="In-Portal" Type="1">UHJvcGVydGllcw==</PHRASE>
<PHRASE Label="la_prompt_Rating" Module="In-Portal" Type="1">UmF0aW5n</PHRASE>
<PHRASE Label="la_prompt_RatingLimits" Module="In-Portal" Type="1">KE1pbmltdW0gMCwgTWF4aW11bSA1KQ==</PHRASE>
<PHRASE Label="la_prompt_RecordsCount" Module="In-Portal" Type="1">TnVtYmVyIG9mIERhdGFiYXNlIFJlY29yZHM=</PHRASE>
<PHRASE Label="la_prompt_RegionsCount" Module="In-Portal" Type="1">TnVtYmVyIG9mIFJlZ2lvbiBQYWNrcw==</PHRASE>
<PHRASE Label="la_prompt_RegUserId" Module="In-Portal" Type="1">UmVndWxhciBVc2VyIEdyb3Vw</PHRASE>
<PHRASE Label="la_prompt_RegUsers" Module="In-Portal" Type="1">TGluayBwZXJtaXNzaW9uIElEIGZvciBhbGwgcmVnaXN0ZXJlZCB1c2VycyB0byB2aWV3IGl0</PHRASE>
<PHRASE Label="la_prompt_RelationId" Module="In-Portal" Type="1">UmVsYXRpb24gSUQ=</PHRASE>
<PHRASE Label="la_prompt_RelationType" Module="In-Portal" Type="1">UmVsYXRpb24gVHlwZQ==</PHRASE>
<PHRASE Label="la_prompt_relevence_percent" Module="In-Portal" Type="1">U2VhcmNoIFJlbGV2YW5jZSBkZXBlbmRzIG9u</PHRASE>
<PHRASE Label="la_prompt_relevence_settings" Module="In-Portal" Type="1">U2VhcmNoIFJlbGV2ZW5jZSBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_prompt_remote_url" Module="In-Portal" Type="1">VXNlIHJlbW90ZSBpbWFnZSAoVVJMKQ==</PHRASE>
<PHRASE Label="la_prompt_ReplacementWord" Module="In-Portal" Type="1">UmVwbGFjZW1lbnQgV29yZA==</PHRASE>
<PHRASE Label="la_prompt_required_field_increase" Module="In-Portal" Type="1">SW5jcmVhc2UgaW1wb3J0YW5jZSBpZiBmaWVsZCBjb250YWlucyBhIHJlcXVpcmVkIGtleXdvcmQgYnk=</PHRASE>
<PHRASE Label="la_Prompt_Restore_Failed" Module="In-Portal" Type="1">UmVzdG9yZSBoYXMgZmFpbGVkIGFuIGVycm9yIG9jY3VyZWQ6</PHRASE>
<PHRASE Label="la_Prompt_Restore_Filechoose" Module="In-Portal" Type="1">Q2hvb3NlIG9uZSBvZiB0aGUgZm9sbG93aW5nIGJhY2t1cCBkYXRlcyB0byByZXN0b3JlIG9yIGRlbGV0ZQ==</PHRASE>
<PHRASE Label="la_Prompt_Restore_Status" Module="In-Portal" Type="1">UmVzdG9yZSBTdGF0dXM=</PHRASE>
<PHRASE Label="la_Prompt_Restore_Success" Module="In-Portal" Type="1">UmVzdG9yZSBoYXMgYmVlbiBjb21wbGV0ZWQgc3VjY2Vzc2Z1bGx5</PHRASE>
<PHRASE Label="la_Prompt_ReviewedBy" Module="In-Portal" Type="1">UmV2aWV3ZWQgQnk=</PHRASE>
<PHRASE Label="la_prompt_ReviewId" Module="In-Portal" Type="1">UmV2aWV3IElE</PHRASE>
<PHRASE Label="la_prompt_ReviewText" Module="In-Portal" Type="1">UmV2aWV3IFRleHQ=</PHRASE>
<PHRASE Label="la_prompt_RootCategory" Module="In-Portal" Type="1">U2VsZWN0IE1vZHVsZSBSb290IENhdGVnb3J5Og==</PHRASE>
<PHRASE Label="la_prompt_root_name" Module="In-Portal" Type="1">Um9vdCBjYXRlZ29yeSBuYW1lIChsYW5ndWFnZSB2YXJpYWJsZSk=</PHRASE>
<PHRASE Label="la_prompt_root_pass" Module="In-Portal" Type="1">Um9vdCBQYXNzd29yZA==</PHRASE>
<PHRASE Label="la_prompt_Root_Password" Module="In-Portal" Type="1">UGxlYXNlIGVudGVyIHRoZSBSb290IHBhc3N3b3Jk</PHRASE>
<PHRASE Label="la_prompt_root_pass_verify" Module="In-Portal" Type="1">VmVyaWZ5IFJvb3QgUGFzc3dvcmQ=</PHRASE>
<PHRASE Label="la_prompt_RuleType" Module="In-Portal" Type="2">UnVsZSBUeXBl</PHRASE>
<PHRASE Label="la_prompt_runlink_validation" Module="In-Portal" Type="2">VmFsaWRhdGlvbiBQcm9ncmVzcw==</PHRASE>
<PHRASE Label="la_prompt_Search" Module="In-Portal" Type="1">U2VhcmNo</PHRASE>
<PHRASE Label="la_prompt_SearchType" Module="In-Portal" Type="1">U2VhcmNoIFR5cGU=</PHRASE>
<PHRASE Label="la_prompt_Select_Source" Module="In-Portal" Type="1">U2VsZWN0IFNvdXJjZSBMYW5ndWFnZQ==</PHRASE>
<PHRASE Label="la_prompt_sendmethod" Module="In-Portal" Type="1">U2VuZCBFbWFpbCBBcw==</PHRASE>
<PHRASE Label="la_prompt_SentOn" Module="In-Portal" Type="1">U2VudCBPbg==</PHRASE>
<PHRASE Label="la_prompt_Server" Module="In-Portal" Type="1">U2VydmVyIEhvc3RuYW1l</PHRASE>
<PHRASE Label="la_prompt_SessionKey" Module="In-Portal" Type="1">U0lE</PHRASE>
<PHRASE Label="la_prompt_session_cookie_name" Module="In-Portal" Type="1">U2Vzc2lvbiBDb29raWUgTmFtZQ==</PHRASE>
<PHRASE Label="la_prompt_session_management" Module="In-Portal" Type="1">U2Vzc2lvbiBNYW5hZ2VtZW50IE1ldGhvZA==</PHRASE>
<PHRASE Label="la_prompt_session_timeout" Module="In-Portal" Type="1">U2Vzc2lvbiBJbmFjdGl2aXR5IFRpbWVvdXQgKHNlY29uZHMp</PHRASE>
<PHRASE Label="la_prompt_showgeneraltab" Module="In-Portal" Type="1">U2hvdyBvbiB0aGUgZ2VuZXJhbCB0YWI=</PHRASE>
<PHRASE Label="la_prompt_SimpleSearch" Module="In-Portal" Type="1">U2ltcGxlIFNlYXJjaA==</PHRASE>
<PHRASE Label="la_prompt_smtpheaders" Module="In-Portal" Type="1">QWRkaXRpb25hbCBNZXNzYWdlIEhlYWRlcnM=</PHRASE>
<PHRASE Label="la_prompt_smtp_pass" Module="In-Portal" Type="1">TWFpbCBTZXJ2ZXIgUGFzc3dvcmQ=</PHRASE>
<PHRASE Label="la_prompt_smtp_user" Module="In-Portal" Type="1">TWFpbCBTZXJ2ZXIgVXNlcm5hbWU=</PHRASE>
<PHRASE Label="la_prompt_socket_blocking_mode" Module="In-Portal" Type="1">VXNlIG5vbi1ibG9ja2luZyBzb2NrZXQgbW9kZQ==</PHRASE>
<PHRASE Label="la_prompt_sqlquery" Module="In-Portal" Type="1">U1FMIFF1ZXJ5Og==</PHRASE>
<PHRASE Label="la_prompt_sqlquery_error" Module="In-Portal" Type="1">QW4gU1FMIGVycm9yIGhhcyBvY2N1cmVk</PHRASE>
<PHRASE Label="la_prompt_sqlquery_header" Module="In-Portal" Type="1">UGVyZm9ybSBTUUwgUXVlcnk=</PHRASE>
<PHRASE Label="la_prompt_sqlquery_result" Module="In-Portal" Type="1">U1FMIFF1ZXJ5IFJlc3VsdHM=</PHRASE>
<PHRASE Label="la_prompt_SqlType" Module="In-Portal" Type="1">U2VydmVyIFR5cGU=</PHRASE>
<PHRASE Label="la_prompt_StartDate" Module="In-Portal" Type="1">U3RhcnQgRGF0ZQ==</PHRASE>
<PHRASE Label="la_prompt_State" Module="In-Portal" Type="1">U3RhdGU=</PHRASE>
<PHRASE Label="la_prompt_Status" Module="In-Portal" Type="1">U3RhdHVz</PHRASE>
<PHRASE Label="la_Prompt_Step_One" Module="In-Portal" Type="1">U3RlcCBPbmU=</PHRASE>
<PHRASE Label="la_prompt_Street" Module="In-Portal" Type="1">U3RyZWV0</PHRASE>
<PHRASE Label="la_prompt_Stylesheet" Module="In-Portal" Type="1">U3R5bGVzaGVldA==</PHRASE>
<PHRASE Label="la_prompt_Subject" Module="In-Portal" Type="1">U3ViamVjdA==</PHRASE>
<PHRASE Label="la_prompt_SubSearch" Module="In-Portal" Type="1">U3ViIFNlYXJjaA==</PHRASE>
<PHRASE Label="la_prompt_syscache_enable" Module="In-Portal" Type="1">RW5hYmxlIFRhZyBDYWNoaW5n</PHRASE>
<PHRASE Label="la_prompt_SystemFileSize" Module="In-Portal" Type="1">VG90YWwgU2l6ZSBvZiBTeXN0ZW0gRmlsZXM=</PHRASE>
<PHRASE Label="la_Prompt_SystemPermissions" Module="In-Portal" Type="1">U3lzdGVtIHByZW1pc3Npb25z</PHRASE>
<PHRASE Label="la_prompt_TablesCount" Module="In-Portal" Type="1">TnVtYmVyIG9mIERhdGFiYXNlIFRhYmxlcw==</PHRASE>
<PHRASE Label="la_prompt_Template" Module="In-Portal" Type="1">VGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_prompt_text_version" Module="In-Portal" Type="1">VGV4dCBWZXJzaW9u</PHRASE>
<PHRASE Label="la_prompt_Theme" Module="In-Portal" Type="1">VGhlbWU=</PHRASE>
<PHRASE Label="la_prompt_ThemeCount" Module="In-Portal" Type="1">TnVtYmVyIG9mIFRoZW1lcw==</PHRASE>
<PHRASE Label="la_prompt_ThemeId" Module="In-Portal" Type="1">VGhlbWUgSWQ=</PHRASE>
<PHRASE Label="la_prompt_thousand" Module="In-Portal" Type="2">VGhvdXNhbmRzIFNlcGFyYXRvcg==</PHRASE>
<PHRASE Label="la_prompt_ThumbURL" Module="In-Portal" Type="1">UmVtb3RlIFVSTA==</PHRASE>
<PHRASE Label="la_prompt_TimeFormat" Module="In-Portal" Type="1">KGhoOm1tOnNzKQ==</PHRASE>
<PHRASE Label="la_Prompt_Title" Module="In-Portal" Type="1">VGl0bGU=</PHRASE>
<PHRASE Label="la_prompt_To" Module="In-Portal" Type="1">VG8=</PHRASE>
<PHRASE Label="la_prompt_TopicAverageRating" Module="In-Portal" Type="1">VG9waWNzIEF2ZXJhZ2UgUmF0aW5n</PHRASE>
<PHRASE Label="la_prompt_TopicId" Module="In-Portal" Type="1">VG9waWMgSUQ=</PHRASE>
<PHRASE Label="la_prompt_TopicLocked" Module="In-Portal" Type="1">VG9waWMgTG9ja2Vk</PHRASE>
<PHRASE Label="la_prompt_TopicReviews" Module="In-Portal" Type="1">VG90YWwgVG9waWMgUmV2aWV3cw==</PHRASE>
<PHRASE Label="la_prompt_TopicsActive" Module="In-Portal" Type="1">QWN0aXZlIFRvcGljcw==</PHRASE>
<PHRASE Label="la_prompt_TopicsDisabled" Module="In-Portal" Type="1">RGlzYWJsZWQgVG9waWNz</PHRASE>
<PHRASE Label="la_prompt_TopicsPending" Module="In-Portal" Type="1">UGVuZGluZyBUb3BpY3M=</PHRASE>
<PHRASE Label="la_prompt_TopicsTotal" Module="In-Portal" Type="1">VG90YWwgVG9waWNz</PHRASE>
<PHRASE Label="la_prompt_TopicsUsers" Module="In-Portal" Type="1">VG90YWwgVXNlcnMgd2l0aCBUb3BpY3M=</PHRASE>
<PHRASE Label="la_prompt_TotalCategories" Module="In-Portal" Type="1">VG90YWwgQ2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_prompt_TotalLinks" Module="In-Portal" Type="1">VG90YWwgTGlua3M=</PHRASE>
<PHRASE Label="la_prompt_TotalUserGroups" Module="In-Portal" Type="1">VG90YWwgVXNlciBHcm91cHM=</PHRASE>
<PHRASE Label="la_prompt_Type" Module="In-Portal" Type="1">VHlwZQ==</PHRASE>
<PHRASE Label="la_prompt_updating" Module="In-Portal" Type="1">VXBkYXRpbmc=</PHRASE>
<PHRASE Label="la_prompt_upload" Module="In-Portal" Type="1">VXBsb2FkIGltYWdlIGZyb20gbG9jYWwgUEM=</PHRASE>
<PHRASE Label="la_prompt_URL" Module="In-Portal" Type="1">VVJM</PHRASE>
<PHRASE Label="la_prompt_UserCount" Module="In-Portal" Type="1">VXNlciBDb3VudA==</PHRASE>
<PHRASE Label="la_prompt_Usermame" Module="In-Portal" Type="1">VXNlcm5hbWU=</PHRASE>
<PHRASE Label="la_prompt_Username" Module="In-Portal" Type="1">VXNlcm5hbWU=</PHRASE>
<PHRASE Label="la_prompt_UsersActive" Module="In-Portal" Type="1">QWN0aXZlIFVzZXJz</PHRASE>
<PHRASE Label="la_prompt_UsersDisabled" Module="In-Portal" Type="1">RGlzYWJsZWQgVXNlcnM=</PHRASE>
<PHRASE Label="la_prompt_UsersPending" Module="In-Portal" Type="1">UGVuZGluZyBVc2Vycw==</PHRASE>
<PHRASE Label="la_prompt_UsersUniqueCountries" Module="In-Portal" Type="1">TnVtYmVyIG9mIFVuaXF1ZSBDb3VudHJpZXMgb2YgVXNlcnM=</PHRASE>
<PHRASE Label="la_prompt_UsersUniqueStates" Module="In-Portal" Type="1">TnVtYmVyIG9mIFVuaXF1ZSBTdGF0ZXMgb2YgVXNlcnM=</PHRASE>
<PHRASE Label="la_prompt_Value" Module="In-Portal" Type="1">VmFsdWU=</PHRASE>
<PHRASE Label="la_prompt_valuelist" Module="In-Portal" Type="1">TGlzdCBvZiBWYWx1ZXM=</PHRASE>
<PHRASE Label="la_prompt_Views" Module="In-Portal" Type="1">Vmlld3M=</PHRASE>
<PHRASE Label="la_prompt_Visible" Module="In-Portal" Type="1">VmlzaWJsZQ==</PHRASE>
<PHRASE Label="la_prompt_VoteLimits" Module="In-Portal" Type="1">KE1pbmltdW0gMSk=</PHRASE>
<PHRASE Label="la_prompt_Votes" Module="In-Portal" Type="1">Vm90ZXM=</PHRASE>
<PHRASE Label="la_Prompt_Warning" Module="In-Portal" Type="1">V2FybmluZyE=</PHRASE>
<PHRASE Label="la_prompt_weight" Module="In-Portal" Type="1">V2VpZ2h0</PHRASE>
<PHRASE Label="la_prompt_Zip" Module="In-Portal" Type="1">Wmlw</PHRASE>
<PHRASE Label="la_promt_ReferrerCheck" Module="In-Portal" Type="1">U2Vzc2lvbiBSZWZlcnJlciBDaGVja2luZw==</PHRASE>
<PHRASE Label="la_Rating" Module="In-Portal" Type="1">bGFfUmF0aW5n</PHRASE>
<PHRASE Label="la_rating_alreadyvoted" Module="In-Portal" Type="1">QWxyZWFkeSB2b3RlZA==</PHRASE>
<PHRASE Label="la_RemoveFrom" Module="In-Portal" Type="1">UmVtb3ZlIEZyb20=</PHRASE>
<PHRASE Label="la_RequiredWarning" Module="In-Portal" Type="1">Tm90IGFsbCByZXF1aXJlZCBmaWVsZHMgYXJlIGZpbGxlZC4gUGxlYXNlIGZpbGwgdGhlbSBmaXJzdC4=</PHRASE>
<PHRASE Label="la_restore_access_denied" Module="In-Portal" Type="1">QWNjZXNzIGRlbmllZA==</PHRASE>
<PHRASE Label="la_restore_file_error" Module="In-Portal" Type="1">RmlsZSBlcnJvcg==</PHRASE>
<PHRASE Label="la_restore_file_not_found" Module="In-Portal" Type="1">RmlsZSBub3QgZm91bmQ=</PHRASE>
<PHRASE Label="la_restore_read_error" Module="In-Portal" Type="1">VW5hYmxlIHRvIHJlYWQgZnJvbSBmaWxl</PHRASE>
<PHRASE Label="la_restore_unknown_error" Module="In-Portal" Type="1">QW4gdW5kZWZpbmVkIGVycm9yIGhhcyBvY2N1cmVk</PHRASE>
<PHRASE Label="la_reviewer" Module="In-Portal" Type="1">UmV2aWV3ZXI=</PHRASE>
<PHRASE Label="la_review_added" Module="In-Portal" Type="1">UmV2aWV3IGFkZGVkIHN1Y2Nlc3NmdWxseQ==</PHRASE>
<PHRASE Label="la_review_alreadyreviewed" Module="In-Portal" Type="1">VGhpcyBpdGVtIGhhcyBhbHJlYWR5IGJlZW4gcmV2aWV3ZWQ=</PHRASE>
<PHRASE Label="la_review_error" Module="In-Portal" Type="1">RXJyb3IgYWRkaW5nIHJldmlldw==</PHRASE>
<PHRASE Label="la_review_perpage_prompt" Module="In-Portal" Type="1">UmV2aWV3cyBQZXIgUGFnZQ==</PHRASE>
<PHRASE Label="la_review_perpage_short_prompt" Module="In-Portal" Type="1">UmV2aWV3cyBQZXIgUGFnZSAoU2hvcnRsaXN0KQ==</PHRASE>
<PHRASE Label="la_rootpass_verify_error" Module="In-Portal" Type="1">RXJyb3IgdmVyaWZ5aW5nIHBhc3N3b3Jk</PHRASE>
<PHRASE Label="la_running_query" Module="In-Portal" Type="1">UnVubmluZyBRdWVyeQ==</PHRASE>
<PHRASE Label="la_SampleText" Module="In-Portal" Type="1">U2FtcGxlIFRleHQ=</PHRASE>
<PHRASE Label="la_Save" Module="In-Portal" Type="1">U2F2ZQ==</PHRASE>
<PHRASE Label="la_Search" Module="In-Portal" Type="1">U2VhcmNo</PHRASE>
<PHRASE Label="la_SearchLabel" Module="In-Portal" Type="1">U2VhcmNo</PHRASE>
<PHRASE Label="la_SearchLabel_Categories" Module="In-Portal" Type="1">U2VhcmNoIENhdGVnb3JpZXM=</PHRASE>
<PHRASE Label="la_SearchLabel_Links" Module="In-Portal" Type="1">U2VhcmNoIExpbmtz</PHRASE>
<PHRASE Label="la_SearchLabel_News" Module="In-Portal" Type="1">U2VhcmNoIEFydGljbGVz</PHRASE>
<PHRASE Label="la_SearchLabel_Topics" Module="In-Portal" Type="1">U2VhcmNoIFRvcGljcw==</PHRASE>
<PHRASE Label="la_SearchMenu_Categories" Module="In-Portal" Type="1">Q2F0ZWdvcmllczE=</PHRASE>
<PHRASE Label="la_SearchMenu_Clear" Module="In-Portal" Type="1">Q2xlYXIgU2VhcmNo</PHRASE>
<PHRASE Label="la_SearchMenu_New" Module="In-Portal" Type="1">TmV3IFNlYXJjaA==</PHRASE>
<PHRASE Label="la_Sectionheader_MetaInformation" Module="In-Portal" Type="1">TUVUQSBJbmZvcm1hdGlvbg==</PHRASE>
<PHRASE Label="la_section_Category" Module="In-Portal" Type="1">Q2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_section_CustomFields" Module="In-Portal" Type="1">Q3VzdG9tIEZpZWxkcw==</PHRASE>
<PHRASE Label="la_section_General" Module="In-Portal" Type="1">R2VuZXJhbA==</PHRASE>
<PHRASE Label="la_section_Message" Module="In-Portal" Type="1">TWVzc2FnZQ==</PHRASE>
<PHRASE Label="la_section_overview" Module="In-Portal" Type="1">U2VjdGlvbiBPdmVydmlldw==</PHRASE>
<PHRASE Label="la_section_Properties" Module="In-Portal" Type="1">UHJvcGVydGllcw==</PHRASE>
<PHRASE Label="la_section_QuickLinks" Module="In-Portal" Type="1">UXVpY2sgTGlua3M=</PHRASE>
<PHRASE Label="la_section_Templates" Module="In-Portal" Type="1">VGVtcGxhdGVz</PHRASE>
<PHRASE Label="la_section_Translation" Module="In-Portal" Type="1">VHJhbnNsYXRpb24=</PHRASE>
<PHRASE Label="la_section_UsersSearch" Module="In-Portal" Type="1">U2VhcmNoIFVzZXJz</PHRASE>
<PHRASE Label="la_selecting_categories" Module="In-Portal" Type="1">U2VsZWN0aW5nIENhdGVnb3JpZXM=</PHRASE>
<PHRASE Label="la_Selection_Empty" Module="In-Portal" Type="1">RW1wdHkgc2VsZWN0aW9u</PHRASE>
<PHRASE Label="la_SeparatedCategoryPath" Module="In-Portal" Type="1">T25lIGZpZWxkIGZvciBlYWNoIGNhdGVnb3J5IGxldmVs</PHRASE>
<PHRASE Label="la_Showing_Logs" Module="In-Portal" Type="1">U2hvd2luZyBMb2dz</PHRASE>
<PHRASE Label="la_Showing_Stats" Module="In-Portal" Type="1">U2hvd2luZyBTdGF0aXN0aWNz</PHRASE>
<PHRASE Label="la_Show_EmailLog" Module="In-Portal" Type="1">U2hvdyBFbWFpbCBMb2c=</PHRASE>
<PHRASE Label="la_Show_Log" Module="In-Portal" Type="1">U2hvd2luZyBMb2dz</PHRASE>
<PHRASE Label="la_sortfield2_prompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_step" Module="In-Portal" Type="1">U3RlcA==</PHRASE>
<PHRASE Label="la_StyleDefinition" Module="In-Portal" Type="1">RGVmaW5pdGlvbg==</PHRASE>
<PHRASE Label="la_StylePreview" Module="In-Portal" Type="1">UHJldmlldw==</PHRASE>
<PHRASE Label="la_sunday" Module="In-Portal" Type="1">U3VuZGF5</PHRASE>
<PHRASE Label="la_tab_AdminUI" Module="In-Portal" Type="1">QWRtaW5pc3RyYXRpb24gUGFuZWwgVUk=</PHRASE>
<PHRASE Label="la_tab_AdvancedView" Module="In-Portal" Type="1">QWR2YW5jZWQgVmlldw==</PHRASE>
<PHRASE Label="la_tab_Backup" Module="In-Portal" Type="1">QmFja3Vw</PHRASE>
<PHRASE Label="la_tab_BanList" Module="In-Portal" Type="1">VXNlciBCYW4gTGlzdA==</PHRASE>
<PHRASE Label="la_tab_BaseStyles" Module="In-Portal" Type="1">QmFzZSBTdHlsZXM=</PHRASE>
<PHRASE Label="la_tab_BlockStyles" Module="In-Portal" Type="1">QmxvY2sgU3R5bGVz</PHRASE>
<PHRASE Label="la_tab_Browse" Module="In-Portal" Type="1">Q2F0YWxvZw==</PHRASE>
<PHRASE Label="la_tab_Categories" Module="In-Portal" Type="1">Q2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_tab_Category_RelationSelect" Module="In-Portal" Type="1">U2VsZWN0IEl0ZW0=</PHRASE>
<PHRASE Label="la_tab_Category_Select" Module="In-Portal" Type="1">Q2F0ZWdvcnkgU2VsZWN0</PHRASE>
<PHRASE Label="la_tab_Censorship" Module="In-Portal" Type="1">Q2Vuc29yc2hpcA==</PHRASE>
<PHRASE Label="la_tab_Community" Module="In-Portal" Type="1">Q29tbXVuaXR5</PHRASE>
<PHRASE Label="la_tab_ConfigCategories" Module="In-Portal" Type="1">R2VuZXJhbCBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_tab_ConfigCensorship" Module="In-Portal" Type="1">Q2Vuc29yc2hpcA==</PHRASE>
<PHRASE Label="la_tab_ConfigCustom" Module="In-Portal" Type="1">Q3VzdG9tIEZpZWxkcw==</PHRASE>
<PHRASE Label="la_tab_ConfigE-mail" Module="In-Portal" Type="1">RS1tYWlsIFNldHRpbmdz</PHRASE>
<PHRASE Label="la_tab_ConfigGeneral" Module="In-Portal" Type="1">R2VuZXJhbCBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_tab_ConfigOutput" Module="In-Portal" Type="1">T3V0cHV0IFNldHRpbmdz</PHRASE>
<PHRASE Label="la_tab_ConfigSearch" Module="In-Portal" Type="1">U2VhcmNoIFNldHRpbmdz</PHRASE>
<PHRASE Label="la_tab_ConfigSettings" Module="In-Portal" Type="1">R2VuZXJhbCBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_tab_ConfigSmileys" Module="In-Portal" Type="1">U21pbGV5cw==</PHRASE>
<PHRASE Label="la_tab_ConfigUsers" Module="In-Portal" Type="1">R2VuZXJhbCBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_tab_Custom" Module="In-Portal" Type="1">Q3VzdG9t</PHRASE>
<PHRASE Label="la_tab_EmailEvents" Module="In-Portal" Type="1">RW1haWwgRXZlbnRz</PHRASE>
<PHRASE Label="la_tab_EmailLog" Module="In-Portal" Type="1">RW1haWwgTG9n</PHRASE>
<PHRASE Label="la_tab_EmailMessage" Module="In-Portal" Type="1">RW1haWwgTWVzc2FnZQ==</PHRASE>
<PHRASE Label="la_tab_ExportData" Module="In-Portal" Type="1">RXhwb3J0IERhdGE=</PHRASE>
<PHRASE Label="la_tab_ExportLang" Module="In-Portal" Type="1">RXhwb3J0IExhbmd1YWdlIFBhY2s=</PHRASE>
<PHRASE Label="la_tab_General" Module="In-Portal" Type="1">R2VuZXJhbA==</PHRASE>
<PHRASE Label="la_tab_GeneralSettings" Module="In-Portal" Type="1">R2VuZXJhbCBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_tab_Group" Module="In-Portal" Type="1">R3JvdXA=</PHRASE>
<PHRASE Label="la_tab_Groups" Module="In-Portal" Type="1">R3JvdXBz</PHRASE>
<PHRASE Label="la_tab_GroupSelect" Module="In-Portal" Type="1">U2VsZWN0IEdyb3Vw</PHRASE>
<PHRASE Label="la_tab_Help" Module="In-Portal" Type="1">SGVscA==</PHRASE>
<PHRASE Label="la_tab_Images" Module="In-Portal" Type="1">SW1hZ2Vz</PHRASE>
<PHRASE Label="la_tab_ImportData" Module="In-Portal" Type="1">SW1wb3J0IERhdGE=</PHRASE>
<PHRASE Label="la_tab_ImportLang" Module="In-Portal" Type="1">SW1wb3J0IExhbmd1YWdlIFBhY2s=</PHRASE>
<PHRASE Label="la_tab_inlinkimport" Module="In-Portal" Type="1">SW4tbGluayBpbXBvcnQ=</PHRASE>
<PHRASE Label="la_tab_Install" Module="In-Portal" Type="1">SW5zdGFsbA==</PHRASE>
<PHRASE Label="la_tab_ItemList" Module="In-Portal" Type="1">SXRlbSBMaXN0</PHRASE>
<PHRASE Label="la_tab_Items" Module="In-Portal" Type="1">SXRlbXM=</PHRASE>
<PHRASE Label="la_tab_label" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_tab_Labels" Module="In-Portal" Type="1">TGFiZWxz</PHRASE>
<PHRASE Label="la_tab_LinkValidation" Module="In-Portal" Type="2">TGluayBWYWxpZGF0aW9u</PHRASE>
<PHRASE Label="la_tab_Mail_List" Module="In-Portal" Type="1">TWFpbCBMaXN0</PHRASE>
<PHRASE Label="la_tab_Message" Module="In-Portal" Type="1">TWVzc2FnZQ==</PHRASE>
<PHRASE Label="la_tab_MissingLabels" Module="In-Portal" Type="1">TWlzc2luZyBMYWJlbHM=</PHRASE>
<PHRASE Label="la_tab_modules" Module="In-Portal" Type="1">TW9kdWxlcw==</PHRASE>
<PHRASE Label="la_tab_ModulesManagement" Module="In-Portal" Type="1">TW9kdWxlcyBNYW5hZ2VtZW50</PHRASE>
<PHRASE Label="la_tab_ModulesSettings" Module="In-Portal" Type="1">TW9kdWxlcyAmIFNldHRpbmdz</PHRASE>
<PHRASE Label="la_tab_Overview" Module="In-Portal" Type="1">T3ZlcnZpZXc=</PHRASE>
<PHRASE Label="la_tab_PackageContent" Module="In-Portal" Type="1">UGFja2FnZSBDb250ZW50</PHRASE>
<PHRASE Label="la_tab_Permissions" Module="In-Portal" Type="1">UGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_tab_phpbbimport" Module="In-Portal" Type="1">cGhwQkIgSW1wb3J0</PHRASE>
<PHRASE Label="la_tab_Properties" Module="In-Portal" Type="1">UHJvcGVydGllcw==</PHRASE>
<PHRASE Label="la_tab_QueryDB" Module="In-Portal" Type="1">UXVlcnkgRGF0YWJhc2U=</PHRASE>
<PHRASE Label="la_tab_Regional" Module="In-Portal" Type="1">UmVnaW9uYWw=</PHRASE>
<PHRASE Label="la_tab_Relations" Module="In-Portal" Type="1">UmVsYXRpb25z</PHRASE>
<PHRASE Label="la_tab_Reports" Module="In-Portal" Type="1">U3VtbWFyeSAmIExvZ3M=</PHRASE>
<PHRASE Label="la_tab_Restore" Module="In-Portal" Type="1">UmVzdG9yZQ==</PHRASE>
<PHRASE Label="la_tab_Review" Module="In-Portal" Type="1">UmV2aWV3</PHRASE>
<PHRASE Label="la_tab_Reviews" Module="In-Portal" Type="1">UmV2aWV3cw==</PHRASE>
<PHRASE Label="la_tab_Rule" Module="In-Portal" Type="2">UnVsZSBQcm9wZXJ0aWVz</PHRASE>
<PHRASE Label="la_Tab_Search" Module="In-Portal" Type="1">U2VhcmNo</PHRASE>
<PHRASE Label="la_tab_SearchLog" Module="In-Portal" Type="1">U2VhcmNoIExvZw==</PHRASE>
<PHRASE Label="la_tab_Search_Groups" Module="In-Portal" Type="1">U2VhcmNoIEdyb3Vwcw==</PHRASE>
<PHRASE Label="la_tab_Search_Users" Module="In-Portal" Type="1">U2VhcmNoIFVzZXJz</PHRASE>
<PHRASE Label="la_tab_SendMail" Module="In-Portal" Type="1">U2VuZCBlLW1haWw=</PHRASE>
<PHRASE Label="la_tab_ServerInfo" Module="In-Portal" Type="1">U2VydmVyIEluZm9ybWF0aW9u</PHRASE>
<PHRASE Label="la_tab_SessionLog" Module="In-Portal" Type="1">U2Vzc2lvbiBMb2c=</PHRASE>
<PHRASE Label="la_tab_Settings" Module="In-Portal" Type="1">R2VuZXJhbCBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_tab_Site_Structure" Module="In-Portal" Type="1">U3RydWN0dXJlICYgRGF0YQ==</PHRASE>
<PHRASE Label="la_tab_Stats" Module="In-Portal" Type="1">U3RhdGlzdGljcw==</PHRASE>
<PHRASE Label="la_tab_Stylesheets" Module="In-Portal" Type="1">U3R5bGVzaGVldHM=</PHRASE>
<PHRASE Label="la_tab_Summary" Module="In-Portal" Type="1">U3VtbWFyeQ==</PHRASE>
<PHRASE Label="la_tab_Sys_Config" Module="In-Portal" Type="1">Q29uZmlndXJhdGlvbg==</PHRASE>
<PHRASE Label="la_tab_taglibrary" Module="In-Portal" Type="1">VGFnIGxpYnJhcnk=</PHRASE>
<PHRASE Label="la_tab_Template" Module="In-Portal" Type="1">VGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_tab_Templates" Module="In-Portal" Type="1">VGVtcGxhdGVz</PHRASE>
<PHRASE Label="la_tab_Themes" Module="In-Portal" Type="1">VGhlbWVz</PHRASE>
<PHRASE Label="la_tab_Tools" Module="In-Portal" Type="1">VG9vbHM=</PHRASE>
<PHRASE Label="la_tab_upgrade_license" Module="In-Portal" Type="1">VXBkYXRlIExpY2Vuc2U=</PHRASE>
<PHRASE Label="la_tab_userban" Module="In-Portal" Type="1">QmFuIHVzZXI=</PHRASE>
<PHRASE Label="la_tab_UserBanList" Module="In-Portal" Type="1">VXNlciBCYW4gTGlzdA==</PHRASE>
<PHRASE Label="la_tab_Users" Module="In-Portal" Type="1">VXNlcnM=</PHRASE>
<PHRASE Label="la_tab_UserSelect" Module="In-Portal" Type="1">VXNlciBTZWxlY3Q=</PHRASE>
<PHRASE Label="la_tab_User_Groups" Module="In-Portal" Type="1">R3JvdXBz</PHRASE>
<PHRASE Label="la_tab_User_List" Module="In-Portal" Type="1">VXNlcnM=</PHRASE>
<PHRASE Label="la_tab_Visits" Module="In-Portal" Type="1">VmlzaXRz</PHRASE>
<PHRASE Label="la_taglib_link" Module="In-Portal" Type="1">VGFnIExpYnJhcnk=</PHRASE>
<PHRASE Label="la_tag_library" Module="In-Portal" Type="1">VGFnIExpYnJhcnk=</PHRASE>
<PHRASE Label="la_terabytes" Module="In-Portal" Type="1">dGVyYWJ5dGUocyk=</PHRASE>
<PHRASE Label="la_Text" Module="In-Portal" Type="1">dGV4dA==</PHRASE>
<PHRASE Label="la_Text_Access_Denied" Module="In-Portal" Type="1">SW52YWxpZCB1c2VyIG5hbWUgb3IgcGFzc3dvcmQ=</PHRASE>
<PHRASE Label="la_Text_Active" Module="In-Portal" Type="1">QWN0aXZl</PHRASE>
<PHRASE Label="la_Text_Adding" Module="In-Portal" Type="1">QWRkaW5n</PHRASE>
<PHRASE Label="la_Text_Address" Module="In-Portal" Type="1">QWRkcmVzcw==</PHRASE>
<PHRASE Label="la_text_address_denied" Module="In-Portal" Type="1">TG9naW4gbm90IGFsbG93ZWQgZnJvbSB0aGlzIGFkZHJlc3M=</PHRASE>
<PHRASE Label="la_Text_Admin" Module="In-Portal" Type="1">QWRtaW4=</PHRASE>
<PHRASE Label="la_Text_AdminEmail" Module="In-Portal" Type="1">QWRtaW5pc3RyYXRvciBSZWNlaXZlIE5vdGljZXMgV2hlbg==</PHRASE>
<PHRASE Label="la_text_advanced" Module="In-Portal" Type="1">QWR2YW5jZWQ=</PHRASE>
<PHRASE Label="la_Text_All" Module="In-Portal" Type="1">QWxs</PHRASE>
<PHRASE Label="la_Text_Allow" Module="In-Portal" Type="1">QWxsb3c=</PHRASE>
<PHRASE Label="la_Text_Any" Module="In-Portal" Type="1">QW55</PHRASE>
<PHRASE Label="la_Text_Archived" Module="In-Portal" Type="1">QXJjaGl2ZWQ=</PHRASE>
<PHRASE Label="la_Text_Article" Module="In-Portal" Type="1">QXJ0aWNsZQ==</PHRASE>
<PHRASE Label="la_Text_Articles" Module="In-Portal" Type="1">QXJ0aWNsZXM=</PHRASE>
<PHRASE Label="la_text_As" Module="In-Portal" Type="1">YXM=</PHRASE>
<PHRASE Label="la_Text_backing_up" Module="In-Portal" Type="1">QmFja2luZyB1cA==</PHRASE>
<PHRASE Label="la_Text_BackupComplete" Module="In-Portal" Type="1">QmFjayB1cCBoYXMgYmVlbiBjb21wbGV0ZWQuIFRoZSBiYWNrdXAgZmlsZSBpczo=</PHRASE>
<PHRASE Label="la_Text_BackupPath" Module="In-Portal" Type="1">QmFja3VwIFBhdGg=</PHRASE>
<PHRASE Label="la_Text_backup_access" Module="In-Portal" Type="2">SW4tUG9ydGFsIGRvZXMgbm90IGhhdmUgYWNjZXNzIHRvIHdyaXRlIHRvIHRoaXMgZGlyZWN0b3J5</PHRASE>
<PHRASE Label="la_Text_Backup_Info" Module="In-Portal" Type="1">VGhpcyB1dGlsaXR5IGFsbG93cyB5b3UgdG8gYmFja3VwIHlvdXIgY3VycmVudCBkYXRhIGZyb20gSW4tUG9ydGFsIGRhdGFiYXNlLg==</PHRASE>
<PHRASE Label="la_text_Backup_in_progress" Module="In-Portal" Type="1">QmFja3VwIGluIHByb2dyZXNz</PHRASE>
<PHRASE Label="la_Text_Ban" Module="In-Portal" Type="1">QmFu</PHRASE>
<PHRASE Label="la_Text_BanRules" Module="In-Portal" Type="2">VXNlciBCYW4gUnVsZXM=</PHRASE>
<PHRASE Label="la_Text_BanUserFields" Module="In-Portal" Type="1">QmFuIFVzZXIgSW5mb3JtYXRpb24=</PHRASE>
<PHRASE Label="la_Text_Blank_Field" Module="In-Portal" Type="1">QmxhbmsgdXNlcm5hbWUgb3IgcGFzc3dvcmQ=</PHRASE>
<PHRASE Label="la_Text_Both" Module="In-Portal" Type="1">Qm90aA==</PHRASE>
<PHRASE Label="la_Text_BuiltIn" Module="In-Portal" Type="1">QnVpbHQgSW4=</PHRASE>
<PHRASE Label="la_text_Bytes" Module="In-Portal" Type="1">Ynl0ZXM=</PHRASE>
<PHRASE Label="la_Text_Catalog" Module="In-Portal" Type="1">Q2F0YWxvZw==</PHRASE>
<PHRASE Label="la_Text_Categories" Module="In-Portal" Type="1">Q2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_Text_Category" Module="In-Portal" Type="1">Q2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_Text_Censorship" Module="In-Portal" Type="1">Q2Vuc29yc2hpcA==</PHRASE>
<PHRASE Label="la_Text_City" Module="In-Portal" Type="1">Q2l0eQ==</PHRASE>
<PHRASE Label="la_text_ClearClipboardWarning" Module="In-Portal" Type="1">WW91IGFyZSBhYm91dCB0byBjbGVhciBjbGlwYm9hcmQgY29udGVudCENClByZXNzIE9LIHRvIGNvbnRpbnVlIG9yIENhbmNlbCB0byByZXR1cm4gdG8gcHJldmlvdXMgc2NyZWVuLg==</PHRASE>
<PHRASE Label="la_Text_ComingSoon" Module="In-Portal" Type="1">U2VjdGlvbiBDb21pbmcgU29vbg==</PHRASE>
<PHRASE Label="la_Text_Complete" Module="In-Portal" Type="1">Q29tcGxldGU=</PHRASE>
<PHRASE Label="la_Text_Configuration" Module="In-Portal" Type="1">Q29uZmlndXJhdGlvbg==</PHRASE>
<PHRASE Label="la_text_Contains" Module="In-Portal" Type="1">Q29udGFpbnM=</PHRASE>
<PHRASE Label="la_Text_Counters" Module="In-Portal" Type="1">Q291bnRlcnM=</PHRASE>
<PHRASE Label="la_Text_Current" Module="In-Portal" Type="1">Q3VycmVudA==</PHRASE>
<PHRASE Label="la_text_custom" Module="In-Portal" Type="1">Q3VzdG9t</PHRASE>
<PHRASE Label="la_Text_CustomField" Module="In-Portal" Type="1">Q3VzdG9tIEZpZWxk</PHRASE>
<PHRASE Label="la_Text_CustomFields" Module="In-Portal" Type="1">Q3VzdG9tIEZpZWxkcw==</PHRASE>
<PHRASE Label="la_Text_DatabaseSettings" Module="In-Portal" Type="1">RGF0YWJhc2UgU2V0dGluZ3MgLSBJbnRlY2huaWMgSW4tTGluayAyLng=</PHRASE>
<PHRASE Label="la_Text_DataType_1" Module="In-Portal" Type="1">Y2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_Text_DataType_2" Module="In-Portal" Type="1">RGF0YSBUeXBlIDI=</PHRASE>
<PHRASE Label="la_Text_DataType_3" Module="In-Portal" Type="1">cG9zdA==</PHRASE>
<PHRASE Label="la_Text_DataType_4" Module="In-Portal" Type="1">bGlua3M=</PHRASE>
<PHRASE Label="la_Text_DataType_6" Module="In-Portal" Type="1">dXNlcnM=</PHRASE>
<PHRASE Label="la_Text_Date_Time_Settings" Module="In-Portal" Type="1">RGF0ZS9UaW1lIFNldHRpbmdz</PHRASE>
<PHRASE Label="la_Text_Day" Module="In-Portal" Type="1">RGF5</PHRASE>
<PHRASE Label="la_text_db_warning" Module="In-Portal" Type="1">UnVubmluZyB0aGlzIHV0aWxpdHkgd2lsbCBhZmZlY3QgeW91ciBkYXRhYmFzZS4gIFBsZWFzZSBiZSBhZHZpc2VkIHRoYXQgeW91IGNhbiB1c2UgdGhpcyB1dGlsaXR5IGF0IHlvdXIgb3duIHJpc2suICBJbnRlY2huaWMgQ29ycG9yYXRpb24gY2FuIG5vdCBiZSBoZWxkIGxpYWJsZSBmb3IgYW55IGNvcnJ1cHQgZGF0YSBvciBkYXRhIGxvc3Mu</PHRASE>
<PHRASE Label="la_Text_Default" Module="In-Portal" Type="1">RGVmYXVsdA==</PHRASE>
<PHRASE Label="la_Text_Delete" Module="In-Portal" Type="1">RGVsZXRl</PHRASE>
<PHRASE Label="la_text_denied" Module="In-Portal" Type="1">RGVuaWVk</PHRASE>
<PHRASE Label="la_Text_Deny" Module="In-Portal" Type="1">RGVueQ==</PHRASE>
<PHRASE Label="la_Text_Disable" Module="In-Portal" Type="1">RGlzYWJsZQ==</PHRASE>
<PHRASE Label="la_Text_Disabled" Module="In-Portal" Type="1">RGlzYWJsZWQ=</PHRASE>
<PHRASE Label="la_text_disclaimer_part1" Module="In-Portal" Type="1">UnVubmluZyB0aGlzIHV0aWxpdHkgd2lsbCBhZmZlY3QgeW91ciBkYXRhYmFzZS4gUGxlYXNlIGJlIGFkdmlzZWQgdGhhdCB5b3UgY2FuIHVzZSB0aGlzIHV0aWxpdHkgYXQgeW91ciBvd24gcmlzay4gSW50ZWNobmljIENvcnBvcmF0aW9uIGNhbiBub3QgYmUgaGVsZCBsaWFibGUgZm9yIGFueSBjb3JydXB0IGRhdGEgb3IgZGF0YSBsb3NzLg==</PHRASE>
<PHRASE Label="la_text_disclaimer_part2" Module="In-Portal" Type="1">UGxlYXNlIG1ha2Ugc3VyZSB0byBiYWNrIHVwIHlvdXIgZGF0YWJhc2UocykgYmVmb3JlIHJ1bm5pbmcgdGhpcyB1dGlsaXR5Lg==</PHRASE>
<PHRASE Label="la_Text_Edit" Module="In-Portal" Type="1">RWRpdA==</PHRASE>
<PHRASE Label="la_Text_Editing" Module="In-Portal" Type="1">RWRpdGluZw==</PHRASE>
<PHRASE Label="la_Text_Editor" Module="In-Portal" Type="1">RWRpdG9y</PHRASE>
<PHRASE Label="la_Text_Email" Module="In-Portal" Type="1">RW1haWw=</PHRASE>
<PHRASE Label="la_Text_Emoticons" Module="In-Portal" Type="1">RW1vdGlvbiBJY29ucw==</PHRASE>
<PHRASE Label="la_Text_Enable" Module="In-Portal" Type="1">RW5hYmxl</PHRASE>
<PHRASE Label="la_Text_Enabled" Module="In-Portal" Type="1">RW5hYmxlZA==</PHRASE>
<PHRASE Label="la_Text_Events" Module="In-Portal" Type="1">RXZlbnRz</PHRASE>
<PHRASE Label="la_Text_example" Module="In-Portal" Type="2">RXhhbXBsZQ==</PHRASE>
<PHRASE Label="la_Text_Exists" Module="In-Portal" Type="1">RXhpc3Rz</PHRASE>
<PHRASE Label="la_Text_Expired" Module="In-Portal" Type="1">RXhwaXJlZA==</PHRASE>
<PHRASE Label="la_Text_Export" Module="In-Portal" Type="2">RXhwb3J0</PHRASE>
<PHRASE Label="la_Text_Fields" Module="In-Portal" Type="1">RmllbGRz</PHRASE>
<PHRASE Label="la_Text_Filter" Module="In-Portal" Type="1">RmlsdGVy</PHRASE>
<PHRASE Label="la_Text_FirstName" Module="In-Portal" Type="1">Rmlyc3QgTmFtZQ==</PHRASE>
<PHRASE Label="la_text_for" Module="In-Portal" Type="1">Zm9y</PHRASE>
<PHRASE Label="la_Text_Front" Module="In-Portal" Type="1">RnJvbnQ=</PHRASE>
<PHRASE Label="la_Text_FrontEnd" Module="In-Portal" Type="1">RnJvbnQgRW5k</PHRASE>
<PHRASE Label="la_Text_FrontOnly" Module="In-Portal" Type="1">RnJvbnQtZW5kIE9ubHk=</PHRASE>
<PHRASE Label="la_Text_Full" Module="In-Portal" Type="1">RnVsbA==</PHRASE>
<PHRASE Label="la_Text_Full_Size_Image" Module="In-Portal" Type="1">RnVsbCBTaXplIEltYWdl</PHRASE>
<PHRASE Label="la_Text_General" Module="In-Portal" Type="1">R2VuZXJhbA==</PHRASE>
<PHRASE Label="la_Text_GreaterThan" Module="In-Portal" Type="1">R3JlYXRlciBUaGFu</PHRASE>
<PHRASE Label="la_Text_Group" Module="In-Portal" Type="1">R3JvdXA=</PHRASE>
<PHRASE Label="la_Text_Groups" Module="In-Portal" Type="1">R3JvdXBz</PHRASE>
<PHRASE Label="la_Text_Group_Name" Module="In-Portal" Type="1">R3JvdXAgTmFtZQ==</PHRASE>
<PHRASE Label="la_Text_Guest" Module="In-Portal" Type="1">R3Vlc3Q=</PHRASE>
<PHRASE Label="la_Text_GuestUsers" Module="In-Portal" Type="1">R3Vlc3QgVXNlcnM=</PHRASE>
<PHRASE Label="la_Text_Hot" Module="In-Portal" Type="1">SG90</PHRASE>
<PHRASE Label="la_Text_Hour" Module="In-Portal" Type="1">SG91cg==</PHRASE>
<PHRASE Label="la_Text_IAgree" Module="In-Portal" Type="1">SSBhZ3JlZSB0byB0aGUgdGVybXMgYW5kIGNvbmRpdGlvbnM=</PHRASE>
<PHRASE Label="la_Text_Image" Module="In-Portal" Type="1">SW1hZ2U=</PHRASE>
<PHRASE Label="la_Text_Images" Module="In-Portal" Type="1">SW1hZ2Vz</PHRASE>
<PHRASE Label="la_Text_Inactive" Module="In-Portal" Type="1">SW5hY3RpdmU=</PHRASE>
<PHRASE Label="la_Text_InDevelopment" Module="In-Portal" Type="1">SW4gRGV2ZWxvcG1lbnQ=</PHRASE>
<PHRASE Label="la_Text_Install" Module="In-Portal" Type="1">SW5zdGFsbA==</PHRASE>
<PHRASE Label="la_Text_Installed" Module="In-Portal" Type="1">SW5zdGFsbGVk</PHRASE>
<PHRASE Label="la_Text_Invalid" Module="In-Portal" Type="2">SW52YWxpZA==</PHRASE>
<PHRASE Label="la_Text_Invert" Module="In-Portal" Type="1">SW52ZXJ0</PHRASE>
<PHRASE Label="la_Text_IPAddress" Module="In-Portal" Type="1">SVAgQWRkcmVzcw==</PHRASE>
<PHRASE Label="la_Text_Is" Module="In-Portal" Type="1">SXM=</PHRASE>
<PHRASE Label="la_Text_IsNot" Module="In-Portal" Type="1">SXMgTm90</PHRASE>
<PHRASE Label="la_Text_Items" Module="In-Portal" Type="1">SXRlbXM=</PHRASE>
<PHRASE Label="la_text_keyword" Module="In-Portal" Type="1">S2V5d29yZA==</PHRASE>
<PHRASE Label="la_Text_Label" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_Text_LangImport" Module="In-Portal" Type="1">TGFuZ3VhZ2UgSW1wb3J0</PHRASE>
<PHRASE Label="la_Text_Languages" Module="In-Portal" Type="2">TGFuZ3VhZ2U=</PHRASE>
<PHRASE Label="la_Text_LastName" Module="In-Portal" Type="1">TGFzdCBOYW1l</PHRASE>
<PHRASE Label="la_text_leading" Module="In-Portal" Type="1">TGVhZGluZw==</PHRASE>
<PHRASE Label="la_Text_LessThan" Module="In-Portal" Type="1">TGVzcyBUaGFu</PHRASE>
<PHRASE Label="la_Text_Licence" Module="In-Portal" Type="1">TGljZW5zZQ==</PHRASE>
<PHRASE Label="la_Text_Link" Module="In-Portal" Type="1">TGluaw==</PHRASE>
<PHRASE Label="la_Text_Links" Module="In-Portal" Type="1">TGlua3M=</PHRASE>
<PHRASE Label="la_Text_Link_Validation" Module="In-Portal" Type="2">VmFsaWRhdGluZyBMaW5rcw==</PHRASE>
<PHRASE Label="la_Text_Local" Module="In-Portal" Type="1">TG9jYWw=</PHRASE>
<PHRASE Label="la_Text_Locked" Module="In-Portal" Type="1">TG9ja2Vk</PHRASE>
<PHRASE Label="la_Text_Login" Module="In-Portal" Type="1">VXNlcm5hbWU=</PHRASE>
<PHRASE Label="la_Text_MailEvent" Module="In-Portal" Type="1">RW1haWwgRXZlbnQ=</PHRASE>
<PHRASE Label="la_Text_MetaInfo" Module="In-Portal" Type="1">RGVmYXVsdCBNRVRBIGtleXdvcmRz</PHRASE>
<PHRASE Label="la_text_minkeywordlength" Module="In-Portal" Type="1">TWluaW11bSBrZXl3b3JkIGxlbmd0aA==</PHRASE>
<PHRASE Label="la_Text_Minute" Module="In-Portal" Type="1">TWludXRl</PHRASE>
<PHRASE Label="la_text_min_password" Module="In-Portal" Type="1">TWluaW11bSBwYXNzd29yZCBsZW5ndGg=</PHRASE>
<PHRASE Label="la_text_min_username" Module="In-Portal" Type="1">TWluaW11bSB1c2VyIG5hbWUgbGVuZ3Ro</PHRASE>
<PHRASE Label="la_Text_Missing_Password" Module="In-Portal" Type="1">QmxhbmsgcGFzc3dvcmRzIGFyZSBub3QgYWxsb3dlZA==</PHRASE>
<PHRASE Label="la_Text_Missing_Username" Module="In-Portal" Type="1">QmxhbmsgdXNlciBuYW1l</PHRASE>
<PHRASE Label="la_Text_Modules" Module="In-Portal" Type="1">TW9kdWxlcw==</PHRASE>
<PHRASE Label="la_Text_Month" Module="In-Portal" Type="1">TW9udGhz</PHRASE>
<PHRASE Label="la_text_multipleshow" Module="In-Portal" Type="1">U2hvdyBtdWx0aXBsZQ==</PHRASE>
<PHRASE Label="la_Text_New" Module="In-Portal" Type="1">TmV3</PHRASE>
<PHRASE Label="la_Text_NewCensorWord" Module="In-Portal" Type="1">TmV3IENlbnNvciBXb3Jk</PHRASE>
<PHRASE Label="la_Text_NewField" Module="In-Portal" Type="1">TmV3IEZpZWxk</PHRASE>
<PHRASE Label="la_Text_NewTheme" Module="In-Portal" Type="1">TmV3IFRoZW1l</PHRASE>
<PHRASE Label="la_text_NoCategories" Module="In-Portal" Type="1">Tm8gQ2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_Text_None" Module="In-Portal" Type="1">Tm9uZQ==</PHRASE>
<PHRASE Label="la_text_nopermissions" Module="In-Portal" Type="1">Tm8gcGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_Text_NotContains" Module="In-Portal" Type="1">RG9lcyBOb3QgQ29udGFpbg==</PHRASE>
<PHRASE Label="la_Text_Not_Validated" Module="In-Portal" Type="2">Tm90IFZhbGlkYXRlZA==</PHRASE>
<PHRASE Label="la_Text_No_permissions" Module="In-Portal" Type="1">Tm8gcGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_Text_OneWay" Module="In-Portal" Type="1">T25lIFdheQ==</PHRASE>
<PHRASE Label="la_Text_Pack" Module="In-Portal" Type="1">UGFjaw==</PHRASE>
<PHRASE Label="la_Text_Pending" Module="In-Portal" Type="1">UGVuZGluZw==</PHRASE>
<PHRASE Label="la_text_Permission" Module="In-Portal" Type="1">UGVybWlzc2lvbg==</PHRASE>
<PHRASE Label="la_Text_Phone" Module="In-Portal" Type="1">UGhvbmU=</PHRASE>
<PHRASE Label="la_Text_Pop" Module="In-Portal" Type="1">UG9wdWxhcg==</PHRASE>
<PHRASE Label="la_text_popularity" Module="In-Portal" Type="1">UG9wdWxhcml0eQ==</PHRASE>
<PHRASE Label="la_Text_PostBody" Module="In-Portal" Type="1">UG9zdCBCb2R5</PHRASE>
<PHRASE Label="la_Text_Posts" Module="In-Portal" Type="1">UG9zdHM=</PHRASE>
<PHRASE Label="la_text_prerequisit_not_passed" Module="In-Portal" Type="1">UHJlcmVxdWlzaXRlIG5vdCBmdWxmaWxsZWQsIGluc3RhbGxhdGlvbiBjYW5ub3QgY29udGludWUh</PHRASE>
<PHRASE Label="la_Text_Primary" Module="In-Portal" Type="1">UHJpbWFyeQ==</PHRASE>
<PHRASE Label="la_text_quicklinks" Module="In-Portal" Type="1">UXVpY2sgbGlua3M=</PHRASE>
<PHRASE Label="la_text_ReadOnly" Module="In-Portal" Type="1">UmVhZCBPbmx5</PHRASE>
<PHRASE Label="la_text_ready_to_install" Module="In-Portal" Type="1">UmVhZHkgdG8gSW5zdGFsbA==</PHRASE>
<PHRASE Label="la_Text_Reciprocal" Module="In-Portal" Type="1">UmVjaXByb2NhbA==</PHRASE>
<PHRASE Label="la_Text_Relation" Module="In-Portal" Type="1">UmVsYXRpb24=</PHRASE>
<PHRASE Label="la_Text_Relations" Module="In-Portal" Type="1">UmVsYXRpb25z</PHRASE>
<PHRASE Label="la_Text_Replies" Module="In-Portal" Type="1">UmVwbGllcw==</PHRASE>
<PHRASE Label="la_text_restore warning" Module="In-Portal" Type="1">VGhlIHZlcnNpb25zIG9mIHRoZSBiYWNrdXAgYW5kIHlvdXIgY29kZSBkb24ndCBtYXRjaC4gWW91ciBpbnN0YWxsYXRpb24gd2lsbCBwcm9iYWJseSBiZSBub24gb3BlcmF0aW9uYWwu</PHRASE>
<PHRASE Label="la_Text_Restore_Heading" Module="In-Portal" Type="1">SGVyZSB5b3UgY2FuIHJlc3RvcmUgeW91ciBkYXRhYmFzZSBmcm9tIGEgcHJldmlvdXNseSBiYWNrZWQgdXAgc25hcHNob3QuIFJlc3RvcmluZyB5b3VyIGRhdGFiYXNlIHdpbGwgZGVsZXRlIGFsbCBvZiB5b3VyIGN1cnJlbnQgZGF0YSBhbmQgbG9nIHlvdSBvdXQgb2YgdGhlIHN5c3RlbS4=</PHRASE>
<PHRASE Label="la_text_Restore_in_progress" Module="In-Portal" Type="1">UmVzdG9yZSBpcyBpbiBwcm9ncmVzcw==</PHRASE>
<PHRASE Label="la_Text_Restore_Warning" Module="In-Portal" Type="1">IFJ1bm5pbmcgdGhpcyB1dGlsaXR5IHdpbGwgYWZmZWN0IHlvdXIgZGF0YWJhc2UuICBQbGVhc2UgYmUgYWR2aXNlZCB0aGF0IHlvdSBjYW4gdXNlIHRoaXMgdXRpbGl0eSBhdCB5b3VyIG93biByaXNrLiAgSW50ZWNobmljIGNvcnBvcmF0aW9uIGNhbiBub3QgYmUgaGVsZCBsaWFibGUgZm9yIGFueSBjb3JydXB0IGRhdGEgb3IgZGF0YSBsb3NzLiAgUGxlYXNlIG1ha2Ugc3VyZSB0byBiYWNrIHVwIHlvdXIgZGF0YWJhc2UocykgYmVmb3JlIHJ1bm5p</PHRASE>
<PHRASE Label="la_Text_Restrictions" Module="In-Portal" Type="1">UmVzdHJpY3Rpb25z</PHRASE>
<PHRASE Label="la_Text_Results" Module="In-Portal" Type="2">UmVzdWx0cw==</PHRASE>
<PHRASE Label="la_text_review" Module="In-Portal" Type="1">UmV2aWV3</PHRASE>
<PHRASE Label="la_Text_Reviews" Module="In-Portal" Type="1">UmV2aWV3cw==</PHRASE>
<PHRASE Label="la_Text_Root" Module="In-Portal" Type="1">Um9vdA==</PHRASE>
<PHRASE Label="la_Text_RootCategory" Module="In-Portal" Type="1">TW9kdWxlIFJvb3QgQ2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_text_Rows" Module="In-Portal" Type="1">cm93KHMp</PHRASE>
<PHRASE Label="la_Text_Rule" Module="In-Portal" Type="2">UnVsZQ==</PHRASE>
<PHRASE Label="la_text_Same" Module="In-Portal" Type="1">U2FtZQ==</PHRASE>
<PHRASE Label="la_text_Same_As_Thumbnail" Module="In-Portal" Type="1">U2FtZSBhcyB0aHVtYm5haWw=</PHRASE>
<PHRASE Label="la_text_Save" Module="In-Portal" Type="1">U2F2ZQ==</PHRASE>
<PHRASE Label="la_Text_Scanning" Module="In-Portal" Type="1">U2Nhbm5pbmc=</PHRASE>
<PHRASE Label="la_Text_Search_Results" Module="In-Portal" Type="1">U2VhcmNoIFJlc3VsdHM=</PHRASE>
<PHRASE Label="la_Text_Second" Module="In-Portal" Type="1">U2Vjb25kcw==</PHRASE>
<PHRASE Label="la_Text_Select" Module="In-Portal" Type="1">U2VsZWN0</PHRASE>
<PHRASE Label="la_Text_Send" Module="In-Portal" Type="1">U2VuZA==</PHRASE>
<PHRASE Label="la_Text_Sessions" Module="In-Portal" Type="1">U2Vzc2lvbnM=</PHRASE>
<PHRASE Label="la_text_sess_expired" Module="In-Portal" Type="0">U2Vzc2lvbiBFeHBpcmVk</PHRASE>
<PHRASE Label="la_Text_Settings" Module="In-Portal" Type="1">U2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_Text_ShowingGroups" Module="In-Portal" Type="1">U2hvd2luZyBHcm91cHM=</PHRASE>
<PHRASE Label="la_Text_ShowingUsers" Module="In-Portal" Type="1">U2hvd2luZyBVc2Vycw==</PHRASE>
<PHRASE Label="la_Text_Simple" Module="In-Portal" Type="1">U2ltcGxl</PHRASE>
<PHRASE Label="la_Text_Size" Module="In-Portal" Type="1">U2l6ZQ==</PHRASE>
<PHRASE Label="la_Text_Smiley" Module="In-Portal" Type="1">U21pbGV5</PHRASE>
<PHRASE Label="la_Text_smtp_server" Module="In-Portal" Type="1">U01UUCAobWFpbCkgU2VydmVy</PHRASE>
<PHRASE Label="la_Text_Sort" Module="In-Portal" Type="1">U29ydA==</PHRASE>
<PHRASE Label="la_Text_State" Module="In-Portal" Type="1">U3RhdGU=</PHRASE>
<PHRASE Label="la_Text_Step" Module="In-Portal" Type="1">U3RlcA==</PHRASE>
<PHRASE Label="la_Text_SubCats" Module="In-Portal" Type="1">U3ViQ2F0cw==</PHRASE>
<PHRASE Label="la_Text_Subitems" Module="In-Portal" Type="1">U3ViSXRlbXM=</PHRASE>
<PHRASE Label="la_Text_Table" Module="In-Portal" Type="1">VGFibGU=</PHRASE>
<PHRASE Label="la_Text_Template" Module="In-Portal" Type="1">VGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_Text_Templates" Module="In-Portal" Type="1">VGVtcGxhdGVz</PHRASE>
<PHRASE Label="la_Text_Theme" Module="In-Portal" Type="1">VGhlbWU=</PHRASE>
<PHRASE Label="la_text_Thumbnail" Module="In-Portal" Type="1">VGh1bWJuYWls</PHRASE>
<PHRASE Label="la_text_Thumbnail_Image" Module="In-Portal" Type="1">VGh1bWJuYWlsIEltYWdl</PHRASE>
<PHRASE Label="la_Text_to" Module="In-Portal" Type="1">dG8=</PHRASE>
<PHRASE Label="la_Text_Topic" Module="In-Portal" Type="1">VG9waWM=</PHRASE>
<PHRASE Label="la_Text_Topics" Module="In-Portal" Type="1">VG9waWNz</PHRASE>
<PHRASE Label="la_Text_Type" Module="In-Portal" Type="1">VHlwZQ==</PHRASE>
<PHRASE Label="la_text_types" Module="In-Portal" Type="1">dHlwZXM=</PHRASE>
<PHRASE Label="la_Text_Unique" Module="In-Portal" Type="1">SXMgVW5pcXVl</PHRASE>
<PHRASE Label="la_Text_Unselect" Module="In-Portal" Type="1">VW5zZWxlY3Q=</PHRASE>
<PHRASE Label="la_Text_Update_Licence" Module="In-Portal" Type="1">VXBkYXRlIExpY2Vuc2U=</PHRASE>
<PHRASE Label="la_text_upgrade_disclaimer" Module="In-Portal" Type="1">WW91ciBkYXRhIHdpbGwgYmUgbW9kaWZpZWQgZHVyaW5nIHRoZSB1cGdyYWRlLiBXZSBzdHJvbmdseSByZWNvbW1lbmQgdGhhdCB5b3UgbWFrZSBhIGJhY2t1cCBvZiB5b3VyIGRhdGFiYXNlLiBQcm9jZWVkIHdpdGggdGhlIHVwZ3JhZGU/</PHRASE>
<PHRASE Label="la_Text_Upload" Module="In-Portal" Type="1">VXBsb2Fk</PHRASE>
<PHRASE Label="la_Text_User" Module="In-Portal" Type="1">VXNlcg==</PHRASE>
<PHRASE Label="la_Text_UserEmail" Module="In-Portal" Type="1">VXNlciBSZWNlaXZlcyBOb3RpY2VzIFdoZW4=</PHRASE>
<PHRASE Label="la_Text_Users" Module="In-Portal" Type="1">VXNlcnM=</PHRASE>
<PHRASE Label="la_Text_User_Count" Module="In-Portal" Type="1">VXNlciBDb3VudA==</PHRASE>
<PHRASE Label="la_Text_Valid" Module="In-Portal" Type="1">VmFsaWQ=</PHRASE>
<PHRASE Label="la_Text_Version" Module="In-Portal" Type="1">VmVyc2lvbg==</PHRASE>
<PHRASE Label="la_Text_View" Module="In-Portal" Type="1">Vmlldw==</PHRASE>
<PHRASE Label="la_Text_Views" Module="In-Portal" Type="1">Vmlld3M=</PHRASE>
<PHRASE Label="la_Text_Website" Module="In-Portal" Type="1">V2Vic2l0ZQ==</PHRASE>
<PHRASE Label="la_Text_Week" Module="In-Portal" Type="1">V2Vla3M=</PHRASE>
<PHRASE Label="la_Text_Within" Module="In-Portal" Type="1">V2l0aGlu</PHRASE>
<PHRASE Label="la_Text_Year" Module="In-Portal" Type="1">WWVhcnM=</PHRASE>
<PHRASE Label="la_Text_Zip" Module="In-Portal" Type="1">Wmlw</PHRASE>
<PHRASE Label="la_title_addingCustom" Module="In-Portal" Type="1">QWRkaW5nIEN1c3RvbSBGaWVsZA==</PHRASE>
<PHRASE Label="la_title_Adding_BaseStyle" Module="In-Portal" Type="1">QWRkaW5nIEJhc2UgU3R5bGU=</PHRASE>
<PHRASE Label="la_title_Adding_BlockStyle" Module="In-Portal" Type="1">QWRkaW5nIEJsb2NrIFN0eWxl</PHRASE>
<PHRASE Label="la_title_Adding_Category" Module="In-Portal" Type="1">QWRkaW5nIENhdGVnb3J5</PHRASE>
<PHRASE Label="la_title_Adding_Group" Module="In-Portal" Type="1">QWRkaW5nIEdyb3Vw</PHRASE>
<PHRASE Label="la_title_Adding_Language" Module="In-Portal" Type="1">QWRkaW5nIExhbmd1YWdl</PHRASE>
<PHRASE Label="la_title_Adding_Phrase" Module="In-Portal" Type="1">QWRkaW5nIFBocmFzZQ==</PHRASE>
<PHRASE Label="la_title_Adding_Stylesheet" Module="In-Portal" Type="1">QWRkaW5nIFN0eWxlc2hlZXQ=</PHRASE>
<PHRASE Label="la_title_AdditionalPermissions" Module="In-Portal" Type="1">QWRkaXRpb25hbCBQZXJtaXNzaW9ucw==</PHRASE>
<PHRASE Label="la_title_Add_Module" Module="In-Portal" Type="1">QWRkIE1vZHVsZQ==</PHRASE>
<PHRASE Label="la_title_AdvancedView" Module="In-Portal" Type="1">QWR2YW5jZWQgVmlldw==</PHRASE>
<PHRASE Label="la_title_Backup" Module="In-Portal" Type="1">QmFja3Vw</PHRASE>
<PHRASE Label="la_title_BaseStyles" Module="In-Portal" Type="1">QmFzZSBTdHlsZXM=</PHRASE>
<PHRASE Label="la_title_BlockStyles" Module="In-Portal" Type="1">QmxvY2sgU3R5bGVz</PHRASE>
<PHRASE Label="la_title_Browse" Module="In-Portal" Type="1">Q2F0YWxvZw==</PHRASE>
<PHRASE Label="la_title_Categories" Module="In-Portal" Type="1">Q2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_title_category_relationselect" Module="In-Portal" Type="1">U2VsZWN0IHJlbGF0aW9u</PHRASE>
<PHRASE Label="la_title_category_select" Module="In-Portal" Type="1">U2VsZWN0IGNhdGVnb3J5</PHRASE>
<PHRASE Label="la_title_Censorship" Module="In-Portal" Type="1">Q2Vuc29yc2hpcA==</PHRASE>
<PHRASE Label="la_title_Community" Module="In-Portal" Type="1">Q29tbXVuaXR5</PHRASE>
<PHRASE Label="la_title_Configuration" Module="In-Portal" Type="1">Q29uZmlndXJhdGlvbg==</PHRASE>
<PHRASE Label="la_title_Custom" Module="In-Portal" Type="1">Q3VzdG9t</PHRASE>
<PHRASE Label="la_title_CustomFields" Module="In-Portal" Type="1">Q3VzdG9tIEZpZWxkcw==</PHRASE>
<PHRASE Label="la_title_Done" Module="In-Portal" Type="1">RG9uZQ==</PHRASE>
<PHRASE Label="la_title_EditingEmailEvent" Module="In-Portal" Type="1">RWRpdGluZyBFbWFpbCBFdmVudA==</PHRASE>
<PHRASE Label="la_title_EditingGroup" Module="In-Portal" Type="1">RWRpdGluZyBHcm91cA==</PHRASE>
<PHRASE Label="la_title_EditingStyle" Module="In-Portal" Type="1">RWRpdGluZyBTdHlsZQ==</PHRASE>
<PHRASE Label="la_title_EditingTranslation" Module="In-Portal" Type="1">RWRpdGluZyBUcmFuc2xhdGlvbg==</PHRASE>
<PHRASE Label="la_title_Editing_BaseStyle" Module="In-Portal" Type="1">RWRpdGluZyBCYXNlIFN0eWxl</PHRASE>
<PHRASE Label="la_title_Editing_BlockStyle" Module="In-Portal" Type="1">RWRpdGluZyBCbG9jayBTdHlsZQ==</PHRASE>
<PHRASE Label="la_title_Editing_Category" Module="In-Portal" Type="1">RWRpdGluZyBDYXRlZ29yeQ==</PHRASE>
<PHRASE Label="la_title_Editing_CustomField" Module="In-Portal" Type="1">RWRpdGluZyBDdXN0b20gRmllbGQ=</PHRASE>
<PHRASE Label="la_title_Editing_Group" Module="In-Portal" Type="1">RWRpdGluZyBHcm91cA==</PHRASE>
<PHRASE Label="la_title_Editing_Language" Module="In-Portal" Type="1">RWRpdGluZyBMYW5ndWFnZQ==</PHRASE>
<PHRASE Label="la_title_Editing_Phrase" Module="In-Portal" Type="1">RWRpdGluZyBQaHJhc2U=</PHRASE>
<PHRASE Label="la_title_Editing_Stylesheet" Module="In-Portal" Type="1">RWRpdGluZyBTdHlsZXNoZWV0</PHRASE>
<PHRASE Label="la_title_Edit_Article" Module="In-Portal" Type="1">U2l0ZSBTdHJ1Y3R1cmU=</PHRASE>
<PHRASE Label="la_title_edit_category" Module="In-Portal" Type="1">RWRpdCBDYXRlZ29yeQ==</PHRASE>
<PHRASE Label="la_title_Edit_Group" Module="In-Portal" Type="1">RWRpdCBHcm91cA==</PHRASE>
<PHRASE Label="la_title_Edit_Link" Module="In-Portal" Type="1">U2l0ZSBTdHJ1Y3R1cmU=</PHRASE>
<PHRASE Label="la_title_Edit_Topic" Module="In-Portal" Type="1">U2l0ZSBTdHJ1Y3R1cmU=</PHRASE>
<PHRASE Label="la_title_Edit_User" Module="In-Portal" Type="1">RWRpdCBVc2Vy</PHRASE>
<PHRASE Label="la_title_EmailEvents" Module="In-Portal" Type="1">RS1tYWlsIEV2ZW50cw==</PHRASE>
<PHRASE Label="la_title_EmailSettings" Module="In-Portal" Type="1">RS1tYWlsIFNldHRpbmdz</PHRASE>
<PHRASE Label="la_title_ExportData" Module="In-Portal" Type="1">RXhwb3J0IERhdGE=</PHRASE>
<PHRASE Label="la_title_ExportLanguagePack" Module="In-Portal" Type="1">RXhwb3J0IExhbmd1YWdlIFBhY2s=</PHRASE>
<PHRASE Label="la_title_ExportLanguagePackResults" Module="In-Portal" Type="1">RXhwb3J0IExhbmd1YWdlIFBhY2sgLSBSZXN1bHRz</PHRASE>
<PHRASE Label="la_title_ExportLanguagePackStep1" Module="In-Portal" Type="1">RXhwb3J0IExhbmd1YWdlIFBhY2sgLSBTdGVwMQ==</PHRASE>
<PHRASE Label="la_title_General" Module="In-Portal" Type="1">R2VuZXJhbA==</PHRASE>
<PHRASE Label="la_title_General_Configuration" Module="In-Portal" Type="1">R2VuZXJhbCBDb25maWd1cmF0aW9u</PHRASE>
<PHRASE Label="la_title_Groups" Module="In-Portal" Type="1">R3JvdXBz</PHRASE>
<PHRASE Label="la_title_groupselect" Module="In-Portal" Type="1">U2VsZWN0IGdyb3Vw</PHRASE>
<PHRASE Label="la_title_Help" Module="In-Portal" Type="1">SGVscA==</PHRASE>
<PHRASE Label="la_title_ImportData" Module="In-Portal" Type="1">SW1wb3J0IERhdGE=</PHRASE>
<PHRASE Label="la_title_ImportLanguagePack" Module="In-Portal" Type="1">SW1wb3J0IExhbmd1YWdlIFBhY2s=</PHRASE>
<PHRASE Label="la_title_In-Bulletin" Module="In-Portal" Type="1">SW4tYnVsbGV0aW4=</PHRASE>
<PHRASE Label="la_title_In-Link" Module="In-Portal" Type="1">SW4tbGluaw==</PHRASE>
<PHRASE Label="la_title_In-News" Module="In-Portal" Type="1">SW4tbmV3eg==</PHRASE>
<PHRASE Label="la_title_Install" Module="In-Portal" Type="1">SW5zdGFsbGF0aW9uIEhlbHA=</PHRASE>
<PHRASE Label="la_title_InstallLanguagePackStep1" Module="In-Portal" Type="1">SW5zdGFsbCBMYW5ndWFnZSBQYWNrIC0gU3RlcCAx</PHRASE>
<PHRASE Label="la_title_InstallLanguagePackStep2" Module="In-Portal" Type="1">SW5zdGFsbCBMYW5ndWFnZSBQYWNrIC0gU3RlcCAy</PHRASE>
<PHRASE Label="la_title_Items" Module="In-Portal" Type="1">SXRlbXM=</PHRASE>
<PHRASE Label="la_title_label" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_title_Labels" Module="In-Portal" Type="1">TGFiZWxz</PHRASE>
<PHRASE Label="la_Title_LanguageImport" Module="In-Portal" Type="1">SW5zdGFsbCBMYW5ndWFnZSBQYWNr</PHRASE>
<PHRASE Label="la_title_LanguagePacks" Module="In-Portal" Type="1">TGFuZ3VhZ2UgUGFja3M=</PHRASE>
<PHRASE Label="la_title_Loading" Module="In-Portal" Type="1">TG9hZGluZyAuLi4=</PHRASE>
<PHRASE Label="la_title_Module_Status" Module="In-Portal" Type="1">TW9kdWxlIFN0YXR1cw==</PHRASE>
<PHRASE Label="la_title_NewCustomField" Module="In-Portal" Type="1">TmV3IEN1c3RvbSBGaWVsZA==</PHRASE>
<PHRASE Label="la_title_New_BaseStyle" Module="In-Portal" Type="1">TmV3IEJhc2UgU3R5bGU=</PHRASE>
<PHRASE Label="la_title_New_BlockStyle" Module="In-Portal" Type="1">TmV3IEJsb2NrIFN0eWxl</PHRASE>
<PHRASE Label="la_title_New_Category" Module="In-Portal" Type="1">TmV3IENhdGVnb3J5</PHRASE>
<PHRASE Label="la_title_New_Group" Module="In-Portal" Type="1">TmV3IEdyb3Vw</PHRASE>
<PHRASE Label="la_title_New_Language" Module="In-Portal" Type="1">TmV3IExhbmd1YWdl</PHRASE>
<PHRASE Label="la_title_New_Phrase" Module="In-Portal" Type="1">TmV3IFBocmFzZQ==</PHRASE>
<PHRASE Label="la_title_New_Stylesheet" Module="In-Portal" Type="1">TmV3IFN0eWxlc2hlZXQ=</PHRASE>
<PHRASE Label="la_title_NoPermissions" Module="In-Portal" Type="1">Tm8gUGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_title_Permissions" Module="In-Portal" Type="1">UGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_Title_PleaseWait" Module="In-Portal" Type="1">UGxlYXNlIFdhaXQ=</PHRASE>
<PHRASE Label="la_title_Properties" Module="In-Portal" Type="1">UHJvcGVydGllcw==</PHRASE>
<PHRASE Label="la_title_Regional" Module="In-Portal" Type="1">UmVnaW9uYWw=</PHRASE>
<PHRASE Label="la_title_RegionalSettings" Module="In-Portal" Type="1">UmVnaW9uYWwgU2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_title_Relations" Module="In-Portal" Type="1">UmVsYXRpb25z</PHRASE>
<PHRASE Label="la_title_Reports" Module="In-Portal" Type="1">U3VtbWFyeSAmIExvZ3M=</PHRASE>
<PHRASE Label="la_title_Restore" Module="In-Portal" Type="1">UmVzdG9yZQ==</PHRASE>
<PHRASE Label="la_title_reviews" Module="In-Portal" Type="1">UmV2aWV3cw==</PHRASE>
<PHRASE Label="la_title_SearchLog" Module="In-Portal" Type="1">U2VhcmNoIExvZw==</PHRASE>
<PHRASE Label="la_title_searchresults" Module="In-Portal" Type="1">U2VhcmNoIFJlc3VsdHM=</PHRASE>
<PHRASE Label="la_title_SelectUser" Module="In-Portal" Type="1">U2VsZWN0IFVzZXI=</PHRASE>
<PHRASE Label="la_title_select_item" Module="In-Portal" Type="1">U2VsZWN0IGl0ZW0=</PHRASE>
<PHRASE Label="la_title_select_target_item" Module="In-Portal" Type="1">U2VsZWN0IGl0ZW0=</PHRASE>
<PHRASE Label="la_Title_SendInit" Module="In-Portal" Type="1">UHJlcGFyaW5nIHRvIFNlbmQgTWFpbA==</PHRASE>
<PHRASE Label="la_title_sendmail" Module="In-Portal" Type="1">U2VuZCBlbWFpbA==</PHRASE>
<PHRASE Label="la_title_sendmailcancel" Module="In-Portal" Type="1">Q2FuY2VsIHNlbmRpbmcgbWFpbA==</PHRASE>
<PHRASE Label="la_Title_SendMailComplete" Module="In-Portal" Type="1">TWFpbCBoYXMgYmVlbiBzZW50IFN1Y2Nlc3NmdWxseQ==</PHRASE>
<PHRASE Label="la_Title_SendMailInit" Module="In-Portal" Type="1">UHJlcGFyaW5nIHRvIFNlbmQgTWVzc2FnZXM=</PHRASE>
<PHRASE Label="la_Title_SendMailProgress" Module="In-Portal" Type="1">U2VuZGluZyBNZXNzYWdlLi4=</PHRASE>
<PHRASE Label="la_title_SessionLog" Module="In-Portal" Type="1">U2Vzc2lvbiBMb2c=</PHRASE>
<PHRASE Label="la_title_Settings" Module="In-Portal" Type="1">TW9kdWxlcyAmIFNldHRpbmdz</PHRASE>
<PHRASE Label="la_title_Site_Structure" Module="In-Portal" Type="1">U3RydWN0dXJlICYgRGF0YQ==</PHRASE>
<PHRASE Label="la_title_Stylesheets" Module="In-Portal" Type="1">U3R5bGVzaGVldHM=</PHRASE>
<PHRASE Label="la_title_Summary" Module="In-Portal" Type="1">U3VtbWFyeQ==</PHRASE>
<PHRASE Label="la_title_Sys_Config" Module="In-Portal" Type="1">Q29uZmlndXJhdGlvbg==</PHRASE>
<PHRASE Label="la_title_Tools" Module="In-Portal" Type="1">VG9vbHM=</PHRASE>
<PHRASE Label="la_title_UpdatingCategories" Module="In-Portal" Type="1">VXBkYXRpbmcgQ2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="la_title_Users" Module="In-Portal" Type="1">VXNlcnM=</PHRASE>
<PHRASE Label="la_title_userselect" Module="In-Portal" Type="1">U2VsZWN0IHVzZXI=</PHRASE>
<PHRASE Label="la_title_Visits" Module="In-Portal" Type="1">VmlzaXRz</PHRASE>
<PHRASE Label="la_to" Module="In-Portal" Type="1">dG8=</PHRASE>
<PHRASE Label="la_ToolTip_AddToGroup" Module="In-Portal" Type="1">QWRkIFVzZXIgdG8gR3JvdXA=</PHRASE>
<PHRASE Label="la_ToolTip_AddUserToGroup" Module="In-Portal" Type="1">QWRkIFVzZXIgVG8gR3JvdXA=</PHRASE>
<PHRASE Label="la_ToolTip_Apply_Rules" Module="In-Portal" Type="1">QXBwbHkgUnVsZXM=</PHRASE>
<PHRASE Label="la_ToolTip_Approve" Module="In-Portal" Type="1">QXBwcm92ZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Back" Module="In-Portal" Type="1">QmFjaw==</PHRASE>
<PHRASE Label="la_ToolTip_Ban" Module="In-Portal" Type="1">QmFu</PHRASE>
<PHRASE Label="la_tooltip_cancel" Module="In-Portal" Type="1">Q2FuY2Vs</PHRASE>
<PHRASE Label="la_ToolTip_ClearClipboard" Module="In-Portal" Type="1">Q2xlYXIgQ2xpcGJvYXJk</PHRASE>
<PHRASE Label="la_ToolTip_Clone" Module="In-Portal" Type="1">Q2xvbmU=</PHRASE>
<PHRASE Label="la_tooltip_close" Module="In-Portal" Type="1">Q2xvc2U=</PHRASE>
<PHRASE Label="la_ToolTip_ContinueValidation" Module="In-Portal" Type="1">Q29udGludWUgTGluayBWYWxpZGF0aW9u</PHRASE>
<PHRASE Label="la_ToolTip_Copy" Module="In-Portal" Type="1">Q29weQ==</PHRASE>
<PHRASE Label="la_ToolTip_Cut" Module="In-Portal" Type="1">Q3V0</PHRASE>
<PHRASE Label="la_ToolTip_Decline" Module="In-Portal" Type="1">RGVjbGluZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Delete" Module="In-Portal" Type="1">RGVsZXRl</PHRASE>
<PHRASE Label="la_ToolTip_DeleteAll" Module="In-Portal" Type="1">RGVsZXRlIEFsbA==</PHRASE>
<PHRASE Label="la_ToolTip_DeleteFromGroup" Module="In-Portal" Type="1">RGVsZXRlIFVzZXIgRnJvbSBHcm91cA==</PHRASE>
<PHRASE Label="la_ToolTip_Deny" Module="In-Portal" Type="1">RGVueQ==</PHRASE>
<PHRASE Label="la_ToolTip_Disable" Module="In-Portal" Type="1">RGlzYWJsZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Edit" Module="In-Portal" Type="1">RWRpdA==</PHRASE>
<PHRASE Label="la_ToolTip_Edit_Current_Category" Module="In-Portal" Type="1">RWRpdCBDdXJyZW50IENhdGVnb3J5</PHRASE>
<PHRASE Label="la_ToolTip_Email_Disable" Module="In-Portal" Type="1">RGlzYWJsZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Email_Enable" Module="In-Portal" Type="1">RW5hYmxl</PHRASE>
<PHRASE Label="la_ToolTip_Email_FrontOnly" Module="In-Portal" Type="1">RnJvbnQgT25seQ==</PHRASE>
<PHRASE Label="la_ToolTip_Email_UserSelect" Module="In-Portal" Type="1">U2VsZWN0IFVzZXI=</PHRASE>
<PHRASE Label="la_ToolTip_Enable" Module="In-Portal" Type="1">RW5hYmxl</PHRASE>
<PHRASE Label="la_ToolTip_Export" Module="In-Portal" Type="0">RXhwb3J0</PHRASE>
<PHRASE Label="la_tooltip_ExportLanguage" Module="In-Portal" Type="1">RXhwb3J0IExhbmd1YWdl</PHRASE>
<PHRASE Label="la_ToolTip_Home" Module="In-Portal" Type="1">SG9tZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Import" Module="In-Portal" Type="1">SW1wb3J0</PHRASE>
<PHRASE Label="la_tooltip_ImportLanguage" Module="In-Portal" Type="1">SW1wb3J0IExhbmd1YWdl</PHRASE>
<PHRASE Label="la_ToolTip_Import_Langpack" Module="In-Portal" Type="1">SW1wb3J0IGEgTGFnbnVhZ2UgUGFja2FnZQ==</PHRASE>
<PHRASE Label="la_tooltip_movedown" Module="In-Portal" Type="0">TW92ZSBEb3du</PHRASE>
<PHRASE Label="la_tooltip_moveup" Module="In-Portal" Type="0">TW92ZSBVcA==</PHRASE>
<PHRASE Label="la_ToolTip_Move_Down" Module="In-Portal" Type="1">TW92ZSBEb3du</PHRASE>
<PHRASE Label="la_ToolTip_Move_Up" Module="In-Portal" Type="1">TW92ZSBVcA==</PHRASE>
<PHRASE Label="la_tooltip_NewBaseStyle" Module="In-Portal" Type="1">TmV3IEJhc2UgU3R5bGU=</PHRASE>
<PHRASE Label="la_tooltip_NewBlockStyle" Module="In-Portal" Type="1">TmV3IEJsb2NrIFN0eWxl</PHRASE>
<PHRASE Label="la_ToolTip_NewGroup" Module="In-Portal" Type="1">TmV3IEdyb3Vw</PHRASE>
<PHRASE Label="la_tooltip_newlabel" Module="In-Portal" Type="1">TmV3IGxhYmVs</PHRASE>
<PHRASE Label="la_tooltip_NewLanguage" Module="In-Portal" Type="1">TmV3IExhbmd1YWdl</PHRASE>
<PHRASE Label="la_tooltip_newstylesheet" Module="In-Portal" Type="1">TmV3IFN0eWxlc2hlZXQ=</PHRASE>
<PHRASE Label="la_ToolTip_NewValidation" Module="In-Portal" Type="1">U3RhcnQgTmV3IFZhbGlkYXRpb24=</PHRASE>
<PHRASE Label="la_ToolTip_New_Category" Module="In-Portal" Type="1">TmV3IENhdGVnb3J5</PHRASE>
<PHRASE Label="la_ToolTip_New_CensorWord" Module="In-Portal" Type="1">TmV3IENlbnNvciBXb3Jk</PHRASE>
<PHRASE Label="la_tooltip_New_Coupon" Module="In-Portal" Type="0">TmV3IENvdXBvbg==</PHRASE>
<PHRASE Label="la_ToolTip_New_CustomField" Module="In-Portal" Type="1">TmV3IEN1c3RvbSBGaWVsZA==</PHRASE>
<PHRASE Label="la_tooltip_New_Discount" Module="In-Portal" Type="0">TmV3IERpc2NvdW50</PHRASE>
<PHRASE Label="la_ToolTip_New_Emoticon" Module="In-Portal" Type="1">TmV3IEVtb3Rpb24gSWNvbg==</PHRASE>
<PHRASE Label="la_ToolTip_New_Image" Module="In-Portal" Type="1">TmV3IEltYWdl</PHRASE>
<PHRASE Label="la_ToolTip_New_label" Module="In-Portal" Type="1">QWRkIG5ldyBsYWJlbA==</PHRASE>
<PHRASE Label="la_ToolTip_New_LangPack" Module="In-Portal" Type="1">TmV3IExhbmd1YWdlIFBhY2s=</PHRASE>
<PHRASE Label="la_ToolTip_New_Permission" Module="In-Portal" Type="1">TmV3IFBlcm1pc3Npb24=</PHRASE>
<PHRASE Label="la_ToolTip_New_Relation" Module="In-Portal" Type="1">TmV3IFJlbGF0aW9u</PHRASE>
<PHRASE Label="la_ToolTip_New_Review" Module="In-Portal" Type="1">TmV3IFJldmlldw==</PHRASE>
<PHRASE Label="la_ToolTip_New_Rule" Module="In-Portal" Type="1">TmV3IFJ1bGU=</PHRASE>
<PHRASE Label="la_ToolTip_New_Template" Module="In-Portal" Type="1">TmV3IFRlbXBsYXRl</PHRASE>
<PHRASE Label="la_ToolTip_New_Theme" Module="In-Portal" Type="1">TmV3IFRoZW1l</PHRASE>
<PHRASE Label="la_ToolTip_New_User" Module="In-Portal" Type="1">TmV3IFVzZXI=</PHRASE>
<PHRASE Label="la_ToolTip_Next" Module="In-Portal" Type="1">TmV4dA==</PHRASE>
<PHRASE Label="la_tooltip_nextstep" Module="In-Portal" Type="1">TmV4dCBzdGVw</PHRASE>
<PHRASE Label="la_ToolTip_Paste" Module="In-Portal" Type="1">UGFzdGU=</PHRASE>
<PHRASE Label="la_ToolTip_Preview" Module="In-Portal" Type="1">UHJldmlldw==</PHRASE>
<PHRASE Label="la_ToolTip_Previous" Module="In-Portal" Type="1">UHJldmlvdXM=</PHRASE>
<PHRASE Label="la_tooltip_previousstep" Module="In-Portal" Type="1">UHJldmlvdXMgc3RlcA==</PHRASE>
<PHRASE Label="la_ToolTip_Primary" Module="In-Portal" Type="1">U2V0IFByaW1hcnkgVGhlbWU=</PHRASE>
<PHRASE Label="la_ToolTip_PrimaryGroup" Module="In-Portal" Type="1">U2V0IFByaW1hcnkgR3JvdXA=</PHRASE>
<PHRASE Label="la_ToolTip_Print" Module="In-Portal" Type="1">UHJpbnQ=</PHRASE>
<PHRASE Label="la_ToolTip_RebuildCategoryCache" Module="In-Portal" Type="1">UmVidWlsZCBDYXRlZ29yeSBDYWNoZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Refresh" Module="In-Portal" Type="1">UmVmcmVzaA==</PHRASE>
<PHRASE Label="la_ToolTip_RemoveUserFromGroup" Module="In-Portal" Type="1">RGVsZXRlIFVzZXIgRnJvbSBHcm91cA==</PHRASE>
<PHRASE Label="la_ToolTip_RescanThemes" Module="In-Portal" Type="1">UmVzY2FuIFRoZW1lcw==</PHRASE>
<PHRASE Label="la_ToolTip_Reset" Module="In-Portal" Type="1">UmVzZXQ=</PHRASE>
<PHRASE Label="la_ToolTip_ResetToBase" Module="In-Portal" Type="1">UmVzZXQgVG8gQmFzZQ==</PHRASE>
<PHRASE Label="la_ToolTip_ResetValidationStatus" Module="In-Portal" Type="1">UmVzZXQgVmFsaWRhdGlvbiBTdGF0dXM=</PHRASE>
<PHRASE Label="la_ToolTip_Restore" Module="In-Portal" Type="1">UmVzdG9yZQ==</PHRASE>
<PHRASE Label="la_tooltip_save" Module="In-Portal" Type="1">U2F2ZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Search" Module="In-Portal" Type="1">U2VhcmNo</PHRASE>
<PHRASE Label="la_ToolTip_SearchReset" Module="In-Portal" Type="1">UmVzZXQ=</PHRASE>
<PHRASE Label="la_ToolTip_Select" Module="In-Portal" Type="1">U2VsZWN0</PHRASE>
<PHRASE Label="la_tooltip_SelectUser" Module="In-Portal" Type="1">U2VsZWN0IFVzZXI=</PHRASE>
<PHRASE Label="la_ToolTip_SendEmail" Module="In-Portal" Type="1">U2VuZCBFLW1haWw=</PHRASE>
<PHRASE Label="la_ToolTip_SendMail" Module="In-Portal" Type="1">U2VuZCBFLW1haWw=</PHRASE>
<PHRASE Label="la_tooltip_setPrimary" Module="In-Portal" Type="1">U2V0IFByaW1hcnk=</PHRASE>
<PHRASE Label="la_ToolTip_SetPrimaryLanguage" Module="In-Portal" Type="1">U2V0IFByaW1hcnkgTGFuZ3VhZ2U=</PHRASE>
<PHRASE Label="la_ToolTip_Stop" Module="In-Portal" Type="1">Q2FuY2Vs</PHRASE>
<PHRASE Label="la_ToolTip_Up" Module="In-Portal" Type="1">VXAgYSBDYXRlZ29yeQ==</PHRASE>
<PHRASE Label="la_ToolTip_ValidateSelected" Module="In-Portal" Type="1">VmFsaWRhdGU=</PHRASE>
<PHRASE Label="la_ToolTip_View" Module="In-Portal" Type="1">Vmlldw==</PHRASE>
<PHRASE Label="la_topic_editorpicksabove_prompt" Module="In-Portal" Type="1">RGlzcGxheSBlZGl0b3IgcGlja3MgYWJvdmUgcmVndWxhciB0b3BpY3M=</PHRASE>
<PHRASE Label="la_topic_newdays_prompt" Module="In-Portal" Type="1">TmV3IFRvcGljcyAoRGF5cyk=</PHRASE>
<PHRASE Label="la_topic_perpage_prompt" Module="In-Portal" Type="1">TnVtYmVyIG9mIHRvcGljcyBwZXIgcGFnZQ==</PHRASE>
<PHRASE Label="la_topic_perpage_short_prompt" Module="In-Portal" Type="1">VG9waWNzIFBlciBQYWdlIChTaG9ydGxpc3Qp</PHRASE>
<PHRASE Label="la_Topic_Pick" Module="In-Portal" Type="1">UGljaw==</PHRASE>
<PHRASE Label="la_topic_reviewed" Module="In-Portal" Type="1">VG9waWMgcmV2aWV3ZWQ=</PHRASE>
<PHRASE Label="la_topic_sortfield2_pompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_topic_sortfield2_prompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_topic_sortfield2_prompt!" Module="In-Portal" Type="1">YW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_topic_sortfield_pompt" Module="In-Portal" Type="1">T3JkZXIgVG9waWNzIEJ5</PHRASE>
<PHRASE Label="la_topic_sortfield_prompt" Module="In-Portal" Type="1">U29ydCB0b3BpY3MgYnk=</PHRASE>
<PHRASE Label="la_topic_sortoder2_prompt" Module="In-Portal" Type="1">QW5kIHRoZW4gYnk=</PHRASE>
<PHRASE Label="la_topic_sortoder_prompt" Module="In-Portal" Type="1">T3JkZXIgdG9waWNzIGJ5</PHRASE>
<PHRASE Label="la_Topic_Text" Module="In-Portal" Type="1">VG9waWMgVGV4dA==</PHRASE>
<PHRASE Label="la_Topic_Views" Module="In-Portal" Type="1">Vmlld3M=</PHRASE>
<PHRASE Label="la_to_date" Module="In-Portal" Type="1">VG8gRGF0ZQ==</PHRASE>
<PHRASE Label="la_type_checkbox" Module="In-Portal" Type="1">Q2hlY2tib3hlcw==</PHRASE>
<PHRASE Label="la_type_date" Module="In-Portal" Type="1">RGF0ZQ==</PHRASE>
<PHRASE Label="la_type_datetime" Module="In-Portal" Type="1">RGF0ZSAmIFRpbWU=</PHRASE>
<PHRASE Label="la_type_label" Module="In-Portal" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_type_password" Module="In-Portal" Type="1">UGFzc3dvcmQgZmllbGQ=</PHRASE>
<PHRASE Label="la_type_radio" Module="In-Portal" Type="1">UmFkaW8gYnV0dG9ucw==</PHRASE>
<PHRASE Label="la_type_select" Module="In-Portal" Type="1">RHJvcCBkb3duIGZpZWxk</PHRASE>
+ <PHRASE Label="la_type_SingleCheckbox" Module="In-Portal" Type="1">Q2hlY2tib3g=</PHRASE>
<PHRASE Label="la_type_text" Module="In-Portal" Type="1">VGV4dCBmaWVsZA==</PHRASE>
<PHRASE Label="la_type_textarea" Module="In-Portal" Type="1">VGV4dCBhcmVh</PHRASE>
<PHRASE Label="la_Unchanged" Module="In-Portal" Type="1">VW5jaGFuZ2Vk</PHRASE>
<PHRASE Label="la_updating_config" Module="In-Portal" Type="1">VXBkYXRpbmcgQ29uZmlndXJhdGlvbg==</PHRASE>
<PHRASE Label="la_updating_rules" Module="In-Portal" Type="1">VXBkYXRpbmcgUnVsZXM=</PHRASE>
<PHRASE Label="la_UseCronForRegularEvent" Module="In-Portal" Type="1">VXNlIENyb24gZm9yIFJ1bm5pbmcgUmVndWxhciBFdmVudHM=</PHRASE>
<PHRASE Label="la_users_allow_new" Module="In-Portal" Type="1">QWxsb3cgbmV3IHVzZXIgcmVnaXN0cmF0aW9u</PHRASE>
<PHRASE Label="la_users_assign_all_to" Module="In-Portal" Type="1">QXNzaWduIEFsbCBVc2VycyBUbyBHcm91cA==</PHRASE>
<PHRASE Label="la_users_email_validate" Module="In-Portal" Type="1">VmFsaWRhdGUgZS1tYWlsIGFkZHJlc3M=</PHRASE>
<PHRASE Label="la_users_guest_group" Module="In-Portal" Type="1">QXNzaWduIHVzZXJzIG5vdCBsb2dnZWQgaW4gdG8gZ3JvdXA=</PHRASE>
<PHRASE Label="la_users_new_group" Module="In-Portal" Type="1">QXNzaWduIHJlZ2lzdGVyZWQgdXNlcnMgdG8gZ3JvdXA=</PHRASE>
<PHRASE Label="la_users_password_auto" Module="In-Portal" Type="1">QXNzaWduIHBhc3N3b3JkIGF1dG9tYXRpY2FsbHk=</PHRASE>
<PHRASE Label="la_users_review_deny" Module="In-Portal" Type="1">TnVtYmVyIG9mIGRheXMgdG8gZGVueSBtdWx0aXBsZSByZXZpZXdzIGZyb20gdGhlIHNhbWUgdXNlcg==</PHRASE>
<PHRASE Label="la_users_subscriber_group" Module="In-Portal" Type="2">QXNzaWduIG1haWxpbmcgbGlzdCBzdWJzY3JpYmVycyB0byBncm91cA==</PHRASE>
<PHRASE Label="la_users_votes_deny" Module="In-Portal" Type="1">TnVtYmVyIG9mIGRheXMgdG8gZGVueSBtdWx0aXBsZSB2b3RlcyBmcm9tIHRoZSBzYW1lIHVzZXI=</PHRASE>
<PHRASE Label="la_User_Instant" Module="In-Portal" Type="1">SW5zdGFudA==</PHRASE>
<PHRASE Label="la_User_Not_Allowed" Module="In-Portal" Type="1">Tm90IEFsbG93ZWQ=</PHRASE>
<PHRASE Label="la_User_Upon_Approval" Module="In-Portal" Type="1">VXBvbiBBcHByb3ZhbA==</PHRASE>
<PHRASE Label="la_use_emails_as_login" Module="In-Portal" Type="1">VXNlIEVtYWlscyBBcyBMb2dpbg==</PHRASE>
<PHRASE Label="la_US_UK" Module="In-Portal" Type="1">VVMvVUs=</PHRASE>
<PHRASE Label="la_validation_AlertMsg" Module="In-Portal" Type="1">UGxlYXNlIGNoZWNrIHRoZSByZXF1aXJlZCBmaWVsZHMgYW5kIHRyeSBhZ2FpbiE=</PHRASE>
<PHRASE Label="la_Value" Module="In-Portal" Type="1">VmFsdWU=</PHRASE>
<PHRASE Label="la_valuelist_help" Module="In-Portal" Type="1">RW50ZXIgbGlzdCBvZiB2YWx1ZXMgYW5kIHRoZWlyIGRlc2NyaXB0aW9ucywgbGlrZSAxPU9uZSwgMj1Ud28=</PHRASE>
<PHRASE Label="la_val_Active" Module="In-Portal" Type="1">QWN0aXZl</PHRASE>
<PHRASE Label="la_val_Always" Module="In-Portal" Type="1">QWx3YXlz</PHRASE>
<PHRASE Label="la_val_Auto" Module="In-Portal" Type="1">QXV0bw==</PHRASE>
<PHRASE Label="la_val_Disabled" Module="In-Portal" Type="1">RGlzYWJsZWQ=</PHRASE>
<PHRASE Label="la_val_Enabled" Module="In-Portal" Type="1">RW5hYmxlZA==</PHRASE>
<PHRASE Label="la_val_Never" Module="In-Portal" Type="1">TmV2ZXI=</PHRASE>
<PHRASE Label="la_val_Password" Module="In-Portal" Type="1">SW52YWxpZCBQYXNzd29yZA==</PHRASE>
<PHRASE Label="la_val_Pending" Module="In-Portal" Type="1">UGVuZGluZw==</PHRASE>
<PHRASE Label="la_val_RequiredField" Module="In-Portal" Type="1">UmVxdWlyZWQgRmllbGQ=</PHRASE>
<PHRASE Label="la_val_Username" Module="In-Portal" Type="1">SW52YWxpZCBVc2VybmFtZQ==</PHRASE>
<PHRASE Label="la_visit_DirectReferer" Module="In-Portal" Type="1">RGlyZWN0IGFjY2VzcyBvciBib29rbWFyaw==</PHRASE>
<PHRASE Label="la_vote_added" Module="In-Portal" Type="1">Vm90ZSBzdWJtaXR0ZWQgc3VjY2Vzc2Z1bGx5</PHRASE>
<PHRASE Label="la_Warning_Enable_HTML" Module="In-Portal" Type="1">V2FybmluZzogRW5hYmxpbmcgSFRNTCBpcyBhIHNlY3VyaXR5IHJpc2sgYW5kIGNvdWxkIGRhbWFnZSB0aGUgc3lzdGVtIGlmIHVzZWQgaW1wcm9wZXJseSE=</PHRASE>
<PHRASE Label="la_Warning_Filter" Module="In-Portal" Type="1">QSBzZWFyY2ggb3IgYSBmaWx0ZXIgaXMgaW4gZWZmZWN0LiBZb3UgbWF5IG5vdCBiZSBzZWVpbmcgYWxsIG9mIHRoZSBkYXRhLg==</PHRASE>
<PHRASE Label="la_warning_primary_delete" Module="In-Portal" Type="1">WW91IGFyZSBhYm91dCB0byBkZWxldGUgdGhlIHByaW1hcnkgdGhlbWUuIENvbnRpbnVlPw==</PHRASE>
<PHRASE Label="la_Warning_Save_Item" Module="In-Portal" Type="1">TW9kaWZpY2F0aW9ucyB3aWxsIG5vdCB0YWtlIGVmZmVjdCB1bnRpbCB5b3UgY2xpY2sgdGhlIFNhdmUgYnV0dG9uIQ==</PHRASE>
<PHRASE Label="la_Yes" Module="In-Portal" Type="1">WWVz</PHRASE>
<PHRASE Label="lu_access_denied" Module="In-Portal" Type="0">WW91IGRvIG5vdCBoYXZlIGFjY2VzcyB0byBwZXJmb3JtIHRoaXMgb3BlcmF0aW9u</PHRASE>
<PHRASE Label="lu_account_info" Module="In-Portal" Type="0">QWNjb3VudCBJbmZvcm1hdGlvbg==</PHRASE>
<PHRASE Label="lu_action" Module="In-Portal" Type="0">QWN0aW9u</PHRASE>
<PHRASE Label="lu_action_box_title" Module="In-Portal" Type="0">QWN0aW9uIEJveA==</PHRASE>
<PHRASE Label="lu_action_prompt" Module="In-Portal" Type="0">SGVyZSBZb3UgQ2FuOg==</PHRASE>
<PHRASE Label="lu_add" Module="In-Portal" Type="0">QWRk</PHRASE>
<PHRASE Label="lu_addcat_confirm" Module="In-Portal" Type="0">U3VnZ2VzdCBDYXRlZ29yeSBSZXN1bHRz</PHRASE>
<PHRASE Label="lu_addcat_confirm_pending" Module="In-Portal" Type="0">Q2F0ZWdvcnkgQWRkZWQgUGVuZGluZyBBcHByb3ZhbA==</PHRASE>
<PHRASE Label="lu_addcat_confirm_pending_text" Module="In-Portal" Type="0">WW91ciBjYXRlZ29yeSBzdWdnZXN0aW9uIGhhcyBiZWVuIGFjY2VwdGVkIGFuZCBpcyBwZW5kaW5nIGFkbWluaXN0cmF0aXZlIGFwcHJvdmFsLg==</PHRASE>
<PHRASE Label="lu_addcat_confirm_text" Module="In-Portal" Type="0">VGhlIENhdGVnb3J5IHlvdSBzdWdnZXN0ZWQgaGFzIGJlZW4gYWRkZWQgdG8gdGhlIHN5c3RlbS4=</PHRASE>
<PHRASE Label="lu_added" Module="In-Portal" Type="0">QWRkZWQ=</PHRASE>
<PHRASE Label="lu_added_today" Module="In-Portal" Type="0">QWRkZWQgVG9kYXk=</PHRASE>
<PHRASE Label="lu_additional_cats" Module="In-Portal" Type="0">QWRkaXRpb25hbCBjYXRlZ29yaWVz</PHRASE>
<PHRASE Label="lu_addlink_confirm" Module="In-Portal" Type="0">QWRkIExpbmsgUmVzdWx0cw==</PHRASE>
<PHRASE Label="lu_addlink_confirm_pending" Module="In-Portal" Type="0">QWRkIFBlbmRpbmcgTGluayBSZXN1bHRz</PHRASE>
<PHRASE Label="lu_addlink_confirm_pending_text" Module="In-Portal" Type="0">WW91ciBsaW5rIGhhcyBiZWVuIGFkZGVkIHBlbmRpbmcgYWRtaW5pc3RyYXRpdmUgYXBwcm92YWwu</PHRASE>
<PHRASE Label="lu_addlink_confirm_text" Module="In-Portal" Type="0">VGhlIGxpbmsgeW91IGhhdmUgc3VnZ2VzdGVkIGhhcyBiZWVuIGFkZGVkIHRvIHRoZSBkYXRhYmFzZS4=</PHRASE>
<PHRASE Label="lu_address" Module="In-Portal" Type="0">QWRkcmVzcw==</PHRASE>
<PHRASE Label="lu_address_line" Module="In-Portal" Type="0">QWRkcmVzcyBMaW5l</PHRASE>
<PHRASE Label="lu_Address_Line1" Module="In-Portal" Type="0">QWRkcmVzcyBMaW5lIDE=</PHRASE>
<PHRASE Label="lu_Address_Line2" Module="In-Portal" Type="0">QWRkcmVzcyBMaW5lIDI=</PHRASE>
<PHRASE Label="lu_add_friend" Module="In-Portal" Type="0">QWRkIEZyaWVuZA==</PHRASE>
<PHRASE Label="lu_add_link" Module="In-Portal" Type="0">QWRkIExpbms=</PHRASE>
<PHRASE Label="lu_add_pm" Module="In-Portal" Type="0">U2VuZCBQcml2YXRlIE1lc3NhZ2U=</PHRASE>
<PHRASE Label="lu_add_review" Module="In-Portal" Type="0">QWRkIFJldmlldw==</PHRASE>
<PHRASE Label="lu_add_topic" Module="In-Portal" Type="0">QWRkIFRvcGlj</PHRASE>
<PHRASE Label="lu_add_to_favorites" Module="In-Portal" Type="0">QWRkIHRvIEZhdm9yaXRlcw==</PHRASE>
<PHRASE Label="lu_AdvancedSearch" Module="In-Portal" Type="0">QWR2YW5jZWQgU2VhcmNo</PHRASE>
<PHRASE Label="lu_advanced_search" Module="In-Portal" Type="0">QWR2YW5jZWQgU2VhcmNo</PHRASE>
<PHRASE Label="lu_advanced_search_link" Module="In-Portal" Type="0">QWR2YW5jZWQ=</PHRASE>
<PHRASE Label="lu_advsearch_any" Module="In-Portal" Type="0">QW55</PHRASE>
<PHRASE Label="lu_advsearch_contains" Module="In-Portal" Type="0">Q29udGFpbnM=</PHRASE>
<PHRASE Label="lu_advsearch_is" Module="In-Portal" Type="0">SXMgRXF1YWwgVG8=</PHRASE>
<PHRASE Label="lu_advsearch_isnot" Module="In-Portal" Type="0">SXMgTm90IEVxdWFsIFRv</PHRASE>
<PHRASE Label="lu_advsearch_notcontains" Module="In-Portal" Type="0">RG9lcyBOb3QgQ29udGFpbg==</PHRASE>
<PHRASE Label="lu_AllRightsReserved" Module="In-Portal" Type="0">QWxsIHJpZ2h0cyByZXNlcnZlZC4=</PHRASE>
<PHRASE Label="lu_already_suggested" Module="In-Portal" Type="0">IGhhcyBhbHJlYWR5IGJlZW4gc3VnZ2VzdGVkIHRvIHRoaXMgc2l0ZSBvbg==</PHRASE>
<PHRASE Label="lu_and" Module="In-Portal" Type="0">QW5k</PHRASE>
<PHRASE Label="lu_aol_im" Module="In-Portal" Type="0">QU9MIElN</PHRASE>
<PHRASE Label="lu_Apr" Module="In-Portal" Type="0">QXBy</PHRASE>
<PHRASE Label="lu_AProblemInForm" Module="In-Portal" Type="0">VGhlcmUgaXMgYSBwcm9ibGVtIHdpdGggdGhlIGZvcm0sIHBsZWFzZSBjaGVjayB0aGUgZXJyb3IgbWVzc2FnZXMgYmVsb3cu</PHRASE>
<PHRASE Label="lu_AProblemWithForm" Module="In-Portal" Type="0">VGhlcmUgaXMgYSBwcm9ibGVtIHdpdGggdGhlIGZvcm0sIHBsZWFzZSBjaGVjayB0aGUgZXJyb3IgbWVzc2FnZXMgYmVsb3c=</PHRASE>
<PHRASE Label="lu_articles" Module="In-Portal" Type="0">QXJ0aWNsZXM=</PHRASE>
<PHRASE Label="lu_article_details" Module="In-Portal" Type="0">QXJ0aWNsZSBEZXRhaWxz</PHRASE>
<PHRASE Label="lu_article_name" Module="In-Portal" Type="0">QXJ0aWNsZSBuYW1l</PHRASE>
<PHRASE Label="lu_article_reviews" Module="In-Portal" Type="0">QXJ0aWNsZSBSZXZpZXdz</PHRASE>
<PHRASE Label="lu_ascending" Module="In-Portal" Type="0">QXNjZW5kaW5n</PHRASE>
<PHRASE Label="lu_Aug" Module="In-Portal" Type="0">QXVn</PHRASE>
<PHRASE Label="lu_author" Module="In-Portal" Type="0">QXV0aG9y</PHRASE>
<PHRASE Label="lu_auto" Module="In-Portal" Type="1">QXV0b21hdGlj</PHRASE>
<PHRASE Label="lu_avatar_disabled" Module="In-Portal" Type="0">RGlzYWJsZWQgYXZhdGFy</PHRASE>
<PHRASE Label="lu_back" Module="In-Portal" Type="0">QmFjaw==</PHRASE>
<PHRASE Label="lu_bbcode" Module="In-Portal" Type="0">QkJDb2Rl</PHRASE>
<PHRASE Label="lu_birth_date" Module="In-Portal" Type="0">QmlydGggRGF0ZQ==</PHRASE>
<PHRASE Label="lu_blank_password" Module="In-Portal" Type="0">QmxhbmsgcGFzc3dvcmQ=</PHRASE>
<PHRASE Label="lu_box" Module="In-Portal" Type="0">Ym94</PHRASE>
<PHRASE Label="lu_btn_NewLink" Module="In-Portal" Type="0">TmV3IExpbms=</PHRASE>
<PHRASE Label="lu_btn_newtopic" Module="In-Portal" Type="0">TmV3IHRvcGlj</PHRASE>
<PHRASE Label="lu_button_forgotpw" Module="In-Portal" Type="0">U2VuZCBQYXNzd29yZA==</PHRASE>
<PHRASE Label="lu_button_go" Module="In-Portal" Type="0">R28=</PHRASE>
<PHRASE Label="lu_button_join" Module="In-Portal" Type="0">Sm9pbg==</PHRASE>
<PHRASE Label="lu_button_mailinglist" Module="In-Portal" Type="0">U3Vic2NyaWJl</PHRASE>
<PHRASE Label="lu_button_no" Module="In-Portal" Type="0">Tm8=</PHRASE>
<PHRASE Label="lu_button_ok" Module="In-Portal" Type="0">T2s=</PHRASE>
<PHRASE Label="lu_button_rate" Module="In-Portal" Type="0">UmF0ZQ==</PHRASE>
<PHRASE Label="lu_button_search" Module="In-Portal" Type="0">U2VhcmNo</PHRASE>
<PHRASE Label="lu_button_unsubscribe" Module="In-Portal" Type="0">VW5zdWJzY3JpYmU=</PHRASE>
<PHRASE Label="lu_button_yes" Module="In-Portal" Type="0">WWVz</PHRASE>
<PHRASE Label="lu_by" Module="In-Portal" Type="0">Ynk=</PHRASE>
<PHRASE Label="lu_cancel" Module="In-Portal" Type="0">Q2FuY2Vs</PHRASE>
<PHRASE Label="lu_cat" Module="In-Portal" Type="0">Q2F0ZWdvcnk=</PHRASE>
<PHRASE Label="lu_categories" Module="In-Portal" Type="0">Q2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="lu_categories_updated" Module="In-Portal" Type="0">Y2F0ZWdvcmllcyB1cGRhdGVk</PHRASE>
<PHRASE Label="lu_category" Module="In-Portal" Type="0">Q2F0ZWdvcnk=</PHRASE>
<PHRASE Label="lu_category_information" Module="In-Portal" Type="0">Q2F0ZWdvcnkgSW5mb3JtYXRpb24=</PHRASE>
<PHRASE Label="lu_category_search_results" Module="In-Portal" Type="0">Q2F0ZWdvcnkgU2VhcmNoIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_CatLead_Story" Module="In-Portal" Type="0">Q2F0ZWdvcnkgTGVhZCBTdG9yeQ==</PHRASE>
<PHRASE Label="lu_cats" Module="In-Portal" Type="0">Q2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="lu_city" Module="In-Portal" Type="0">Q2l0eQ==</PHRASE>
<PHRASE Label="lu_ClickHere" Module="In-Portal" Type="0">Y2xpY2sgaGVyZQ==</PHRASE>
<PHRASE Label="lu_close" Module="In-Portal" Type="0">Q2xvc2U=</PHRASE>
<PHRASE Label="lu_close_window" Module="In-Portal" Type="0">Q2xvc2UgV2luZG93</PHRASE>
<PHRASE Label="lu_code_expired" Module="In-Portal" Type="0">UGFzc3dvcmQgcmVzZXQgaGFzIGNvZGUgZXhwaXJlZA==</PHRASE>
<PHRASE Label="lu_code_is_not_valid" Module="In-Portal" Type="0">UGFzc3dvcmQgcmVzZXQgY29kZSBpcyBub3QgdmFsaWQ=</PHRASE>
<PHRASE Label="lu_comm_CartChangedAfterLogin" Module="In-Portal" Type="0">UHJpY2VzIG9mIG9uZSBvciBtb3JlIGl0ZW1zIGluIHlvdXIgc2hvcHBpbmcgY2FydCBoYXZlIGJlZW4gY2hhbmdlZCBkdWUgdG8geW91ciBsb2dpbiwgcGxlYXNlIHJldmlldyBjaGFuZ2VzLg==</PHRASE>
<PHRASE Label="lu_comm_EmailAddress" Module="In-Portal" Type="0">RW1haWxBZGRyZXNz</PHRASE>
<PHRASE Label="lu_comm_NoPermissions" Module="In-Portal" Type="0">Tm8gUGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="lu_comm_ProductDescription" Module="In-Portal" Type="0">UHJvZHVjdCBEZXNjcmlwdGlvbg==</PHRASE>
<PHRASE Label="lu_company" Module="In-Portal" Type="0">Q29tcGFueQ==</PHRASE>
<PHRASE Label="lu_confirm" Module="In-Portal" Type="0">Y29uZmlybQ==</PHRASE>
<PHRASE Label="lu_confirmation_title" Module="In-Portal" Type="0">Q29uZmlybWF0aW9uIFRpdGxl</PHRASE>
<PHRASE Label="lu_confirm_link_delete_subtitle" Module="In-Portal" Type="0">WW91IGFyZSBhYm91dCB0byBkZWxldGUgdGhlIGxpbmsgYmVsb3cu</PHRASE>
<PHRASE Label="lu_confirm_subtitle" Module="In-Portal" Type="0">Q29uZmlybWF0aW9uIFN1YnRpdGxl</PHRASE>
<PHRASE Label="lu_confirm_text" Module="In-Portal" Type="0">Q29uZmlybWF0aW9uIHRleHQ=</PHRASE>
<PHRASE Label="lu_ContactUs" Module="In-Portal" Type="0">Q29udGFjdCBVcw==</PHRASE>
<PHRASE Label="lu_contact_information" Module="In-Portal" Type="0">Q29udGFjdCBJbmZvcm1hdGlvbg==</PHRASE>
<PHRASE Label="lu_continue" Module="In-Portal" Type="0">Q29udGludWU=</PHRASE>
<PHRASE Label="lu_cookies" Module="In-Portal" Type="1">Q29va2llcw==</PHRASE>
<PHRASE Label="lu_cookies_error" Module="In-Portal" Type="0">UGxlYXNlIGVuYWJsZSBjb29raWVzIHRvIGxvZ2luIQ==</PHRASE>
<PHRASE Label="lu_country" Module="In-Portal" Type="0">Q291bnRyeQ==</PHRASE>
<PHRASE Label="lu_created" Module="In-Portal" Type="0">Y3JlYXRlZA==</PHRASE>
<PHRASE Label="lu_create_password" Module="In-Portal" Type="0">Q3JlYXRlIFBhc3N3b3Jk</PHRASE>
<PHRASE Label="lu_CreditCards" Module="In-Portal" Type="0">Q3JlZGl0IENhcmRz</PHRASE>
<PHRASE Label="lu_current_value" Module="In-Portal" Type="0">Q3VycmVudCBWYWx1ZQ==</PHRASE>
<PHRASE Label="lu_date" Module="In-Portal" Type="0">RGF0ZQ==</PHRASE>
<PHRASE Label="lu_date_created" Module="In-Portal" Type="0">RGF0ZSBjcmVhdGVk</PHRASE>
<PHRASE Label="lu_Dec" Module="In-Portal" Type="0">RGVj</PHRASE>
<PHRASE Label="lu_default_bbcode" Module="In-Portal" Type="0">RW5hYmxlIEJCQ29kZQ==</PHRASE>
<PHRASE Label="lu_default_notify_owner" Module="In-Portal" Type="0">Tm90aWZ5IG1lIG9uIGNoYW5nZXMgdG8gdG9waWNzIEkgY3JlYXRl</PHRASE>
<PHRASE Label="lu_default_notify_pm" Module="In-Portal" Type="0">UmVjZWl2ZSBQcml2YXRlIE1lc3NhZ2UgTm90aWZpY2F0aW9ucw==</PHRASE>
<PHRASE Label="lu_default_signature" Module="In-Portal" Type="0">QXR0YXRjaCBNeSBTaWduYXR1cmUgdG8gUG9zdHM=</PHRASE>
<PHRASE Label="lu_default_smileys" Module="In-Portal" Type="0">U2ltbGllcyBvbiBieSBkZWZhdWx0</PHRASE>
<PHRASE Label="lu_default_user_signatures" Module="In-Portal" Type="0">U2lnbmF0dXJlcyBvbiBieSBkZWZhdWx0</PHRASE>
<PHRASE Label="lu_delete" Module="In-Portal" Type="0">RGVsZXRl</PHRASE>
<PHRASE Label="lu_delete_confirm_title" Module="In-Portal" Type="0">Q29uZmlybSBEZWxldGU=</PHRASE>
<PHRASE Label="lu_delete_friend" Module="In-Portal" Type="0">RGVsZXRlIEZyaWVuZA==</PHRASE>
<PHRASE Label="lu_delete_link_question" Module="In-Portal" Type="0">QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGlzIGxpbms/</PHRASE>
<PHRASE Label="lu_del_favorites" Module="In-Portal" Type="0">VGhlIGxpbmsgd2FzIHN1Y2Nlc3NmdWxseSByZW1vdmVkIGZyb20gIEZhdm9yaXRlcy4=</PHRASE>
<PHRASE Label="lu_descending" Module="In-Portal" Type="0">RGVzY2VuZGluZw==</PHRASE>
<PHRASE Label="lu_details" Module="In-Portal" Type="0">RGV0YWlscw==</PHRASE>
<PHRASE Label="lu_details_updated" Module="In-Portal" Type="0">ZGV0YWlscyB1cGRhdGVk</PHRASE>
<PHRASE Label="lu_directory" Module="In-Portal" Type="0">RGlyZWN0b3J5</PHRASE>
<PHRASE Label="lu_disable" Module="In-Portal" Type="0">RGlzYWJsZQ==</PHRASE>
<PHRASE Label="lu_edit" Module="In-Portal" Type="0">TW9kaWZ5</PHRASE>
<PHRASE Label="lu_editedby" Module="In-Portal" Type="0">RWRpdGVkIEJ5</PHRASE>
<PHRASE Label="lu_editors_pick" Module="In-Portal" Type="0">RWRpdG9ycyBQaWNr</PHRASE>
<PHRASE Label="lu_editors_picks" Module="In-Portal" Type="0">RWRpdG9yJ3MgUGlja3M=</PHRASE>
<PHRASE Label="lu_edittopic_confirm" Module="In-Portal" Type="0">RWRpdCBUb3BpYyBSZXN1bHRz</PHRASE>
<PHRASE Label="lu_edittopic_confirm_pending" Module="In-Portal" Type="0">VG9waWMgbW9kaWZpZWQ=</PHRASE>
<PHRASE Label="lu_edittopic_confirm_pending_text" Module="In-Portal" Type="0">VG9waWMgaGFzIGJlZW4gbW9kaWZpZWQgcGVuZGluZyBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbA==</PHRASE>
<PHRASE Label="lu_edittopic_confirm_text" Module="In-Portal" Type="0">Q2hhbmdlcyBtYWRlIHRvIHRoZSB0b3BpYyBoYXZlIGJlZW4gc2F2ZWQu</PHRASE>
<PHRASE Label="lu_edit_post" Module="In-Portal" Type="0">TW9kaWZ5IFBvc3Q=</PHRASE>
<PHRASE Label="lu_edit_topic" Module="In-Portal" Type="0">TW9kaWZ5IFRvcGlj</PHRASE>
<PHRASE Label="LU_EMAIL" Module="In-Portal" Type="0">RS1NYWls</PHRASE>
<PHRASE Label="lu_email_already_exist" Module="In-Portal" Type="0">QSB1c2VyIHdpdGggc3VjaCBlLW1haWwgYWxyZWFkeSBleGlzdHMu</PHRASE>
<PHRASE Label="lu_email_send_error" Module="In-Portal" Type="0">TWFpbCBzZW5kaW5nIGZhaWxlZA==</PHRASE>
<PHRASE Label="lu_enabled" Module="In-Portal" Type="0">RW5hYmxlZA==</PHRASE>
<PHRASE Label="lu_end_on" Module="In-Portal" Type="0">RW5kIE9u</PHRASE>
<PHRASE Label="lu_enlarge_picture" Module="In-Portal" Type="0">Wm9vbSBpbg==</PHRASE>
<PHRASE Label="lu_enter" Module="In-Portal" Type="0">RW50ZXI=</PHRASE>
<PHRASE Label="lu_EnterEmailToRecommend" Module="In-Portal" Type="0">RW50ZXIgeW91ciBmcmllbmQgZS1tYWlsIGFkZHJlc3MgdG8gcmVjb21tZW5kIHRoaXMgc2l0ZQ==</PHRASE>
<PHRASE Label="lu_EnterEmailToSubscribe" Module="In-Portal" Type="0">RW50ZXIgeW91ciBlLW1haWwgYWRkcmVzcyB0byBzdWJzY3JpYmUgdG8gdGhlIG1haWxpbmcgbGlzdC4=</PHRASE>
<PHRASE Label="lu_EnterForgotUserEmail" Module="In-Portal" Type="0">RW50ZXIgeW91ciBVc2VybmFtZSBvciBFbWFpbCBBZGRyZXNzIGJlbG93IHRvIGhhdmUgeW91ciBhY2NvdW50IGluZm9ybWF0aW9uIHNlbnQgdG8gdGhlIGVtYWlsIGFkZHJlc3Mgb2YgeW91ciBhY2NvdW50Lg==</PHRASE>
<PHRASE Label="lu_errors_on_form" Module="In-Portal" Type="0">TWlzc2luZyBvciBpbnZhbGlkIHZhbHVlcy4gUGxlYXNlIGNoZWNrIGFsbCB0aGUgZmllbGRzIGFuZCB0cnkgYWdhaW4u</PHRASE>
<PHRASE Label="lu_error_404_description" Module="In-Portal" Type="0">U29ycnksIHRoZSByZXF1ZXN0ZWQgVVJMIHdhcyBub3QgZm91bmQgb24gb3VyIHNlcnZlci4=</PHRASE>
<PHRASE Label="lu_error_404_title" Module="In-Portal" Type="0">RXJyb3IgNDA0IC0gTm90IEZvdW5k</PHRASE>
<PHRASE Label="lu_error_subtitle" Module="In-Portal" Type="0">RXJyb3I=</PHRASE>
<PHRASE Label="lu_error_title" Module="In-Portal" Type="0">RXJyb3I=</PHRASE>
<PHRASE Label="lu_existing_users" Module="In-Portal" Type="0">RXhpc3RpbmcgVXNlcnM=</PHRASE>
<PHRASE Label="lu_expires" Module="In-Portal" Type="0">RXhwaXJlcw==</PHRASE>
<PHRASE Label="lu_false" Module="In-Portal" Type="0">RmFsc2U=</PHRASE>
<PHRASE Label="lu_favorite" Module="In-Portal" Type="0">RmF2b3JpdGU=</PHRASE>
<PHRASE Label="lu_favorite_denied" Module="In-Portal" Type="0">VW5hYmxlIHRvIGFkZCBmYXZvcml0ZSwgYWNjZXNzIGRlbmllZA==</PHRASE>
<PHRASE Label="lu_Feb" Module="In-Portal" Type="0">RmVi</PHRASE>
<PHRASE Label="lu_ferror_forgotpw_nodata" Module="In-Portal" Type="1">WW91IG11c3QgZW50ZXIgYSBVc2VybmFtZSBvciBFbWFpbCBBZGRyZXNzIHRvIHJldHJpdmUgeW91ciBhY2NvdW50IGluZm9ybWF0aW9u</PHRASE>
<PHRASE Label="lu_ferror_loginboth" Module="In-Portal" Type="1">Qm90aCBhIFVzZXJuYW1lIGFuZCBQYXNzd29yZCBpcyByZXF1aXJlZA==</PHRASE>
<PHRASE Label="lu_ferror_login_login_password" Module="In-Portal" Type="1">UGxlYXNlIGVudGVyIHlvdXIgcGFzc3dvcmQgYW5kIHRyeSBhZ2Fpbg==</PHRASE>
<PHRASE Label="lu_ferror_login_login_user" Module="In-Portal" Type="1">WW91IGRpZCBub3QgZW50ZXIgeW91ciBVc2VybmFtZQ==</PHRASE>
<PHRASE Label="lu_ferror_m_acctinfo_dob" Module="In-Portal" Type="0">RGF0ZSBvZiBiaXJ0aCBpcyByZXF1aXJlZA==</PHRASE>
<PHRASE Label="lu_ferror_m_acctinfo_firstname" Module="In-Portal" Type="0">TWlzc2luZyBmaXJzdCBuYW1l</PHRASE>
<PHRASE Label="lu_ferror_m_profile_userid" Module="In-Portal" Type="0">TWlzc2luZyB1c2Vy</PHRASE>
<PHRASE Label="lu_ferror_m_register_dob" Module="In-Portal" Type="0">RGF0ZSBvZiBiaXJ0aCBpcyByZXF1aXJlZA==</PHRASE>
<PHRASE Label="lu_ferror_m_register_email" Module="In-Portal" Type="0">RW1haWwgaXMgcmVxdWlyZWQ=</PHRASE>
<PHRASE Label="lu_ferror_m_register_firstname" Module="In-Portal" Type="0">Rmlyc3QgbmFtZSBpcyByZXF1aXJlZA==</PHRASE>
<PHRASE Label="lu_ferror_m_register_password" Module="In-Portal" Type="0">UGFzc3dvcmQgcmVxdWlyZWQ=</PHRASE>
<PHRASE Label="lu_ferror_no_access" Module="In-Portal" Type="0">QWNjZXNzIGRlbmllZA==</PHRASE>
<PHRASE Label="lu_ferror_pswd_mismatch" Module="In-Portal" Type="0">UGFzc3dvcmRzIGRvIG5vdCBtYXRjaA==</PHRASE>
<PHRASE Label="lu_ferror_pswd_toolong" Module="In-Portal" Type="0">VGhlIHBhc3N3b3JkIGlzIHRvbyBsb25n</PHRASE>
<PHRASE Label="lu_ferror_pswd_tooshort" Module="In-Portal" Type="0">UGFzc3dvcmQgaXMgdG9vIHNob3J0</PHRASE>
<PHRASE Label="lu_ferror_reset_denied" Module="In-Portal" Type="0">Tm90IHJlc2V0</PHRASE>
<PHRASE Label="lu_ferror_review_duplicate" Module="In-Portal" Type="0">WW91IGhhdmUgYWxyZWFkeSByZXZpZXdlZCB0aGlzIGl0ZW0u</PHRASE>
<PHRASE Label="lu_ferror_toolarge" Module="In-Portal" Type="0">RmlsZSBpcyB0b28gbGFyZ2U=</PHRASE>
<PHRASE Label="lu_ferror_unknown_email" Module="In-Portal" Type="1">VXNlciBhY2NvdW50IHdpdGggZ2l2ZW4gRS1tYWlsIG5vdCBmb3VuZA==</PHRASE>
<PHRASE Label="lu_ferror_unknown_username" Module="In-Portal" Type="1">VXNlciBhY2NvdW50IHdpdGggZ2l2ZW4gVXNlcm5hbWUgbm90IGZvdW5k</PHRASE>
<PHRASE Label="lu_ferror_username_tooshort" Module="In-Portal" Type="0">VXNlciBuYW1lIGlzIHRvbyBzaG9ydA==</PHRASE>
<PHRASE Label="lu_ferror_wrongtype" Module="In-Portal" Type="0">V3JvbmcgZmlsZSB0eXBl</PHRASE>
<PHRASE Label="lu_fieldcustom__cc1" Module="In-Portal" Type="2">Y2Mx</PHRASE>
<PHRASE Label="lu_fieldcustom__cc2" Module="In-Portal" Type="2">Y2My</PHRASE>
<PHRASE Label="lu_fieldcustom__cc3" Module="In-Portal" Type="2">Y2Mz</PHRASE>
<PHRASE Label="lu_fieldcustom__cc4" Module="In-Portal" Type="2">Y2M0</PHRASE>
<PHRASE Label="lu_fieldcustom__cc5" Module="In-Portal" Type="2">Y2M1</PHRASE>
<PHRASE Label="lu_fieldcustom__cc6" Module="In-Portal" Type="2">Y2M2</PHRASE>
<PHRASE Label="lu_fieldcustom__lc1" Module="In-Portal" Type="2">bGMx</PHRASE>
<PHRASE Label="lu_fieldcustom__lc2" Module="In-Portal" Type="2">bGMy</PHRASE>
<PHRASE Label="lu_fieldcustom__lc3" Module="In-Portal" Type="2">bGMz</PHRASE>
<PHRASE Label="lu_fieldcustom__lc4" Module="In-Portal" Type="2">bGM0</PHRASE>
<PHRASE Label="lu_fieldcustom__lc5" Module="In-Portal" Type="2">bGM1</PHRASE>
<PHRASE Label="lu_fieldcustom__lc6" Module="In-Portal" Type="2">bGM2</PHRASE>
<PHRASE Label="lu_fieldcustom__uc1" Module="In-Portal" Type="2">dWMx</PHRASE>
<PHRASE Label="lu_fieldcustom__uc2" Module="In-Portal" Type="2">dWMy</PHRASE>
<PHRASE Label="lu_fieldcustom__uc3" Module="In-Portal" Type="2">dWMz</PHRASE>
<PHRASE Label="lu_fieldcustom__uc4" Module="In-Portal" Type="2">dWM0</PHRASE>
<PHRASE Label="lu_fieldcustom__uc5" Module="In-Portal" Type="2">dWM1</PHRASE>
<PHRASE Label="lu_fieldcustom__uc6" Module="In-Portal" Type="2">dWM2</PHRASE>
<PHRASE Label="lu_field_archived" Module="In-Portal" Type="0">QXJjaGl2ZSBEYXRl</PHRASE>
<PHRASE Label="lu_field_author" Module="In-Portal" Type="0">QXJ0aWNsZSBBdXRob3I=</PHRASE>
<PHRASE Label="lu_field_body" Module="In-Portal" Type="0">QXJ0aWNsZSBCb2R5</PHRASE>
<PHRASE Label="lu_field_cacheddescendantcatsqty" Module="In-Portal" Type="0">TnVtYmVyIG9mIERlc2NlbmRhbnRz</PHRASE>
<PHRASE Label="lu_field_cachednavbar" Module="In-Portal" Type="0">Q2F0ZWdvcnkgUGF0aA==</PHRASE>
<PHRASE Label="lu_field_cachedrating" Module="In-Portal" Type="2">UmF0aW5n</PHRASE>
<PHRASE Label="lu_field_cachedreviewsqty" Module="In-Portal" Type="2">TnVtYmVyIG9mIFJldmlld3M=</PHRASE>
<PHRASE Label="lu_field_cachedvotesqty" Module="In-Portal" Type="2">TnVtYmVyIG9mIFJhdGluZyBWb3Rlcw==</PHRASE>
<PHRASE Label="lu_field_categoryid" Module="In-Portal" Type="0">Q2F0ZWdvcnkgSWQ=</PHRASE>
<PHRASE Label="lu_field_city" Module="In-Portal" Type="0">Q2l0eQ==</PHRASE>
<PHRASE Label="lu_field_country" Module="In-Portal" Type="0">Q291bnRyeQ==</PHRASE>
<PHRASE Label="lu_field_createdbyid" Module="In-Portal" Type="2">Q3JlYXRlZCBCeSBVc2VyIElE</PHRASE>
<PHRASE Label="lu_field_createdon" Module="In-Portal" Type="2">RGF0ZSBDcmVhdGVk</PHRASE>
<PHRASE Label="lu_field_description" Module="In-Portal" Type="2">RGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="lu_field_dob" Module="In-Portal" Type="0">RGF0ZSBvZiBCaXJ0aA==</PHRASE>
<PHRASE Label="lu_field_editorspick" Module="In-Portal" Type="0">RWRpdG9yJ3MgcGljaw==</PHRASE>
<PHRASE Label="lu_field_email" Module="In-Portal" Type="0">RS1tYWls</PHRASE>
<PHRASE Label="lu_field_endon" Module="In-Portal" Type="0">RW5kcyBPbg==</PHRASE>
<PHRASE Label="lu_field_excerpt" Module="In-Portal" Type="0">QXJ0aWNsZSBFeGNlcnB0</PHRASE>
<PHRASE Label="lu_field_firstname" Module="In-Portal" Type="0">Rmlyc3QgTmFtZQ==</PHRASE>
<PHRASE Label="lu_field_hits" Module="In-Portal" Type="2">SGl0cw==</PHRASE>
<PHRASE Label="lu_field_hotitem" Module="In-Portal" Type="2">SXRlbSBJcyBIb3Q=</PHRASE>
<PHRASE Label="lu_field_lastname" Module="In-Portal" Type="0">TGFzdCBOYW1l</PHRASE>
<PHRASE Label="lu_field_lastpostid" Module="In-Portal" Type="2">TGFzdCBQb3N0IElE</PHRASE>
<PHRASE Label="lu_field_leadcatstory" Module="In-Portal" Type="0">Q2F0ZWdvcnkgTGVhZCBTdG9yeT8=</PHRASE>
<PHRASE Label="lu_field_leadstory" Module="In-Portal" Type="0">TGVhZCBTdG9yeT8=</PHRASE>
<PHRASE Label="lu_field_linkid" Module="In-Portal" Type="2">TGluayBJRA==</PHRASE>
<PHRASE Label="lu_field_login" Module="In-Portal" Type="0">TG9naW4gKFVzZXIgbmFtZSk=</PHRASE>
<PHRASE Label="lu_field_metadescription" Module="In-Portal" Type="0">TWV0YSBEZXNjcmlwdGlvbg==</PHRASE>
<PHRASE Label="lu_field_metakeywords" Module="In-Portal" Type="0">TWV0YSBLZXl3b3Jkcw==</PHRASE>
<PHRASE Label="lu_field_modified" Module="In-Portal" Type="2">TGFzdCBNb2RpZmllZCBEYXRl</PHRASE>
<PHRASE Label="lu_field_modifiedbyid" Module="In-Portal" Type="2">TW9kaWZpZWQgQnkgVXNlciBJRA==</PHRASE>
<PHRASE Label="lu_field_name" Module="In-Portal" Type="2">TmFtZQ==</PHRASE>
<PHRASE Label="lu_field_newitem" Module="In-Portal" Type="2">SXRlbSBJcyBOZXc=</PHRASE>
<PHRASE Label="lu_field_newsid" Module="In-Portal" Type="0">QXJ0aWNsZSBJRA==</PHRASE>
<PHRASE Label="lu_field_notifyowneronchanges" Module="In-Portal" Type="2">Tm90aWZ5IE93bmVyIG9mIENoYW5nZXM=</PHRASE>
<PHRASE Label="lu_field_orgid" Module="In-Portal" Type="2">T3JpZ2luYWwgSXRlbSBJRA==</PHRASE>
<PHRASE Label="lu_field_ownerid" Module="In-Portal" Type="2">T3duZXIgVXNlciBJRA==</PHRASE>
<PHRASE Label="lu_field_parentid" Module="In-Portal" Type="0">UGFyZW50IElk</PHRASE>
<PHRASE Label="lu_field_parentpath" Module="In-Portal" Type="0">UGFyZW50IENhdGVnb3J5IFBhdGg=</PHRASE>
<PHRASE Label="lu_field_password" Module="In-Portal" Type="0">UGFzc3dvcmQ=</PHRASE>
<PHRASE Label="lu_field_phone" Module="In-Portal" Type="0">VGVsZXBob25l</PHRASE>
<PHRASE Label="lu_field_popitem" Module="In-Portal" Type="2">SXRlbSBJcyBQb3B1bGFy</PHRASE>
<PHRASE Label="lu_field_portaluserid" Module="In-Portal" Type="0">VXNlciBJRA==</PHRASE>
<PHRASE Label="lu_field_postedby" Module="In-Portal" Type="2">UG9zdGVkIEJ5</PHRASE>
<PHRASE Label="lu_field_posts" Module="In-Portal" Type="0">VG9waWMgUG9zdHM=</PHRASE>
<PHRASE Label="lu_field_priority" Module="In-Portal" Type="2">UHJpb3JpdHk=</PHRASE>
<PHRASE Label="lu_field_qtysold" Module="In-Portal" Type="1">UXR5IFNvbGQ=</PHRASE>
<PHRASE Label="lu_field_resourceid" Module="In-Portal" Type="2">UmVzb3VyY2UgSUQ=</PHRASE>
<PHRASE Label="lu_field_startdate" Module="In-Portal" Type="0">U3RhcnQgRGF0ZQ==</PHRASE>
<PHRASE Label="lu_field_state" Module="In-Portal" Type="0">U3RhdGU=</PHRASE>
<PHRASE Label="lu_field_status" Module="In-Portal" Type="2">U3RhdHVz</PHRASE>
<PHRASE Label="lu_field_street" Module="In-Portal" Type="0">U3RyZWV0IEFkZHJlc3M=</PHRASE>
<PHRASE Label="lu_field_textformat" Module="In-Portal" Type="0">QXJ0aWNsZSBUZXh0</PHRASE>
<PHRASE Label="lu_field_title" Module="In-Portal" Type="0">QXJ0aWNsZSBUaXRsZQ==</PHRASE>
<PHRASE Label="lu_field_topicid" Module="In-Portal" Type="2">VG9waWMgSUQ=</PHRASE>
<PHRASE Label="lu_field_topictext" Module="In-Portal" Type="2">VG9waWMgVGV4dA==</PHRASE>
<PHRASE Label="lu_field_topictype" Module="In-Portal" Type="0">VG9waWMgVHlwZQ==</PHRASE>
<PHRASE Label="lu_field_topseller" Module="In-Portal" Type="1">SXRlbSBJcyBhIFRvcCBTZWxsZXI=</PHRASE>
<PHRASE Label="lu_field_tz" Module="In-Portal" Type="0">VGltZSBab25l</PHRASE>
<PHRASE Label="lu_field_url" Module="In-Portal" Type="2">VVJM</PHRASE>
<PHRASE Label="lu_field_views" Module="In-Portal" Type="0">Vmlld3M=</PHRASE>
<PHRASE Label="lu_field_zip" Module="In-Portal" Type="0">WmlwIChQb3N0YWwpIENvZGU=</PHRASE>
<PHRASE Label="lu_first_name" Module="In-Portal" Type="0">Rmlyc3QgTmFtZQ==</PHRASE>
<PHRASE Label="lu_fld_module" Module="In-Portal" Type="0">TW9kdWxl</PHRASE>
<PHRASE Label="lu_fld_phrase" Module="In-Portal" Type="0">UGhyYXNl</PHRASE>
<PHRASE Label="lu_fld_primary_translation" Module="In-Portal" Type="0">UHJpbWFyeSBUcmFuc2xhdGlvbg==</PHRASE>
<PHRASE Label="lu_fld_translation" Module="In-Portal" Type="0">VHJhbnNsYXRpb24=</PHRASE>
<PHRASE Label="lu_ForgotPassword" Module="In-Portal" Type="0">Rm9yZ290IHBhc3N3b3Jk</PHRASE>
<PHRASE Label="lu_forgotpw_confirm" Module="In-Portal" Type="0">UGFzc3dvcmQgUmVxdWVzdCBDb25maXJtYXRpb24=</PHRASE>
<PHRASE Label="lu_forgotpw_confirm_reset" Module="In-Portal" Type="0">Q29uZmlybSBwYXNzd29yZCByZXNldA==</PHRASE>
<PHRASE Label="lu_forgotpw_confirm_text" Module="In-Portal" Type="0">WW91IGhhdmUgY2hvc2VkIHRvIHJlc2V0IHlvdXIgcGFzc3dvcmQuIEEgbmV3IHBhc3N3b3JkIGhhcyBiZWVuIGF1dG9tYXRpY2FsbHkgZ2VuZXJhdGVkIGJ5IHRoZSBzeXN0ZW0uIEl0IGhhcyBiZWVuIGVtYWlsZWQgdG8geW91ciBhZGRyZXNzIG9uIGZpbGUu</PHRASE>
<PHRASE Label="lu_forgotpw_confirm_text_reset" Module="In-Portal" Type="0">UGxlYXNlIGNvbmZpcm0gdGhhdCB5b3Ugd2FudCB0byByZXNldCB5b3VyIHBhc3N3b3JkLg==</PHRASE>
<PHRASE Label="lu_forgot_password" Module="In-Portal" Type="0">Rm9yZ290IFBhc3N3b3Jk</PHRASE>
<PHRASE Label="lu_forgot_password_link" Module="In-Portal" Type="0">Rm9yZ290IFBhc3N3b3Jk</PHRASE>
<PHRASE Label="lu_forgot_pw_description" Module="In-Portal" Type="1">RW50ZXIgeW91ciBVc2VybmFtZSBvciBFbWFpbCBBZGRyZXNzIGJlbG93IHRvIGhhdmUgeW91ciBhY2NvdW50IGluZm9ybWF0aW9uIHNlbnQgdG8gdGhlIGVtYWlsIGFkZHJlc3Mgb2YgeW91ciBhY2NvdW50Lg==</PHRASE>
<PHRASE Label="lu_forums" Module="In-Portal" Type="0">Rm9ydW1z</PHRASE>
<PHRASE Label="lu_forum_hdrtext" Module="In-Portal" Type="0">V2VsY29tZSB0byBJbi1wb3J0YWwgZm9ydW1zIQ==</PHRASE>
<PHRASE Label="lu_forum_hdrwelcometext" Module="In-Portal" Type="0">V2VsY29tZSB0byBJbi1idWxsZXRpbiBGb3J1bXMh</PHRASE>
<PHRASE Label="lu_forum_locked_for_posting" Module="In-Portal" Type="0">Rm9ydW0gaXMgbG9ja2VkIGZvciBwb3N0aW5n</PHRASE>
<PHRASE Label="lu_found" Module="In-Portal" Type="0">Rm91bmQ6</PHRASE>
<PHRASE Label="lu_from" Module="In-Portal" Type="0">RnJvbQ==</PHRASE>
<PHRASE Label="lu_full_story" Module="In-Portal" Type="0">RnVsbCBTdG9yeQ==</PHRASE>
<PHRASE Label="lu_getting_rated" Module="In-Portal" Type="0">R2V0dGluZyBSYXRlZA==</PHRASE>
<PHRASE Label="lu_getting_rated_text" Module="In-Portal" Type="0">WW91IG1heSBwbGFjZSB0aGUgZm9sbG93aW5nIEhUTUwgY29kZSBvbiB5b3VyIHdlYiBzaXRlIHRvIGFsbG93IHlvdXIgc2l0ZSB2aXNpdG9ycyB0byB2b3RlIGZvciB0aGlzIHJlc291cmNl</PHRASE>
<PHRASE Label="lu_guest" Module="In-Portal" Type="0">R3Vlc3Q=</PHRASE>
<PHRASE Label="lu_help" Module="In-Portal" Type="0">SGVscA==</PHRASE>
<PHRASE Label="lu_Here" Module="In-Portal" Type="0">SGVyZQ==</PHRASE>
<PHRASE Label="lu_hits" Module="In-Portal" Type="0">SGl0cw==</PHRASE>
<PHRASE Label="lu_home" Module="In-Portal" Type="0">SG9tZQ==</PHRASE>
<PHRASE Label="lu_hot" Module="In-Portal" Type="0">SG90</PHRASE>
<PHRASE Label="lu_hot_links" Module="In-Portal" Type="0">SG90IExpbmtz</PHRASE>
<PHRASE Label="lu_in" Module="In-Portal" Type="0">aW4=</PHRASE>
<PHRASE Label="lu_inbox" Module="In-Portal" Type="0">SW5ib3g=</PHRASE>
<PHRASE Label="lu_incorrect_login" Module="In-Portal" Type="0">VXNlcm5hbWUvUGFzc3dvcmQgSW5jb3JyZWN0</PHRASE>
<PHRASE Label="lu_IndicatesRequired" Module="In-Portal" Type="0">SW5kaWNhdGVzIFJlcXVpcmVkIGZpZWxkcw==</PHRASE>
<PHRASE Label="lu_InvalidEmail" Module="In-Portal" Type="0">SW52YWxpZCBlLW1haWwgYWRkcmVzcw==</PHRASE>
<PHRASE Label="lu_invalid_emailaddress" Module="In-Portal" Type="0">RS1tYWlsIGFkZHJlc3MgbWlzc2luZyBvciBpbnZhbGlk</PHRASE>
<PHRASE Label="lu_invalid_password" Module="In-Portal" Type="0">SW52YWxpZCBQYXNzd29yZA==</PHRASE>
<PHRASE Label="lu_in_this_message" Module="In-Portal" Type="0">SW4gdGhpcyBtZXNzYWdl</PHRASE>
<PHRASE Label="lu_items_since_last" Module="In-Portal" Type="0">SXRlbXMgc2luY2UgbGFzdCBsb2dpbg==</PHRASE>
<PHRASE Label="lu_Jan" Module="In-Portal" Type="0">SmFu</PHRASE>
<PHRASE Label="lu_joined" Module="In-Portal" Type="0">Sm9pbmVk</PHRASE>
<PHRASE Label="lu_Jul" Module="In-Portal" Type="0">SnVs</PHRASE>
<PHRASE Label="lu_Jun" Module="In-Portal" Type="0">SnVu</PHRASE>
<PHRASE Label="lu_keywords_tooshort" Module="In-Portal" Type="0">S2V5d29yZCBpcyB0b28gc2hvcnQ=</PHRASE>
<PHRASE Label="lu_lastpost" Module="In-Portal" Type="0">TGFzdCBQb3N0</PHRASE>
<PHRASE Label="lu_lastposter" Module="In-Portal" Type="0">TGFzdCBQb3N0IEJ5</PHRASE>
<PHRASE Label="lu_lastupdate" Module="In-Portal" Type="0">TGFzdCBVcGRhdGU=</PHRASE>
<PHRASE Label="lu_last_name" Module="In-Portal" Type="0">TGFzdCBOYW1l</PHRASE>
<PHRASE Label="lu_legend" Module="In-Portal" Type="0">TGVnZW5k</PHRASE>
<PHRASE Label="lu_links" Module="In-Portal" Type="0">TGlua3M=</PHRASE>
<PHRASE Label="lu_links_updated" Module="In-Portal" Type="0">bGlua3MgdXBkYXRlZA==</PHRASE>
<PHRASE Label="lu_link_addreview_confirm_pending_text" Module="In-Portal" Type="0">WW91ciByZXZpZXcgaGFzIGJlZW4gYWRkZWQgcGVuZGluZyBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbA==</PHRASE>
<PHRASE Label="lu_link_addreview_confirm_text" Module="In-Portal" Type="0">WW91ciByZXZpZXcgaGFzIGJlZW4gYWRkZWQ=</PHRASE>
<PHRASE Label="lu_link_details" Module="In-Portal" Type="0">TGluayBEZXRhaWxz</PHRASE>
<PHRASE Label="lu_link_information" Module="In-Portal" Type="0">TGluayBJbmZvcm1hdGlvbg==</PHRASE>
<PHRASE Label="lu_link_name" Module="In-Portal" Type="0">TGluayBOYW1l</PHRASE>
<PHRASE Label="lu_link_rate_confirm" Module="In-Portal" Type="0">TGluayBSYXRpbmcgUmVzdWx0cw==</PHRASE>
<PHRASE Label="lu_link_rate_confirm_duplicate_text" Module="In-Portal" Type="0">WW91IGhhdmUgYWxyZWFkeSByYXRlZCB0aGlzIGxpbmsu</PHRASE>
<PHRASE Label="lu_link_rate_confirm_text" Module="In-Portal" Type="0">VGhhbmsgZm9yIHJhdGluZyB0aGlzIGxpbmsuICBZb3VyIGlucHV0IGhhcyBiZWVuIHJlY29yZGVkLg==</PHRASE>
<PHRASE Label="lu_link_reviews" Module="In-Portal" Type="0">TGluayBSZXZpZXdz</PHRASE>
<PHRASE Label="lu_link_review_confirm" Module="In-Portal" Type="0">TGluayBSZXZpZXcgUmVzdWx0cw==</PHRASE>
<PHRASE Label="lu_link_review_confirm_pending" Module="In-Portal" Type="0">TGluayBSZXZpZXcgUGVuZGluZw==</PHRASE>
<PHRASE Label="lu_link_search_results" Module="In-Portal" Type="0">TGluayBTZWFyY2ggUmVzdWx0cw==</PHRASE>
<PHRASE Label="lu_location" Module="In-Portal" Type="0">TG9jYXRpb24=</PHRASE>
<PHRASE Label="lu_locked_topic" Module="In-Portal" Type="0">TG9ja2VkIHRvcGlj</PHRASE>
<PHRASE Label="lu_lock_unlock" Module="In-Portal" Type="0">TG9jay9VbmxvY2s=</PHRASE>
<PHRASE Label="lu_login" Module="In-Portal" Type="0">TG9naW4=</PHRASE>
<PHRASE Label="lu_login_information" Module="In-Portal" Type="0">TG9naW4gSW5mb3JtYXRpb24=</PHRASE>
<PHRASE Label="lu_login_name" Module="In-Portal" Type="0">TG9naW4gTmFtZQ==</PHRASE>
<PHRASE Label="lu_login_title" Module="In-Portal" Type="0">TG9naW4=</PHRASE>
<PHRASE Label="lu_logout" Module="In-Portal" Type="0">TG9nIE91dA==</PHRASE>
<PHRASE Label="lu_LogoutText" Module="In-Portal" Type="0">TG9nb3V0IG9mIHlvdXIgYWNjb3VudA==</PHRASE>
<PHRASE Label="lu_logout_description" Module="In-Portal" Type="0">TG9nIG91dCBvZiB0aGUgc3lzdGVt</PHRASE>
<PHRASE Label="lu_mailinglist" Module="In-Portal" Type="0">TWFpbGluZyBMaXN0</PHRASE>
<PHRASE Label="lu_Mar" Module="In-Portal" Type="0">TWFy</PHRASE>
<PHRASE Label="lu_May" Module="In-Portal" Type="0">TWF5</PHRASE>
<PHRASE Label="lu_message" Module="In-Portal" Type="0">TWVzc2FnZQ==</PHRASE>
<PHRASE Label="lu_message_body" Module="In-Portal" Type="0">TWVzc2FnZSBCb2R5</PHRASE>
<PHRASE Label="lu_min_pw_reset_interval" Module="In-Portal" Type="0">UGFzc3dvcmQgcmVzZXQgaW50ZXJ2YWw=</PHRASE>
<PHRASE Label="lu_missing_error" Module="In-Portal" Type="0">TWlzc2luZyBUZW1wbGF0ZQ==</PHRASE>
<PHRASE Label="lu_modified" Module="In-Portal" Type="0">TW9kaWZpZWQ=</PHRASE>
<PHRASE Label="lu_modifylink_confirm" Module="In-Portal" Type="0">TGluayBNb2RpZmljYXRpb24gQ29uZmlybWF0aW9u</PHRASE>
<PHRASE Label="lu_modifylink_confirm_text" Module="In-Portal" Type="0">WW91ciBsaW5rIGhhcyBiZWVuIG1vZGlmaWVkLg==</PHRASE>
<PHRASE Label="lu_modifylink_pending_confirm" Module="In-Portal" Type="0">TGluayBtb2RpZmljYXRpb24gY29tcGxldGU=</PHRASE>
<PHRASE Label="lu_modifylink_pending_confirm_text" Module="In-Portal" Type="0">WW91ciBsaW5rIG1vZGlmaWNhdGlvbiBoYXMgYmVlbiBzdWJtaXR0ZWQgcGVuZGluZyBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbA==</PHRASE>
<PHRASE Label="lu_modify_link" Module="In-Portal" Type="0">TW9kaWZ5IExpbms=</PHRASE>
<PHRASE Label="lu_more" Module="In-Portal" Type="0">TW9yZQ==</PHRASE>
<PHRASE Label="lu_MoreDetails" Module="In-Portal" Type="0">TW9yZSBkZXRhaWxz</PHRASE>
<PHRASE Label="lu_more_info" Module="In-Portal" Type="0">TW9yZSBJbmZv</PHRASE>
<PHRASE Label="lu_msg_welcome" Module="In-Portal" Type="0">V2VsY29tZQ==</PHRASE>
<PHRASE Label="lu_myaccount" Module="In-Portal" Type="0">TXkgQWNjb3VudA==</PHRASE>
<PHRASE Label="lu_my_articles" Module="In-Portal" Type="0">TXkgQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="lu_my_articles_description" Module="In-Portal" Type="0">TmV3cyBBcnRpY2xlcyB5b3UgaGF2ZSB3cml0dGVu</PHRASE>
<PHRASE Label="lu_my_favorites" Module="In-Portal" Type="0">TXkgRmF2b3JpdGVz</PHRASE>
<PHRASE Label="lu_my_favorites_description" Module="In-Portal" Type="0">SXRlbXMgeW91IGhhdmUgbWFya2VkIGFzIGZhdm9yaXRl</PHRASE>
<PHRASE Label="lu_my_friends" Module="In-Portal" Type="0">TXkgRnJpZW5kcw==</PHRASE>
<PHRASE Label="lu_my_friends_description" Module="In-Portal" Type="0">VmlldyB5b3VyIGxpc3Qgb2YgZnJpZW5kcw==</PHRASE>
<PHRASE Label="lu_my_info" Module="In-Portal" Type="0">TXkgUHJvZmlsZQ==</PHRASE>
<PHRASE Label="lu_my_info_description" Module="In-Portal" Type="0">WW91ciBBY2NvdW50IEluZm9ybWF0aW9u</PHRASE>
<PHRASE Label="lu_my_items_title" Module="In-Portal" Type="0">TXkgSXRlbXM=</PHRASE>
<PHRASE Label="lu_my_links" Module="In-Portal" Type="0">TXkgTGlua3M=</PHRASE>
<PHRASE Label="lu_my_links_description" Module="In-Portal" Type="0">TGlua3MgeW91IGhhdmUgYWRkZWQgdG8gdGhlIHN5c3RlbQ==</PHRASE>
<PHRASE Label="lu_my_link_favorites" Module="In-Portal" Type="0">TXkgRmF2b3JpdGVz</PHRASE>
<PHRASE Label="lu_my_news" Module="In-Portal" Type="0">TXkgTmV3cw==</PHRASE>
<PHRASE Label="lu_my_news_favorites" Module="In-Portal" Type="0">RmF2b3JpdGUgQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="lu_my_preferences" Module="In-Portal" Type="0">TXkgUHJlZmVyZW5jZXM=</PHRASE>
<PHRASE Label="lu_my_preferences_description" Module="In-Portal" Type="0">RWRpdCB5b3VyIEluLVBvcnRhbCBQcmVmZXJlbmNlcw==</PHRASE>
<PHRASE Label="lu_my_profile" Module="In-Portal" Type="0">TXkgUHJvZmlsZQ==</PHRASE>
<PHRASE Label="lu_my_topics" Module="In-Portal" Type="0">TXkgVG9waWNz</PHRASE>
<PHRASE Label="lu_my_topics_description" Module="In-Portal" Type="0">RGlzY3Vzc2lvbnMgeW91IGhhdmUgY3JlYXRlZA==</PHRASE>
<PHRASE Label="lu_my_topic_favorites" Module="In-Portal" Type="0">TXkgVG9waWNz</PHRASE>
<PHRASE Label="lu_Name" Module="In-Portal" Type="0">TmFtZQ==</PHRASE>
<PHRASE Label="lu_nav_addlink" Module="In-Portal" Type="0">QWRkIExpbms=</PHRASE>
<PHRASE Label="lu_new" Module="In-Portal" Type="0">TmV3</PHRASE>
<PHRASE Label="lu_NewCustomers" Module="In-Portal" Type="0">TmV3IEN1c3RvbWVycw==</PHRASE>
<PHRASE Label="lu_newpm_confirm" Module="In-Portal" Type="0">TmV3IFByaXZhdGUgTWVzc2FnZSBDb25maXJtYXRpb24=</PHRASE>
<PHRASE Label="lu_newpm_confirm_text" Module="In-Portal" Type="0">WW91ciBwcml2YXRlIG1lc3NhZ2UgaGFzIGJlZW4gc2VudC4=</PHRASE>
<PHRASE Label="lu_news" Module="In-Portal" Type="0">TmV3cw==</PHRASE>
<PHRASE Label="lu_news_addreview_confirm_text" Module="In-Portal" Type="0">VGhlIGFydGljbGUgcmV2aWV3IGhhcyBiZWVuIGFkZGVkIHRvIHRoZSBkYXRhYmFzZS4=</PHRASE>
<PHRASE Label="lu_news_addreview_confirm__pending_text" Module="In-Portal" Type="0">QXJ0aWNsZSByZXZpZXcgaGFzIGJlZW4gc3VibWl0dGVkIHBlbmRpbmcgYWRtaW5pc3RyYXRpdmUgYXBwcm92YWw=</PHRASE>
<PHRASE Label="lu_news_details" Module="In-Portal" Type="0">TmV3cyBEZXRhaWxz</PHRASE>
<PHRASE Label="lu_news_rate_confirm" Module="In-Portal" Type="0">UmF0ZSBBcnRpY2xlIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_news_rate_confirm_duplicate_text" Module="In-Portal" Type="0">WW91IGhhdmUgYWxyZWFkeSByYXRlZCB0aGlzIGFydGljbGU=</PHRASE>
<PHRASE Label="lu_news_rate_confirm_text" Module="In-Portal" Type="0">VGhhbmsgeW91IGZvciByYXRpbmcgdGhpcyBhcnRpY2xlLiBZb3VyIHZvdGUgaGFzIGJlZW4gcmVjb3JkZWQu</PHRASE>
<PHRASE Label="lu_news_review_confirm" Module="In-Portal" Type="0">VGhlIHJldmlldyBoYXMgYmVlbiBhZGRlZA==</PHRASE>
<PHRASE Label="lu_news_review_confirm_pending" Module="In-Portal" Type="0">QXJ0aWNsZSByZXZpZXcgc3VibWl0dGVk</PHRASE>
<PHRASE Label="lu_news_search_results" Module="In-Portal" Type="0">U2VhcmNoIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_news_updated" Module="In-Portal" Type="0">bmV3cyB1cGRhdGVk</PHRASE>
<PHRASE Label="lu_newtopic_confirm" Module="In-Portal" Type="0">QWRkIFRvcGljIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_newtopic_confirm_pending" Module="In-Portal" Type="0">WW91ciB0b3BpYyBoYXMgYmVlbiBhZGRlZA==</PHRASE>
<PHRASE Label="lu_newtopic_confirm_pending_text" Module="In-Portal" Type="0">VGhlIHN5c3RlbSBhZG1pbmlzdHJhdG9yIG11c3QgYXBwcm92ZSB5b3VyIHRvcGljIGJlZm9yZSBpdCBpcyBwdWJsaWNseSBhdmFpbGFibGUu</PHRASE>
<PHRASE Label="lu_newtopic_confirm_text" Module="In-Portal" Type="0">VGhlIFRvcGljIHlvdSBoYXZlIGNyZWF0ZWQgaGFzIGJlZW4gYWRkZWQgdG8gdGhlIHN5c3RlbQ==</PHRASE>
<PHRASE Label="lu_new_articles" Module="In-Portal" Type="0">TmV3IGFydGljbGVz</PHRASE>
<PHRASE Label="lu_new_links" Module="In-Portal" Type="0">TmV3IExpbmtz</PHRASE>
<PHRASE Label="lu_new_news" Module="In-Portal" Type="0">TmV3IGFydGljbGVz</PHRASE>
<PHRASE Label="lu_new_pm" Module="In-Portal" Type="0">TmV3IFByaXZhdGUgTWVzc2FnZQ==</PHRASE>
<PHRASE Label="lu_new_posts" Module="In-Portal" Type="0">Rm9ydW0gaGFzIG5ldyBwb3N0cw==</PHRASE>
<PHRASE Label="lu_new_private_message" Module="In-Portal" Type="0">TmV3IHByaXZhdGUgbWVzc2FnZQ==</PHRASE>
<PHRASE Label="lu_new_since_links" Module="In-Portal" Type="0">TmV3IGxpbmtz</PHRASE>
<PHRASE Label="lu_new_since_news" Module="In-Portal" Type="0">TmV3IGFydGljbGVz</PHRASE>
<PHRASE Label="lu_new_since_topics" Module="In-Portal" Type="0">TmV3IHRvcGljcw==</PHRASE>
<PHRASE Label="lu_new_topic" Module="In-Portal" Type="0">TmV3IFRvcGlj</PHRASE>
<PHRASE Label="lu_new_users" Module="In-Portal" Type="0">TmV3IFVzZXJz</PHRASE>
<PHRASE Label="lu_no" Module="In-Portal" Type="0">Tm8=</PHRASE>
<PHRASE Label="lu_NoAccess" Module="In-Portal" Type="0">U29ycnksIHlvdSBoYXZlIG5vIGFjY2VzcyB0byB0aGlzIHBhZ2Uh</PHRASE>
<PHRASE Label="lu_none" Module="In-Portal" Type="0">Tm9uZQ==</PHRASE>
<PHRASE Label="lu_notify_owner" Module="In-Portal" Type="0">Tm90aWZ5IG1lIHdoZW4gcG9zdHMgYXJlIG1hZGUgaW4gdGhpcyB0b3BpYw==</PHRASE>
<PHRASE Label="lu_not_logged_in" Module="In-Portal" Type="0">Tm90IGxvZ2dlZCBpbg==</PHRASE>
<PHRASE Label="lu_Nov" Module="In-Portal" Type="0">Tm92</PHRASE>
<PHRASE Label="lu_no_articles" Module="In-Portal" Type="0">Tm8gQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="lu_no_categories" Module="In-Portal" Type="0">Tm8gQ2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="lu_no_expiration" Module="In-Portal" Type="0">Tm8gZXhwaXJhdGlvbg==</PHRASE>
<PHRASE Label="lu_no_favorites" Module="In-Portal" Type="0">Tm8gZmF2b3JpdGVz</PHRASE>
<PHRASE Label="lu_no_items" Module="In-Portal" Type="0">Tm8gSXRlbXM=</PHRASE>
<PHRASE Label="lu_no_keyword" Module="In-Portal" Type="0">S2V5d29yZCBtaXNzaW5n</PHRASE>
<PHRASE Label="lu_no_links" Module="In-Portal" Type="0">Tm8gTGlua3M=</PHRASE>
<PHRASE Label="lu_no_new_posts" Module="In-Portal" Type="0">Rm9ydW0gaGFzIG5vIG5ldyBwb3N0cw==</PHRASE>
<PHRASE Label="lu_no_permissions" Module="In-Portal" Type="0">Tm8gUGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="lu_no_related_categories" Module="In-Portal" Type="0">Tm8gUmVsYXRlZCBDYXRlZ29yaWVz</PHRASE>
<PHRASE Label="lu_no_session_error" Module="In-Portal" Type="0">RXJyb3I6IG5vIHNlc3Npb24=</PHRASE>
<PHRASE Label="lu_no_template_error" Module="In-Portal" Type="0">TWlzc2luZyB0ZW1wbGF0ZQ==</PHRASE>
<PHRASE Label="lu_no_topics" Module="In-Portal" Type="0">Tm8gVG9waWNz</PHRASE>
<PHRASE Label="lu_Oct" Module="In-Portal" Type="0">T2N0</PHRASE>
<PHRASE Label="lu_of" Module="In-Portal" Type="2">b2Y=</PHRASE>
<PHRASE Label="lu_offline" Module="In-Portal" Type="0">T2ZmbGluZQ==</PHRASE>
<PHRASE Label="lu_ok" Module="In-Portal" Type="0">T2s=</PHRASE>
<PHRASE Label="lu_on" Module="In-Portal" Type="0">b24=</PHRASE>
<PHRASE Label="lu_online" Module="In-Portal" Type="0">T25saW5l</PHRASE>
<PHRASE Label="lu_on_this_post" Module="In-Portal" Type="0">b24gdGhpcyBwb3N0</PHRASE>
<PHRASE Label="lu_operation_notallowed" Module="In-Portal" Type="0">WW91IGRvIG5vdCBoYXZlIGFjY2VzcyB0byBwZXJmb3JtIHRoaXMgb3BlcmF0aW9u</PHRASE>
<PHRASE Label="lu_optional" Module="In-Portal" Type="0">T3B0aW9uYWw=</PHRASE>
<PHRASE Label="lu_options" Module="In-Portal" Type="0">T3B0aW9ucw==</PHRASE>
<PHRASE Label="lu_or" Module="In-Portal" Type="0">b3I=</PHRASE>
<PHRASE Label="lu_page" Module="In-Portal" Type="0">UGFnZQ==</PHRASE>
<PHRASE Label="lu_page_label" Module="In-Portal" Type="0">UGFnZTo=</PHRASE>
<PHRASE Label="lu_password" Module="In-Portal" Type="0">UGFzc3dvcmQ=</PHRASE>
<PHRASE Label="lu_passwords_do_not_match" Module="In-Portal" Type="0">UGFzc3dvcmRzIGRvIG5vdCBtYXRjaA==</PHRASE>
<PHRASE Label="lu_passwords_too_short" Module="In-Portal" Type="0">UGFzc3dvcmQgaXMgdG9vIHNob3J0LCBwbGVhc2UgZW50ZXIgYXQgbGVhc3QgJXMgY2hhcmFjdGVycw==</PHRASE>
<PHRASE Label="lu_password_again" Module="In-Portal" Type="0">UGFzc3dvcmQgQWdhaW4=</PHRASE>
<PHRASE Label="lu_PermName_Admin_desc" Module="In-Portal" Type="1">QWRtaW4gTG9naW4=</PHRASE>
<PHRASE Label="lu_PermName_Category.AddPending_desc" Module="In-Portal" Type="0">QWRkIFBlbmRpbmcgQ2F0ZWdvcnk=</PHRASE>
<PHRASE Label="lu_PermName_Category.Add_desc" Module="In-Portal" Type="0">QWRkIENhdGVnb3J5</PHRASE>
<PHRASE Label="lu_PermName_Category.Delete_desc" Module="In-Portal" Type="0">RGVsZXRlIENhdGVnb3J5</PHRASE>
<PHRASE Label="lu_PermName_Category.Modify_desc" Module="In-Portal" Type="0">TW9kaWZ5IENhdGVnb3J5</PHRASE>
<PHRASE Label="lu_PermName_Category.View_desc" Module="In-Portal" Type="0">VmlldyBDYXRlZ29yeQ==</PHRASE>
<PHRASE Label="lu_PermName_Debug.Info_desc" Module="In-Portal" Type="1">QXBwZW5kIHBocGluZm8gdG8gYWxsIHBhZ2VzIChEZWJ1Zyk=</PHRASE>
<PHRASE Label="lu_PermName_Debug.Item_desc" Module="In-Portal" Type="1">RGlzcGxheSBJdGVtIFF1ZXJpZXMgKERlYnVnKQ==</PHRASE>
<PHRASE Label="lu_PermName_Debug.List_desc" Module="In-Portal" Type="1">RGlzcGxheSBJdGVtIExpc3QgUXVlcmllcyAoRGVidWcp</PHRASE>
<PHRASE Label="lu_PermName_favorites_desc" Module="In-Portal" Type="2">QWxsb3cgZmF2b3JpdGVz</PHRASE>
<PHRASE Label="lu_PermName_Link.Add.Pending_desc" Module="In-Portal" Type="0">UGVuZGluZyBMaW5r</PHRASE>
<PHRASE Label="lu_PermName_Link.Add_desc" Module="In-Portal" Type="0">QWRkIExpbms=</PHRASE>
<PHRASE Label="lu_PermName_Link.Delete_desc" Module="In-Portal" Type="0">RGVsZXRlIExpbms=</PHRASE>
<PHRASE Label="lu_PermName_Link.Modify.Pending_desc" Module="In-Portal" Type="2">TW9kaWZ5IExpbmsgUGVuZGluZw==</PHRASE>
<PHRASE Label="lu_PermName_Link.Modify_desc" Module="In-Portal" Type="0">TW9kaWZ5IExpbms=</PHRASE>
<PHRASE Label="lu_PermName_Link.Owner.Delete_desc" Module="In-Portal" Type="2">TGluayBEZWxldGUgYnkgT3duZXI=</PHRASE>
<PHRASE Label="lu_PermName_Link.Owner.Modify.Pending_desc" Module="In-Portal" Type="2">TGluayBNb2RpZnkgUGVuZGluZyBieSBPd25lcg==</PHRASE>
<PHRASE Label="lu_PermName_Link.Owner.Modify_desc" Module="In-Portal" Type="2">TGluayBNb2RpZnkgYnkgT3duZXI=</PHRASE>
<PHRASE Label="lu_PermName_Link.Rate_desc" Module="In-Portal" Type="0">UmF0ZSBMaW5r</PHRASE>
<PHRASE Label="lu_PermName_Link.Review_desc" Module="In-Portal" Type="0">UmV2aWV3IExpbms=</PHRASE>
<PHRASE Label="lu_PermName_Link.Review_Pending_desc" Module="In-Portal" Type="2">UmV2aWV3IExpbmsgUGVuZGluZw==</PHRASE>
<PHRASE Label="lu_PermName_Link.View_desc" Module="In-Portal" Type="0">VmlldyBMaW5r</PHRASE>
<PHRASE Label="lu_PermName_Login_desc" Module="In-Portal" Type="1">QWxsb3cgTG9naW4=</PHRASE>
<PHRASE Label="lu_PermName_News.Add.Pending_desc" Module="In-Portal" Type="0">QWRkIFBlbmRpbmcgTmV3cw==</PHRASE>
<PHRASE Label="lu_PermName_News.Add_desc" Module="In-Portal" Type="0">QWRkIE5ld3M=</PHRASE>
<PHRASE Label="lu_PermName_News.Delete_desc" Module="In-Portal" Type="0">RGVsZXRlIE5ld3M=</PHRASE>
<PHRASE Label="lu_PermName_News.Modify_desc" Module="In-Portal" Type="0">TW9kaWZ5IE5ld3M=</PHRASE>
<PHRASE Label="lu_PermName_News.Rate_desc" Module="In-Portal" Type="0">UmF0ZSBOZXdz</PHRASE>
<PHRASE Label="lu_PermName_News.Review.Pending_desc" Module="In-Portal" Type="2">UmV2aWV3IE5ld3MgUGVuZGluZw==</PHRASE>
<PHRASE Label="lu_PermName_News.Review_desc" Module="In-Portal" Type="0">UmV2aWV3IE5ld3M=</PHRASE>
<PHRASE Label="lu_PermName_News.View_desc" Module="In-Portal" Type="0">VmlldyBOZXdz</PHRASE>
<PHRASE Label="lu_PermName_Profile.Modify_desc" Module="In-Portal" Type="1">Q2hhbmdlIFVzZXIgUHJvZmlsZXM=</PHRASE>
<PHRASE Label="lu_PermName_ShowLang_desc" Module="In-Portal" Type="1">U2hvdyBMYW5ndWFnZSBUYWdz</PHRASE>
<PHRASE Label="lu_PermName_Topic.Add.Pending_desc" Module="In-Portal" Type="0">QWRkIFBlbmRpbmcgVG9waWM=</PHRASE>
<PHRASE Label="lu_PermName_Topic.Add_desc" Module="In-Portal" Type="0">QWRkIFRvcGlj</PHRASE>
<PHRASE Label="lu_PermName_Topic.Delete_desc" Module="In-Portal" Type="0">RGVsZXRlIFRvcGlj</PHRASE>
<PHRASE Label="lu_PermName_Topic.Lock_desc" Module="In-Portal" Type="1">TG9jay9VbmxvY2sgVG9waWNz</PHRASE>
<PHRASE Label="lu_PermName_Topic.Modify.Pending_desc" Module="In-Portal" Type="1">TW9kaWZ5IFRvcGljIFBlbmRpbmc=</PHRASE>
<PHRASE Label="lu_PermName_Topic.Modify_desc" Module="In-Portal" Type="0">TW9kaWZ5IFRvcGlj</PHRASE>
<PHRASE Label="lu_PermName_Topic.Owner.Delete_desc" Module="In-Portal" Type="1">VG9waWMgT3duZXIgRGVsZXRl</PHRASE>
<PHRASE Label="lu_PermName_Topic.Owner.Modify.Pending_desc" Module="In-Portal" Type="1">T3duZXIgTW9kaWZ5IFRvcGljIFBlbmRpbmc=</PHRASE>
<PHRASE Label="lu_PermName_Topic.Owner.Modify_desc" Module="In-Portal" Type="1">VG9waWMgT3duZXIgTW9kaWZ5</PHRASE>
<PHRASE Label="lu_PermName_Topic.Rate_desc" Module="In-Portal" Type="0">UmF0ZSBUb3BpYw==</PHRASE>
<PHRASE Label="lu_PermName_Topic.Reply.Add_desc" Module="In-Portal" Type="0">QWRkIFRvcGljIFJlcGx5</PHRASE>
<PHRASE Label="lu_PermName_Topic.Reply.Delete_desc" Module="In-Portal" Type="0">RGVsZXRlIFRvcGlj</PHRASE>
<PHRASE Label="lu_PermName_Topic.Reply.Modify_desc" Module="In-Portal" Type="0">UmVwbHkgVG9waWMgTW9kaWZ5</PHRASE>
<PHRASE Label="lu_PermName_Topic.Reply.Owner.Delete_desc" Module="In-Portal" Type="1">UG9zdCBPd25lciBEZWxldGU=</PHRASE>
<PHRASE Label="lu_PermName_Topic.Reply.Owner.Modify_desc" Module="In-Portal" Type="1">UG9zdCBPd25lciBNb2RpZnk=</PHRASE>
<PHRASE Label="lu_PermName_Topic.Reply.View_desc" Module="In-Portal" Type="0">VmlldyBUb3BpYyBSZXBseQ==</PHRASE>
<PHRASE Label="lu_PermName_Topic.Review_desc" Module="In-Portal" Type="0">UmV2aWV3IFRvcGlj</PHRASE>
<PHRASE Label="lu_PermName_Topic.View_desc" Module="In-Portal" Type="0">VmlldyBUb3BpYw==</PHRASE>
<PHRASE Label="lu_phone" Module="In-Portal" Type="0">UGhvbmU=</PHRASE>
<PHRASE Label="lu_pick" Module="In-Portal" Type="0">UGljaw==</PHRASE>
<PHRASE Label="lu_pick_links" Module="In-Portal" Type="0">RWRpdG9yJ3MgUGljayBMaW5rcw==</PHRASE>
<PHRASE Label="lu_pick_news" Module="In-Portal" Type="0">RWRpdG9yJ3MgUGljayBBcnRpY2xlcw==</PHRASE>
<PHRASE Label="lu_pick_topics" Module="In-Portal" Type="0">RWRpdG9yJ3MgcGljayB0b3BpY3M=</PHRASE>
<PHRASE Label="lu_PleaseRegister" Module="In-Portal" Type="0">UGxlYXNlIFJlZ2lzdGVy</PHRASE>
<PHRASE Label="lu_pm_delete_confirm" Module="In-Portal" Type="0">QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGlzIHByaXZhdGUgbWVzc2FnZT8=</PHRASE>
<PHRASE Label="lu_pm_list" Module="In-Portal" Type="0">UHJpdmF0ZSBNZXNzYWdlcw==</PHRASE>
<PHRASE Label="lu_pm_list_description" Module="In-Portal" Type="0">UHJpdmF0ZSBNZXNzYWdlcw==</PHRASE>
<PHRASE Label="lu_Pop" Module="In-Portal" Type="0">UG9wdWxhcg==</PHRASE>
<PHRASE Label="lu_pop_links" Module="In-Portal" Type="0">TW9zdCBQb3B1bGFyIExpbmtz</PHRASE>
<PHRASE Label="lu_post" Module="In-Portal" Type="0">UG9zdA==</PHRASE>
<PHRASE Label="lu_posted" Module="In-Portal" Type="0">UG9zdGVk</PHRASE>
<PHRASE Label="lu_poster" Module="In-Portal" Type="0">UG9zdGVy</PHRASE>
<PHRASE Label="lu_posts" Module="In-Portal" Type="0">cG9zdHM=</PHRASE>
<PHRASE Label="lu_posts_updated" Module="In-Portal" Type="0">cG9zdHMgdXBkYXRlZA==</PHRASE>
<PHRASE Label="lu_PoweredBy" Module="In-Portal" Type="0">UG93ZXJlZCBieQ==</PHRASE>
<PHRASE Label="lu_pp_city" Module="In-Portal" Type="0">Q2l0eQ==</PHRASE>
<PHRASE Label="lu_pp_company" Module="In-Portal" Type="0">Q29tcGFueQ==</PHRASE>
<PHRASE Label="lu_pp_country" Module="In-Portal" Type="0">Q291bnRyeQ==</PHRASE>
<PHRASE Label="lu_pp_dob" Module="In-Portal" Type="0">QmlydGhkYXRl</PHRASE>
<PHRASE Label="lu_pp_email" Module="In-Portal" Type="0">RS1tYWls</PHRASE>
<PHRASE Label="lu_pp_fax" Module="In-Portal" Type="0">RmF4</PHRASE>
<PHRASE Label="lu_pp_firstname" Module="In-Portal" Type="0">Rmlyc3QgTmFtZQ==</PHRASE>
<PHRASE Label="lu_pp_lastname" Module="In-Portal" Type="0">TGFzdCBOYW1l</PHRASE>
<PHRASE Label="lu_pp_phone" Module="In-Portal" Type="0">UGhvbmU=</PHRASE>
<PHRASE Label="lu_pp_state" Module="In-Portal" Type="0">U3RhdGU=</PHRASE>
<PHRASE Label="lu_pp_street" Module="In-Portal" Type="0">U3RyZWV0</PHRASE>
<PHRASE Label="lu_pp_street2" Module="In-Portal" Type="0">U3RyZWV0IDI=</PHRASE>
<PHRASE Label="lu_pp_zip" Module="In-Portal" Type="0">Wmlw</PHRASE>
<PHRASE Label="lu_privacy" Module="In-Portal" Type="0">UHJpdmFjeQ==</PHRASE>
<PHRASE Label="lu_privatemessages_updated" Module="In-Portal" Type="0">UHJpdmF0ZSBtZXNzYWdlcyB1cGRhdGVk</PHRASE>
<PHRASE Label="lu_private_messages" Module="In-Portal" Type="0">UHJpdmF0ZSBNZXNzYWdlcw==</PHRASE>
<PHRASE Label="lu_profile" Module="In-Portal" Type="0">UHJvZmlsZQ==</PHRASE>
<PHRASE Label="lu_profile_field" Module="In-Portal" Type="0">UHJvZmlsZQ==</PHRASE>
<PHRASE Label="lu_profile_updated" Module="In-Portal" Type="0">cHJvZmlsZSB1cGRhdGVk</PHRASE>
<PHRASE Label="lu_prompt_avatar" Module="In-Portal" Type="0">QXZhdGFyIEltYWdl</PHRASE>
<PHRASE Label="lu_prompt_catdesc" Module="In-Portal" Type="0">RGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="lu_prompt_catname" Module="In-Portal" Type="0">Q2F0ZWdvcnkgTmFtZQ==</PHRASE>
<PHRASE Label="lu_prompt_email" Module="In-Portal" Type="0">RW1haWw=</PHRASE>
<PHRASE Label="lu_prompt_fullimage" Module="In-Portal" Type="0">RnVsbC1TaXplIEltYWdlOg==</PHRASE>
<PHRASE Label="lu_prompt_linkdesc" Module="In-Portal" Type="0">RGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="lu_prompt_linkname" Module="In-Portal" Type="0">TGluayBOYW1l</PHRASE>
<PHRASE Label="lu_prompt_linkurl" Module="In-Portal" Type="0">VVJM</PHRASE>
<PHRASE Label="lu_prompt_metadesc" Module="In-Portal" Type="0">TWV0YSBUYWcgRGVzY3JpcHRpb24=</PHRASE>
<PHRASE Label="lu_prompt_metakeywords" Module="In-Portal" Type="0">TWV0YSBUYWcgS2V5d29yZHM=</PHRASE>
<PHRASE Label="lu_prompt_password" Module="In-Portal" Type="0">UGFzc3dvcmQ=</PHRASE>
<PHRASE Label="lu_prompt_perpage_posts" Module="In-Portal" Type="0">UG9zdHMgUGVyIFBhZ2U=</PHRASE>
<PHRASE Label="lu_prompt_perpage_topics" Module="In-Portal" Type="0">VG9waWNzIFBlciBQYWdl</PHRASE>
<PHRASE Label="lu_prompt_post_subject" Module="In-Portal" Type="0">UG9zdCBTdWJqZWN0</PHRASE>
<PHRASE Label="lu_prompt_recommend" Module="In-Portal" Type="0">UmVjb21tZW5kIHRoaXMgc2l0ZSB0byBhIGZyaWVuZA==</PHRASE>
<PHRASE Label="lu_prompt_review" Module="In-Portal" Type="0">UmV2aWV3Og==</PHRASE>
<PHRASE Label="lu_prompt_signature" Module="In-Portal" Type="0">U2lnbmF0dXJl</PHRASE>
<PHRASE Label="lu_prompt_subscribe" Module="In-Portal" Type="0">RW50ZXIgeW91ciBlLW1haWwgYWRkcmVzcyB0byBzdWJzY3JpYmUgdG8gdGhlIG1haWxpbmcgbGlzdC4=</PHRASE>
<PHRASE Label="lu_prompt_thumbnail" Module="In-Portal" Type="0">VGh1bWJuYWlsIEltYWdlOg==</PHRASE>
<PHRASE Label="lu_prompt_username" Module="In-Portal" Type="0">VXNlcm5hbWU=</PHRASE>
<PHRASE Label="lu_public_display" Module="In-Portal" Type="0">RGlzcGxheSB0byBQdWJsaWM=</PHRASE>
<PHRASE Label="lu_query_string" Module="In-Portal" Type="1">UXVlcnkgU3RyaW5n</PHRASE>
<PHRASE Label="lu_QuickSearch" Module="In-Portal" Type="0">UXVpY2sgU2VhcmNo</PHRASE>
<PHRASE Label="lu_quick_links" Module="In-Portal" Type="0">UXVpY2sgTGlua3M=</PHRASE>
<PHRASE Label="lu_quote_reply" Module="In-Portal" Type="0">UmVwbHkgUXVvdGVk</PHRASE>
<PHRASE Label="lu_rateit" Module="In-Portal" Type="0">UmF0ZSBUaGlzIExpbms=</PHRASE>
<PHRASE Label="lu_rate_access_denied" Module="In-Portal" Type="0">VW5hYmxlIHRvIHJhdGUsIGFjY2VzcyBkZW5pZWQ=</PHRASE>
<PHRASE Label="lu_rate_article" Module="In-Portal" Type="0">UmF0ZSB0aGlzIGFydGljbGU=</PHRASE>
<PHRASE Label="lu_rate_link" Module="In-Portal" Type="0">UmF0ZSBMaW5r</PHRASE>
<PHRASE Label="lu_rate_news" Module="In-Portal" Type="0">UmF0ZSBBcnRpY2xl</PHRASE>
<PHRASE Label="lu_rate_this_article" Module="In-Portal" Type="0">UmF0ZSB0aGlzIGFydGljbGU=</PHRASE>
<PHRASE Label="lu_rate_topic" Module="In-Portal" Type="0">UmF0ZSBUb3BpYw==</PHRASE>
<PHRASE Label="lu_rating" Module="In-Portal" Type="0">UmF0aW5n</PHRASE>
<PHRASE Label="lu_rating_0" Module="In-Portal" Type="0">UG9vcg==</PHRASE>
<PHRASE Label="lu_rating_1" Module="In-Portal" Type="0">RmFpcg==</PHRASE>
<PHRASE Label="lu_rating_2" Module="In-Portal" Type="0">QXZlcmFnZQ==</PHRASE>
<PHRASE Label="lu_rating_3" Module="In-Portal" Type="0">R29vZA==</PHRASE>
<PHRASE Label="lu_rating_4" Module="In-Portal" Type="0">VmVyeSBHb29k</PHRASE>
<PHRASE Label="lu_rating_5" Module="In-Portal" Type="0">RXhjZWxsZW50</PHRASE>
<PHRASE Label="lu_rating_alreadyvoted" Module="In-Portal" Type="0">QWxyZWFkeSB2b3RlZA==</PHRASE>
<PHRASE Label="lu_read_error" Module="In-Portal" Type="0">VW5hYmxlIHRvIHJlYWQgZnJvbSBmaWxl</PHRASE>
<PHRASE Label="lu_recipent_required" Module="In-Portal" Type="0">VGhlIHJlY2lwaWVudCBpcyByZXF1aXJlZA==</PHRASE>
<PHRASE Label="lu_recipient_doesnt_exist" Module="In-Portal" Type="0">VXNlciBkb2VzIG5vdCBleGlzdA==</PHRASE>
<PHRASE Label="lu_recipient_doesnt_exit" Module="In-Portal" Type="0">VGhlIHJlY2lwaWVudCBkb2VzIG5vdCBleGlzdA==</PHRASE>
<PHRASE Label="lu_recommend" Module="In-Portal" Type="0">UmVjb21tZW5k</PHRASE>
<PHRASE Label="lu_RecommendToFriend" Module="In-Portal" Type="0">UmVjb21tZW5kIHRvIGEgRnJpZW5k</PHRASE>
<PHRASE Label="lu_recommend_confirm" Module="In-Portal" Type="0">UmVjb21tZW5kYXRpb24gQ29uZmlybWF0aW9u</PHRASE>
<PHRASE Label="lu_recommend_confirm_text" Module="In-Portal" Type="0">VGhhbmtzIGZvciByZWNvbW1lbmRpbmcgb3VyIHNpdGUgdG8geW91ciBmcmllbmQuIFRoZSBlbWFpbCBoYXMgYmVlbiBzZW50IG91dC4=</PHRASE>
<PHRASE Label="lu_recommend_title" Module="In-Portal" Type="0">UmVjb21tZW5kIHRvIGEgZnJpZW5k</PHRASE>
<PHRASE Label="lu_redirecting_text" Module="In-Portal" Type="0">Q2xpY2sgaGVyZSBpZiB5b3VyIGJyb3dzZXIgZG9lcyBub3QgYXV0b21hdGljYWxseSByZWRpcmVjdCB5b3Uu</PHRASE>
<PHRASE Label="lu_redirecting_title" Module="In-Portal" Type="0">UmVkaXJlY3RpbmcgLi4u</PHRASE>
<PHRASE Label="lu_register" Module="In-Portal" Type="0">UmVnaXN0ZXI=</PHRASE>
<PHRASE Label="lu_RegisterConfirm" Module="In-Portal" Type="0">UmVnaXN0cmF0aW9uIENvbmZpcm1hdGlvbg==</PHRASE>
<PHRASE Label="lu_register_confirm" Module="In-Portal" Type="0">UmVnaXN0cmF0aW9uIENvbXBsZXRl</PHRASE>
<PHRASE Label="lu_register_confirm_text" Module="In-Portal" Type="0">VGhhbmsgeW91IGZvciBSZWdpc3RlcmluZyEgIFBsZWFzZSBlbnRlciB5b3VyIHVzZXJuYW1lIGFuZCBwYXNzd29yZCBiZWxvdw==</PHRASE>
<PHRASE Label="lu_register_text" Module="In-Portal" Type="2">UmVnaXN0ZXIgd2l0aCBJbi1Qb3J0YWwgZm9yIGNvbnZlbmllbnQgYWNjZXNzIHRvIHVzZXIgYWNjb3VudCBzZXR0aW5ncyBhbmQgcHJlZmVyZW5jZXMu</PHRASE>
<PHRASE Label="lu_RegistrationCompleted" Module="In-Portal" Type="0">VGhhbmsgWW91LiBSZWdpc3RyYXRpb24gY29tcGxldGVkLg==</PHRASE>
<PHRASE Label="lu_related_articles" Module="In-Portal" Type="0">UmVsYXRlZCBhcnRpY2xlcw==</PHRASE>
<PHRASE Label="lu_related_categories" Module="In-Portal" Type="0">UmVsYXRlZCBDYXRlZ29yaWVz</PHRASE>
<PHRASE Label="lu_related_cats" Module="In-Portal" Type="0">UmVsYXRlZCBDYXRlZ29yaWVz</PHRASE>
<PHRASE Label="lu_related_links" Module="In-Portal" Type="0">UmVsYXRlZCBMaW5rcw==</PHRASE>
<PHRASE Label="lu_related_news" Module="In-Portal" Type="0">UmVsYXRlZCBOZXdz</PHRASE>
<PHRASE Label="lu_remember_login" Module="In-Portal" Type="0">UmVtZW1iZXIgTG9naW4=</PHRASE>
<PHRASE Label="lu_remove" Module="In-Portal" Type="0">UmVtb3Zl</PHRASE>
<PHRASE Label="lu_remove_from_favorites" Module="In-Portal" Type="0">UmVtb3ZlIEZyb20gRmF2b3JpdGVz</PHRASE>
<PHRASE Label="lu_repeat_password" Module="In-Portal" Type="0">UmVwZWF0IFBhc3N3b3Jk</PHRASE>
<PHRASE Label="lu_replies" Module="In-Portal" Type="0">UmVwbGllcw==</PHRASE>
<PHRASE Label="lu_reply" Module="In-Portal" Type="0">UmVwbHk=</PHRASE>
<PHRASE Label="lu_required_field" Module="In-Portal" Type="0">UmVxdWlyZWQgRmllbGQ=</PHRASE>
<PHRASE Label="lu_reset" Module="In-Portal" Type="0">UmVzZXQ=</PHRASE>
<PHRASE Label="lu_resetpw_confirm_text" Module="In-Portal" Type="0">QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIHJlc2V0IHRoZSBwYXNzd29yZD8=</PHRASE>
<PHRASE Label="lu_reset_confirm_text" Module="In-Portal" Type="0">UGxlYXNlIGNvbmZpcm0gdGhhdCB5b3Ugd2FudCB0byByZXNldCB5b3VyIHBhc3N3b3JkLg==</PHRASE>
<PHRASE Label="lu_reviews" Module="In-Portal" Type="0">UmV2aWV3cw==</PHRASE>
<PHRASE Label="lu_reviews_updated" Module="In-Portal" Type="0">cmV2aWV3cyB1cGRhdGVk</PHRASE>
<PHRASE Label="lu_review_access_denied" Module="In-Portal" Type="0">VW5hYmxlIHRvIHJldmlldywgYWNjZXNzIGRlbmllZA==</PHRASE>
<PHRASE Label="lu_review_article" Module="In-Portal" Type="0">UmV2aWV3IGFydGljbGU=</PHRASE>
<PHRASE Label="lu_review_link" Module="In-Portal" Type="0">UmV2aWV3IExpbms=</PHRASE>
<PHRASE Label="lu_review_news" Module="In-Portal" Type="0">UmV2aWV3IG5ld3MgYXJ0aWNsZQ==</PHRASE>
<PHRASE Label="lu_review_this_article" Module="In-Portal" Type="0">UmV2aWV3IHRoaXMgYXJ0aWNsZQ==</PHRASE>
<PHRASE Label="lu_rootcategory_name" Module="In-Portal" Type="0">SG9tZQ==</PHRASE>
<PHRASE Label="lu_search" Module="In-Portal" Type="0">U2VhcmNo</PHRASE>
<PHRASE Label="lu_searched_for" Module="In-Portal" Type="0">U2VhcmNoZWQgRm9yOg==</PHRASE>
<PHRASE Label="lu_SearchProducts" Module="In-Portal" Type="0">U2VhcmNoIFByb2R1Y3Rz</PHRASE>
<PHRASE Label="lu_searchtitle_article" Module="In-Portal" Type="0">U2VhcmNoIEFydGljbGVz</PHRASE>
<PHRASE Label="lu_searchtitle_category" Module="In-Portal" Type="0">U2VhcmNoIENhdGVnb3JpZXM=</PHRASE>
<PHRASE Label="lu_searchtitle_link" Module="In-Portal" Type="0">U2VhcmNoIExpbmtz</PHRASE>
<PHRASE Label="lu_searchtitle_topic" Module="In-Portal" Type="0">U2VhcmNoIFRvcGljcw==</PHRASE>
<PHRASE Label="lu_search_again" Module="In-Portal" Type="0">U2VhcmNoIEFnYWlu</PHRASE>
<PHRASE Label="lu_search_error" Module="In-Portal" Type="0">Rm9ybSBFcnJvcg==</PHRASE>
<PHRASE Label="lu_search_results" Module="In-Portal" Type="0">U2VhcmNoIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_search_tips_link" Module="In-Portal" Type="0">U2VhcmNoIFRpcHM=</PHRASE>
<PHRASE Label="lu_search_type" Module="In-Portal" Type="0">U2VhcmNoIFR5cGU=</PHRASE>
<PHRASE Label="lu_search_within" Module="In-Portal" Type="0">U2VhcmNoIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_see_also" Module="In-Portal" Type="0">U2VlIEFsc28=</PHRASE>
<PHRASE Label="lu_select_language" Module="In-Portal" Type="0">U2VsZWN0IExhbmd1YWdl</PHRASE>
<PHRASE Label="lu_select_theme" Module="In-Portal" Type="0">U2VsZWN0IFRoZW1l</PHRASE>
<PHRASE Label="lu_select_username" Module="In-Portal" Type="0">U2VsZWN0IFVzZXJuYW1l</PHRASE>
<PHRASE Label="lu_send" Module="In-Portal" Type="0">U2VuZA==</PHRASE>
<PHRASE Label="lu_send_pm" Module="In-Portal" Type="0">U2VuZCBQcml2YXRlIE1lc3NhZ2U=</PHRASE>
<PHRASE Label="lu_sent" Module="In-Portal" Type="0">U2VudA==</PHRASE>
<PHRASE Label="lu_Sep" Module="In-Portal" Type="0">U2Vw</PHRASE>
<PHRASE Label="lu_ShoppingCart" Module="In-Portal" Type="0">U2hvcHBpbmcgQ2FydA==</PHRASE>
<PHRASE Label="lu_show" Module="In-Portal" Type="0">U2hvdw==</PHRASE>
<PHRASE Label="lu_show_signature" Module="In-Portal" Type="0">U2hvdyBTaWduYXR1cmU=</PHRASE>
<PHRASE Label="lu_show_user_signatures" Module="In-Portal" Type="0">U2hvdyBNeSBTaWduYXR1cmU=</PHRASE>
<PHRASE Label="lu_SiteLead_Story" Module="In-Portal" Type="0">U2l0ZSBMZWFkIFN0b3J5</PHRASE>
<PHRASE Label="lu_site_map" Module="In-Portal" Type="0">U2l0ZSBNYXA=</PHRASE>
<PHRASE Label="lu_smileys" Module="In-Portal" Type="0">U21pbGV5cw==</PHRASE>
<PHRASE Label="lu_sorted_list" Module="In-Portal" Type="0">U29ydGVkIGxpc3Q=</PHRASE>
<PHRASE Label="lu_sort_by" Module="In-Portal" Type="0">U29ydA==</PHRASE>
<PHRASE Label="lu_state" Module="In-Portal" Type="0">U3RhdGU=</PHRASE>
<PHRASE Label="lu_street" Module="In-Portal" Type="0">U3RyZWV0</PHRASE>
<PHRASE Label="lu_street2" Module="In-Portal" Type="0">U3RyZWV0IDI=</PHRASE>
<PHRASE Label="lu_subaction_prompt" Module="In-Portal" Type="0">QWxzbyBZb3UgQ2FuOg==</PHRASE>
<PHRASE Label="lu_subcats" Module="In-Portal" Type="0">U3ViY2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="lu_subject" Module="In-Portal" Type="0">U3ViamVjdA==</PHRASE>
<PHRASE Label="lu_submitting_to" Module="In-Portal" Type="0">U3VibWl0dGluZyB0bw==</PHRASE>
<PHRASE Label="lu_subscribe_banned" Module="In-Portal" Type="0">U3Vic2NyaXB0aW9uIGRlbmllZA==</PHRASE>
<PHRASE Label="lu_subscribe_confirm" Module="In-Portal" Type="0">U3Vic2NyaXB0aW9uIENvbmZpcm1hdGlvbg==</PHRASE>
<PHRASE Label="lu_subscribe_confirm_prompt" Module="In-Portal" Type="0">QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIHN1YnNjcmliZSB0byBvdXIgbWFpbGluZyBsaXN0PyAoWW91IGNhbiB1bnN1YnNjcmliZSBhbnkgdGltZSBieSBlbnRlcmluZyB5b3VyIGVtYWlsIG9uIHRoZSBmcm9udCBwYWdlKS4=</PHRASE>
<PHRASE Label="lu_subscribe_confirm_text" Module="In-Portal" Type="0">VGhhbmsgeW91IGZvciBzdWJzY3JpYmluZyB0byBvdXIgbWFpbGluZyBsaXN0IQ==</PHRASE>
<PHRASE Label="lu_subscribe_error" Module="In-Portal" Type="0">Rm9ybSBFcnJvcg==</PHRASE>
<PHRASE Label="lu_subscribe_missing_address" Module="In-Portal" Type="0">TWlzc2luZyBlbWFpbCBhZGRyZXNz</PHRASE>
<PHRASE Label="lu_subscribe_no_address" Module="In-Portal" Type="0">RS1tYWlsIGFkZHJlc3MgbWlzc2luZyBvciBpbnZhbGlk</PHRASE>
<PHRASE Label="lu_subscribe_success" Module="In-Portal" Type="0">U3Vic2NyaXB0aW9uIHN1Y2Nlc3NmdWw=</PHRASE>
<PHRASE Label="lu_subscribe_title" Module="In-Portal" Type="0">U3Vic2NyaWJlZA==</PHRASE>
<PHRASE Label="lu_subscribe_unknown_error" Module="In-Portal" Type="0">VW5kZWZpbmVkIGVycm9yIG9jY3VycmVkLCBzdWJzY3JpcHRpb24gbm90IGNvbXBsZXRlZA==</PHRASE>
<PHRASE Label="lu_suggest_category" Module="In-Portal" Type="0">U3VnZ2VzdCBDYXRlZ29yeQ==</PHRASE>
<PHRASE Label="lu_suggest_category_pending" Module="In-Portal" Type="0">Q2F0ZWdvcnkgU3VnZ2VzdGVkIChQZW5kaW5nIEFwcHJvdmFsKQ==</PHRASE>
<PHRASE Label="lu_suggest_error" Module="In-Portal" Type="0">Rm9ybSBFcnJvcg==</PHRASE>
<PHRASE Label="lu_suggest_link" Module="In-Portal" Type="0">U3VnZ2VzdCBMaW5r</PHRASE>
<PHRASE Label="lu_suggest_no_address" Module="In-Portal" Type="0">RS1tYWlsIGFkZHJlc3MgbWlzc2luZyBvciBpbnZhbGlk</PHRASE>
<PHRASE Label="lu_suggest_success" Module="In-Portal" Type="0">VGhhbmsgeW91IGZvciBzdWdnZXN0aW5nIG91ciBzaXRlIHRv</PHRASE>
<PHRASE Label="lu_template_error" Module="In-Portal" Type="0">VGVtcGxhdGUgRXJyb3I=</PHRASE>
<PHRASE Label="lu_TextUnsubscribe" Module="In-Portal" Type="0">IFdlIGFyZSBzb3JyeSB5b3UgaGF2ZSB1bnN1YnNjcmliZWQgZnJvbSBvdXIgbWFpbGluZyBsaXN0</PHRASE>
<PHRASE Label="lu_text_keyword" Module="In-Portal" Type="0">S2V5d29yZA==</PHRASE>
<PHRASE Label="lu_text_PasswordRequestConfirm" Module="In-Portal" Type="0">UGxlYXNlIGNvbmZpcm0gdGhhdCB5b3Ugd2FudCB0byByZXNldCB5b3VyIHBhc3N3b3JkLg==</PHRASE>
<PHRASE Label="lu_ThankForSubscribing" Module="In-Portal" Type="0">VGhhbmsgeW91IGZvciBzdWJzY3JpYmluZyB0byBvdXIgbWFpbGluZyBsaXN0</PHRASE>
<PHRASE Label="lu_title_confirm" Module="In-Portal" Type="0">Q29uZmlybWF0aW9u</PHRASE>
<PHRASE Label="lu_title_mailinglist" Module="In-Portal" Type="0">TWFpbGluZyBMaXN0</PHRASE>
<PHRASE Label="lu_title_PasswordRequestConfirm" Module="In-Portal" Type="0">UGFzc3dvcmQgUmVxdWVzdCBDb25maXJtYXRpb24=</PHRASE>
<PHRASE Label="lu_to" Module="In-Portal" Type="0">VG8=</PHRASE>
<PHRASE Label="lu_top" Module="In-Portal" Type="0">VG9wIFJhdGVk</PHRASE>
<PHRASE Label="lu_topics" Module="In-Portal" Type="0">VG9waWNz</PHRASE>
<PHRASE Label="lu_topics_updated" Module="In-Portal" Type="0">VG9waWNzIFVwZGF0ZWQ=</PHRASE>
<PHRASE Label="lu_topic_rate_confirm" Module="In-Portal" Type="0">VG9waWMgUmF0aW5nIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_topic_rate_confirm_duplicate_text" Module="In-Portal" Type="0">WW91IGhhdmUgYWxyZWFkeSByYXRlZCB0aGlzIHRvcGlj</PHRASE>
<PHRASE Label="lu_topic_rate_confirm_text" Module="In-Portal" Type="0">VGhhbmsgeW91IGZvciB2b3RpbmchICBZb3VyIGlucHV0IGhhcyBiZWVuIHJlY29yZGVkLg==</PHRASE>
<PHRASE Label="lu_topic_reply" Module="In-Portal" Type="0">UG9zdCBSZXBseQ==</PHRASE>
<PHRASE Label="lu_topic_search_results" Module="In-Portal" Type="0">VG9waWMgU2VhcmNoIFJlc3VsdHM=</PHRASE>
<PHRASE Label="lu_topic_updated" Module="In-Portal" Type="0">VG9waWMgVXBkYXRlZA==</PHRASE>
<PHRASE Label="lu_top_rated" Module="In-Portal" Type="0">VG9wIFJhdGVkIExpbmtz</PHRASE>
<PHRASE Label="lu_total_categories" Module="In-Portal" Type="0">VG90YWwgQ2F0ZWdvcmllcw==</PHRASE>
<PHRASE Label="lu_total_links" Module="In-Portal" Type="0">VG90YWwgbGlua3MgaW4gdGhlIGRhdGFiYXNl</PHRASE>
<PHRASE Label="lu_total_news" Module="In-Portal" Type="0">VG90YWwgQXJ0aWNsZXM=</PHRASE>
<PHRASE Label="lu_total_topics" Module="In-Portal" Type="0">VG90YWwgVG9waWNz</PHRASE>
<PHRASE Label="lu_true" Module="In-Portal" Type="0">VHJ1ZQ==</PHRASE>
<PHRASE Label="lu_unknown_error" Module="In-Portal" Type="0">U3lzdGVtIGVycm9yIGhhcyBvY2N1cmVk</PHRASE>
<PHRASE Label="lu_unsorted_list" Module="In-Portal" Type="0">VW5zb3J0ZWQgbGlzdA==</PHRASE>
<PHRASE Label="lu_unsubscribe_confirm" Module="In-Portal" Type="0">VW5zdWJzY3JpcHRpb24gQ29uZmlybWF0aW9u</PHRASE>
<PHRASE Label="lu_unsubscribe_confirm_prompt" Module="In-Portal" Type="0">QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIHVuc3Vic2NyaWJlIGZyb20gb3VyIG1haWxpbmcgbGlzdD8gKFlvdSBjYW4gYWx3YXlzIHN1YnNjcmliZSBhZ2FpbiBieSBlbnRlcmluZyB5b3VyIGVtYWlsIGF0IHRoZSBob21lIHBhZ2Up</PHRASE>
<PHRASE Label="lu_unsubscribe_confirm_text" Module="In-Portal" Type="0">V2UgYXJlIHNvcnJ5IHlvdSBoYXZlIHVuc3Vic2NyaWJlZCBmcm9tIG91ciBtYWlsaW5nIGxpc3Q=</PHRASE>
<PHRASE Label="lu_unsubscribe_title" Module="In-Portal" Type="0">VW5zdWJzY3JpYmU=</PHRASE>
<PHRASE Label="lu_update" Module="In-Portal" Type="0">VXBkYXRl</PHRASE>
<PHRASE Label="lu_username" Module="In-Portal" Type="0">VXNlcm5hbWU=</PHRASE>
<PHRASE Label="lu_users_online" Module="In-Portal" Type="0">VXNlcnMgT25saW5l</PHRASE>
<PHRASE Label="lu_user_already_exist" Module="In-Portal" Type="0">QSB1c2VyIHdpdGggc3VjaCB1c2VybmFtZSBhbHJlYWR5IGV4aXN0cy4=</PHRASE>
<PHRASE Label="lu_user_and_email_already_exist" Module="In-Portal" Type="0">QSB1c2VyIHdpdGggc3VjaCB1c2VybmFtZS9lLW1haWwgYWxyZWFkeSBleGlzdHMu</PHRASE>
<PHRASE Label="lu_user_exists" Module="In-Portal" Type="0">VXNlciBhbHJlYWR5IGV4aXN0cw==</PHRASE>
<PHRASE Label="lu_user_pending_aproval" Module="In-Portal" Type="0">UGVuZGluZyBSZWdpc3RyYXRpb24gQ29tcGxldGU=</PHRASE>
<PHRASE Label="lu_user_pending_aproval_text" Module="In-Portal" Type="0">VGhhbmsgeW91IGZvciByZWdpc3RlcmluZy4gWW91ciByZWdpc3RyYXRpb24gaXMgcGVuZGluZyBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbC4=</PHRASE>
<PHRASE Label="lu_VerifyPassword" Module="In-Portal" Type="0">VmVyaWZ5IHBhc3N3b3Jk</PHRASE>
<PHRASE Label="lu_views" Module="In-Portal" Type="0">Vmlld3M=</PHRASE>
<PHRASE Label="lu_view_flat" Module="In-Portal" Type="0">VmlldyBGbGF0</PHRASE>
<PHRASE Label="lu_view_pm" Module="In-Portal" Type="0">VmlldyBQTQ==</PHRASE>
<PHRASE Label="lu_view_profile" Module="In-Portal" Type="0">VmlldyBVc2VyIFByb2ZpbGU=</PHRASE>
<PHRASE Label="lu_view_threaded" Module="In-Portal" Type="0">VmlldyBUaHJlYWRlZA==</PHRASE>
<PHRASE Label="lu_view_your_profile" Module="In-Portal" Type="0">VmlldyBZb3VyIFByb2ZpbGU=</PHRASE>
<PHRASE Label="lu_visit_DirectReferer" Module="In-Portal" Type="0">RGlyZWN0IGFjY2VzcyBvciBib29rbWFyaw==</PHRASE>
<PHRASE Label="lu_votes" Module="In-Portal" Type="0">Vm90ZXM=</PHRASE>
<PHRASE Label="lu_Warning" Module="In-Portal" Type="0">V2FybmluZw==</PHRASE>
<PHRASE Label="lu_WeAcceptCards" Module="In-Portal" Type="0">V2UgYWNjZXB0IGNyZWRpdCBjYXJkcw==</PHRASE>
<PHRASE Label="lu_wrote" Module="In-Portal" Type="0">d3JvdGU=</PHRASE>
<PHRASE Label="lu_yes" Module="In-Portal" Type="0">WWVz</PHRASE>
<PHRASE Label="lu_YourAccount" Module="In-Portal" Type="0">WW91ciBBY2NvdW50</PHRASE>
<PHRASE Label="lu_YourCart" Module="In-Portal" Type="0">U2hvcHBpbmcgQ2FydA==</PHRASE>
<PHRASE Label="lu_YourCurrency" Module="In-Portal" Type="0">WW91ciBjdXJyZW5jeQ==</PHRASE>
<PHRASE Label="lu_YourLanguage" Module="In-Portal" Type="0">WW91ciBMYW5ndWFnZQ==</PHRASE>
<PHRASE Label="lu_YourWishList" Module="In-Portal" Type="0">WW91ciBXaXNoIExpc3Q=</PHRASE>
<PHRASE Label="lu_zip" Module="In-Portal" Type="0">Wmlw</PHRASE>
<PHRASE Label="lu_ZipCode" Module="In-Portal" Type="0">WklQIENvZGU=</PHRASE>
<PHRASE Label="lu_zip_code" Module="In-Portal" Type="0">WklQIENvZGU=</PHRASE>
<PHRASE Label="lu_zoom" Module="In-Portal" Type="0">Wm9vbQ==</PHRASE>
<PHRASE Label="my_account_title" Module="In-Portal" Type="0">TXkgU2V0dGluZ3M=</PHRASE>
<PHRASE Label="Next Theme" Module="In-Portal" Type="0">TmV4dCBUaGVtZQ==</PHRASE>
<PHRASE Label="Previous Theme" Module="In-Portal" Type="0">UHJldmlvdXMgVGhlbWU=</PHRASE>
<PHRASE Label="test 1" Module="In-Portal" Type="0">dGVzdCAy</PHRASE>
</PHRASES>
<EVENTS>
<EVENT MessageType="text" Event="CATEGORY.ADD" Type="0">U3ViamVjdDogQ2F0ZWdvcnkgYWRkZWQKCllvdXIgc3VnZ2VzdGVkIGNhdGVnb3J5ICI8aW5wOm1fY2F0ZWdvcnlfZmllbGQgX0ZpZWxkPSJOYW1lIiBfU3RyaXBIVE1MPSIxIi8+IiBoYXMgYmVlbiBhZGRlZC4=</EVENT>
<EVENT MessageType="text" Event="CATEGORY.ADD" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBhZGRlZAoKQSBjYXRlZ29yeSAiPGlucDptX2NhdGVnb3J5X2ZpZWxkIF9GaWVsZD0iTmFtZSIgX1N0cmlwSFRNTD0iMSIvPiIgaGFzIGJlZW4gYWRkZWQu</EVENT>
<EVENT MessageType="text" Event="CATEGORY.ADD.PENDING" Type="0"></EVENT>
<EVENT MessageType="text" Event="CATEGORY.ADD.PENDING" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQ2F0ZWdvcnkgYWRkZWQgKHBlbmRpbmcpCgpBIGNhdGVnb3J5ICI8aW5wOm1fY2F0ZWdvcnlfZmllbGQgX0ZpZWxkPSJOYW1lIiBfU3RyaXBIVE1MPSIxIi8+IiBoYXMgYmVlbiBhZGRlZCwgcGVuZGluZyB5b3VyIGNvbmZpcm1hdGlvbi4gIFBsZWFzZSByZXZpZXcgdGhlIGNhdGVnb3J5IGFuZCBhcHByb3ZlIG9yIGRlbnkgaXQu</EVENT>
<EVENT MessageType="text" Event="CATEGORY.APPROVE" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBhcHByb3ZlZAoKWW91ciBzdWdnZXN0ZWQgY2F0ZWdvcnkgIjxpbnA6bV9jYXRlZ29yeV9maWVsZCBfRmllbGQ9Ik5hbWUiIF9TdHJpcEhUTUw9IjEiLz4iIGhhcyBiZWVuIGFwcHJvdmVkLg==</EVENT>
<EVENT MessageType="text" Event="CATEGORY.APPROVE" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBhcHByb3ZlZAoKQSBjYXRlZ29yeSAiPGlucDptX2NhdGVnb3J5X2ZpZWxkIF9GaWVsZD0iTmFtZSIgX1N0cmlwSFRNTD0iMSIvPiIgaGFzIGJlZW4gYXBwcm92ZWQu</EVENT>
<EVENT MessageType="text" Event="CATEGORY.DELETE" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBkZWxldGVkCgpBIGNhdGVnb3J5ICI8aW5wOm1fY2F0ZWdvcnlfZmllbGQgX0ZpZWxkPSJOYW1lIiBfU3RyaXBIVE1MPSIxIi8+IiBoYXMgYmVlbiBkZWxldGVkLg==</EVENT>
<EVENT MessageType="text" Event="CATEGORY.DELETE" Type="1">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IEEgY2F0ZWdvcnkgaGFzIGJlZW4gZGVsZXRlZAoKQSBjYXRlZ29yeSAiPGlucDptX2NhdGVnb3J5X2ZpZWxkIF9GaWVsZD0iTmFtZSIgX1N0cmlwSFRNTD0iMSIvPiIgaGFzIGJlZW4gZGVsZXRlZC4=</EVENT>
<EVENT MessageType="text" Event="CATEGORY.DENY" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBkZW5pZWQKCllvdXIgY2F0ZWdvcnkgc3VnZ2VzdGlvbiAiPGlucDptX2NhdGVnb3J5X2ZpZWxkIF9GaWVsZD0iTmFtZSIgX1N0cmlwSFRNTD0iMSIvPiIgaGFzIGJlZW4gZGVuaWVkLg==</EVENT>
<EVENT MessageType="text" Event="CATEGORY.DENY" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBkZW5pZWQKCkEgY2F0ZWdvcnkgIjxpbnA6bV9jYXRlZ29yeV9maWVsZCBfRmllbGQ9Ik5hbWUiIF9TdHJpcEhUTUw9IjEiLz4iIGhhcyBiZWVuIGRlbmllZC4=</EVENT>
<EVENT MessageType="text" Event="CATEGORY.MODIFY" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBtb2RpZmllZAoKWW91ciBzdWdnZXN0ZWQgY2F0ZWdvcnkgIjxpbnA6bV9jYXRlZ29yeV9maWVsZCBfRmllbGQ9Ik5hbWUiIF9TdHJpcEhUTUw9IjEiLz4iIGhhcyBiZWVuIG1vZGlmaWVkLg==</EVENT>
<EVENT MessageType="text" Event="CATEGORY.MODIFY" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBtb2RpZmllZAoKQSBjYXRlZ29yeSAiPGlucDptX2NhdGVnb3J5X2ZpZWxkIF9GaWVsZD0iTmFtZSIgX1N0cmlwSFRNTD0iMSIvPiIgaGFzIGJlZW4gbW9kaWZpZWQu</EVENT>
<EVENT MessageType="html" Event="COMMON.FOOTER" Type="1">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IENvbW1vbiBGb290ZXIgVGVtcGxhdGUKCg==</EVENT>
<EVENT MessageType="text" Event="USER.ADD" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogSW4tcG9ydGFsIHJlZ2lzdHJhdGlvbgoKRGVhciA8aW5wOnRvdXNlciBfRmllbGQ9IkZpcnN0TmFtZSIgLz4gPGlucDp0b3VzZXIgX0ZpZWxkPSJMYXN0TmFtZSIgLz4sDQoNClRoYW5rIHlvdSBmb3IgcmVnaXN0ZXJpbmcgb24gPGlucDptX3BhZ2VfdGl0bGUgLz4uIFlvdXIgcmVnaXN0cmF0aW9uIGlzIG5vdyBhY3RpdmUu</EVENT>
<EVENT MessageType="text" Event="USER.ADD" Type="1">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IE5ldyB1c2VyIGhhcyBiZWVuIGFkZGVkCgpBIG5ldyB1c2VyICI8aW5wOnRvdXNlciBfRmllbGQ9IkxvZ2luIiAvPiIgaGFzIGJlZW4gYWRkZWQu</EVENT>
<EVENT MessageType="text" Event="USER.ADD.PENDING" Type="0">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IEluLVBvcnRhbCBSZWdpc3RyYXRpb24KCkRlYXIgPGlucDp0b3VzZXIgX0ZpZWxkPSJGaXJzdE5hbWUiIC8+IDxpbnA6dG91c2VyIF9GaWVsZD0iTGFzdE5hbWUiIC8+LA0KDQpUaGFuayB5b3UgZm9yIHJlZ2lzdGVyaW5nIG9uIDxpbnA6bV9wYWdlX3RpdGxlIC8+LiBZb3VyIHJlZ2lzdHJhdGlvbiB3aWxsIGJlIGFjdGl2ZSBhZnRlciBhcHByb3ZhbC4=</EVENT>
<EVENT MessageType="text" Event="USER.ADD.PENDING" Type="1">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IFVzZXIgcmVnaXN0ZXJlZAoKQSBuZXcgdXNlciAiPGlucDp0b3VzZXIgX0ZpZWxkPSJMb2dpbiIgLz4iIGhhcyByZWdpc3RlcmVkIGFuZCBpcyBwZW5kaW5nIGFkbWluaXN0cmF0aXZlIGFwcHJvdmFsLg==</EVENT>
<EVENT MessageType="text" Event="USER.APPROVE" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogWW91IGhhdmUgYmVlbiBhcHByb3ZlZAoKV2VsY29tZSB0byBJbi1wb3J0YWwhDQpZb3VyIHVzZXIgcmVnaXN0cmF0aW9uIGhhcyBiZWVuIGFwcHJvdmVkLiBZb3VyIHVzZXIgbmFtZSBpcyAiPGlucDp0b3VzZXIgX0ZpZWxkPSJVc2VyTmFtZSIgLz4iLg==</EVENT>
<EVENT MessageType="text" Event="USER.APPROVE" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVXNlciBhcHByb3ZlZAoKVXNlciAiPGlucDp0b3VzZXIgX0ZpZWxkPSJVc2VyTmFtZSIgLz4iIGhhcyBiZWVuIGFwcHJvdmVkLg==</EVENT>
<EVENT MessageType="text" Event="USER.DENY" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQWNjZXNzIGRlbmllZAoKWW91ciByZWdpc3RyYXRpb24gdG8gPGlucDptX3BhZ2VfdGl0bGUgLz4gaGFzIGJlZW4gZGVuaWVkLg==</EVENT>
<EVENT MessageType="text" Event="USER.DENY" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVXNlciBkZW5pZWQKClVzZXIgIjxpbnA6dG91c2VyIF9GaWVsZD0iVXNlck5hbWUiIC8+IiBoYXMgYmVlbiBkZW5pZWQu</EVENT>
<EVENT MessageType="text" Event="USER.MEMBERSHIP.EXPIRATION.NOTICE" Type="0">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IE1lbWJlcnNoaXAgZXhwaXJhdGlvbiBub3RpY2UKCk1lbWJlcnNoaXAgZXhwaXJhdGlvbiBub3RpY2U=</EVENT>
<EVENT MessageType="text" Event="USER.MEMBERSHIP.EXPIRATION.NOTICE" Type="1">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IE1lbWJlcnNoaXAgZXhwaXJhdGlvbiBub3RpY2UKCk1lbWJlcnNoaXAgZXhwaXJhdGlvbiBub3RpY2U=</EVENT>
<EVENT MessageType="text" Event="USER.MEMBERSHIP.EXPIRED" Type="0">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IE1lbWJlcnNoaXAgZXhwaXJlZAoKTWVtYmVyc2hpcCBleHBpcmVk</EVENT>
<EVENT MessageType="text" Event="USER.MEMBERSHIP.EXPIRED" Type="1">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IE1lbWJlcnNoaXAgZXhwaXJlZAoKTWVtYmVyc2hpcCBleHBpcmVk</EVENT>
<EVENT MessageType="text" Event="USER.PSWD" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTG9zdCBwYXNzd29yZAoKWW91ciBsb3N0IHBhc3N3b3JkIGhhcyBiZWVuIHJlc2V0LiBZb3VyIG5ldyBwYXNzd29yZCBpczogIjxpbnA6dG91c2VyIF9GaWVsZD0iUGFzc3dvcmQiIC8+Ii4=</EVENT>
<EVENT MessageType="text" Event="USER.PSWD" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTG9zdCBwYXNzd29yZAoKWW91ciBsb3N0IHBhc3N3b3JkIGhhcyBiZWVuIHJlc2V0LiBZb3VyIG5ldyBwYXNzd29yZCBpczogIjxpbnA6dG91c2VyIF9GaWVsZD0iUGFzc3dvcmQiIC8+Ii4=</EVENT>
<EVENT MessageType="text" Event="USER.PSWDC" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogUGFzc3dvcmQgcmVzZXQgY29uZmlybWF0aW9uCgpIZWxsbywNCg0KSXQgc2VlbXMgdGhhdCB5b3UgaGF2ZSByZXF1ZXN0ZWQgYSBwYXNzd29yZCByZXNldCBmb3IgeW91ciBJbi1wb3J0YWwgYWNjb3VudC4gSWYgeW91IHdvdWxkIGxpa2UgdG8gcHJvY2VlZCBhbmQgY2hhbmdlIHRoZSBwYXNzd29yZCwgcGxlYXNlIGNsaWNrIG9uIHRoZSBsaW5rIGJlbG93Og0KPGlucDptX2NvbmZpcm1fcGFzc3dvcmRfbGluayAvPg0KDQpZb3Ugd2lsbCByZWNlaXZlIGEgc2Vjb25kIGVtYWlsIHdpdGggeW91ciBuZXcgcGFzc3dvcmQgc2hvcnRseS4NCg0KSWYgeW91IGJlbGlldmUgeW91IGhhdmUgcmVjZWl2ZWQgdGhpcyBlbWFpbCBpbiBlcnJvciwgcGxlYXNlIGlnbm9yZSB0aGlzIGVtYWlsLiBZb3VyIHBhc3N3b3JkIHdpbGwgbm90IGJlIGNoYW5nZWQgdW5sZXNzIHlvdSBoYXZlIGNsaWNrZWQgb24gdGhlIGFib3ZlIGxpbmsuDQo=</EVENT>
<EVENT MessageType="text" Event="USER.SUBSCRIBE" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogU3Vic2NyaXB0aW9uIGNvbmZpcm1hdGlvbgoKWW91IGhhdmUgc3Vic2NyaWJlZCB0byA8aW5wOm1fcGFnZV90aXRsZSAvPiBtYWlsaW5nIGxpc3Qu</EVENT>
<EVENT MessageType="text" Event="USER.SUBSCRIBE" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSB1c2VyIGhhcyBzdWJzY3JpYmVkCgpBIHVzZXIgaGFzIHN1YnNjcmliZWQgdG8gPGlucDptX3BhZ2VfdGl0bGUgLz4gbWFpbGluZyBsaXN0Lg==</EVENT>
<EVENT MessageType="html" Event="USER.SUGGEST" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQ2hlY2sgb3V0IHRoaXMgc2l0ZQoKSGksDQoNClRoaXMgbWVzc2FnZSBoYXMgYmVlbiBzZW50IHRvIHlvdSBmcm9tIG9uZSBvZiB5b3VyIGZyaWVuZHMuDQpDaGVjayBvdXQgdGhpcyBzaXRlOiA8YSBocmVmPSI8aW5wOm1fdGhlbWVfdXJsIF9wYWdlPSJjdXJyZW50Ii8+Ij48aW5wOm1fcGFnZV90aXRsZSAvPjwvYT4h</EVENT>
<EVENT MessageType="text" Event="USER.SUGGEST" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVGhlIHNpdGUgaGFzIGJlZW4gc3VnZ2VzdGVkCgpBIHZpc2l0b3Igc3VnZ2VzdGVkIHlvdXIgc2l0ZSB0byBhIGZyaWVuZC4=</EVENT>
<EVENT MessageType="text" Event="USER.UNSUBSCRIBE" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogWW91IGhhdmUgYmVlbiB1bnN1YnNjcmliZWQKCllvdSBoYXZlIHN1Y2Nlc3NmdWxseSB1bnN1YnNyaWJlZCBmcm9tIDxpbnA6bV9wYWdlX3RpdGxlIC8+IG1haWxpbmcgbGlzdC4=</EVENT>
<EVENT MessageType="text" Event="USER.UNSUBSCRIBE" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVXNlciB1bnN1YnNyaWJlZAoKQSB1c2VyIGhhcyB1bnN1YnNjcmliZWQu</EVENT>
<EVENT MessageType="text" Event="USER.VALIDATE" Type="0">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogSW4tcG9ydGFsIHJlZ2lzdHJhdGlvbgoKV2VsY29tZSB0byBJbi1wb3J0YWwhDQpZb3VyIHVzZXIgcmVnaXN0cmF0aW9uIGhhcyBiZWVuIGFwcHJvdmVkLiBZb3VyIHVzZXIgbmFtZSBpcyAiPGlucDp0b3VzZXIgX0ZpZWxkPSJVc2VyTmFtZSIgLz4iIGFuZCB5b3VyIHBhc3N3b3JkIGlzICI8aW5wOnRvdXNlciBfRmllbGQ9InBhc3N3b3JkIiAvPiIuDQo=</EVENT>
<EVENT MessageType="text" Event="USER.VALIDATE" Type="1">WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVXNlciB2YWxpZGF0ZWQKClVzZXIgIjxpbnA6dG91c2VyIF9GaWVsZD0iVXNlck5hbWUiIC8+IiBoYXMgYmVlbiB2YWxpZGF0ZWQu</EVENT>
</EVENTS>
</LANGUAGE>
</LANGUAGES>
\ No newline at end of file
Property changes on: trunk/admin/install/langpacks/english.lang
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.97
\ No newline at end of property
+1.98
\ No newline at end of property
Index: trunk/admin/install/inportal_remove.sql
===================================================================
--- trunk/admin/install/inportal_remove.sql (revision 6427)
+++ trunk/admin/install/inportal_remove.sql (revision 6428)
@@ -1,210 +1,216 @@
DROP TABLE Addresses
# --------------------------------------------------------
DROP TABLE AffiliatePayments
# --------------------------------------------------------
DROP TABLE AffiliatePlans
# --------------------------------------------------------
DROP TABLE AffiliatePlansBrackets
# --------------------------------------------------------
DROP TABLE AffiliatePlansItems
# --------------------------------------------------------
DROP TABLE AffiliatePaymentTypes
# --------------------------------------------------------
DROP TABLE Affiliates
# --------------------------------------------------------
DROP TABLE Currencies
# --------------------------------------------------------
DROP TABLE GatewayConfigFields
# --------------------------------------------------------
DROP TABLE GatewayConfigValues
# --------------------------------------------------------
DROP TABLE Gateways
# --------------------------------------------------------
DROP TABLE Manufacturers
# --------------------------------------------------------
DROP TABLE OrderItems
# --------------------------------------------------------
DROP TABLE Orders
# --------------------------------------------------------
DROP TABLE PaymentTypeCurrencies
# --------------------------------------------------------
DROP TABLE PaymentTypes
# --------------------------------------------------------
DROP TABLE ProductFiles
# --------------------------------------------------------
DROP TABLE Products
# --------------------------------------------------------
DROP TABLE ProductsCouponItems
# --------------------------------------------------------
DROP TABLE ProductsCoupons
# --------------------------------------------------------
DROP TABLE ProductsDiscountItems
# --------------------------------------------------------
DROP TABLE ProductsDiscounts
# --------------------------------------------------------
DROP TABLE ProductsPricing
# --------------------------------------------------------
DROP TABLE ShippingBrackets
# --------------------------------------------------------
DROP TABLE ShippingCosts
# --------------------------------------------------------
DROP TABLE ShippingQuoteEngines
# --------------------------------------------------------
DROP TABLE ShippingType
# --------------------------------------------------------
DROP TABLE ShippingZones
# --------------------------------------------------------
DROP TABLE ShippingZonesDestinations
# --------------------------------------------------------
DROP TABLE TaxZones
# --------------------------------------------------------
DROP TABLE TaxZonesDestinations
# --------------------------------------------------------
DROP TABLE UserDownloads
# --------------------------------------------------------
DROP TABLE UserFileAccess
# --------------------------------------------------------
DROP TABLE Censorship
# --------------------------------------------------------
DROP TABLE Emoticon
# --------------------------------------------------------
DROP TABLE Topic
# --------------------------------------------------------
DROP TABLE Posting
# --------------------------------------------------------
DROP TABLE PrivateMessageBody
# --------------------------------------------------------
DROP TABLE PrivateMessages
# --------------------------------------------------------
DROP TABLE Link
# --------------------------------------------------------
DROP TABLE LinkValidation
# --------------------------------------------------------
DROP TABLE ListingTypes
# --------------------------------------------------------
DROP TABLE Listings
# --------------------------------------------------------
DROP TABLE News
# --------------------------------------------------------
DROP TABLE Pages
# --------------------------------------------------------
DROP TABLE PageContent
# --------------------------------------------------------
DROP TABLE BanRules
# --------------------------------------------------------
DROP TABLE Cache
# --------------------------------------------------------
DROP TABLE Category
# --------------------------------------------------------
DROP TABLE CategoryItems
# --------------------------------------------------------
DROP TABLE ConfigurationAdmin
# --------------------------------------------------------
DROP TABLE ConfigurationValues
# --------------------------------------------------------
DROP TABLE CountCache
# --------------------------------------------------------
DROP TABLE CustomField
# --------------------------------------------------------
DROP TABLE CustomMetaData
# --------------------------------------------------------
DROP TABLE EmailLog
# --------------------------------------------------------
DROP TABLE EmailMessage
# --------------------------------------------------------
DROP TABLE EmailQueue
# --------------------------------------------------------
DROP TABLE EmailSubscribers
# --------------------------------------------------------
DROP TABLE Events
# --------------------------------------------------------
DROP TABLE Favorites
# --------------------------------------------------------
DROP TABLE IdGenerator
# --------------------------------------------------------
DROP TABLE IgnoreKeywords
# --------------------------------------------------------
DROP TABLE Images
# --------------------------------------------------------
DROP TABLE ImportScripts
# --------------------------------------------------------
DROP TABLE ItemRating
# --------------------------------------------------------
DROP TABLE ItemReview
# --------------------------------------------------------
DROP TABLE ItemTypes
# --------------------------------------------------------
DROP TABLE Language
# --------------------------------------------------------
DROP TABLE Modules
# --------------------------------------------------------
DROP TABLE PermCache
# --------------------------------------------------------
DROP TABLE PermissionConfig
# --------------------------------------------------------
DROP TABLE Permissions
# --------------------------------------------------------
DROP TABLE PersistantSessionData
# --------------------------------------------------------
DROP TABLE Phrase
# --------------------------------------------------------
DROP TABLE PhraseCache
# --------------------------------------------------------
DROP TABLE PortalGroup
# --------------------------------------------------------
DROP TABLE PortalUser
# --------------------------------------------------------
DROP TABLE Relationship
# --------------------------------------------------------
DROP TABLE SearchConfig
# --------------------------------------------------------
DROP TABLE SearchLog
# --------------------------------------------------------
DROP TABLE SessionData
# --------------------------------------------------------
DROP TABLE SpamControl
# --------------------------------------------------------
DROP TABLE StatItem
# --------------------------------------------------------
DROP TABLE StdDestinations
# --------------------------------------------------------
DROP TABLE StylesheetSelectors
# --------------------------------------------------------
DROP TABLE Stylesheets
# --------------------------------------------------------
DROP TABLE SuggestMail
# --------------------------------------------------------
DROP TABLE SysCache
# --------------------------------------------------------
DROP TABLE TagAttributes
# --------------------------------------------------------
DROP TABLE TagLibrary
# --------------------------------------------------------
DROP TABLE Theme
# --------------------------------------------------------
DROP TABLE ThemeFiles
# --------------------------------------------------------
DROP TABLE UserGroup
# --------------------------------------------------------
DROP TABLE UserSession
# --------------------------------------------------------
DROP TABLE Visits
# --------------------------------------------------------
DROP TABLE ProductOptions
# --------------------------------------------------------
DROP TABLE ProductOptionCombinations
# --------------------------------------------------------
DROP TABLE CategoryCustomData
# --------------------------------------------------------
DROP TABLE LinkCustomData
# --------------------------------------------------------
DROP TABLE NewsCustomData
# --------------------------------------------------------
DROP TABLE PortalUserCustomData
# --------------------------------------------------------
DROP TABLE ProductsCustomData
# --------------------------------------------------------
DROP TABLE TopicCustomData
# --------------------------------------------------------
DROP TABLE ImportCache
+# --------------------------------------------------------
+DROP TABLE FormFields
+# --------------------------------------------------------
+DROP TABLE Forms
+# --------------------------------------------------------
+DROP TABLE FormSubmissions
#
\ No newline at end of file
Property changes on: trunk/admin/install/inportal_remove.sql
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.11
\ No newline at end of property
+1.12
\ No newline at end of property
Index: trunk/core/kernel/event_manager.php
===================================================================
--- trunk/core/kernel/event_manager.php (revision 6427)
+++ trunk/core/kernel/event_manager.php (revision 6428)
@@ -1,500 +1,506 @@
<?php
define('hBEFORE', 1);
define('hAFTER', 2);
define('reBEFORE', 1);
define('reAFTER', 2);
class kEventManager extends kBase {
/**
* Connection to database
*
* @var kDBConnection
* @access public
*/
var $Conn;
/**
* Cache of QueryString parameters
* from config, that are represented
* in enviroment variable
*
* @var Array
*/
var $queryMaps = Array();
/**
* Build events registred for
* pseudo classes. key - pseudo class
* value - event name
*
* @var Array
* @access private
*/
var $buildEvents=Array();
/**
* Events, that should be run before parser initialization
*
* @var Array
*/
var $beforeRegularEvents = Array();
/**
* Events, that should be run after parser initialization
*
* @var Array
*/
var $afterRegularEvents = Array();
/**
* Holds before hooks
* key - prefix.event (to link to)
* value - hooked event info
*
* @var Array
* @access private
*/
var $beforeHooks=Array();
/**
* Holds after hooks
* key - prefix.event (to link to)
* value - hooked event info
*
* @var Array
* @access private
*/
var $afterHooks = Array();
var $recursionStack = Array();
function kEventManager()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
/**
* Set's new enviroment parameter mappings
* between their names as application vars
*
* @param Array $new_query_maps
* @access public
*/
/*function setQueryMaps($new_query_maps)
{
$this->queryMaps = $new_query_maps;
}*/
/**
* Adds new query map to already parsed query maps
*
* @param string $prefix
*/
function setQueryMap($prefix_special)
{
list($prefix) = explode('.', $prefix_special);
$query_map = $this->Application->getUnitOption($prefix, 'QueryString');
if ($query_map) {
$this->queryMaps[$prefix_special] = $query_map;
}
else {
unset($this->queryMaps[$prefix]);
}
// 'passed' is set later in ProcessRequest - do we really need it here? (it breakes HTTPQuery initialization...)
// $this->Application->SetVar('passed', implode(',', array_keys($this->queryMaps)) );
return $query_map;
}
/**
* Registers new regular event
*
* @param string $short_name name to be used to store last maintenace run info
* @param string $event_name
* @param int $run_interval run interval in seconds
* @param int $type before or after regular event
*/
function registerRegularEvent($short_name, $event_name, $run_interval, $type = reBEFORE)
{
if($type == reBEFORE)
{
$this->beforeRegularEvents[$short_name] = Array('EventName' => $event_name, 'RunInterval' => $run_interval);
}
else
{
$this->afterRegularEvents[$short_name] = Array('EventName' => $event_name, 'RunInterval' => $run_interval);
}
}
function registerBuildEvent($pseudo_class,$build_event_name)
{
$this->buildEvents[$pseudo_class]=$build_event_name;
}
/**
* Returns build event by pseudo class
* name if any defined in config
*
* @param string $pseudo_class
* @return kEvent
* @access public
*/
function &getBuildEvent($pseudo_class)
{
$false = false;
if( !isset($this->buildEvents[$pseudo_class]) ) return $false;
$event = new kEvent();
$event->Name=$this->buildEvents[$pseudo_class];
$event->MasterEvent=null;
return $event;
}
/**
* Check if event is called twice, that causes recursion
*
* @param kEvent $event
*/
function isRecursion(&$event)
{
$event_key = $event->getPrefixSpecial().':'.$event->Name;
return in_array($event_key, $this->recursionStack) ? true : false;
}
function pushEvent(&$event)
{
$event_key = $event->getPrefixSpecial().':'.$event->Name;
array_push($this->recursionStack, $event_key);
}
function popEvent()
{
array_pop($this->recursionStack);
}
/**
* Allows to process any type of event
*
* @param kEvent $event
* @access public
*/
function HandleEvent(&$event)
{
if ($this->isRecursion($event)) {
return true;
}
$this->pushEvent($event);
if( !$this->Application->prefixRegistred($event->Prefix) )
{
$unit_config_reader =& $this->Application->recallObject('kUnitConfigReader');
$unit_config_reader->loadConfig($event->Prefix);
}
if( !$this->Application->prefixRegistred($event->Prefix) )
{
trigger_error('Prefix <b>'.$event->Prefix.'</b> not registred (requested event <b>'.$event->Name.'</b>)', E_USER_NOTICE);
return false;
}
if (!$event->SkipBeforeHooks) {
$this->processHooks($event, hBEFORE);
if ($event->status == erFATAL) return true;
}
$event_handler =& $this->Application->recallObject($event->Prefix.'_EventHandler');
$event_handler->processEvent($event);
if ($event->status == erFATAL) return true;
if (!$event->SkipAfterHooks) {
$this->processHooks($event, hAFTER);
}
$this->popEvent();
return true;
}
function ProcessRequest()
{
$this->processOpener();
// 1. get events from $_POST
$events = $this->Application->GetVar('events');
if ($events === false) $events = Array();
// 2. if nothing there, then try to find them in $_GET
if ($this->queryMaps && !$events) {
// if we got $_GET type submit (links, not javascript)
foreach ($this->queryMaps as $prefix_special => $query_map) {
$query_map = array_flip($query_map);
if (isset($query_map['event'])) {
$event_name = $this->Application->GetVar($prefix_special.'_event');
if ($event_name) {
$events[$prefix_special] = $event_name;
}
}
}
$actions = $this->Application->GetVar('do');
if ($actions) {
list($prefix, $event_name) = explode('_', $actions);
$events[$prefix] = $event_name;
}
}
$passed = explode(',', $this->Application->GetVar('passed'));
foreach ($events as $prefix_special => $event_name) {
if (!$event_name) continue;
if (is_array($event_name)) {
$event_name = key($event_name);
$events[$prefix_special] = $event_name;
$this->Application->SetVar($prefix_special.'_event', $event_name);
}
$event = new kEvent();
$event->Name = $event_name;
$event->Prefix_Special = $prefix_special;
$prefix_special = explode('.',$prefix_special);
$event->Prefix = $prefix_special[0];
array_push($passed, $prefix_special[0]);
$event->Special = isset($prefix_special[1]) ? $prefix_special[1] : '';
$event->redirect_params = Array('opener' => 's', 'pass' => 'all');
$event->redirect = true;
$event_handler =& $this->Application->recallObject($event->Prefix.'_EventHandler');
$event->setEventParam('top_prefix', $this->Application->GetTopmostPrefix($event->Prefix));
if (($this->Application->GetVar('u_id') == -1) || $event_handler->CheckPermission($event)) {
$this->HandleEvent($event);
}
if ($event->status == erPERM_FAIL) {
$event->redirect = $this->Application->IsAdmin() ? 'no_permission' : $this->Application->ConfigValue('NoPermissionTemplate');
$event->redirect_params['pass'] = 'm';
$event->redirect_params['m_cat_id'] = 0;
// restore stuff, that processOpener() changed
$this->Application->RestoreVar('opener_stack');
// don't save last_template, because no_permission template does js history.back and could cause invalid opener_stack content
$this->Application->SetVar('skip_last_template', 1);
}
// should do redirect but to no_permissions template
if ( ($event->status == erSUCCESS || $event->status == erPERM_FAIL) && ($event->redirect === true || strlen($event->redirect) > 0)) {
+ // we need to pass category if the action was submitted to self-template, with the category passed
+ // and it has not explicly set redirect template or pass_cateogry param
+ if ($event->redirect === true && !isset($event->redirect_params['pass_category']) && $this->Application->GetVar('m_cat_id')) {
+ $event->redirect_params['pass_category'] = 1;
+ }
$this->Application->Redirect($event->redirect, $event->redirect_params, null, $event->redirect_script);
}
}
$this->Application->SetVar('events', $events);
$this->Application->SetVar('passed', implode(',', $passed));
}
function processOpener()
{
$opener_action = $this->Application->GetVar('m_opener');
$opener_stack = $this->Application->RecallVar('opener_stack');
$opener_stack = $opener_stack ? unserialize($opener_stack) : Array();
switch ($opener_action) {
case 'r': // "reset" opener stack
$opener_stack = Array();
break;
case 'd': // "down/push" new template to opener stack, deeplevel++
if ($this->Application->GetVar('front')) {
- array_push($opener_stack, '../'.$this->Application->RecallVar('last_template') );
+ $front_session =& $this->Application->recallObject('Session.front');
+ array_push($opener_stack, '../'.$front_session->RecallVar('last_template') );
}
else {
array_push($opener_stack, $this->Application->RecallVar('last_template') );
}
break;
case 'u': // "up/pop" last template from opener stack, deeplevel--
array_pop($opener_stack);
break;
case 'p': //pop-up - do not store last template
$this->Application->SetVar('skip_last_template', 1);
break;
default: // "s/0," stay on same deep level
break;
}
if (!$this->Application->GetVar('skip_last_template')) {
$this->Application->SetVar('m_opener', 's');
}
$this->Application->StoreVar('opener_stack', serialize($opener_stack));
}
-
+
function openerStackPush($t, $params, $pass = 'all')
{
$opener_stack = $this->Application->RecallVar('opener_stack');
- $opener_stack = $opener_stack ? unserialize($opener_stack) : Array();
-
+ $opener_stack = $opener_stack ? unserialize($opener_stack) : Array();
+
$redirect_params = array_merge_recursive2(Array('m_opener' => 'u', '__URLENCODE__' => 1), $params);
$new_level = $this->Application->BuildEnv($t, $redirect_params, $pass, true);
array_push($opener_stack, 'index.php|'.ltrim($new_level, ENV_VAR_NAME.'=') );
$this->Application->StoreVar('opener_stack', serialize($opener_stack));
}
-
+
function registerHook($hookto_prefix, $hookto_special, $hookto_event, $mode, $do_prefix, $do_special, $do_event, $conditional)
{
if( !$this->Application->prefixRegistred($hookto_prefix) )
{
if ($this->Application->isDebugMode()) {
trigger_error('Prefix <b>'.$hookto_prefix.'</b> doesn\'t exist when trying to hook from <b>'.$do_prefix.':'.$do_event.'</b>', E_USER_WARNING);
}
return;
}
$hookto_prefix_special = rtrim($hookto_prefix.'.'.$hookto_special, '.');
if ($mode == hBEFORE) {
$this->beforeHooks[strtolower($hookto_prefix_special.'.'.$hookto_event)][] = Array(
'DoPrefix' => $do_prefix,
'DoSpecial' => $do_special,
'DoEvent' => $do_event,
'Conditional' => $conditional,
);
}
elseif ($mode == hAFTER) {
$this->afterHooks[strtolower($hookto_prefix_special.'.'.$hookto_event)][] = Array(
'DoPrefix' => $do_prefix,
'DoSpecial' => $do_special,
'DoEvent' => $do_event,
'Conditional' => $conditional,
);
}
}
/**
* Enter description here...
*
* @param kEvent $event
* @param int $mode hBEFORE or hAFTER
* @return Array
*/
function &getHooks(&$event, $mode, $special = null)
{
$event_key = !isset($special) ? $event->Prefix_Special : $event->Prefix.'.'.$special;
if ($mode == hBEFORE) {
$mode_hooks =& $this->beforeHooks;
}
else {
$mode_hooks =& $this->afterHooks;
}
if (!isset($mode_hooks[strtolower($event_key.'.'.$event->Name)])) {
$hooks = array();
return $hooks;
}
return $mode_hooks[strtolower($event_key.'.'.$event->Name)];
}
/**
* Enter description here...
*
* @param kEvent $event
* @param int $mode hBEFORE or hAFTER
*/
function processHooks(&$event, $mode)
{
// * - get hooks that are valid with any special of given prefix
$hooks = array_merge($this->getHooks($event, $mode, '*'), $this->getHooks($event, $mode));
if ($hooks) {
foreach ($hooks as $hook) {
if ($hook['DoSpecial'] == '*') {
// use same special as master event
$hook['DoSpecial'] = $event->Special;
}
$prefix_special = rtrim($hook['DoPrefix'].'_'.$hook['DoSpecial'], '_');
if ( $hook['Conditional'] && !$this->Application->GetVar($prefix_special) ) {
continue;
}
$hook_event = new kEvent( Array('name'=>$hook['DoEvent'],'prefix'=>$hook['DoPrefix'],'special'=>$hook['DoSpecial']) );
$hook_event->MasterEvent =& $event;
$this->HandleEvent($hook_event);
}
}
}
/**
* Set's new event for $prefix_special
* passed
*
* @param string $prefix_special
* @param string $event_name
* @access public
*/
function setEvent($prefix_special,$event_name)
{
$actions =& $this->Application->recallObject('kActions');
$actions->Set('events['.$prefix_special.']',$event_name);
}
/**
* Run registred regular events with specified event type
*
* @param int $event_type
*/
function RunRegularEvents($event_type = reBEFORE, $from_cron=false)
{
if (defined('IS_INSTALL')) return ;
// if RegularEvents are set to run from cron
if (!$from_cron && $this->Application->ConfigValue('UseCronForRegularEvent')) return ;
$events_source = ($event_type == reBEFORE) ? $this->beforeRegularEvents : $this->afterRegularEvents;
/*if(rand(0, 100) < 90)
{
return;
}*/
$sql = 'SELECT Data FROM '.TABLE_PREFIX.'Cache WHERE VarName = %s';
$event_last_runs = $this->Conn->GetOne( sprintf($sql, $this->Conn->qstr('RegularEventRuns') ) );
$event_last_runs = $event_last_runs ? unserialize($event_last_runs) : Array();
foreach($events_source as $short_name => $event_data)
{
$event_last_run = getArrayValue($event_last_runs, $short_name);
if($event_last_run && $event_last_run > adodb_mktime() - $event_data['RunInterval'])
{
continue;
}
else
{
$event = new kEvent($event_data['EventName']);
$event->redirect = false;
$this->Application->HandleEvent($event);
$event_last_runs[$short_name] = adodb_mktime();
}
}
$sql = 'REPLACE INTO '.TABLE_PREFIX.'Cache (VarName,Data,Cached) VALUES (%s,%s,%s)';
$this->Conn->Query( sprintf($sql, $this->Conn->qstr('RegularEventRuns'), $this->Conn->qstr(serialize($event_last_runs)), adodb_mktime() ) );
}
/**
* Allows to determine, that required event is beeing processed right now
*
* @param string $event_key Event name in format prefix[.special]:event_name
* @return bool
*/
function eventRunning($event_key)
{
return array_search($event_key, $this->recursionStack) !== false;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/event_manager.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.38
\ No newline at end of property
+1.39
\ No newline at end of property
Index: trunk/core/kernel/processors/main_processor.php
===================================================================
--- trunk/core/kernel/processors/main_processor.php (revision 6427)
+++ trunk/core/kernel/processors/main_processor.php (revision 6428)
@@ -1,917 +1,930 @@
<?php
class kMainTagProcessor extends TagProcessor {
function Init($prefix, $special, $event_params = null)
{
parent::Init($prefix, $special, $event_params);
$actions =& $this->Application->recallObject('kActions');
$actions->Set('t', $this->Application->GetVar('t'));
$actions->Set('sid', $this->Application->GetSID());
$actions->Set('m_opener', $this->Application->GetVar('m_opener') );
}
/**
* Used to handle calls where tag name
* match with existing php function name
*
* @param Tag $tag
* @return string
*/
function ProcessTag(&$tag)
{
if ($tag->Tag=='include') $tag->Tag='MyInclude';
return parent::ProcessTag($tag);
}
/**
* Base folder for all template includes
*
* @param Array $params
* @return string
*/
function TemplatesBase($params)
{
if ($this->Application->IsAdmin()) {
$module = isset($params['module']) ? $params['module'] : 'kernel';
$path = preg_replace('/\/(.*?)\/(.*)/', $module.'/\\2', THEMES_PATH); // remove leading slash + substitute module
}
else {
$path = substr(THEMES_PATH, 1);
}
return $this->Application->BaseURL().$path;
}
/**
* Creates <base href ..> HTML tag for all templates
* affects future css, js files and href params of links
*
* @return string
* @access public
*/
function Base_Ref($params)
{
return '<base href="'.$this->TemplatesBase($params).'/" />';
}
/**
* Returns base url for web-site
*
* @return string
* @access public
*/
function BaseURL()
{
return $this->Application->BaseURL();
}
function ProjectBase($params)
{
return $this->Application->BaseURL();
}
/*function Base($params)
{
return $this->Application->BaseURL().$params['add'];
}*/
/**
* Used to create link to any template.
* use "pass" paramter if "t" tag to specify
* prefix & special of object to be represented
* in resulting url
*
* @param Array $params
* @return string
* @access public
*/
function T($params)
{
//by default link to current template
$t = $this->SelectParam($params, 't,template');
unset($params['t']);
unset($params['template']);
$prefix=isset($params['prefix']) ? $params['prefix'] : ''; unset($params['prefix']);
$index_file = isset($params['index_file']) ? $params['index_file'] : null; unset($params['index_file']);
return $this->Application->HREF($t, $prefix, $params, $index_file);
}
function Link($params)
{
if (isset($params['template'])) {
$params['t'] = $params['template'];
unset($params['template']);
}
if (!isset($params['pass']) && !isset($params['no_pass'])) $params['pass'] = 'm';
if (isset($params['no_pass'])) unset($params['no_pass']);
if( $this->Application->GetVar('admin') ) $params['admin'] = 1;
return $this->T($params);
}
function Env($params)
{
$t = $params['template'];
unset($params['template']);
return $this->Application->BuildEnv($t, $params, 'm', null, false);
}
function FormAction($params)
{
- return $this->Application->ProcessParsedTag('m', 't', array_merge($params, Array('pass'=>'all,m' )) );
+ return $this->Application->ProcessParsedTag('m', 't', array_merge($params, Array('pass'=>'all,m', 'pass_category' => 1 )) );
}
/*// NEEDS TEST
function Config($params)
{
return $this->Application->ConfigOption($params['var']);
}
function Object($params)
{
$name = $params['name'];
$method = $params['method'];
$tmp =& $this->Application->recallObject($name);
if ($tmp != null) {
if (method_exists($tmp, $method))
return $tmp->$method($params);
else
echo "Method $method does not exist in object ".get_class($tmp)." named $name<br>";
}
else
echo "Object $name does not exist in the appliaction<br>";
}*/
/**
* Tag, that always returns true.
* For parser testing purposes
*
* @param Array $params
* @return bool
* @access public
*/
function True($params)
{
return true;
}
/**
* Tag, that always returns false.
* For parser testing purposes
*
* @param Array $params
* @return bool
* @access public
*/
function False($params)
{
return false;
}
/**
* Returns block parameter by name
*
* @param Array $params
* @return stirng
* @access public
*/
function Param($params)
{
//$parser =& $this->Application->recallObject('TemplateParser');
$res = $this->Application->Parser->GetParam($params['name']);
if ($res === false) $res = '';
if (isset($params['plus']))
$res += $params['plus'];
return $res;
}
function DefaultParam($params)
{
foreach ($params as $key => $val) {
if ($this->Application->Parser->GetParam($key) === false) {
$this->Application->Parser->SetParam($key, $val);
}
}
}
/**
* Gets value of specified field from specified prefix_special and set it as parser param
*
* @param Array $params
*/
/*function SetParam($params)
{
// <inp2:m_SetParam param="custom_name" src="cf:FieldName"/>
list($prefix_special, $field_name) = explode(':', $params['src']);
$object =& $this->Application->recallObject($prefix_special);
$name = $this->SelectParam($params, 'param,name,var');
$this->Application->Parser->SetParam($name, $object->GetField($field_name) );
}*/
/**
* Compares block parameter with value specified
*
* @param Array $params
* @return bool
* @access public
*/
function ParamEquals($params)
{
//$parser =& $this->Application->recallObject('TemplateParser');
$name = $this->SelectParam($params, 'name,var,param');
$value = $params['value'];
return ($this->Application->Parser->GetParam($name) == $value);
}
/*function PHP_Self($params)
{
return $HTTP_SERVER_VARS['PHP_SELF'];
}
*/
/**
* Returns session variable value by name
*
* @param Array $params
* @return string
* @access public
*/
function Recall($params)
{
$ret = $this->Application->RecallVar( $this->SelectParam($params,'name,var,param') );
$ret = ($ret === false && isset($params['no_null'])) ? '' : $ret;
if( getArrayValue($params,'special') || getArrayValue($params,'htmlchars')) $ret = htmlspecialchars($ret);
if ( getArrayValue($params, 'urlencode') ) $ret = urlencode($ret);
return $ret;
}
// bad style to store something from template to session !!! (by Alex)
// Used here only to test how session works, nothing more
function Store($params)
{
//echo"Store $params[name]<br>";
$name = $params['name'];
$value = $params['value'];
$this->Application->StoreVar($name,$value);
}
/**
* Sets application variable value(-s)
*
* @param Array $params
* @access public
*/
function Set($params)
{
foreach ($params as $param => $value) {
$this->Application->SetVar($param, $value);
}
}
/**
* Increment application variable
* specified by number specified
*
* @param Array $params
* @access public
*/
function Inc($params)
{
$this->Application->SetVar($params['param'], $this->Application->GetVar($params['param']) + $params['by']);
}
/**
* Retrieves application variable
* value by name
*
* @param Array $params
* @return string
* @access public
*/
function Get($params)
{
$ret = $this->Application->GetVar($this->SelectParam($params, 'name,var,param'), '');
return getArrayValue($params, 'htmlchars') ? htmlspecialchars($ret) : $ret;
}
/**
* Retrieves application constant
* value by name
*
* @param Array $params
* @return string
* @access public
*/
function GetConst($params)
{
return defined($this->SelectParam($params, 'name,const')) ? constant($this->SelectParam($params, 'name,const,param')) : '';
}
/**
* Retrieves configuration variable value by name
*
* @param Array $params
* @return string
* @access public
*/
function GetConfig($params)
{
$config_name = $this->SelectParam($params, 'name,var');
$ret = $this->Application->ConfigValue($config_name);
if( getArrayValue($params, 'escape') ) $ret = addslashes($ret);
return $ret;
}
function ConfigEquals($params)
{
$option = $this->SelectParam($params, 'name,option,var');
return $this->Application->ConfigValue($option) == getArrayValue($params, 'value');
}
/**
* Creates all hidden fields
* needed for kernel_form
*
* @param Array $params
* @return string
* @access public
*/
function DumpSystemInfo($params)
{
$actions =& $this->Application->recallObject('kActions');
$actions->Set('t', $this->Application->GetVar('t') );
$params = $actions->GetParams();
$o='';
foreach ($params AS $name => $val)
{
$o .= "<input type='hidden' name='$name' id='$name' value='$val'>\n";
}
return $o;
}
function GetFormHiddens($params)
{
$sid = $this->Application->GetSID();
$t = $this->SelectParam($params, 'template,t');
unset($params['template']);
$env = $this->Application->BuildEnv($t, $params, 'm', null, false);
$o = '';
if ( $this->Application->RewriteURLs() )
{
$session =& $this->Application->recallObject('Session');
if ($session->NeedQueryString()) {
$o .= "<input type='hidden' name='sid' id='sid' value='$sid'>\n";
}
}
else {
$o .= "<input type='hidden' name='env' id='env' value='$env'>\n";
}
+ if ($this->Application->GetVar('admin') == 1) {
+ $o .= "<input type='hidden' name='admin' id='admin' value='1'>\n";
+ }
return $o;
}
function Odd_Even($params)
{
$odd = $params['odd'];
$even = $params['even'];
if (!isset($params['var'])) {
$var = 'odd_even';
}
else {
$var = $params['var'];
}
if ($this->Application->GetVar($var) == 'even') {
if (!isset($params['readonly']) || !$params['readonly']) {
$this->Application->SetVar($var, 'odd');
}
return $even;
}
else {
if (!isset($params['readonly']) || !$params['readonly']) {
$this->Application->SetVar($var, 'even');
}
return $odd;
}
}
/**
* Returns phrase translation by name
*
* @param Array $params
* @return string
* @access public
*/
function Phrase($params)
{
// m:phrase name="phrase_name" default="Tr-alala" updated="2004-01-29 12:49"
if (array_key_exists('default', $params)) return $params['default']; //backward compatibility
$translation = $this->Application->Phrase($this->SelectParam($params, 'label,name,title'));
if (getArrayValue($params, 'escape')) {
$translation = htmlspecialchars($translation);
$translation = str_replace('\'', '&#39;', $translation);
$translation = addslashes($translation);
}
return $translation;
}
// for tabs
function is_active($params)
{
$test_templ = $this->SelectParam($params, 'templ,template,t');
if ( !getArrayValue($params,'allow_empty') )
{
$if_true=getArrayValue($params,'true') ? $params['true'] : 1;
$if_false=getArrayValue($params,'false') ? $params['false'] : 0;
}
else
{
$if_true=$params['true'];
$if_false=$params['false'];
}
if ( preg_match("/^".str_replace('/', '\/', $test_templ)."/", $this->Application->GetVar('t'))) {
return $if_true;
}
else {
return $if_false;
}
}
function IsNotActive($params)
{
return !$this->is_active($params);
}
function IsActive($params)
{
return $this->is_active($params);
}
function is_t_active($params)
{
return $this->is_active($params);
}
function CurrentTemplate($params)
{
return $this->is_active($params);
}
/**
* Checks if session variable
* specified by name value match
* value passed as parameter
*
* @param Array $params
* @return string
* @access public
*/
function RecallEquals($params)
{
$name = $this->SelectParam($params, 'name,var');
$value = $params['value'];
return ($this->Application->RecallVar($name) == $value);
}
/**
* Checks if application variable
* specified by name value match
* value passed as parameter
*
* @param Array $params
* @return bool
* @access public
*/
function GetEquals($params)
{
$name = $this->SelectParam($params, 'var,name,param');
$value = $params['value'];
if ($this->Application->GetVar($name) == $value) {
return 1;
}
}
/**
* Includes template
* and returns it's
* parsed version
*
* @param Array $params
* @return string
* @access public
*/
function MyInclude($params)
{
$BlockParser =& $this->Application->makeClass('TemplateParser');
// $BlockParser->SetParams($params);
$parser =& $this->Application->Parser;
$this->Application->Parser =& $BlockParser;
$t = $this->SelectParam($params, 't,template,block,name');
$t = eregi_replace("\.tpl$", '', $t);
if (!$t) {
trigger_error('Template name not specified in <b>&lt;inp2:m_include .../&gt;</b> tag', E_USER_ERROR);
}
-
+
$res = $BlockParser->ParseTemplate( $t, 1, $params, isset($params['is_silent']) ? 1 : 0 );
if ( !$BlockParser->DataExists && (isset($params['data_exists']) || isset($params['block_no_data'])) ) {
if ($block_no_data = getArrayValue($params, 'block_no_data')) {
$res = $BlockParser->Parse(
$this->Application->TemplatesCache->GetTemplateBody($block_no_data, getArrayValue($params, 'is_silent') ),
$t
);
}
else {
$res = '';
}
}
$this->Application->Parser =& $parser;
$this->Application->Parser->DataExists = $this->Application->Parser->DataExists || $BlockParser->DataExists;
return $res;
}
function ModuleInclude($params)
{
$ret = '';
$block_params = array_merge($params, Array('is_silent' => 2)); // don't make fatal errors in case if template is missing
$current_template = $this->Application->GetVar('t');
$skip_prefixes = isset($params['skip_prefixes']) ? explode(',', $params['skip_prefixes']) : Array();
foreach ($this->Application->ModuleInfo as $module_name => $module_data) {
$module_key = strtolower($module_name);
if ($module_name == 'In-Portal') {
$module_prefix = '';
}
else {
$module_prefix = $this->Application->IsAdmin() ? $module_key.'/' : $module_data['TemplatePath'].'/';
}
$block_params['t'] = $module_prefix.$this->SelectParam($params, $module_key.'_template,'.$module_key.'_t,template,t');
if ($block_params['t'] == $current_template || in_array($module_data['Var'], $skip_prefixes)) continue;
$no_data = $this->SelectParam($params, $module_key.'_block_no_data,block_no_data');
if ($no_data) {
$block_params['block_no_data'] = $module_prefix.'/'.$no_data;
}
$ret .= $this->MyInclude($block_params);
}
return $ret;
}
function ModuleEnabled($params)
{
return $this->Application->isModuleEnabled( $params['module'] );
}
/*function Kernel_Scripts($params)
{
return '<script type="text/javascript" src="'.PROTOCOL.SERVER_NAME.BASE_PATH.'/kernel3/js/grid.js"></script>';
}*/
/*function GetUserPermission($params)
{
// echo"GetUserPermission $params[name]";
if ($this->Application->RecallVar('user_type') == 1)
return 1;
else {
$perm_name = $params[name];
$aPermissions = unserialize($this->Application->RecallVar('user_permissions'));
if ($aPermissions)
return $aPermissions[$perm_name];
}
}*/
/**
* Set's parser block param value
*
* @param Array $params
* @access public
*/
function AddParam($params)
{
$parser =& $this->Application->Parser; // recallObject('TemplateParser');
foreach ($params as $param => $value) {
$this->Application->SetVar($param, $value);
$parser->SetParam($param, $value);
$parser->AddParam('/\$'.$param.'/', $value);
}
}
/*function ParseToVar($params)
{
$var = $params['var'];
$tagdata = $params['tag'];
$parser =& $this->Application->Parser; //recallObject('TemplateParser');
$res = $this->Application->ProcessTag($tagdata);
$parser->SetParam($var, $res);
$parser->AddParam('/\$'.$var.'/', $res);
return '';
}*/
/*function TagNotEmpty($params)
{
$tagdata = $params['tag'];
$res = $this->Application->ProcessTag($tagdata);
return $res != '';
}*/
/*function TagEmpty($params)
{
return !$this->TagNotEmpty($params);
}*/
/**
* Parses block and returns result
*
* @param Array $params
* @return string
* @access public
*/
function ParseBlock($params)
{
$parser =& $this->Application->Parser; // recallObject('TemplateParser');
return $parser->ParseBlock($params);
}
function RenderElement($params)
{
return $this->ParseBlock($params);
}
function RenderElements($params)
{
if (!isset($params['elements']) || !$params['elements']) return;
$elements = explode(',',$params['elements']);
if (isset($params['skip']) && $params['skip']) {
$tmp_skip = explode(',',$params['skip']);
foreach ($tmp_skip as $elem) {
$skip[] = trim($elem);
}
}
else {
$skip = array();
}
unset($params['elements']);
$o = '';
foreach ($elements as $an_element)
{
$cur = trim($an_element);
if (in_array($cur,$skip)) continue;
$pass_params = $params;
$pass_params['name'] = $cur;
$o .= $this->ParseBlock($pass_params);
}
return $o;
}
/**
* Checks if debug mode is on
*
* @return bool
* @access public
*/
function IsDebugMode()
{
return $this->Application->isDebugMode();
}
function MassParse($params)
{
$qty = $params['qty'];
$block = $params['block'];
$mode = $params['mode'];
$o = '';
if ($mode == 'func') {
$func = create_function('$params', '
$o = \'<tr>\';
$o.= \'<td>a\'.$params[\'param1\'].\'</td>\';
$o.= \'<td>a\'.$params[\'param2\'].\'</td>\';
$o.= \'<td>a\'.$params[\'param3\'].\'</td>\';
$o.= \'<td>a\'.$params[\'param4\'].\'</td>\';
$o.= \'</tr>\';
return $o;
');
for ($i=1; $i<$qty; $i++) {
$block_params['param1'] = rand(1, 10000);
$block_params['param2'] = rand(1, 10000);
$block_params['param3'] = rand(1, 10000);
$block_params['param4'] = rand(1, 10000);
$o .= $func($block_params);
}
return $o;
}
$block_params['name'] = $block;
for ($i=0; $i<$qty; $i++) {
$block_params['param1'] = rand(1, 10000);
$block_params['param2'] = rand(1, 10000);
$block_params['param3'] = rand(1, 10000);
$block_params['param4'] = rand(1, 10000);
$block_params['passed'] = $params['passed'];
$block_params['prefix'] = 'm';
$o.= $this->Application->ParseBlock($block_params, 1);
}
return $o;
}
function LoggedIn($params)
{
return $this->Application->LoggedIn();
}
/**
* Allows to check if permission exists directly in template and perform additional actions if required
*
* @param Array $params
* @return bool
*/
function CheckPermission($params)
{
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
return $perm_helper->TagPermissionCheck($params, 'm_CheckPermission');
}
/**
* Checks if user is logged in and if not redirects it to template passed
*
* @param Array $params
*/
function RequireLogin($params)
{
$t = $this->Application->GetVar('t');
if ($next_t = getArrayValue($params, 'next_template')) {
$t = $next_t;
}
// check by permissions: begin
if ((isset($params['perm_event']) && $params['perm_event']) ||
(isset($params['perm_prefix']) && $params['perm_prefix']) ||
(isset($params['permissions']) && $params['permissions'])) {
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
$perm_status = $perm_helper->TagPermissionCheck($params, 'm_RequireLogin');
if (!$perm_status) {
list($redirect_template, $redirect_params) = $perm_helper->getPermissionTemplate($params);
$this->Application->Redirect($redirect_template, $redirect_params);
}
else {
return ;
}
}
// check by permissions: end
// check by configuration value: begin
$condition = getArrayValue($params, 'condition');
if (!$condition) {
$condition = true;
}
else {
if (substr($condition, 0, 1) == '!') {
$condition = !$this->Application->ConfigValue(substr($condition, 1));
}
else {
$condition = $this->Application->ConfigValue($condition);
}
}
// check by configuration value: end
// check by belonging to group: begin
$group = $this->SelectParam($params, 'group');
$group_access = true;
if ($group) {
$conn =& $this->Application->GetADODBConnection();
$group_id = $conn->GetOne('SELECT GroupId FROM '.TABLE_PREFIX.'PortalGroup WHERE Name = '.$conn->qstr($group));
if ($group_id) {
$groups = explode(',', $this->Application->RecallVar('UserGroups'));
$group_access = in_array($group_id, $groups);
}
}
// check by belonging to group: end
if ((!$this->Application->LoggedIn() || !$group_access) && $condition) {
if ( $this->Application->LoggedIn() && !$group_access) {
$this->Application->Redirect( $params['no_group_perm_template'], Array('next_template'=>$t) );
}
$redirect_params = Array('next_template' => $t);
$session_expired = $this->Application->GetVar('expired');
if ($session_expired) {
$redirect_params['expired'] = $session_expired;
}
$this->Application->Redirect($params['login_template'], $redirect_params);
}
}
function IsMember($params)
{
$group = getArrayValue($params, 'group');
$conn =& $this->Application->DB;
$group_id = $conn->GetOne('SELECT GroupId FROM '.TABLE_PREFIX.'PortalGroup WHERE Name = '.$conn->qstr($group));
if ($group_id) {
$groups = explode(',', $this->Application->RecallVar('UserGroups'));
$group_access = in_array($group_id, $groups);
}
return $group_access;
}
/**
* Checks if SSL is on and redirects to SSL URL if needed
* If SSL_URL is not defined in config - the tag does not do anything
* If for_logged_in_only="1" exits if user is not logged in.
* If called without params forces https right away. If called with by_config="1" checks the
* Require SSL setting from General Config and if it is ON forces https
*
* @param unknown_type $params
*/
function CheckSSL($params)
{
$ssl = $this->Application->ConfigValue('SSL_URL');
if (!$ssl) return; //SSL URL is not set - no way to require SSL
$require = false;
if (isset($params['mode']) && $params['mode'] == 'required') {
$require = true;
if (isset($params['for_logged_in_only']) && $params['for_logged_in_only'] && !$this->Application->LoggedIn()) {
$require = false;
}
if (isset($params['condition'])) {
if (!$this->Application->ConfigValue($params['condition'])) {
$require = false;
}
}
}
$http_query =& $this->Application->recallObject('HTTPQuery');
$pass = $http_query->getRedirectParams();
if ($require) {
if (PROTOCOL == 'https://') {
$this->Application->SetVar('__KEEP_SSL__', 1);
return;
}
$this->Application->Redirect('', array_merge_recursive2($pass, Array('__SSL__' => 1)));
}
else {
if (PROTOCOL == 'https://' && $this->Application->ConfigValue('Force_HTTP_When_SSL_Not_Required')) {
if ($this->Application->GetVar('__KEEP_SSL__')) return;
$pass = array('pass'=>'m', 'm_cat_id'=>0);
$this->Application->Redirect('', array_merge_recursive2($pass, Array('__SSL__' => 0)));
}
}
}
function ConstOn($params)
{
$name = $this->SelectParam($params,'name,const');
return constOn($name);
}
function SetDefaultCategory($params)
{
$module_name = $params['module'];
$module =& $this->Application->recallObject('mod.'.$module_name);
$this->Application->SetVar('m_cat_id', $module->GetDBField('RootCat') );
}
function XMLTemplate($params)
{
- define('DBG_SKIP_REPORTING', 1);
+ safeDefine('DBG_SKIP_REPORTING', 1);
$lang =& $this->Application->recallObject('lang.current');
header('Content-type: text/xml; charset='.$lang->GetDBField('Charset'));
}
+ function Header($params)
+ {
+ header($params['data']);
+ }
+
+ function NoDebug($params)
+ {
+ define('DBG_SKIP_REPORTING', 1);
+ }
+
function RootCategoryName($params)
{
$root_phrase = $this->Application->ConfigValue('Root_Name');
return $this->Application->Phrase($root_phrase);
}
function AttachFile($params)
{
$email_object =& $this->Application->recallObject('kEmailMessage');
$path = FULL_PATH.'/'.$params['path'];
if (file_exists($path)) {
$email_object->attachFile($path);
}
}
}
Property changes on: trunk/core/kernel/processors/main_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.62
\ No newline at end of property
+1.63
\ No newline at end of property
Index: trunk/core/kernel/session/session.php
===================================================================
--- trunk/core/kernel/session/session.php (revision 6427)
+++ trunk/core/kernel/session/session.php (revision 6428)
@@ -1,764 +1,756 @@
<?php
/*
The session works the following way:
1. When a visitor loads a page from the site the script checks if cookies_on varibale has been passed to it as a cookie.
2. If it has been passed, the script tries to get Session ID (SID) from the request:
3. Depending on session mode the script is getting SID differently.
The following modes are available:
smAUTO - Automatic mode: if cookies are on at the client side, the script relays only on cookies and
ignore all other methods of passing SID.
If cookies are off at the client side, the script relays on SID passed through query string
and referal passed by the client. THIS METHOD IS NOT 100% SECURE, as long as attacker may
get SID and substitude referal to gain access to user' session. One of the faults of this method
is that the session is only created when the visitor clicks the first link on the site, so
there is NO session at the first load of the page. (Actually there is a session, but it gets lost
after the first click because we do not use SID in query string while we are not sure if we need it)
smCOOKIES_ONLY - Cookies only: in this mode the script relays solely on cookies passed from the browser
and ignores all other methods. In this mode there is no way to use sessions for clients
without cookies support or cookies support disabled. The cookies are stored with the
full domain name and path to base-directory of script installation.
smGET_ONLY - GET only: the script will not set any cookies and will use only SID passed in
query string using GET, it will also check referal. The script will set SID at the
first load of the page
smCOOKIES_AND_GET - Combined mode: the script will use both cookies and GET right from the start. If client has
cookies enabled, the script will check SID stored in cookie and passed in query string, and will
use this SID only if both cookie and query string matches. However if cookies are disabled on the
client side, the script will work the same way as in GET_ONLY mode.
4. After the script has the SID it tries to load it from the Storage (default is database)
5. If such SID is found in the database, the script checks its expiration time. If session is not expired, it updates
its expiration, and resend the cookie (if applicable to session mode)
6. Then the script loads all the data (session variables) pertaining to the SID.
Usage:
$session =& new Session(smAUTO); //smAUTO is default, you could just leave the brackets empty, or provide another mode
$session->SetCookieDomain('my.domain.com');
$session->SetCookiePath('/myscript');
$session->SetCookieName('my_sid_cookie');
$session->SetGETName('sid');
$session->InitSession();
...
//link output:
echo "<a href='index.php?'". ( $session->NeedQueryString() ? 'sid='.$session->SID : '' ) .">My Link</a>";
*/
//Implements session storage in the database
class SessionStorage extends kDBBase {
var $Expiration;
var $SessionTimeout=0;
var $DirectVars = Array();
var $ChangedDirectVars = Array();
var $OriginalData=Array();
var $TimestampField;
var $SessionDataTable;
var $DataValueField;
var $DataVarField;
function Init($prefix,$special)
{
parent::Init($prefix,$special);
$this->setTableName('sessions');
$this->setIDField('sid');
$this->TimestampField = 'expire';
$this->SessionDataTable = 'SessionData';
$this->DataValueField = 'value';
$this->DataVarField = 'var';
}
function setSessionTimeout($new_timeout)
{
$this->SessionTimeout = $new_timeout;
}
function StoreSession(&$session, $additional_fields = Array())
{
$fields_hash = Array( $this->IDField => $session->SID,
$this->TimestampField => $session->Expiration);
if ($additional_fields) {
$fields_hash = array_merge_recursive2($fields_hash, $additional_fields);
}
$this->Conn->doInsert($fields_hash, $this->TableName);
}
function DeleteSession(&$session)
{
$query = ' DELETE FROM '.$this->TableName.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID);
$this->Conn->Query($query);
$query = ' DELETE FROM '.$this->SessionDataTable.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID);
$this->Conn->Query($query);
$this->OriginalData = Array();
}
function UpdateSession(&$session, $timeout=0)
{
$this->SetField($session, $this->TimestampField, $session->Expiration);
$query = ' UPDATE '.$this->TableName.' SET '.$this->TimestampField.' = '.$session->Expiration.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID);
$this->Conn->Query($query);
}
function LocateSession($sid)
{
$query = ' SELECT * FROM '.$this->TableName.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($sid);
$result = $this->Conn->GetRow($query);
if($result===false) return false;
$this->DirectVars = $result;
$this->Expiration = $result[$this->TimestampField];
return true;
}
function GetExpiration()
{
return $this->Expiration;
}
function LoadData(&$session)
{
$query = 'SELECT '.$this->DataValueField.','.$this->DataVarField.' FROM '.$this->SessionDataTable.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID);
$this->OriginalData = $this->Conn->GetCol($query, $this->DataVarField);
return $this->OriginalData;
}
/**
* Enter description here...
*
* @param Session $session
* @param string $var_name
* @param mixed $default
*/
function GetField(&$session, $var_name, $default = false)
{
return isset($this->DirectVars[$var_name]) ? $this->DirectVars[$var_name] : $default;
//return $this->Conn->GetOne('SELECT '.$var_name.' FROM '.$this->TableName.' WHERE `'.$this->IDField.'` = '.$this->Conn->qstr($session->GetID()) );
}
function SetField(&$session, $var_name, $value)
{
if ($this->DirectVars[$var_name] != $value) {
$this->DirectVars[$var_name] = $value;
$this->ChangedDirectVars[] = $var_name;
$this->ChangedDirectVars = array_unique($this->ChangedDirectVars);
}
//return $this->Conn->Query('UPDATE '.$this->TableName.' SET '.$var_name.' = '.$this->Conn->qstr($value).' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->GetID()) );
}
function SaveData(&$session)
{
if(!$session->SID) return false; // can't save without sid
$ses_data = $session->Data->GetParams();
$replace = '';
foreach ($ses_data as $key => $value)
{
if ( isset($this->OriginalData[$key]) && $this->OriginalData[$key] == $value)
{
continue; //skip unchanged session data
}
else
{
$replace .= sprintf("(%s, %s, %s),",
$this->Conn->qstr($session->SID),
$this->Conn->qstr($key),
$this->Conn->qstr($value));
}
}
$replace = rtrim($replace, ',');
if ($replace != '') {
$query = ' REPLACE INTO '.$this->SessionDataTable. ' ('.$this->IDField.', '.$this->DataVarField.', '.$this->DataValueField.') VALUES '.$replace;
$this->Conn->Query($query);
}
if ($this->ChangedDirectVars) {
$changes = array();
foreach ($this->ChangedDirectVars as $var) {
$changes[] = $var.' = '.$this->Conn->qstr($this->DirectVars[$var]);
}
$query = 'UPDATE '.$this->TableName.' SET '.implode(',', $changes).' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->GetID());
$this->Conn->Query($query);
}
}
function RemoveFromData(&$session, $var)
{
$query = 'DELETE FROM '.$this->SessionDataTable.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID).
' AND '.$this->DataVarField.' = '.$this->Conn->qstr($var);
$this->Conn->Query($query);
unset($this->OriginalData[$var]);
}
function GetFromData(&$session, $var)
{
return getArrayValue($this->OriginalData, $var);
}
function GetExpiredSIDs()
{
$query = ' SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE '.$this->TimestampField.' > '.adodb_mktime();
return $this->Conn->GetCol($query);
}
function DeleteExpired()
{
$expired_sids = $this->GetExpiredSIDs();
if ($expired_sids) {
$where_clause=' WHERE '.$this->IDField.' IN ("'.implode('","',$expired_sids).'")';
$sql = 'DELETE FROM '.$this->SessionDataTable.$where_clause;
$this->Conn->Query($sql);
$sql = 'DELETE FROM '.$this->TableName.$where_clause;
$this->Conn->Query($sql);
// delete debugger ouputs left of expired sessions
foreach ($expired_sids as $expired_sid) {
$debug_file = KERNEL_PATH.'/../cache/debug_@'.$expired_sid.'@.txt';
if (file_exists($debug_file)) {
@unlink($debug_file);
}
}
}
return $expired_sids;
}
}
define('smAUTO', 1);
define('smCOOKIES_ONLY', 2);
define('smGET_ONLY', 3);
define('smCOOKIES_AND_GET', 4);
class Session extends kBase {
var $Checkers;
var $Mode;
var $OriginalMode = null;
var $GETName = 'sid';
var $CookiesEnabled = true;
var $CookieName = 'sid';
var $CookieDomain;
var $CookiePath;
var $CookieSecure = 0;
var $SessionTimeout = 3600;
var $Expiration;
var $SID;
/**
* Enter description here...
*
* @var SessionStorage
*/
var $Storage;
var $CachedNeedQueryString = null;
var $Data;
function Session($mode=smAUTO)
{
parent::kBase();
$this->SetMode($mode);
}
function SetMode($mode)
{
$this->Mode = $mode;
$this->CachedNeedQueryString = null;
$this->CachedSID = null;
}
function SetCookiePath($path)
{
$this->CookiePath = $path;
}
function SetCookieDomain($domain)
{
$this->CookieDomain = '.'.ltrim($domain, '.');
}
function SetGETName($get_name)
{
$this->GETName = $get_name;
}
function SetCookieName($cookie_name)
{
$this->CookieName = $cookie_name;
}
function InitStorage()
{
$this->Storage =& $this->Application->recallObject('SessionStorage');
$this->Storage->setSessionTimeout($this->SessionTimeout);
}
function Init($prefix,$special)
{
parent::Init($prefix,$special);
$this->CheckIfCookiesAreOn();
if ($this->CookiesEnabled) $_COOKIE['cookies_on'] = 1;
$this->Checkers = Array();
$this->InitStorage();
$this->Data =& new Params();
$tmp_sid = $this->GetPassedSIDValue();
$check = $this->Check();
if( !(defined('IS_INSTALL') && IS_INSTALL) )
{
$expired_sids = $this->DeleteExpired();
if( ( $expired_sids && in_array($tmp_sid,$expired_sids) ) || ( $tmp_sid && !$check ) )
{
$this->SetSession();
$this->Application->HandleEvent($event, 'u:OnSessionExpire');
}
}
if ($check) {
$this->SID = $this->GetPassedSIDValue();
$this->Refresh();
$this->LoadData();
}
else {
$this->SetSession();
}
if (!is_null($this->OriginalMode)) $this->SetMode($this->OriginalMode);
}
function IsHTTPSRedirect()
{
$http_referer = getArrayValue($_SERVER, 'HTTP_REFERER');
return (
( PROTOCOL == 'https://' && preg_match('#http:\/\/#', $http_referer) )
||
( PROTOCOL == 'http://' && preg_match('#https:\/\/#', $http_referer) )
);
}
function CheckReferer($for_cookies=0)
{
if (!$for_cookies) {
if ( !$this->Application->ConfigValue('SessionReferrerCheck') || $_SERVER['REQUEST_METHOD'] != 'POST') {
return true;
}
}
$path = preg_replace('/admin[\/]{0,1}$/', '', $this->CookiePath); // removing /admin for compatability with in-portal (in-link/admin/add_link.php)
$reg = '#^'.preg_quote(PROTOCOL.ltrim($this->CookieDomain, '.').$path).'#';
return preg_match($reg, getArrayValue($_SERVER, 'HTTP_REFERER') ) || (defined('IS_POPUP') && IS_POPUP);
}
/*function CheckDuplicateCookies()
{
if (isset($_SERVER['HTTP_COOKIE'])) {
$cookie_str = $_SERVER['HTTP_COOKIE'];
$cookies = explode('; ', $cookie_str);
$all_cookies = array();
foreach ($cookies as $cookie) {
list($name, $value) = explode('=', $cookie);
if (isset($all_cookies[$name])) {
//double cookie name!!!
$this->RemoveCookie($name);
}
else $all_cookies[$name] = $value;
}
}
}
function RemoveCookie($name)
{
$path = $_SERVER['PHP_SELF'];
$path_parts = explode('/', $path);
$cur_path = '';
setcookie($name, false, null, $cur_path);
foreach ($path_parts as $part) {
$cur_path .= $part;
setcookie($name, false, null, $cur_path);
$cur_path .= '/';
setcookie($name, false, null, $cur_path);
}
}*/
function CheckIfCookiesAreOn()
{
// $this->CheckDuplicateCookies();
- if ($this->Mode == smGET_ONLY ||
- ( defined('INPORTAL_ENV') &&
- INPORTAL_ENV &&
- $this->Application->IsAdmin()
- &&
- !$this->Application->GetVar('front'))
- )
+ if ($this->Mode == smGET_ONLY)
{
//we don't need to bother checking if we would not use it
$this->CookiesEnabled = false;
return;
}
$http_query =& $this->Application->recallObject('HTTPQuery');
$cookies_on = isset($http_query->Cookie['cookies_on']); // not good here
$get_sid = getArrayValue($http_query->Get, $this->GETName);
if ($this->IsHTTPSRedirect() && $get_sid) { //Redirect from http to https on different domain
$this->OriginalMode = $this->Mode;
$this->SetMode(smGET_ONLY);
}
if (!$cookies_on || $this->IsHTTPSRedirect()) {
//If referer is our server, but we don't have our cookies_on, it's definetly off
if ($this->CheckReferer(1) && !$this->Application->GetVar('admin') && !$this->IsHTTPSRedirect()) {
$this->CookiesEnabled = false;
}
else {
//Otherwise we still suppose cookies are on, because may be it's the first time user visits the site
//So we send cookies on to get it next time (when referal will tell us if they are realy off
setcookie(
'cookies_on',
1,
adodb_mktime()+31104000, //one year should be enough
$this->CookiePath,
$this->CookieDomain,
$this->CookieSecure
);
}
}
else
$this->CookiesEnabled = true;
return $this->CookiesEnabled;
}
function Check()
{
// we should check referer if cookies are disabled, and in combined mode
// auto mode would detect cookies, get only mode would turn it off - so we would get here
// and we don't care about referal in cookies only mode
if ( $this->Mode != smCOOKIES_ONLY && (!$this->CookiesEnabled || $this->Mode == smCOOKIES_AND_GET) ) {
if (!$this->CheckReferer())
return false;
}
$sid = $this->GetPassedSIDValue();
if (empty($sid)) return false;
//try to load session by sid, if everything is fine
$result = $this->LoadSession($sid);
return $result;
}
function LoadSession($sid)
{
if( $this->Storage->LocateSession($sid) ) {
//if we have session with such SID - get its expiration
$this->Expiration = $this->Storage->GetExpiration();
//If session has expired
if ($this->Expiration < adodb_mktime()) return false;
//Otherwise it's ok
return true;
}
else //fake or deleted due to expiration SID
return false;
}
function GetPassedSIDValue($use_cache = 1)
{
if (!empty($this->CachedSID) && $use_cache) return $this->CachedSID;
$http_query =& $this->Application->recallObject('HTTPQuery');
$get_sid = getArrayValue($http_query->Get, $this->GETName);
if ($this->Application->GetVar('admin') == 1 && $get_sid) {
$sid = $get_sid;
}
else {
switch ($this->Mode) {
case smAUTO:
//Cookies has the priority - we ignore everything else
$sid=$this->CookiesEnabled ? getArrayValue($http_query->Cookie,$this->CookieName) : $get_sid;
break;
case smCOOKIES_ONLY:
$sid = $http_query->Cookie[$this->CookieName];
break;
case smGET_ONLY:
$sid = $get_sid;
break;
case smCOOKIES_AND_GET:
$cookie_sid = $http_query->Cookie[$this->CookieName];
//both sids should match if cookies are enabled
if (!$this->CookiesEnabled || ($cookie_sid == $get_sid))
{
$sid = $get_sid; //we use get here just in case cookies are disabled
}
else
{
$sid = '';
}
break;
}
}
- if ($this->Application->GetVar('front')) {
- $this->CookiesEnabled = false;
- }
$this->CachedSID = $sid;
return $this->CachedSID;
}
/**
* Returns session id
*
* @return int
* @access public
*/
function GetID()
{
return $this->SID;
}
/**
* Generates new session id
*
* @return int
* @access private
*/
function GenerateSID()
{
list($usec, $sec) = explode(" ",microtime());
$sid_part_1 = substr($usec, 4, 4);
$sid_part_2 = mt_rand(1,9);
$sid_part_3 = substr($sec, 6, 4);
$digit_one = substr($sid_part_1, 0, 1);
if ($digit_one == 0) {
$digit_one = mt_rand(1,9);
$sid_part_1 = ereg_replace("^0","",$sid_part_1);
$sid_part_1=$digit_one.$sid_part_1;
}
$this->setSID($sid_part_1.$sid_part_2.$sid_part_3);
return $this->SID;
}
/**
* Set's new session id
*
* @param int $new_sid
* @access private
*/
function setSID($new_sid)
{
$this->SID=$new_sid;
$this->Application->SetVar($this->GETName,$new_sid);
}
function SetSession()
{
$this->GenerateSID();
$this->Expiration = adodb_mktime() + $this->SessionTimeout;
switch ($this->Mode) {
case smAUTO:
if ($this->CookiesEnabled) {
$this->SetSessionCookie();
}
break;
case smGET_ONLY:
break;
case smCOOKIES_ONLY:
case smCOOKIES_AND_GET:
$this->SetSessionCookie();
break;
}
$this->Storage->StoreSession($this);
}
function SetSessionCookie()
{
setcookie(
$this->CookieName,
$this->SID,
$this->Expiration,
$this->CookiePath,
$this->CookieDomain,
$this->CookieSecure
);
$_COOKIE[$this->CookieName] = $this->SID; // for compatibility with in-portal
}
/**
* Refreshes session expiration time
*
* @access private
*/
function Refresh()
{
if ($this->CookiesEnabled) $this->SetSessionCookie(); //we need to refresh the cookie
$this->Storage->UpdateSession($this);
}
function Destroy()
{
$this->Storage->DeleteSession($this);
$this->Data =& new Params();
$this->SID = '';
if ($this->CookiesEnabled) $this->SetSessionCookie(); //will remove the cookie due to value (sid) is empty
$this->SetSession(); //will create a new session
}
function NeedQueryString($use_cache = 1)
{
if ($this->CachedNeedQueryString != null && $use_cache) return $this->CachedNeedQueryString;
$result = false;
switch ($this->Mode)
{
case smAUTO:
if (!$this->CookiesEnabled) $result = true;
break;
/*case smCOOKIES_ONLY:
break;*/
case smGET_ONLY:
case smCOOKIES_AND_GET:
$result = true;
break;
}
$this->CachedNeedQueryString = $result;
return $result;
}
function LoadData()
{
$this->Data->AddParams($this->Storage->LoadData($this));
}
function PrintSession($comment='')
{
if($this->Application->isDebugMode() && constOn('DBG_SHOW_SESSIONDATA')) {
$this->Application->Debugger->appendHTML('SessionStorage ('.$comment.'):');
$session_data = $this->Data->GetParams();
ksort($session_data);
foreach ($session_data as $session_key => $session_value) {
if (IsSerialized($session_value)) {
$session_data[$session_key] = unserialize($session_value);
}
}
$this->Application->Debugger->dumpVars($session_data);
// to insert after HTTPQuery if it's visible
$new_row = constOn('DBG_SHOW_HTTPQUERY') ? 4 : 2;
//$debugger->moveAfterRow($new_row,2);
}
}
function SaveData()
{
if (!$this->Application->GetVar('skip_last_template') && $this->Application->GetVar('ajax') != 'yes') {
$this->SaveLastTemplate( $this->Application->GetVar('t') );
}
$this->PrintSession('after save');
$this->Storage->SaveData($this);
}
function SaveLastTemplate($t)
{
$last_env = $this->Application->BuildEnv($t, Array('m_opener' => 'u', '__URLENCODE__' => 1), 'all');
$last_template = basename($_SERVER['PHP_SELF']).'|'.substr($last_env, strlen(ENV_VAR_NAME) + 1);
$this->StoreVar('last_template', $last_template);
+ $this->StoreVar('last_url', $_SERVER['REQUEST_URI']);
$this->StoreVar('last_env', substr($this->Application->BuildEnv($t, Array('__URLENCODE__' => 1), 'all'), strlen(ENV_VAR_NAME)+1));
}
function StoreVar($name, $value)
{
$this->Data->Set($name, $value);
}
function StoreVarDefault($name, $value)
{
$tmp = $this->RecallVar($name);
if($tmp === false || $tmp == '')
{
$this->StoreVar($name, $value);
}
}
function RecallVar($name,$default=false)
{
$ret = $this->Data->Get($name);
return ($ret===false) ? $default : $ret;
}
function RemoveVar($name)
{
$this->Storage->RemoveFromData($this, $name);
$this->Data->Remove($name);
}
/**
* Ignores session varible value set before
*
* @param string $name
*/
function RestoreVar($name)
{
return $this->StoreVar($name, $this->Storage->GetFromData($this, $name));
}
function GetField($var_name, $default = false)
{
return $this->Storage->GetField($this, $var_name, $default);
}
function SetField($var_name, $value)
{
$this->Storage->SetField($this, $var_name, $value);
}
/**
* Deletes expired sessions
*
* @return Array expired sids if any
* @access private
*/
function DeleteExpired()
{
return $this->Storage->DeleteExpired();
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/session/session.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.50
\ No newline at end of property
+1.51
\ No newline at end of property
Index: trunk/core/kernel/utility/formatters/password_formatter.php
===================================================================
--- trunk/core/kernel/utility/formatters/password_formatter.php (revision 6427)
+++ trunk/core/kernel/utility/formatters/password_formatter.php (revision 6428)
@@ -1,97 +1,101 @@
<?php
class kPasswordFormatter extends kFormatter
{
function PrepareOptions($field_name, &$field_options, &$object)
{
if( isset( $field_options['verify_field'] ) )
{
$add_fields = Array();
$options = Array('master_field' => $field_name, 'formatter'=>'kPasswordFormatter');
$add_fields[ $field_options['verify_field'] ] = $options;
$add_fields[$field_name.'_plain'] = Array('type'=>'string', 'error_field'=>$field_name);
$add_fields[ $field_options['verify_field'].'_plain' ] = Array('type'=>'string', 'error_field'=>$field_options['verify_field'] );
$add_fields = array_merge_recursive2($add_fields, $object->VirtualFields);
$object->setVirtualFields($add_fields);
}
}
function Format($value, $field_name, &$object, $format=null)
{
return $value;
}
function Parse($value, $field_name, &$object)
{
$options = $object->GetFieldOptions($field_name);
$fields = Array('master_field','verify_field');
$fields_set = true;
$flip_count = 0;
while($flip_count < 2)
{
if( getArrayValue($options,$fields[0]) )
{
$object->SetDBField($field_name.'_plain', $value);
if( !getArrayValue($object->Fields[ $options[ $fields[0] ] ], $fields[1].'_set') )
{
$object->Fields[ $options[ $fields[0] ] ][$fields[1].'_set'] = true;
}
$password_field = $options[ $fields[0] ];
$verify_field = $field_name;
}
$fields = array_reverse($fields);
$flip_count++;
}
if( getArrayValue($object->Fields[$password_field], 'verify_field_set') && getArrayValue($object->Fields[$verify_field], 'master_field_set') )
{
$new_password = $object->GetDBField($password_field.'_plain');
$verify_password = $object->GetDBField($verify_field.'_plain');
if($new_password == '' && $verify_password == '')
{
if( $object->GetDBField($password_field) != $this->EncryptPassword('') )
{
+ if ($options['encryption_method'] == 'plain') return $value;
return $this->EncryptPassword($value);
}
else
{
$object->Fields[$password_field.'_plain']['required'] = true;
$object->Fields[$verify_field.'_plain']['required'] = true;
return null;
}
}
$min_length = $this->Application->ConfigValue('Min_Password');
if( strlen($new_password) >= $min_length )
{
if($new_password != $verify_password)
{
$object->ErrorMsgs['passwords_do_not_match'] = $this->Application->Phrase('lu_passwords_do_not_match');
$object->FieldErrors[$password_field]['pseudo'] = 'passwords_do_not_match';
$object->FieldErrors[$verify_field]['pseudo'] = 'passwords_do_not_match';
}
}
else
{
$object->ErrorMsgs['passwords_min_length'] = sprintf($this->Application->Phrase('lu_passwords_too_short'), $min_length);
$object->FieldErrors[$password_field]['pseudo'] = 'passwords_min_length';
$object->FieldErrors[$verify_field]['pseudo'] = 'passwords_min_length';
}
}
if($value == '') return $object->GetDBField($field_name);
+
+ if ($options['encryption_method'] == 'plain') return $value;
return $this->EncryptPassword($value);
}
- function EncryptPassword($value)
+ function EncryptPassword($value, $salt=null)
{
- return md5($value);
+ if (!isset($salt)) return md5($value);
+ return md5(md5($value).$salt);
}
}
\ No newline at end of file
Property changes on: trunk/core/kernel/utility/formatters/password_formatter.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/core/kernel/utility/debugger.php
===================================================================
--- trunk/core/kernel/utility/debugger.php (revision 6427)
+++ trunk/core/kernel/utility/debugger.php (revision 6428)
@@ -1,1091 +1,1091 @@
<?php
if( !class_exists('Debugger') ) {
class Debugger {
/**
* Set to true if fatal error occured
*
* @var bool
*/
var $IsFatalError = false;
/**
* Debugger data for building report
*
* @var Array
*/
var $Data = Array();
var $ProfilerData = Array();
var $ProfilerTotals = Array();
var $ProfilerTotalCount = Array();
/**
* Prevent recursion when processing debug_backtrace() function results
*
* @var Array
*/
var $RecursionStack = Array();
var $scrollbarWidth = 0;
/**
* Long errors are saved here, because trigger_error doesn't support error messages over 1KB in size
*
* @var Array
*/
var $longErrors = Array();
var $IncludesData = Array();
var $IncludeLevel = 0;
var $reportDone = false;
/**
* Transparent spacer image used in case of none spacer image defined via SPACER_URL contant.
* Used while drawing progress bars (memory usage, time usage, etc.)
*
* @var string
*/
var $dummyImage = 'http://www.adamauto.lv/chevrolet/images/spacer.gif';
/**
* Temporary files created by debugger will be stored here
*
* @var string
*/
var $tempFolder = '';
/**
* Debug rows will be separated using this string before writing to debug file
*
* @var string
*/
var $rowSeparator = '@@';
/**
* Base URL for debugger includes
*
* @var string
*/
var $baseURL = '';
function Debugger()
{
global $start;
$this->InitDebugger();
$this->profileStart('kernel4_startup', 'Startup and Initialization of kernel4', $start);
$this->profileStart('script_runtime', 'Script runtime', $start);
error_reporting(E_ALL);
ini_set('display_errors', $this->constOn('DBG_ZEND_PRESENT') ? 0 : 1); // show errors on screen in case if not in Zend Studio debugging
$this->scrollbarWidth = $this->isGecko() ? 22 : 25; // vertical scrollbar width differs in Firefox and other browsers
$this->appendRequest();
}
/**
* Set's default values to constants debugger uses
*
*/
function InitDebugger()
{
unset($_REQUEST['debug_host'], $_REQUEST['debug_fastfile']); // this var messed up whole detection stuff :(
// Detect fact, that this session beeing debugged by Zend Studio
foreach ($_REQUEST as $rq_name => $rq_value) {
if (substr($rq_name, 0, 6) == 'debug_') {
$this->safeDefine('DBG_ZEND_PRESENT', 1);
break;
}
}
$this->safeDefine('DBG_ZEND_PRESENT', 0); // set this constant value to 0 (zero) to debug debugger using Zend Studio
// set default values for debugger constants
$dbg_constMap = Array(
'DBG_USE_HIGHLIGHT' => 1, // highlight output same as php code using "highlight_string" function
'DBG_WINDOW_WIDTH' => 700, // set width of debugger window (in pixels) for better viewing large amount of debug data
'DBG_USE_SHUTDOWN_FUNC' => DBG_ZEND_PRESENT ? 0 : 1, // use shutdown function to include debugger code into output
'DBG_HANDLE_ERRORS' => DBG_ZEND_PRESENT ? 0 : 1, // handle all allowed by php (see php manual) errors instead of default handler
'DBG_IGNORE_STRICT_ERRORS' => 1, // ignore PHP5 errors about private/public view modified missing in class declarations
'DBG_DOMVIEWER' => '/temp/domviewer.html', // path to DOMViewer on website
'DOC_ROOT' => str_replace('\\', '/', realpath($_SERVER['DOCUMENT_ROOT']) ), // windows hack
'DBG_LOCAL_BASE_PATH' => 'w:', // replace DOC_ROOT in filenames (in errors) using this path
);
// only for IE, in case if no windows php script editor defined
if (!defined('DBG_EDITOR')) {
// $dbg_constMap['DBG_EDITOR'] = 'c:\Program Files\UltraEdit\uedit32.exe %F/%L';
$dbg_constMap['DBG_EDITOR'] = 'c:\Program Files\Zend\ZendStudio-5.2.0\bin\ZDE.exe %F';
}
foreach ($dbg_constMap as $dbg_constName => $dbg_constValue) {
$this->safeDefine($dbg_constName, $dbg_constValue);
}
}
function constOn($const_name)
{
return defined($const_name) && constant($const_name);
}
function safeDefine($const_name, $const_value) {
if (!defined($const_name)) {
define($const_name, $const_value);
}
}
function InitReport()
{
if (!class_exists('kApplication')) return false;
$application =& kApplication::Instance();
// string used to separate debugger records while in file (used in debugger dump filename too)
$this->rowSeparator = '@'.(is_object($application->Factory) ? $application->GetSID() : 0).'@';
// include debugger files from this url
$reg_exp = '/^'.preg_quote(FULL_PATH, '/').'/';
$kernel_path = preg_replace($reg_exp, '', KERNEL_PATH, 1);
$this->baseURL = PROTOCOL.SERVER_NAME.rtrim(BASE_PATH, '/').$kernel_path.'/utility/debugger';
// save debug output in this folder
$this->tempFolder = FULL_PATH.'/kernel/cache';
}
function mapLongError($msg)
{
$key = $this->generateID();
$this->longErrors[$key] = $msg;
return $key;
}
/**
* Appends all passed variable values (wihout variable names) to debug output
*
*/
function dumpVars()
{
$dumpVars = func_get_args();
foreach ($dumpVars as $varValue) {
$this->Data[] = Array('value' => $varValue, 'debug_type' => 'var_dump');
}
}
function prepareHTML($dataIndex)
{
$Data =& $this->Data[$dataIndex];
if ($Data['debug_type'] == 'html') {
return $Data['html'];
}
switch ($Data['debug_type']) {
case 'error':
$fileLink = $this->getFileLink($Data['file'], $Data['line']);
$ret = '<b class="debug_error">'.$this->getErrorNameByCode($Data['no']).'</b>: '.$Data['str'];
$ret .= ' in <b>'.$fileLink.'</b> on line <b>'.$Data['line'].'</b>';
return $ret;
break;
case 'var_dump':
return $this->highlightString( $this->print_r($Data['value'], true) );
break;
case 'trace':
ini_set('memory_limit', '500M');
$trace =& $Data['trace'];
$i = 0; $traceCount = count($trace);
$ret = '';
while ($i < $traceCount) {
$traceRec =& $trace[$i];
$argsID = 'trace_args_'.$dataIndex.'_'.$i;
$has_args = isset($traceRec['args']);
if (isset($traceRec['file'])) {
$func_name = isset($traceRec['class']) ? $traceRec['class'].$traceRec['type'].$traceRec['function'] : $traceRec['function'];
$args_link = $has_args ? '<a href="javascript:$Debugger.ToggleTraceArgs(\''.$argsID.'\');" title="Show/Hide Function Arguments"><b>Function</b></a>' : '<b>Function</b>';
$ret .= $args_link.': '.$this->getFileLink($traceRec['file'], $traceRec['line'], $func_name);
$ret .= ' in <b>'.basename($traceRec['file']).'</b> on line <b>'.$traceRec['line'].'</b><br>';
}
else {
$ret .= 'no file information available';
}
if ($has_args) {
// if parameter value is longer then 200 symbols, then leave only first 50
$args = $this->highlightString($this->print_r($traceRec['args'], true, 50, 200));
$ret .= '<div id="'.$argsID.'" style="display: none;">'.$args.'</div>';
}
$i++;
}
return $ret;
break;
case 'profiler':
$profileKey = $Data['profile_key'];
$Data =& $this->ProfilerData[$profileKey];
$runtime = ($Data['ends'] - $Data['begins']); // in seconds
$totals_key = getArrayValue($Data, 'totalsKey');
if ($totals_key) {
$total_before = $Data['totalsBefore'];
$total = $this->ProfilerTotals[$totals_key];
$div_width = Array();
$total_width = ($this->getWindowWidth()-10);
$div_width['before'] = round(($total_before / $total) * $total_width);
$div_width['current'] = round(($runtime / $total) * $total_width);
$div_width['left'] = round((($total - $total_before - $runtime) / $total) * $total_width);
$ret = '<b>Name</b>: '.$Data['description'].'<br />';
-
+
if (isset($Data['file'])) {
$ret .= '[<b>Runtime</b>: '.$runtime.'s] [<b>File</b>: '.$Data['file'].']<br />';
}
else {
$ret .= '<b>Runtime</b>: '.$runtime.'s<br />';
}
-
+
$ret .= '<div class="dbg_profiler" style="width: '.$div_width['before'].'px; border-right: 0px; background-color: #298DDF;"><img src="'.$this->dummyImage.'" width="1" height="1"/></div>';
$ret .= '<div class="dbg_profiler" style="width: '.$div_width['current'].'px; border-left: 0px; border-right: 0px; background-color: #EF4A4A;"><img src="'.$this->dummyImage.'" width="1" height="1"/></div>';
$ret .= '<div class="dbg_profiler" style="width: '.$div_width['left'].'px; border-left: 0px; background-color: #DFDFDF;"><img src="'.$this->dummyImage.'" width="1" height="1"/></div>';
return $ret;
}
else {
return '<b>Name</b>: '.$Data['description'].'<br><b>Runtime</b>: '.$runtime.'s';
}
break;
default:
return 'incorrect debug data';
break;
}
}
function getWindowWidth()
{
return DBG_WINDOW_WIDTH - $this->scrollbarWidth - 8;
}
/**
* Tells debugger to skip objects that are heavy in plan of memory usage while printing debug_backtrace results
*
* @param Object $object
* @return bool
*/
function IsBigObject(&$object)
{
$skip_classes = Array(
defined('APPLICATION_CLASS') ? APPLICATION_CLASS : 'kApplication',
'kFactory',
'kUnitConfigReader',
'TemplateParser',
);
foreach ($skip_classes as $class_name) {
if (strtolower(get_class($object)) == strtolower($class_name)) {
return true;
}
}
return false;
}
/**
* Advanced version of print_r (for debugger only). Don't print objects recursively
*
* @param Array $array
* @param bool $return_output return output or print it out
* @param int $cut_first cut first N symbols, don't cut anything if -1 specified
* @package int $cut_min_length cut only of this length of string or greather
* @return string
*/
function print_r(&$array, $return_output = false, $cut_first = -1, $cut_min_length = -1)
{
static $first_line = true, $tab_count = -1;
-
+
if (is_null($array)) {
return 'NULL';
}elseif (!is_array($array)) {
if ($cut_min_length != -1 && strlen($array) > $cut_min_length) {
$array = substr($array, 0, $cut_first).' ...';
}
return $array;
}
-
+
$output = '';
-
+
$tab_count++;
$output .= "Array\n".str_repeat(' ', $tab_count)."(\n";
-
+
$tab_count++;
$tabsign = $tab_count ? str_repeat(' ', $tab_count) : '';
-
+
$array_keys = array_keys($array);
foreach ($array_keys as $key) {
switch (gettype($array[$key])) {
case 'array':
$output .= $tabsign.'['.$key.'] = '.$this->print_r($array[$key], true, 50, 200);
break;
case 'boolean':
$output .= $tabsign.'['.$key.'] = '.($array[$key] ? 'true' : 'false')."\n";
break;
case 'integer':
case 'double':
case 'string':
if ($cut_min_length != -1 && strlen($array[$key]) > $cut_min_length) {
$array[$key] = substr($array[$key], 0, $cut_first).' ...';
}
$output .= $tabsign.'['.$key.'] = '.$array[$key]."\n";
break;
-
+
case 'NULL':
$output .= $tabsign.'['.$key."] = NULL\n";
break;
-
+
case 'object':
$attribute_names = get_class_vars( get_class($array[$key]) );
if (!$attribute_names) {
$output .= $tabsign.'['.$key."] = NO_ATTRIBUTES\n";
}
else {
if ($this->IsBigObject($array[$key])) {
$output .= $tabsign.'['.$key.'] = SKIPPED (class: '.get_class($array[$key]).")\n";
break;
}
-
+
// $attribute_value - default value for this attribute, not used here
foreach ($attribute_names as $attribute_name => $attribute_value) {
if (is_object($array[$key]->$attribute_name)) {
// it is object
$object_class = get_class($array[$key]->$attribute_name);
if (!in_array($object_class, $this->RecursionStack)) {
// object [not in recursion stack]
if ($this->IsBigObject($array[$key]->$attribute_name)) {
$output .= $tabsign.'['.$attribute_name.'] = SKIPPED (class: '.$object_class.")\n";
continue;
}
-
+
array_push($this->RecursionStack, $object_class);
$output .= $this->print_r($array[$key]->$attribute_name, true, 50, 200);
array_pop($this->RecursionStack);
}
else {
// object [in recursion stack]
$output .= $tabsign.'['.$attribute_name.'] = *** RECURSION *** (class: '.$object_class.")\n";
}
}
else {
$output .= $tabsign.'['.$attribute_name.'] = '.$this->print_r($array[$key]->$attribute_name, true, 50, 200)."\n";
}
}
}
break;
-
+
default:
$output .= $tabsign.'['.$key.'] unknown = '.gettype($array[$key])."\n";
break;
}
}
-
+
$tab_count--;
$output .= str_repeat(' ', $tab_count).")\n";
-
+
if ($first_line) {
$first_line = false;
$output .= "\n";
}
-
+
$tab_count--;
-
+
if ($return_output) {
return $output;
}
else {
echo $output;
}
-
+
return true;
}
/**
* Returns only first 200 chars of string, this allow to save amount of data sent to browser
*
* @param string $string
* @return string
*/
function cutStringForHTML($string)
{
if (strlen($string) > 200) {
$string = substr($string,0,50).' ...';
}
return $string;
}
/**
* Format SQL Query using predefined formatting
* and highlighting techniques
*
* @param string $sql
* @return string
*/
function formatSQL($sql)
{
$sql = preg_replace('/(\n|\t| )+/is', ' ', $sql);
$sql = preg_replace('/(CREATE TABLE|DROP TABLE|SELECT|UPDATE|SET|REPLACE|INSERT|DELETE|VALUES|FROM|LEFT JOIN|INNER JOIN|LIMIT|WHERE|HAVING|GROUP BY|ORDER BY) /is', "\n\t$1 ", $sql);
return $this->highlightString($sql);
}
function highlightString($string)
{
if (!$this->constOn('DBG_USE_HIGHLIGHT')) {
return $string;
}
$string = str_replace( Array('\\', '/') , Array('_no_match_string_', '_n_m_s_'), $string);
$string = highlight_string('<?php '.$string.'?>', true);
$string = str_replace( Array('_no_match_string_', '_n_m_s_'), Array('\\', '/'), $string);
return preg_replace('/&lt;\?(.*)php(.*)\?&gt;/Us', '\\2', $string);
}
/**
* Determine by php type of browser used to show debugger
*
* @return bool
*/
function isGecko()
{
return strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'firefox') !== false;
}
/**
* Returns link for editing php file (from error) in external editor
*
* @param string $file filename with path from root folder
* @param int $lineno line number in file where error is found
* @param string $title text to show on file edit link
* @return string
*/
function getFileLink($file, $lineno = 1, $title = '')
{
if (!$title) {
$title = str_replace('/', '\\', $this->getLocalFile($file));
}
if ($this->isGecko()) {
return '<a href="file://'.$this->getLocalFile($file).'">'.$title.'</a>';
}
else {
return '<a href="javascript:$Debugger.editFile(\''.$this->getLocalFile($file).'\', '.$lineno.');" title="'.$file.'">'.$title.'</a>';
}
}
/**
* Converts filepath on server to filepath in mapped DocumentRoot on developer pc
*
* @param string $remoteFile
* @return string
*/
function getLocalFile($remoteFile)
{
return preg_replace('/^'.preg_quote(DOC_ROOT, '/').'/', DBG_LOCAL_BASE_PATH, $remoteFile, 1);
}
/**
* Appends call trace till this method call
*
*/
function appendTrace()
{
$trace = debug_backtrace();
array_shift($trace);
-
+
$this->Data[] = Array('trace' => $trace, 'debug_type' => 'trace');
}
function appendMemoryUsage($msg, $used = null)
{
if (!isset($used)) {
$used = round(memory_get_usage() / 1024);
}
$this->appendHTML('<b>Memory usage</b> '.$msg.' '.$used.'Kb');
}
/**
* Appends HTML code whithout transformations
*
* @param string $html
*/
function appendHTML($html)
{
$this->Data[] = Array('html' => $html, 'debug_type' => 'html');
}
/**
* Change debugger info that was already generated before.
* Returns true if html was set.
*
* @param int $index
* @param string $html
* @param string $type = {'append','prepend','replace'}
* @return bool
*/
function setHTMLByIndex($index, $html, $type = 'append')
{
if (!isset($this->Data[$index]) || $this->Data[$index]['debug_type'] != 'html') {
return false;
}
switch ($type) {
case 'append':
$this->Data[$index]['html'] .= '<br>'.$html;
break;
case 'prepend':
$this->Data[$index]['html'] = $this->Data[$index]['html'].'<br>'.$html;
break;
case 'replace':
$this->Data[$index]['html'] = $html;
break;
}
return true;
}
/**
* Move $debugLineCount lines of input from debug output
* end to beginning.
*
* @param int $debugLineCount
*/
function moveToBegin($debugLineCount)
{
$lines = array_splice($this->Data,count($this->Data)-$debugLineCount,$debugLineCount);
$this->Data = array_merge($lines,$this->Data);
}
function moveAfterRow($new_row, $debugLineCount)
{
$lines = array_splice($this->Data,count($this->Data)-$debugLineCount,$debugLineCount);
$rows_before = array_splice($this->Data,0,$new_row,$lines);
$this->Data = array_merge($rows_before,$this->Data);
}
function appendRequest()
{
if (isset($_SERVER['SCRIPT_FILENAME'])) {
$script = $_SERVER['SCRIPT_FILENAME'];
}
else {
$script = $_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF'];
}
$this->appendHTML('ScriptName: <b>'.$this->getFileLink($script, 1, basename($script)).'</b> (<b>'.dirname($script).'</b>)');
if (isset($_REQUEST['ajax']) && $_REQUEST['ajax'] == 'yes') {
$this->appendHTML('RequestURI: '.$_SERVER['REQUEST_URI'].' (QS Length:'.strlen($_SERVER['QUERY_STRING']).')');
}
$this->appendHTML('<a href="http://www.brainjar.com/dhtml/domviewer/" target="_blank">DomViewer</a>: <input id="dbg_domviewer" type="text" value="window" style="border: 1px solid #000000;"/>&nbsp;<button class="button" onclick="return $Debugger.OpenDOMViewer();">Show</button>');
ob_start();
?>
<table border="0" cellspacing="0" cellpadding="0" class="dbg_flat_table" style="width: <?php echo $this->getWindowWidth(); ?>px;">
<thead style="font-weight: bold;">
<td width="20">Src</td><td>Name</td><td>Value</td>
</thead>
<?php
foreach ($_REQUEST as $key => $value) {
if(!is_array($value) && trim($value) == '') {
$value = '<b class="debug_error">no value</b>';
}
else {
$value = htmlspecialchars($this->print_r($value, true));
}
$in_cookie = isset($_COOKIE[$key]);
$src = isset($_GET[$key]) && !$in_cookie ? 'GE' : (isset($_POST[$key]) && !$in_cookie ? 'PO' : ($in_cookie ? 'CO' : '?') );
echo '<tr><td>'.$src.'</td><td>'.$key.'</td><td>'.$value.'</td></tr>';
}
?>
</table>
<?php
$this->appendHTML(ob_get_contents());
ob_end_clean();
}
/**
* Appends php session content to debugger output
*
*/
function appendSession()
{
if (isset($_SESSION) && $_SESSION) {
$this->appendHTML('PHP Session: [<b>'.ini_get('session.name').'</b>]');
$this->dumpVars($_SESSION);
$this->moveToBegin(2);
}
}
function profileStart($key, $description = null, $timeStamp = null)
{
if (!isset($timeStamp)) {
$timeStamp = $this->getMoment();
}
$this->ProfilerData[$key] = Array('begins' => $timeStamp, 'ends' => 5000, 'debuggerRowID' => count($this->Data));
if (isset($description)) {
$this->ProfilerData[$key]['description'] = $description;
}
if (substr($key, 0, 4) == 'sql_') {
// append place from what was called
$trace_results = debug_backtrace();
$trace_count = count($trace_results);
$i = 0;
while ($i < $trace_count) {
$trace_file = basename($trace_results[$i]['file']);
if ($trace_file != 'db_connection.php' && $trace_file != 'adodb.inc.php') {
break;
}
$i++;
}
$this->ProfilerData[$key]['file'] = $trace_file.':'.$trace_results[$i]['line'];
unset($trace_results);
}
-
+
$this->Data[] = Array('profile_key' => $key, 'debug_type' => 'profiler');
}
function profileFinish($key, $description = null, $timeStamp = null)
{
if (!isset($timeStamp)) {
$timeStamp = $this->getMoment();
}
$this->ProfilerData[$key]['ends'] = $timeStamp;
if (isset($description)) {
$this->ProfilerData[$key]['description'] = $description;
}
}
function profilerAddTotal($total_key, $key = null, $value = null)
{
if (!isset($this->ProfilerTotals[$total_key])) {
$this->ProfilerTotals[$total_key] = 0;
$this->ProfilerTotalCount[$total_key] = 0;
}
if (!isset($value)) {
$value = $this->ProfilerData[$key]['ends'] - $this->ProfilerData[$key]['begins'];
}
if (isset($key)) {
$this->ProfilerData[$key]['totalsKey'] = $total_key;
$this->ProfilerData[$key]['totalsBefore'] = $this->ProfilerTotals[$total_key];
}
$this->ProfilerTotals[$total_key] += $value;
$this->ProfilerTotalCount[$total_key]++;
}
function getMoment()
{
list($usec, $sec) = explode(' ', microtime());
return ((float)$usec + (float)$sec);
}
function generateID()
{
list($usec, $sec) = explode(' ', microtime());
$id_part_1 = substr($usec, 4, 4);
$id_part_2 = mt_rand(1,9);
$id_part_3 = substr($sec, 6, 4);
$digit_one = substr($id_part_1, 0, 1);
if ($digit_one == 0) {
$digit_one = mt_rand(1,9);
$id_part_1 = ereg_replace("^0",'',$id_part_1);
$id_part_1=$digit_one.$id_part_1;
}
return $id_part_1.$id_part_2.$id_part_3;
}
function getErrorNameByCode($error_code)
{
$error_map = Array(
'Fatal Error' => Array(E_USER_ERROR),
'Warning' => Array(E_WARNING, E_USER_WARNING),
'Notice' => Array(E_NOTICE, E_USER_NOTICE),
);
if (defined('E_STRICT')) {
$error_map['PHP5 Strict'] = Array(E_STRICT);
}
foreach ($error_map as $error_name => $error_codes) {
if (in_array($error_code, $error_codes)) {
return $error_name;
}
}
return '';
}
/**
* Generates report
*
*/
function printReport($returnResult = false, $clean_output_buffer = true)
{
if ($this->reportDone) {
// don't print same report twice (in case if shutdown function used + compression + fatal error)
return '';
}
-
+
$this->profileFinish('script_runtime');
$this->breakOutofBuffering();
$debugger_start = memory_get_usage();
if (defined('SPACER_URL')) {
$this->dummyImage = SPACER_URL;
}
$this->InitReport(); // set parameters required by AJAX
// defined here, because user can define this contant while script is running, not event before debugger is started
$this->safeDefine('DBG_RAISE_ON_WARNINGS', 0);
$this->safeDefine('DBG_TOOLBAR_BUTTONS', 1);
-
+
$this->appendSession(); // show php session if any
// ensure, that 1st line of debug output always is this one:
$top_line = '<table cellspacing="0" cellpadding="0" style="width: '.$this->getWindowWidth().'px; margin: 0px;"><tr><td align="left" width="50%">[<a href="javascript:window.location.reload();">Reload Frame</a>] [<a href="javascript:$Debugger.Toggle(27);">Hide Debugger</a>]</td><td align="right" width="50%">[Current Time: <b>'.date('H:i:s').'</b>] [File Size: <b>#DBG_FILESIZE#</b>]</td></tr></table>';
-
+
$this->appendHTML($top_line);
$this->moveToBegin(1);
if ($this->constOn('DBG_SQL_PROFILE') && isset($this->ProfilerTotals['sql'])) {
// sql query profiling was enabled -> show totals
$this->appendHTML('<b>SQL Total time:</b> '.$this->ProfilerTotals['sql'].' <b>Number of queries</b>: '.$this->ProfilerTotalCount['sql']);
}
if ($this->constOn('DBG_PROFILE_INCLUDES') && isset($this->ProfilerTotals['includes'])) {
// included file profiling was enabled -> show totals
$this->appendHTML('<b>Included Files Total time:</b> '.$this->ProfilerTotals['includes'].' Number of includes: '.$this->ProfilerTotalCount['includes']);
}
if ($this->constOn('DBG_PROFILE_MEMORY')) {
// detailed memory usage reporting by objects was enabled -> show totals
$this->appendHTML('<b>Memory used by Objects:</b> '.round($this->ProfilerTotals['objects'] / 1024, 2).'Kb');
}
/*if ($this->constOn('DBG_INCLUDED_FILES')) {
$files = get_included_files();
$this->appendHTML('<b>Included files:</b>');
foreach ($files as $file) {
$this->appendHTML($this->getFileLink($this->getLocalFile($file)).' ('.round(filesize($file) / 1024, 2).'Kb)');
}
}*/
/*if ($this->constOn('DBG_PROFILE_INCLUDES')) {
$this->appendHTML('<b>Included files statistics:</b>'.( $this->constOn('DBG_SORT_INCLUDES_MEM') ? ' (sorted by memory usage)':''));
$totals = Array( 'mem' => 0, 'time' => 0);
$totals_configs = Array( 'mem' => 0, 'time' => 0);
if (is_array($this->IncludesData['mem'])) {
if ( $this->constOn('DBG_SORT_INCLUDES_MEM') ) {
array_multisort($this->IncludesData['mem'], SORT_DESC, $this->IncludesData['file'], $this->IncludesData['time'], $this->IncludesData['level']);
}
foreach ($this->IncludesData['file'] as $key => $file_name) {
$this->appendHTML( str_repeat('&nbsp;->&nbsp;', ($this->IncludesData['level'][$key] >= 0 ? $this->IncludesData['level'][$key] : 0)).$file_name.' Mem: '.sprintf("%.4f Kb", $this->IncludesData['mem'][$key]/1024).' Time: '.sprintf("%.4f", $this->IncludesData['time'][$key]));
if ($this->IncludesData['level'][$key] == 0) {
$totals['mem'] += $this->IncludesData['mem'][$key];
$totals['time'] += $this->IncludesData['time'][$key];
}
else if ($this->IncludesData['level'][$key] == -1) {
$totals_configs['mem'] += $this->IncludesData['mem'][$key];
$totals_configs['time'] += $this->IncludesData['time'][$key];
}
}
$this->appendHTML('<b>Sub-Total classes:</b> '.' Mem: '.sprintf("%.4f Kb", $totals['mem']/1024).' Time: '.sprintf("%.4f", $totals['time']));
$this->appendHTML('<b>Sub-Total configs:</b> '.' Mem: '.sprintf("%.4f Kb", $totals_configs['mem']/1024).' Time: '.sprintf("%.4f", $totals_configs['time']));
$this->appendHTML('<span class="error"><b>Grand Total:</b></span> '.' Mem: '.sprintf("%.4f Kb", ($totals['mem']+$totals_configs['mem'])/1024).' Time: '.sprintf("%.4f", $totals['time']+$totals_configs['time']));
}
}*/
-
+
$is_ajax = isset($_GET['ajax']) && $_GET['ajax'] == 'yes';
$skip_reporting = $this->constOn('DBG_SKIP_REPORTING') || $this->constOn('DBG_ZEND_PRESENT');
-
+
if ($is_ajax || !$skip_reporting) {
$debug_file = $this->tempFolder.'/debug_'.$this->rowSeparator.'.txt';
if (file_exists($debug_file)) unlink($debug_file);
-
+
$i = 0;
$fp = fopen($debug_file, 'a');
$lineCount = count($this->Data);
while ($i < $lineCount) {
fwrite($fp, $this->prepareHTML($i).$this->rowSeparator);
$i++;
}
fclose($fp);
}
-
+
if ($skip_reporting) {
// let debugger write report and then don't output anything
$this->reportDone = true;
return '';
}
-
+
ob_start();
?>
<html><body></body></html>
<script type="text/javascript" src="<?php echo $this->baseURL; ?>/debugger.js"></script>
<link rel="stylesheet" rev="stylesheet" href="<?php echo $this->baseURL; ?>/debugger.css" type="text/css" media="screen" />
<div id="debug_layer" class="debug_layer_container" style="display: none; width: <?php echo DBG_WINDOW_WIDTH; ?>px;">
<div class="debug_layer" style="width: <?php echo $this->getWindowWidth(); ?>px;">
<table width="100%" cellpadding="0" cellspacing="1" border="0" class="debug_layer_table" style="width: <?php echo $this->getWindowWidth(); ?>px;" align="left">
<tbody id="debug_table"></tbody>
</table>
</div>
</div>
<script type="text/javascript">
var $Debugger = new Debugger();
$Debugger.IsFatalError = <?php echo $this->IsFatalError ? 'true' : 'false'; ?>;
$Debugger.DOMViewerURL = '<?php echo constant('DBG_DOMVIEWER'); ?>';
$Debugger.EditorPath = '<?php echo defined('DBG_EDITOR') ? addslashes(DBG_EDITOR) : '' ?>';
$Debugger.RowSeparator = '<?php echo $this->rowSeparator; ?>';
$Debugger.DebugURL = '<?php echo $this->baseURL.'/debugger_responce.php?sid='.$this->rowSeparator; ?>';
<?php
if ($this->IsFatalError || DBG_RAISE_ON_WARNINGS) {
echo '$Debugger.Toggle();';
}
if (DBG_TOOLBAR_BUTTONS) {
echo '$Debugger.AddToolbar("$Debugger");';
}
?>
window.focus();
</script>
<?php
if (!isset($this->ProfilerTotals['error_handling'])) {
$memory_used = $debugger_start;
$this->ProfilerTotalCount['error_handling'] = 0;
}
else {
$memory_used = $debugger_start - $this->ProfilerTotals['error_handling'];
}
if ($returnResult) {
$ret = ob_get_contents();
if ($clean_output_buffer) {
ob_end_clean();
}
$ret .= $this->getShortReport($memory_used);
$this->reportDone = true;
return $ret;
}
else {
if (!$this->constOn('DBG_HIDE_FULL_REPORT')) {
$this->breakOutofBuffering();
}
elseif ($clean_output_buffer) {
ob_clean();
}
echo $this->getShortReport($memory_used);
$this->reportDone = true;
}
}
/**
* Format's memory usage report by debugger
*
* @return string
* @access private
*/
function getShortReport($memory_used)
{
$info = Array(
'Script Runtime' => 'PROFILE:script_runtime',
'-' => 'SEP:-',
'Notice / Warning' => 'PROFILE_TC:error_handling',
'SQLs Count' => 'PROFILE_TC:sql',
);
$ret = '<tr><td>Application:</td><td><b>'.$this->formatSize($memory_used).'</b> ('.$memory_used.')</td></tr>';
foreach ($info as $title => $value_key) {
list ($record_type, $record_data) = explode(':', $value_key, 2);
switch ($record_type) {
case 'PROFILE': // profiler totals value
$Data =& $this->ProfilerData[$record_data];
$profile_time = ($Data['ends'] - $Data['begins']); // in seconds
$ret .= '<tr><td>'.$title.':</td><td><b>'.sprintf('%.5f', $profile_time).' s</b></td></tr>';
break;
case 'PROFILE_TC': // profile totals record count
$record_cell = '<td>';
if ($record_data == 'error_handling' && $this->ProfilerTotalCount[$record_data] > 0) {
$record_cell = '<td class="debug_error">';
}
$ret .= '<tr>'.$record_cell.$title.':</td>'.$record_cell.'<b>'.$this->ProfilerTotalCount[$record_data].'</b></td></tr>';
break;
case 'SEP':
$ret .= '<tr><td colspan="2" style="height: 1px; background-color: #000000; padding: 0px;"><img src="'.$this->dummyImage.'" height="1" alt=""/></td></tr>';
break;
}
}
-
+
return '<br /><table class="dbg_stats_table"><tr><td style="border-color: #FFFFFF;"><table class="dbg_stats_table" align="left">'.$ret.'</table></td></tr></table>';
}
/**
* User-defined error handler
*
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
* @param array $errcontext
*/
function saveError($errno, $errstr, $errfile = '', $errline = '', $errcontext = '')
{
$this->ProfilerData['error_handling']['begins'] = memory_get_usage();
$errorType = $this->getErrorNameByCode($errno);
if (!$errorType) {
trigger_error('Unknown error type ['.$errno.']', E_USER_ERROR);
return false;
}
if ($this->constOn('DBG_IGNORE_STRICT_ERRORS') && defined('E_STRICT') && ($errno == E_STRICT)) return;
if (preg_match('/(.*)#([\d]+)$/', $errstr, $rets) ) {
// replace short message with long one (due triger_error limitations on message size)
$long_id = $rets[2];
$errstr = $this->longErrors[$long_id];
unset($this->longErrors[$long_id]);
}
if (strpos($errfile,'eval()\'d code') !== false) {
$errstr = '[<b>EVAL</b>, line <b>'.$errline.'</b>]: '.$errstr;
$tmpStr = $errfile;
$pos = strpos($tmpStr,'(');
$errfile = substr($tmpStr, 0, $pos);
$pos++;
$errline = substr($tmpStr,$pos,strpos($tmpStr,')',$pos)-$pos);
}
$this->Data[] = Array('no' => $errno, 'str' => $errstr, 'file' => $errfile, 'line' => $errline, 'context' => $errcontext, 'debug_type' => 'error');
$this->ProfilerData['error_handling']['ends'] = memory_get_usage();
$this->profilerAddTotal('error_handling', 'error_handling');
if (substr($errorType, 0, 5) == 'Fatal') {
$this->IsFatalError = true;
// append debugger report to data in buffer & clean buffer afterwards
die( $this->breakOutofBuffering(false) . $this->printReport(true) );
}
}
-
+
function breakOutofBuffering($flush = true)
{
$buffer_content = Array();
while (ob_get_level()) {
$buffer_content[] = ob_get_clean();
}
$ret = implode('', array_reverse($buffer_content));
if ($flush) {
echo $ret;
flush();
}
return $ret;
}
function saveToFile($msg)
{
$fp = fopen($_SERVER['DOCUMENT_ROOT'].'/vb_debug.txt', 'a');
fwrite($fp, $msg."\n");
fclose($fp);
}
/**
* Formats file/memory size in nice way
*
* @param int $bytes
* @return string
* @access public
*/
function formatSize($bytes)
{
if ($bytes >= 1099511627776) {
$return = round($bytes / 1024 / 1024 / 1024 / 1024, 2);
$suffix = "TB";
} elseif ($bytes >= 1073741824) {
$return = round($bytes / 1024 / 1024 / 1024, 2);
$suffix = "GB";
} elseif ($bytes >= 1048576) {
$return = round($bytes / 1024 / 1024, 2);
$suffix = "MB";
} elseif ($bytes >= 1024) {
$return = round($bytes / 1024, 2);
$suffix = "KB";
} else {
$return = $bytes;
$suffix = "Byte";
}
$return .= ' '.$suffix;
return $return;
}
function printConstants($constants)
{
if (!is_array($constants)) {
$constants = explode(',', $constants);
}
$contant_tpl = '<tr><td>%s</td><td><b>%s</b></td></tr>';
$ret = '<table class="dbg_flat_table" style="width: '.$this->getWindowWidth().'px;">';
foreach ($constants as $constant_name) {
$ret .= sprintf($contant_tpl, $constant_name, constant($constant_name));
}
$ret .= '</table>';
$this->appendHTML($ret);
}
function AttachToApplication() {
if (!$this->constOn('DBG_HANDLE_ERRORS')) return true;
if (class_exists('kApplication')) {
restore_error_handler();
$application =& kApplication::Instance();
$application->Debugger =& $this;
$application->errorHandlers[] = Array(&$this, 'saveError');
}
else {
set_error_handler(Array(&$this, 'saveError'));
}
}
}
if (!function_exists('memory_get_usage')) {
function memory_get_usage(){ return -1; }
}
if (!Debugger::constOn('DBG_ZEND_PRESENT')) {
$debugger = new Debugger();
}
if (Debugger::constOn('DBG_USE_SHUTDOWN_FUNC')) {
register_shutdown_function( Array(&$debugger, 'printReport') );
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/utility/debugger.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.60
\ No newline at end of property
+1.61
\ No newline at end of property
Index: trunk/core/kernel/utility/email.php
===================================================================
--- trunk/core/kernel/utility/email.php (revision 6427)
+++ trunk/core/kernel/utility/email.php (revision 6428)
@@ -1,456 +1,459 @@
<?php
class kEmailMessage extends kBase {
var $Compiled;
var $Headers;
var $HeadersArray;
var $BodyText;
var $BodyHtml;
var $Body;
var $Subject;
// var $From;
// var $To;
// var $ReplyTo;
// var $CC;
// var $BCC;
var $Charset;
var $LineFeed;
var $TransferEncoding;
var $From;
var $To;
var $IsMultipart;
var $Parts;
var $Files;
var $TextBoundary;
var $EmailBoundary;
function kEmailMessage(){
parent::kBase();
//$this->TextBoundary = uniqid(adodb_mktime());
$this->EmailBoundary = uniqid(adodb_mktime());
$this->LineFeed = "\n";
- $this->Charset='ISO-8859-1';
+
+ $lang =& $this->Application->recallObject('lang.current');
+ $this->Charset = $lang->GetDBField('Charset') ? $lang->GetDBField('Charset') : 'ISO-8859-1';
+
$this->TransferEncoding='8bit';
$this->Body = '';
$this->setHeader('Subject', 'Automatically generated message');
$this->HeadersArray=array();
$this->setHeader('Mime-Version', '1.0');
}
function setHeader($header, $value){
$this->HeadersArray[$header] = $value;
$this->Compiled = false;
}
function fixLineBreaks($data)
{
$data = str_replace("\n\n","\r\n\r\n",$data);
$data = str_replace("\r\n","\n",$data);
$data = str_replace("\n","\r\n",$data);
return $data;
}
function setHeaders($headers){
$headers=$this->fixLineBreaks($headers);
$headers_lines = explode("\r\n", $headers);
foreach ($headers_lines as $line_num => $line){
list($header_field, $header_value) = explode(':', $line, 2);
$header_value = trim($header_value);
$this->setHeader($header_field, $header_value);
if ($header_field == 'Subject') $this->Subject = $header_value;
}
}
function appendHeader($header, $value){
$this->HeadersArray[$header][] = $value;
$this->Compiled = false;
}
function setFrom($from, $name=''){
$this->From = $from;
if ($name!=''){
$from = trim($name).' <'.$from.'>';
}
$this->setHeader('From', trim($from));
}
function setTo($to, $name=''){
$this->To = $to;
if ($name!=''){
$to = trim($name).' <'.$to.'>';
}
$this->setHeader('To', trim($to));
}
function setSubject($subj){
$this->setHeader('Subject', $subj);
}
function SetCC($to_cc){
$this->appendHeader('CC', $to_cc);
}
function SetBCC($to_bcc){
$this->appendHeader('BCC', $to_bcc);
}
function setReplyTo($reply_to){
$this->setHeader('Reply-to', $reply_to);
}
function Clear()
{
$this->Compiled = false;
$this->Body = '';
$this->BodyHtml = '';
$this->BodyText = '';
$this->Headers = '';
$this->Files = '';
$this->From = '';
$this->To = '';
}
function setTextBody($body_text){
$this->BodyText = $body_text;
$this->Compiled = false;
}
function setHTMLBody($body_html){
$this->BodyHtml = $body_html;
$this->IsMultipart = true;
$this->Compiled = false;
}
function convertHTMLtoPlain($text)
{
$search = Array (
"'(<\/td>.*)[\r\n]+(.*<td)'i",//formating text in tables
"'(<br[ ]?[\/]?>[\r\n]{0,2})|(<\/p>)|(<\/div>)|(<\/tr>)'i",
"'<head>(.*?)</head>'si",
"'<style(.*?)</style>'si",
"'<title>(.*?)</title>'si",
"'<script(.*?)</script>'si",
// "'^[\s\n\r\t]+'", //strip all spacers & newlines in the begin of document
// "'[\s\n\r\t]+$'", //strip all spacers & newlines in the end of document
"'&(quot|#34);'i",
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
"'&#(\d+);'e"
);
$replace = Array (
"\\1\t\\2",
"\n",
"",
"",
"",
"",
// "",
// "",
"\"",
"&",
"<",
">",
" ",
chr(161),
chr(162),
chr(163),
chr(169),
"chr(\\1)"
);
return strip_tags( preg_replace ($search, $replace, $text) );
}
function compileBody(){
if($this->BodyHtml){
$not_html = $this->convertHTMLtoPlain($this->BodyHtml);
// $not_html = $this->removeBlankLines($not_html);
// Fixing problem with add exclamation characters "!" into the body of the email.
$not_html = wordwrap($not_html, 72);
$this->BodyHtml = wordwrap($this->BodyHtml, 72);
$this->Body = '';
//$this->Body .= 'Content-Type: multipart/alternative;'.$this->LF()." ".'boundary="----='.$this->TextBoundary.'"'.$this->LF();
//$this->Body .= $this->LF();
$this->Body .= '------='.$this->EmailBoundary.$this->LF();
$this->Body .= 'Content-Type: text/plain;'." ".'charset="'.$this->Charset.'"'.$this->LF();
$this->Body .= $this->LF();
$this->Body .= $not_html.$this->LF().$this->LF();
$this->Body .= '------='.$this->EmailBoundary.$this->LF();
$this->Body .= 'Content-Type: text/html;'." ".'charset="'.$this->Charset.'"'.$this->LF();
$this->Body .= 'Content-Transfer-Encoding: '.$this->TransferEncoding.$this->LF();
$this->Body .= 'Content-Description: HTML part'.$this->LF();
$this->Body .= 'Content-Disposition: inline'.$this->LF();
$this->Body .= $this->LF();
$this->BodyHtml = str_replace("\r", "", $this->BodyHtml);
$this->BodyHtml = str_replace("\n", $this->LF(), $this->BodyHtml);
$this->Body .= $this->BodyHtml;
$this->Body .= $this->LF().$this->LF();
$this->IsMultipart = true;
}else{
$not_html = $this->convertHTMLtoPlain($this->BodyText);
// $not_html = $this->removeBlankLines($not_html);
// Fixing problem with add exclamation characters "!" into the body of the email.
$not_html = wordwrap($not_html, 72);
if ($this->IsMultipart){
$this->Body .= '------='.$this->EmailBoundary.$this->LF();
$this->Body .= 'Content-Type: text/plain;'.$this->LF()." ".'charset="'.$this->Charset.'"'.$this->LF();
$this->Body .= 'Content-Disposition: inline'.$this->LF();
$this->Body .= $this->LF();
$this->Body .= $not_html.$this->LF().$this->LF();
}else{
//$this->BodyText = str_replace("\r", "", $this->BodyText);
//$this->BodyText = str_replace("\n", $this->LF(), $this->BodyText);
$this->Body = $not_html;
}
}
}
function setCharset($charset){
$this->Charset = $charset;
$this->Compiled = false;
}
function setLineFeed($linefeed){
$this->LineFeed=$linefeed;
}
function attachFile($filepath, $mime="application/octet-stream"){
if(is_file($filepath)){
$file_info = array('path'=>$filepath, 'mime'=>$mime);
$this->Files[] = $file_info;
}else{
$this->Application->ApplicationDie('File "'.$filepath.'" not exist...'."\n");
}
$this->IsMultipart = true;
$this->Compiled = false;
}
function LF($str=''){
$str = str_replace("\n", "", $str);
$str = str_replace("\r", "", $str);
return $str.$this->LineFeed;
}
function getContentType(){
$content_type="";
if ($this->IsMultipart){
$content_type .= $this->LF('multipart/alternative; boundary="----='.$this->EmailBoundary.'"');
}else{
$content_type .= $this->LF('text/plain;');
$content_type .= $this->LF(" ".'charset='.$this->Charset);
}
return $content_type;
}
// ========================================
function compileHeaders(){
$this->Headers="";
// $this->Headers .= "From: ".$this->LF($this->From);
//if ($this->ReplyTo){
// $this->Headers .= "Reply-To: ".$this->ReplyTo.$this->LF();
//}
//$this->Headers .= "To: ".$this->LF($this->To);
//$this->Headers .= "Subject: ".$this->LF($this->Subject);
/*
if (sizeof($this->CC)){
$this->Headers .= "Cc: ";
foreach ($this->Cc as $key => $addr){
$this->Headers.=$this->LF($addr.',');
}
}
if (sizeof($this->BCC)){
$this->Headers .= "Bcc: ";
foreach ($this->BCC as $key => $addr){
$this->Headers.=$this->LF($addr.',');
}
}
*/
foreach ($this->HeadersArray as $key => $val){
if ($key=="To" || $key=="") continue; // avoid duplicate "To" field in headers
if (is_array($val)){
$val = chunk_split(implode(', ', $val),72, $this->LF().' ');
$this->Headers .= $key.": ".$val.$this->LF();
}else{
$this->Headers .= $key.": ".$val.$this->LF();
}
}
if ($this->IsMultipart) {
$this->Headers .= 'MIME-Version: 1.0'.$this->LF();
}
$this->Headers .= "Content-Type: ".$this->getContentType();
//$this->Headers .= "Content-Transfer-Encoding: ".$this->TransferEncoding.$this->LF();
}
function compileFiles(){
if ($this->Files){
foreach($this->Files as $key => $file_info)
{
$filepath = $file_info['path'];
$mime = $file_info['mime'];
$attachment_header = $this->LF('------='.$this->EmailBoundary);
$attachment_header .= $this->LF('Content-Type: '.$mime.'; name="'.basename($filepath).'"');
$attachment_header .= $this->LF('Content-Transfer-Encoding: base64');
$attachment_header .= $this->LF('Content-Description: '.basename($filepath));
$attachment_header .= $this->LF('Content-Disposition: attachment; filename="'.basename($filepath).'"');
$attachment_header .= $this->LF('');
$attachment_data = fread(fopen($filepath,"rb"),filesize($filepath));
$attachment_data = base64_encode($attachment_data);
$attachment_data = chunk_split($attachment_data,72);
$this->Body .= $attachment_header.$attachment_data.$this->LF('');
$this->IsMultipart = true;
}
}
}
function compile(){
if ($this->Compiled) return;
$this->compileBody();
$this->compileFiles();
$this->compileHeaders();
// Compile
if ($this->IsMultipart){
$this->Body .= '------='.$this->EmailBoundary.'--'.$this->LF();
}
$this->Body = $this->fixLineBreaks($this->Body);
$this->Headers = $this->fixLineBreaks($this->Headers);
$this->Compiled = true;
}
// ========================================
function getHeaders(){
$this->Compile();
return $this->Headers;
}
function getBody(){
$this->Compile();
return $this->Body;
}
function send(){
return mail($this->HeadersArray['To'], $this->HeadersArray['Subject'], "", $this->getHeaders().$this->LF().$this->LF().$this->getBody());
//return mail($this->HeadersArray['To'], $this->HeadersArray['Subject'], "", $this->getHeaders().$this->LF().$this->LF().$this->getBody(), '-f'.$this->From);
}
function sendSMTP(&$smtp_object, $smtp_host, $user, $pass, $auth_used = 0){
$params['host'] = $smtp_host; // The smtp server host/ip
$params['port'] = 25; // The smtp server port
$params['helo'] = $_SERVER['HTTP_HOST']; // What to use when sending the helo command. Typically, your domain/hostname
$params['auth'] = TRUE; // Whether to use basic authentication or not
$params['user'] = $user; // Username for authentication
$params['pass'] = $pass; // Password for authentication
$params['debug'] = 1;
if ($auth_used == 0){
$params['authmethod'] = 'NOAUTH'; // forse disabling auth
}
if (strpos($this->To, ',') !== false) {
$this->To = str_replace(' ', '', $this->To);
$send_params['recipients'] = explode(',', $this->To);
}
else {
$send_params['recipients'] = array($this->To); // The recipients (can be multiple)
}
$send_params['headers'] = explode("\r\n", $this->getHeaders());
array_unshift($send_params['headers'], 'To: '.$this->HeadersArray['To']);
$send_params['from'] = $this->From; // This is used as in the MAIL FROM: cmd
// It should end up as the Return-Path: header
$send_params['body']=$this->getBody();
if($smtp_object->connect($params) && $smtp_object->send($send_params)){
if ( $this->Application->isDebugMode() )
{
$this->Application->Debugger->appendHTML('<pre>'.$smtp_object->debugtext.'</pre>');
//define('DBG_REDIRECT', 1);
}
return true;
}
else {
if ( $this->Application->isDebugMode() )
{
$this->Application->Debugger->appendHTML('<pre>'.$smtp_object->debugtext.'</pre>');
//define('DBG_REDIRECT', 1);
}
return false;
}
}
}
?>
Property changes on: trunk/core/kernel/utility/email.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.15
\ No newline at end of property
+1.16
\ No newline at end of property
Index: trunk/core/kernel/db/db_tag_processor.php
===================================================================
--- trunk/core/kernel/db/db_tag_processor.php (revision 6427)
+++ trunk/core/kernel/db/db_tag_processor.php (revision 6428)
@@ -1,1580 +1,1592 @@
<?php
class kDBTagProcessor extends TagProcessor {
/**
* Description
*
* @var kDBConnection
* @access public
*/
var $Conn;
function kDBTagProcessor()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
/**
* Returns true if "new" button was pressed in toolbar
*
* @param Array $params
* @return bool
*/
function IsNewMode($params)
{
$object =& $this->getObject($params);
return $object->GetID() <= 0;
}
/**
* Returns view menu name for current prefix
*
* @param Array $params
* @return string
*/
function GetItemName($params)
{
$item_name = $this->Application->getUnitOption($this->Prefix, 'ViewMenuPhrase');
return $this->Application->Phrase($item_name);
}
function ViewMenu($params)
{
$block_params = $params;
unset($block_params['block']);
$block_params['name'] = $params['block'];
$list =& $this->GetList($params);
$block_params['PrefixSpecial'] = $list->getPrefixSpecial();
return $this->Application->ParseBlock($block_params);
}
function SearchKeyword($params)
{
$list =& $this->GetList($params);
return $this->Application->RecallVar($list->getPrefixSpecial().'_search_keyword');
}
/**
* Draw filter menu content (for ViewMenu) based on filters defined in config
*
* @param Array $params
* @return string
*/
function DrawFilterMenu($params)
{
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['spearator_block'];
$separator = $this->Application->ParseBlock($block_params);
$filter_menu = $this->Application->getUnitOption($this->Prefix,'FilterMenu');
if(!$filter_menu)
{
trigger_error('<span class="debug_error">no filters defined</span> for prefix <b>'.$this->Prefix.'</b>, but <b>DrawFilterMenu</b> tag used', E_USER_WARNING);
return '';
}
// Params: label, filter_action, filter_status
$block_params['name'] = $params['item_block'];
$view_filter = $this->Application->RecallVar($this->getPrefixSpecial().'_view_filter');
if($view_filter === false)
{
$event_params = Array('prefix'=>$this->Prefix,'special'=>$this->Special,'name'=>'OnRemoveFilters');
$this->Application->HandleEvent( new kEvent($event_params) );
$view_filter = $this->Application->RecallVar($this->getPrefixSpecial().'_view_filter');
}
$view_filter = unserialize($view_filter);
$filters = Array();
$prefix_special = $this->getPrefixSpecial();
foreach ($filter_menu['Filters'] as $filter_key => $filter_params) {
$group_params = isset($filter_params['group_id']) ? $filter_menu['Groups'][ $filter_params['group_id'] ] : Array();
if (!isset($group_params['element_type'])) {
$group_params['element_type'] = 'checkbox';
}
if (!$filter_params) {
$filters[] = $separator;
continue;
}
$block_params['label'] = addslashes( $this->Application->Phrase($filter_params['label']) );
if (getArrayValue($view_filter,$filter_key)) {
$submit = 0;
$status = $group_params['element_type'] == 'checkbox' ? 1 : 2;
}
else {
$submit = 1;
$status = 0;
}
$block_params['filter_action'] = 'set_filter("'.$prefix_special.'","'.$filter_key.'","'.$submit.'",'.$params['ajax'].');';
$block_params['filter_status'] = $status; // 1 - checkbox, 2 - radio, 0 - no image
$filters[] = $this->Application->ParseBlock($block_params);
}
return implode('', $filters);
}
function IterateGridFields($params)
{
$mode = $params['mode'];
$def_block = $params['block'];
$grids = $this->Application->getUnitOption($this->Prefix,'Grids');
$grid_config = $grids[$params['grid']]['Fields'];
$std_params['pass_params']='true';
$std_params['PrefixSpecial']=$this->getPrefixSpecial();
$o = '';
foreach ($grid_config as $field => $options) {
$block_params = Array();
$block_params['name'] = isset($options[$mode.'_block']) ? $options[$mode.'_block'] : $def_block;
$block_params['field'] = $field;
$block_params['sort_field'] = isset($options['sort_field']) ? $options['sort_field'] : $field;
$block_params = array_merge($std_params, $block_params, $options);
$o.= $this->Application->ParseBlock($block_params, 1);
}
return $o;
}
function GridFieldsCount($params)
{
$grids = $this->Application->getUnitOption($this->Prefix, 'Grids');
$grid_config = $grids[$params['grid']]['Fields'];
return count($grid_config);
}
/**
* Prints list content using block specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintList($params)
{
$list =& $this->GetList($params);
$id_field = $this->Application->getUnitOption($this->Prefix,'IDField');
$list->Query();
$o = '';
$list->GoFirst();
$block_params=$this->prepareTagParams($params);
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
$block_params['pass_params'] = 'true';
while (!$list->EOL())
{
$this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET
$o.= $this->Application->ParseBlock($block_params, 1);
$list->GoNext();
}
$this->Application->SetVar( $this->getPrefixSpecial().'_id', '');
return $o;
}
function InitList($params)
{
$list_name = isset($params['list_name']) ? $params['list_name'] : '';
$names_mapping = $this->Application->GetVar('NamesToSpecialMapping');
if( !getArrayValue($names_mapping, $this->Prefix, $list_name) )
{
$list =& $this->GetList($params);
}
}
function BuildListSpecial($params)
{
return $this->Special;
}
/**
* Enter description here...
*
* @param Array $params
* @return kDBList
*/
function &GetList($params)
{
$list_name = $this->SelectParam($params, 'list_name,name');
if (!$list_name) {
$list_name = $this->Application->Parser->GetParam('list_name');
}
$requery = getArrayValue($params, 'requery');
if ($list_name && !$requery){
$names_mapping = $this->Application->GetVar('NamesToSpecialMapping');
$special = getArrayValue($names_mapping, $this->Prefix, $list_name);
if(!$special)
{
$special = $this->BuildListSpecial($params);
}
}
else
{
$special = $this->BuildListSpecial($params);
}
$prefix_special = rtrim($this->Prefix.'.'.$special, '.');
$params['skip_counting'] = true;
$list =& $this->Application->recallObject( $prefix_special, $this->Prefix.'_List', $params);
if ($requery) {
$this->Application->HandleEvent($an_event, $prefix_special.':OnListBuild', $params);
}
$list->Query($requery);
$this->Special = $special;
if ($list_name) {
$names_mapping[$this->Prefix][$list_name] = $special;
$this->Application->SetVar('NamesToSpecialMapping', $names_mapping);
}
return $list;
}
function ListMarker($params)
{
$list =& $this->GetList($params);
$ret = $list->getPrefixSpecial();
if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/');
return $ret;
}
function SubmitName($params)
{
$list =& $this->GetList($params);
$prefix_special = $list->getPrefixSpecial();
return 'events['.$prefix_special.']['.$params['event'].']';
}
function CombinedSortingDropDownName($params)
{
$list =& $this->GetList($params);
$prefix_special = $list->getPrefixSpecial();
return $prefix_special.'_CombinedSorting';
}
function SortingSelected($params)
{
$list =& $this->GetList($params);
$user_sorting_start = $this->getUserSortIndex();
$sorting = strtolower($list->GetOrderField($user_sorting_start).'|'.$list->GetOrderDirection($user_sorting_start));
if ($sorting == strtolower($params['sorting'])) return $params['selected'];
}
/**
* Prints list content using block specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintList2($params)
{
$per_page = $this->SelectParam($params, 'per_page,max_items');
if ($per_page !== false) $params['per_page'] = $per_page;
$list =& $this->GetList($params);
$o = '';
$direction = (isset($params['direction']) && $params['direction']=="H")?"H":"V";
$columns = (isset($params['columns'])) ? $params['columns'] : 1;
$id_field = (isset($params['id_field'])) ? $params['id_field'] : $this->Application->getUnitOption($this->Prefix, 'IDField');
if ($columns>1 && $direction=="V") {
$list->Records = $this->LinearToVertical($list->Records, $columns, $list->GetPerPage());
$list->SelectedCount=count($list->Records);
ksort($list->Records); // this is issued twice, maybe need to be removed
}
$list->GoFirst();
$block_params=$this->prepareTagParams($params);
$block_params['name']=$this->SelectParam($params, 'render_as,block');
$block_params['pass_params']='true';
$block_params['column_width'] = 100 / $columns;
$block_start_row_params = $this->prepareTagParams($params);
$block_start_row_params['name'] = $this->SelectParam($params, 'row_start_render_as,block_row_start,row_start_block');
$block_end_row_params=$this->prepareTagParams($params);
$block_end_row_params['name'] = $this->SelectParam($params, 'row_end_render_as,block_row_end,row_end_block');
$block_empty_cell_params = $this->prepareTagParams($params);
$block_empty_cell_params['name'] = $this->SelectParam($params, 'empty_cell_render_as,block_empty_cell,empty_cell_block');
$i=0;
$backup_id=$this->Application->GetVar($this->Prefix."_id");
$displayed = array();
$column_number = 1;
$cache_mod_rw = $this->Application->getUnitOption($this->Prefix, 'CacheModRewrite') && $this->Application->RewriteURLs();
while (!$list->EOL())
{
$this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET
$this->Application->SetVar( $this->Prefix.'_id', $list->GetDBField($id_field) );
if ($cache_mod_rw) {
$this->Application->setCache('filenames', $this->Prefix.'_'.$list->GetDBField($id_field), $list->GetDBField('Filename'));
$this->Application->setCache('filenames', 'c_'.$list->GetDBField('CategoryId'), $list->GetDBField('CategoryFilename'));
}
if ($i % $columns == 0) {
// record in this iteration is first in row, then open row
$column_number = 1;
$o.= $block_start_row_params['name'] ?
$this->Application->ParseBlock($block_start_row_params, 1) :
(!isset($params['no_table']) ? '<tr>' : '');
}
else {
$column_number++;
}
$block_params['column_number'] = $column_number;
$o.= $this->Application->ParseBlock($block_params, 1);
array_push($displayed, $list->GetDBField($id_field));
if (($i+1) % $columns == 0) {
// record in next iteration is first in row too, then close this row
$o.= $block_end_row_params['name'] ?
$this->Application->ParseBlock($block_end_row_params, 1) :
(!isset($params['no_table']) ? '<tr>' : '');
}
$list->GoNext();
$i++;
}
// append empty cells in place of missing cells in last row
while ($i % $columns != 0) {
// until next cell will be in new row append empty cells
$o .= $block_empty_cell_params['name'] ? $this->Application->ParseBlock($block_empty_cell_params, 1) : '<td>&nbsp;</td>';
if (($i+1) % $columns == 0) {
// record in next iteration is first in row too, then close this row
$o .= $block_end_row_params['name'] ? $this->Application->ParseBlock($block_end_row_params, 1) : '</tr>';
}
$i++;
}
$cur_displayed = $this->Application->GetVar($this->Prefix.'_displayed_ids');
if (!$cur_displayed) {
$cur_displayed = Array();
}
else {
$cur_displayed = explode(',', $cur_displayed);
}
$displayed = array_unique(array_merge($displayed, $cur_displayed));
$this->Application->SetVar($this->Prefix.'_displayed_ids', implode(',',$displayed));
$this->Application->SetVar( $this->Prefix.'_id', $backup_id);
$this->Application->SetVar( $this->getPrefixSpecial().'_id', '');
if (isset($params['more_link_render_as'])) {
$block_params = $params;
$params['render_as'] = $params['more_link_render_as'];
$o .= $this->MoreLink($params);
}
return $o;
}
function MoreLink($params)
{
$per_page = $this->SelectParam($params, 'per_page,max_items');
if ($per_page !== false) $params['per_page'] = $per_page;
$list =& $this->GetList($params);
if ($list->PerPage < $list->RecordsCount) {
$block_params = array();
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
return $this->Application->ParseBlock($block_params, 1);
}
}
function NotLastItem($params)
{
$object =& $this->getList($params); // maybe we should use $this->GetList($params) instead
return ($object->CurrentIndex < min($object->PerPage == -1 ? $object->RecordsCount : $object->PerPage, $object->RecordsCount) - 1);
}
function PageLink($params)
{
$t = isset($params['template']) ? $param['template'] : '';
if (!$t) $t = $this->Application->GetVar('t');
if (isset($params['page'])) {
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $params['page']);
}
// $http_query =& $this->Application->recallObject('HTTPQuery');
// $get = $http_query->getRedirectParams();
$pass = Array('pass' => 'm,'.$this->getPrefixSpecial());
// $pass = array_merge($get, $pass);
return $this->Application->HREF($t, '', $pass);
}
function ColumnWidth($params)
{
$columns = $this->Application->Parser->GetParam('columns');
return round(100/$columns).'%';
}
/**
* Append prefix and special to tag
* params (get them from tagname) like
* they were really passed as params
*
* @param Array $tag_params
* @return Array
* @access protected
*/
function prepareTagParams($tag_params = Array())
{
/*if (isset($tag_params['list_name'])) {
$list =& $this->GetList($tag_params);
$this->Init($list->Prefix, $list->Special);
}*/
$ret = $tag_params;
$ret['Prefix'] = $this->Prefix;
$ret['Special'] = $this->Special;
$ret['PrefixSpecial'] = $this->getPrefixSpecial();
return $ret;
}
function GetISO($currency)
{
if ($currency == 'selected') {
$iso = $this->Application->RecallVar('curr_iso');
}
elseif ($currency == 'primary' || $currency == '') {
$iso = $this->Application->GetPrimaryCurrency();
}
else { //explicit currency
$iso = $currency;
}
return $iso;
}
function ConvertCurrency($value, $iso)
{
$converter =& $this->Application->recallObject('kCurrencyRates');
// convery primary currency to selected (if they are the same, converter will just return)
$value = $converter->Convert($value, 'PRIMARY', $iso);
return $value;
}
function AddCurrencySymbol($value, $iso)
{
$currency =& $this->Application->recallObject('curr.-'.$iso, null, Array('skip_autoload' => true));
if( !$currency->isLoaded() ) $currency->Load($iso, 'ISO');
$symbol = $currency->GetDBField('Symbol');
if (!$symbol) $symbol = $currency->GetDBField('ISO').'&nbsp;';
if ($currency->GetDBField('SymbolPosition') == 0) {
$value = $symbol.$value;
}
if ($currency->GetDBField('SymbolPosition') == 1) {
$value = $value.$symbol;
}
return $value;
}
/**
* Get's requested field value
*
* @param Array $params
* @return string
* @access public
*/
function Field($params)
{
$field = $this->SelectParam($params, 'name,field');
if( !$this->Application->IsAdmin() ) $params['no_special'] = 'no_special';
$object =& $this->getObject($params);
if ( $this->HasParam($params, 'db') )
{
$value = $object->GetDBField($field);
}
else
{
if( $this->HasParam($params, 'currency') )
{
$iso = $this->GetISO($params['currency']);
$original = $object->GetDBField($field);
$value = $this->ConvertCurrency($original, $iso);
$object->SetDBField($field, $value);
$object->Fields[$field]['converted'] = true;
}
$format = getArrayValue($params, 'format');
if( !$format || $format == '$format' )
{
$format = null;
}
else
{
if(preg_match("/_regional_(.*)/", $format, $regs))
{
$lang =& $this->Application->recallObject('lang.current');
$format = $lang->GetDBField($regs[1]);
}
}
$value = $object->GetField($field, $format);
if( $this->SelectParam($params, 'negative') )
{
if(strpos($value, '-') === 0)
{
$value = substr($value, 1);
}
else
{
$value = '-'.$value;
}
}
if( $this->HasParam($params, 'currency') )
{
$value = $this->AddCurrencySymbol($value, $iso);
$params['no_special'] = 1;
}
}
if( !$this->HasParam($params, 'no_special') ) $value = htmlspecialchars($value);
if( getArrayValue($params,'checked' ) ) $value = ($value == ( isset($params['value']) ? $params['value'] : 1)) ? 'checked' : '';
- if( getArrayValue($params,'as_label') ) $value = $this->Application->Phrase($value);
+ if( isset($params['plus_or_as_label']) ) {
+ $value = substr($value, 0,1) == '+' ? substr($value, 1) : $this->Application->Phrase($value);
+ }
+ elseif( getArrayValue($params,'as_label') ) $value = $this->Application->Phrase($value);
$first_chars = $this->SelectParam($params,'first_chars,cut_first');
if($first_chars)
{
$needs_cut = strlen($value) > $first_chars;
$value = substr($value,0,$first_chars);
if($needs_cut) $value .= ' ...';
}
if( getArrayValue($params,'nl2br' ) ) $value = nl2br($value);
if ($value != '') $this->Application->Parser->DataExists = true;
if( $this->HasParam($params, 'currency') )
{
//restoring value in original currency, for other Field tags to work properly
$object->SetDBField($field, $original);
}
return $value;
}
function SetField($params)
{
// <inp2:SetField field="Value" src=p:cust_{$custom_name}"/>
$object =& $this->getObject($params);
$dst_field = $this->SelectParam($params, 'name,field');
list($prefix_special, $src_field) = explode(':', $params['src']);
$src_object =& $this->Application->recallObject($prefix_special);
$object->SetDBField($dst_field, $src_object->GetDBField($src_field));
}
/**
* Checks if parameter is passed
* Note: works like Tag and line simple method too
*
* @param Array $params
* @param string $param_name
* @return bool
*/
function HasParam($params, $param_name = null)
{
if( !isset($param_name) )
{
$param_name = $this->SelectParam($params, 'name');
$params = $this->Application->Parser->Params;
}
$value = getArrayValue($params, $param_name);
return $value && ($value != '$'.$param_name);
}
function PhraseField($params)
{
$field_label = $this->Field($params);
$translation = $this->Application->Phrase( $field_label );
return $translation;
}
function Error($params)
{
$field = $this->SelectParam($params, 'name,field');
$object =& $this->getObject($params);
$msg = $object->GetErrorMsg($field, false);
return $msg;
}
function HasError($params)
{
if ($params['field'] == 'any')
{
$object =& $this->getObject($params);
$skip_fields = getArrayValue($params, 'except');
$skip_fields = $skip_fields ? explode(',', $skip_fields) : Array();
return $object->HasErrors($skip_fields);
}
else
{
$fields = $this->SelectParam($params, 'field,fields');
$fields = explode(',', $fields);
$res = false;
foreach($fields as $field)
{
$params['field'] = $field;
$res = $res || ($this->Error($params) != '');
}
return $res;
}
}
function IsRequired($params)
{
$field = $params['field'];
$object =& $this->getObject($params);;
+ $formatter_class = getArrayValue($object->Fields, $field, 'formatter');
+ if ($formatter_class == 'kMultiLanguage')
+ {
+ $formatter =& $this->Application->recallObject($formatter_class);
+ $field = $formatter->LangFieldName($field);
+ }
+
$options = $object->GetFieldOptions($field);
return getArrayValue($options,'required');
}
function PredefinedOptions($params)
{
$field = $params['field'];
$object =& $this->getObject($params);
$value = $object->GetDBField($field);
$options = $object->GetFieldOptions($field);
if( $this->HasParam($params,'has_empty') )
{
$empty_value = getArrayValue($params, 'empty_value');
if($empty_value === false) $empty_value = '';
$options['options'] = array_merge_recursive2( Array($empty_value => ''), $options['options'] );
}
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
$block_params['field'] = $params['field'];
$block_params['pass_params'] = 'true';
$block_params['field_name'] = $this->InputName($params);
$block_params['PrefixSpecial'] = $this->getPrefixSpecial();
$selected_param_name = getArrayValue($params,'selected_param');
if(!$selected_param_name) $selected_param_name = $params['selected'];
$selected = $params['selected'];
$o = '';
if( $this->HasParam($params,'no_empty') && !getArrayValue($options['options'],'') ) array_shift($options['options']);
if( strpos($value, '|') !== false )
{
// multiple selection checkboxes
$value = explode('|', substr($value, 1, -1) );
foreach ($options['options'] as $key => $val)
{
$block_params['key'] = $key;
$block_params['option'] = $val;
$block_params[$selected_param_name] = ( in_array($key, $value) ? ' '.$selected : '');
$o .= $this->Application->ParseBlock($block_params, 1);
}
}
else
{
// single selection radio or checkboxes
foreach ($options['options'] as $key => $val)
{
$block_params['key'] = $key;
$block_params['option'] = $val;
$block_params[$selected_param_name] = ( $key == $value ? ' '.$selected : '');
$o .= $this->Application->ParseBlock($block_params, 1);
}
}
return $o;
}
function PredefinedSearchOptions($params)
{
$object =& $this->getObject($params);
$field = $params['field'];
$saved_value = $object->GetDBField($field);
$custom_filters = $this->Application->RecallVar( $this->getPrefixSpecial().'_custom_filters');
if ($custom_filters) {
$custom_filters = unserialize($custom_filters);
$append = getArrayValue($params, 'type') ? '_'.$params['type'] : '';
$object->SetDBField($field, $custom_filters[$field.$append]);
}
else {
$object->SetDBField($field, '');
}
$ret = $this->PredefinedOptions($params);
$object->SetDBField($field, $saved_value);
return $ret;
}
function Format($params)
{
$field = $this->SelectParam($params, 'name,field');
$object =& $this->getObject($params);
$options = $object->GetFieldOptions($field);
$format = $options[ $this->SelectParam($params, 'input_format') ? 'input_format' : 'format' ];
$formatter_class = getArrayValue($options,'formatter');
if($formatter_class)
{
$formatter =& $this->Application->recallObject($formatter_class);
$human_format = getArrayValue($params,'human');
$edit_size = getArrayValue($params,'edit_size');
$sample = getArrayValue($params,'sample');
if($sample)
{
return $formatter->GetSample($field, $options, $object);
}
elseif($human_format || $edit_size)
{
$format = $formatter->HumanFormat($format);
return $edit_size ? strlen($format) : $format;
}
}
return $format;
}
/**
* Print grid pagination using
* block names specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintPages($params)
{
$list =& $this->GetList($params);
$prefix_special = $list->getPrefixSpecial();
$total_pages = $list->GetTotalPages();
if ($total_pages > 1) $this->Application->Parser->DataExists = true;
if($total_pages == 0) $total_pages = 1; // display 1st page as selected in case if we have no pages at all
$o = '';
// what are these 2 lines for?
$this->Application->SetVar($prefix_special.'_event','');
$this->Application->SetVar($prefix_special.'_id','');
$current_page = $list->Page; // $this->Application->RecallVar($prefix_special.'_Page');
$block_params = $this->prepareTagParams($params);
$split = ( isset($params['split'] ) ? $params['split'] : 10 );
$split_start = $current_page - ceil($split/2);
if ($split_start < 1){
$split_start = 1;
}
$split_end = $split_start + $split-1;
if ($split_end > $total_pages) {
$split_end = $total_pages;
$split_start = max($split_end - $split + 1, 1);
}
if ($current_page > 1){
$prev_block_params = $this->prepareTagParams();
if ($total_pages > $split){
$prev_block_params['page'] = max($current_page-$split, 1);
$prev_block_params['name'] = $this->SelectParam($params, 'prev_page_split_render_as,prev_page_split_block');
if ($prev_block_params['name']){
$o .= $this->Application->ParseBlock($prev_block_params, 1);
}
}
$prev_block_params['name'] = 'page';
$prev_block_params['page'] = $current_page-1;
$prev_block_params['name'] = $this->SelectParam($params, 'prev_page_render_as,block_prev_page,prev_page_block');
if ($prev_block_params['name']) {
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $current_page-1);
$o .= $this->Application->ParseBlock($prev_block_params, 1);
}
}
else {
if ( $no_prev_page_block = $this->SelectParam($params, 'no_prev_page_render_as,block_no_prev_page') ) {
$block_params['name'] = $no_prev_page_block;
$o .= $this->Application->ParseBlock($block_params, 1);
}
}
$separator_params['name'] = $this->SelectParam($params, 'separator_render_as,block_separator');
for ($i = $split_start; $i <= $split_end; $i++)
{
if ($i == $current_page) {
$block = $this->SelectParam($params, 'current_render_as,active_render_as,block_current,active_block');
}
else {
$block = $this->SelectParam($params, 'link_render_as,inactive_render_as,block_link,inactive_block');
}
$block_params['name'] = $block;
$block_params['page'] = $i;
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $i);
$o .= $this->Application->ParseBlock($block_params, 1);
if ($this->SelectParam($params, 'separator_render_as,block_separator')
&& $i < $split_end)
{
$o .= $this->Application->ParseBlock($separator_params, 1);
}
}
if ($current_page < $total_pages){
$next_block_params = $this->prepareTagParams();
$next_block_params['page']=$current_page+1;
$next_block_params['name'] = $this->SelectParam($params, 'next_page_render_as,block_next_page,next_page_block');
if ($next_block_params['name']){
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $current_page+1);
$o .= $this->Application->ParseBlock($next_block_params, 1);
}
if ($total_pages > $split){
$next_block_params['page']=min($current_page+$split, $total_pages);
$next_block_params['name'] = $this->SelectParam($params, 'next_page_split_render_as,next_page_split_block');
if ($next_block_params['name']){
$o .= $this->Application->ParseBlock($next_block_params, 1);
}
}
}
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $current_page);
return $o;
}
/**
* Print grid pagination using
* block names specified
*
* @param Array $params
* @return string
* @access public
*/
function PaginationBar($params)
{
return $this->PrintPages($params);
}
/**
* Returns field name (processed by kMultiLanguage formatter
* if required) and item's id from it's IDField or field required
*
* @param Array $params
* @return Array (id,field)
* @access private
*/
function prepareInputName($params)
{
$field = $this->SelectParam($params, 'name,field');
$object =& $this->getObject($params);
$formatter_class = getArrayValue($object->Fields, $field, 'formatter');
if ($formatter_class == 'kMultiLanguage')
{
$formatter =& $this->Application->recallObject($formatter_class);
$field = $formatter->LangFieldName($field);
}
$id_field = getArrayValue($params, 'IdField');
$id = $id_field ? $object->GetDBField($id_field) : $object->GetID();
return Array($id, $field);
}
/**
* Returns input field name to
* be placed on form (for correct
* event processing)
*
* @param Array $params
* @return string
* @access public
*/
function InputName($params)
{
list($id, $field) = $this->prepareInputName($params);
$ret = $this->getPrefixSpecial().'['.$id.']['.$field.']';
if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/');
return $ret;
}
/**
* Allows to override various field options through hidden fields with specific names in submit.
* This tag generates this special names
*
* @param Array $params
* @return string
* @author Alex
*/
function FieldModifier($params)
{
list($id, $field) = $this->prepareInputName($params);
$ret = 'field_modifiers['.$this->getPrefixSpecial().']['.$field.']['.$params['type'].']';
if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/');
return $ret;
}
/**
* Returns index where 1st changable sorting field begins
*
* @return int
* @access private
*/
function getUserSortIndex()
{
$list_sortings = $this->Application->getUnitOption($this->Prefix, 'ListSortings');
$sorting_prefix = getArrayValue($list_sortings, $this->Special) ? $this->Special : '';
$user_sorting_start = 0;
if ( $forced_sorting = getArrayValue($list_sortings, $sorting_prefix, 'ForcedSorting') ) {
$user_sorting_start = count($forced_sorting);
}
return $user_sorting_start;
}
/**
* Returns order direction for given field
*
*
*
* @param Array $params
* @return string
* @access public
*/
function Order($params)
{
$field = $params['field'];
$user_sorting_start = $this->getUserSortIndex();
$list =& $this->GetList($params);
if ($list->GetOrderField($user_sorting_start) == $field)
{
return strtolower($list->GetOrderDirection($user_sorting_start));
}
elseif($list->GetOrderField($user_sorting_start+1) == $field)
{
return '2_'.strtolower($list->GetOrderDirection($user_sorting_start+1));
}
else
{
return 'no';
}
}
/**
* Get's information of sorting field at "pos" position,
* like sorting field name (type="field") or sorting direction (type="direction")
*
* @param Array $params
* @return mixed
*/
function OrderInfo($params)
{
$user_sorting_start = $this->getUserSortIndex() + --$params['pos'];
$list =& $this->GetList($params);
// $object =& $this->Application->recallObject( $this->getPrefixSpecial() );
if($params['type'] == 'field') return $list->GetOrderField($user_sorting_start);
if($params['type'] == 'direction') return $list->GetOrderDirection($user_sorting_start);
}
/**
* Checks if sorting field/direction matches passed field/direction parameter
*
* @param Array $params
* @return bool
*/
function IsOrder($params)
{
$params['type'] = isset($params['field']) ? 'field' : 'direction';
$value = $this->OrderInfo($params);
if( isset($params['field']) ) return $params['field'] == $value;
if( isset($params['direction']) ) return $params['direction'] == $value;
}
/**
* Returns list perpage
*
* @param Array $params
* @return int
*/
function PerPage($params)
{
$object =& $this->getObject($params);
return $object->PerPage;
}
/**
* Checks if list perpage matches value specified
*
* @param Array $params
* @return bool
*/
function PerPageEquals($params)
{
$object =& $this->getObject($params);
return $object->PerPage == $params['value'];
}
function SaveEvent($params)
{
// SaveEvent is set during OnItemBuild, but we may need it before any other tag calls OnItemBuild
$object =& $this->getObject($params);
return $this->Application->GetVar($this->getPrefixSpecial().'_SaveEvent');
}
function NextId($params)
{
$object =& $this->getObject($params);
$ids = explode(',', $this->Application->RecallVar($this->getPrefixSpecial().'_selected_ids'));
$cur_id = $object->GetID();
$i = array_search($cur_id, $ids);
if ($i !== false) {
return $i < count($ids) - 1 ? $ids[$i + 1] : '';
}
return '';
}
function PrevId($params)
{
$object =& $this->getObject($params);
$ids = explode(',', $this->Application->RecallVar($this->getPrefixSpecial().'_selected_ids'));
$cur_id = $object->GetID();
$i = array_search($cur_id, $ids);
if ($i !== false) {
return $i > 0 ? $ids[$i - 1] : '';
}
return '';
}
function IsSingle($params)
{
return ($this->NextId($params) === '' && $this->PrevId($params) === '');
}
function IsLast($params)
{
return ($this->NextId($params) === '');
}
function IsFirst($params)
{
return ($this->PrevId($params) === '');
}
/**
* Checks if field value is equal to proposed one
*
* @param Array $params
* @return bool
*/
function FieldEquals($params)
{
$object =& $this->getObject($params);
$ret = $object->GetDBField($this->SelectParam($params, 'name,field')) == $params['value'];
// if( getArrayValue($params,'inverse') ) $ret = !$ret;
return $ret;
}
function ItemIcon($params)
{
$object =& $this->getObject($params);
$grids = $this->Application->getUnitOption($this->Prefix,'Grids');
$icons =& $grids[ $params['grid'] ]['Icons'];
$key = '';
$status_fields = $this->Application->getUnitOption($this->Prefix,'StatusField');
if(!$status_fields) return $icons['default'];
foreach($status_fields as $status_field)
{
$key .= $object->GetDBField($status_field).'_';
}
$key = rtrim($key,'_');
$value = ($key !== false) ? $key : 'default';
return isset($icons[$value]) ? $icons[$value] : $icons['default'];
}
/**
* Generates bluebar title + initializes prefixes used on page
*
* @param Array $params
* @return string
*/
function SectionTitle($params)
{
$preset_name = replaceModuleSection($params['title_preset']);
$title_presets = $this->Application->getUnitOption($this->Prefix,'TitlePresets');
$title_info = getArrayValue($title_presets, $preset_name);
if($title_info === false) return str_replace('#preset_name#', $preset_name, $params['title']);
if( getArrayValue($title_presets,'default') )
{
// use default labels + custom labels specified in preset used
$title_info = array_merge_recursive2($title_presets['default'], $title_info);
}
$title = $title_info['format'];
// 1. get objects in use for title construction
$objects = Array();
$object_status = Array();
$status_labels = Array();
$prefixes = getArrayValue($title_info,'prefixes');
$all_tag_params = getArrayValue($title_info,'tag_params');
if($prefixes)
{
$tag_params = Array();
foreach($prefixes as $prefix_special)
{
$prefix_data = $this->Application->processPrefix($prefix_special);
$prefix_data['prefix_special'] = rtrim($prefix_data['prefix_special'],'.');
if($all_tag_params)
{
$tag_params = getArrayValue($all_tag_params, $prefix_data['prefix_special']);
if(!$tag_params) $tag_params = Array();
}
$tag_params = array_merge_recursive2($params, $tag_params);
$objects[ $prefix_data['prefix_special'] ] =& $this->Application->recallObject($prefix_data['prefix_special'], $prefix_data['prefix'], $tag_params);
$object_status[ $prefix_data['prefix_special'] ] = $objects[ $prefix_data['prefix_special'] ]->IsNewItem() ? 'new' : 'edit';
// a. set object's status field (adding item/editing item) for each object in title
if( getArrayValue($title_info[ $object_status[ $prefix_data['prefix_special'] ].'_status_labels' ],$prefix_data['prefix_special']) )
{
$status_labels[ $prefix_data['prefix_special'] ] = $title_info[ $object_status[ $prefix_data['prefix_special'] ].'_status_labels' ][ $prefix_data['prefix_special'] ];
$title = str_replace('#'.$prefix_data['prefix_special'].'_status#', $status_labels[ $prefix_data['prefix_special'] ], $title);
}
// b. setting object's titlefield value (in titlebar ONLY) to default in case if object beeing created with no titlefield filled in
if( $object_status[ $prefix_data['prefix_special'] ] == 'new' )
{
$new_value = $this->getInfo( $objects[ $prefix_data['prefix_special'] ], 'titlefield' );
if(!$new_value && getArrayValue($title_info['new_titlefield'],$prefix_data['prefix_special']) ) $new_value = $this->Application->Phrase($title_info['new_titlefield'][ $prefix_data['prefix_special'] ]);
$title = str_replace('#'.$prefix_data['prefix_special'].'_titlefield#', $new_value, $title);
}
}
}
// 2. replace phrases if any found in format string
$title = $this->Application->ReplaceLanguageTags($title,false);
// 3. find and replace any replacement vars
preg_match_all('/#(.*_.*)#/Uis',$title,$rets);
if($rets[1])
{
$replacement_vars = array_keys( array_flip($rets[1]) );
foreach($replacement_vars as $replacement_var)
{
$var_info = explode('_',$replacement_var,2);
$object =& $objects[ $var_info[0] ];
$new_value = $this->getInfo($object,$var_info[1]);
$title = str_replace('#'.$replacement_var.'#', $new_value, $title);
}
}
$cut_first = getArrayValue($params,'cut_first');
if( $cut_first && strlen($title) > $cut_first && !preg_match('/<a href="(.*)">(.*)<\/a>/',$title) ) $title = substr($title, 0, $cut_first).' ...';
return $title;
}
function getInfo(&$object, $info_type)
{
switch ($info_type)
{
case 'titlefield':
$field = $this->Application->getUnitOption($object->Prefix,'TitleField');
return $field !== false ? $object->GetField($field) : 'TitleField Missing';
break;
case 'recordcount':
$of_phrase = $this->Application->Phrase('la_of');
return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' '.$of_phrase.' '.$object->NoFilterCount : $object->RecordsCount;
break;
default:
+ return $object->GetField($info_type);
break;
}
}
/**
* Parses block depending on its element type.
* For radio and select elements values are taken from 'value_list_field' in key1=value1,key2=value2
* format. key=value can be substituted by <SQL>SELECT f1 AS OptionName, f2 AS OptionValue... FROM <PREFIX>TableName </SQL>
* where prefix is TABLE_PREFIX
*
* @param Array $params
* @return string
*/
function ConfigFormElement($params)
{
$object =& $this->getObject($params);
$field = $params['field'];
$helper =& $this->Application->recallObject('InpCustomFieldsHelper');
$element_type = $object->GetDBField($params['element_type_field']);
if($element_type == 'label') $element_type = 'text';
$params['name'] = $params['blocks_prefix'].$element_type;
switch ($element_type) {
case 'select':
case 'radio':
$field_options = $object->GetFieldOptions($field, 'options');
$field_options['options'] = $helper->GetValuesHash( $object->GetDBField($params['value_list_field']) );
$object->SetFieldOptions($field, $field_options);
break;
case 'text':
case 'textarea':
$params['field_params'] = $helper->ParseConfigSQL($object->GetDBField($params['value_list_field']));
break;
case 'password':
case 'checkbox':
default:
break;
}
return $this->Application->ParseBlock($params, 1);
}
/**
* Get's requested custom field value
*
* @param Array $params
* @return string
* @access public
*/
function CustomField($params)
{
$params['name'] = 'cust_'.$this->SelectParam($params, 'name,field');
return $this->Field($params);
}
function CustomFieldLabel($params)
{
$object =& $this->getObject($params);
$field = $this->SelectParam($params, 'name,field');
$sql = 'SELECT FieldLabel
FROM '.$this->Application->getUnitOption('cf', 'TableName').'
WHERE FieldName = '.$this->Conn->qstr($field);
return $this->Application->Phrase($this->Conn->GetOne($sql));
}
/**
* transposes 1-dimensional array elements for vertical alignment according to given columns and per_page parameters
*
* @param array $arr
* @param int $columns
* @param int $per_page
* @return array
*/
function LinearToVertical(&$arr, $columns, $per_page)
{
$rows = $columns;
// in case if after applying per_page limit record count less then
// can fill requrested column count, then fill as much as we can
$cols = min(ceil($per_page / $columns), ceil(count($arr) / $columns));
$imatrix = array();
for ($row = 0; $row < $rows; $row++) {
for ($col = 0; $col < $cols; $col++) {
$source_index = $row * $cols + $col;
if (!isset($arr[$source_index])) {
// in case if source array element count is less then element count in one row
continue;
}
$imatrix[$col * $rows + $row] = $arr[$source_index];
}
}
ksort($imatrix);
reset($imatrix);
return $imatrix;
}
/**
* If data was modfied & is in TempTables mode, then parse block with name passed;
* remove modification mark if not in TempTables mode
*
* @param Array $params
* @return string
* @access public
* @author Alexey
*/
function SaveWarning($params)
{
$main_prefix = getArrayValue($params, 'main_prefix');
if ($main_prefix && $main_prefix != '$main_prefix') {
$top_prefix = $main_prefix;
}
else {
$top_prefix = $this->Application->GetTopmostPrefix($this->Prefix);
}
$temp_tables = $this->Application->GetVar($top_prefix.'_mode') == 't';
$modified = $this->Application->RecallVar($top_prefix.'_modified');
if ($temp_tables && $modified) {
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $this->SelectParam($params, 'render_as,name');
$block_params['edit_mode'] = $temp_tables ? 1 : 0;
return $this->Application->ParseBlock($block_params);
}
$this->Application->RemoveVar($top_prefix.'_modified');
return '';
}
/**
* Returns list record count queries (on all pages)
*
* @param Array $params
* @return int
*/
function TotalRecords($params)
{
$list =& $this->GetList($params);
if (!$list->Counted) $list->CountRecs();
return $list->RecordsCount;
}
/**
* Range filter field name
*
* @param Array $params
* @return string
*/
function SearchInputName($params)
{
$field = $this->SelectParam($params, 'field,name');
$append = getArrayValue($params, 'type') ? '_'.$params['type'] : '';
return 'custom_filters['.$this->getPrefixSpecial().']['.$field.$append.']';
}
/**
* Return range filter field value
*
* @param Array $params
* @return string
*/
function SearchField($params) // RangeValue
{
$field = $this->SelectParam($params, 'field,name');
$custom_filters = $this->Application->RecallVar($this->getPrefixSpecial().'_custom_filters');
$custom_filters = $custom_filters ? unserialize($custom_filters) : Array();
$append = getArrayValue($params, 'type');
return getArrayValue($custom_filters, $field.( $append ? '_'.$append : '') );
}
function SearchFormat($params)
{
$field = $params['field'];
$object =& $this->GetList($params);
$options = $object->GetFieldOptions($field);
$format = $options[ $this->SelectParam($params, 'input_format') ? 'input_format' : 'format' ];
$formatter_class = getArrayValue($options,'formatter');
if($formatter_class)
{
$formatter =& $this->Application->recallObject($formatter_class);
$human_format = getArrayValue($params,'human');
$edit_size = getArrayValue($params,'edit_size');
$sample = getArrayValue($params,'sample');
if($sample)
{
return $formatter->GetSample($field, $options, $object);
}
elseif($human_format || $edit_size)
{
$format = $formatter->HumanFormat($format);
return $edit_size ? strlen($format) : $format;
}
}
return $format;
}
/**
* Returns error of range field
*
* @param unknown_type $params
* @return unknown
*/
function SearchError($params)
{
$field = $this->SelectParam($params, 'field,name');
$error_var_name = $this->getPrefixSpecial().'_'.$field.'_'.$params['type'].'_error';
$error_msg = $this->Application->RecallVar($error_var_name);
if($error_msg)
{
$this->Application->StoreVar($error_var_name, '');
}
$object =& $this->Application->recallObject($this->Prefix.'.'.$this->Special.'-item', null, Array('skip_autoload' => true));
return $object->ErrorMsgs[$error_msg];
}
/**
* Returns templates path for module, which is gathered from prefix module
*
* @param Array $params
* @return string
* @author Alex
*/
function ModulePath($params)
{
$force_module = getArrayValue($params, 'module');
if ($force_module) {
if ($force_module == '#session#') {
$force_module = $this->Application->RecallVar('module');
}
else {
$force_module = strtolower($force_module);
}
$module_folder = trim( $this->Application->findModule('Name', $force_module, 'Path'), '/');
}
else {
$module_folder = $this->Application->getUnitOption($this->Prefix, 'ModuleFolder');
}
return '../../'.$module_folder.'/admin_templates/';
}
/**
* Returns object used in tag processor
*
* @access public
* @return kDBBase
*/
function &getObject($params = Array())
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
return $object;
}
/**
* Checks if object propery value matches value passed
*
* @param Array $params
* @return bool
*/
function PropertyEquals($params)
{
$object =& $this->getObject($params);
$property_name = $this->SelectParam($params, 'name,var,property');
return $object->$property_name == $params['value'];
}
/**
* Group list records by header, saves internal order in group
*
* @param Array $records
* @param string $heading_field
*/
function groupRecords(&$records, $heading_field)
{
$sorted = Array();
$i = 0; $record_count = count($records);
while ($i < $record_count) {
$sorted[ $records[$i][$heading_field] ][] = $records[$i];
$i++;
}
$records = Array();
foreach ($sorted as $heading => $heading_records) {
$records = array_merge_recursive($records, $heading_records);
}
}
function DisplayOriginal($params)
{
return false;
- }
+ }
function MultipleEditing($params)
{
$selected_ids = $this->Application->RecallVar($this->getPrefixSpecial().'_selected_ids');
$ret = '';
if ($selected_ids) {
$selected_ids = explode(',', $selected_ids);
$object =& $this->getObject( array_merge_recursive2($params, Array('skip_autoload' => true)) );
$params['name'] = $params['render_as'];
foreach ($selected_ids as $id) {
$object->Load($id);
$ret .= $this->Application->ParseBlock($params);
}
}
-
+
return $ret;
}
+
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/db/db_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.64
\ No newline at end of property
+1.65
\ No newline at end of property
Index: trunk/core/kernel/db/dblist.php
===================================================================
--- trunk/core/kernel/db/dblist.php (revision 6427)
+++ trunk/core/kernel/db/dblist.php (revision 6428)
@@ -1,803 +1,803 @@
<?php
/**
* System Having/Where filter
*
*/
define('FLT_SYSTEM', 1);
/**
* User Having/Where filter
*
*/
define('FLT_NORMAL', 2);
/**
* User "Search" Having/Where filter
*
*/
define('FLT_SEARCH', 3);
/**
* User "View Menu" Having/Where filter
*
*/
define('FLT_VIEW', 4);
/**
* DBList
*
* Desciption
* @package kernel4
*/
class kDBList extends kDBBase {
/**
* Holds totals for fields specified in config
*
* @var Array
*/
var $Totals = Array();
/**
* Description
*
* @var array
* @access public
*/
var $OrderFields;
/**
* Holds counted total number of records in the query - without pagination (system+user filters)
*
* @var int
* @access public
*/
var $RecordsCount;
/**
* Records count with system filters only applied
*
* @var int
* @access private
*/
var $NoFilterCount = 0;
/**
* Record count selected to be
* showed on current page
*
* @var int
*/
var $SelectedCount=0;
/**
* Array of records selected
*
* @var Array
* @access private
*/
var $Records;
var $CurrentIndex = 0;
/**
* List items per-page
*
* @var int
* @access public
*/
var $PerPage;
/**
* Pages count in list based on PerPage & RecordsCount attributes
*
* @var int
* @access public
*/
var $TotalPages;
/**
* Description
*
* @var int
* @access public
*/
var $Direction;
/**
* Holds current page number - used when forming LIMIT clause of SELECT statement
*
* @var int
* @access public
*/
var $Page;
/**
* Holds offset for LIMIT clause, calculated in {@link kDBList::PerPage()}
*
* @var int
* @access private
*/
var $Offset;
/**
* Count SQL was already issued on query
*
* @var bool
* @access private
*/
var $hasCounted = false;
/**
* Holds list WHERE filter object
*
* @var kMultipleFilter
* @access private
*/
var $WhereFilter = Array(FLT_SYSTEM => null, FLT_NORMAL => null, FLT_SEARCH => null, FLT_VIEW => null);
/**
* Holds list HAVING filter object
*
* @var kMultipleFilter
* @access private
*/
var $HavingFilter = Array(FLT_SYSTEM => null, FLT_NORMAL => null, FLT_SEARCH => null, FLT_VIEW => null);
var $AggregateFilter = Array(FLT_SYSTEM => null, FLT_NORMAL => null);
var $GroupByFields = Array();
var $Queried = false;
var $Counted = false;
var $TotalsCalculated = false;
/**
* Creates kDBList
*
* @return kDBList
*/
function kDBList()
{
parent::kDBBase();
$this->OrderFields = Array();
$this->WhereFilter[FLT_SYSTEM] =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_AND);
$this->WhereFilter[FLT_NORMAL] =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_OR);
$this->WhereFilter[FLT_SEARCH] =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_OR);
$this->WhereFilter[FLT_VIEW] =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_AND);
$this->HavingFilter[FLT_SYSTEM] =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_AND);
$this->HavingFilter[FLT_NORMAL] =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_OR);
$this->HavingFilter[FLT_SEARCH] =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_OR);
$this->HavingFilter[FLT_VIEW] =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_AND);
$this->AggregateFilter[FLT_SYSTEM] =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_AND);
$this->AggregateFilter[FLT_NORMAL] =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_OR);
$this->AggregateFilter[FLT_VIEW] =& $this->Application->makeClass('kMultipleFilter', FLT_TYPE_AND);
$this->PerPage = -1;
}
/**
* Adds new or replaces old filter with same name
*
* @param string $name filter name (for internal use)
* @param string $clause where/having clause part (no OR/AND allowed)
* @param int $filter_type is filter having filter or where filter
* @param int $filter_scope filter subtype: FLT_NORMAL,FLT_SYSTEM,FLT_SEARCH,FLT_VIEW
* @access public
*/
function addFilter($name, $clause, $filter_type = WHERE_FILTER, $filter_scope = FLT_SYSTEM)
{
$filter_source = Array( WHERE_FILTER => 'WhereFilter',
HAVING_FILTER => 'HavingFilter',
AGGREGATE_FILTER => 'AggregateFilter');
$filter_name = $filter_source[$filter_type];
$filter =& $this->$filter_name;
$filter =& $filter[$filter_scope];
$filter->addFilter($name,$clause);
}
/**
* Removes specified filter from filters list
*
* @param string $name filter name (for internal use)
* @param int $filter_type is filter having filter or where filter
* @param int $filter_scope filter subtype: FLT_NORMAL,FLT_SYSTEM,FLT_SEARCH,FLT_VIEW
* @access public
*/
function removeFilter($name, $filter_type = WHERE_FILTER, $filter_scope = FLT_SYSTEM)
{
$filter_source = Array( WHERE_FILTER => 'WhereFilter',
HAVING_FILTER => 'HavingFilter',
AGGREGATE_FILTER => 'AggregateFilter');
$filter_name = $filter_source[$filter_type];
$filter =& $this->$filter_name;
$filter =& $filter[$filter_scope];
$filter->removeFilter($name);
}
/**
* Clear list filters
*
* @param bool $user clear user filters
* @param bool $system clear system filters
*/
function clearFilters($user=true,$system=true,$search=true,$view=true)
{
if ($system) {
$this->WhereFilter[FLT_SYSTEM]->clearFilters();
$this->HavingFilter[FLT_SYSTEM]->clearFilters();
$this->AggregateFilter[FLT_SYSTEM]->clearFilters();
}
if ($user) {
$this->WhereFilter[FLT_NORMAL]->clearFilters();
$this->HavingFilter[FLT_NORMAL]->clearFilters();
$this->AggregateFilter[FLT_NORMAL]->clearFilters();
}
if ($search) {
$this->WhereFilter[FLT_SEARCH]->clearFilters();
$this->HavingFilter[FLT_SEARCH]->clearFilters();
}
if ($view) {
$this->WhereFilter[FLT_VIEW]->clearFilters();
$this->HavingFilter[FLT_VIEW]->clearFilters();
}
}
/**
* Counts the total number of records base on the query resulted from {@link kDBList::GetSelectSQL()}
*
* The method modifies the query to substitude SELECT part (fields listing) with COUNT(*).
* Special care should be applied when working with lists based on grouped queries, all aggregate function fields
* like SUM(), AVERAGE() etc. should be added to CountedSQL by using {@link kDBList::SetCountedSQL()}
*
* @access public
* @param string
* @return void
*/
function CountRecs()
{
$all_sql = $this->GetSelectSQL(true,false);
$sql = $this->getCountSQL($all_sql);
if( $this->GetGroupClause() )
{
$this->RecordsCount = count( $this->Conn->GetCol($sql) );
}
else
{
$this->RecordsCount = (int)$this->Conn->GetOne($sql);
}
$system_sql = $this->GetSelectSQL(true,true);
if($system_sql == $all_sql) //no need to query the same again
{
$this->NoFilterCount = $this->RecordsCount;
return;
}
$sql = $this->getCountSQL($system_sql);
if( $this->GetGroupClause() )
{
$this->NoFilterCount = count( $this->Conn->GetCol($sql) );
}
else
{
$this->NoFilterCount = (int)$this->Conn->GetOne($sql);
}
$this->Counted = true;
}
function getCountSQL($sql)
{
if ( preg_match("/DISTINCT(.*?)FROM(?!_)/is",$sql,$regs ) )
{
return preg_replace("/^.*SELECT DISTINCT(.*?)FROM(?!_)/is", "SELECT COUNT(DISTINCT ".$regs[1].") AS count FROM", $sql);
}
else
{
return preg_replace("/^.*SELECT(.*?)FROM(?!_)/is", "SELECT COUNT(*) AS count FROM ", $sql);
}
}
/**
* Queries the database with SQL resulted from {@link kDBList::GetSelectSQL()} and stores result in {@link kDBList::SelectRS}
*
* All the sorting, pagination, filtration of the list should be set prior to calling Query().
*
* @access public
* @param string
* @return void
*/
function Query($force=false)
{
if (!$force && $this->Queried) return true;
$q = $this->GetSelectSQL();
//$rs = $this->Conn->SelectLimit($q, $this->PerPage, $this->Offset);
//in case we have not counted records try to select one more item to find out if we have something more than perpage
$limit = $this->Counted ? $this->PerPage : $this->PerPage+1;
$sql = $q.' '.$this->Conn->getLimitClause($this->Offset,$limit);
$this->Records = $this->Conn->Query($sql);
$this->SelectedCount = count($this->Records);
if (!$this->Counted) $this->RecordsCount = $this->SelectedCount;
if (!$this->Counted && $this->SelectedCount > $this->PerPage && $this->PerPage != -1) $this->SelectedCount--;
if ($this->Records === false) {
//handle errors here
return false;
}
$this->Queried = true;
return true;
}
function CalculateTotals()
{
$this->Totals = Array();
$fields = Array();
foreach($this->Fields as $field_name => $field_options)
{
$totals = getArrayValue($field_options, 'totals');
if(!$totals) continue;
$calculated_field = isset($this->CalculatedFields[$field_name]) && isset($this->VirtualFields[$field_name]);
$db_field = !isset($this->VirtualFields[$field_name]);
if($calculated_field || $db_field)
{
$field_expression = $calculated_field ? $this->CalculatedFields[$field_name] : '`'.$this->TableName.'`.`'.$field_name.'`';
$fields[$field_name] = $totals.'('.$field_expression.') AS '.$field_name.'_'.$totals;
}
}
if(!$fields) return false;
$sql = $this->GetSelectSQL(true, false);
$fields = implode(', ', $fields);
if ( preg_match("/DISTINCT(.*?)FROM(?!_)/is",$sql,$regs ) )
{
$sql = preg_replace("/^.*SELECT DISTINCT(.*?)FROM(?!_)/is", 'SELECT '.$fields.' FROM', $sql);
}
else
{
$sql = preg_replace("/^.*SELECT(.*?)FROM(?!_)/is", 'SELECT '.$fields.' FROM ', $sql);
}
$totals = $this->Conn->Query($sql);
foreach($totals as $totals_row)
{
foreach($totals_row as $total_field => $field_value)
{
if(!isset($this->Totals[$total_field])) $this->Totals[$total_field] = 0;
$this->Totals[$total_field] += $field_value;
}
}
$this->TotalsCalculated = true;
}
function getTotal($field, $total_function)
{
if (!$this->TotalsCalculated) $this->CalculateTotals();
return $this->Totals[$field.'_'.$total_function];
}
/**
* Builds full select query except for LIMIT clause
*
* @access public
* @return string
*/
function GetSelectSQL($for_counting=false,$system_filters_only=false)
{
$q = parent::GetSelectSQL($this->SelectClause);
$q = !$for_counting ? $this->addCalculatedFields($q, 0) : str_replace('%2$s', '', $q);
$where = $this->GetWhereClause($for_counting,$system_filters_only);
$having = $this->GetHavingClause($for_counting,$system_filters_only);
$order = $this->GetOrderClause();
$group = $this->GetGroupClause();
if (!empty($where)) $q .= ' WHERE ' . $where;
if (!empty($group)) $q .= ' GROUP BY ' . $group;
if (!empty($having)) $q .= ' HAVING ' . $having;
if ( !$for_counting && !empty($order) ) $q .= ' ORDER BY ' . $order;
return $this->replaceModePrefix( str_replace('%1$s', $this->TableName, $q) );
}
/**
* Enter description here...
*
* @param string $clause where clause to extract calculated fields from
* @param int $aggregated 0 - having + aggregated, 1 - having only, 2 - aggregated only
* @return string
*/
function extractCalculatedFields($clause, $aggregated = 1)
{
$fields = $this->getCalculatedFields($aggregated);
if (is_array($fields) && count($fields) > 0) {
foreach ($fields as $field_name => $field_expression) {
- $clause = preg_replace('/[,` ]{1}'.$field_name.'[` ]{1}/', $field_expression, $clause);
+ $clause = preg_replace('/[,` ]{1}'.$field_name.'[` ]{1}/', ' '.$field_expression.' ', $clause);
}
}
return $clause;
}
/**
* Returns WHERE clause of the query
*
* @access public
* @param bool $for_counting merge where filters with having filters + replace field names for having fields with their values
* @return string
*/
function GetWhereClause($for_counting=false,$system_filters_only=false)
{
$where =& $this->Application->makeClass('kMultipleFilter');
$where->addFilter('system_where', $this->WhereFilter[FLT_SYSTEM] );
if (!$system_filters_only) {
$where->addFilter('view_where', $this->WhereFilter[FLT_VIEW] );
$search_w = $this->WhereFilter[FLT_SEARCH]->getSQL();
if( $search_w || $for_counting ) // move search_having to search_where in case search_where isset or we are counting
{
$search_h = $this->extractCalculatedFields( $this->HavingFilter[FLT_SEARCH]->getSQL() );
$search_w = ($search_w && $search_h) ? $search_w.' OR '.$search_h : $search_w.$search_h;
$where->addFilter('search_where', $search_w );
}
}
if( $for_counting ) // add system_having and view_having to where
{
$where->addFilter('system_having', $this->extractCalculatedFields($this->HavingFilter[FLT_SYSTEM]->getSQL()) );
if (!$system_filters_only) $where->addFilter('view_having', $this->extractCalculatedFields( $this->HavingFilter[FLT_VIEW]->getSQL() ) );
}
return $where->getSQL();
}
/**
* Depricated method
*
* @param string $clause
* @todo REMOVE
*/
function SetWhereClause($clause)
{
if( $this->Application->isDebugMode() )
{
global $debugger;
$debugger->appendTrace();
}
trigger_error('Depricated method <b>kDBList->SetWhereClause</b>. Use <b>kDBList->addFilter</b> instead.', E_USER_ERROR);
}
/**
* Returns HAVING clause of the query
*
* @param bool $for_counting don't return having filter in case if this is counting sql
* @param bool $system_filters_only return only system having filters
* @param int $aggregated 0 - aggregated and having, 1 - having only, 2 - aggregated only
* @return string
* @access public
*/
function GetHavingClause($for_counting=false, $system_filters_only=false, $aggregated = 0)
{
if ($for_counting) {
$aggregate_filter =& $this->Application->makeClass('kMultipleFilter');
$aggregate_filter->addFilter('aggregate_system', $this->AggregateFilter[FLT_SYSTEM]);
if (!$system_filters_only) {
$aggregate_filter->addFilter('aggregate_view', $this->AggregateFilter[FLT_VIEW]);
}
return $this->extractCalculatedFields($aggregate_filter->getSQL(), 2);
}
$having =& $this->Application->makeClass('kMultipleFilter');
$having->addFilter('system_having', $this->HavingFilter[FLT_SYSTEM] );
if ($aggregated == 0) {
if (!$system_filters_only) {
$having->addFilter('view_aggregated', $this->AggregateFilter[FLT_VIEW] );
}
$having->addFilter('system_aggregated', $this->AggregateFilter[FLT_SYSTEM]);
}
if (!$system_filters_only) {
$having->addFilter('view_having', $this->HavingFilter[FLT_VIEW] );
$search_w = $this->WhereFilter[FLT_SEARCH]->getSQL();
if (!$search_w) {
$having->addFilter('search_having', $this->HavingFilter[FLT_SEARCH] );
}
}
return $having->getSQL();
}
/**
* Returns GROUP BY clause of the query
*
* @access public
* @return string
*/
function GetGroupClause()
{
return $this->GroupByFields ? implode(',', $this->GroupByFields) : '';
}
function AddGroupByField($field)
{
$this->GroupByFields[$field] = $field;
}
function RemoveGroupByField($field)
{
unset($this->GroupByFields[$field]);
}
/**
* Adds order field to ORDER BY clause
*
* @access public
* @param string $field Field name
* @param string $direction Direction of ordering (asc|desc)
* @return void
*/
function AddOrderField($field, $direction)
{
// original multilanguage field - convert to current lang field
if (getArrayValue($this->Fields, $field, 'formatter') == 'kMultiLanguage' && !getArrayValue($this->Fields, $field, 'master_field')) {
$lang = $this->Application->GetVar('m_lang');
$field = 'l'.$lang.'_'.$field;
}
if (!isset($this->Fields[$field]) && ($field != 'RAND()')) {
trigger_error('<span class="debug_error">Incorrect sorting</span> defined (field = <b>'.$field.'</b>; direction = <b>'.$direction.'</b>) in config for prefix <b>'.$this->Prefix.'</b>', E_USER_WARNING);
}
$this->OrderFields[] = Array($field, $direction);
}
/**
* Removes all order fields
*
* @access public
* @return void
*/
function ClearOrderFields()
{
$this->OrderFields = Array();
}
/**
* Returns ORDER BY Clause of the query
*
* The method builds order by clause by iterating {@link kDBList::OrderFields} array and concatenating it.
*
* @access public
* @return string
*/
function GetOrderClause()
{
$ret = '';
foreach ($this->OrderFields as $field) {
$name = $field[0];
$ret .= isset($this->Fields[$name]) && !isset($this->VirtualFields[$name]) ? '`'.$this->TableName.'`.' : '';
if ($field[0] == 'RAND()') {
$ret .= $field[0].' '.$field[1].',';
}
else {
$ret .= '`'.$field[0] . '` ' . $field[1] . ',';
}
}
$ret = rtrim($ret, ',');
return $ret;
}
function GetOrderField($pos=NULL)
{
if(!(isset($this->OrderFields[$pos]) && $this->OrderFields[$pos]) )
{
$pos = 0;
}
return isset($this->OrderFields[$pos][0]) ? $this->OrderFields[$pos][0] : '';
}
function GetOrderDirection($pos=NULL)
{
if( !getArrayValue($this->OrderFields, $pos) ) $pos = 0;
return getArrayValue($this->OrderFields, $pos, 1);
}
/**
* Return unformatted field value
*
* @param string
* @return mixed
* @access public
*/
function GetDBField($name)
{
$row =& $this->getCurrentRecord();
return $row[$name];
}
function HasField($name)
{
$row =& $this->getCurrentRecord();
return isset($row[$name]);
}
function GetFieldValues()
{
return $this->getCurrentRecord();
}
function &getCurrentRecord()
{
return $this->Records[$this->CurrentIndex];
}
/**
* Description
*
* @access public
* @param string
* @return void
*/
function GoFirst()
{
$this->CurrentIndex = 0;
}
/**
* Description
*
* @access public
* @return void
*/
function GoNext()
{
$this->CurrentIndex++;
}
/**
* Description
*
* @access public
* @return void
*/
function GoPrev()
{
if ($this->CurrentIndex>0)
$this->CurrentIndex--;
}
/**
* Description
*
* @access public
* @return bool
*/
function EOL()
{
return ($this->CurrentIndex >= $this->SelectedCount);
}
/**
* Description
*
* @access public
* @param string
* @return void
*/
function GetTotalPages()
{
if (!$this->Counted) $this->CountRecs();
if ($this->PerPage == -1) return 1;
$this->TotalPages = (($this->RecordsCount - ($this->RecordsCount % $this->PerPage)) / $this->PerPage) // integer part of division
+ (($this->RecordsCount % $this->PerPage) != 0); // adds 1 if there is a reminder
return $this->TotalPages;
}
/**
* Sets number of records to query per page
*
* @access public
* @param int $per_page Number of records to display per page
* @return void
*/
function SetPerPage($per_page)
{
$this->PerPage = $per_page;
}
function GetPerPage()
{
return $this->PerPage == -1 ? $this->RecordsCount : $this->PerPage;
}
/**
* Description
*
* @access public
* @param int $page
* @return void
*/
function SetPage($page)
{
if ($this->PerPage == -1) {
$this->Page = 1;
return;
}
if ($page < 1) $page = 1;
$this->Offset = ($page-1)*$this->PerPage;
if ($this->Counted && $this->Offset > $this->RecordsCount) {
$this->SetPage(1);
}
else {
$this->Page = $page;
}
//$this->GoFirst();
}
/**
* Sets current item field value
* (doesn't apply formatting)
*
* @access public
* @param string $name Name of the field
* @param mixed $value Value to set the field to
* @return void
*/
function SetDBField($name,$value)
{
$this->Records[$this->CurrentIndex][$name] = $value;
}
/**
* Apply where clause, that links this object to it's parent item
*
* @param string $special
* @access public
*/
function linkToParent($special)
{
$parent_prefix = $this->Application->getUnitOption($this->Prefix, 'ParentPrefix');
if($parent_prefix)
{
$parent_table_key = $this->Application->getUnitOption($this->Prefix, 'ParentTableKey');
if (is_array($parent_table_key)) $parent_table_key = getArrayValue($parent_table_key, $parent_prefix);
$foreign_key_field = $this->Application->getUnitOption($this->Prefix, 'ForeignKey');
if (is_array($foreign_key_field)) $foreign_key_field = getArrayValue($foreign_key_field, $parent_prefix);
if (!$parent_table_key || !$foreign_key_field) return ;
$parent_object =& $this->Application->recallObject($parent_prefix.'.'.$special);
$parent_id = $parent_object->GetDBField($parent_table_key);
$this->addFilter('parent_filter', '`'.$this->TableName.'`.`'.$foreign_key_field.'` = '.$parent_id); // only for list in this case
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/db/dblist.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.19
\ No newline at end of property
+1.20
\ No newline at end of property
Index: trunk/core/kernel/db/db_event_handler.php
===================================================================
--- trunk/core/kernel/db/db_event_handler.php (revision 6427)
+++ trunk/core/kernel/db/db_event_handler.php (revision 6428)
@@ -1,1848 +1,1864 @@
<?php
define('EH_CUSTOM_PROCESSING_BEFORE',1);
define('EH_CUSTOM_PROCESSING_AFTER',2);
/**
* Note:
* 1. When adressing variables from submit containing
* Prefix_Special as part of their name use
* $event->getPrefixSpecial(true) instead of
* $event->Prefix_Special as usual. This is due PHP
* is converting "." symbols in variable names during
* submit info "_". $event->getPrefixSpecial optional
* 1st parameter returns correct corrent Prefix_Special
* for variables beeing submitted such way (e.g. variable
* name that will be converted by PHP: "users.read_only_id"
* will be submitted as "users_read_only_id".
*
* 2. When using $this->Application-LinkVar on variables submitted
* from form which contain $Prefix_Special then note 1st item. Example:
* LinkVar($event->getPrefixSpecial(true).'_varname',$event->Prefix_Special.'_varname')
*
*/
/**
* EventHandler that is used to process
* any database related events
*
*/
class kDBEventHandler extends kEventHandler {
/**
* Description
*
* @var kDBConnection
* @access public
*/
var $Conn;
/**
* Adds ability to address db connection
*
* @return kDBEventHandler
* @access public
*/
function kDBEventHandler()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if (!$this->Application->IsAdmin()) {
$allow_events = Array('OnSearch', 'OnSearchReset', 'OnNew');
if (in_array($event->Name, $allow_events)) {
// allow search on front
return true;
}
}
$section = $event->getSection();
if (!preg_match('/^CATEGORY:(.*)/', $section)) {
// only if not category item events
if ((substr($event->Name, 0, 9) == 'OnPreSave') || ($event->Name == 'OnSave')) {
if ($this->isNewItemCreate($event)) {
return $this->Application->CheckPermission($section.'.add', 1);
}
else {
return $this->Application->CheckPermission($section.'.add', 1) || $this->Application->CheckPermission($section.'.edit', 1);
}
}
}
if ($event->Name == 'OnPreCreate') {
// save category_id before item create (for item category selector not to destroy permission checking category)
$this->Application->LinkVar('m_cat_id');
}
return parent::CheckPermission($event);
}
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnLoad' => Array('self' => 'view', 'subitem' => 'view'),
'OnNew' => Array('self' => 'add', 'subitem' => 'add|edit'),
'OnCreate' => Array('self' => 'add', 'subitem' => 'add|edit'),
'OnUpdate' => Array('self' => 'edit', 'subitem' => 'add|edit'),
'OnSetPrimary' => Array('self' => 'add|edit', 'subitem' => 'add|edit'),
'OnDelete' => Array('self' => 'delete', 'subitem' => 'add|edit'),
'OnMassDelete' => Array('self' => 'delete', 'subitem' => 'add|edit'),
'OnMassClone' => Array('self' => 'add', 'subitem' => 'add|edit'),
'OnSelectItems' => Array('self' => 'add|edit', 'subitem' => 'add|edit'),
'OnProcessSelected' => Array('self' => 'add|edit', 'subitem' => 'add|edit'),
'OnSelectUser' => Array('self' => 'add|edit', 'subitem' => 'add|edit'),
'OnMassApprove' => Array('self' => 'advanced:approve|edit', 'subitem' => 'advanced:approve|add|edit'),
'OnMassDecline' => Array('self' => 'advanced:decline|edit', 'subitem' => 'advanced:decline|add|edit'),
'OnMassMoveUp' => Array('self' => 'advanced:move_up|edit', 'subitem' => 'advanced:move_up|add|edit'),
'OnMassMoveDown' => Array('self' => 'advanced:move_down|edit', 'subitem' => 'advanced:move_down|add|edit'),
'OnPreCreate' => Array('self' => 'add|add.pending'),
'OnEdit' => Array('self' => 'edit|edit.pending'),
// theese event do not harm, but just in case check them too :)
'OnCancelEdit' => Array('self' => true, 'subitem' => true),
'OnCancel' => Array('self' => true, 'subitem' => true),
'OnSetSorting' => Array('self' => true, 'subitem' => true),
'OnSetSortingDirect' => Array('self' => true, 'subitem' => true),
'OnSetFilter' => Array('self' => true, 'subitem' => true),
'OnApplyFilters' => Array('self' => true, 'subitem' => true),
'OnRemoveFilters' => Array('self' => true, 'subitem' => true),
'OnSetPerPage' => Array('self' => true, 'subitem' => true),
'OnSearch' => Array('self' => true, 'subitem' => true),
'OnSearchReset' => Array('self' => true, 'subitem' => true),
'OnGoBack' => Array('self' => true, 'subitem' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
function mapEvents()
{
$events_map = Array('OnRemoveFilters' => 'FilterAction',
'OnApplyFilters' => 'FilterAction');
$this->eventMethods = array_merge($this->eventMethods, $events_map);
}
/**
* Returns ID of current item to be edited
* by checking ID passed in get/post as prefix_id
* or by looking at first from selected ids, stored.
* Returned id is also stored in Session in case
* it was explicitly passed as get/post
*
* @param kEvent $event
* @return int
*/
function getPassedID(&$event)
{
if ($event->getEventParam('raise_warnings') === false) {
$event->setEventParam('raise_warnings', 1);
}
// 1. get id from post (used in admin)
$ret = $this->Application->GetVar($event->getPrefixSpecial(true).'_id');
if($ret) return $ret;
// 2. get id from env (used in front)
$ret = $this->Application->GetVar($event->getPrefixSpecial().'_id');
if($ret) return $ret;
// recall selected ids array and use the first one
$ids=$this->Application->GetVar($event->getPrefixSpecial().'_selected_ids');
if ($ids != '') {
$ids=explode(',',$ids);
if($ids) $ret=array_shift($ids);
}
else { // if selected ids are not yet stored
$this->StoreSelectedIDs($event);
return $this->Application->GetVar($event->getPrefixSpecial(true).'_id'); // StoreSelectedIDs sets this variable
}
return $ret;
}
/**
* Prepares and stores selected_ids string
* in Session and Application Variables
* by getting all checked ids from grid plus
* id passed in get/post as prefix_id
*
* @param kEvent $event
* @return Array ids stored
*/
function StoreSelectedIDs(&$event)
{
$ret = Array();
// May be we don't need this part: ?
$passed = $this->Application->GetVar($event->getPrefixSpecial(true).'_id');
if($passed !== false && $passed != '')
{
array_push($ret, $passed);
}
$ids = Array();
// get selected ids from post & save them to session
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
$id_field = $this->Application->getUnitOption($event->Prefix,'IDField');
foreach($items_info as $id => $field_values)
{
if( getArrayValue($field_values,$id_field) ) array_push($ids,$id);
}
//$ids=array_keys($items_info);
}
$ret = array_unique(array_merge($ret, $ids));
$this->Application->SetVar($event->getPrefixSpecial().'_selected_ids',implode(',',$ret));
$this->Application->LinkVar($event->getPrefixSpecial().'_selected_ids');
// This is critical - otherwise getPassedID will return last ID stored in session! (not exactly true)
// this smells... needs to be refactored
$first_id = getArrayValue($ret,0);
if (($first_id === false) && ($event->getEventParam('raise_warnings') == 1)) {
if ($this->Application->isDebugMode()) {
$this->Application->Debugger->appendTrace();
}
trigger_error('Requested ID for prefix <b>'.$event->getPrefixSpecial().'</b> <span class="debug_error">not passed</span>',E_USER_NOTICE);
}
$this->Application->SetVar($event->getPrefixSpecial(true).'_id', $first_id);
return $ret;
}
/**
* Returns stored selected ids as an array
*
* @param kEvent $event
* @return array
*/
function getSelectedIDs(&$event)
{
return explode(',', $this->Application->GetVar($event->getPrefixSpecial().'_selected_ids'));
}
/**
* Returs associative array of submitted fields for current item
* Could be used while creating/editing single item -
* meaning on any edit form, except grid edit
*
* @param kEvent $event
*/
function getSubmittedFields(&$event)
{
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
$field_values = $items_info ? array_shift($items_info) : Array();
return $field_values;
}
/**
* Removes any information about current/selected ids
* from Application variables and Session
*
* @param kEvent $event
*/
function clearSelectedIDs(&$event)
{
$prefix_special = $event->getPrefixSpecial();
$ids = $this->Application->RecallVar($prefix_special.'_selected_ids');
$event->setEventParam('ids', $ids);
$this->Application->RemoveVar($prefix_special.'_selected_ids');
$this->Application->SetVar($prefix_special.'_selected_ids', '');
$this->Application->SetVar($prefix_special.'_id', ''); // $event->getPrefixSpecial(true).'_id' too may be
}
/*function SetSaveEvent(&$event)
{
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent','OnUpdate');
$this->Application->LinkVar($event->Prefix_Special.'_SaveEvent');
}*/
/**
* Common builder part for Item & List
*
* @param kDBBase $object
* @param kEvent $event
* @access private
*/
function dbBuild(&$object, &$event)
{
$object->Configure();
$this->PrepareObject($object, $event);
// force live table if specified or is original item
$live_table = $event->getEventParam('live_table') || $event->Special == 'original';
if( $this->UseTempTables($event) && !$live_table )
{
$object->SwitchToTemp();
}
// This strange constuction creates hidden field for storing event name in form submit
// It pass SaveEvent to next screen, otherwise after unsuccsefull create it will try to update rather than create
$current_event = $this->Application->GetVar($event->Prefix_Special.'_event');
// $this->Application->setEvent($event->Prefix_Special, $current_event);
$this->Application->setEvent($event->Prefix_Special, '');
$save_event = $this->UseTempTables($event) && $this->Application->GetTopmostPrefix($event->Prefix) == $event->Prefix ? 'OnSave' : 'OnUpdate';
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent',$save_event);
}
/**
* Builds item (loads if needed)
*
* @param kEvent $event
* @access protected
*/
function OnItemBuild(&$event)
{
$object =& $event->getObject();
$this->dbBuild($object,$event);
$sql = $this->ItemPrepareQuery($event);
$sql = $this->Application->ReplaceLanguageTags($sql);
$object->setSelectSQL($sql);
// 2. loads if allowed
$auto_load = $this->Application->getUnitOption($event->Prefix,'AutoLoad');
$skip_autload = $event->getEventParam('skip_autoload');
if($auto_load && !$skip_autload) $this->LoadItem($event);
$actions =& $this->Application->recallObject('kActions');
$actions->Set($event->Prefix_Special.'_GoTab', '');
$actions->Set($event->Prefix_Special.'_GoId', '');
}
/**
* Build subtables array from configs
*
* @param kEvent $event
*/
function OnTempHandlerBuild(&$event)
{
$object =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$object->BuildTables( $event->Prefix, $this->getSelectedIDs($event) );
}
/**
* Enter description here...
*
* @param kEvent $event
* @return unknown
*/
function UseTempTables(&$event)
{
$object = &$event->getObject();
$top_prefix = $this->Application->GetTopmostPrefix($event->Prefix);
- return $this->Application->GetVar($top_prefix.'_mode') == 't';
+
+ return (
+ $this->Application->GetVar(rtrim($top_prefix.'_'.$event->Special, '_')) == 't'
+ ||
+ $this->Application->GetVar(rtrim($top_prefix.'.'.$event->Special, '.')) == 't'
+ ||
+ $this->Application->GetVar($top_prefix.'_mode') == 't'
+ );
}
/**
* Returns table prefix from event (temp or live)
*
* @param kEvent $event
* @return string
* @todo Needed? Should be refactored (by Alex)
*/
function TablePrefix(&$event)
{
return $this->UseTempTables($event) ? $this->Application->GetTempTablePrefix().TABLE_PREFIX : TABLE_PREFIX;
}
/**
* Load item if id is available
*
* @param kEvent $event
*/
function LoadItem(&$event)
{
$object =& $event->getObject();
$id = $this->getPassedID($event);
if ($object->Load($id) )
{
$actions =& $this->Application->recallObject('kActions');
$actions->Set($event->Prefix_Special.'_id', $object->GetID() );
$use_pending_editing = $this->Application->getUnitOption($event->Prefix, 'UsePendingEditing');
if ($use_pending_editing && $event->Special != 'original') {
$this->Application->SetVar($event->Prefix.'.original_id', $object->GetDBField('OrgId'));
}
}
else
{
$object->setID($id);
}
}
/**
* Builds list
*
* @param kEvent $event
* @access protected
*/
function OnListBuild(&$event)
{
$object =& $event->getObject();
$this->dbBuild($object,$event);
$sql = $this->ListPrepareQuery($event);
$sql = $this->Application->ReplaceLanguageTags($sql);
$object->setSelectSQL($sql);
$object->linkToParent( $this->getMainSpecial($event) );
$this->AddFilters($event);
$this->SetCustomQuery($event); // new!, use this for dynamic queries based on specials for ex.
$this->SetPagination($event);
$this->SetSorting($event);
// $object->CalculateTotals(); // Now called in getTotals to avoid extra query
$actions =& $this->Application->recallObject('kActions');
$actions->Set('remove_specials['.$event->Prefix_Special.']', '0');
$actions->Set($event->Prefix_Special.'_GoTab', '');
}
/**
* Get's special of main item for linking with subitem
*
* @param kEvent $event
* @return string
*/
function getMainSpecial(&$event)
{
$special = $event->getEventParam('main_special');
if($special === false || $special == '$main_special')
{
$special = $event->Special;
}
return $special;
}
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @access protected
* @see OnListBuild
*/
function SetCustomQuery(&$event)
{
}
/**
* Set's new perpage for grid
*
* @param kEvent $event
*/
function OnSetPerPage(&$event)
{
$per_page = $this->Application->GetVar($event->getPrefixSpecial(true).'_PerPage');
$this->Application->StoreVar( $event->getPrefixSpecial().'_PerPage', $per_page );
}
/**
* Set's correct page for list
* based on data provided with event
*
* @param kEvent $event
* @access private
* @see OnListBuild
*/
function SetPagination(&$event)
{
// get PerPage (forced -> session -> config -> 10)
$per_page = $this->getPerPage($event);
$object =& $event->getObject();
$object->SetPerPage($per_page);
$this->Application->StoreVarDefault($event->getPrefixSpecial().'_Page', 1);
$page = $this->Application->GetVar($event->getPrefixSpecial().'_Page');
if (!$page) {
$page = $this->Application->GetVar($event->getPrefixSpecial(true).'_Page');
}
if (!$page) {
$page = $this->Application->RecallVar($event->getPrefixSpecial().'_Page');
}
else {
$this->Application->StoreVar($event->getPrefixSpecial().'_Page', $page);
}
if( !$event->getEventParam('skip_counting') )
{
$pages = $object->GetTotalPages();
if($page > $pages)
{
$this->Application->StoreVar($event->getPrefixSpecial().'_Page', 1);
$page = 1;
}
}
/*$per_page = $event->getEventParam('per_page');
if ($per_page == 'list_next') {
$cur_page = $page;
$cur_per_page = $per_page;
$object->SetPerPage(1);
$object =& $this->Application->recallObject($event->Prefix);
$cur_item_index = $object->CurrentIndex;
$page = ($cur_page-1) * $cur_per_page + $cur_item_index + 1;
$object->SetPerPage(1);
}*/
$object->SetPage($page);
}
function getPerPage(&$event)
{
$per_page = $event->getEventParam('per_page');
/* if ($per_page == 'list_next') {
$per_page = '';
}*/
$config_mapping = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping');
if ( $config_mapping ) {
switch ( $per_page ){
case 'short_list' :
$per_page = $this->Application->ConfigValue($config_mapping['ShortListPerPage']);
break;
case 'default' :
$per_page = $this->Application->ConfigValue($config_mapping['PerPage']);
break;
}
}
if(!$per_page)
{
$per_page_var = $event->getPrefixSpecial().'_PerPage';
$per_page = $this->Application->RecallVar($per_page_var);
if(!$per_page)
{
if ($config_mapping) {
if (!isset($config_mapping['PerPage'])) {
trigger_error('Incorrect mapping of <span class="debug_error">PerPage</span> key in config for prefix <b>'.$event->Prefix.'</b>', E_USER_WARNING);
}
$per_page = $this->Application->ConfigValue($config_mapping['PerPage']);
}
if(!$per_page) $per_page = 10;
}
}
return $per_page;
}
/**
* Set's correct sorting for list
* based on data provided with event
*
* @param kEvent $event
* @access private
* @see OnListBuild
*/
function SetSorting(&$event)
{
$event->setPseudoClass('_List');
$object =& $event->getObject();
$cur_sort1 = $this->Application->RecallVar($event->Prefix_Special.'_Sort1');
$cur_sort1_dir = $this->Application->RecallVar($event->Prefix_Special.'_Sort1_Dir');
$cur_sort2 = $this->Application->RecallVar($event->Prefix_Special.'_Sort2');
$cur_sort2_dir = $this->Application->RecallVar($event->Prefix_Special.'_Sort2_Dir');
$sorting_configs = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping');
$list_sortings = $this->Application->getUnitOption($event->Prefix, 'ListSortings');
$sorting_prefix = getArrayValue($list_sortings, $event->Special) ? $event->Special : '';
$tag_sort_by = $event->getEventParam('sort_by');
if ($tag_sort_by) {
list($by, $dir) = explode(',', $tag_sort_by);
if ($by == 'random') $by = 'RAND()';
$object->AddOrderField($by, $dir);
}
if ($sorting_configs && isset ($sorting_configs['DefaultSorting1Field'])){
$list_sortings[$sorting_prefix]['Sorting'] = Array(
$this->Application->ConfigValue($sorting_configs['DefaultSorting1Field']) => $this->Application->ConfigValue($sorting_configs['DefaultSorting1Dir']),
$this->Application->ConfigValue($sorting_configs['DefaultSorting2Field']) => $this->Application->ConfigValue($sorting_configs['DefaultSorting2Dir']),
);
}
// Use default if not specified
if ( !$cur_sort1 || !$cur_sort1_dir)
{
if ( $sorting = getArrayValue($list_sortings, $sorting_prefix, 'Sorting') ) {
reset($sorting);
$cur_sort1 = key($sorting);
$cur_sort1_dir = current($sorting);
if (next($sorting)) {
$cur_sort2 = key($sorting);
$cur_sort2_dir = current($sorting);
}
}
}
if ( $forced_sorting = getArrayValue($list_sortings, $sorting_prefix, 'ForcedSorting') ) {
foreach ($forced_sorting as $field => $dir) {
$object->AddOrderField($field, $dir);
}
}
if($cur_sort1 != '' && $cur_sort1_dir != '')
{
$object->AddOrderField($cur_sort1, $cur_sort1_dir);
}
if($cur_sort2 != '' && $cur_sort2_dir != '')
{
$object->AddOrderField($cur_sort2, $cur_sort2_dir);
}
}
/**
* Add filters found in session
*
* @param kEvent $event
*/
function AddFilters(&$event)
{
$object =& $event->getObject();
$search_filter = $this->Application->RecallVar($event->getPrefixSpecial().'_search_filter');
if($search_filter)
{
$search_filter = unserialize($search_filter);
foreach($search_filter as $search_field => $filter_params)
{
$filter_type = ($filter_params['type'] == 'having') ? HAVING_FILTER : WHERE_FILTER;
$object->addFilter($search_field, $filter_params['value'], $filter_type, FLT_SEARCH);
}
}
$view_filter = $this->Application->RecallVar($event->getPrefixSpecial().'_view_filter');
if($view_filter)
{
$view_filter = unserialize($view_filter);
$temp_filter =& $this->Application->makeClass('kMultipleFilter');
$filter_menu = $this->Application->getUnitOption($event->Prefix,'FilterMenu');
$group_key = 0; $group_count = count($filter_menu['Groups']);
while($group_key < $group_count)
{
$group_info = $filter_menu['Groups'][$group_key];
$temp_filter->setType( constant('FLT_TYPE_'.$group_info['mode']) );
$temp_filter->clearFilters();
foreach ($group_info['filters'] as $flt_id)
{
$sql_key = getArrayValue($view_filter,$flt_id) ? 'on_sql' : 'off_sql';
if ($filter_menu['Filters'][$flt_id][$sql_key] != '')
{
$temp_filter->addFilter('view_filter_'.$flt_id, $filter_menu['Filters'][$flt_id][$sql_key]);
}
}
$object->addFilter('view_group_'.$group_key, $temp_filter, $group_info['type'] , FLT_VIEW);
$group_key++;
}
}
}
/**
* Set's new sorting for list
*
* @param kEvent $event
* @access protected
*/
function OnSetSorting(&$event)
{
$cur_sort1 = $this->Application->RecallVar($event->Prefix_Special.'_Sort1');
$cur_sort1_dir = $this->Application->RecallVar($event->Prefix_Special.'_Sort1_Dir');
$cur_sort2 = $this->Application->RecallVar($event->Prefix_Special.'_Sort2');
$cur_sort2_dir = $this->Application->RecallVar($event->Prefix_Special.'_Sort2_Dir');
$passed_sort1 = $this->Application->GetVar($event->getPrefixSpecial(true).'_Sort1');
if ($cur_sort1 == $passed_sort1) {
$cur_sort1_dir = $cur_sort1_dir == 'asc' ? 'desc' : 'asc';
}
else {
$cur_sort2 = $cur_sort1;
$cur_sort2_dir = $cur_sort1_dir;
$cur_sort1 = $passed_sort1;
$cur_sort1_dir = 'asc';
}
$this->Application->StoreVar($event->Prefix_Special.'_Sort1', $cur_sort1);
$this->Application->StoreVar($event->Prefix_Special.'_Sort1_Dir', $cur_sort1_dir);
$this->Application->StoreVar($event->Prefix_Special.'_Sort2', $cur_sort2);
$this->Application->StoreVar($event->Prefix_Special.'_Sort2_Dir', $cur_sort2_dir);
}
/**
* Set sorting directly to session
*
* @param kEvent $event
*/
function OnSetSortingDirect(&$event)
{
$combined = $this->Application->GetVar($event->getPrefixSpecial(true).'_CombinedSorting');
if ($combined) {
list($field,$dir) = explode('|',$combined);
$this->Application->StoreVar($event->Prefix_Special.'_Sort1', $field);
$this->Application->StoreVar($event->Prefix_Special.'_Sort1_Dir', $dir);
return;
}
$field_pos = $this->Application->GetVar($event->getPrefixSpecial(true).'_SortPos');
$this->Application->LinkVar( $event->getPrefixSpecial(true).'_Sort'.$field_pos, $event->Prefix_Special.'_Sort'.$field_pos);
$this->Application->LinkVar( $event->getPrefixSpecial(true).'_Sort'.$field_pos.'_Dir', $event->Prefix_Special.'_Sort'.$field_pos.'_Dir');
}
/**
* Reset grid sorting to default (from config)
*
* @param kEvent $event
*/
function OnResetSorting(&$event)
{
$this->Application->RemoveVar($event->Prefix_Special.'_Sort1');
$this->Application->RemoveVar($event->Prefix_Special.'_Sort1_Dir');
$this->Application->RemoveVar($event->Prefix_Special.'_Sort2');
$this->Application->RemoveVar($event->Prefix_Special.'_Sort2_Dir');
}
/**
* Creates needed sql query to load item,
* if no query is defined in config for
* special requested, then use default
* query
*
* @param kEvent $event
* @access protected
*/
function ItemPrepareQuery(&$event)
{
$sqls = $this->Application->getUnitOption($event->Prefix,'ItemSQLs');
return isset($sqls[$event->Special]) ? $sqls[$event->Special] : $sqls[''];
}
/**
* Creates needed sql query to load list,
* if no query is defined in config for
* special requested, then use default
* query
*
* @param kEvent $event
* @access protected
*/
function ListPrepareQuery(&$event)
{
$sqls = $this->Application->getUnitOption($event->Prefix,'ListSQLs');
return isset( $sqls[$event->Special] ) ? $sqls[$event->Special] : $sqls[''];
}
/**
* Apply custom processing to item
*
* @param kEvent $event
*/
function customProcessing(&$event, $type)
{
}
/* Edit Events mostly used in Admin */
/**
* Creates new kDBItem
*
* @param kEvent $event
* @access protected
*/
function OnCreate(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
list($id,$field_values) = each($items_info);
$object->SetFieldsFromHash($field_values);
}
$this->customProcessing($event,'before');
//look at kDBItem' Create for ForceCreateId description, it's rarely used and is NOT set by default
if( $object->Create($event->getEventParam('ForceCreateId')) )
{
if( $object->IsTempTable() ) $object->setTempID();
$this->customProcessing($event,'after');
$event->status=erSUCCESS;
$event->redirect_params = Array('opener'=>'u');
}
else
{
$event->status = erFAIL;
$event->redirect = false;
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent','OnCreate');
$object->setID($id);
}
}
/**
* Updates kDBItem
*
* @param kEvent $event
* @access protected
*/
function OnUpdate(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
foreach($items_info as $id => $field_values)
{
$object->Load($id);
$object->SetFieldsFromHash($field_values);
$this->customProcessing($event, 'before');
if( $object->Update($id) )
{
$this->customProcessing($event, 'after');
$event->status=erSUCCESS;
}
else
{
$event->status=erFAIL;
$event->redirect=false;
break;
}
}
}
$event->redirect_params = Array('opener'=>'u');
}
/**
* Delete's kDBItem object
*
* @param kEvent $event
* @access protected
*/
function OnDelete(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->ID = $this->getPassedID($event);
if( $object->Delete() )
{
$event->status = erSUCCESS;
}
else
{
$event->status = erFAIL;
$event->redirect = false;
}
}
/**
* Prepares new kDBItem object
*
* @param kEvent $event
* @access protected
*/
function OnNew(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->setID(0);
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent','OnCreate');
$table_info = $object->getLinkedInfo();
$object->SetDBField($table_info['ForeignKey'], $table_info['ParentId']);
$event->redirect = false;
}
/**
* Cancel's kDBItem Editing/Creation
*
* @param kEvent $event
* @access protected
*/
function OnCancel(&$event)
{
$object =& $event->getObject(Array('skip_autoload' => true));
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
if ($items_info) {
$delete_ids = Array();
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
foreach ($items_info as $id => $field_values) {
$object->Load($id);
// record created for using with selector (e.g. Reviews->Select User), and not validated => Delete it
if ($object->isLoaded() && !$object->Validate() && ($id <= 0) ) {
$delete_ids[] = $id;
}
}
if ($delete_ids) {
$temp->DeleteItems($event->Prefix, $event->Special, $delete_ids);
}
}
$event->redirect_params = Array('opener'=>'u');
}
/**
* Deletes all selected items.
* Automatically recurse into sub-items using temp handler, and deletes sub-items
* by calling its Delete method if sub-item has AutoDelete set to true in its config file
*
* @param kEvent $event
*/
function OnMassDelete(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$event->status=erSUCCESS;
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$this->StoreSelectedIDs($event);
$event->setEventParam('ids', $this->getSelectedIDs($event) );
$this->customProcessing($event, 'before');
$ids = $event->getEventParam('ids');
if($ids)
{
$temp->DeleteItems($event->Prefix, $event->Special, $ids);
}
$this->clearSelectedIDs($event);
}
/**
* Prepare temp tables and populate it
* with items selected in the grid
*
* @param kEvent $event
*/
function OnEdit(&$event)
{
$this->StoreSelectedIDs($event);
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$temp->PrepareEdit();
$event->redirect=false;
}
/**
* Saves content of temp table into live and
* redirects to event' default redirect (normally grid template)
*
* @param kEvent $event
*/
function OnSave(&$event)
{
$event->CallSubEvent('OnPreSave');
if ($event->status == erSUCCESS) {
$skip_master = false;
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
$live_ids = $temp->SaveEdit($event->getEventParam('master_ids') ? $event->getEventParam('master_ids') : Array());
if ($live_ids) {
// ensure, that newly created item ids are avalable as if they were selected from grid
// NOTE: only works if main item has subitems !!!
$this->Application->StoreVar($event->getPrefixSpecial().'_selected_ids', implode(',', $live_ids));
}
}
$this->clearSelectedIDs($event);
$event->redirect_params = Array('opener' => 'u');
$this->Application->RemoveVar($event->getPrefixSpecial().'_modified');
// all temp tables are deleted here => all after hooks should think, that it's live mode now
$this->Application->SetVar($event->Prefix.'_mode', '');
}
}
/**
* Cancels edit
* Removes all temp tables and clears selected ids
*
* @param kEvent $event
*/
function OnCancelEdit(&$event)
{
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$temp->CancelEdit();
$this->clearSelectedIDs($event);
$event->redirect_params = Array('opener'=>'u');
$this->Application->RemoveVar($event->getPrefixSpecial().'_modified');
}
/**
* Allows to determine if we are creating new item or editing already created item
*
* @param kEvent $event
* @return bool
*/
function isNewItemCreate(&$event)
{
$event->setEventParam('raise_warnings', 0);
$item_id = $this->getPassedID($event);
return ($item_id == '') ? true : false;
}
/**
* Saves edited item into temp table
* If there is no id, new item is created in temp table
*
* @param kEvent $event
*/
function OnPreSave(&$event)
{
//$event->redirect = false;
// if there is no id - it means we need to create an item
if (is_object($event->MasterEvent)) {
$event->MasterEvent->setEventParam('IsNew',false);
}
if ($this->isNewItemCreate($event)) {
$event->CallSubEvent('OnPreSaveCreated');
if (is_object($event->MasterEvent)) {
$event->MasterEvent->setEventParam('IsNew',true);
}
return;
}
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info) {
foreach ($items_info as $id => $field_values) {
$object->SetDefaultValues();
$object->Load($id);
$object->SetFieldsFromHash($field_values);
$this->customProcessing($event, 'before');
if( $object->Update($id) )
{
$this->customProcessing($event, 'after');
$event->status=erSUCCESS;
}
else {
$event->status = erFAIL;
$event->redirect = false;
break;
}
}
}
}
/**
* Saves edited item in temp table and loads
* item with passed id in current template
* Used in Prev/Next buttons
*
* @param kEvent $event
*/
function OnPreSaveAndGo(&$event)
{
$event->CallSubEvent('OnPreSave');
if ($event->status==erSUCCESS) {
$event->redirect_params[$event->getPrefixSpecial(true).'_id'] = $this->Application->GetVar($event->Prefix_Special.'_GoId');
}
}
/**
* Saves edited item in temp table and goes
* to passed tabs, by redirecting to it with OnPreSave event
*
* @param kEvent $event
*/
function OnPreSaveAndGoToTab(&$event)
{
$event->CallSubEvent('OnPreSave');
if ($event->status==erSUCCESS) {
$event->redirect=$this->Application->GetVar($event->getPrefixSpecial(true).'_GoTab');
}
}
/**
* Saves editable list and goes to passed tab,
* by redirecting to it with empty event
*
* @param kEvent $event
*/
function OnUpdateAndGoToTab(&$event)
{
$event->setPseudoClass('_List');
$event->CallSubEvent('OnUpdate');
if ($event->status==erSUCCESS) {
$event->redirect=$this->Application->GetVar($event->getPrefixSpecial(true).'_GoTab');
}
}
/**
* Prepare temp tables for creating new item
* but does not create it. Actual create is
* done in OnPreSaveCreated
*
* @param kEvent $event
*/
function OnPreCreate(&$event)
{
$this->clearSelectedIDs($event);
$object =& $event->getObject( Array('skip_autoload' => true) );
$temp =& $this->Application->recallObject($event->Prefix.'_TempHandler', 'kTempTablesHandler');
$temp->PrepareEdit();
$object->setID(0);
$event->redirect=false;
}
/**
* Creates a new item in temp table and
* stores item id in App vars and Session on succsess
*
* @param kEvent $event
*/
function OnPreSaveCreated(&$event)
{
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info) $field_values = array_shift($items_info);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->SetFieldsFromHash($field_values);
$this->customProcessing($event, 'before');
if( $object->Create() )
{
$this->customProcessing($event, 'after');
$event->redirect_params[$event->getPrefixSpecial(true).'_id'] = $object->GetId();
$event->status=erSUCCESS;
}
else
{
$event->status=erFAIL;
$event->redirect=false;
$object->setID(0);
}
}
/* End of Edit events */
// III. Events that allow to put some code before and after Update,Load,Create and Delete methods of item
/**
* Occurse before loading item, 'id' parameter
* allows to get id of item beeing loaded
*
* @param kEvent $event
* @access public
*/
function OnBeforeItemLoad(&$event)
{
}
/**
* Occurse after loading item, 'id' parameter
* allows to get id of item that was loaded
*
* @param kEvent $event
* @access public
*/
function OnAfterItemLoad(&$event)
{
}
/**
* Occurse before creating item
*
* @param kEvent $event
* @access public
*/
function OnBeforeItemCreate(&$event)
{
}
/**
* Occurse after creating item
*
* @param kEvent $event
* @access public
*/
function OnAfterItemCreate(&$event)
{
}
/**
* Occurse before updating item
*
* @param kEvent $event
* @access public
*/
function OnBeforeItemUpdate(&$event)
{
}
/**
* Occurse after updating item
*
* @param kEvent $event
* @access public
*/
function OnAfterItemUpdate(&$event)
{
}
/**
* Occurse before deleting item, id of item beeing
* deleted is stored as 'id' event param
*
* @param kEvent $event
* @access public
*/
function OnBeforeItemDelete(&$event)
{
}
/**
* Occurse after deleting item, id of deleted item
* is stored as 'id' param of event
*
* @param kEvent $event
* @access public
*/
function OnAfterItemDelete(&$event)
{
}
/**
* Occurs after successful item validation
*
* @param kEvent $event
*/
function OnAfterItemValidate(&$event)
{
}
/**
* Occures after an item has been copied to temp
* Id of copied item is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnAfterCopyToTemp(&$event)
{
}
/**
* Occures before an item is deleted from live table when copying from temp
* (temp handler deleted all items from live and then copy over all items from temp)
* Id of item being deleted is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnBeforeDeleteFromLive(&$event)
{
}
/**
* Occures before an item is copied to live table (after all foreign keys have been updated)
* Id of item being copied is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnBeforeCopyToLive(&$event)
{
}
/**
* !!! NOT FULLY IMPLEMENTED - SEE TEMP HANDLER COMMENTS (search by event name)!!!
* Occures after an item has been copied to live table
* Id of copied item is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnAfterCopyToLive(&$event)
{
}
/**
* Occures before an item is cloneded
* Id of ORIGINAL item is passed as event' 'id' param
* Do not call object' Update method in this event, just set needed fields!
*
* @param kEvent $event
*/
function OnBeforeClone(&$event)
{
}
/**
* Occures after an item has been cloned
* Id of newly created item is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnAfterClone(&$event)
{
}
/**
* Enter description here...
*
* @param kEvent $event
* @param string $search_field
* @param string $type
* @param string $value
* @param string $formatter_class
*/
function processRangeField(&$event, $search_field, $type, $value, $formatter_class)
{
$field = $search_field.'_'.$type;
$lang_current =& $this->Application->recallObject('lang.current');
$object =& $event->getObject();
$dt_separator = getArrayValue( $object->GetFieldOptions($search_field), 'date_time_separator' );
if(!$dt_separator) $dt_separator = ' ';
$time = ($type == 'datefrom') ? adodb_mktime(0,0,0) : adodb_mktime(23,59,59);
$time = adodb_date( $lang_current->GetDBField('InputTimeFormat'), $time);
$full_value = $value.$dt_separator.$time;
$formatter =& $this->Application->recallObject($formatter_class);
$value_ts = $formatter->Parse($full_value, $search_field, $object);
$pseudo = getArrayValue($object->FieldErrors, $search_field, 'pseudo');
if($pseudo)
{
$this->Application->StoreVar($event->getPrefixSpecial().'_'.$field.'_error', $pseudo);
return -1;
}
return $value_ts;
}
/**
* Ensures that popup will be closed automatically
* and parent window will be refreshed with template
* passed
*
* @param kEvent $event
* @access public
*/
function finalizePopup(&$event)
{
$event->redirect = 'incs/close_popup';
// 2. substitute opener
$opener_stack = $this->Application->RecallVar('opener_stack');
$opener_stack = $opener_stack ? unserialize($opener_stack) : Array();
//array_pop($opener_stack);
$t = $this->Application->RecallVar('return_template');
$this->Application->RemoveVar('return_template');
// restore original "m" prefix all params, that have values before opening selector
$return_m = $this->Application->RecallVar('return_m');
$this->Application->RemoveVar('return_m');
$this->Application->HttpQuery->parseEnvPart($return_m);
$pass_events = $event->getEventParam('pass_events');
$redirect_params = array_merge_recursive2($event->redirect_params, Array('m_opener' => 'u', '__URLENCODE__' => 1));
$new_level = 'index.php|'.ltrim($this->Application->BuildEnv($t, $redirect_params, 'all', $pass_events), ENV_VAR_NAME.'=');
array_push($opener_stack, $new_level);
$this->Application->StoreVar('opener_stack', serialize($opener_stack));
}
/**
* Create search filters based on search query
*
* @param kEvent $event
* @access protected
*/
function OnSearch(&$event)
{
$event->setPseudoClass('_List');
$object =& $event->getObject();
$search_keyword = $this->Application->GetVar( $event->getPrefixSpecial(true).'_search_keyword');
$this->Application->StoreVar( $event->getPrefixSpecial().'_search_keyword', $search_keyword);
$search_keyword = str_replace('*', '%', $search_keyword);
$custom_filters = $this->Application->RecallVar( $event->getPrefixSpecial().'_custom_filters');
$custom_filters = $custom_filters ? unserialize($custom_filters) : Array();
$submit_custom_filters = $this->Application->GetVar('custom_filters');
if ($submit_custom_filters) {
$submit_custom_filters = getArrayValue($submit_custom_filters, $event->getPrefixSpecial() );
if ($submit_custom_filters) {
foreach ($submit_custom_filters as $cf_name => $cf_value) {
if ($cf_value) {
$custom_filters[$cf_name] = $cf_value;
}
else {
unset($custom_filters[$cf_name]);
}
}
}
}
$this->Application->StoreVar($event->getPrefixSpecial().'_custom_filters', serialize($custom_filters) );
if( !$search_keyword && !count($custom_filters) )
{
$this->OnSearchReset($event);
return true;
}
$grid_name = $this->Application->GetVar('grid_name');
$grids = $this->Application->getUnitOption($event->Prefix,'Grids');
$search_fields = array_keys($grids[$grid_name]['Fields']);
$search_filter = Array();
$search_helper =& $this->Application->recallObject('SearchHelper');
$search_keywords = $search_helper->splitKeyword($search_keyword);
foreach($search_fields as $search_field)
{
$filter_type = isset($object->VirtualFields[$search_field]) ? 'having' : 'where';
$field_type = getArrayValue($object->Fields[$search_field],'type');
if(!$field_type) $field_type = 'string'; // default LIKE filter for all fields without type
$filter_value = '';
- $table_name = ($filter_type == 'where') ? '`'.$object->TableName.'`.' : '';
+
+ if (preg_match('/(.*)\.(.*)/', $search_field, $regs)) {
+ $table_name = '`'.$regs[1].'`.';
+ $search_field = $regs[2];
+ }
+ elseif ($filter_type == 'where') {
+ $table_name = '`'.$object->TableName.'`.';
+ }
+
+ $table_name = ($filter_type == 'where') ? $table_name : '';
// get field clause by formatter name and/or parameters
$formatter = getArrayValue($object->Fields[$search_field],'formatter');
switch($formatter)
{
case 'kOptionsFormatter':
$search_keys = Array();
$field_value = getArrayValue($custom_filters, $search_field);
if ($field_value !== false) {
// if keyword passed through advanced search filter (e.g. on Visits lists section)
array_push($search_keys, $this->Conn->qstr($field_value));
}
else {
// if keywords passed through simple search filter (on each grid)
$use_phrases = getArrayValue($object->Fields[$search_field], 'use_phrases');
$field_options = $object->GetFieldOptions($search_field);
foreach ($field_options['options'] as $key => $val) {
foreach ($search_keywords as $keyword => $sign) {
$pattern = '#'.$keyword.'#i';
if (!preg_match($pattern, $use_phrases ? $this->Application->Phrase($val) : $val)) {
if ($sign == '+') {
$filter_value = $table_name.'`'.$search_field.'` = NULL';
break;
}
else {
continue;
}
}
if ($sign == '+' || $sign == '') {
$search_keys[$key] = $this->Conn->qstr($key);
}
elseif($sign == '-') {
// if same value if found as exclusive too, then remove from search result
unset($search_keys[$key]);
}
}
}
}
if ($search_keys) {
$filter_value = $table_name.'`'.$search_field.'` IN ('.implode(',', $search_keys).')';
}
$field_processed = true;
break;
case 'kDateFormatter':
$custom_filter = getArrayValue($object->Fields[$search_field], 'custom_filter');
if(!$custom_filter)
{
$field_processed = false;
break;
}
$filter_value = Array();
$field_value = getArrayValue($custom_filters, $search_field.'_datefrom');
if($field_value)
{
$value = $this->processRangeField($event, $search_field, 'datefrom', $field_value, $formatter);
$filter_value[] = $table_name.'`'.$search_field.'` >= '.$value;
}
$field_value = getArrayValue($custom_filters, $search_field.'_dateto');
if($field_value)
{
$value = $this->processRangeField($event, $search_field, 'dateto', $field_value, $formatter);
$filter_value[] = $table_name.'`'.$search_field.'` <= '.$value;
}
$filter_value = $filter_value ? '('.implode(') AND (', $filter_value).')' : '';
$field_processed = true;
break;
default:
$field_processed = false;
break;
}
// if not already processed by formatter, then get clause by field type
if (!$field_processed && $search_keywords) {
switch($field_type)
{
case 'int':
case 'integer':
case 'numeric':
$search_keys = Array();
foreach ($search_keywords as $keyword => $sign) {
if (!is_numeric($keyword) || ($sign == '-')) continue;
$search_keys[] = $this->Conn->qstr($keyword);
}
if ($search_keys) {
$filter_value = $table_name.'`'.$search_field.'` IN ('.implode(',', $search_keys).')';
}
break;
case 'double':
case 'float':
case 'real':
$search_keys = Array();
foreach ($search_keywords as $keyword => $sign) {
$keyword = str_replace(',', '.', $keyword);
if (!is_numeric($keyword) || ($sign == '-')) continue;
$search_keys[] = 'ABS('.$table_name.'`'.$search_field.'` - '.$this->Conn->qstr($keyword).') <= 0.0001';
}
if ($search_keys) {
$filter_value = '('.implode(') OR (', $search_keys).')';
}
break;
case 'string':
$filter_value = $search_helper->buildWhereClause($search_keyword, Array($table_name.'`'.$search_field.'`'));
break;
}
}
if ($filter_value) {
$search_filter[$search_field] = Array('type' => $filter_type, 'value' => $filter_value);
}
}
$this->Application->StoreVar($event->getPrefixSpecial().'_search_filter', serialize($search_filter) );
}
/**
* Clear search keywords
*
* @param kEvent $event
* @access protected
*/
function OnSearchReset(&$event)
{
$this->Application->RemoveVar($event->getPrefixSpecial().'_search_filter');
$this->Application->RemoveVar($event->getPrefixSpecial().'_search_keyword');
$this->Application->RemoveVar($event->getPrefixSpecial().'_custom_filters');
}
/**
* Set's new filter value (filter_id meaning from config)
*
* @param kEvent $event
*/
function OnSetFilter(&$event)
{
$filter_id = $this->Application->GetVar('filter_id');
$filter_value = $this->Application->GetVar('filter_value');
$view_filter = $this->Application->RecallVar($event->getPrefixSpecial().'_view_filter');
$view_filter = $view_filter ? unserialize($view_filter) : Array();
$view_filter[$filter_id] = $filter_value;
$this->Application->StoreVar( $event->getPrefixSpecial().'_view_filter', serialize($view_filter) );
}
/**
* Add/Remove all filters applied to list from "View" menu
*
* @param kEvent $event
*/
function FilterAction(&$event)
{
$view_filter = Array();
$filter_menu = $this->Application->getUnitOption($event->Prefix,'FilterMenu');
switch ($event->Name)
{
case 'OnRemoveFilters':
$filter_value = 1;
break;
case 'OnApplyFilters':
$filter_value = 0;
break;
}
foreach($filter_menu['Filters'] as $filter_key => $filter_params)
{
if(!$filter_params) continue;
$view_filter[$filter_key] = $filter_value;
}
$this->Application->StoreVar( $event->getPrefixSpecial().'_view_filter', serialize($view_filter) );
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnPreSaveAndOpenTranslator(&$event)
{
$this->Application->SetVar('allow_translation', true);
$object =& $event->getObject();
$this->RemoveRequiredFields($object);
$event->CallSubEvent('OnPreSave');
if ($event->status == erSUCCESS) {
$resource_id = $this->Application->GetVar('translator_resource_id');
if ($resource_id) {
$t_prefixes = explode(',', $this->Application->GetVar('translator_prefixes'));
$cdata =& $this->Application->recallObject($t_prefixes[1], null, Array('skip_autoload' => true));
$cdata->Load($resource_id, 'ResourceId');
if (!$cdata->isLoaded()) {
$cdata->SetDBField('ResourceId', $resource_id);
$cdata->Create();
}
$this->Application->SetVar($cdata->getPrefixSpecial().'_id', $cdata->GetID());
}
$event->redirect = $this->Application->GetVar('translator_t');
$event->redirect_params = Array('pass'=>'all,trans,'.$this->Application->GetVar('translator_prefixes'),
$event->getPrefixSpecial(true).'_id' => $object->GetID(),
'trans_event' => 'OnLoad',
'trans_prefix' => $this->Application->GetVar('translator_prefixes'),
'trans_field' => $this->Application->GetVar('translator_field'),
'trans_multi_line' => $this->Application->GetVar('translator_multi_line'),
);
// 1. SAVE LAST TEMPLATE TO SESSION (really needed here, because of tweaky redirect)
$last_template = $this->Application->RecallVar('last_template');
preg_match('/index4\.php\|'.$this->Application->GetSID().'-(.*):/U', $last_template, $rets);
$this->Application->StoreVar('return_template', $this->Application->GetVar('t'));
}
}
function RemoveRequiredFields(&$object)
{
// making all field non-required to achieve successful presave
foreach($object->Fields as $field => $options)
{
if(isset($options['required']))
{
unset($object->Fields[$field]['required']);
}
}
}
/**
* Dynamically fills customdata config
*
* @param kEvent $event
*/
function OnCreateCustomFields(&$event)
{
$main_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
if (!$main_prefix) return false;
$item_type = $this->Application->getUnitOption($main_prefix, 'ItemType');
if (!$item_type) {
// no main config of such type
return false;
}
// 1. get custom field information
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'CustomField
WHERE Type = '.$item_type.'
ORDER BY CustomFieldId';
$custom_fields = $this->Conn->Query($sql, 'CustomFieldId');
if (!$custom_fields) {
// config doesn't have custom fields
return false;
}
// 2. create fields (for customdata item)
$fields = $this->Application->getUnitOption($event->Prefix, 'Fields', Array());
$field_options = Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'db_type' => 'text', 'default' => '');
foreach ($custom_fields as $custom_id => $custom_params) {
if (isset($fields['cust_'.$custom_id])) continue;
$fields['cust_'.$custom_id] = $field_options;
}
$this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
// 3. create virtual & calculated fields (for main item)
$calculated_fields = $this->Application->getUnitOption($main_prefix.'.', 'CalculatedFields', Array());
$virtual_fields = $this->Application->getUnitOption($main_prefix, 'VirtualFields', Array());
$cf_helper =& $this->Application->recallObject('InpCustomFieldsHelper');
$field_options = Array('type' => 'string', 'not_null' => 1, 'default' => '');
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
foreach ($custom_fields as $custom_id => $custom_params) {
switch ($custom_params['ElementType']) {
case 'date':
case 'datetime':
unset($field_options['options']);
$field_options['formatter'] = 'kDateFormatter';
break;
case 'select':
case 'radio':
if ($custom_params['ValueList']) {
$field_options['options'] = $cf_helper->GetValuesHash($custom_params['ValueList']);
$field_options['formatter'] = 'kOptionsFormatter';
}
break;
default:
unset($field_options['options'], $field_options['formatter']);
break;
}
$custom_name = $custom_params['FieldName'];
$calculated_fields['cust_'.$custom_name] = 'cust.'.$ml_formatter->LangFieldName('cust_'.$custom_id);
if (!isset($virtual_fields['cust_'.$custom_name])) {
$virtual_fields['cust_'.$custom_name] = Array();
}
$virtual_fields['cust_'.$custom_name] = array_merge_recursive2($field_options, $virtual_fields['cust_'.$custom_name]);
$custom_fields[$custom_id] = $custom_name;
}
$this->Application->setUnitOption($main_prefix, 'CustomFields', $custom_fields);
$this->Application->setUnitOption($main_prefix.'.', 'CalculatedFields', $calculated_fields);
$this->Application->setUnitOption($main_prefix, 'VirtualFields', $virtual_fields);
}
/**
* Saves selected user in needed field
*
* @param kEvent $event
*/
function OnSelectUser(&$event)
{
$items_info = $this->Application->GetVar('u');
if ($items_info) {
$user_id = array_shift( array_keys($items_info) );
$object =& $event->getObject();
$this->RemoveRequiredFields($object);
$is_new = !$object->isLoaded();
$is_main = $this->Application->GetVar($event->Prefix.'_mode') == 't';
if ($is_new) {
$new_event = $is_main ? 'OnPreCreate' : 'OnNew';
$event->CallSubEvent($new_event);
}
$object->SetDBField($this->Application->RecallVar('dst_field'), $user_id);
if ($is_new) {
$object->Create();
if (!$is_main && $object->IsTempTable()) {
$object->setTempID();
}
}
else {
$object->Update();
}
}
$event->SetRedirectParam($event->getPrefixSpecial().'_id', $object->GetID());
$this->finalizePopup($event);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/db/db_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.74
\ No newline at end of property
+1.75
\ No newline at end of property
Index: trunk/core/kernel/startup.php
===================================================================
--- trunk/core/kernel/startup.php (revision 6427)
+++ trunk/core/kernel/startup.php (revision 6428)
@@ -1,123 +1,123 @@
<?php
define('KERNEL_PATH', FULL_PATH.'/kernel/kernel4');
if (!function_exists('getmicrotime')) {
function getmicrotime()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
}
$globals_start = getmicrotime();
include_once(KERNEL_PATH.'/globals.php'); // non OOP functions used through kernel, e.g. print_pre
$globals_end = getmicrotime();
define('INPORTAL_ENV', 1);
# New path detection method: begin
safeDefine('REL_PATH', '/admin');
- $ps = preg_replace("/".preg_quote(rtrim(REL_PATH, '/'), '/')."$/", '', str_replace('\\', '/', dirname($_SERVER['PHP_SELF'])));
+ $ps = rtrim(preg_replace("/".preg_quote(rtrim(REL_PATH, '/'), '/')."$/", '', str_replace('\\', '/', dirname($_SERVER['PHP_SELF']))), '/');
safeDefine('BASE_PATH', $ps); // in case in-portal has defined it before
# New path detection method: end
safeDefine('INPORTAL_TAGS', true);
safeDefine('SERVER_NAME', $_SERVER['HTTP_HOST']);
safeDefine('KERNEL_PATH', FULL_PATH.'/kernel4');
$https_mark = getArrayValue($_SERVER, 'HTTPS');
safeDefine('PROTOCOL', ($https_mark == 'on') || ($https_mark == '1') ? 'https://' : 'http://');
$vars = parse_portal_ini(FULL_PATH.'/config.php');
if ($vars === false || count($vars) == 0) {
global $rootURL;
echo 'In-Portal is probably not installed, or configuration file is missing.<br>';
echo 'Please use the installation script to fix the problem.<br><br>';
echo '<a href="'.PROTOCOL.SERVER_NAME.rtrim(BASE_PATH, '/').'/admin/install.php">Go to installation script</a><br><br>';
flush();
exit;
}
define('SQL_TYPE', $vars['DBType']);
define('SQL_SERVER', $vars['DBHost']);
define('SQL_USER', $vars['DBUser']);
define('SQL_PASS', $vars['DBUserPassword']);
define('SQL_DB', $vars['DBName']);
define('TABLE_PREFIX', $vars['TablePrefix']);
define('DOMAIN', getArrayValue($vars, 'Domain'));
ini_set('memory_limit', '50M');
define('MODULES_PATH', FULL_PATH);
define('EXPORT_PATH', FULL_PATH.'/admin/export');
define('GW_CLASS_PATH', MODULES_PATH.'/in-commerce/units/gateways/gw_classes'); // Payment Gateway Classes Path
define('SYNC_CLASS_PATH', FULL_PATH.'/sync'); // path for 3rd party user syncronization scripts
safeDefine('ENV_VAR_NAME','env');
safeDefine('IMAGES_PATH', '/kernel/images/');
safeDefine('IMAGES_PENDING_PATH', IMAGES_PATH.'pending/');
safeDefine('CUSTOM_UPLOAD_PATH', '/templates/images/custom/');
safeDefine('MAX_UPLOAD_SIZE', min(ini_get('upload_max_filesize'), ini_get('post_max_size'))*1024*1024);
if( ini_get('safe_mode') ) define('SAFE_MODE', 1);
safeDefine('EXPERIMENTAL_PRE_PARSE', 1);
safeDefine('SILENT_LOG', 0);
if( file_exists(FULL_PATH.'/debug.php') )
{
include_once(FULL_PATH.'/debug.php');
if( constOn('DEBUG_MODE') ) {
$debugger_start = getmicrotime();
include_once(KERNEL_PATH.'/utility/debugger.php');
$debugger_end = getmicrotime();
if (isset($debugger) && constOn('DBG_PROFILE_INCLUDES')) {
// $debugger->profileStart('inc_globals', KERNEL_PATH.'/globals.php', $globals_start);
// $debugger->profileFinish('inc_globals', KERNEL_PATH.'/globals.php', $globals_end);
$debugger->profilerAddTotal('includes', 'inc_globals');
$debugger->profileStart('inc_debugger', KERNEL_PATH.'/utility/debugger.php', $debugger_start);
$debugger->profileFinish('inc_debugger', KERNEL_PATH.'/utility/debugger.php', $debugger_end);
$debugger->profilerAddTotal('includes', 'inc_debugger');
}
}
}
$includes = Array(
KERNEL_PATH.'/application.php',
MODULES_PATH.'/kernel/units/general/my_application.php',
KERNEL_PATH.'/db/db_connection.php',
KERNEL_PATH."/kbase.php",
KERNEL_PATH.'/utility/event.php',
KERNEL_PATH."/utility/factory.php",
KERNEL_PATH."/languages/phrases_cache.php",
KERNEL_PATH."/db/dblist.php",
KERNEL_PATH."/db/dbitem.php",
// KERNEL_PATH.'/processors/tag_processor.php',
// KERNEL_PATH."/db/db_tag_processor.php",
KERNEL_PATH."/event_handler.php",
KERNEL_PATH.'/db/db_event_handler.php',
MODULES_PATH.'/kernel/units/general/inp_db_event_handler.php',
);
foreach ($includes as $a_file) {
k4_include_once($a_file);
}
if (defined('DEBUG_MODE') && DEBUG_MODE && isset($debugger)) {
$debugger->AttachToApplication();
}
if( !function_exists('adodb_mktime') ) include_once(KERNEL_PATH.'/utility/adodb-time.inc.php');
// include_once(KERNEL_PATH."/utility/temp_handler.php"); // needed because of static calls from kBase
// up to here
// global constants
define ('KG_TO_POUND', 2.20462262);
define ('POUND_TO_KG', 0.45359237);
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/startup.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.46
\ No newline at end of property
+1.47
\ No newline at end of property
Index: trunk/core/kernel/application.php
===================================================================
--- trunk/core/kernel/application.php (revision 6427)
+++ trunk/core/kernel/application.php (revision 6428)
@@ -1,2197 +1,2205 @@
<?php
/**
* Basic class for Kernel3-based Application
*
* This class is a Facade for any other class which needs to deal with Kernel3 framework.<br>
* The class incapsulates the main run-cycle of the script, provide access to all other objects in the framework.<br>
* <br>
* The class is a singleton, which means that there could be only one instance of KernelApplication in the script.<br>
* This could be guranteed by NOT calling the class constuctor directly, but rather calling KernelApplication::Instance() method,
* which returns an instance of the application. The method gurantees that it will return exactly the same instance for any call.<br>
* See singleton pattern by GOF.
* @package kernel4
*/
class kApplication {
/**
* Is true, when Init method was called already, prevents double initialization
*
* @var bool
*/
var $InitDone = false;
/**
* Holds internal TemplateParser object
* @access private
* @var TemplateParser
*/
var $Parser;
/**
* Holds parser output buffer
* @access private
* @var string
*/
var $HTML;
/**
* Prevents request from beeing proceeded twice in case if application init is called mere then one time
*
* @var bool
* @todo This is not good anyway (by Alex)
*/
var $RequestProcessed = false;
/**
* The main Factory used to create
* almost any class of kernel and
* modules
*
* @access private
* @var kFactory
*/
var $Factory;
/**
* All ConfigurationValues table content (hash) here
*
* @var Array
* @access private
*/
var $ConfigHash = Array();
/**
* Ids of config variables used in current run (for caching)
*
* @var Array
* @access private
*/
var $ConfigCacheIds = array();
/**
* Reference to debugger
*
* @var Debugger
*/
var $Debugger = null;
/**
* Holds all phrases used
* in code and template
*
* @var PhrasesCache
*/
var $Phrases;
/**
* Modules table content, key - module name
*
* @var Array
*/
var $ModuleInfo = Array();
/**
* Holds DBConnection
*
* @var kDBConnection
*/
var $Conn = null;
/**
* Maintains list of user-defined error handlers
*
* @var Array
*/
var $errorHandlers = Array();
// performance needs:
/**
* Holds a refererence to httpquery
*
* @var kHttpQuery
*/
var $HttpQuery = null;
/**
* Holds a reference to UnitConfigReader
*
* @var kUnitConfigReader
*/
var $UnitConfigReader = null;
/**
* Holds a reference to Session
*
* @var Session
*/
var $Session = null;
/**
* Holds a ref to kEventManager
*
* @var kEventManager
*/
var $EventManager = null;
/**
* Ref to itself, needed because everybody used to write $this->Application, even inside kApplication
*
* @var kApplication
*/
var $Application = null;
/**
* Ref for TemplatesChache
*
* @var TemplatesCache
*/
var $TemplatesCache = null;
var $CompilationCache = array(); //used when compiling templates
var $CachedProcessors = array(); //used when running compiled templates
/**
* Returns kApplication instance anywhere in the script.
*
* This method should be used to get single kApplication object instance anywhere in the
* Kernel-based application. The method is guranteed to return the SAME instance of kApplication.
* Anywhere in the script you could write:
* <code>
* $application =& kApplication::Instance();
* </code>
* or in an object:
* <code>
* $this->Application =& kApplication::Instance();
* </code>
* to get the instance of kApplication. Note that we call the Instance method as STATIC - directly from the class.
* To use descendand of standard kApplication class in your project you would need to define APPLICATION_CLASS constant
* BEFORE calling kApplication::Instance() for the first time. If APPLICATION_CLASS is not defined the method would
* create and return default KernelApplication instance.
* @static
* @access public
* @return kApplication
*/
function &Instance()
{
static $instance = false;
if(!$instance)
{
safeDefine('APPLICATION_CLASS', 'kApplication');
$class = APPLICATION_CLASS;
$instance = new $class();
$instance->Application =& $instance;
}
return $instance;
}
/**
* Initializes the Application
*
* @access public
* @see kHTTPQuery
* @see Session
* @see TemplatesCache
* @return bool Was Init actually made now or before
*/
function Init()
{
if($this->InitDone) return false;
- ob_start(); // collect any output from method (other then tags) into buffer
+ if (!constOn('SKIP_OUT_COMPRESSION')) {
+ ob_start(); // collect any output from method (other then tags) into buffer
+ }
if(defined('DEBUG_MODE') && $this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Init:');
}
if (!$this->isDebugMode() && !constOn('DBG_ZEND_PRESENT')) {
error_reporting(0);
ini_set('display_errors', 0);
}
if (!constOn('DBG_ZEND_PRESENT')) {
$error_handler = set_error_handler( Array(&$this,'handleError') );
if ($error_handler) $this->errorHandlers[] = $error_handler;
}
$this->Conn = new kDBConnection(SQL_TYPE, Array(&$this, 'handleSQLError') );
$this->Conn->Connect(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB);
$this->Conn->debugMode = $this->isDebugMode();
$this->Factory = new kFactory();
$this->registerDefaultClasses();
$this->Phrases = new PhrasesCache();
$this->EventManager =& $this->Factory->makeClass('EventManager');
$this->Factory->Storage['EventManager'] =& $this->EventManager;
$this->RegisterDefaultBuildEvents();
$this->SetDefaultConstants();
$this->UnitConfigReader =& $this->recallObject('kUnitConfigReader');
$this->UnitConfigReader->scanModules(MODULES_PATH);
$this->registerModuleConstants();
$rewrite_on = $this->ConfigValue('UseModRewrite');
// admin=1 - when front is browsed using admin session
$admin_on = getArrayValue($_REQUEST, 'admin') || $this->IsAdmin();
define('MOD_REWRITE', $rewrite_on && !$admin_on ? 1 : 0);
$this->HttpQuery =& $this->recallObject('HTTPQuery');
$this->Session =& $this->recallObject('Session');
$this->HttpQuery->AfterInit();
$this->LoadCache();
$this->InitConfig();
$this->Phrases->Init('phrases');
$this->UnitConfigReader->AfterConfigRead();
/*// Module items are recalled during url parsing & PhrasesCache is needed already there,
// because it's used in their build events. That's why phrases cache initialization is
// called from kHTTPQuery in case when mod_rewrite is used
if (!$this->RewriteURLs()) {
$this->Phrases = new PhrasesCache();
}*/
if(!$this->RecallVar('UserGroups')) {
$session =& $this->recallObject('Session');
$user_groups = trim($session->GetField('GroupList'), ',');
if (!$user_groups) $user_groups = $this->ConfigValue('User_GuestGroup');
$this->StoreVar('UserGroups', $user_groups);
}
if ($this->GetVar('m_cat_id') === false) $this->SetVar('m_cat_id', 0);
if( !$this->RecallVar('curr_iso') ) $this->StoreVar('curr_iso', $this->GetPrimaryCurrency() );
$this->SetVar('visits_id', $this->RecallVar('visit_id') );
$language =& $this->recallObject( 'lang.current', null, Array('live_table' => true) );
$this->HandleEvent( new kEvent('visits:OnRegisterVisit') );
$this->ValidateLogin();
if($this->isDebugMode()) {
$this->Debugger->profileFinish('kernel4_startup');
}
$this->InitDone = true;
return true;
}
/**
* Returns module information. Searches module by requested field
*
* @param string $field
* @param mixed $value
* @param string field value to returns, if not specified, then return all fields
* @param string field to return
* @return Array
*/
function findModule($field, $value, $return_field = null)
{
$found = false;
foreach ($this->ModuleInfo as $module_name => $module_info) {
if (strtolower($module_info[$field]) == strtolower($value)) {
$found = true;
break;
}
}
if ($found) {
return isset($return_field) ? $module_info[$return_field] : $module_info;
}
return false;
}
function refreshModuleInfo()
{
$modules_helper =& $this->recallObject('ModulesHelper');
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'Modules
WHERE '.$modules_helper->getWhereClause().'
ORDER BY LoadOrder';
$this->ModuleInfo = $this->Conn->Query($sql, 'Name');
$this->registerModuleConstants();
}
/**
* Checks if passed language id if valid and sets it to primary otherwise
*
*/
function VerifyLanguageId()
{
$language_id = $this->GetVar('m_lang');
if (!$language_id) {
$language_id = 'default';
}
$this->SetVar('lang.current_id', $language_id );
$this->SetVar('m_lang', $language_id );
$lang_mode = $this->GetVar('lang_mode');
$this->SetVar('lang_mode', '');
$lang =& $this->recallObject('lang.current');
if ( !$lang->IsLoaded() || (!$this->Application->IsAdmin() && !$lang->GetDBField('Enabled')) ) {
if (!defined('IS_INSTALL')) $this->ApplicationDie('Unknown or disabled language');
}
$this->SetVar('lang_mode',$lang_mode);
}
/**
* Checks if passed theme id if valid and sets it to primary otherwise
*
*/
function VerifyThemeId()
{
if ($this->Application->IsAdmin()) {
safeDefine('THEMES_PATH', '/kernel/admin_templates');
return;
}
$theme_id = $this->GetVar('m_theme');
if (!$theme_id) {
$theme_id = $this->GetDefaultThemeId();
if (!$theme_id) {
$this->ApplicationDie('No Primary Theme Selected');
}
}
$this->SetVar('m_theme', $theme_id);
$this->SetVar('theme.current_id', $theme_id ); // KOSTJA: this is to fool theme' getPassedId
$theme =& $this->recallObject('theme.current');
if (!$theme->IsLoaded() || !$theme->GetDBField('Enabled')) {
if (!defined('IS_INSTALL')) $this->ApplicationDie('Unknown or disabled theme');
}
safeDefine('THEMES_PATH', '/themes/'.$theme->GetDBField('Name'));
}
function GetDefaultLanguageId()
{
static $language_id = 0;
if ($language_id > 0) return $language_id;
$table = $this->getUnitOption('lang','TableName');
$id_field = $this->getUnitOption('lang','IDField');
$sql = 'SELECT '.$id_field.'
FROM '.$table.'
WHERE (PrimaryLang = 1) AND (Enabled = 1)';
$language_id = $this->Conn->GetOne($sql);
if (!$language_id && defined('IS_INSTALL') && IS_INSTALL) {
$language_id = 1;
}
return $language_id;
}
function GetDefaultThemeId()
{
static $theme_id = 0;
if($theme_id > 0) return $theme_id;
if (constOn('DBG_FORCE_THEME')) {
$theme_id = DBG_FORCE_THEME;
}
else {
$table = $this->getUnitOption('theme','TableName');
$id_field = $this->getUnitOption('theme','IDField');
$sql = 'SELECT '.$id_field.'
FROM '.$table.'
WHERE (PrimaryTheme = 1) AND (Enabled = 1)';
$theme_id = $this->Conn->GetOne($sql);
}
return $theme_id;
}
function GetPrimaryCurrency()
{
if ($this->isModuleEnabled('In-Commerce')) {
$table = $this->getUnitOption('curr', 'TableName');
return $this->Conn->GetOne('SELECT ISO FROM '.$table.' WHERE IsPrimary = 1');
}
else {
return 'USD';
}
}
/**
* Registers default classes such as ItemController, GridController and LoginController
*
* Called automatically while initializing Application
* @access private
* @return void
*/
function RegisterDefaultClasses()
{
$this->registerClass('kTempTablesHandler', KERNEL_PATH.'/utility/temp_handler.php');
$this->registerClass('kEventManager', KERNEL_PATH.'/event_manager.php', 'EventManager');
$this->registerClass('kUnitConfigReader', KERNEL_PATH.'/utility/unit_config_reader.php');
$this->registerClass('kArray', KERNEL_PATH.'/utility/params.php');
$this->registerClass('Params', KERNEL_PATH.'/utility/params.php');
$this->registerClass('kHelper', KERNEL_PATH.'/kbase.php');
$this->registerClass('kCache', KERNEL_PATH.'/utility/cache.php', 'Cache', Array('Params'));
$this->registerClass('kHTTPQuery', KERNEL_PATH.'/utility/http_query.php', 'HTTPQuery', Array('Params') );
$this->registerClass('Session', KERNEL_PATH.'/session/session.php');
$this->registerClass('SessionStorage', KERNEL_PATH.'/session/session.php');
$this->registerClass('Params', KERNEL_PATH.'/utility/params.php', 'kActions');
/*$this->registerClass('kFormatter', KERNEL_PATH.'/utility/formatters.php');
$this->registerClass('kOptionsFormatter', KERNEL_PATH.'/utility/formatters.php');
$this->registerClass('kUploadFormatter', KERNEL_PATH.'/utility/formatters.php');
$this->registerClass('kPictureFormatter', KERNEL_PATH.'/utility/formatters.php');
$this->registerClass('kDateFormatter', KERNEL_PATH.'/utility/formatters.php');
$this->registerClass('kLEFTFormatter', KERNEL_PATH.'/utility/formatters.php');
$this->registerClass('kMultiLanguage', KERNEL_PATH.'/utility/formatters.php');
$this->registerClass('kPasswordFormatter', KERNEL_PATH.'/utility/formatters.php');
$this->registerClass('kCCDateFormatter', KERNEL_PATH.'/utility/formatters.php');
$this->registerClass('kUnitFormatter', KERNEL_PATH.'/utility/formatters.php');
$this->registerClass('kFilesizeFormatter', KERNEL_PATH.'/utility/formatters.php');
$this->registerClass('kSerializedFormatter', KERNEL_PATH.'/utility/formatters.php');*/
$this->registerClass('kMultipleFilter', KERNEL_PATH.'/utility/filters.php');
$this->registerClass('kDBList', KERNEL_PATH.'/db/dblist.php');
$this->registerClass('kDBItem', KERNEL_PATH.'/db/dbitem.php');
$this->registerClass('kDBEventHandler', KERNEL_PATH.'/db/db_event_handler.php');
$this->registerClass('kTagProcessor', KERNEL_PATH.'/processors/tag_processor.php');
$this->registerClass('kMainTagProcessor', KERNEL_PATH.'/processors/main_processor.php','m_TagProcessor', 'kTagProcessor');
$this->registerClass('kDBTagProcessor', KERNEL_PATH.'/db/db_tag_processor.php', null, 'kTagProcessor');
$this->registerClass('TemplatesCache', KERNEL_PATH.'/parser/template.php');
$this->registerClass('Template', KERNEL_PATH.'/parser/template.php');
$this->registerClass('TemplateParser', KERNEL_PATH.'/parser/template_parser.php',null, 'kDBTagProcessor');
$this->registerClass('kEmailMessage', KERNEL_PATH.'/utility/email.php');
$this->registerClass('kSmtpClient', KERNEL_PATH.'/utility/smtp_client.php');
if (file_exists(MODULES_PATH.'/in-commerce/units/currencies/currency_rates.php')) {
$this->registerClass('kCurrencyRates', MODULES_PATH.'/in-commerce/units/currencies/currency_rates.php');
}
$this->registerClass('FCKeditor', FULL_PATH.'/admin/editor/cmseditor/fckeditor.php'); // need this?
}
function RegisterDefaultBuildEvents()
{
$event_manager =& $this->recallObject('EventManager');
$event_manager->registerBuildEvent('kTempTablesHandler', 'OnTempHandlerBuild');
}
/**
* Returns item's filename that corresponds id passed. If possible, then get it from cache
*
* @param string $prefix
* @param int $id
* @return string
*/
function getFilename($prefix, $id, $category_id=null)
{
$filename = $this->getCache('filenames', $prefix.'_'.$id);
if ($filename === false) {
$table = $this->getUnitOption($prefix, 'TableName');
$id_field = $this->getUnitOption($prefix, 'IDField');
if ($prefix == 'c') {
if(!$id) {
$this->setCache('filenames', $prefix.'_'.$id, '');
return '';
}
// this allows to save 2 sql queries for each category
$sql = 'SELECT NamedParentPath, CachedCategoryTemplate
FROM '.$table.'
WHERE '.$id_field.' = '.$this->Conn->qstr($id);
$category_data = $this->Conn->GetRow($sql);
$filename = $category_data['NamedParentPath'];
$this->setCache('category_templates', $id, $category_data['CachedCategoryTemplate']);
// $this->setCache('item_templates', $id, $category_data['CachedItemTemplate']);
}
else {
$resource_id = $this->Conn->GetOne('SELECT ResourceId FROM '.$table.' WHERE '.$id_field.' = '.$this->Conn->qstr($id));
if (is_null($category_id)) $category_id = $this->GetVar('m_cat_id');
$sql = 'SELECT Filename FROM '.TABLE_PREFIX.'CategoryItems WHERE ItemResourceId = '.$resource_id.' AND CategoryId = '.$category_id;
$filename = $this->Conn->GetOne($sql);
/*if (!$filename) {
$sql = 'SELECT Filename FROM '.TABLE_PREFIX.'CategoryItems WHERE ItemResourceId = '.$resource_id.' AND PrimaryCat = 1';
$filename = $this->Conn->GetOne($sql);
}*/
/*$sql = 'SELECT Filename
FROM '.$table.'
WHERE '.$id_field.' = '.$this->Conn->qstr($id);
$filename = $this->Conn->GetOne($sql);*/
}
$this->setCache('filenames', $prefix.'_'.$id, $filename);
}
return $filename;
}
/**
* Adds new value to cache $cache_name and identified by key $key
*
* @param string $cache_name cache name
* @param int $key key name to add to cache
* @param mixed $value value of chached record
*/
function setCache($cache_name, $key, $value)
{
$cache =& $this->recallObject('Cache');
$cache->setCache($cache_name, $key, $value);
}
/**
* Returns cached $key value from cache named $cache_name
*
* @param string $cache_name cache name
* @param int $key key name from cache
* @return mixed
*/
function getCache($cache_name, $key)
{
$cache =& $this->recallObject('Cache');
return $cache->getCache($cache_name, $key);
}
/**
* Defines default constants if it's not defined before - in config.php
*
* @access private
*/
function SetDefaultConstants()
{
safeDefine('SERVER_NAME', $_SERVER['HTTP_HOST']);
}
/**
* Registers each module specific constants if any found
*
*/
function registerModuleConstants()
{
if (!$this->ModuleInfo) return false;
foreach($this->ModuleInfo as $module_name => $module_info)
{
$module_path = '/'.$module_info['Path'];
$contants_file = FULL_PATH.$module_path.'constants.php';
if( file_exists($contants_file) ) k4_include_once($contants_file);
}
return true;
}
function ProcessRequest()
{
$event_manager =& $this->recallObject('EventManager');
if($this->isDebugMode() && constOn('DBG_SHOW_HTTPQUERY')) {
$this->Debugger->appendHTML('HTTPQuery:');
$this->Debugger->dumpVars($this->HttpQuery->_Params);
}
$event_manager->ProcessRequest();
$event_manager->RunRegularEvents(reBEFORE);
$this->RequestProcessed = true;
}
/**
* Actually runs the parser against current template and stores parsing result
*
* This method gets t variable passed to the script, loads the template given in t variable and
* parses it. The result is store in {@link $this->HTML} property.
* @access public
* @return void
*/
function Run()
{
if($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Run:');
}
if ($this->IsAdmin()) {
// for permission checking in events & templates
$this->LinkVar('module'); // for common configuration templates
$this->LinkVar('section'); // for common configuration templates
if ($this->GetVar('m_opener') == 'p') {
$this->LinkVar('main_prefix'); // window prefix, that opened selector
$this->LinkVar('dst_field'); // field to set value choosed in selector
$this->LinkVar('return_template'); // template to go, when something was coosen from popup (from finalizePopup)
$this->LinkVar('return_m'); // main env part to restore after popup will be closed (from finalizePopup)
}
if ($this->GetVar('ajax') == 'yes') {
// hide debug output from ajax requests automatically
define('DBG_SKIP_REPORTING', 1);
}
}
if (!$this->RequestProcessed) $this->ProcessRequest();
$this->InitParser();
$t = $this->GetVar('t');
- if ($this->isModuleEnabled('In-CMS')) {
+ if ($this->isModuleEnabled('In-Edit')) {
$cms_handler =& $this->recallObject('cms_EventHandler');
if (!$this->TemplatesCache->TemplateExists($t) && !$this->IsAdmin()) {
$t = $cms_handler->GetDesignTemplate();
}
/*else {
$cms_handler->SetCatByTemplate();
}*/
}
if($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Parsing:');
}
$this->HTML = $this->Parser->ParseTemplate( $t );
if ($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application after Parsing:');
}
}
function InitParser()
{
if( !is_object($this->Parser) ) {
$this->Parser =& $this->recallObject('TemplateParser');
$this->TemplatesCache =& $this->recallObject('TemplatesCache');
}
}
/**
* Send the parser results to browser
*
* Actually send everything stored in {@link $this->HTML}, to the browser by echoing it.
* @access public
* @return void
*/
function Done()
{
if ($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Done:');
}
if ($this->GetVar('admin')) {
$reg = '/('.preg_quote(BASE_PATH, '/').'.*\.html)(#.*){0,1}(")/sU';
$this->HTML = preg_replace($reg, "$1?admin=1$2$3", $this->HTML);
}
//eval("?".">".$this->HTML);
if ($this->isDebugMode()) {
$this->EventManager->RunRegularEvents(reAFTER);
$this->Session->SaveData();
$this->HTML = ob_get_clean() . $this->HTML . $this->Debugger->printReport(true);
}
else {
$this->HTML = ob_get_clean().$this->HTML;
}
if ($this->UseOutputCompression()) {
header('Content-Encoding: gzip');
$compression_level = $this->ConfigValue('OutputCompressionLevel');
if ($compression_level < 0 || $compression_level > 9) $compression_level = 7;
echo gzencode($this->HTML, $compression_level);
}
else {
echo $this->HTML;
}
$this->UpdateCache();
flush();
if ($this->isDebugMode() && constOn('DBG_CACHE')) {
$cache =& $this->recallObject('Cache');
$cache->printStatistics();
}
$this->EventManager->RunRegularEvents(reAFTER);
$this->Session->SaveData();
}
/**
* Checks if output compression options is available
*
* @return string
*/
function UseOutputCompression()
{
if (constOn('IS_INSTALL') || constOn('DBG_ZEND_PRESENT') || constOn('SKIP_OUT_COMPRESSION')) return false;
return $this->ConfigValue('UseOutputCompression') && function_exists('gzencode') && strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
}
// Facade
/**
* Returns current session id (SID)
* @access public
* @return longint
*/
function GetSID()
{
$session =& $this->recallObject('Session');
return $session->GetID();
}
function DestroySession()
{
$session =& $this->recallObject('Session');
$session->Destroy();
}
/**
* Returns variable passed to the script as GET/POST/COOKIE
*
* @access public
* @param string $name Name of variable to retrieve
* @param int $default default value returned in case if varible not present
* @return mixed
*/
function GetVar($name, $default = false)
{
// $http_query =& $this->recallObject('HTTPQuery');
return isset($this->HttpQuery->_Params[$name]) ? $this->HttpQuery->_Params[$name] : $default;
}
/**
* Returns ALL variables passed to the script as GET/POST/COOKIE
*
* @access public
* @return array
*/
function GetVars()
{
return $this->HttpQuery->GetParams();
}
/**
* Set the variable 'as it was passed to the script through GET/POST/COOKIE'
*
* This could be useful to set the variable when you know that
* other objects would relay on variable passed from GET/POST/COOKIE
* or you could use SetVar() / GetVar() pairs to pass the values between different objects.<br>
*
* This method is formerly known as $this->Session->SetProperty.
* @param string $var Variable name to set
* @param mixed $val Variable value
* @access public
* @return void
*/
function SetVar($var,$val)
{
// $http_query =& $this->recallObject('HTTPQuery');
return $this->HttpQuery->Set($var,$val);
}
/**
* Deletes kHTTPQuery variable
*
* @param string $var
* @todo think about method name
*/
function DeleteVar($var)
{
return $this->HttpQuery->Remove($var);
}
/**
* Deletes Session variable
*
* @param string $var
*/
function RemoveVar($var)
{
return $this->Session->RemoveVar($var);
}
/**
* Restores Session variable to it's db version
*
* @param string $var
*/
function RestoreVar($var)
{
return $this->Session->RestoreVar($var);
}
/**
* Returns session variable value
*
* Return value of $var variable stored in Session. An optional default value could be passed as second parameter.
*
* @see SimpleSession
* @access public
* @param string $var Variable name
* @param mixed $default Default value to return if no $var variable found in session
* @return mixed
*/
function RecallVar($var,$default=false)
{
return $this->Session->RecallVar($var,$default);
}
/**
* Stores variable $val in session under name $var
*
* Use this method to store variable in session. Later this variable could be recalled.
* @see RecallVar
* @access public
* @param string $var Variable name
* @param mixed $val Variable value
*/
function StoreVar($var, $val)
{
$session =& $this->recallObject('Session');
$this->Session->StoreVar($var, $val);
}
function StoreVarDefault($var, $val)
{
$session =& $this->recallObject('Session');
$this->Session->StoreVarDefault($var, $val);
}
/**
* Links HTTP Query variable with session variable
*
* If variable $var is passed in HTTP Query it is stored in session for later use. If it's not passed it's recalled from session.
* This method could be used for making sure that GetVar will return query or session value for given
* variable, when query variable should overwrite session (and be stored there for later use).<br>
* This could be used for passing item's ID into popup with multiple tab -
* in popup script you just need to call LinkVar('id', 'current_id') before first use of GetVar('id').
* After that you can be sure that GetVar('id') will return passed id or id passed earlier and stored in session
* @access public
* @param string $var HTTP Query (GPC) variable name
* @param mixed $ses_var Session variable name
* @param mixed $default Default variable value
*/
function LinkVar($var, $ses_var = null, $default = '')
{
if (!isset($ses_var)) $ses_var = $var;
if ($this->GetVar($var) !== false) {
$this->StoreVar($ses_var, $this->GetVar($var));
}
else {
$this->SetVar($var, $this->RecallVar($ses_var, $default));
}
}
/**
* Returns variable from HTTP Query, or from session if not passed in HTTP Query
*
* The same as LinkVar, but also returns the variable value taken from HTTP Query if passed, or from session if not passed.
* Returns the default value if variable does not exist in session and was not passed in HTTP Query
*
* @see LinkVar
* @access public
* @param string $var HTTP Query (GPC) variable name
* @param mixed $ses_var Session variable name
* @param mixed $default Default variable value
* @return mixed
*/
function GetLinkedVar($var, $ses_var = null, $default = '')
{
$this->LinkVar($var, $ses_var, $default);
return $this->GetVar($var);
}
function AddBlock($name, $tpl)
{
$this->cache[$name] = $tpl;
}
/* Seems to be not used anywhere... /Kostja
function SetTemplateBody($title,$body)
{
$templates_cache =& $this->recallObject('TemplatesCache');
$templates_cache->SetTemplateBody($title,$body);
}*/
function ProcessTag($tag_data)
{
$a_tag = new Tag($tag_data,$this->Parser);
return $a_tag->DoProcessTag();
}
function ProcessParsedTag($prefix, $tag, $params)
{
$a_tag = new Tag('',$this->Parser);
$a_tag->Tag = $tag;
$a_tag->Processor = $prefix;
$a_tag->NamedParams = $params;
return $a_tag->DoProcessTag();
}
/**
* Return ADODB Connection object
*
* Returns ADODB Connection object already connected to the project database, configurable in config.php
* @access public
* @return kDBConnection
*/
function &GetADODBConnection()
{
return $this->Conn;
}
function ParseBlock($params,$pass_params=0,$as_template=false)
{
if (substr($params['name'], 0, 5) == 'html:') return substr($params['name'], 6);
return $this->Parser->ParseBlock($params, $pass_params, $as_template);
}
/**
* Returns index file, that could be passed as parameter to method, as parameter to tag and as constant or not passed at all
*
* @param string $prefix
* @param string $index_file
* @param Array $params
* @return string
*/
function getIndexFile($prefix, $index_file, &$params)
{
if (isset($params['index_file'])) {
$index_file = $params['index_file'];
unset($params['index_file']);
return $index_file;
}
if (isset($index_file)) {
return $index_file;
}
if (defined('INDEX_FILE')) {
return INDEX_FILE;
}
$cut_prefix = trim(BASE_PATH, '/').'/'.trim($prefix, '/');
return trim(preg_replace('/'.preg_quote($cut_prefix, '/').'(.*)/', '\\1', $_SERVER['PHP_SELF']), '/');
}
/**
* Return href for template
*
* @access public
* @param string $t Template path
* @var string $prefix index.php prefix - could be blank, 'admin'
*/
function HREF($t, $prefix='', $params=null, $index_file=null)
{
if(!$t) $t = $this->GetVar('t'); // moved from kMainTagProcessor->T()
if ($this->GetVar('skip_last_template')) {
$params['opener'] = 'p';
$this->SetVar('m_opener', 'p');
}
if ($t == 'incs/close_popup') {
// because this template closes the popup and we don't need popup mark here anymore
$params['m_opener'] = 's';
}
if( substr($t, -4) == '.tpl' ) $t = substr($t, 0, strlen($t) - 4 );
if ( $this->IsAdmin() && $prefix == '') $prefix = '/admin';
if ( $this->IsAdmin() && $prefix == '_FRONT_END_') $prefix = '';
$index_file = $this->getIndexFile($prefix, $index_file, $params);
if (isset($params['_auto_prefix_'])) {
unset($params['_auto_prefix_']); // this is parser-related param, do not need to pass it here
}
$ssl = isset($params['__SSL__']) ? $params['__SSL__'] : null;
if ($ssl !== null) {
$session =& $this->recallObject('Session');
$cookie_url = trim($session->CookieDomain.$session->CookiePath, '/.');
if ($ssl) {
$target_url = $this->ConfigValue('SSL_URL');
}
else {
$target_url = 'http://'.DOMAIN.$this->ConfigValue('Site_Path');
}
if (!preg_match('#'.preg_quote($cookie_url).'#', $target_url)) {
$session->SetMode(smGET_ONLY);
}
}
if (getArrayValue($params, 'opener') == 'u') {
$opener_stack=$this->RecallVar('opener_stack');
if($opener_stack) {
$opener_stack=unserialize($opener_stack);
if (count($opener_stack) > 0) {
list($index_file, $env) = explode('|', $opener_stack[count($opener_stack)-1]);
$ret = $this->BaseURL($prefix, $ssl).$index_file.'?'.ENV_VAR_NAME.'='.$env;
if( getArrayValue($params,'escape') ) $ret = addslashes($ret);
return $ret;
}
else {
//define('DBG_REDIRECT', 1);
$t = $this->GetVar('t');
}
}
else {
//define('DBG_REDIRECT', 1);
$t = $this->GetVar('t');
}
}
$pass = isset($params['pass']) ? $params['pass'] : '';
$pass_events = isset($params['pass_events']) ? $params['pass_events'] : false; // pass events with url
$map_link = '';
if( isset($params['anchor']) )
{
$map_link = '#'.$params['anchor'];
unset($params['anchor']);
}
if ( isset($params['no_amp']) )
{
$params['__URLENCODE__'] = $params['no_amp'];
unset($params['no_amp']);
}
$no_rewrite = false;
if( isset($params['__NO_REWRITE__']) )
{
$no_rewrite = true;
unset($params['__NO_REWRITE__']);
}
$force_rewrite = false;
if( isset($params['__MOD_REWRITE__']) )
{
$force_rewrite = true;
unset($params['__MOD_REWRITE__']);
}
$force_no_sid = false;
if( isset($params['__NO_SID__']) )
{
$force_no_sid = true;
unset($params['__NO_SID__']);
}
// append pass through variables to each link to be build
$params = array_merge_recursive2($this->getPassThroughVariables($params), $params);
if ($force_rewrite || ($this->RewriteURLs($ssl) && !$no_rewrite))
{
$session =& $this->recallObject('Session');
if( $session->NeedQueryString() && !$force_no_sid ) $params['sid'] = $this->GetSID();
$url = $this->BuildEnv_NEW($t, $params, $pass, $pass_events);
$ret = $this->BaseURL($prefix, $ssl).$url.$map_link;
}
else
{
+ unset($params['pass_category']); // we don't need to pass it when mod_rewrite is off
$env = $this->BuildEnv($t, $params, $pass, $pass_events);
$ret = $this->BaseURL($prefix, $ssl).$index_file.'?'.$env.$map_link;
}
return $ret;
}
/**
* Returns variables with values that should be passed throught with this link + variable list
*
* @param Array $params
* @return Array
*/
function getPassThroughVariables(&$params)
{
static $cached_pass_through = null;
if (isset($params['no_pass_through']) && $params['no_pass_through']) {
unset($params['no_pass_through']);
return Array();
}
// because pass through is not changed during script run, then we can cache it
if (is_null($cached_pass_through)) {
$cached_pass_through = Array();
$pass_through = $this->Application->GetVar('pass_through');
if ($pass_through) {
// names of variables to pass to each link
$cached_pass_through['pass_through'] = $pass_through;
$pass_through = explode(',', $pass_through);
foreach ($pass_through as $pass_through_var) {
$cached_pass_through[$pass_through_var] = $this->Application->GetVar($pass_through_var);
}
}
}
return $cached_pass_through;
}
/**
* Returns sorted array of passed prefixes (to build url from)
*
* @param string $pass
* @return Array
*/
function getPassInfo($pass = 'all')
{
$pass = trim(str_replace('all', trim($this->GetVar('passed'), ','), $pass), ',');
if (!$pass) {
return Array();
}
$pass_info = array_unique( explode(',', $pass) ); // array( prefix[.special], prefix[.special] ...
sort($pass_info, SORT_STRING); // to be prefix1,prefix1.special1,prefix1.special2,prefix3.specialX
// ensure that "m" prefix is at the beginning
$main_index = array_search('m', $pass_info);
if ($main_index !== false) {
unset($pass_info[$main_index]);
array_unshift($pass_info, 'm');
}
return $pass_info;
}
function BuildEnv_NEW($t, $params, $pass = 'all', $pass_events = false)
{
// $session =& $this->recallObject('Session');
$force_admin = getArrayValue($params,'admin') || $this->GetVar('admin');
// if($force_admin) $sid = $this->GetSID();
$ret = '';
$env = '';
$encode = false;
if (isset($params['__URLENCODE__']))
{
$encode = $params['__URLENCODE__'];
unset($params['__URLENCODE__']);
}
if (isset($params['__SSL__'])) {
unset($params['__SSL__']);
}
$m_only = true;
$pass_info = $this->getPassInfo($pass);
if ($pass_info) {
if ($pass_info[0] == 'm') array_shift($pass_info);
$params['t'] = $t;
foreach($pass_info as $pass_index => $pass_element)
{
list($prefix) = explode('.', $pass_element);
$require_rewrite = $this->findModule('Var', $prefix) && $this->getUnitOption($prefix, 'CatalogItem');
if ($require_rewrite) {
// if next prefix is same as current, but with special => exclude current prefix from url
$next_prefix = getArrayValue($pass_info, $pass_index + 1);
if ($next_prefix) {
$next_prefix = substr($next_prefix, 0, strlen($prefix) + 1);
if ($prefix.'.' == $next_prefix) continue;
}
$a = $this->BuildModuleEnv_NEW($pass_element, $params, $pass_events);
if ($a) {
$ret .= '/'.$a;
$m_only = false;
}
}
else
{
$env .= ':'.$this->BuildModuleEnv($pass_element, $params, $pass_events);
}
}
+ if (!$m_only) $params['pass_category'] = 1;
$ret = $this->BuildModuleEnv_NEW('m', $params, $pass_events).$ret;
$cat_processed = isset($params['category_processed']) && $params['category_processed'];
if ($cat_processed) {
unset($params['category_processed']);
}
if (!$m_only || !$cat_processed || !defined('EXP_DIR_URLS')) {
$ret = trim($ret, '/').'.html';
}
else {
$ret .= '/';
}
// $ret = trim($ret, '/').'/';
if($env) $params[ENV_VAR_NAME] = ltrim($env, ':');
}
unset($params['pass'], $params['opener'], $params['m_event']);
if ($force_admin) $params['admin'] = 1;
if( getArrayValue($params,'escape') )
{
$ret = addslashes($ret);
unset($params['escape']);
}
$ret = str_replace('%2F', '/', urlencode($ret));
$params_str = '';
$join_string = $encode ? '&' : '&amp;';
foreach ($params as $param => $value)
{
$params_str .= $join_string.$param.'='.$value;
}
$ret .= preg_replace('/^'.$join_string.'(.*)/', '?\\1', $params_str);
if ($encode) {
$ret = str_replace('\\', '%5C', $ret);
}
return $ret;
}
function BuildModuleEnv_NEW($prefix_special, &$params, $pass_events = false)
{
$event_params = Array('pass_events' => $pass_events, 'url_params' => $params);
$event = new kEvent($prefix_special.':BuildEnv', $event_params);
$this->HandleEvent($event);
$params = $event->getEventParam('url_params'); // save back unprocessed parameters
$ret = '';
if ($event->getEventParam('env_string')) {
$ret = trim( $event->getEventParam('env_string'), '/');
}
return $ret;
}
/**
* Builds env part that corresponds prefix passed
*
* @param string $prefix_special item's prefix & [special]
* @param Array $params url params
* @param bool $pass_events
*/
function BuildModuleEnv($prefix_special, &$params, $pass_events = false)
{
list($prefix) = explode('.', $prefix_special);
$query_vars = $this->getUnitOption($prefix, 'QueryString');
//if pass events is off and event is not implicity passed
if( !$pass_events && !isset($params[$prefix_special.'_event']) ) {
$params[$prefix_special.'_event'] = ''; // remove event from url if requested
//otherwise it will use value from get_var
}
if(!$query_vars) return '';
$tmp_string = Array(0 => $prefix_special);
foreach($query_vars as $index => $var_name)
{
//if value passed in params use it, otherwise use current from application
$var_name = $prefix_special.'_'.$var_name;
$tmp_string[$index] = isset( $params[$var_name] ) ? $params[$var_name] : $this->GetVar($var_name);
if ( isset($params[$var_name]) ) unset( $params[$var_name] );
}
$escaped = array();
foreach ($tmp_string as $tmp_val) {
$escaped[] = str_replace(Array('-',':'), Array('\-','\:'), $tmp_val);
}
$ret = implode('-', $escaped);
if ($this->getUnitOption($prefix, 'PortalStyleEnv') == true)
{
$ret = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/','\\1\\2-\\3', $ret);
}
return $ret;
}
function BuildEnv($t, $params, $pass='all', $pass_events = false, $env_var = true)
{
$session =& $this->recallObject('Session');
$ssl = isset($params['__SSL__']) ? $params['__SSL__'] : 0;
$sid = $session->NeedQueryString() && !$this->RewriteURLs($ssl) ? $this->GetSID() : '';
- if (getArrayValue($params,'admin') == 1) $sid = $this->GetSID();
+// if (getArrayValue($params,'admin') == 1) $sid = $this->GetSID();
$ret = '';
if ($env_var) {
$ret = ENV_VAR_NAME.'=';
}
$ret .= $sid.(constOn('INPORTAL_ENV') ? '-' : ':');
$encode = false;
if (isset($params['__URLENCODE__'])) {
$encode = $params['__URLENCODE__'];
unset($params['__URLENCODE__']);
}
if (isset($params['__SSL__'])) {
unset($params['__SSL__']);
}
$env_string = '';
$category_id = isset($params['m_cat_id']) ? $params['m_cat_id'] : $this->GetVar('m_cat_id');
$item_id = 0;
$pass_info = $this->getPassInfo($pass);
if ($pass_info) {
if ($pass_info[0] == 'm') array_shift($pass_info);
foreach ($pass_info as $pass_element) {
list($prefix) = explode('.', $pass_element);
$require_rewrite = $this->findModule('Var', $prefix);
if ($require_rewrite) {
$item_id = isset($params[$pass_element.'_id']) ? $params[$pass_element.'_id'] : $this->GetVar($pass_element.'_id');
}
$env_string .= ':'.$this->BuildModuleEnv($pass_element, $params, $pass_events);
}
}
if (strtolower($t) == '__default__') {
// to put category & item templates into cache
$filename = $this->getFilename('c', $category_id);
if ($item_id) {
$mod_rw_helper =& $this->Application->recallObject('ModRewriteHelper');
$t = $mod_rw_helper->GetItemTemplate($category_id, $pass_element); // $pass_element should be the last processed element
// $t = $this->getCache('item_templates', $category_id);
}
elseif ($category_id) {
$t = $this->getCache('category_templates', $category_id);
}
else {
$t = 'index';
}
}
$ret .= $t.':'.$this->BuildModuleEnv('m', $params, $pass_events).$env_string;
unset($params['pass']);
unset($params['opener']);
unset($params['m_event']);
if ($this->GetVar('admin') && !isset($params['admin'])) {
$params['admin'] = 1;
}
if( getArrayValue($params,'escape') )
{
$ret = addslashes($ret);
unset($params['escape']);
}
$join_string = $encode ? '&' : '&amp;';
$params_str = '';
foreach ($params as $param => $value)
{
$params_str .= $join_string.$param.'='.$value;
}
$ret .= $params_str;
if ($encode) {
$ret = str_replace('\\', '%5C', $ret);
}
return $ret;
}
function BaseURL($prefix='', $ssl=null)
{
if ($ssl === null) {
return PROTOCOL.SERVER_NAME.(defined('PORT')?':'.PORT : '').rtrim(BASE_PATH, '/').$prefix.'/';
}
else {
if ($ssl) {
return rtrim( $this->ConfigValue('SSL_URL'), '/').$prefix.'/';
}
else {
return 'http://'.DOMAIN.(defined('PORT')?':'.PORT : '').rtrim( $this->ConfigValue('Site_Path'), '/').$prefix.'/';
}
}
}
function Redirect($t='', $params=null, $prefix='', $index_file=null)
{
$js_redirect = getArrayValue($params, 'js_redirect');
if (preg_match("/external:(.*)/", $t, $rets)) {
$location = $rets[1];
}
else {
if ($t == '' || $t === true) $t = $this->GetVar('t');
// pass prefixes and special from previous url
if( isset($params['js_redirect']) ) unset($params['js_redirect']);
if (!isset($params['pass'])) $params['pass'] = 'all';
if ($this->GetVar('ajax') == 'yes' && $t == $this->GetVar('t')) {
// redirects to the same template as current
$params['ajax'] = 'yes';
}
$params['__URLENCODE__'] = 1;
$location = $this->HREF($t, $prefix, $params, $index_file);
//echo " location : $location <br>";
}
$a_location = $location;
$location = "Location: $location";
if ($this->isDebugMode() && constOn('DBG_REDIRECT')) {
$this->Debugger->appendTrace();
echo "<b>Debug output above!!!</b> Proceed to redirect: <a href=\"$a_location\">$a_location</a><br>";
}
else {
if ($js_redirect) {
$this->SetVar('t', 'redirect');
$this->SetVar('redirect_to_js', addslashes($a_location) );
$this->SetVar('redirect_to', $a_location);
return true;
}
else {
if ($this->GetVar('ajax') == 'yes' && $t != $this->GetVar('t')) {
// redirection to other then current template during ajax request
echo '#redirect#'.$a_location;
}
elseif (headers_sent() != '') {
// some output occured -> redirect using javascript
echo '<script type="text/javascript">window.location.href = \''.$a_location.'\';</script>';
}
else {
// no output before -> redirect using HTTP header
// header('HTTP/1.1 302 Found');
header("$location");
}
}
}
ob_end_flush();
- $this->Session->SaveData();
+ // session expiration is called from session initialization,
+ // that's why $this->Session may be not defined here
+ if (is_object($this->Session)) {
+ $this->Session->SaveData();
+ }
exit;
}
function Phrase($label)
{
return $this->Phrases->GetPhrase($label);
}
/**
* Replace language tags in exclamation marks found in text
*
* @param string $text
* @param bool $force_escape force escaping, not escaping of resulting string
* @return string
* @access public
*/
function ReplaceLanguageTags($text, $force_escape=null)
{
// !!!!!!!!
// if( !is_object($this->Phrases) ) $this->Debugger->appendTrace();
return $this->Phrases->ReplaceLanguageTags($text,$force_escape);
}
/**
* Checks if user is logged in, and creates
* user object if so. User object can be recalled
* later using "u" prefix. Also you may
* get user id by getting "u_id" variable.
*
* @access private
*/
function ValidateLogin()
{
$session =& $this->recallObject('Session');
$user_id = $session->GetField('PortalUserId');
if (!$user_id && $user_id != -1) $user_id = -2;
$this->SetVar('u_id', $user_id);
$this->StoreVar('user_id', $user_id);
if ($this->GetVar('expired') == 1) {
$user =& $this->recallObject('u');
$user->SetError('ValidateLogin', 'session_expired', 'la_text_sess_expired');
}
if (($user_id != -2) && constOn('DBG_REQUREST_LOG') ) {
$http_query =& $this->recallObject('HTTPQuery');
$http_query->writeRequestLog(DBG_REQUREST_LOG);
}
}
function LoadCache() {
$cache_key = $this->GetVar('t').$this->GetVar('m_theme').$this->GetVar('m_lang').$this->IsAdmin();
$query = sprintf("SELECT PhraseList, ConfigVariables FROM %s WHERE Template = %s",
TABLE_PREFIX.'PhraseCache',
$this->Conn->Qstr(md5($cache_key)));
$res = $this->Conn->GetRow($query);
if ($res) {
$this->Caches['PhraseList'] = $res['PhraseList'] ? explode(',', $res['PhraseList']) : array();
$config_ids = $res['ConfigVariables'] ? explode(',', $res['ConfigVariables']) : array();
$config_ids = array_diff($config_ids, $this->Caches['ConfigVariables']);
}
else {
$config_ids = array();
}
$this->Caches['ConfigVariables'] = $config_ids;
$this->ConfigCacheIds = $config_ids;
}
function UpdateCache()
{
$update = false;
//something changed
$update = $update || $this->Phrases->NeedsCacheUpdate();
$update = $update || (count($this->ConfigCacheIds) && $this->ConfigCacheIds != $this->Caches['ConfigVariables']);
if ($update) {
$cache_key = $this->GetVar('t').$this->GetVar('m_theme').$this->GetVar('m_lang').$this->IsAdmin();
$query = sprintf("REPLACE %s (PhraseList, CacheDate, Template, ConfigVariables)
VALUES (%s, %s, %s, %s)",
TABLE_PREFIX.'PhraseCache',
$this->Conn->Qstr(join(',', $this->Phrases->Ids)),
adodb_mktime(),
$this->Conn->Qstr(md5($cache_key)),
$this->Conn->qstr(implode(',', array_unique($this->ConfigCacheIds))));
$this->Conn->Query($query);
}
}
function InitConfig()
{
if (isset($this->Caches['ConfigVariables']) && count($this->Caches['ConfigVariables']) > 0) {
$this->ConfigHash = array_merge($this->ConfigHash, $this->Conn->GetCol(
'SELECT VariableValue, VariableName FROM '.TABLE_PREFIX.'ConfigurationValues
WHERE VariableId IN ('.implode(',', $this->Caches['ConfigVariables']).')', 'VariableName'));
}
}
/**
* Returns configuration option value by name
*
* @param string $name
* @return string
*/
function ConfigValue($name)
{
$res = isset($this->ConfigHash[$name]) ? $this->ConfigHash[$name] : false;
if ($res !== false) return $res;
$res = $this->Conn->GetRow('SELECT VariableId, VariableValue FROM '.TABLE_PREFIX.'ConfigurationValues WHERE VariableName = '.$this->Conn->qstr($name));
if ($res) {
$this->ConfigHash[$name] = $res['VariableValue'];
$this->ConfigCacheIds[] = $res['VariableId'];
return $res['VariableValue'];
}
return false;
}
function UpdateConfigCache()
{
if ($this->ConfigCacheIds) {
}
}
/**
* Allows to process any type of event
*
* @param kEvent $event
* @access public
* @author Alex
*/
function HandleEvent(&$event, $params=null, $specificParams=null)
{
if ( isset($params) ) {
$event = new kEvent( $params, $specificParams );
}
if (!isset($this->EventManager)) {
$this->EventManager =& $this->recallObject('EventManager');
}
$this->EventManager->HandleEvent($event);
}
/**
* Registers new class in the factory
*
* @param string $real_class Real name of class as in class declaration
* @param string $file Filename in what $real_class is declared
* @param string $pseudo_class Name under this class object will be accessed using getObject method
* @param Array $dependecies List of classes required for this class functioning
* @access public
* @author Alex
*/
function registerClass($real_class, $file, $pseudo_class = null, $dependecies = Array() )
{
$this->Factory->registerClass($real_class, $file, $pseudo_class, $dependecies);
}
/**
* Add $class_name to required classes list for $depended_class class.
* All required class files are included before $depended_class file is included
*
* @param string $depended_class
* @param string $class_name
* @author Alex
*/
function registerDependency($depended_class, $class_name)
{
$this->Factory->registerDependency($depended_class, $class_name);
}
/**
* Registers Hook from subprefix event to master prefix event
*
* @param string $hookto_prefix
* @param string $hookto_special
* @param string $hookto_event
* @param string $mode
* @param string $do_prefix
* @param string $do_special
* @param string $do_event
* @param string $conditional
* @access public
* @todo take care of a lot parameters passed
* @author Kostja
*/
function registerHook($hookto_prefix, $hookto_special, $hookto_event, $mode, $do_prefix, $do_special, $do_event, $conditional)
{
$event_manager =& $this->recallObject('EventManager');
$event_manager->registerHook($hookto_prefix, $hookto_special, $hookto_event, $mode, $do_prefix, $do_special, $do_event, $conditional);
}
/**
* Allows one TagProcessor tag act as other TagProcessor tag
*
* @param Array $tag_info
* @author Kostja
*/
function registerAggregateTag($tag_info)
{
$aggregator =& $this->recallObject('TagsAggregator', 'kArray');
$aggregator->SetArrayValue($tag_info['AggregateTo'], $tag_info['AggregatedTagName'], Array($tag_info['LocalPrefix'], $tag_info['LocalTagName'], getArrayValue($tag_info, 'LocalSpecial')));
}
/**
* Returns object using params specified,
* creates it if is required
*
* @param string $name
* @param string $pseudo_class
* @param Array $event_params
* @return Object
* @author Alex
*/
function &recallObject($name,$pseudo_class=null,$event_params=Array())
{
$result =& $this->Factory->getObject($name, $pseudo_class, $event_params);
return $result;
}
/**
* Returns object using Variable number of params,
* all params starting with 4th are passed to object consturctor
*
* @param string $name
* @param string $pseudo_class
* @param Array $event_params
* @return Object
* @author Alex
*/
function &recallObjectP($name,$pseudo_class=null,$event_params=Array())
{
$func_args = func_get_args();
$result =& ref_call_user_func_array( Array(&$this->Factory, 'getObjectP'), $func_args );
return $result;
}
/**
* Returns tag processor for prefix specified
*
* @param string $prefix
* @return kDBTagProcessor
*/
function &recallTagProcessor($prefix)
{
$result =& $this->recallObject($prefix.'_TagProcessor');
return $result;
}
/**
* Checks if object with prefix passes was already created in factory
*
* @param string $name object presudo_class, prefix
* @return bool
* @author Kostja
*/
function hasObject($name)
{
return isset($this->Factory->Storage[$name]);
}
/**
* Removes object from storage by given name
*
* @param string $name Object's name in the Storage
* @author Kostja
*/
function removeObject($name)
{
$this->Factory->DestroyObject($name);
}
/**
* Get's real class name for pseudo class,
* includes class file and creates class
* instance
*
* @param string $pseudo_class
* @return Object
* @access public
* @author Alex
*/
function &makeClass($pseudo_class)
{
$func_args = func_get_args();
$result =& ref_call_user_func_array( Array(&$this->Factory, 'makeClass'), $func_args);
return $result;
}
/**
* Checks if application is in debug mode
*
* @param bool $check_debugger check if kApplication debugger is initialized too, not only for defined DEBUG_MODE constant
* @return bool
* @author Alex
* @access public
*/
function isDebugMode($check_debugger = true)
{
$debug_mode = defined('DEBUG_MODE') && DEBUG_MODE;
if($check_debugger)
{
$debug_mode = $debug_mode && is_object($this->Debugger);
}
return $debug_mode;
}
/**
* Checks if it is admin
*
* @return bool
* @author Alex
*/
function IsAdmin()
{
return constOn('ADMIN');
}
/**
* Apply url rewriting used by mod_rewrite or not
*
* @param bool $ssl Force ssl link to be build
* @return bool
*/
function RewriteURLs($ssl = false)
{
// case #1,#4:
// we want to create https link from http mode
// we want to create https link from https mode
// conditions: ($ssl || PROTOCOL == 'https://') && $this->ConfigValue('UseModRewriteWithSSL')
// case #2,#3:
// we want to create http link from https mode
// we want to create http link from http mode
// conditions: !$ssl && (PROTOCOL == 'https://' || PROTOCOL == 'http://')
$allow_rewriting =
(!$ssl && (PROTOCOL == 'https://' || PROTOCOL == 'http://')) // always allow mod_rewrite for http
|| // or allow rewriting for redirect TO httpS or when already in httpS
(($ssl || PROTOCOL == 'https://') && $this->ConfigValue('UseModRewriteWithSSL')); // but only if it's allowed in config!
return constOn('MOD_REWRITE') && $allow_rewriting;
}
/**
* Reads unit (specified by $prefix)
* option specified by $option
*
* @param string $prefix
* @param string $option
* @param mixed $default
* @return string
* @access public
* @author Alex
*/
function getUnitOption($prefix, $option, $default = false)
{
/*if (!isset($this->UnitConfigReader)) {
$this->UnitConfigReader =& $this->recallObject('kUnitConfigReader');
}*/
return $this->UnitConfigReader->getUnitOption($prefix, $option, $default);
}
/**
* Set's new unit option value
*
* @param string $prefix
* @param string $name
* @param string $value
* @author Alex
* @access public
*/
function setUnitOption($prefix, $option, $value)
{
// $unit_config_reader =& $this->recallObject('kUnitConfigReader');
return $this->UnitConfigReader->setUnitOption($prefix,$option,$value);
}
/**
* Read all unit with $prefix options
*
* @param string $prefix
* @return Array
* @access public
* @author Alex
*/
function getUnitOptions($prefix)
{
// $unit_config_reader =& $this->recallObject('kUnitConfigReader');
return $this->UnitConfigReader->getUnitOptions($prefix);
}
/**
* Returns true if config exists and is allowed for reading
*
* @param string $prefix
* @return bool
*/
function prefixRegistred($prefix)
{
/*if (!isset($this->UnitConfigReader)) {
$this->UnitConfigReader =& $this->recallObject('kUnitConfigReader');
}*/
return $this->UnitConfigReader->prefixRegistred($prefix);
}
/**
* Splits any mixing of prefix and
* special into correct ones
*
* @param string $prefix_special
* @return Array
* @access public
* @author Alex
*/
function processPrefix($prefix_special)
{
return $this->Factory->processPrefix($prefix_special);
}
/**
* Set's new event for $prefix_special
* passed
*
* @param string $prefix_special
* @param string $event_name
* @access public
*/
function setEvent($prefix_special,$event_name)
{
$event_manager =& $this->recallObject('EventManager');
$event_manager->setEvent($prefix_special,$event_name);
}
/**
* SQL Error Handler
*
* @param int $code
* @param string $msg
* @param string $sql
* @return bool
* @access private
* @author Alex
*/
function handleSQLError($code, $msg, $sql)
{
if ( isset($this->Debugger) )
{
$errorLevel = constOn('DBG_SQL_FAILURE') && !defined('IS_INSTALL') ? E_USER_ERROR : E_USER_WARNING;
$this->Debugger->dumpVars($_REQUEST);
$this->Debugger->appendTrace();
$error_msg = '<span class="debug_error">'.$msg.' ('.$code.')</span><br><a href="javascript:$Debugger.SetClipboard(\''.htmlspecialchars($sql).'\');"><b>SQL</b></a>: '.$this->Debugger->formatSQL($sql);
$long_id = $this->Debugger->mapLongError($error_msg);
trigger_error( substr($msg.' ('.$code.') ['.$sql.']',0,1000).' #'.$long_id, $errorLevel);
return true;
}
else
{
//$errorLevel = constOn('IS_INSTALL') ? E_USER_WARNING : E_USER_ERROR;
$errorLevel = E_USER_WARNING;
trigger_error('<b>SQL Error</b> in sql: '.$sql.', code <b>'.$code.'</b> ('.$msg.')', $errorLevel);
/*echo '<b>xProcessing SQL</b>: '.$sql.'<br>';
echo '<b>Error ('.$code.'):</b> '.$msg.'<br>';*/
return $errorLevel == E_USER_ERROR ? false : true;
}
}
/**
* Default error handler
*
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
* @param Array $errcontext
*/
function handleError($errno, $errstr, $errfile = '', $errline = '', $errcontext = '')
{
if( constOn('SILENT_LOG') )
{
$fp = fopen(FULL_PATH.'/silent_log.txt','a');
$time = adodb_date('d/m/Y H:i:s');
fwrite($fp, '['.$time.'] #'.$errno.': '.strip_tags($errstr).' in ['.$errfile.'] on line '.$errline."\n");
fclose($fp);
}
if( !$this->errorHandlers ) return true;
$i = 0; // while (not foreach) because it is array of references in some cases
$eh_count = count($this->errorHandlers);
while($i < $eh_count)
{
if( is_array($this->errorHandlers[$i]) )
{
$object =& $this->errorHandlers[$i][0];
$method = $this->errorHandlers[$i][1];
$object->$method($errno, $errstr, $errfile, $errline, $errcontext);
}
else
{
$function = $this->errorHandlers[$i];
$function($errno, $errstr, $errfile, $errline, $errcontext);
}
$i++;
}
}
/**
* Returns & blocks next ResourceId available in system
*
* @return int
* @access public
* @author Alex
*/
function NextResourceId()
{
$table_name = TABLE_PREFIX.'IdGenerator';
$this->Conn->Query('LOCK TABLES '.$table_name.' WRITE');
$this->Conn->Query('UPDATE '.$table_name.' SET lastid = lastid + 1');
$id = $this->Conn->GetOne('SELECT lastid FROM '.$table_name);
if($id === false)
{
$this->Conn->Query('INSERT INTO '.$table_name.' (lastid) VALUES (2)');
$id = 2;
}
$this->Conn->Query('UNLOCK TABLES');
return $id - 1;
}
/**
* Returns main prefix for subtable prefix passes
*
* @param string $current_prefix
* @return string
* @access public
* @author Kostja
*/
function GetTopmostPrefix($current_prefix)
{
while ( $parent_prefix = $this->getUnitOption($current_prefix, 'ParentPrefix') )
{
$current_prefix = $parent_prefix;
}
return $current_prefix;
}
function &EmailEventAdmin($email_event_name, $to_user_id = -1, $send_params = false)
{
return $this->EmailEvent($email_event_name, 1, $to_user_id, $send_params);
}
function &EmailEventUser($email_event_name, $to_user_id = -1, $send_params = false)
{
return $this->EmailEvent($email_event_name, 0, $to_user_id, $send_params);
}
function &EmailEvent($email_event_name, $email_event_type, $to_user_id = -1, $send_params = false)
{
$event = new kEvent('emailevents:OnEmailEvent');
$event->setEventParam('EmailEventName', $email_event_name);
$event->setEventParam('EmailEventToUserId', $to_user_id);
$event->setEventParam('EmailEventType', $email_event_type);
if ($send_params){
$event->setEventParam('DirectSendParams', $send_params);
}
$this->HandleEvent($event);
return $event;
}
function LoggedIn()
{
$user_id = $this->Application->RecallVar('user_id');
// $user =& $this->recallObject('u');
// $user_id = $user->GetID();
$ret = $user_id > 0;
if ($this->IsAdmin() && ($user_id == -1)) {
$ret = true;
}
return $ret;
}
/**
* Check current user permissions based on it's group permissions in specified category
*
* @param string $name permission name
* @param int $cat_id category id, current used if not specified
* @param int $type permission type {1 - system, 0 - per category}
* @return int
*/
function CheckPermission($name, $type = 1, $cat_id = null)
{
$perm_helper =& $this->recallObject('PermissionsHelper');
return $perm_helper->CheckPermission($name, $type, $cat_id);
}
/**
* Set's any field of current visit
*
* @param string $field
* @param mixed $value
*/
function setVisitField($field, $value)
{
$visit =& $this->recallObject('visits');
$visit->SetDBField($field, $value);
$visit->Update();
}
/**
* Allows to check if in-portal is installed
*
* @return bool
*/
function isInstalled()
{
return $this->InitDone && (count($this->ModuleInfo) > 0);
}
/**
* Allows to determine if module is installed & enabled
*
* @param string $module_name
* @return bool
*/
function isModuleEnabled($module_name)
{
- return $this->findModule('Name', $module_name);
+ return $this->findModule('Name', $module_name) !== false;
}
function reportError($class, $method)
{
$this->Debugger->appendTrace();
trigger_error('depricated method <b>'.$class.'->'.$method.'(...)</b>', E_USER_ERROR);
}
/**
* Get temp table name
*
* @param string $table
* @return string
*/
function GetTempName($table)
{
return TABLE_PREFIX.'ses_'.$this->GetSID().'_edit_'.$table;
}
function GetTempTablePrefix()
{
return TABLE_PREFIX.'ses_'.$this->GetSID().'_edit_';
}
function IsTempTable($table)
{
return strpos($table, TABLE_PREFIX.'ses_'.$this->GetSID().'_edit_') !== false;
}
/**
* Return live table name based on temp table name
*
* @param string $temp_table
* @return string
*/
function GetLiveName($temp_table)
{
if( preg_match('/'.TABLE_PREFIX.'ses_'.$this->GetSID().'_edit_(.*)/',$temp_table,$rets) )
{
return $rets[1];
}
else
{
return $temp_table;
}
}
function CheckProcessors($processors)
{
foreach ($processors as $a_processor)
{
if (!isset($this->CachedProcessors[$a_processor])) {
$this->CachedProcessors[$a_processor] =& $this->recallObject($a_processor.'_TagProcessor');
}
}
}
function TimeZoneAdjustment($time_zone=null)
{
$target_zone = isset($time_zone) ? $time_zone : $this->ConfigValue('Config_Site_Time');
return 3600 * ($target_zone - $this->ConfigValue('Config_Server_Time'));
}
function ApplicationDie($message = '')
{
$message = ob_get_clean().$message;
if ($this->isDebugMode()) {
$message .= $this->Debugger->printReport(true);
}
echo $this->UseOutputCompression() ? gzencode($message, DBG_COMPRESSION_LEVEL) : $message;
exit;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/application.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.156
\ No newline at end of property
+1.157
\ No newline at end of property
Index: trunk/core/kernel/parser/template_parser.php
===================================================================
--- trunk/core/kernel/parser/template_parser.php (revision 6427)
+++ trunk/core/kernel/parser/template_parser.php (revision 6428)
@@ -1,683 +1,684 @@
<?php
k4_include_once(KERNEL_PATH.'/parser/tags.php');
k4_include_once(KERNEL_PATH.'/parser/construct_tags.php');
class TemplateParser extends kBase {
var $Template;
var $Output = '';
var $Position = 0;
var $LastPosition = 0;
var $Ses;
var $Recursion = Array();
var $RecursionIndex = 0;
var $SkipMode = 0;
var $Params = Array();
var $Pattern = Array();
var $ForSort = Array();
var $Values = Array();
var $Buffers = Array();
var $Args;
var $ParamsRecursionIndex = 0;
var $ParamsStack = Array();
var $CompiledBuffer;
var $DataExists = false;
function TemplateParser()
{
parent::kBase();
$this->Ses =& $this->Application->recallObject('Session');
}
function AddParam($pattern, $value, $dont_sort=0)
{
$this->ForSort[] = Array($pattern, $value);
if (!$dont_sort) //used when mass-adding params, to escape sorting after every new param
$this->SortParams(); //but do sort by default!
}
//We need to sort params by its name length desc, so that params starting with same word get parsed correctly
function SortParams()
{
uasort($this->ForSort, array ("TemplateParser", "CmpParams"));
// commented out by Kostja, otherwise when rednerElement is done into var (result_to_var) the other params are reset
// $this->Pattern = Array();
// $this->Values = Array();
foreach($this->ForSort as $pair)
{
$this->Pattern[] = $pair[0];
$this->Values[] = $pair[1];
}
}
function CmpParams($a, $b)
{
$a_len = strlen($a[0]);
$b_len = strlen($b[0]);
if ($a_len == $b_len) return 0;
return $a_len > $b_len ? -1 : 1;
}
function SetParams($params, $for_parsing=true)
{
if (!is_array($params)) $params = Array();
$this->ForSort = array();
$this->Params = $params;
$this->ParamsStack[$this->ParamsRecursionIndex] = $params;
if (!$for_parsing) return ;
foreach ($params as $key => $val) {
$this->AddParam('/[{]{0,1}\$'.$key.'[}]{0,1}/i', $val, 1); //Do not sort every time
}
$this->SortParams(); //Sort once after adding is done
}
/**
* Returns parser parameter value at specified deep level
*
* @param string $name
* @param int $deep_level if greather then 0 then use from ParamsStack
* @return mixed
*/
function GetParam($name, $deep_level = 0)
{
if ($deep_level > 0) {
return isset($this->ParamsStack[$deep_level][$name]) ? $this->ParamsStack[$deep_level][$name] : false;
}
return isset($this->Params[$name]) ? $this->Params[$name] : false;
}
/**
* Set's template parser parameter, that could be retrieved from template
*
* @param string $name
* @param mixed $value
*/
function SetParam($name, $value)
{
$this->Params[strtolower($name)] = $value;
$this->AddParam('/[{]{0,1}\$'.$name.'[}]{0,1}/i', $value, $this->FromPreParseCache);
}
function SetBuffer($body)
{
$this->Buffers[$this->RecursionIndex] = $body;
}
function GetBuffer()
{
return $this->Buffers[$this->RecursionIndex];
}
function GetCode()
{
return $this->Code[$this->RecursionIndex];
}
function AppendBuffer($append)
{
$this->Buffers[$this->RecursionIndex] .= $append;
$this->AppendCode( $this->ConvertToCode($append) );
}
function AppendOutput($append, $append_code=false)
{
if ($this->SkipMode == parse) {
$this->Output .= $append; //append to Ouput only if we are parsing
if ($append_code) $this->AppendCompiledHTML($append);
}
elseif ($this->SkipMode == skip) {
if ($append_code) $this->AppendCompiledHTML($append);
}
elseif ($this->SkipMode == skip_tags) {
$this->AppendBuffer($append); //append to buffer if we are skipping tags
}
}
function ConvertToCode($data)
{
$code = '$o .= \''. str_replace("'", "\'", $data) .'\';';
$code = explode("\n", $code);
return $code;
}
function AppendCode($code)
{
if (defined('EXPERIMENTAL_PRE_PARSE')) {
if (!isset($this->Code[$this->RecursionIndex])) {
$this->Code[$this->RecursionIndex] = Array();
}
if (is_array($code)) {
foreach ($code as $line) {
$this->Code[$this->RecursionIndex][] = rtrim($line, "\n")."\n";
}
}
else {
$this->Code[$this->RecursionIndex][] .= rtrim($code, "\n")."\n";
}
}
}
function AppendCompiledFunction($f_name, $f_body)
{
$real_name = 'f_'.abs(crc32($this->TemplateName)).'_'.$f_name;
if (defined('EXPERIMENTAL_PRE_PARSE')) {
// if such function already compiled
if ( isset($this->Application->CompiledFunctions[$f_name]) ||
function_exists($real_name)
)
{
if (!isset($this->Application->CompiledFunctions[$f_name])) {
$real_name = $real_name.'_';
}
else {
$real_name = $this->Application->CompiledFunctions[$f_name].'_';
}
}
$this->CompiledBuffer .= "\t".'$application->PreParsedBlocks[\''.$f_name.'\'] = \''.$real_name.'\';'."\n";
$this->CompiledBuffer .= 'if (!function_exists(\''.$real_name.'\')) {'."\n";
$this->CompiledBuffer .= "\t".'function '.$real_name.'($params)'."\n\t{\n";
$this->CompiledBuffer .= $f_body;
$this->CompiledBuffer .= "\t}\n\n";
$this->CompiledBuffer .= '}'."\n";
$this->Application->CompiledFunctions[$f_name] = $real_name;
}
}
function AppendCompiledCode($code)
{
if (defined('EXPERIMENTAL_PRE_PARSE')) {
if (is_array($code)) {
foreach ($code as $line) {
$this->CompiledBuffer .= "\t".rtrim($line, "\n")."\n";
}
}
else {
$this->CompiledBuffer .= $code;
}
$this->CompiledBuffer .= "\t".'echo $o;'."\n\t".'$o = \'\';'."\n";
}
}
function AppendCompiledHTML($append)
{
if (defined('EXPERIMENTAL_PRE_PARSE')) {
$this->CompiledBuffer .= '?'.'>'."\n";
$this->CompiledBuffer .= rtrim($append, "\t");
$this->CompiledBuffer .= '<'.'?php'."\n";
}
}
function ResetCode()
{
$this->Code[$this->RecursionIndex] = Array();
}
function FindTag2()
{
$openings = Array('<%' => '%>', '<inp2:' => Array('>', '/>'), '</inp2:' => '>', '</inp2>' => '', '<!--' => '-->');
$tag_open_pos = false;
foreach ($openings as $an_opening => $closings) {
$pos = strpos($this->Template, $an_opening, $this->Position);
if ($pos !== false && ($tag_open_pos === false || (int) $pos <= (int) $tag_open_pos)) {
$tag_open_pos = $pos;
$open_len = strlen($an_opening);
$opening_tag = $an_opening;
$tag_closings = $closings;
}
}
if ($tag_open_pos === false) { //If no tags left - adding all other data
$this->AppendOutput(substr($this->Template, $this->Position), true);
return false;
}
//Adding all data before tag open
$this->AppendOutput(substr($this->Template, $this->Position, $tag_open_pos - $this->Position), true);
if (is_array($tag_closings)) {
$tag_close_pos = false;
foreach ($tag_closings as $a_closing) {
$pos = strpos($this->Template, $a_closing, $tag_open_pos);
if ($pos !== false && ($tag_close_pos === false || (int) $pos <= (int) $tag_close_pos)) {
$tag_close_pos = $pos;
$closing_tag = $a_closing;
}
}
}
elseif ($opening_tag == '</inp2>') {
$closing_tag = '';
$tag_close_pos = $tag_open_pos + $open_len;
}
else {
$closing_tag = $tag_closings;
$tag_close_pos = strpos($this->Template, $closing_tag, $tag_open_pos);
}
$close_len = strlen($closing_tag);
// Cutting trailing line-breaks after tags (same way PHP does it)
if (substr($this->Template, $tag_close_pos+$close_len, 2) == "\r\n") {
$this->Template = substr_replace($this->Template, '', $tag_close_pos, 2);
}
elseif (substr($this->Template, $tag_close_pos+$close_len, 1) == "\n") {
$this->Template = substr_replace($this->Template, '', $tag_close_pos, 1);
}
//Cutting out the tag itself
$tag = substr($this->Template, $tag_open_pos + $open_len, $tag_close_pos - $tag_open_pos - $open_len);
if ($opening_tag == '<inp2:') {
//getting prefix_tag upto first space, tab or line break into regs[1]
preg_match("/^([^ \t\n]*)(.*)/", $tag, $regs);
$tag_part = $regs[1];
if (strpos($tag_part, '_') !== false) {
list($prefix, $the_tag) = explode('_', $tag, 2);
/*preg_match('/(.*)_(.*)/', $tag_part, $rets);
$prefix = $rets[1];
$the_tag = $rets[2].$regs[2];*/
$tag = $prefix.':'.$the_tag;
}
else {
$the_tag = $tag;
$tag = ':'.$tag;
}
}
if ($opening_tag == '</inp2>') { //empty closing means old style in-portal if <inp2:tag>....</inp2>
$tag = 'm:endif';
}
if ($opening_tag == '</inp2:') {
preg_match("/^([^ \t\n]*)(.*)/", $tag, $regs);
$tag_part = $regs[1];
if (strpos($tag_part, '_') !== false) {
list($prefix, $the_tag) = explode('_', $tag, 2);
$tag = $prefix.':'.$the_tag;
}
$tag .= ' _closing_tag_="1"';
}
// if there is no prefix for the tag
if (strpos($tag, ':') === 0) {
$prefix = getArrayValue($this->Params, 'PrefixSpecial');
$tag = $prefix.$tag.' _auto_prefix_="1"';
}
// temporary - for backward compatability with in-portal style if
if ($opening_tag == '<inp2:' && $closing_tag == '>' && $tag_part != 'm_if' && $tag_part != 'm_DefineElement') {
if (strpos($the_tag, ' ') !== false) {
list($function, $params) = explode(' ', $the_tag, 2);
}
else {
$function = $the_tag;
$params = '';
}
$tag = 'm:if prefix="'.$prefix.'" function="'.$function.'" '.$params;
}
if ($opening_tag == '<!--') {
$this->AppendOutput('<!-- '.htmlspecialchars($tag). '-->');
$tag = '__COMMENT__';
}
$this->Position = $tag_close_pos + $close_len;
return $tag;
}
function CurrentLineNumber()
{
return substr_count(substr($this->Template, 0, $this->Position), "\n")+1;
}
function SkipModeName()
{
switch ($this->SkipMode) {
case skip: return 'skip';
case skip_tags: return 'skip_tags';
case parse: return 'parse';
}
}
/**
* Recursive mkdir
*
* @param string $dir
* @param string $base_path base path to directory where folders should be created in
*/
function CheckDir($dir, $base_path = '')
{
if (file_exists($dir)) {
return;
}
else {
// remove $base_path from beggining because it is already created during install
$dir = preg_replace('/^'.preg_quote($base_path.'/', '/').'/', '', $dir, 1);
$segments = explode('/', $dir);
$cur_path = $base_path;
foreach ($segments as $segment) {
// do not add leading / for windows paths (c:\...)
$cur_path .= preg_match('/^[a-zA-Z]{1}:/', $segment) ? $segment : '/'.$segment;
if (!file_exists($cur_path)) {
mkdir($cur_path);
}
}
}
}
function ParseTemplate($name, $pre_parse = 1, $params=array(), $silent=0)
{
$this->FromPreParseCache = false;
if ($this->GetParam('from_inportal')) $pre_parse = 0;
if ($pre_parse) {
$pre_parsed = $this->Application->TemplatesCache->GetPreParsed($name);
if ($pre_parsed && $pre_parsed['active']) { // active means good (not expired) pre-parsed cache
$this->FromPreParseCache = true;
$this->SetParams($params, 0); // 0 to disable params sorting and regexp generation - not needed when processing pre-parsed
ob_start();
if ($pre_parsed['mode'] == 'file') {
include($pre_parsed['fname']);
}
else {
eval('?'.'>'.$pre_parsed['content']);
}
$output = ob_get_contents();
ob_end_clean();
}
else {
$this->SetParams($params);
$this->CompiledBuffer .= '<'.'?php'."\n";
$this->CompiledBuffer .= 'global $application;'."\n";
$this->CompiledBuffer .= '$params =& $application->Parser->Params;'."\n";
$this->CompiledBuffer .= 'extract($params);'."\n";
$this->CompiledBuffer .= '$o = \'\';'."\n";
$output = $this->NewParse($this->Application->TemplatesCache->GetTemplateBody($name, $silent), $name);
$this->CompiledBuffer .= '?'.'>'."\n";
if (defined('SAFE_MODE') && SAFE_MODE) {
if (!isset($conn)) $conn =& $this->Application->GetADODBConnection();
$conn->Query('REPLACE INTO '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ('.$conn->qstr($pre_parsed['fname']).','.$conn->qstr($this->CompiledBuffer).','.adodb_mktime().')');
}
else {
$compiled = fopen($pre_parsed['fname'], 'w');
fwrite($compiled, $this->CompiledBuffer);
fclose($compiled);
}
}
if ( !$this->GetParam('from_inportal') && strpos($output, '<inp:') !== false) {
$inp1_parser =& $this->Application->recallObject('Inp1Parser');
+// $name = $this->Application->TemplatesCache->GetTemplateFileName($name) . '-block:' . $name; // may be is needed (by Alex)
$output = $inp1_parser->Parse($name, $output);
}
return $output;
}
// pre-parse is OFF
$this->SetParams($params);
return $this->NewParse($this->Application->TemplatesCache->GetTemplateBody($name), $name, $pre_parse);
}
function NewParse($template, $name='unknown', $pre_parse = 1)
{
$this->Template = $template;
$this->TemplateName = $name;
$this->Position = 0;
$this->Output = '';
$this->TagHolder = new MyTagHolder();
$has_inp_tags = false;
if (!getArrayValue($this->Params, 'PrefixSpecial')) {
$this->Params['PrefixSpecial'] = '$PrefixSpecial';
}
//While we have more tags
while ($tag_data = $this->FindTag2())
{
if ($tag_data == '__COMMENT__') continue;
//Create tag object from passed tag data
if( $this->Application->isDebugMode() && constOn('DBG_SHOW_TAGS') )
{
global $debugger;
$debugger->appendHTML('mode: '.$this->SkipModeName().' tag '.$debugger->highlightString($tag_data).' in '.$debugger->getFileLink($debugger->getLocalFile(FULL_PATH.THEMES_PATH.'/'.$this->TemplateName).'.tpl', $this->CurrentLineNumber(), '', true));
}
$tag =& $this->TagHolder->GetTag($tag_data, $this);
if (!$this->CheckRecursion($tag)) //we do NOT process closing tags
{
$tag->Process();
}
}
return $this->Output;
}
function Parse($template, $name='unknown', $pre_parse = 1)
{
$this->Template = $template;
$this->TemplateName = $name;
$this->Position = 0;
$this->Output = '';
$this->TagHolder = new MyTagHolder();
$has_inp_tags = false;
if ($this->GetParam('from_inportal')) $pre_parse = 0;
if (defined('EXPERIMENTAL_PRE_PARSE') && $pre_parse) {
$fname = $this->Application->TemplatesCache->GetRealFilename($this->TemplateName).'.php';
$fname = str_replace(FULL_PATH, FULL_PATH.'/kernel/cache', $fname);
if (!defined('SAFE_MODE') || !SAFE_MODE) {
$this->CheckDir(dirname($fname), FULL_PATH.'/kernel/cache');
}
$tname = $this->Application->TemplatesCache->GetRealFilename($this->TemplateName).'.tpl';
$output = '';
$is_cached = false;
ob_start();
if (defined('SAFE_MODE') && SAFE_MODE) {
$conn =& $this->Application->GetADODBConnection();
$cached = $conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'Cache WHERE VarName = "'.$fname.'"');
if ($cached !== false && $cached['Cached'] > filemtime($tname)) {
eval('?'.'>'.$cached['Data']);
$is_cached = true;
}
}
else {
if (file_exists($fname) && file_exists($tname) && filemtime($fname) > filemtime($tname)) {
include($fname);
$is_cached = true;
}
}
$output = ob_get_contents();
ob_end_clean();
if ( $is_cached && !$this->GetParam('from_inportal') ) {
if ( strpos($output, '<inp:') !== false) {
$inp1_parser =& $this->Application->recallObject('Inp1Parser');
$output = $inp1_parser->Parse($name, $output);
}
return $output;
}
$this->CompiledBuffer .= '<'.'?php'."\n";
$this->CompiledBuffer .= 'global $application;'."\n";
$this->CompiledBuffer .= '$params =& $application->Parser->Params;'."\n";
$this->CompiledBuffer .= 'extract($params);'."\n";
$this->CompiledBuffer .= '$o = \'\';'."\n";
}
if (!getArrayValue($this->Params, 'PrefixSpecial')) {
$this->Params['PrefixSpecial'] = '$PrefixSpecial';
}
//While we have more tags
while ($tag_data = $this->FindTag2())
{
if ($tag_data == '__COMMENT__') continue;
//Create tag object from passed tag data
if( $this->Application->isDebugMode() && constOn('DBG_SHOW_TAGS') )
{
global $debugger;
$debugger->appendHTML('mode: '.$this->SkipModeName().' tag '.$debugger->highlightString($tag_data).' in '.$debugger->getFileLink($debugger->getLocalFile(FULL_PATH.THEMES_PATH.'/'.$this->TemplateName).'.tpl', $this->CurrentLineNumber(), '', true));
}
// $tag =& new MyTag($tag_data, $this);
$tag =& $this->TagHolder->GetTag($tag_data, $this);
if (!$this->CheckRecursion($tag)) //we do NOT process closing tags
{
$tag->Process();
}
}
if ( !$this->GetParam('from_inportal') ) {
if ( strpos($this->Output, '<inp:') !== false) {
$inp1_parser =& $this->Application->recallObject('Inp1Parser');
$this->Output = $inp1_parser->Parse($name, $this->Output);
$has_inp_tags = true;
}
}
if (defined('EXPERIMENTAL_PRE_PARSE') && $pre_parse && !$has_inp_tags) {
// $this->CompiledBuffer .= 'echo $o;'."\n";
$this->CompiledBuffer .= '?'.'>'."\n";
if (defined('SAFE_MODE') && SAFE_MODE) {
if (!isset($conn)) $conn =& $this->Application->GetADODBConnection();
$conn->Query('REPLACE INTO '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ('.$conn->qstr($fname).','.$conn->qstr($this->CompiledBuffer).','.adodb_mktime().')');
}
else {
$compiled = fopen($fname, 'w');
fwrite($compiled, $this->CompiledBuffer);
fclose($compiled);
}
}
return $this->Output;
}
function ParseBlock($params, $force_pass_params=0, $as_template=false)
{
if( $this->Application->isDebugMode() && constOn('DBG_SHOW_TAGS') )
{
global $debugger;
$debugger->appendHTML('ParseBlock '.$params['name'].' pass_params is '.$params['pass_params'].' force is '.$force_pass_params.' in '.$debugger->getFileLink($debugger->getLocalFile(FULL_PATH.THEMES_PATH.'/'.$this->TemplateName).'.tpl', $this->CurrentLineNumber(), '', true));
}
/*if ( $this->Application->isDebugMode() && constOn('DBG_PRE_PARSE') ) {
global $debugger;
$debugger->CurrentPreParsedBlock = $params['name'];
}*/
if (defined('EXPERIMENTAL_PRE_PARSE')) {
$this->MainParser = false;
if (isset($this->Application->PreParsedBlocks[$params['name']]) ) {
if ($this->ParamsRecursionIndex == 0) {
$this->ParamsStack[$this->ParamsRecursionIndex] = $this->Params;
}
if (isset($params['pass_params']) || $force_pass_params) {
$pass_params = array_merge($this->ParamsStack[$this->ParamsRecursionIndex], $params);
}
else {
$pass_params = $params;
}
$this->ParamsStack[++$this->ParamsRecursionIndex] = $pass_params;
$this->Params = $pass_params;
$f = $this->Application->PreParsedBlocks[$params['name']];
// $this->ParamsRecursionIndex--;
//$this->SetParams($params);
if( !isset($pass_params['PrefixSpecial']) && isset($pass_params['prefix']) ) $pass_params['PrefixSpecial'] = $pass_params['prefix'];
$ret = $f($pass_params);
unset($this->ParamsStack[$this->ParamsRecursionIndex--]);
$this->Params = $this->ParamsStack[$this->ParamsRecursionIndex];
$this->MainParser = true;
return $ret;
}
}
$BlockParser =& $this->Application->makeClass('TemplateParser');
if (isset($params['pass_params']) || $force_pass_params) {
$BlockParser->SetParams(array_merge($this->Params, $params));
}
else
$BlockParser->SetParams($params);
$this->Application->Parser =& $BlockParser;
if (!isset($params['name'])) trigger_error('<b>***Error: Block name not passed to ParseBlock</b>', E_USER_ERROR);
$templates_cache =& $this->Application->recallObject('TemplatesCache');
$template_name = $as_template ? $params['name'] : $templates_cache->GetTemplateFileName($params['name']) . '-block:'.$params['name'];
$silent = getArrayValue($params, 'from_inportal') && !defined('DBG_TEMPLATE_FAILURE');
$o = $BlockParser->Parse(
$templates_cache->GetTemplateBody($params['name'], $silent),
$template_name
);
if (getArrayValue($params, 'BlockNoData') && !$BlockParser->DataExists) {
$template_name = $as_template ? $params['BlockNoData'] : $templates_cache->GetTemplateFileName($params['BlockNoData']) . '-block:'.$params['BlockNoData'];
$o = $BlockParser->Parse(
$templates_cache->GetTemplateBody($params['BlockNoData'], $silent),
$template_name
);
}
$this->Application->Parser =& $this;
$this->Application->Parser->DataExists = $this->Application->Parser->DataExists || $BlockParser->DataExists;
return $o;
}
function Recurve(&$tag)
{
$this->Recursion[++$this->RecursionIndex] =& $tag;
}
function CheckRecursion(&$tag)
{
if ($this->RecursionIndex > 0) { //If we are inside the recursion
if ($this->Recursion[$this->RecursionIndex]->CheckRecursion($tag)) { //If we can close this recursion
unset($this->Recursion[$this->RecursionIndex--]); //unsetting current recursion level and decreasing it at the same time
return true; //we should inform not to process closing tag
}
}
return false;
}
function SetSkipMode($mode)
{
$this->SkipMode = $mode;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/parser/template_parser.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.25
\ No newline at end of property
+1.26
\ No newline at end of property
Index: trunk/core/units/categories/categories_tag_processor.php
===================================================================
--- trunk/core/units/categories/categories_tag_processor.php (revision 6427)
+++ trunk/core/units/categories/categories_tag_processor.php (revision 6428)
@@ -1,485 +1,487 @@
<?php
class CategoriesTagProcessor extends kDBTagProcessor {
function SubCatCount($params)
{
$cat_object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
$sql = ' SELECT COUNT(*) - 1
FROM '.$cat_object->TableName.'
WHERE ParentPath LIKE "'.$cat_object->GetDBField('ParentPath').'%"';
if (isset($params['today'])) {
$sql .= ' AND CreatedOn > '.(adodb_mktime()-86400);
}
return $this->Conn->GetOne($sql);
}
function IsNew($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
$ret = $object->GetDBField('IsNew') ? 1 : 0;
return $ret;
}
function IsPick($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
$ret = $object->GetDBField('EditorsPick') ? 1 : 0;
return $ret;
}
function ItemIcon($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
$status = $object->GetDBField('Status');
if($status == 1)
{
$ret = $object->GetDBField('IsNew') ? 'icon16_cat_new.gif' : 'icon16_cat.gif';
}
else
{
$ret = $status ? 'icon16_cat_pending.gif' : 'icon16_cat_disabled.gif';
}
return $ret;
}
function ItemCount($params)
{
$cat_object =& $this->getObject($params);
$ci_table = $this->Application->getUnitOption('l-ci', 'TableName');
$sql = ' SELECT COUNT(*)
FROM '.$cat_object->TableName.' c
LEFT JOIN '.$ci_table.' ci
ON c.CategoryId=ci.CategoryId
WHERE c.ParentPath LIKE "'.$cat_object->GetDBField('ParentPath').'%"
AND NOT (ci.CategoryId IS NULL)';
return $this->Conn->GetOne($sql);
}
function ListCategories($params)
{
return $this->PrintList2($params);
}
function RootCategoryName($params)
{
return $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params);
}
function CheckModuleRoot($params)
{
$module_name = getArrayValue($params, 'module') ? $params['module'] : 'In-Commerce';
$module =& $this->Application->recallObject('mod.'.$module_name);
$module_root_cat = $module->GetDBField('RootCat');
$additional_cats = $this->SelectParam($params, 'add_cats');
if ($additional_cats) {
$additional_cats = explode(',', $additional_cats);
}
else {
$additional_cats = array();
}
if ($this->Application->GetVar('m_cat_id') == $module_root_cat || in_array($this->Application->GetVar('m_cat_id'), $additional_cats)) {
$home_template = getArrayValue($params, 'home_template');
if (!$home_template) return;
$this->Application->Redirect($home_template, Array('pass'=>'all'));
};
}
function CategoryPath($params)
{
$module_name = getArrayValue($params, 'module') ? $params['module'] : 'In-Commerce';
$module_category_id = $this->Application->findModule('Name', $module_name, 'RootCat');
$module_item_id = $this->Application->GetVar($this->Application->findModule('Name', $module_name, 'Var').'_id');
$block_params['separator'] = $params['separator'];
if (!isset($params['cat_id'])) {
$params['cat_id'] = getArrayValue($params, 'cat_id') ? $params['cat_id'] : $this->Application->GetVar('m_cat_id');
}
if ($params['cat_id'] == 0) {
$block_params['current'] = 1;
$block_params['cat_id'] = 0;
$block_params['cat_name'] = $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params);
$block_params['name'] = $this->SelectParam($params, 'root_cat_render_as,block_root_cat,rootcatblock,render_as');
return $this->Application->ParseBlock($block_params);
}
else {
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$navbar_field = $ml_formatter->LangFieldName('CachedNavBar');
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($this->Prefix, 'TableName');
$sql = 'SELECT '.$navbar_field.', ParentPath
FROM '.$table_name.'
WHERE '.$id_field.' = '.$params['cat_id'];
$category_data = $this->Conn->GetRow($sql);
$ret = '';
if ($category_data) {
$category_names = explode('&|&', $category_data[$navbar_field]);
$category_ids = explode('|', substr($category_data['ParentPath'], 1, -1));
// add "Home" category at beginning of path
array_unshift($category_names, $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params));
array_unshift($category_ids, 0);
foreach ($category_ids as $category_pos => $category_id) {
$block_params['cat_id'] = $category_id;
$block_params['cat_name'] = $category_names[$category_pos];
$block_params['current'] = ($params['cat_id'] == $category_id) && !$module_item_id ? 1 : 0;
$block_params['is_module_root'] = $category_id == $module_category_id ? 1 : 0;
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
// which block to parse as current ?
if ($category_id == 0) {
$block_params['name'] = $this->SelectParam($params, 'root_cat_render_as,block_root_cat,rootcatblock,render_as,block');
}
if ($block_params['is_module_root'] == 1) { // module root
$block_params['name'] = $this->SelectParam($params, 'module_root_render_as,block_module_root,rootmoduleblock,render_as,block');
}
if ($block_params['current'] == 1) { // current cat (label)
$block_params['name'] = $this->SelectParam($params, 'current_render_as,block_current,currentblock,render_as,block');
}
$this->Application->SetVar($this->Prefix.'_id', $category_id);
$ret .= $this->Application->ParseBlock($block_params, 1);
}
}
return $ret;
}
}
function CurrentCategoryName($params)
{
$cat_object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix.'_List');
$sql = 'SELECT '.$this->getTitleField().'
FROM '.$cat_object->TableName.'
WHERE CategoryId = '.$this->Application->GetVar('m_cat_id');
return $this->Conn->GetOne($sql);
}
function getTitleField()
{
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
return $ml_formatter->LangFieldName('Name');
}
function CategoryLink($params)
{
// 'p_id'=>'0', ??
$params = array_merge(array('pass'=>'m'), $params);
$cat_id = getArrayValue($params,'cat_id');
if ($cat_id === false) {
// $cat_id = $this->Application->Parser->GetParam('cat_id');
$cat_id = $this->Application->GetVar($this->getPrefixSpecial().'_id');
}
if($cat_id == 'Root')
{
$object =& $this->Application->recallObject('mod.'.$params['module']);
$params['m_cat_id'] = $object->GetDBField('RootCat');
unset($params['module']);
}
else{
$params['m_cat_id'] = $cat_id;
}
unset($params['cat_id']);
+ $params['pass_category'] = 1;
+
$main_processor =& $this->Application->recallObject('m_TagProcessor');
return $main_processor->T($params);
}
function CategoryList($params)
{
//$object =& $this->Application->recallObject( $this->getPrefixSpecial() , $this->Prefix.'_List', $params );
$object =& $this->GetList($params);
if ($object->RecordsCount == 0)
{
if (isset($params['block_no_cats'])) {
$params['name'] = $params['block_no_cats'];
return $this->Application->ParseBlock($params);
}
else {
return '';
}
}
if (isset($params['block'])) {
return $this->PrintList($params);
}
else {
$params['block'] = $params['block_main'];
if (isset($params['block_row_start'])) {
$params['row_start_block'] = $params['block_row_start'];
}
if (isset($params['block_row_end'])) {
$params['row_end_block'] = $params['block_row_end'];
}
return $this->PrintList2($params);
}
}
function Meta($params)
{
$name = getArrayValue($params, 'name');
$object =& $this->Application->recallObject($this->Prefix.'.-item');
$field = $object->GetField('Meta'.$name);
if ($field) return $field;
switch ($name) {
case 'Description':
$conf = 'Category_MetaDesc';
break;
case 'Keywords':
$conf = 'Category_MetaKey';
break;
}
return $this->Application->ConfigValue($conf);
}
function BuildListSpecial($params)
{
if ( isset($params['parent_cat_id']) ) {
$parent_cat_id = $params['parent_cat_id'];
}
else {
$parent_cat_id = $this->Application->GetVar($this->Prefix.'_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
if (!$parent_cat_id) {
$parent_cat_id = 0;
}
}
$types = $this->SelectParam($params, 'types');
$except = $this->SelectParam($params, 'except');
$no_special = isset($params['no_special']) && $params['no_special'];
if ($no_special) return $this->Special;
if ($types.$except.$parent_cat_id == '') {
return parent::BuildListSpecial($params);
}
$special = crc32($types.$except.$parent_cat_id);
return $special;
}
function IsCurrent($params)
{
return false;
}
/**
* Substitutes category in last template base on current category
*
* @param Array $params
*/
function UpdateLastTemplate($params)
{
$category_id = $this->Application->GetVar('m_cat_id');
list($index_file, $env) = explode('|', $this->Application->RecallVar('last_template'), 2);
$this->Application->SetVar(ENV_VAR_NAME, str_replace('%5C', '\\', $env));
$this->Application->HttpQuery->processQueryString();
// update required fields
$this->Application->SetVar('m_cat_id', $category_id);
$this->Application->Session->SaveLastTemplate($params['template']);
}
function GetParentCategory($params)
{
$parent_id = 0;
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$table = $this->Application->getUnitOption($this->Prefix,'TableName');
$cat_id = $this->Application->GetVar('m_cat_id');
if ($cat_id > 0) {
$sql = 'SELECT ParentId
FROM '.$table.'
WHERE '.$id_field.' = '.$cat_id;
$parent_id = $this->Conn->GetOne($sql);
}
return $parent_id;
}
function InitCacheUpdater($params)
{
safeDefine('CACHE_PERM_CHUNK_SIZE', 30);
$continue = $this->Application->GetVar('continue');
$total_cats = (int) $this->Conn->GetOne('SELECT COUNT(*) FROM '.TABLE_PREFIX.'Category');
if ($continue === false && $total_cats > CACHE_PERM_CHUNK_SIZE) {
// first step, if category count > CACHE_PERM_CHUNK_SIZE, then ask for cache update
return true;
}
if ($continue === false) {
// if we don't have to ask, then assume user selected "Yes" in permcache update dialog
$continue = 1;
}
$updater =& $this->Application->recallObject('kPermCacheUpdater', null, Array('continue' => $continue));
if ($continue === '0') { // No in dialog
$updater->clearData();
$this->Application->Redirect($params['destination_template']);
}
$ret = false; // don't ask for update
if ($continue == 1) { // Initial run
$updater->setData();
}
if ($continue == 2) { // Continuing
// called from AJAX request => returns percent
$needs_more = true;
while ($needs_more && $updater->iteration <= CACHE_PERM_CHUNK_SIZE) {
// until proceeeded in this step category count exceeds category per step limit
$needs_more = $updater->DoTheJob();
}
if ($needs_more) {
// still some categories are left for next step
$updater->setData();
}
else {
// all done -> redirect
$updater->clearData();
$this->Application->RemoveVar('PermCache_UpdateRequired');
$this->Application->Redirect($params['destination_template']);
}
$ret = $updater->getDonePercent();
}
return $ret;
}
function SaveWarning($params)
{
$main_prefix = getArrayValue($params, 'main_prefix');
if ($main_prefix && $main_prefix != '$main_prefix') {
$top_prefix = $main_prefix;
}
else {
$top_prefix = $this->Application->GetTopmostPrefix($this->Prefix);
}
$temp_tables = $this->Application->GetVar($top_prefix.'_mode') == 't';
$modified = $this->Application->RecallVar($top_prefix.'_modified');
if (!$temp_tables) {
$this->Application->RemoveVar($top_prefix.'_modified');
return '';
}
$block_name = $this->SelectParam($params, 'render_as,name');
if ($block_name) {
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $block_name;
$block_params['edit_mode'] = $temp_tables ? 1 : 0;
$block_params['display'] = $temp_tables && $modified ? 1 : 0;
return $this->Application->ParseBlock($block_params);
}
else {
return $temp_tables && $modified ? 1 : 0;
}
return ;
}
/**
* Allows to detect if this prefix has something in clipboard
*
* @param Array $params
* @return bool
*/
function HasClipboard($params)
{
$clipboard = $this->Application->RecallVar('clipboard');
if ($clipboard) {
$clipboard = unserialize($clipboard);
foreach ($clipboard as $prefix => $clipboard_data) {
foreach ($clipboard_data as $mode => $ids) {
if (count($ids)) return 1;
}
}
}
return 0;
}
/**
* Allows to detect if root category being edited
*
* @param Array $params
*/
function IsRootCategory($params)
{
$object =& $this->getObject($params);
return $object->IsRoot();
}
function CatalogItemCount($params)
{
$object =& $this->GetList($params);
if (!$object->Counted) {
$object->CountRecs();
}
return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' / '.$object->NoFilterCount : $object->RecordsCount;
}
/**
* Print grid pagination using
* block names specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintPages($params)
{
if ($this->Application->Parser->GetParam('no_special')) {
$params['no_special'] = $this->Application->Parser->GetParam('no_special');
}
return parent::PrintPages($params);
}
function InitCatalog($params)
{
$tab_prefixes = $this->Application->GetVar('tp'); // {all, <prefixes_list>, none}
if ($tab_prefixes === false) $tab_prefixes = 'all';
$skip_prefixes = isset($params['skip_prefixes']) && $params['skip_prefixes'] ? explode(',', $params['skip_prefixes']) : Array();
// get all prefixes available
$prefixes = Array();
foreach ($this->Application->ModuleInfo as $module_name => $module_data) {
if ($module_data['Var'] == 'm') continue;
$prefixes[] = $module_data['Var'];
}
if ($tab_prefixes == 'none') {
$skip_prefixes = array_unique(array_merge($skip_prefixes, $prefixes));
}
elseif ($tab_prefixes != 'all') {
// prefix list here
$tab_prefixes = explode(',', $tab_prefixes); // list of prefixes that should stay
$skip_prefixes = array_unique(array_merge($skip_prefixes, array_diff($prefixes, $tab_prefixes)));
}
$params['name'] = $params['render_as'];
$params['skip_prefixes'] = implode(',', $skip_prefixes);
return $this->Application->ParseBlock($params, 1);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/categories/categories_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.29
\ No newline at end of property
+1.30
\ No newline at end of property
Index: trunk/core/units/admin/admin_config.php
===================================================================
--- trunk/core/units/admin/admin_config.php (revision 6427)
+++ trunk/core/units/admin/admin_config.php (revision 6428)
@@ -1,201 +1,205 @@
<?php
$config = Array(
'Prefix' => 'adm',
'EventHandlerClass' => Array('class' => 'AdminEventsHandler', 'file' => 'admin_events_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array('class' => 'AdminTagProcessor', 'file' => 'admin_tag_processor.php', 'build_event' => 'OnBuild'),
'TitlePresets' => Array(
'tree_root' => Array('format' => '!la_section_overview!'),
'tree_reports' => Array('format' => '!la_section_overview!'),
'tree_system' => Array('format' => '!la_section_overview!'),
'tree_tools' => Array('format' => '!la_section_overview!'),
'system_tools' => Array('format' => '!la_section_system!'),
'no_permissions' => Array('format' => '!la_title_NoPermissions!'),
),
'Sections' => Array(
'in-portal:root' => Array(
'parent' => null,
'icon' => 'site',
'label' => $this->Application->ConfigValue('Site_Name'),
'url' => Array('t' => 'sections_list', 'pass' => 'm', 'pass_section' => true, 'no_amp' => 1),
'permissions' => Array('advanced:admin_login', 'advanced:front_login'),
'priority' => 0,
'type' => stTREE,
),
// "Summary & Logs" section
'in-portal:reports' => Array(
'parent' => 'in-portal:root',
'icon' => 'summary_logs',
'label' => 'la_tab_Reports',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:log_summary' => Array(
'parent' => 'in-portal:reports',
'icon' => 'summary',
'label' => 'la_tab_Summary',
'url' => Array('index_file' => 'logs/summary.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:searchlog' => Array(
'parent' => 'in-portal:reports',
'icon' => 'search_log',
'label' => 'la_tab_SearchLog',
'url' => Array('index_file' => 'logs/searchlog.php', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:sessionlog' => Array(
'parent' => 'in-portal:reports',
'icon' => 'sessions_log',
'label' => 'la_tab_SessionLog',
'url' => Array('index_file' => 'logs/session_list.php', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:emaillog' => Array(
'parent' => 'in-portal:reports',
'icon' => 'email_log',
'label' => 'la_tab_EmailLog',
'url' => Array('index_file' => 'logs/email_log.php', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:visits' => Array(
'parent' => 'in-portal:reports',
'icon' => 'visits',
'label' => 'la_tab_Visits',
'url' => Array('t' => 'visits/visits_list', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 5,
'type' => stTREE,
),
// "Configuration" section
'in-portal:system' => Array(
'parent' => 'in-portal:root',
'icon' => 'conf',
'label' => 'la_tab_Sys_Config',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:configure_general' => Array(
'parent' => 'in-portal:system',
'icon' => 'conf_general',
'label' => 'la_tab_General',
'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 1,
'type' => stTREE,
),
// "Tools" section
'in-portal:tools' => Array(
'parent' => 'in-portal:root',
'icon' => 'tools',
'label' => 'la_tab_Tools',
'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 6,
'type' => stTREE,
),
- /*'in-portal:service' => Array(
- 'parent' => 'in-portal:tools',
- 'icon' => 'conf_general',
- 'label' => 'la_tab_Service',
- 'url' => Array('t' => 'tools/system_tools', 'pass' => 'm'),
- 'permissions' => Array('view'),
- 'priority' => 10,
- 'type' => stTREE,
- ),*/
-
'in-portal:backup' => Array(
'parent' => 'in-portal:tools',
'icon' => 'tool_backup',
'label' => 'la_tab_Backup',
'url' => Array('index_file' => 'backup/backup1.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:restore' => Array(
'parent' => 'in-portal:tools',
'icon' => 'tool_restore',
'label' => 'la_tab_Restore',
'url' => Array('index_file' => 'backup/restore1.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:main_import' => Array(
'parent' => 'in-portal:tools',
'icon' => 'tool_import',
'label' => 'la_tab_ImportData',
'url' => Array('index_file' => 'import/step1.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:sql_query' => Array(
'parent' => 'in-portal:tools',
'icon' => 'tool_import',
'label' => 'la_tab_QueryDB',
'url' => Array('index_file' => 'tools/sql_query.php', 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:server_info' => Array(
'parent' => 'in-portal:tools',
'icon' => 'server_info',
'label' => 'la_tab_ServerInfo',
'url' => Array('index_file' => 'tools/server_info.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 6,
'type' => stTREE,
),
// "Help" section
'in-portal:help' => Array(
'parent' => 'in-portal:root',
'icon' => 'help',
'label' => 'la_tab_Help',
'url' => Array('index_file' => 'help/manual.pdf', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 7,
'type' => stTREE,
),
),
);
+
+ $application =& kApplication::Instance();
+ if ($application->isDebugMode()) {
+ $config['Sections']['in-portal:service'] = Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'conf_general',
+ 'label' => 'la_tab_Service',
+ 'url' => Array('t' => 'tools/system_tools', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 10,
+ 'type' => stTREE,
+ );
+ }
+
?>
\ No newline at end of file
Property changes on: trunk/core/units/admin/admin_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.15
\ No newline at end of property
+1.16
\ No newline at end of property
Index: trunk/core/units/users/users_event_handler.php
===================================================================
--- trunk/core/units/users/users_event_handler.php (revision 6427)
+++ trunk/core/units/users/users_event_handler.php (revision 6428)
@@ -1,1033 +1,1035 @@
<?php
class UsersEventHandler extends InpDBEventHandler
{
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
// admin
'OnSetPersistantVariable' => Array('self' => 'view'), // because setting to logged in user only
// front
'OnRefreshForm' => Array('self' => true),
'OnForgotPassword' => Array('self' => true),
'OnResetPassword' => Array('self' => true),
'OnResetPasswordConfirmed' => Array('self' => true),
'OnSubscribeQuery' => Array('self' => true),
'OnSubscribeUser' => Array('self' => true),
'OnRecommend' => Array('self' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if ($event->Name == 'OnLogin' || $event->Name == 'OnLogout') {
// permission is checked in OnLogin event directly
return true;
}
if (!$this->Application->IsAdmin()) {
$user_id = $this->Application->GetVar('u_id');
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
if ($event->Name == 'OnCreate' && $user_id == -2) {
// "Guest" can create new users
return true;
}
if ($event->Name == 'OnUpdate' && $user_id > 0) {
$user_dummy =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true));
foreach ($items_info as $id => $field_values) {
if ($id != $user_id) {
// registered users can update their record only
return false;
}
$user_dummy->Load($id);
$status_field = array_shift($this->Application->getUnitOption($event->Prefix, 'StatusField'));
if ($user_dummy->GetDBField($status_field) != STATUS_ACTIVE) {
// not active user is not allowed to update his record (he could not activate himself manually)
return false;
}
if (isset($field_values[$status_field]) && $user_dummy->GetDBField($status_field) != $field_values[$status_field]) {
// user can't change status by himself
return false;
}
}
return true;
}
if ($event->Name == 'OnUpdate' && $user_id <= 0) {
// guests are not allowed to update their record, because they don't have it :)
return false;
}
}
return parent::CheckPermission($event);
}
function OnSessionExpire()
{
if( $this->Application->IsAdmin() ) {
$this->Application->Redirect('index', Array('expired' => 1), '', 'index.php');
}
else {
$http_query =& $this->Application->recallObject('HTTPQuery');
$get = $http_query->getRedirectParams();
$t = $this->Application->GetVar('t');
$get['js_redirect'] = $this->Application->ConfigValue('UseJSRedirect');
$this->Application->Redirect($t ? $t : 'index', $get);
}
}
/**
* Checks user data and logs it in if allowed
*
* @param kEvent $event
*/
function OnLogin(&$event)
{
$object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true));
$password = $this->Application->GetVar('password');
if(!$password)
{
$object->SetError('ValidateLogin', 'blank_password', 'lu_blank_password');
$event->status = erFAIL;
return false;
}
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
list($login_field, $submit_field) = $email_as_login && !$this->Application->IsAdmin() ? Array('Email', 'email') : Array('Login', 'login');
$login_value = $this->Application->GetVar($submit_field);
if ($this->Application->IsAdmin() && ($login_value == 'root')) {
// logging in "root" (admin only)
$root_password = $this->Application->ConfigValue('RootPass');
- if ($root_password != md5($password)) {
+ $password_formatter =& $this->Application->recallObject('kPasswordFormatter');
+ $test = $password_formatter->EncryptPassword($password, 'b38');
+ if ($root_password != $test) {
$object->SetError('ValidateLogin', 'invalid_password', 'lu_invalid_password');
$event->status = erFAIL;
return false;
}
elseif ($this->checkLoginPermission($login_value)) {
$user_id = -1;
$object->Load($user_id);
$object->SetDBField('Login', $login_value);
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', $user_id);
// $session->SetField('GroupList', implode(',', $groups) );
$this->Application->SetVar('u_id', $user_id);
$this->Application->StoreVar('user_id', $user_id);
$this->processLoginRedirect($event, $password);
return true;
}
else {
$object->SetError('ValidateLogin', 'invalid_license', 'la_invalid_license');
$event->status = erFAIL;
return false;
}
}
/*$sql = 'SELECT PortalUserId FROM '.$object->TableName.' WHERE (%s = %s) AND (Password = MD5(%s))';
$user_id = $this->Conn->GetOne( sprintf($sql, $login_field, $this->Conn->qstr($login_value), $this->Conn->qstr($password) ) );*/
$sql = 'SELECT PortalUserId FROM '.$object->TableName.' WHERE (Email = %1$s OR Login = %1$s) AND (Password = MD5(%2$s))';
$user_id = $this->Conn->GetOne( sprintf($sql, $this->Conn->qstr($login_value), $this->Conn->qstr($password) ) );
if ($user_id) {
$object->Load($user_id);
if ($object->GetDBField('Status') == STATUS_ACTIVE) {
$groups = $object->getMembershipGroups(true);
if(!$groups) $groups = Array();
array_push($groups, $this->Application->ConfigValue('User_LoggedInGroup') );
$this->Application->StoreVar( 'UserGroups', implode(',', $groups) );
if ($this->checkLoginPermission($login_value)) {
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', $user_id);
$session->SetField('GroupList', implode(',', $groups) );
$this->Application->SetVar('u_id', $user_id);
$this->Application->StoreVar('user_id', $user_id);
$this->Application->setVisitField('PortalUserId', $user_id);
$this_login = (int)$object->getPersistantVar('ThisLogin');
$object->setPersistantVar('LastLogin', $this_login);
$object->setPersistantVar('ThisLogin', adodb_mktime());
}
else {
$object->Load(-2);
$object->SetError('ValidateLogin', 'no_permission', 'lu_no_permissions');
$event->status = erFAIL;
}
$this->processLoginRedirect($event, $password);
}
else {
$event->redirect = $this->Application->GetVar('pending_disabled_template');
}
}
else
{
$object->SetID(-2);
$object->SetError('ValidateLogin', 'invalid_password', 'lu_invalid_password');
$event->status = erFAIL;
}
}
/**
* Enter description here...
*
* @param string $user_name
* @return bool
*/
function checkLoginPermission($user_name)
{
$ret = true;
if ($this->Application->IsAdmin()) {
$modules_helper =& $this->Application->recallObject('ModulesHelper');
if ($user_name != 'root') {
// root is virtual user, so allow him to login to admin in any case
$ret = $this->Application->CheckPermission('ADMIN', 1);
}
$ret = $ret && $modules_helper->checkLogin();
}
else {
$ret = $this->Application->CheckPermission('LOGIN', 1);
}
return $ret;
}
/**
* Process all required data and redirect logged-in user
*
* @param kEvent $event
*/
function processLoginRedirect(&$event, $password)
{
$object =& $event->getObject();
$next_template = $this->Application->GetVar('next_template');
if ($next_template == '_ses_redirect') {
$location = $this->Application->BaseURL().$this->Application->RecallVar($next_template);
if( $this->Application->isDebugMode() && constOn('DBG_REDIRECT') )
{
$this->Application->Debugger->appendTrace();
echo "<b>Debug output above!!!</b> Proceed to redirect: <a href=\"$location\">$location</a><br>";
}
else {
header('Location: '.$location);
}
$session =& $this->Application->recallObject('Session');
$session->SaveData();
exit;
}
if ($next_template) {
$event->redirect = $next_template;
}
if ($this->Application->ConfigValue('UseJSRedirect')) {
$event->SetRedirectParam('js_redirect', 1);
}
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LoginUser', $object->GetDBField('Login'), $password);
}
/**
* Called when user logs in using old in-portal
*
* @param kEvent $event
*/
function OnInpLogin(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LoginUser', $event->getEventParam('user'), $event->getEventParam('pass') );
if ($event->redirect && is_string($event->redirect)) {
// some real template specified instead of true
$this->Application->Redirect($event->redirect, $event->redirect_params);
}
}
/**
* Called when user logs in using old in-portal
*
* @param kEvent $event
*/
function OnInpLogout(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LogoutUser');
}
function OnLogout(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LogoutUser');
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', -2);
$this->Application->SetVar('u_id', -2);
$this->Application->StoreVar('user_id', -2);
$object =& $this->Application->recallObject('u');
$object->Load(-2);
$this->Application->DestroySession();
$group_list = $this->Application->ConfigValue('User_GuestGroup').','.$this->Application->ConfigValue('User_LoggedInGroup');
$session->SetField('GroupList', $group_list);
$this->Application->StoreVar('UserGroups', $group_list);
if ($this->Application->ConfigValue('UseJSRedirect')) {
$event->SetRedirectParam('js_redirect', 1);
}
}
/**
* Prefill states dropdown with correct values
*
* @param kEvent $event
* @access public
*/
function OnPrepareStates(&$event)
{
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$cs_helper->PopulateStates($event, 'State', 'Country');
$object =& $event->getObject();
if( $object->isRequired('Country') && $cs_helper->CountryHasStates( $object->GetDBField('Country') ) ) $object->setRequired('State', true);
$object->setLogin();
}
/**
* Redirects user after succesfull registration to confirmation template (on Front only)
*
* @param kEvent $event
*/
function OnAfterItemCreate(&$event)
{
$is_subscriber = $this->Application->GetVar('IsSubscriber');
if(!$is_subscriber)
{
$object =& $event->getObject();
$sql = 'UPDATE '.TABLE_PREFIX.'UserGroup
SET PrimaryGroup = 0
WHERE PortalUserId = '.$object->GetDBField('PortalUserId');
$this->Conn->Query($sql);
$group_id = $this->Application->ConfigValue('User_NewGroup');
$sql = 'REPLACE INTO '.TABLE_PREFIX.'UserGroup(PortalUserId,GroupId,PrimaryGroup) VALUES (%s,%s,1)';
$this->Conn->Query( sprintf($sql, $object->GetID(), $group_id) );
}
}
/**
* Login user if possible, if not then redirect to corresponding template
*
* @param kEvent $event
*/
function autoLoginUser(&$event)
{
$object =& $event->getObject();
$this->Application->SetVar('u_id', $object->GetID() );
if($object->GetDBField('Status') == STATUS_ACTIVE)
{
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
list($login_field, $submit_field) = $email_as_login ? Array('Email', 'email') : Array('Login', 'login');
$this->Application->SetVar($submit_field, $object->GetDBField($login_field) );
$this->Application->SetVar('password', $object->GetDBField('Password_plain') );
$event->CallSubEvent('OnLogin');
}
}
/**
* When creating user & user with such email exists then force to use OnUpdate insted of ?
*
* @param kEvent $event
*/
function OnSubstituteSubscriber(&$event)
{
$ret = false;
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
list($id, $field_values) = each($items_info);
$user_email = $field_values['Email'];
if($user_email)
{
// check if is subscriber
$verify_user =& $this->Application->recallObject('u.verify', null, Array('skup_autoload' => true) );
$verify_user->Load($user_email, 'Email');
if( $verify_user->isLoaded() && $verify_user->isSubscriberOnly() )
{
$items_info = Array( $verify_user->GetDBField('PortalUserId') => $field_values );
$this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
$ret = true;
}
}
}
if( isset($event->MasterEvent) )
{
$event->MasterEvent->setEventParam('is_subscriber_only', $ret);
}
else
{
$event->setEventParam('is_subscriber_only', $ret);
}
}
/**
* Enter description here...
*
* @param kEvent $event
* @return bool
*/
function isSubscriberOnly(&$event)
{
$event->CallSubEvent('OnSubstituteSubscriber');
$is_subscriber = false;
if( $event->getEventParam('is_subscriber_only') )
{
$is_subscriber = true;
$object =& $event->getObject( Array('skip_autoload' => true) );
$this->OnUpdate($event);
if($event->status == erSUCCESS)
{
$this->OnAfterItemCreate($event);
$object->SendEmailEvents();
if( !$this->Application->IsAdmin() && ($event->status == erSUCCESS) && $event->redirect) $this->autoLoginUser($event);
}
}
return $is_subscriber;
}
/**
* Creates new user
*
* @param kEvent $event
*/
function OnCreate(&$event)
{
if( !$this->Application->IsAdmin() ) $this->setUserStatus($event);
if( !$this->isSubscriberOnly($event) )
{
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$cs_helper->CheckStateField($event, 'State', 'Country');
parent::OnCreate($event);
$object =& $event->getObject( Array('skip_autoload' => true) );
$this->Application->SetVar('u_id', $object->getID() );
$this->setNextTemplate($event);
if( !$this->Application->IsAdmin() && ($event->status == erSUCCESS) && $event->redirect)
{
$object->SendEmailEvents();
$this->autoLoginUser($event);
}
}
}
/**
* Set's new user status based on config options
*
* @param kEvent $event
*/
function setUserStatus(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$new_users_allowed = $this->Application->ConfigValue('User_Allow_New');
// 1 - Instant, 2 - Not Allowed, 3 - Pending
switch ($new_users_allowed)
{
case 1: // Instant
$object->SetDBField('Status', 1);
$next_template = $this->Application->GetVar('registration_confirm_template');
if($next_template) $event->redirect = $next_template;
break;
case 3: // Pending
$next_template = $this->Application->GetVar('registration_confirm_pending_template');
if($next_template) $event->redirect = $next_template;
$object->SetDBField('Status', 2);
break;
case 2: // Not Allowed
$object->SetDBField('Status', 0);
break;
}
/*if ($object->GetDBField('PaidMember') == 1) {
$this->Application->HandleEvent($add_to_cart, 'ord:OnAddToCart');
$event->redirect = 'in-commerce/checkout/shop_cart';
} */
}
/**
* Set's new unique resource id to user
*
* @param kEvent $event
*/
function OnBeforeItemCreate(&$event)
{
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
$object =& $event->getObject();
if ($email_as_login) {
$object->Fields['Email']['error_msgs']['unique'] = $this->Application->Phrase('lu_user_and_email_already_exist');
}
}
/**
* Set's new unique resource id to user
*
* @param kEvent $event
*/
function OnAfterItemValidate(&$event)
{
$object =& $event->getObject();
$resource_id = $object->GetDBField('ResourceId');
if (!$resource_id)
{
$object->SetDBField('ResourceId', $this->Application->NextResourceId() );
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnRecommend(&$event){
$friend_email = $this->Application->GetVar('friend_email');
$friend_name = $this->Application->GetVar('friend_email');
if (preg_match("/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/", $friend_email))
{
$send_params = array();
$send_params['to_email']=$friend_email;
$send_params['to_name']=$friend_name;
$user_id = $this->Application->GetVar('u_id');
$email_event = &$this->Application->EmailEventUser('SITE.SUGGEST', $user_id, $send_params);
if ($email_event->status == erSUCCESS){
$event->redirect_params = array('opener' => 's', 'pass' => 'all');
$event->redirect = $this->Application->GetVar('template_success');
}
else {
// $event->redirect_params = array('opener' => 's', 'pass' => 'all');
// $event->redirect = $this->Application->GetVar('template_fail');
$object =& $this->Application->recallObject('u');
$object->ErrorMsgs['send_error'] = $this->Application->Phrase('lu_email_send_error');
$object->FieldErrors['Email']['pseudo'] = 'send_error';
$event->status = erFAIL;
}
}
else {
$object =& $this->Application->recallObject('u');
$object->ErrorMsgs['invalid_email'] = $this->Application->Phrase('lu_InvalidEmail');
$object->FieldErrors['Email']['pseudo'] = 'invalid_email';
$event->status = erFAIL;
}
}
/**
* Saves address changes and mades no redirect
*
* @param kEvent $event
*/
function OnUpdateAddress(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
list($id,$field_values) = each($items_info);
if($id > 0) $object->Load($id);
$object->SetFieldsFromHash($field_values);
$object->setID($id);
$object->Validate();
}
$event->redirect = false;
}
function OnSubscribeQuery(&$event){
$user_email = $this->Application->GetVar('subscriber_email');
if ( preg_match("/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/", $user_email) ){
$object = &$this->Application->recallObject($this->Prefix.'.subscriber', null, Array('skip_autoload' => true));
$this->Application->StoreVar('SubscriberEmail', $user_email);
if( $object->Load(array('Email'=>$user_email)) ){
$group_info = $this->GetGroupInfo($object->GetID());
if($group_info){
$event->redirect = $this->Application->GetVar('unsubscribe_template');
}
else {
$event->redirect = $this->Application->GetVar('subscribe_template');
}
}
else {
$event->redirect = $this->Application->GetVar('subscribe_template');
$this->Application->StoreVar('SubscriberEmail', $user_email);
}
}
else {
$object =& $this->Application->recallObject('u');
$object->ErrorMsgs['invalid_email'] = $this->Application->Phrase('lu_InvalidEmail');
$object->FieldErrors['SubscribeEmail']['pseudo'] = 'invalid_email';
$event->status = erFAIL;
}
//subscribe_query_ok_template
}
function OnSubscribeUser(&$event){
$object = &$this->Application->recallObject($this->Prefix.'.subscriber', Array('skip_autoload' => true));
$user_email = $this->Application->RecallVar('SubscriberEmail');
if (preg_match("/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/", $user_email)){
if($object->Load(array('Email'=>$user_email))){
$group_info = $this->GetGroupInfo($object->GetID());
if ($group_info){
if ($event->getEventParam('no_unsubscribe')) return;
if ($group_info['PrimaryGroup']){
// delete user
$object->Delete();
}
else {
$this->RemoveSubscriberGroup($object->GetID());
}
$event->redirect = $this->Application->GetVar('unsubscribe_ok_template');
}
else {
$this->AddSubscriberGroup($object->GetID(), 0);
$event->redirect = $this->Application->GetVar('subscribe_ok_template');
}
}
else {
$object->SetField('Email', $user_email);
$object->SetField('Login', $user_email);
$object->SetDBField('dob', 1);
$object->SetDBField('dob_date', 1);
$object->SetDBField('dob_time', 1);
$ip = getenv('HTTP_X_FORWARDED_FOR')?getenv('HTTP_X_FORWARDED_FOR'):getenv('REMOTE_ADDR');
$object->SetDBField('ip', $ip);
$this->Application->SetVar('IsSubscriber', 1);
if ($object->Create()) {
$this->AddSubscriberGroup($object->GetID(), 1);
$event->redirect = $this->Application->GetVar('subscribe_ok_template');
}
$this->Application->SetVar('IsSubscriber', 0);
}
}
else {
// error handling here
$event->redirect = $this->Application->GetVar('subscribe_fail_template');
}
}
function AddSubscriberGroup($user_id, $is_primary){
$group_id = $this->Application->ConfigValue('User_SubscriberGroup');
$sql = 'INSERT INTO '.TABLE_PREFIX.'UserGroup(PortalUserId,GroupId,PrimaryGroup) VALUES (%s,%s,'.$is_primary.')';
$this->Conn->Query( sprintf($sql, $user_id, $group_id) );
$this->Application->EmailEventAdmin('USER.SUBSCRIBE', $user_id);
$this->Application->EmailEventUser('USER.SUBSCRIBE', $user_id);
}
function RemoveSubscriberGroup($user_id){
$group_id = $this->Application->ConfigValue('User_SubscriberGroup');
$sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup WHERE PortalUserId='.$user_id.' AND GroupId='.$this->Application->ConfigValue('User_SubscriberGroup');
$this->Conn->Query($sql);
$this->Application->EmailEventAdmin('USER.UNSUBSCRIBE', $user_id);
$this->Application->EmailEventUser('USER.UNSUBSCRIBE', $user_id);
}
function GetGroupInfo($user_id){
$group_info = $this->Conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'UserGroup
WHERE PortalUserId='.$user_id.'
AND GroupId='.$this->Application->ConfigValue('User_SubscriberGroup'));
return $group_info;
}
function OnForgotPassword(&$event){
$user_object = &$this->Application->recallObject('u.forgot', null, Array('skip_autoload' => true));
$user_current_object = &$this->Application->recallObject('u');
$username = $this->Application->GetVar('username');
$email = $this->Application->GetVar('email');
$found = false;
$allow_reset = true;
if( strlen($username) )
{
if( $user_object->Load(array('Login'=>$username)) )
$found = ($user_object->GetDBField("Login")==$username && $user_object->GetDBField("Status")==1) && strlen($user_object->GetDBField("Password"));
}
else if( strlen($email) )
{
if( $user_object->Load(array('Email'=>$email)) )
$found = ($user_object->GetDBField("Email")==$email && $user_object->GetDBField("Status")==1) && strlen($user_object->GetDBField("Password"));
}
if( $user_object->isLoaded() )
{
$PwResetConfirm = $user_object->GetDBField('PwResetConfirm');
$PwRequestTime = $user_object->GetDBField('PwRequestTime');
$PassResetTime = $user_object->GetDBField('PassResetTime');
//$MinPwResetDelay = $user_object->GetDBField('MinPwResetDelay');
$MinPwResetDelay = $this->Application->ConfigValue('Users_AllowReset');
$allow_reset = (strlen($PwResetConfirm) ?
adodb_mktime() > $PwRequestTime + $MinPwResetDelay :
adodb_mktime() > $PassResetTime + $MinPwResetDelay);
}
if($found && $allow_reset)
{
$this->Application->StoreVar('tmp_user_id', $user_object->GetDBField("PortalUserId"));
$this->Application->StoreVar('tmp_email', $user_object->GetDBField("Email"));
$this->Application->EmailEventUser('INCOMMERCEUSER.PSWDC', $user_object->GetDBField("PortalUserId"));
$event->redirect = $this->Application->GetVar('template_success');
}
else
{
if(!strlen($username) && !strlen($email))
{
$user_current_object->ErrorMsgs['forgotpw_nodata'] = $this->Application->Phrase('lu_ferror_forgotpw_nodata');
$user_current_object->FieldErrors['Login']['pseudo'] = 'forgotpw_nodata';
$user_current_object->FieldErrors['Email']['pseudo'] = 'forgotpw_nodata';
}
else
{
if($allow_reset)
{
if( strlen($username) ){
$user_current_object->ErrorMsgs['unknown_username'] = $this->Application->Phrase('lu_ferror_unknown_username');
$user_current_object->FieldErrors['Login']['pseudo']='unknown_username';
}
if( strlen($email) ){
$user_current_object->ErrorMsgs['unknown_email'] = $this->Application->Phrase('lu_ferror_unknown_email');
$user_current_object->FieldErrors['Email']['pseudo']='unknown_email';
}
}
else
{
$user_current_object->ErrorMsgs['reset_denied'] = $this->Application->Phrase('lu_ferror_reset_denied');
if( strlen($username) ){
$user_current_object->FieldErrors['Login']['pseudo']='reset_denied';
}
if( strlen($email) ){
$user_current_object->FieldErrors['Email']['pseudo']='reset_denied';
}
}
}
if($user_current_object->FieldErrors){
$event->redirect = false;
}
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnResetPassword(&$event){
$user_object = &$this->Application->recallObject('u.forgot');
if($user_object->Load($this->Application->RecallVar('tmp_user_id'))){
$this->Application->EmailEventUser('INCOMMERCEUSER.PSWDC', $user_object->GetDBField("PortalUserId"));
$event->redirect = $this->Application->GetVar('template_success');
$mod_object =& $this->Application->recallObject('mod.'.'In-Commerce');
$m_cat_id = $mod_object->GetDBField('RootCat');
$event->SetRedirectParam('pass', 'm');
//$event->SetRedirectParam('m_cat_id', $m_cat_id);
$this->Application->SetVar('m_cat_id', $m_cat_id);
}
}
function OnResetPasswordConfirmed(&$event){
$passed_key = $this->Application->GetVar('user_key');
$user_object = &$this->Application->recallObject('u.forgot');
$user_current_object = &$this->Application->recallObject('u');
if (strlen(trim($passed_key)) == 0) {
$event->redirect_params = array('opener' => 's', 'pass' => 'all');
$event->redirect = false;
$user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
}
if($user_object->Load(array('PwResetConfirm'=>$passed_key)))
{
$exp_time = $user_object->GetDBField('PwRequestTime') + 3600;
$user_object->SetDBField("PwResetConfirm", '');
$user_object->SetDBField("PwRequestTime", 0);
if ( $exp_time > adodb_mktime() )
{
//$m_var_list_update['codevalidationresult'] = 'lu_resetpw_confirm_text';
$newpw = makepassword4();
$this->Application->StoreVar('password', $newpw);
$user_object->SetDBField("Password",$newpw);
$user_object->SetDBField("PassResetTime", adodb_mktime());
$user_object->SetDBField("PwResetConfirm", '');
$user_object->SetDBField("PwRequestTime", 0);
$user_object->Update();
$this->Application->SetVar('ForgottenPassword', $newpw);
$email_event_user = &$this->Application->EmailEventUser('INCOMMERCEUSER.PSWD', $user_object->GetDBField('PortalUserId'));
$email_event_admin = &$this->Application->EmailEventAdmin('INCOMMERCEUSER.PSWD');
$this->Application->DeleteVar('ForgottenPassword');
if ($email_event_user->status == erSUCCESS){
$event->redirect_params = array('opener' => 's', 'pass' => 'all');
$event->redirect = $this->Application->GetVar('template_success');
}
$user_object->SetDBField("Password",md5($newpw));
$user_object->Update();
} else {
$user_current_object->ErrorMsgs['code_expired'] = $this->Application->Phrase('lu_code_expired');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_expired';
$event->redirect = false;
}
} else {
$user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
$event->redirect = false;
}
}
function OnUpdate(&$event)
{
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$cs_helper->CheckStateField($event, 'State', 'Country');
parent::OnUpdate($event);
$this->setNextTemplate($event);
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function setNextTemplate(&$event)
{
if( !$this->Application->IsAdmin() )
{
$event->redirect_params['opener'] = 's';
$object =& $event->getObject();
if($object->GetDBField('Status') == STATUS_ACTIVE)
{
$next_template = $this->Application->GetVar('next_template');
if($next_template) $event->redirect = $next_template;
}
}
}
/**
* Delete users from groups if their membership is expired
*
* @param kEvent $event
*/
function OnCheckExpiredMembership(&$event)
{
// send pre-expiration reminders: begin
$pre_expiration = adodb_mktime() + $this->Application->ConfigValue('User_MembershipExpirationReminder') * 3600 * 24;
$sql = 'SELECT PortalUserId, GroupId
FROM '.TABLE_PREFIX.'UserGroup
WHERE (MembershipExpires IS NOT NULL) AND (ExpirationReminderSent = 0) AND (MembershipExpires < '.$pre_expiration.')';
$skip_clause = $event->getEventParam('skip_clause');
if ($skip_clause) {
$sql .= ' AND !('.implode(') AND !(', $skip_clause).')';
}
$records = $this->Conn->Query($sql);
if ($records) {
$conditions = Array();
foreach ($records as $record) {
$email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRATION.NOTICE', $record['PortalUserId']);
$email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRATION.NOTICE');
$conditions[] = '(PortalUserId = '.$record['PortalUserId'].' AND GroupId = '.$record['GroupId'].')';
}
$sql = 'UPDATE '.TABLE_PREFIX.'UserGroup
SET ExpirationReminderSent = 1
WHERE '.implode(' OR ', $conditions);
$this->Conn->Query($sql);
}
// send pre-expiration reminders: end
// remove users from groups with expired membership: begin
$sql = 'SELECT PortalUserId
FROM '.TABLE_PREFIX.'UserGroup
WHERE (MembershipExpires IS NOT NULL) AND (MembershipExpires < '.adodb_mktime().')';
$user_ids = $this->Conn->GetCol($sql);
if ($user_ids) {
foreach ($user_ids as $id) {
$email_event_user =& $this->Application->EmailEventUser('USER.MEMBERSHIP.EXPIRED', $id);
$email_event_admin =& $this->Application->EmailEventAdmin('USER.MEMBERSHIP.EXPIRED');
}
}
$sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup
WHERE (MembershipExpires IS NOT NULL) AND (MembershipExpires < '.adodb_mktime().')';
$this->Conn->Query($sql);
// remove users from groups with expired membership: end
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnRefreshForm(&$event)
{
$event->redirect = false;
$item_info = $this->Application->GetVar($event->Prefix_Special);
list($id, $fields) = each($item_info);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->setID($id);
$object->IgnoreValidation = true;
$object->SetFieldsFromHash($fields);
}
/**
* Sets persistant variable
*
* @param kEvent $event
*/
function OnSetPersistantVariable(&$event)
{
$object =& $event->getObject();
$field = $this->Application->GetVar('field');
$value = $this->Application->GetVar('value');
$object->setPersistantVar($field, $value);
$force_tab = $this->Application->GetVar('SetTab');
if ($force_tab) {
$this->Application->StoreVar('force_tab', $force_tab);
}
}
/**
* Overwritten to return user from order by special .ord
*
* @param kEvent $event
*/
function getPassedId(&$event)
{
if ($event->Special == 'ord') {
$order =& $this->Application->recallObject('ord');
return $order->GetDBField('PortalUserId');
}
return parent::getPassedID($event);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/users/users_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.64
\ No newline at end of property
+1.65
\ No newline at end of property
Index: trunk/core/units/configuration/configuration_event_handler.php
===================================================================
--- trunk/core/units/configuration/configuration_event_handler.php (revision 6427)
+++ trunk/core/units/configuration/configuration_event_handler.php (revision 6428)
@@ -1,191 +1,192 @@
<?php
class ConfigurationEventHandler extends InpDBEventHandler {
/**
* Changes permission section to one from REQUEST, not from config
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
$event->setEventParam('PermSection', $this->Application->GetVar('section'));
return parent::CheckPermission($event);
}
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @access protected
* @see OnListBuild
*/
function SetCustomQuery(&$event)
{
$object =& $event->getObject();
$module = $this->Application->GetVar('module');
$section = $this->Application->GetVar('section');
$object->addFilter('module_filter', '%1$s.ModuleOwner = '.$this->Conn->qstr($module));
$object->addFilter('section_filter', '%1$s.Section = '.$this->Conn->qstr($section));
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnBeforeItemUpdate(&$event)
{
$object =& $event->getObject();
// if password field is empty, then don't update
if ($object->GetDBField('element_type') == 'password') {
if (trim($object->GetDBField('VariableValue')) == '') {
$field_options = $object->GetFieldOptions('VariableValue');
$field_options['skip_empty'] = 1;
$object->SetFieldOptions('VariableValue', $field_options);
}else {
- $object->SetDBField('VariableValue', md5($object->GetDBField('VariableValue')));
+ $password_formatter =& $this->Application->recallObject('kPasswordFormatter');
+ $object->SetDBField('VariableValue', $password_formatter->EncryptPassword($object->GetDBField('VariableValue'), 'b38'));
}
}
$field_values = $this->Application->GetVar($event->getPrefixSpecial(true));
$state_country_hash = Array(
'Comm_State' => 'Comm_Country',
'Comm_Shipping_State' => 'Comm_Shipping_Country'
);
$field_name = $object->GetDBField('VariableName');
if (isset($state_country_hash[$field_name])) {
// if this is state field
$check_state = $object->GetDBField('VariableValue');
$check_country = $field_values[ $state_country_hash[$field_name] ]['VariableValue'];
if (!($check_country && $check_state)) {
return true;
}
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$state_iso = $cs_helper->CheckState($check_state, $check_country);
if ($state_iso !== false) {
$object->SetDBField('VariableValue', $state_iso);
}
else
{
$errormsgs = $this->Application->GetVar('errormsgs');
$errors = !$errormsgs || !isset($errormsgs[$event->Prefix_Special]) ? Array() : $errormsgs[$event->Prefix_Special];
$errors[$field_name] = 'la_InvalidState';
$errormsgs[$event->Prefix_Special] = $errors;
$this->Application->SetVar('errormsgs', $errormsgs);
$event->status = erFAIL;
}
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnAfterItemUpdate(&$event)
{
$object =& $event->getObject();
if ($object->GetDBField('element_type') == 'password') {
if (trim($object->GetDBField('VariableValue')) == '') {
$field_options = $object->GetFieldOptions('VariableValue');
unset($field_options['skip_empty']);
$object->SetFieldOptions('VariableValue', $field_options);
}
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnUpdate(&$event)
{
if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
// 1. save user selected module root category
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
$new_category_id = getArrayValue($items_info, 'ModuleRootCategory', 'VariableValue');
if ($new_category_id) {
unset($items_info['ModuleRootCategory']);
$this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
}
parent::OnUpdate($event);
if ($event->status == erSUCCESS && $new_category_id !== false) {
// root category was submitted
$module = $this->Application->GetVar('module');
$root_category_id = $this->Application->findModule('Name', $module, 'RootCat');
if ($root_category_id != $new_category_id) {
// root category differs from one in db
$fields_hash = Array('RootCat' => $new_category_id);
$this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Modules', 'Name = '.$this->Conn->qstr($module));
}
}
if ($event->status == erSUCCESS) { // reset cache
$this->Application->UnitConfigReader->ResetParsedData();
}
}
if ($this->Application->GetVar('errormsgs')) {
// because we have list out there, and this is item
$this->Application->removeObject($event->getPrefixSpecial());
$event->redirect = false;
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
/*function OnChangeCountry(&$event)
{
$event->setPseudoClass('_List');
$object = &$event->getObject( Array('per_page'=>-1) );
$object->Query();
$array_records =& $object->Records;
foreach($array_records as $i=>$record){
if ($record['VariableName']=='Comm_Country'){
$values = $this->Application->GetVar('conf');
$array_records[$i]['VariableValue'] = $values['Comm_Country']['VariableValue'];
}
}
$event->redirect_params = Array('opener' => 's', 'pass'=>'all,conf'); //stay!
$event->redirect = false;
}*/
-
+
/**
* Process items from selector (selected_ids var, key - prefix, value - comma separated ids)
*
* @param kEvent $event
*/
function OnProcessSelected(&$event)
{
$selected_ids = $this->Application->GetVar('selected_ids');
$this->Application->StoreVar('ModuleRootCategory', $selected_ids['c']);
$this->finalizePopup($event);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/configuration/configuration_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.16
\ No newline at end of property
+1.17
\ No newline at end of property
Index: trunk/core/units/email_events/email_events_event_handler.php
===================================================================
--- trunk/core/units/email_events/email_events_event_handler.php (revision 6427)
+++ trunk/core/units/email_events/email_events_event_handler.php (revision 6428)
@@ -1,269 +1,271 @@
<?php
class EmailEventsEventsHandler extends InpDBEventHandler
{
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnFrontOnly' => Array('self' => 'edit'),
'OnSaveSelected' => Array('self' => 'view'),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Changes permission section to one from REQUEST, not from config
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
$module = $this->Application->GetVar('module');
$module = explode(':', $module, 2);
if (count($module) == 1) {
$main_prefix = $this->Application->findModule('Name', $module[0], 'Var');
}
else {
$exceptions = Array('Category' => 'c', 'Users' => 'u');
$main_prefix = $exceptions[ $module[1] ];
}
$section = $this->Application->getUnitOption($main_prefix.'.email', 'PermSection');
$event->setEventParam('PermSection', $section);
return parent::CheckPermission($event);
}
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @access protected
* @see OnListBuild
*/
function SetCustomQuery(&$event)
{
if ($event->Special == 'module') {
$object =& $event->getObject();
$module = $this->Application->GetVar('module');
$object->addFilter('module_filter', '%1$s.Module = '.$this->Conn->qstr($module));
}
}
/**
* Sets status Front-End Only to selected email events
*
* @param kEvent $event
*/
function OnFrontOnly(&$event)
{
$ids = implode(',', $this->StoreSelectedIDs($event));
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'UPDATE '.$table_name.'
SET Enabled = 2
WHERE EventId IN ('.$ids.')';
$this->Conn->Query($sql);
}
/**
* Sets selected user to email events selected
*
* @param kEvent $event
*/
function OnSelectUser(&$event)
{
$items_info = $this->Application->GetVar('u');
if ($items_info) {
$user_id = array_shift( array_keys($items_info) );
$ids = $this->Application->RecallVar($event->getPrefixSpecial().'_selected_ids');
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'UPDATE '.$table_name.'
SET '.$this->Application->RecallVar('dst_field').' = '.$user_id.'
WHERE '.$id_field.' IN ('.$ids.')';
$this->Conn->Query($sql);
}
$this->finalizePopup($event);
}
/**
* Saves selected ids to session
*
* @param kEvent $event
*/
function OnSaveSelected(&$event)
{
$this->StoreSelectedIDs($event);
}
/**
* Raised when email message shoul be sent
*
* @param kEvent $event
*/
function OnEmailEvent(&$event){
$email_event = $event->getEventParam('EmailEventName');
if( strpos($email_event, '_') !== false )
{
trigger_error('<span class="debug_error">Invalid email event name</span> <b>'.$email_event.'</b>. Use only <b>UPPERCASE characters</b> and <b>dots</b> as email event names', E_USER_ERROR);
}
$to_user_id = $event->getEventParam('EmailEventToUserId');
$email_event_type = $event->getEventParam('EmailEventType');
$message_object = &$this->Application->recallObject('emailmessages', null, Array('skip_autoload' => true));
$event_table = $this->Application->getUnitOption('emailevents', 'TableName');
- $event_object = &$event->getObject();
+ $event_object =& $event->getObject( Array('skip_autoload' => true) );
$event_object->Load(array('Event'=>$email_event, 'Type'=>$email_event_type));
$event_id = $event_object->GetDBField('EventId');
$from_user_id = $event_object->GetDBField('FromUserId');
$type = $event_object->GetDBField('Type');
$enabled = $event_object->GetDBField('Enabled');
$direct_send_params = $event->getEventParam('DirectSendParams');
if ($enabled == 0) return; // disabled event
if ($enabled == 2 && $this->Application->IsAdmin() ) return; // event only for front-end
if ($type == 1){
// For type "Admin" recipient is a user from field FromUserId which means From/To user in Email events list
$to_user_id = $from_user_id;
$from_user_id = -1;
}
/*
if (!($to_user_id > 0) && !$direct_send_params){
// if we can not determine recepient we will not send email
return;
}
*/
//Parse Message Template
$message_object->Load(array('EventId' => $event_id, 'LanguageId' => $this->Application->GetVar('m_lang')));
$message_type = $message_object->GetDBField('MessageType');
$email_object = &$this->Application->recallObject('kEmailMessage');
$email_object->Clear();
// add footer: begin
$sql = 'SELECT em.Template
FROM '.$message_object->TableName.' em
LEFT JOIN '.TABLE_PREFIX.'Events e ON e.EventId = em.EventId
WHERE em.LanguageId = '.$message_object->GetDBField('LanguageId').' AND e.Event = "COMMON.FOOTER"';
$footer = explode("\n\n", $this->Conn->GetOne($sql));
$footer = $message_object->GetDBField('MessageType') == 'text' ? $email_object->convertHTMLtoPlain($footer[1]) : $footer[1];
$message_template = $message_object->GetDBField('Template')."\r\n".$footer;
// add footer: end
- $from_user_object = &$this->Application->recallObject('u.-email'.$from_user_id, null, Array('skip_autoload' => true));
+ $from_user_object = &$this->Application->recallObject('u.email-from', null, Array('skip_autoload' => true));
$from_user_object->Load($from_user_id);
// here if we don't have from_user loaded, it takes a default user from config values
if ( $from_user_object->IsLoaded() ) {
$from_user_email = $from_user_object->GetDBField('Email');
$from_user_name = trim($from_user_object->GetDBField('FirstName').' '.$from_user_object->GetDBField('LastName'));
}
else {
$from_user_email = $this->Application->ConfigValue('Smtp_AdminMailFrom');
}
- $to_user_object = &$this->Application->recallObject('u.-email'.$to_user_id, null, Array('skip_autoload' => true));
+ $to_user_object = &$this->Application->recallObject('u.email-to', null, Array('skip_autoload' => true));
$to_user_object->Load($to_user_id);
$to_user_email = $to_user_object->GetDBField('Email');
$to_user_name = trim($to_user_object->GetDBField('FirstName').' '.$to_user_object->GetDBField('LastName'));
if($direct_send_params){
$to_user_email = ( $direct_send_params['to_email'] ? $direct_send_params['to_email'] : $to_user_email );
$to_user_name = ( $direct_send_params['to_name'] ? $direct_send_params['to_name'] : $to_user_name );
$from_user_email = ( $direct_send_params['from_email'] ? $direct_send_params['from_email'] : $from_user_email);
$from_user_name = ( $direct_send_params['from_name'] ? $direct_send_params['from_name'] : $from_user_name );
$message_body_additional = $direct_send_params['message'];
}
$to_user_email = $to_user_email ? $to_user_email : $this->Application->ConfigValue('Smtp_AdminMailFrom');
$this->Application->makeClass('Template');
$this->Application->InitParser();
$parser_params = $this->Application->Parser->Params;
$direct_send_params['message_text'] = $message_body_additional;
$this->Application->Parser->Params = array_merge_recursive2($this->Application->Parser->Params, $direct_send_params);
$message_template = str_replace('<inp:touser _Field', '<inp2:u_Field name', $message_template);
$message_template = $this->Application->Parser->Parse($message_template, 'email_template', 0);
$this->Application->Parser->Params = $parser_params;
$message_template = str_replace("\r", "", $message_template);
list($message_headers, $message_body) = explode("\n\n", $message_template, 2);
$email_object->setFrom($from_user_email, $from_user_name);
$email_object->setTo($to_user_email, $to_user_name);
$email_object->setSubject('Mail message');
$email_object->setHeaders($message_headers);
if ($message_type == 'html'){
$email_object->setHTMLBody($message_body);
}
else {
$email_object->setTextBody($message_body);
}
$smtp_object = &$this->Application->recallObject('kSmtpClient');
$smtp_object->debug = $this->Application->isDebugMode() && constOn('DBG_SMTP');
$smtp_server = $this->Application->ConfigValue('Smtp_Server');
$smtp_port = $this->Application->ConfigValue('Smtp_Port');
$smtp_authenticate = $this->Application->ConfigValue('Smtp_Authenticate');
if ($smtp_authenticate){
$smtp_user = $this->Application->ConfigValue('Smtp_User');
$smtp_pass = $this->Application->ConfigValue('Smtp_Pass');
}else{
$smtp_user = '';
$smtp_pass = '';
}
if ($smtp_server){
if ($email_object->sendSMTP($smtp_object, $smtp_server, $smtp_user, $smtp_pass, $smtp_authenticate)){
$event->status=erSUCCESS;
}
else {
$event->status=erFAIL;
}
}else{
if($email_object->send()){
$event->status=erSUCCESS;
}
else {
$event->status=erFAIL;
}
}
if ($event->status == erSUCCESS){
if (!$from_user_name) {
$from_user_name = strip_tags( $this->Application->ConfigValue('Site_Name') );
}
$sql = 'INSERT INTO '.TABLE_PREFIX.'EmailLog SET
fromuser = '.$this->Conn->qstr($from_user_name.' ('.$from_user_email.')').',
addressto = '.$this->Conn->qstr($to_user_name.' ('.$to_user_email.')').',
subject = '.$this->Conn->qstr($email_object->Subject).',
timestamp = UNIX_TIMESTAMP(),
event = '.$this->Conn->qstr($email_event);
$this->Conn->Query($sql);
}
+ $this->Application->removeObject('u.email-from');
+ $this->Application->removeObject('u.email-to');
return $event;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/email_events/email_events_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.25
\ No newline at end of property
+1.26
\ No newline at end of property
Index: trunk/core/units/general/cat_tag_processor.php
===================================================================
--- trunk/core/units/general/cat_tag_processor.php (revision 6427)
+++ trunk/core/units/general/cat_tag_processor.php (revision 6428)
@@ -1,226 +1,236 @@
<?php
class kCatDBTagProcessor extends kDBTagProcessor {
/**
* Permission Helper
*
* @var kPermissionsHelper
*/
var $PermHelper = null;
function kCatDBTagProcessor()
{
parent::kDBTagProcessor();
$this->PermHelper = $this->Application->recallObject('PermissionsHelper');
}
function ItemIcon($params)
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
$grids = $this->Application->getUnitOption($this->Prefix,'Grids');
$icons =& $grids[ $params['grid'] ]['Icons'];
$status_fields = $this->Application->getUnitOption($this->Prefix,'StatusField');
if (!$status_fields) return $icons['default'];
$value = $object->GetDBField($status_fields[0]); // sets base status icon
if ($value == STATUS_ACTIVE) {
if( $object->GetDBField('IsPop') ) $value = 'POP';
if( $object->GetDBField('IsHot') ) $value = 'HOT';
if( $object->GetDBField('IsNew') ) $value = 'NEW';
if( $object->GetDBField('EditorsPick') ) $value = 'PICK';
}
return isset($icons[$value]) ? $icons[$value] : $icons['default'];
}
- function ItemLink($params)
+ /**
+ * Allows to create valid mod-rewrite compatible link to module item
+ *
+ * @param Array $params
+ * @param string $id_prefix
+ * @return string
+ */
+ function ItemLink($params, $id_prefix)
{
- // 'p_id'=>'0', ??
- $params = array_merge($params, array('pass'=>'m,'.$this->Prefix));
- $item_id = getArrayValue($params,$this->Prefix.'_id');
+ $params = array_merge($params, Array('pass' => 'm,'.$this->Prefix) );
+
+ $item_id = isset($params[$id_prefix.'_id']) && $params[$id_prefix.'_id'];
if (!$item_id) {
- $item_id = $this->Application->GetVar($this->Prefix.'_id');
+ $item_id = $this->Application->GetVar($this->getPrefixSpecial().'_id');
+ if (!$item_id) {
+ $item_id = $this->Application->GetVar($this->Prefix.'_id');
+ }
}
$params[$this->Prefix.'_id'] = $item_id;
- $item =& $this->Application->recallObject($this->getPrefixSpecial());
- $params['m_cat_id'] = $item->GetDBField('CategoryId');
+ $object =& $this->getObject($params);
+ $params['m_cat_id'] = $object->GetDBField('CategoryId');
+ $params['pass_category'] = 1;
- $main_processor =& $this->Application->recallObject('m_TagProcessor');
- return $main_processor->T($params);
+ return $this->Application->ProcessParsedTag('m', 't', $params);
}
/**
* Returns path where exported category items should be saved
*
* @param Array $params
*/
function ExportPath($params)
{
$ret = EXPORT_PATH.'/';
if( getArrayValue($params, 'as_url') )
{
$ret = str_replace( FULL_PATH.'/', $this->Application->BaseURL(), $ret);
}
$export_options = unserialize($this->Application->RecallVar($this->getPrefixSpecial().'_options'));
$ret .= $export_options['ExportFilename'].'.'.($export_options['ExportFormat'] == 1 ? 'csv' : 'xml');
return $ret;
}
function CategoryPath($params)
{
if (!isset($params['cat_id'])) {
$params['cat_id'] = $this->Application->RecallVar($params['session_var'], 0);
}
return $this->Application->ProcessParsedTag('c', 'CategoryPath', $params);
}
function BuildListSpecial($params)
{
if ($this->Special != '') return $this->Special;
if ( isset($params['parent_cat_id']) ) {
$parent_cat_id = $params['parent_cat_id'];
}
else {
$parent_cat_id = $this->Application->GetVar('c_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
}
$recursive = isset($params['recursive']);
$types = $this->SelectParam($params, 'types');
$except = $this->SelectParam($params, 'except');
if ($types.$except.$recursive == '') {
return parent::BuildListSpecial($params);
}
$special = crc32($parent_cat_id.$types.$except.$recursive);
return $special;
}
function ExportStatus($params)
{
$export_object =& $this->Application->recallObject('CatItemExportHelper');
$event = new kEvent($this->getPrefixSpecial().':OnDummy');
$action_method = 'perform'.ucfirst($this->Special);
$field_values = $export_object->$action_method($event);
// finish code is done from JS now
if ($field_values['start_from'] == $field_values['total_records'])
{
if ($this->Special == 'import') {
$this->Application->StoreVar('PermCache_UpdateRequired', 1);
$this->Application->Redirect('categories/cache_updater', Array('m_opener' => 'r', 'pass' => 'm', 'continue' => 1, 'no_amp' => 1));
}
elseif ($this->Special == 'export') {
$template = $this->Application->getUnitOption($this->Prefix, 'ModuleFolder').'/'.$this->Special.'_finish';
$this->Application->Redirect($template, Array('pass' => 'all'));
}
}
$export_options = $export_object->loadOptions($event);
return $export_options['start_from'] * 100 / $export_options['total_records'];
}
function CatalogItemCount($params)
{
$object =& $this->GetList($params);
if (!$object->Counted) {
$object->CountRecs();
}
return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' / '.$object->NoFilterCount : $object->RecordsCount;
}
function ListReviews($params)
{
$prefix = $this->Prefix.'-rev';
$review_tag_processor =& $this->Application->recallObject($prefix.'.item_TagProcessor');
return $review_tag_processor->PrintList($params);
}
function ReviewCount($params)
{
$review_tag_processor =& $this->Application->recallObject('rev.item_TagProcessor');
return $review_tag_processor->TotalRecords($params);
}
function InitCatalogTab($params)
{
$tab_params['mode'] = $this->Application->GetVar('tm'); // single/multi selection possible
$tab_params['special'] = $this->Application->GetVar('ts'); // use special for this tab
$tab_params['dependant'] = $this->Application->GetVar('td'); // is grid dependant on categories grid
// set default params (same as in catalog)
if ($tab_params['mode'] === false) $tab_params['mode'] = 'multi';
if ($tab_params['special'] === false) $tab_params['special'] = '';
if ($tab_params['dependant'] === false) $tab_params['dependant'] = 'yes';
// pass params to block with tab content
$params['name'] = $params['render_as'];
$params['prefix'] = trim($this->Prefix.'.'.($tab_params['special'] ? $tab_params['special'] : $this->Special), '.');
$params['cat_prefix'] = trim('c.'.($tab_params['special'] ? $tab_params['special'] : $this->Special), '.');
$params['tab_mode'] = $tab_params['mode'];
$params['tab_dependant'] = $tab_params['dependant'];
$params['show_category'] = $tab_params['special'] == 'showall' ? 1 : 0; // this is advanced view -> show category name
return $this->Application->ParseBlock($params, 1);
}
/**
* Show CachedNavbar of current item primary category
*
* @param Array $params
* @return string
*/
function CategoryName($params)
{
// show category cachednavbar of
$object =& $this->getObject($params);
$category_id = isset($params['cat_id']) ? $params['cat_id'] : $object->GetDBField('CategoryId');
$category_path = $this->Application->getCache('category_paths', $category_id);
if ($category_path === false) {
// not chached
if ($category_id > 0) {
$category_path = trim($this->CategoryName( Array('cat_id' => 0) ).' > '.str_replace('&|&', ' > ', $object->GetDBField('CachedNavbar')), ' > ');
}
else {
$category_path = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') );
}
$this->Application->setCache('category_paths', $category_id, $category_path);
}
return $category_path;
}
/**
* Allows to determine if original value should be shown
*
* @param Array $params
* @return bool
*/
function DisplayOriginal($params)
{
// original id found & greather then zero + show original
$display_original = isset($params['display_original']) && $params['display_original'];
$object =& $this->getObject($params);
$perm_value = $this->PermHelper->ModifyCheckPermission($object->GetDBField('CreatedById'), $object->GetDBField('CategoryId'), $this->Prefix);
return $display_original && ($perm_value == 1) && $this->Application->GetVar($this->Prefix.'.original_id');
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/cat_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.12
\ No newline at end of property
+1.13
\ No newline at end of property
Index: trunk/core/units/general/cat_event_handler.php
===================================================================
--- trunk/core/units/general/cat_event_handler.php (revision 6427)
+++ trunk/core/units/general/cat_event_handler.php (revision 6428)
@@ -1,1893 +1,1916 @@
<?php
$application =& kApplication::Instance();
$application->Factory->includeClassFile('kDBEventHandler');
class kCatDBEventHandler extends InpDBEventHandler {
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnExport' => Array('self' => 'view|advanced:export'),
'OnExportBegin' => Array('self' => 'view|advanced:export'),
'OnSaveSettings' => Array('self' => 'add|edit|advanced:import'),
'OnBeforeDeleteOriginal' => Array('self' => 'edit|advanced:approve'),
'OnCancelAction' => Array( 'self' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if (!$this->Application->IsAdmin()) {
if ($event->Name == 'OnSetSortingDirect') {
// allow sorting on front event without view permission
return true;
}
}
if ($event->Name == 'OnExport') {
// save category_id before doing export
$this->Application->LinkVar('m_cat_id');
}
if ($event->Name == 'OnNew' && preg_match('/(.*)\/import$/', $this->Application->GetVar('t'), $rets)) {
// redirect to item import template, where permission (import) category will be chosen)
$root_category = $this->Application->findModule('Path', $rets[1].'/', 'RootCat');
$this->Application->StoreVar('m_cat_id', $root_category);
}
if ($event->Name == 'OnEdit' || $event->Name == 'OnSave') {
// check each id from selected individually and only if all are allowed proceed next
if ($event->Name == 'OnEdit') {
$selected_ids = implode(',', $this->StoreSelectedIDs($event));
}
else {
$selected_ids = $this->Application->RecallVar($event->getPrefixSpecial().'_selected_ids');
}
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'SELECT '.$id_field.', CreatedById, ci.CategoryId
FROM '.$table_name.' item_table
LEFT JOIN '.$this->Application->getUnitOption('ci', 'TableName').' ci ON ci.ItemResourceId = item_table.ResourceId
WHERE '.$id_field.' IN ('.$selected_ids.') AND (ci.PrimaryCat = 1)';
$items = $this->Conn->Query($sql, $id_field);
$perm_value = true;
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
foreach ($items as $item_id => $item_data) {
if ($perm_helper->ModifyCheckPermission($item_data['CreatedById'], $item_data['CategoryId'], $event->Prefix) == 0) {
// one of items selected has no permission
$perm_value = false;
break;
}
}
if (!$perm_value) {
$event->status = erPERM_FAIL;
}
return $perm_value;
}
return parent::CheckPermission($event);
}
/**
* Add selected items to clipboard with mode = COPY (CLONE)
*
* @param kEvent $event
*/
function OnCopy(&$event)
{
$this->Application->RemoveVar('clipboard');
$clipboard_helper =& $this->Application->recallObject('ClipboardHelper');
$clipboard_helper->setClipboard($event, 'copy', $this->StoreSelectedIDs($event));
}
/**
* Add selected items to clipboard with mode = CUT
*
* @param kEvent $event
*/
function OnCut(&$event)
{
$this->Application->RemoveVar('clipboard');
$clipboard_helper =& $this->Application->recallObject('ClipboardHelper');
$clipboard_helper->setClipboard($event, 'cut', $this->StoreSelectedIDs($event));
}
/**
* Performs category item paste
*
* @param kEvent $event
*/
function OnPaste(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$clipboard_data = $event->getEventParam('clipboard_data');
if (!$clipboard_data['cut'] && !$clipboard_data['copy']) {
return false;
}
if ($clipboard_data['copy']) {
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$temp->CloneItems($event->Prefix, $event->Special, $clipboard_data['copy']);
}
if ($clipboard_data['cut']) {
$object =& $this->Application->recallObject($event->getPrefixSpecial().'.item', $event->Prefix, Array('skip_autoload' => true));
foreach ($clipboard_data['cut'] as $id) {
$object->Load($id);
$object->MoveToCat();
}
}
}
/**
* Return type clauses for list bulding on front
*
* @param kEvent $event
* @return Array
*/
function getTypeClauses(&$event)
{
$types = $event->getEventParam('types');
$except_types = $event->getEventParam('except');
$type_clauses = Array();
$type_clauses['pick']['include'] = '%1$s.EditorsPick = 1 AND '.TABLE_PREFIX.'CategoryItems.PrimaryCat = 1';
$type_clauses['pick']['except'] = '%1$s.EditorsPick! = 1 AND '.TABLE_PREFIX.'CategoryItems.PrimaryCat = 1';
$type_clauses['pick']['having_filter'] = false;
$type_clauses['hot']['include'] = '`IsHot` = 1 AND PrimaryCat = 1';
$type_clauses['hot']['except'] = '`IsHot`! = 1 AND PrimaryCat = 1';
$type_clauses['hot']['having_filter'] = true;
$type_clauses['pop']['include'] = '`IsPop` = 1 AND PrimaryCat = 1';
$type_clauses['pop']['except'] = '`IsPop`! = 1 AND PrimaryCat = 1';
$type_clauses['pop']['having_filter'] = true;
$type_clauses['new']['include'] = '`IsNew` = 1 AND PrimaryCat = 1';
$type_clauses['new']['except'] = '`IsNew`! = 1 AND PrimaryCat = 1';
$type_clauses['new']['having_filter'] = true;
$type_clauses['displayed']['include'] = '';
$displayed = $this->Application->GetVar($event->Prefix.'_displayed_ids');
if ($displayed) {
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$type_clauses['displayed']['except'] = '%1$s.'.$id_field.' NOT IN ('.$displayed.')';
}
else {
$type_clauses['displayed']['except'] = '';
}
$type_clauses['displayed']['having_filter'] = false;
if (strpos($types, 'search') !== false || strpos($except_types, 'search') !== false) {
$event_mapping = Array(
'simple' => 'OnSimpleSearch',
'subsearch' => 'OnSubSearch',
'advanced' => 'OnAdvancedSearch');
if($this->Application->GetVar('INPORTAL_ON') && $this->Application->GetVar('Action') == 'm_simple_subsearch')
{
$type = 'subsearch';
}
else
{
$type = $this->Application->GetVar('search_type') ? $this->Application->GetVar('search_type') : 'simple';
}
if($keywords = $event->getEventParam('keyword_string')) // processing keyword_string param of ListProducts tag
{
$this->Application->SetVar('keywords', $keywords);
$type = 'simple';
}
$search_event = $event_mapping[$type];
$this->$search_event($event);
$search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$sql = 'SHOW TABLES LIKE "'.$search_table.'"';
if ( $this->Conn->Query($sql) ) {
$search_res_ids = $this->Conn->GetCol('SELECT ResourceId FROM '.$search_table);
}
if ($search_res_ids) {
$type_clauses['search']['include'] = '%1$s.ResourceId IN ('.implode(',', $search_res_ids).') AND PrimaryCat = 1';
$type_clauses['search']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $search_res_ids).') AND PrimaryCat = 1';
}
else {
$type_clauses['search']['include'] = '0';
$type_clauses['search']['except'] = '1';
}
$type_clauses['search']['having_filter'] = false;
}
if (strpos($types, 'related') !== false || strpos($except_types, 'related') !== false) {
$related_to = $event->getEventParam('related_to');
if (!$related_to) {
$related_prefix = $event->Prefix;
}
else {
$sql = 'SELECT Prefix
FROM '.TABLE_PREFIX.'ItemTypes
WHERE ItemName = '.$this->Conn->qstr($related_to);
$related_prefix = $this->Conn->GetOne($sql);
}
$rel_table = $this->Application->getUnitOption('rel', 'TableName');
$item_type = $this->Application->getUnitOption($event->Prefix, 'ItemType');
$p_item =& $this->Application->recallObject($related_prefix.'.current', null, Array('skip_autoload' => true));
$p_item->Load( $this->Application->GetVar($related_prefix.'_id') );
$p_resource_id = $p_item->GetDBField('ResourceId');
$sql = 'SELECT SourceId, TargetId FROM '.$rel_table.'
WHERE
(Enabled = 1)
AND (
(Type = 0 AND SourceId = '.$p_resource_id.' AND TargetType = '.$item_type.')
OR
(Type = 1
AND (
(SourceId = '.$p_resource_id.' AND TargetType = '.$item_type.')
OR
(TargetId = '.$p_resource_id.' AND SourceType = '.$item_type.')
)
)
)';
$related_ids_array = $this->Conn->Query($sql);
$related_ids = Array();
foreach ($related_ids_array as $key => $record) {
$related_ids[] = $record[ $record['SourceId'] == $p_resource_id ? 'TargetId' : 'SourceId' ];
}
if (count($related_ids) > 0) {
$type_clauses['related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_ids).') AND PrimaryCat = 1';
$type_clauses['related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_ids).') AND PrimaryCat = 1';
}
else {
$type_clauses['related']['include'] = '0';
$type_clauses['related']['except'] = '1';
}
$type_clauses['related']['having_filter'] = false;
}
return $type_clauses;
}
/**
* Apply filters to list
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
parent::SetCustomQuery($event);
$object =& $event->getObject();
// add category filter if needed
if ($event->Special != 'showall') {
if ( $event->getEventParam('parent_cat_id') ) {
$parent_cat_id = $event->getEventParam('parent_cat_id');
}
else {
$parent_cat_id = $this->Application->GetVar('c_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
if (!$parent_cat_id) {
$parent_cat_id = 0;
}
}
if ((string) $parent_cat_id != 'any') {
if ($event->getEventParam('recursive')) {
$current_path = $this->Conn->GetOne('SELECT ParentPath FROM '.TABLE_PREFIX.'Category WHERE CategoryId='.$parent_cat_id);
$subcats = $this->Conn->GetCol('SELECT CategoryId FROM '.TABLE_PREFIX.'Category WHERE ParentPath LIKE "'.$current_path.'%" ');
$object->addFilter('category_filter', TABLE_PREFIX.'CategoryItems.CategoryId IN ('.implode(', ', $subcats).')');
}
else {
$object->addFilter('category_filter', TABLE_PREFIX.'CategoryItems.CategoryId = '.$parent_cat_id );
}
}
}
else {
$object->addFilter('primary_filter', 'PrimaryCat = 1');
}
// add permission filter
if ($this->Application->GetVar('u_id') == -1) {
// for "root" CATEGORY.VIEW permission is checked for items lists too
$view_perm = 1;
}
else {
// for any real user itemlist view permission is checked instead of CATEGORY.VIEW
$sql = 'SELECT PermissionConfigId
FROM '.TABLE_PREFIX.'PermissionConfig
WHERE PermissionName = "'.$this->Application->getUnitOption($event->Prefix, 'PermItemPrefix').'.VIEW"';
$view_perm = $this->Conn->GetOne($sql);
$groups = explode( ',', $this->Application->RecallVar('UserGroups') );
foreach($groups as $group)
{
$view_filters[] = 'FIND_IN_SET('.$group.', perm.acl)';
}
$view_filter = implode(' OR ', $view_filters);
$object->addFilter('perm_filter2', $view_filter);
}
$object->addFilter('perm_filter', 'perm.PermId = '.$view_perm);
if ( !$this->Application->IsAdmin() )
{
$object->addFilter('status_filter', $object->TableName.'.Status = 1');
if ($this->Application->getUnitOption($event->Prefix, 'UsePendingEditing')) {
// if category item uses pending editing abilities, then in no cases show pending copies on front
$object->addFilter('original_filter', '%1$s.OrgId = 0 OR %1$s.OrgId IS NULL');
}
}
else {
if ($this->Application->getUnitOption($event->Prefix, 'UsePendingEditing')) {
$pending_ids = $this->Conn->GetCol(
'SELECT OrgId FROM '.$object->TableName.'
WHERE Status = -2 AND OrgId IS NOT NULL');
if ($pending_ids) {
$object->addFilter('no_original_filter', '%1$s.'.$object->IDField.' NOT IN ('.implode(',', $pending_ids).')');
}
}
}
$types = $event->getEventParam('types');
$except_types = $event->getEventParam('except');
$type_clauses = $this->getTypeClauses($event);
// convert prepared type clauses into list filters
$includes_or_filter =& $this->Application->makeClass('kMultipleFilter');
$includes_or_filter->setType(FLT_TYPE_OR);
$excepts_and_filter =& $this->Application->makeClass('kMultipleFilter');
$excepts_and_filter->setType(FLT_TYPE_AND);
$includes_or_filter_h =& $this->Application->makeClass('kMultipleFilter');
$includes_or_filter_h->setType(FLT_TYPE_OR);
$excepts_and_filter_h =& $this->Application->makeClass('kMultipleFilter');
$excepts_and_filter_h->setType(FLT_TYPE_AND);
- $except_types_array = explode(',', $types);
-
if ($types) {
$types_array = explode(',', $types);
for ($i = 0; $i < sizeof($types_array); $i++) {
$type = trim($types_array[$i]);
if (isset($type_clauses[$type])) {
if ($type_clauses[$type]['having_filter']) {
$includes_or_filter_h->removeFilter('filter_'.$type);
$includes_or_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['include']);
}else {
$includes_or_filter->removeFilter('filter_'.$type);
$includes_or_filter->addFilter('filter_'.$type, $type_clauses[$type]['include']);
}
}
}
}
if ($except_types) {
$except_types_array = explode(',', $except_types);
for ($i = 0; $i < sizeof($except_types_array); $i++) {
$type = trim($except_types_array[$i]);
if (isset($type_clauses[$type])) {
if ($type_clauses[$type]['having_filter']) {
$excepts_and_filter_h->removeFilter('filter_'.$type);
$excepts_and_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['except']);
}else {
$excepts_and_filter->removeFilter('filter_'.$type);
$excepts_and_filter->addFilter('filter_'.$type, $type_clauses[$type]['except']);
}
}
}
}
/*if ( !$this->Application->IsAdmin() ) {
$object->addFilter('expire_filter', '%1$s.Expire IS NULL OR %1$s.Expire > UNIX_TIMESTAMP()');
}*/
/*$list_type = $event->getEventParam('ListType');
switch($list_type)
{
case 'favorites':
$fav_table = $this->Application->getUnitOption('fav','TableName');
$user_id =& $this->Application->GetVar('u_id');
$sql = 'SELECT DISTINCT f.ResourceId
FROM '.$fav_table.' f
LEFT JOIN '.$object->TableName.' p ON p.ResourceId = f.ResourceId
WHERE f.PortalUserId = '.$user_id;
$ids = $this->Conn->GetCol($sql);
if(!$ids) $ids = Array(-1);
$object->addFilter('category_filter', TABLE_PREFIX.'CategoryItems.PrimaryCat = 1');
$object->addFilter('favorites_filter', '%1$s.`ResourceId` IN ('.implode(',',$ids).')');
break;
case 'search':
$search_results_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$sql = ' SELECT DISTINCT ResourceId
FROM '.$search_results_table.'
WHERE ItemType=11';
$ids = $this->Conn->GetCol($sql);
if(!$ids) $ids = Array(-1);
$object->addFilter('search_filter', '%1$s.`ResourceId` IN ('.implode(',',$ids).')');
break;
} */
$object->addFilter('includes_filter', $includes_or_filter);
$object->addFilter('excepts_filter', $excepts_and_filter);
$object->addFilter('includes_filter_h', $includes_or_filter_h, HAVING_FILTER);
$object->addFilter('excepts_filter_h', $excepts_and_filter_h, HAVING_FILTER);
}
/**
* Adds calculates fields for item statuses
*
* @param kCatDBItem $object
* @param kEvent $event
*/
function prepareObject(&$object, &$event)
{
$this->prepareItemStatuses($event);
$object->addCalculatedField('CachedNavbar', 'l'.$this->Application->GetVar('m_lang').'_CachedNavbar');
if ($event->Special == 'export' || $event->Special == 'import')
{
$this->prepareExportColumns($event);
}
}
/**
* Creates calculated fields for all item statuses based on config settings
*
* @param kEvent $event
*/
function prepareItemStatuses(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings');
if (!$property_map) {
return ;
}
// new items
$object->addCalculatedField('IsNew', ' IF(%1$s.NewItem = 2,
IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - '.
$this->Application->ConfigValue($property_map['NewDays']).
'*3600*24), 1, 0),
%1$s.NewItem
)');
// hot items (cache updated every hour)
$sql = 'SELECT Data
FROM '.TABLE_PREFIX.'Cache
WHERE (VarName = "'.$property_map['HotLimit'].'") AND (Cached >'.(adodb_mktime() - 3600).')';
$hot_limit = $this->Conn->GetOne($sql);
if ($hot_limit === false) {
$hot_limit = $this->CalculateHotLimit($event);
}
$object->addCalculatedField('IsHot', ' IF(%1$s.HotItem = 2,
IF(%1$s.'.$property_map['ClickField'].' >= '.$hot_limit.', 1, 0),
%1$s.HotItem
)');
// popular items
$object->addCalculatedField('IsPop', ' IF(%1$s.PopItem = 2,
IF(%1$s.CachedVotesQty >= '.
$this->Application->ConfigValue($property_map['MinPopVotes']).
' AND %1$s.CachedRating >= '.
$this->Application->ConfigValue($property_map['MinPopRating']).
', 1, 0),
%1$s.PopItem)');
}
function CalculateHotLimit(&$event)
{
$property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings');
if (!$property_map) {
return;
}
$click_field = $property_map['ClickField'];
$last_hot = $this->Application->ConfigValue($property_map['MaxHotNumber']) - 1;
$sql = 'SELECT '.$click_field.' FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
ORDER BY '.$click_field.' DESC
LIMIT '.$last_hot.', 1';
$res = $this->Conn->GetCol($sql);
$hot_limit = (double)array_shift($res);
$this->Conn->Query('REPLACE INTO '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("'.$property_map['HotLimit'].'", "'.$hot_limit.'", '.adodb_mktime().')');
return $hot_limit;
return 0;
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnBeforeItemUpdate(&$event)
{
$property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings');
if (!$property_map) {
return;
}
$click_field = $property_map['ClickField'];
$object =& $event->getObject();
if( $this->Application->IsAdmin() && ($this->Application->GetVar($click_field.'_original') !== false) &&
floor($this->Application->GetVar($click_field.'_original')) != $object->GetDBField($click_field) )
{
$sql = 'SELECT MAX('.$click_field.') FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
WHERE FLOOR('.$click_field.') = '.$object->GetDBField($click_field);
$hits = ( $res = $this->Conn->GetOne($sql) ) ? $res + 0.000001 : $object->GetDBField($click_field);
$object->SetDBField($click_field, $hits);
}
}
/**
* Load price from temp table if product mode is temp table
*
* @param kEvent $event
*/
function OnAfterItemLoad(&$event)
{
$special = substr($event->Special, -6);
$object =& $event->getObject();
if ($special == 'import' || $special == 'export') {
$image_data = $object->getPrimaryImageData();
if ($image_data) {
$thumbnail_image = $image_data[$image_data['LocalThumb'] ? 'ThumbPath' : 'ThumbUrl'];
if ($image_data['SameImages']) {
$full_image = '';
}
else {
$full_image = $image_data[$image_data['LocalImage'] ? 'LocalPath' : 'Url'];
}
$object->SetDBField('ThumbnailImage', $thumbnail_image);
$object->SetDBField('FullImage', $full_image);
$object->SetDBField('ImageAlt', $image_data['AltName']);
}
}
//substituiting pending status value for pending editing
if ($object->HasField('OrgId') && $object->GetDBField('OrgId') > 0 && $object->GetDBField('Status') == -2) {
$options = $object->Fields['Status']['options'];
foreach ($options as $key => $val) {
if ($key == 2) $key = -2;
$new_options[$key] = $val;
}
$object->Fields['Status']['options'] = $new_options;
}
}
function OnAfterItemUpdate(&$event)
{
$this->CalculateHotLimit($event);
if ( substr($event->Special, -6) == 'import') {
$this->setCustomExportColumns($event);
}
}
/**
* sets values for import process
*
* @param kEvent $event
*/
function OnAfterItemCreate(&$event)
{
if ( substr($event->Special, -6) == 'import') {
$this->setCustomExportColumns($event);
}
}
/**
* Make record to search log
*
* @param string $keywords
* @param int $search_type 0 - simple search, 1 - advanced search
*/
function saveToSearchLog($keywords, $search_type = 0)
{
$sql = 'UPDATE '.TABLE_PREFIX.'SearchLog
SET Indices = Indices + 1
WHERE Keyword = '.$this->Conn->qstr($keywords).' AND SearchType = '.$search_type; // 0 - simple search, 1 - advanced search
$this->Conn->Query($sql);
if ($this->Conn->getAffectedRows() == 0) {
$fields_hash = Array('Keyword' => $keywords, 'Indices' => 1, 'SearchType' => $search_type);
$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'SearchLog');
}
}
/**
* Makes simple search for products
* based on keywords string
*
* @param kEvent $event
* @todo Change all hardcoded Products table & In-Commerce module usage to dynamic usage from item config !!!
*/
function OnSimpleSearch(&$event)
{
if($this->Application->GetVar('INPORTAL_ON') && !($this->Application->GetVar('Action') == 'm_simple_search'))
{
return;
}
$event->redirect = false;
$search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$keywords = unhtmlentities( trim($this->Application->GetVar('keywords')) );
$query_object =& $this->Application->recallObject('HTTPQuery');
$sql = 'SHOW TABLES LIKE "'.$search_table.'"';
if(!isset($query_object->Get['keywords']) &&
!isset($query_object->Post['keywords']) &&
$this->Conn->Query($sql))
{
return; // used when navigating by pages or changing sorting in search results
}
if(!$keywords || strlen($keywords) < $this->Application->ConfigValue('Search_MinKeyword_Length'))
{
$this->Conn->Query('DROP TABLE IF EXISTS '.$search_table);
$this->Application->SetVar('keywords_too_short', 1);
return; // if no or too short keyword entered, doing nothing
}
$this->Application->StoreVar('keywords', $keywords);
if (!$this->Application->GetVar('INPORTAL_ON')) {
// don't save search log, because in-portal already saved it
$this->saveToSearchLog($keywords, 0); // 0 - simple search, 1 - advanced search
}
$keywords = strtr($keywords, Array('%' => '\\%', '_' => '\\_'));
$event->setPseudoClass('_List');
$object =& $event->getObject();
$this->Application->SetVar($event->getPrefixSpecial().'_Page', 1);
$lang = $this->Application->GetVar('m_lang');
- $product_table = $this->Application->getUnitOption('p', 'TableName');
+ $items_table = $this->Application->getUnitOption($event->Prefix, 'TableName');
+ $module_name = $this->Application->findModule('Var', $event->Prefix, 'Name');
$sql = ' SELECT * FROM '.$this->Application->getUnitOption('confs', 'TableName').'
- WHERE ModuleName="In-Commerce"
+ WHERE ModuleName="'.$module_name.'"
AND SimpleSearch=1';
$search_config = $this->Conn->Query($sql, 'FieldName');
$field_list = array_keys($search_config);
$join_clauses = Array();
// field processing
$weight_sum = 0;
$alias_counter = 0;
$custom_fields = $this->Application->getUnitOption($event->Prefix, 'CustomFields');
if ($custom_fields) {
$custom_table = $this->Application->getUnitOption($event->Prefix.'-cdata', 'TableName');
- $join_clauses[] = ' LEFT JOIN '.$custom_table.' custom_data ON '.$product_table.'.ResourceId = custom_data.ResourceId';
+ $join_clauses[] = ' LEFT JOIN '.$custom_table.' custom_data ON '.$items_table.'.ResourceId = custom_data.ResourceId';
}
// what field in search config becomes what field in sql (key - new field, value - old field (from searchconfig table))
$search_config_map = Array();
foreach ($field_list as $key => $field) {
$options = $object->getFieldOptions($field);
$local_table = TABLE_PREFIX.$search_config[$field]['TableName'];
$weight_sum += $search_config[$field]['Priority']; // counting weight sum; used when making relevance clause
// processing multilingual fields
if (getArrayValue($options, 'formatter') == 'kMultiLanguage') {
$field_list[$key.'_primary'] = 'l'.$this->Application->GetDefaultLanguageId().'_'.$field;
$field_list[$key] = 'l'.$lang.'_'.$field;
if(!isset($search_config[$field]['ForeignField']))
{
$field_list[$key.'_primary'] = $local_table.'.'.$field_list[$key.'_primary'];
$search_config_map[ $field_list[$key.'_primary'] ] = $field;
}
}
// processing fields from other tables
if($foreign_field = $search_config[$field]['ForeignField'])
{
$exploded = explode(':', $foreign_field, 2);
if($exploded[0] == 'CALC')
{
unset($field_list[$key]);
continue; // ignoring having type clauses in simple search
/*$user_object =& $this->Application->recallObject('u');
$user_groups = $this->Application->RecallVar('UserGroups');
$having_list[$key] = str_replace('{PREFIX}', TABLE_PREFIX, $exploded[1]);
$join_clause = str_replace('{PREFIX}', TABLE_PREFIX, $search_config[$field]['JoinClause']);
$join_clause = str_replace('{USER_GROUPS}', $user_groups, $join_clause);
$join_clause = ' LEFT JOIN '.$join_clause;
$join_clauses[] = $join_clause;*/
}
else
{
+ $multi_lingual = false;
+ if ($exploded[0] == 'MULTI')
+ {
+ $multi_lingual = true;
+ $foreign_field = $exploded[1];
+ }
$exploded = explode('.', $foreign_field); // format: table.field_name
$foreign_table = TABLE_PREFIX.$exploded[0];
$alias_counter++;
$alias = 't'.$alias_counter;
- $field_list[$key] = $alias.'.'.$exploded[1];
- $search_config_map[ $field_list[$key] ] = $field;
+ if ($multi_lingual) {
+ $field_list[$key] = $alias.'.'.'l'.$lang.'_'.$exploded[1];
+ $field_list[$key.'_primary'] = 'l'.$this->Application->GetDefaultLanguageId().'_'.$field;
+ $search_config_map[ $field_list[$key] ] = $field;
+ $search_config_map[ $field_list[$key.'_primary'] ] = $field;
+ }
+ else {
+ $field_list[$key] = $alias.'.'.$exploded[1];
+ $search_config_map[ $field_list[$key] ] = $field;
+ }
$join_clause = str_replace('{ForeignTable}', $alias, $search_config[$field]['JoinClause']);
- $join_clause = str_replace('{LocalTable}', $product_table, $join_clause);
+ $join_clause = str_replace('{LocalTable}', $items_table, $join_clause);
$join_clauses[] = ' LEFT JOIN '.$foreign_table.' '.$alias.'
ON '.$join_clause;
}
}
else {
// processing fields from local table
if ($search_config[$field]['CustomFieldId']) {
$local_table = 'custom_data';
$field_list[$key] = 'l'.$lang.'_cust_'.array_search($field_list[$key], $custom_fields);
}
$field_list[$key] = $local_table.'.'.$field_list[$key];
$search_config_map[ $field_list[$key] ] = $field;
}
}
// keyword string processing
$search_helper =& $this->Application->recallObject('SearchHelper');
$where_clause = $search_helper->buildWhereClause($keywords, $field_list);
- $where_clause = $where_clause.' AND '.$product_table.'.Status=1';
+ $where_clause = $where_clause.' AND '.$items_table.'.Status=1';
if($this->Application->GetVar('Action') == 'm_simple_subsearch') // subsearch, In-portal
{
if( $event->getEventParam('ResultIds') )
{
- $where_clause .= ' AND '.$product_table.'.ResourceId IN ('.implode(',', $event->specificParams['ResultIds']).')';
+ $where_clause .= ' AND '.$items_table.'.ResourceId IN ('.implode(',', $event->specificParams['ResultIds']).')';
}
}
if( $event->MasterEvent && $event->MasterEvent->Name == 'OnListBuild' ) // subsearch, k4
{
if( $event->MasterEvent->getEventParam('ResultIds') )
{
- $where_clause .= ' AND '.$product_table.'.ResourceId IN ('.implode(',', $event->MasterEvent->getEventParam('ResultIds')).')';
+ $where_clause .= ' AND '.$items_table.'.ResourceId IN ('.implode(',', $event->MasterEvent->getEventParam('ResultIds')).')';
}
}
// making relevance clause
$positive_words = $search_helper->getPositiveKeywords($keywords);
$this->Application->StoreVar('highlight_keywords', serialize($positive_words));
$revelance_parts = Array();
reset($search_config);
foreach ($field_list as $field) {
$config_elem = $search_config[ $search_config_map[$field] ];
$weight = $config_elem['Priority'];
$revelance_parts[] = 'IF('.$field.' LIKE "%'.implode(' ', $positive_words).'%", '.$weight_sum.', 0)';
foreach ($positive_words as $keyword) {
$revelance_parts[] = 'IF('.$field.' LIKE "%'.$keyword.'%", '.$weight.', 0)';
}
}
- $rel_keywords = $this->Application->ConfigValue('SearchRel_Keyword_products') / 100;
- $rel_pop = $this->Application->ConfigValue('SearchRel_Pop_products') / 100;
- $rel_rating = $this->Application->ConfigValue('SearchRel_Rating_products') / 100;
+ $conf_postfix = $this->Application->getUnitOption($event->Prefix, 'SearchConfigPostfix');
+ $rel_keywords = $this->Application->ConfigValue('SearchRel_Keyword_'.$conf_postfix) / 100;
+ $rel_pop = $this->Application->ConfigValue('SearchRel_Pop_'.$conf_postfix) / 100;
+ $rel_rating = $this->Application->ConfigValue('SearchRel_Rating_'.$conf_postfix) / 100;
$relevance_clause = '('.implode(' + ', $revelance_parts).') / '.$weight_sum.' * '.$rel_keywords;
- $relevance_clause .= ' + (Hits + 1) / (MAX(Hits) + 1) * '.$rel_pop;
- $relevance_clause .= ' + (CachedRating + 1) / (MAX(CachedRating) + 1) * '.$rel_rating;
+ if ($rel_pop && isset($object->Fields['Hits'])) {
+ $relevance_clause .= ' + (Hits + 1) / (MAX(Hits) + 1) * '.$rel_pop;
+ }
+ if ($rel_rating && isset($object->Fields['CachedRating'])) {
+ $relevance_clause .= ' + (CachedRating + 1) / (MAX(CachedRating) + 1) * '.$rel_rating;
+ }
// building final search query
- if (!$this->Application->GetVar('INPORTAL_ON')) {
+ if (!$this->Application->GetVar('do_not_drop_search_table') && !$this->Application->GetVar('INPORTAL_ON')) {
$this->Conn->Query('DROP TABLE IF EXISTS '.$search_table); // erase old search table if clean k4 event
+ $this->Application->SetVar('do_not_drop_search_table', true);
}
- if ($this->Conn->Query('SHOW TABLES LIKE "'.$search_table.'"')) {
+
+ $search_table_exists = $this->Conn->Query('SHOW TABLES LIKE "'.$search_table.'"');
+ if ($search_table_exists) {
$select_intro = 'INSERT INTO '.$search_table.' (Relevance, ItemId, ResourceId, ItemType, EdPick) ';
}
else {
$select_intro = 'CREATE TABLE '.$search_table.' AS ';
}
+ $edpick_clause = $this->Application->getUnitOption($event->Prefix.'.EditorsPick', 'Fields') ? $items_table.'.EditorsPick' : '0';
+
+
$sql = $select_intro.' SELECT '.$relevance_clause.' AS Relevance,
- '.$product_table.'.ProductId AS ItemId,
- '.$product_table.'.ResourceId,
- 11 AS ItemType,
- '.$product_table.'.EditorsPick AS EdPick
+ '.$items_table.'.'.$this->Application->getUnitOption($event->Prefix, 'IDField').' AS ItemId,
+ '.$items_table.'.ResourceId,
+ '.$this->Application->getUnitOption($event->Prefix, 'ItemType').' AS ItemType,
+ '.$edpick_clause.' AS EdPick
FROM '.$object->TableName.'
'.implode(' ', $join_clauses).'
WHERE '.$where_clause.'
- GROUP BY '.$product_table.'.ProductId';
+ GROUP BY '.$items_table.'.'.$this->Application->getUnitOption($event->Prefix, 'IDField');
$res = $this->Conn->Query($sql);
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnSubSearch(&$event)
{
$search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$sql = 'SHOW TABLES LIKE "'.$search_table.'"';
if($this->Conn->Query($sql))
{
$sql = 'SELECT DISTINCT ResourceId FROM '.$search_table;
$ids = $this->Conn->GetCol($sql);
}
$event->setEventParam('ResultIds', $ids);
$event->CallSubEvent('OnSimpleSearch');
}
/**
* Enter description here...
*
* @param kEvent $event
* @todo Change all hardcoded Products table & In-Commerce module usage to dynamic usage from item config !!!
*/
function OnAdvancedSearch(&$event)
{
$query_object =& $this->Application->recallObject('HTTPQuery');
if(!isset($query_object->Post['andor']))
{
return; // used when navigating by pages or changing sorting in search results
}
$this->Application->RemoveVar('keywords');
$this->Application->RemoveVar('Search_Keywords');
$sql = ' SELECT * FROM '.$this->Application->getUnitOption('confs', 'TableName').'
WHERE ModuleName="In-Commerce"
AND AdvancedSearch=1';
$search_config = $this->Conn->Query($sql);
$lang = $this->Application->GetVar('m_lang');
$object =& $event->getObject();
$object->SetPage(1);
$user_object =& $this->Application->recallObject('u');
$product_table = $this->Application->getUnitOption('p', 'TableName');
$search_keywords = $this->Application->GetVar('value'); // will not be changed
$keywords = $this->Application->GetVar('value'); // will be changed down there
$verbs = $this->Application->GetVar('verb');
$glues = $this->Application->GetVar('andor');
$and_conditions = Array();
$or_conditions = Array();
$and_having_conditions = Array();
$or_having_conditions = Array();
$join_clauses = Array();
$highlight_keywords = Array();
$relevance_parts = Array();
$condition_patterns = Array( 'any' => '%s LIKE %s',
'contains' => '%s LIKE %s',
'notcontains' => '(NOT (%1$s LIKE %2$s) OR %1$s IS NULL)',
'is' => '%s = %s',
'isnot' => '(%1$s != %2$s OR %1$s IS NULL)');
$alias_counter = 0;
$custom_fields = $this->Application->getUnitOption($event->Prefix, 'CustomFields');
if ($custom_fields) {
$custom_table = $this->Application->getUnitOption($event->Prefix.'-cdata', 'TableName');
$join_clauses[] = ' LEFT JOIN '.$custom_table.' custom_data ON '.$product_table.'.ResourceId = custom_data.ResourceId';
}
$search_log = '';
$weight_sum = 0;
// processing fields and preparing conditions
foreach($search_config as $record)
{
$field = $record['FieldName'];
$join_clause = '';
$condition_mode = 'WHERE';
// field processing
$options = $object->getFieldOptions($field);
$local_table = TABLE_PREFIX.$record['TableName'];
$weight_sum += $record['Priority']; // counting weight sum; used when making relevance clause
// processing multilingual fields
if (getArrayValue($options, 'formatter') == 'kMultiLanguage') {
$field_name = 'l'.$lang.'_'.$field;
}
else {
$field_name = $field;
}
// processing fields from other tables
if ($foreign_field = $record['ForeignField']) {
$exploded = explode(':', $foreign_field, 2);
if($exploded[0] == 'CALC')
{
$user_groups = $this->Application->RecallVar('UserGroups');
$field_name = str_replace('{PREFIX}', TABLE_PREFIX, $exploded[1]);
$join_clause = str_replace('{PREFIX}', TABLE_PREFIX, $record['JoinClause']);
$join_clause = str_replace('{USER_GROUPS}', $user_groups, $join_clause);
$join_clause = ' LEFT JOIN '.$join_clause;
$condition_mode = 'HAVING';
}
else {
$exploded = explode('.', $foreign_field);
$foreign_table = TABLE_PREFIX.$exploded[0];
if($record['CustomFieldId']) {
$exploded[1] = 'l'.$lang.'_'.$exploded[1];
}
$alias_counter++;
$alias = 't'.$alias_counter;
$field_name = $alias.'.'.$exploded[1];
$join_clause = str_replace('{ForeignTable}', $alias, $record['JoinClause']);
$join_clause = str_replace('{LocalTable}', $product_table, $join_clause);
if($record['CustomFieldId'])
{
$join_clause .= ' AND '.$alias.'.CustomFieldId='.$record['CustomFieldId'];
}
$join_clause = ' LEFT JOIN '.$foreign_table.' '.$alias.'
ON '.$join_clause;
}
}
else
{
// processing fields from local table
if ($record['CustomFieldId']) {
$local_table = 'custom_data';
$field_name = 'l'.$lang.'_cust_'.array_search($field_name, $custom_fields);
}
$field_name = $local_table.'.'.$field_name;
}
$condition = '';
switch($record['FieldType'])
{
case 'text':
$keywords[$field] = unhtmlentities( $keywords[$field] );
if(strlen($keywords[$field]) >= $this->Application->ConfigValue('Search_MinKeyword_Length'))
{
$highlight_keywords[] = $keywords[$field];
if( in_array($verbs[$field], Array('any', 'contains', 'notcontains')) )
{
$keywords[$field] = '%'.strtr($keywords[$field], Array('%' => '\\%', '_' => '\\_')).'%';
}
$condition = sprintf( $condition_patterns[$verbs[$field]],
$field_name,
$this->Conn->qstr( $keywords[$field] ));
}
break;
case 'boolean':
if($keywords[$field] != -1)
{
$property_mappings = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings');
switch($field)
{
case 'HotItem':
$hot_limit_var = getArrayValue($property_mappings, 'HotLimit');
if($hot_limit_var)
{
$sql = 'SELECT Data FROM '.TABLE_PREFIX.'Cache WHERE VarName="'.$hot_limit_var.'"';
$hot_limit = (int)$this->Conn->GetOne($sql);
$condition = 'IF('.$product_table.'.HotItem = 2,
IF('.$product_table.'.Hits >= '.
$hot_limit.
', 1, 0), '.$product_table.'.HotItem) = '.$keywords[$field];
}
break;
case 'PopItem':
$votes2pop_var = getArrayValue($property_mappings, 'VotesToPop');
$rating2pop_var = getArrayValue($property_mappings, 'RatingToPop');
if($votes2pop_var && $rating2pop_var)
{
$condition = 'IF('.$product_table.'.PopItem = 2, IF('.$product_table.'.CachedVotesQty >= '.
$this->Application->ConfigValue($votes2pop_var).
' AND '.$product_table.'.CachedRating >= '.
$this->Application->ConfigValue($rating2pop_var).
', 1, 0), '.$product_table.'.PopItem) = '.$keywords[$field];
}
break;
case 'NewItem':
$new_days_var = getArrayValue($property_mappings, 'NewDays');
if($new_days_var)
{
$condition = 'IF('.$product_table.'.NewItem = 2,
IF('.$product_table.'.CreatedOn >= (UNIX_TIMESTAMP() - '.
$this->Application->ConfigValue($new_days_var).
'*3600*24), 1, 0), '.$product_table.'.NewItem) = '.$keywords[$field];
}
break;
case 'EditorsPick':
$condition = $product_table.'.EditorsPick = '.$keywords[$field];
break;
}
}
break;
case 'range':
$range_conditions = Array();
if($keywords[$field.'_from'] && !preg_match("/[^0-9]/i", $keywords[$field.'_from']))
{
$range_conditions[] = $field_name.' >= '.$keywords[$field.'_from'];
}
if($keywords[$field.'_to'] && !preg_match("/[^0-9]/i", $keywords[$field.'_to']))
{
$range_conditions[] = $field_name.' <= '.$keywords[$field.'_to'];
}
if($range_conditions)
{
$condition = implode(' AND ', $range_conditions);
}
break;
case 'date':
if($keywords[$field])
{
if( in_array($keywords[$field], Array('today', 'yesterday')) )
{
$current_time = getdate();
$day_begin = adodb_mktime(0, 0, 0, $current_time['mon'], $current_time['mday'], $current_time['year']);
$time_mapping = Array('today' => $day_begin, 'yesterday' => ($day_begin - 86400));
$min_time = $time_mapping[$keywords[$field]];
}
else
{
$time_mapping = Array( 'last_week' => 604800, 'last_month' => 2628000,
'last_3_months' => 7884000, 'last_6_months' => 15768000,
'last_year' => 31536000
);
$min_time = adodb_mktime() - $time_mapping[$keywords[$field]];
}
$condition = $field_name.' > '.$min_time;
}
break;
}
if($condition)
{
if($join_clause)
{
$join_clauses[] = $join_clause;
}
$relevance_parts[] = 'IF('.$condition.', '.$record['Priority'].', 0)';
if($glues[$field] == 1) // and
{
if($condition_mode == 'WHERE')
{
$and_conditions[] = $condition;
}
else
{
$and_having_conditions[] = $condition;
}
}
else // or
{
if($condition_mode == 'WHERE')
{
$or_conditions[] = $condition;
}
else
{
$or_having_conditions[] = $condition;
}
}
// create search log record
$search_log_data = Array('search_config' => $record, 'verb' => getArrayValue($verbs, $field), 'value' => ($record['FieldType'] == 'range') ? $search_keywords[$field.'_from'].'|'.$search_keywords[$field.'_to'] : $search_keywords[$field]);
$search_log[] = $this->Application->Phrase('la_Field').' "'.$this->getHuman('Field', $search_log_data).'" '.$this->getHuman('Verb', $search_log_data).' '.$this->Application->Phrase('la_Value').' '.$this->getHuman('Value', $search_log_data).' '.$this->Application->Phrase($glues[$field] == 1 ? 'lu_And' : 'lu_Or');
}
}
$search_log = implode('<br />', $search_log);
$search_log = preg_replace('/(.*) '.preg_quote($this->Application->Phrase('lu_and'), '/').'|'.preg_quote($this->Application->Phrase('lu_or'), '/').'$/is', '\\1', $search_log);
$this->saveToSearchLog($search_log, 1); // advanced search
$this->Application->StoreVar('highlight_keywords', serialize($highlight_keywords));
// making relevance clause
if($relevance_parts)
{
$rel_keywords = $this->Application->ConfigValue('SearchRel_Keyword_products') / 100;
$rel_pop = $this->Application->ConfigValue('SearchRel_Pop_products') / 100;
$rel_rating = $this->Application->ConfigValue('SearchRel_Rating_products') / 100;
$relevance_clause = '('.implode(' + ', $relevance_parts).') / '.$weight_sum.' * '.$rel_keywords;
$relevance_clause .= ' + (Hits + 1) / (MAX(Hits) + 1) * '.$rel_pop;
$relevance_clause .= ' + (CachedRating + 1) / (MAX(CachedRating) + 1) * '.$rel_rating;
}
else
{
$relevance_clause = '0';
}
// building having clause
if($or_having_conditions)
{
$and_having_conditions[] = '('.implode(' OR ', $or_having_conditions).')';
}
$having_clause = implode(' AND ', $and_having_conditions);
$having_clause = $having_clause ? ' HAVING '.$having_clause : '';
// building where clause
if($or_conditions)
{
$and_conditions[] = '('.implode(' OR ', $or_conditions).')';
}
// $and_conditions[] = $product_table.'.Status = 1';
$where_clause = implode(' AND ', $and_conditions);
if(!$where_clause)
{
if($having_clause)
{
$where_clause = '1';
}
else
{
$where_clause = '0';
$this->Application->SetVar('adv_search_error', 1);
}
}
$where_clause .= ' AND '.$product_table.'.Status = 1';
// building final search query
$search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$this->Conn->Query('DROP TABLE IF EXISTS '.$search_table);
$sql = ' CREATE TABLE '.$search_table.'
SELECT '.$relevance_clause.' AS Relevance,
'.$product_table.'.ProductId AS ItemId,
'.$product_table.'.ResourceId AS ResourceId,
11 AS ItemType,
'.$product_table.'.EditorsPick AS EdPick
FROM '.$product_table.'
'.implode(' ', $join_clauses).'
WHERE '.$where_clause.'
GROUP BY '.$product_table.'.ProductId'.
$having_clause;
$res = $this->Conn->Query($sql);
}
function getHuman($type, $search_data)
{
$type = ucfirst(strtolower($type));
extract($search_data);
switch ($type) {
case 'Field':
return $this->Application->Phrase($search_config['DisplayName']);
break;
case 'Verb':
return $verb ? $this->Application->Phrase('lu_advsearch_'.$verb) : '';
break;
case 'Value':
switch ($search_config['FieldType']) {
case 'date':
$values = Array(0 => 'lu_comm_Any', 'today' => 'lu_comm_Today',
'yesterday' => 'lu_comm_Yesterday', 'last_week' => 'lu_comm_LastWeek',
'last_month' => 'lu_comm_LastMonth', 'last_3_months' => 'lu_comm_Last3Months',
'last_6_months' => 'lu_comm_Last6Months', 'last_year' => 'lu_comm_LastYear');
$ret = $this->Application->Phrase($values[$value]);
break;
case 'range':
$value = explode('|', $value);
return $this->Application->Phrase('lu_comm_From').' "'.$value[0].'" '.$this->Application->Phrase('lu_comm_To').' "'.$value[1].'"';
break;
case 'boolean':
$values = Array(1 => 'lu_comm_Yes', 0 => 'lu_comm_No', -1 => 'lu_comm_Both');
$ret = $this->Application->Phrase($values[$value]);
break;
case 'text':
$ret = $value;
break;
}
return '"'.$ret.'"';
break;
}
}
/**
* Set's correct page for list
* based on data provided with event
*
* @param kEvent $event
* @access private
* @see OnListBuild
*/
function SetPagination(&$event)
{
// get PerPage (forced -> session -> config -> 10)
$per_page = $this->getPerPage($event);
$object =& $event->getObject();
$object->SetPerPage($per_page);
$this->Application->StoreVarDefault($event->getPrefixSpecial().'_Page', 1);
$page = $this->Application->GetVar($event->getPrefixSpecial().'_Page');
if (!$page)
{
$page = $this->Application->GetVar($event->getPrefixSpecial(true).'_Page');
}
if (!$page)
{
if( $this->Application->RewriteURLs() )
{
$page = $this->Application->GetVar($event->Prefix.'_Page');
if (!$page)
{
$page = $this->Application->RecallVar($event->Prefix.'_Page');
}
if($page) $this->Application->StoreVar($event->getPrefixSpecial().'_Page', $page);
}
else
{
$page = $this->Application->RecallVar($event->getPrefixSpecial().'_Page');
}
}
else {
$this->Application->StoreVar($event->getPrefixSpecial().'_Page', $page);
}
if( !$event->getEventParam('skip_counting') )
{
$pages = $object->GetTotalPages();
if($page > $pages)
{
$this->Application->StoreVar($event->getPrefixSpecial().'_Page', 1);
$page = 1;
}
}
/*$cur_per_page = $per_page;
$per_page = $event->getEventParam('per_page');
if ($per_page == 'list_next') {
$cur_page = $page;
$object =& $this->Application->recallObject($event->Prefix);
$object->SetPerPage(1);
$cur_item_index = $object->CurrentIndex;
$page = ($cur_page-1) * $cur_per_page + $cur_item_index + 1;
$object->SetPerPage(1);
}*/
$object->SetPage($page);
}
/* === RELATED TO IMPORT/EXPORT: BEGIN === */
/**
* Returns module folder
*
* @param kEvent $event
* @return string
*/
function getModuleFolder(&$event)
{
return $this->Application->getUnitOption($event->Prefix, 'ModuleFolder');
}
/**
* Shows export dialog
*
* @param kEvent $event
*/
function OnExport(&$event)
{
// use old fasion (in-portal) grid
$selector_name = $this->Application->getUnitOption($event->Prefix, 'CatalogSelectorName');
if ($selector_name) {
$selected_ids = $this->Application->GetVar($selector_name);
}
else {
$this->StoreSelectedIDs($event);
$selected_ids = $this->getSelectedIDs($event);
if (implode(',', $selected_ids) == '') {
// K4 fix when no ids found bad selected ids array is formed
$selected_ids = false;
}
}
$selected_cats_ids = $this->Application->GetVar('export_categories');
$this->Application->StoreVar($event->Prefix.'_export_ids', $selected_ids ? implode(',', $selected_ids) : '' );
$this->Application->StoreVar($event->Prefix.'_export_cats_ids', $selected_cats_ids);
$event->redirect = $this->getModuleFolder($event).'/export';
$redirect_params = Array( 'm_opener' => 'd',
$this->Prefix.'.export_event' => 'OnNew',
'pass' => 'all,'.$this->Prefix.'.export');
$event->setRedirectParams($redirect_params);
}
/**
* Export form validation & processing
*
* @param kEvent $event
*/
function OnExportBegin(&$event)
{
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if (!$items_info)
{
$items_info = unserialize( $this->Application->RecallVar($event->getPrefixSpecial().'_ItemsInfo') );
$this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
}
list($item_id, $field_values) = each($items_info);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->SetFieldsFromHash($field_values);
$field_values['ImportFilename'] = $object->GetDBField('ImportFilename'); //if upload formatter has renamed the file during moving !!!
$object->setID($item_id);
$this->setRequiredFields($event);
$export_object =& $this->Application->recallObject('CatItemExportHelper');
// save export/import options
if ($event->Special == 'export')
{
$export_ids = $this->Application->RecallVar($event->Prefix.'_export_ids');
$export_cats_ids = $this->Application->RecallVar($event->Prefix.'_export_cats_ids');
// used for multistep export
$field_values['export_ids'] = $export_ids ? explode(',', $export_ids) : false;
$field_values['export_cats_ids'] = $export_cats_ids ? explode(',', $export_cats_ids) : Array( $this->Application->GetVar('m_cat_id') );
}
$field_values['ExportColumns'] = $field_values['ExportColumns'] ? explode('|', substr($field_values['ExportColumns'], 1, -1) ) : Array();
$field_values['start_from'] = 0;
$export_object->saveOptions($event, $field_values);
if( $export_object->verifyOptions($event) )
{
$event->redirect = $this->getModuleFolder($event).'/'.$event->Special.'_progress';
}
else
{
// make uploaded file local & change source selection
$filename = getArrayValue($field_values, 'ImportFilename');
if ($filename) {
$this->updateImportFiles($event);
$object->SetDBField('ImportSource', 2);
$field_values['ImportSource'] = 2;
$object->SetDBField('ImportLocalFilename', $filename);
$field_values['ImportLocalFilename'] = $filename;
$export_object->saveOptions($event, $field_values);
}
$event->status = erFAIL;
$event->redirect = false;
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnExportCancel(&$event)
{
$this->OnGoBack($event);
}
/**
* Sets correct available & export fields
*
* @param kEvent $event
*/
function prepareExportColumns(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$available_columns = Array();
// category field (mixed)
$available_columns['__CATEGORY__CategoryPath'] = 'CategoryPath';
if ($event->Special == 'import') {
// category field (separated fields)
$max_level = $this->Application->ConfigValue('MaxImportCategoryLevels');
$i = 0;
while ($i < $max_level) {
$available_columns['__CATEGORY__Category'.($i + 1)] = 'Category'.($i + 1);
$i++;
}
}
// db fields
foreach ($object->Fields as $field_name => $field_options)
{
if (!$object->SkipField($field_name))
{
$available_columns[$field_name] = $field_name.(getArrayValue($field_options, 'required') ? '*' : '');
}
}
$available_columns = array_merge_recursive2($available_columns, $this->getCustomExportColumns($event));
// custom fields
foreach ($object->customFields as $custom_id => $custom_name)
{
$available_columns['__CUSTOM__'.$custom_name] = $custom_name;
}
// columns already in use
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info)
{
list($item_id, $field_values) = each($items_info);
$export_keys = $field_values['ExportColumns'];
$export_keys = $export_keys ? explode('|', substr($export_keys, 1, -1) ) : Array();
}
else {
$export_keys = Array();
}
$export_columns = Array();
foreach ($export_keys as $field_key)
{
$field_name = $this->getExportField($field_key);
$export_columns[$field_key] = $field_name;
unset($available_columns[$field_key]);
}
$options = $object->GetFieldOptions('ExportColumns');
$options['options'] = $export_columns;
$object->SetFieldOptions('ExportColumns', $options);
$options = $object->GetFieldOptions('AvailableColumns');
$options['options'] = $available_columns;
$object->SetFieldOptions('AvailableColumns', $options);
$this->updateImportFiles($event);
}
/**
* Updates uploaded files list
*
* @param kEvent $event
*/
function updateImportFiles(&$event)
{
if ($event->Special != 'import') {
return false;
}
$object =& $event->getObject();
$import_filenames = Array();
if ($folder_handle = opendir(EXPORT_PATH)) {
while (false !== ($file = readdir($folder_handle))) {
if (is_dir(EXPORT_PATH.'/'.$file) || substr($file, 0, 1) == '.' || strtolower($file) == 'cvs' || strtolower($file) == 'dummy' || filesize(EXPORT_PATH.'/'.$file) == 0) continue;
$file_size = formatSize( filesize(EXPORT_PATH.'/'.$file) );
$import_filenames[$file] = $file.' ('.$file_size.')';
}
closedir($folder_handle);
}
$options = $object->GetFieldOptions('ImportLocalFilename');
$options['options'] = $import_filenames;
$object->SetFieldOptions('ImportLocalFilename', $options);
}
/**
* Returns specific to each item type columns only
*
* @param kEvent $event
* @return Array
*/
function getCustomExportColumns(&$event)
{
return Array( '__VIRTUAL__ThumbnailImage' => 'ThumbnailImage',
'__VIRTUAL__FullImage' => 'FullImage',
'__VIRTUAL__ImageAlt' => 'ImageAlt');
}
/**
* Sets non standart virtual fields (e.g. to other tables)
*
* @param kEvent $event
*/
function setCustomExportColumns(&$event)
{
$this->restorePrimaryImage($event);
}
/**
* Create/Update primary image record in info found in imported data
*
* @param kEvent $event
*/
function restorePrimaryImage(&$event)
{
$object =& $event->getObject();
$has_image_info = $object->GetDBField('ImageAlt') && ($object->GetDBField('ThumbnailImage') || $object->GetDBField('FullImage'));
if (!$has_image_info) {
return false;
}
$image_data = $object->getPrimaryImageData();
$image =& $this->Application->recallObject('img', null, Array('skip_autoload' => true));
if ($image_data) {
$image->Load($image_data['ImageId']);
}
else {
$image->Clear();
$image->SetDBField('Name', 'main');
$image->SetDBField('DefaultImg', 1);
$image->SetDBField('ResourceId', $object->GetDBField('ResourceId'));
}
$image->SetDBField('AltName', $object->GetDBField('ImageAlt'));
if ($object->GetDBField('ThumbnailImage')) {
$thumbnail_field = $this->isURL( $object->GetDBField('ThumbnailImage') ) ? 'ThumbUrl' : 'ThumbPath';
$image->SetDBField($thumbnail_field, $object->GetDBField('ThumbnailImage') );
$image->SetDBField('LocalThumb', $thumbnail_field == 'ThumbPath' ? 1 : 0);
}
if (!$object->GetDBField('FullImage')) {
$image->SetDBField('SameImages', 1);
}
else {
$image->SetDBField('SameImages', 0);
$full_field = $this->isURL( $object->GetDBField('FullImage') ) ? 'Url' : 'LocalPath';
$image->SetDBField($full_field, $object->GetDBField('FullImage') );
$image->SetDBField('LocalImage', $full_field == 'LocalPath' ? 1 : 0);
}
if ($image->isLoaded()) {
$image->Update();
}
else {
$image->Create();
}
}
function isURL($path)
{
return preg_match('#(http|https)://(.*)#', $path);
}
// ImportLocalFilename
function getExportField($field_key)
{
$prepends = Array('__CUSTOM__', '__CATEGORY__');
foreach ($prepends as $prepend)
{
if (substr($field_key, 0, strlen($prepend) ) == $prepend)
{
$field_key = substr($field_key, strlen($prepend), strlen($field_key) );
break;
}
}
return $field_key;
}
/**
* Prepares item for import/export operations
*
* @param kEvent $event
*/
function OnNew(&$event)
{
parent::OnNew($event);
if ($event->Special != 'import' && $event->Special != 'export') return ;
$this->setRequiredFields($event);
$this->Application->StoreVar('ImportCategory', 0);
}
/**
* set required fields based on import or export params
*
* @param kEvent $event
*/
function setRequiredFields(&$event)
{
$required_fields['common'] = Array('FieldsSeparatedBy', 'LineEndings', 'CategoryFormat');
$required_fields['export'] = Array('ExportFormat', 'ExportFilename','ExportColumns');
$required_fields['import'] = Array('FieldTitles', 'ImportSource', 'CheckDuplicatesMethod'); // ImportFilename, ImportLocalFilename
$object =& $event->getObject();
if ($event->Special == 'import')
{
$import_source = Array(1 => 'ImportFilename', 2 => 'ImportLocalFilename');
$used_field = $import_source[ $object->GetDBField('ImportSource') ];
$required_fields[$event->Special][] = $used_field;
$object->Fields[$used_field]['error_field'] = 'ImportSource';
if ($object->GetDBField('FieldTitles') == 2) $required_fields[$event->Special][] = 'ExportColumns'; // manual field titles
}
$required_fields = array_merge($required_fields['common'], $required_fields[$event->Special]);
foreach ($required_fields as $required_field) {
$object->setRequired($required_field, true);
}
}
/**
* Process items selected in item_selector
*
* @param kEvent $event
*/
function OnProcessSelected(&$event)
{
$selected_ids = $this->Application->GetVar('selected_ids');
$dst_field = $this->Application->RecallVar('dst_field');
if ($dst_field == 'ItemCategory') {
// Item Edit -> Categories Tab -> New Categories
$object =& $event->getObject();
$category_ids = explode(',', $selected_ids['c']);
foreach ($category_ids as $category_id) {
$object->assignToCategory($category_id);
}
}
if ($dst_field == 'ImportCategory') {
// Tools -> Import -> Item Import -> Select Import Category
$this->Application->StoreVar('ImportCategory', $selected_ids['c']);
$this->Application->StoreVar($event->getPrefixSpecial().'_ForceNotValid', 1); // not to loose import/export values on form refresh
$this->Application->SetVar($event->getPrefixSpecial().'_id', 0);
$this->Application->SetVar($event->getPrefixSpecial().'_event', 'OnExportBegin');
$passed = $this->Application->GetVar('passed');
$this->Application->SetVar('passed', $passed.','.$event->getPrefixSpecial());
$event->setEventParam('pass_events', true);
}
$this->finalizePopup($event);
}
/**
* Saves Import/Export settings to session
*
* @param kEvent $event
*/
function OnSaveSettings(&$event)
{
$event->redirect = false;
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info) {
list($id, $field_values) = each($items_info);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->SetFieldsFromHash($field_values);
$field_values['ImportFilename'] = $object->GetDBField('ImportFilename'); //if upload formatter has renamed the file during moving !!!
$field_values['ImportSource'] = 2;
$field_values['ImportLocalFilename'] = $object->GetDBField('ImportFilename');
$items_info[$id] = $field_values;
$this->Application->StoreVar($event->getPrefixSpecial().'_ItemsInfo', serialize($items_info));
}
}
function OnCancelAction(&$event)
{
$event->redirect_params = Array('pass' => 'all,'.$event->GetPrefixSpecial());
$event->redirect = $this->Application->GetVar('cancel_template');
}
/* === RELATED TO IMPORT/EXPORT: END === */
/**
* Stores item's owner login into separate field together with id
*
* @param kEvent $event
* @param string $id_field
* @param string $cached_field
*/
function cacheItemOwner(&$event, $id_field, $cached_field)
{
$object =& $event->getObject();
$user_id = $object->GetDBField($id_field);
$options = $object->GetFieldOptions($id_field);
if (isset($options['options'][$user_id])) {
$object->SetDBField($cached_field, $options['options'][$user_id]);
}
else {
$id_field = $this->Application->getUnitOption('u', 'IDField');
$table_name = $this->Application->getUnitOption('u', 'TableName');
$sql = 'SELECT Login
FROM '.$table_name.'
WHERE '.$id_field.' = '.$user_id;
$object->SetDBField($cached_field, $this->Conn->GetOne($sql));
}
}
/**
* Saves item beeing edited into temp table
*
* @param kEvent $event
*/
function OnPreSave(&$event)
{
parent::OnPreSave($event);
$use_pending_editing = $this->Application->getUnitOption($event->Prefix, 'UsePendingEditing');
if ($event->status == erSUCCESS && $use_pending_editing) {
// decision: clone or not clone
$object =& $event->getObject();
if ($object->GetID() == 0 || $object->GetDBField('OrgId') > 0) {
// new items or cloned items shouldn't be cloned again
return true;
}
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
if ($perm_helper->ModifyCheckPermission($object->GetDBField('CreatedById'), $object->GetDBField('CategoryId'), $event->Prefix) == 2) {
// 1. clone original item
$temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$cloned_ids = $temp_handler->CloneItems($event->Prefix, $event->Special, Array($object->GetID()), null, null, null, true);
$ci_table = $this->Application->GetTempName(TABLE_PREFIX.'CategoryItems');
// 2. delete record from CategoryItems (about cloned item) that was automatically created during call of Create method of kCatDBItem
$sql = 'SELECT ResourceId
FROM '.$object->TableName.'
WHERE '.$object->IDField.' = '.$cloned_ids[0];
$clone_resource_id = $this->Conn->GetOne($sql);
$sql = 'DELETE FROM '.$ci_table.'
WHERE ItemResourceId = '.$clone_resource_id.' AND PrimaryCat = 1';
$this->Conn->Query($sql);
// 3. copy main item categoryitems to cloned item
$sql = ' INSERT INTO '.$ci_table.' (CategoryId, ItemResourceId, PrimaryCat, ItemPrefix, Filename)
SELECT CategoryId, '.$clone_resource_id.' AS ItemResourceId, PrimaryCat, ItemPrefix, Filename
FROM '.$ci_table.'
WHERE ItemResourceId = '.$object->GetDBField('ResourceId');
$this->Conn->Query($sql);
// 4. put cloned id to OrgId field of item being cloned
$sql = 'UPDATE '.$object->TableName.'
SET OrgId = '.$object->GetID().'
WHERE '.$object->IDField.' = '.$cloned_ids[0];
$this->Conn->Query($sql);
// 5. substitute id of item being cloned with clone id
$this->Application->SetVar($event->getPrefixSpecial().'_id', $cloned_ids[0]);
$selected_ids = explode(',', $this->Application->RecallVar($event->getPrefixSpecial().'_selected_ids'));
$selected_ids[ array_search($object->GetID(), $selected_ids) ] = $cloned_ids[0];
$this->Application->StoreVar($event->getPrefixSpecial().'_selected_ids', implode(',', $selected_ids));
// 6. delete original item from temp table
$temp_handler->DeleteItems($event->Prefix, $event->Special, Array($object->GetID()));
}
}
}
/**
* Sets default expiration based on module setting
*
* @param kEvent $event
*/
function OnPreCreate(&$event)
{
parent::OnPreCreate($event);
if ($event->status == erSUCCESS) {
$object =& $event->getObject();
$object->SetDBField('CreatedById', $this->Application->GetVar('u_id'));
}
}
/**
* Occures before original item of item in pending editing got deleted (for hooking only)
*
* @param kEvent $event
*/
function OnBeforeDeleteOriginal(&$event)
{
}
/**
* Apply same processing to each item beeing selected in grid
*
* @param kEvent $event
* @access private
*/
function iterateItems(&$event)
{
if ($event->Name != 'OnMassApprove' && $event->Name != 'OnMassDecline') {
return parent::iterateItems($event);
}
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$object =& $event->getObject( Array('skip_autoload' => true) );
$ids = $this->StoreSelectedIDs($event);
if ($ids) {
foreach ($ids as $id) {
$object->Load($id);
switch ($event->Name) {
case 'OnMassApprove':
$ret = $object->ApproveChanges();
break;
case 'OnMassDecline':
$ret = $object->DeclineChanges();
break;
}
if (!$ret) {
$event->status = erFAIL;
$event->redirect = false;
break;
}
}
}
}
-
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/cat_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.65
\ No newline at end of property
+1.66
\ No newline at end of property
Index: trunk/core/units/general/helpers/permissions_helper.php
===================================================================
--- trunk/core/units/general/helpers/permissions_helper.php (revision 6427)
+++ trunk/core/units/general/helpers/permissions_helper.php (revision 6428)
@@ -1,451 +1,467 @@
<?php
class kPermissionsHelper extends kHelper {
/**
* Current set of permissions for group being edited
*
* @var Array
*/
var $Permissions = Array();
function LoadPermissions($group_id, $cat_id, $type = 1)
{
$perm_table = $this->Application->getUnitOption('perm', 'TableName');
$perm_table = $this->Application->GetTempName($perm_table);
$sql = 'SELECT *
FROM '.$perm_table.'
WHERE (GroupId = '.$group_id.') AND (CatId = '.$cat_id.') AND (Type = '.$type.')';
$permissions = $this->Conn->Query($sql, 'Permission');
$this->Permissions = Array();
foreach ($permissions as $perm_name => $perm_options) {
$perm_record['value'] = $perm_options['PermissionValue'];
$perm_record['id'] = $perm_options['PermissionId'];
$this->Permissions[$perm_name] = $perm_record;
}
}
function getPermissionValue($perm_name)
{
return isset($this->Permissions[$perm_name]) ? $this->Permissions[$perm_name]['value'] : 0;
}
function getPermissionID($perm_name)
{
return isset($this->Permissions[$perm_name]) ? $this->Permissions[$perm_name]['id'] : 0;
}
/**
* This is old permission like ADMIN or LOGIN
*
* @param string $section_name
* @param string $perm_name
* @return bool
*/
function isOldPermission($section_name, $perm_name)
{
return $section_name == 'in-portal:root' && $perm_name != 'view';
}
/**
* Returns permission names to check based on event name and item prefix (main item or subitem)
*
* @param kEvent $event
* @return Array
*/
function getPermissionByEvent(&$event, $perm_mapping)
{
$top_prefix = $event->getEventParam('top_prefix');
$pefix_type = ($top_prefix == $event->Prefix) ? 'self' : 'subitem';
$perm_mapping = getArrayValue($perm_mapping, $event->Name);
if (!$perm_mapping[$pefix_type]) {
trigger_error('Permission mappings not defined for event <b>'.$top_prefix.' <- '.$event->Prefix.':'.$event->Name.'</b>', E_USER_ERROR);
}
if ($perm_mapping[$pefix_type] === true) {
// event is defined in mapping but is not checked by permissions
return true;
}
return explode('|', $perm_mapping[$pefix_type]);
}
/**
* Common event permission checking method
*
* @param kEvent $event
*/
function CheckEventPermission(&$event, $perm_mapping)
{
$section = $event->getSection();
if (preg_match('/^CATEGORY:(.*)/', $section)) {
return $this->CheckEventCategoryPermission($event, $perm_mapping);
}
$top_prefix = $event->getEventParam('top_prefix');
$check_perms = $this->getPermissionByEvent($event, $perm_mapping);
if ($check_perms === true) {
// event is defined in mapping but is not checked by permissions
return true;
}
$perm_status = false;
foreach ($check_perms as $perm_name) {
// check if at least one of required permissions is set
$perm_name = $section.'.'.$perm_name;
$perm_status = $this->CheckPermission($perm_name, 1);
if (($perm_name == $section.'.add') && $perm_status && ($top_prefix == $event->Prefix)) {
// main item, add permission allowed, but ID is > 0, then deny permission
// how to get id here
}
if ($perm_status) {
return $perm_status;
}
}
if (!$perm_status) {
if ($this->Application->isDebugMode()) {
// for debugging purposes
$event->SetRedirectParam('section', $section);
$event->SetRedirectParam('main_prefix', $top_prefix);
$event->SetRedirectParam('event_name', $event->Name);
$event->SetRedirectParam('next_template', $this->Application->GetVar('t'));
}
$event->status = erPERM_FAIL;
}
return $perm_status;
}
/**
* Checks non-system permission on event per category basis
*
* @param kEvent $event
*/
function CheckEventCategoryPermission(&$event, $event_perm_mapping)
{
// mapping between specific permissions and common permissions
$perm_mapping = Array('add' => 'ADD', 'add.pending' => 'ADD.PENDING', 'edit' => 'MODIFY', 'edit.pending' => 'MODIFY.PENDING', 'delete' => 'DELETE', 'view' => 'VIEW');
$top_prefix = $event->getEventParam('top_prefix');
$event_handler =& $this->Application->recallObject($event->Prefix.'_EventHandler');
if ($event->Prefix != $top_prefix) {
$top_event = new kEvent($top_prefix.':'.$event->Name);
$id = $event_handler->getPassedID($top_event);
}
else {
$id = $event_handler->getPassedID($event);
}
// 1. get primary category of category item
$id_field = $this->Application->getUnitOption($top_prefix, 'IDField');
$table_name = $this->Application->getUnitOption($top_prefix, 'TableName');
$ci_table = $this->Application->getUnitOption('ci', 'TableName');
if (!$id) {
// item being created -> check by current (before editing started, saved in OnPreCreate event) category permissions
$category_id = $this->Application->RecallVar('m_cat_id');
}
elseif ($top_prefix == 'c') {
$category_id = $id;
}
else {
// item being edited -> check by it's primary category permissions
$sql = 'SELECT ci.CategoryId, main_table.CreatedById
FROM '.$table_name.' main_table
LEFT JOIN '.$ci_table.' ci ON ci.ItemResourceId = main_table.ResourceId
WHERE (main_table.'.$id_field.' = '.$id.') AND (ci.PrimaryCat = 1)';
$item_info = $this->Conn->GetRow($sql);
$category_id = $item_info['CategoryId'];
$owner_id = $item_info['CreatedById'];
}
$item_prefix = $this->Application->getUnitOption($top_prefix, 'PermItemPrefix');
if (substr($event->Name, 0, 9) == 'OnPreSave') {
if ($event_handler->isNewItemCreate($event)) {
return $this->CheckPermission($item_prefix.'.ADD', 0, $category_id) ||
$this->CheckPermission($item_prefix.'.ADD.PENDING', 0, $category_id);
}
else {
return $this->CheckPermission($item_prefix.'.ADD', 0, $category_id) ||
$this->CheckPermission($item_prefix.'.ADD.PENDING', 0, $category_id) ||
$this->ModifyCheckPermission($owner_id, $category_id, $top_prefix);
}
}
$perm_status = false;
$check_perms = $this->getPermissionByEvent($event, $event_perm_mapping);
if ($check_perms === true) {
// event is defined in mapping but is not checked by permissions
return true;
}
foreach ($check_perms as $perm_name) {
// check if at least one of required permissions is set
if (!isset($perm_mapping[$perm_name])) {
// not mapped permission (e.g. advanced:approve) -> skip
continue;
}
$perm_name = $item_prefix.'.'.$perm_mapping[$perm_name];
$this->showDebug('Event <b>'.$event->Name.'</b> permission(-s): <b>'.$perm_name.'</b>', Array());
$perm_status = $this->CheckPermission($perm_name, 0, $category_id);
if ($perm_status) {
return $perm_status;
}
}
if (!$perm_status) {
$event->SetRedirectParam('index_file', 'index.php'); // because called from browse.php
if ($this->Application->isDebugMode()) {
// for debugging purposes
$event->SetRedirectParam('section', $event->getSection());
$event->SetRedirectParam('main_prefix', $top_prefix);
$event->SetRedirectParam('event_name', $event->Name);
$event->SetRedirectParam('next_template', $this->Application->GetVar('t'));
}
$event->status = erPERM_FAIL;
}
return $perm_status;
}
function showDebug($text, $params)
{
$is_ajax = $this->Application->GetVar('ajax') == 'yes' || isset($params['ajax']) || isset($params['tab_init']);
if (!$this->Application->isDebugMode() || $is_ajax) return true;
echo $text.'<br />';
}
function TagPermissionCheck($params, $tag_name)
{
$perm_prefix = getArrayValue($params, 'perm_prefix');
$perm_event = getArrayValue($params, 'perm_event');
$permission_groups = getArrayValue($params, 'permissions');
if ($permission_groups) {
// check permissions by permission names in current category
$this->showDebug('Tag <b>'.$tag_name.'</b> permission(-s): <b>'.$permission_groups.'</b>', $params);
$permission_groups = explode('|', $permission_groups);
$group_has_permission = false;
$perm_category = $this->Application->GetVar('m_cat_id');
if ($perm_prefix) {
// use primary category of item with id from {perm_prefix}_id as base for permission checking
$perm_category = $this->getPrimaryCategory($perm_prefix);
}
foreach ($permission_groups as $permission_group) {
$permissions = explode(',', $permission_group);
$has_permission = true;
foreach ($permissions as $permission) {
$has_permission = $has_permission && $this->CheckPermission($permission, isset($params['system']) && $params['system'] ? 1 : 0, $perm_category);
}
$group_has_permission = $group_has_permission || $has_permission;
if ($group_has_permission) {
return true;
}
}
return false;
}
elseif ($perm_event) {
// check permission by event name
$this->showDebug('Tag <b>'.$tag_name.'</b> permission_event: <b>'.$perm_event.'</b>', $params);
list($prefix, $event) = explode(':', $perm_event);
$event_handler =& $this->Application->recallObject($prefix.'_EventHandler');
return $event_handler->CheckPermission( new kEvent($perm_event) );
}
return true;
}
/**
* Returns item's primary category (get item_id from request)
*
* @param string $prefix
* @return int
*/
function getPrimaryCategory($prefix)
{
$id_field = $this->Application->getUnitOption($prefix, 'IDField');
$table_name = $this->Application->getUnitOption($prefix, 'TableName');
$id = $this->Application->GetVar($prefix.'_id');
if (!$id) return $this->Application->GetVar('m_cat_id');
$sql = 'SELECT ResourceId
FROM '.$table_name.'
WHERE '.$id_field.' = '.$id;
$resource_id = $this->Conn->GetOne($sql);
$sql = 'SELECT CategoryId
FROM '.$this->Application->getUnitOption('ci', 'TableName').'
WHERE ItemResourceId = '.$resource_id.' AND PrimaryCat = 1';
return $this->Conn->GetOne($sql);
}
/**
* Returns no permission template to redirect to
*
* @param Array $params
* @return Array
*/
function getPermissionTemplate($params)
{
$t = $this->Application->GetVar('t');
if ($next_t = getArrayValue($params, 'next_template')) {
$t = $next_t;
}
if (!$this->Application->LoggedIn()) {
$redirect_template = $params['login_template'];
+ if (!$redirect_template && $this->Application->IsAdmin()) $redirect_template = 'login';
$redirect_params = Array('next_template' => $t);
}
else {
if (isset($params['no_permissions_template'])) {
$redirect_template = $params['no_permissions_template'];
}
else {
$redirect_template = $this->Application->IsAdmin() ? 'no_permission' : $this->Application->ConfigValue('NoPermissionTemplate');
}
$redirect_params = $this->Application->isDebugMode() ? Array('from_template' => 1, 'perms' => $params[ isset($params['permissions']) ? 'permissions' : 'perm_event'], 'next_template' => $t) : Array();
}
if (isset($params['index_file']) && $params['index_file']) {
$redirect_params['index_file'] = $params['index_file'];
}
return Array($redirect_template, $redirect_params);
}
/**
* Check current user permissions based on it's group permissions in specified category (for non-system permissions) or just checks if system permission is set
*
* @param string $name permission name
* @param int $cat_id category id, current used if not specified
* @param int $type permission type {1 - system, 0 - per category}
* @return int
*/
function CheckPermission($name, $type = 1, $cat_id = null)
{
- if ($this->Application->GetVar('u_id') == -1) {
+ $user_id = $this->Application->GetVar('u_id');
+ return $this->CheckUserPermission($user_id, $name, $type, $cat_id);
+ }
+
+ function CheckUserPermission($user_id, $name, $type = 1, $cat_id = null)
+ {
+ if ($user_id == -1) {
// "root" is allowed anywhere
return $name == 'SYSTEM_ACCESS.READONLY' ? 0 : 1;
}
if ($type == 1) {
// "system" permission are always checked per "Home" category (ID = 0)
$cat_id = 0;
}
if (!isset($cat_id)) {
$cat_id = $this->Application->GetVar('m_cat_id');
}
$cache_key = $name.'|'.$type.'|'.$cat_id;
$perm_value = $this->Application->getCache('permissions', $cache_key);
if ($perm_value !== false) {
return $perm_value;
}
// perm cache is build only based on records in db, that's why if permission is not explicitly denied, then
// that (perm cache creator) code thinks that it is allowed & adds corresponding record and code below will
// return incorrect results
if (preg_match('/(.*)\.VIEW$/', $name) && ($type == 0)) {
// cached view permission of category: begin
$sql = 'SELECT PermissionConfigId
FROM '.TABLE_PREFIX.'PermissionConfig
WHERE PermissionName = '.$this->Conn->qstr($name);
$perm_id = $this->Conn->GetOne($sql);
$sql = 'SELECT PermId
FROM '.TABLE_PREFIX.'PermCache
WHERE (PermId = '.$perm_id.') AND (CategoryId = '.$cat_id.')';
$view_filters = Array();
- $groups = explode(',', $this->Application->RecallVar('UserGroups'));
+ if ($user_id == $this->Application->GetVar('u_id')) {
+ $groups = explode(',', $this->Application->RecallVar('UserGroups'));
+ }
+ else { // checking not current user
+ $sql = 'SELECT GroupId FROM '.TABLE_PREFIX.'UserGroup
+ WHERE (PortalUserId = '.$user_id.') AND
+ ( (MembershipExpires IS NULL) OR ( MembershipExpires >= UNIX_TIMESTAMP() ) )';
+ $groups = $this->Conn->GetCol($sql);
+ array_push($groups, $this->Application->ConfigValue('User_LoggedInGroup') );
+ }
foreach ($groups as $group) {
$view_filters[] = 'FIND_IN_SET('.$group.', ACL)';
}
$sql .= ' AND ('.implode(' OR ', $view_filters).')';
$perm_value = $this->Conn->GetOne($sql) ? 1 : 0;
$this->Application->setCache('permissions', $cache_key, $perm_value);
return $perm_value;
// cached view permission of category: end
}
if ($cat_id == 0) {
$cat_hierarchy = Array(0);
}
else {
$sql = 'SELECT ParentPath
FROM '.$this->Application->getUnitOption('c', 'TableName').'
WHERE CategoryId = '.$cat_id;
$cat_hierarchy = $this->Conn->GetOne($sql);
$cat_hierarchy = explode('|', substr($cat_hierarchy, 1, -1));
$cat_hierarchy = array_reverse($cat_hierarchy);
array_push($cat_hierarchy, 0);
}
$perm_value = 0;
$groups = $this->Application->RecallVar('UserGroups');
foreach ($cat_hierarchy as $category_id) {
$sql = 'SELECT SUM(PermissionValue)
FROM '.TABLE_PREFIX.'Permissions
WHERE Permission = "'.$name.'" AND CatId = '.$category_id.' AND GroupId IN ('.$groups.') AND Type = '.$type;
$res = $this->Conn->GetOne($sql);
if ($res !== false && !is_null($res)) {
$perm_value = $res ? 1 : 0;
break;
}
}
$this->Application->setCache('permissions', $cache_key, $perm_value);
return $perm_value;
}
/**
* Allows to check MODIFY & OWNER.MODFY +/- PENDING permission combinations on item
*
* @param int $owner_id user_id, that is owner of the item
* @param int $category_id primary category of item
* @param string $prefix prefix of item
* @return int {0 - no MODIFY permission, 1 - has MODIFY permission, 2 - has MODIFY.PENDING permission}
*/
function ModifyCheckPermission($owner_id, $category_id, $prefix)
{
$perm_prefix = $this->Application->getUnitOption($prefix, 'PermItemPrefix');
$live_modify = $this->CheckPermission($perm_prefix.'.MODIFY', ptCATEGORY, $category_id);
if ($live_modify) {
return 1;
}
else if ($this->CheckPermission($perm_prefix.'.MODIFY.PENDING', ptCATEGORY, $category_id)) {
return 2;
}
if ($owner_id == $this->Application->GetVar('u_id')) {
// user is item's OWNER -> check this permissions first
$live_modify = $this->CheckPermission($perm_prefix.'.OWNER.MODIFY', ptCATEGORY, $category_id);
if ($live_modify) {
return 1;
}
else if ($this->CheckPermission($perm_prefix.'.OWNER.MODIFY.PENDING', ptCATEGORY, $category_id)) {
return 2;
}
}
return 0;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/helpers/permissions_helper.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.18
\ No newline at end of property
+1.19
\ No newline at end of property
Index: trunk/core/units/general/helpers/mod_rewrite_helper.php
===================================================================
--- trunk/core/units/general/helpers/mod_rewrite_helper.php (revision 6427)
+++ trunk/core/units/general/helpers/mod_rewrite_helper.php (revision 6428)
@@ -1,466 +1,485 @@
<?php
class kModRewriteHelper extends kHelper {
function kModRewriteHelper()
{
parent::kHelper();
$this->HTTPQuery =& $this->Application->recallObject('HTTPQuery');
}
function SetDefaultValues(&$vars)
{
$defaults = Array('m_cat_id' => 0, 'm_cat_page' => 1, 'm_opener' => 's');
foreach ($defaults as $default_key => $default_value)
{
if ($this->HTTPQuery->Get($default_key) == null) {
$vars[$default_key] = $default_value;
}
}
}
function ProcessLanguage(&$url_parts, &$vars)
{
if (!isset($url_parts[0])) return false;
$res = false;
$url_part = array_shift($url_parts);
$sql = 'SELECT LanguageId FROM '.TABLE_PREFIX.'Language WHERE LOWER(PackName) = '.$this->Conn->qstr($url_part).' AND Enabled = 1';
$language_id = $this->Conn->GetOne($sql);
$this->Application->Phrases = new PhrasesCache();
if($language_id)
{
$vars['m_lang'] = $language_id;
$res = true;
}
- $this->Application->VerifyLanguageId();
+// $this->Application->VerifyLanguageId();
if (!$res) {
array_unshift($url_parts, $url_part);
}
return $res;
}
function ProcessTheme(&$url_parts, &$vars)
{
if (!isset($url_parts[0])) return false;
$res = false;
$url_part = array_shift($url_parts);
$sql = 'SELECT ThemeId FROM '.TABLE_PREFIX.'Theme WHERE LOWER(Name) = '.$this->Conn->qstr($url_part).' AND Enabled = 1';
$theme_id = $this->Conn->GetOne($sql);
if($theme_id)
{
$vars['m_theme'] = $theme_id;
$res = true;
}
- $this->Application->VerifyThemeId(); // verify anyway - will set default if not found!!!
+// $this->Application->VerifyThemeId(); // verify anyway - will set default if not found!!!
if (!$res) {
array_unshift($url_parts, $url_part);
}
return $res;
}
function ProcessCategory(&$url_parts, &$vars)
{
if (!isset($url_parts[0])) return false;
$res = false;
$url_part = array_shift($url_parts);
$category_id = 0;
$last_category_id = 0;
$category_path = '';
do
{
$category_path = trim($category_path.'/'.$url_part, '/');
if( preg_match('/(.*)_([\d]+)$/', $category_path, $rets) )
{
$category_path = $rets[1];
$vars['m_cat_page'] = $rets[2];
}
$category_id = $this->Conn->GetOne(
'SELECT CategoryId
FROM '.TABLE_PREFIX.'Category
WHERE Status = 1 AND NamedParentPath = '.$this->Conn->qstr($category_path));
if ($category_id !== false) {
$last_category_id = $category_id;
$url_part = array_shift($url_parts);
$res = true;
}
} while ($category_id !== false && $url_part);
$vars['m_cat_id'] = $last_category_id;
if ($url_part) {
array_unshift($url_parts, $url_part);
}
return $res;
}
+ function ProcessPage(&$url_parts, &$vars)
+ {
+ if (!is_numeric($url_parts[0]) || count($url_parts) > 1) return false;
+
+ // set module pages for all modules, since we don't know which module will need it
+ foreach ($this->Application->ModuleInfo as $module_name => $module_data)
+ {
+ $vars[ $module_data['Var'].'_id'] = 0;
+ $vars[ $module_data['Var'].'_Page'] = $url_parts[0];
+ $vars[ $module_data['Var'].'_Reviews_Page'] = 0;
+ }
+ return true;
+ }
+
function ProcessModuleIndex(&$url_parts, &$vars)
{
if ( count($url_parts) > 1) return false; // if no more parts or only 1 part left
if ( $url_parts && $url_parts[0] == 'index') { // treat index same as no parts
array_shift($url_parts);
}
if( $url_parts ) { // if parts are left, it can only be module page
if (!is_numeric($url_parts[0])) return false;
-
- // set module pages for all modules, since we don't know which module will need it
- foreach ($this->Application->ModuleInfo as $module_name => $module_data)
- {
- $vars[ $module_data['Var'].'_id'] = 0;
- $vars[ $module_data['Var'].'_Page'] = $url_parts[0];
- $vars[ $module_data['Var'].'_Reviews_Page'] = 0;
- }
+ $this->ProcessPage($url_parts, $vars);
}
// try to find CMS index page of the category
if ($this->Application->isModuleEnabled('In-CMS')) {
$sql = 'SELECT p.Path, ci.CategoryId FROM '.TABLE_PREFIX.'Pages AS p
LEFT JOIN '.TABLE_PREFIX.'CategoryItems AS ci
ON ci.ItemResourceId = p.ResourceId
WHERE
p.IsIndex = 1
AND
p.Status = 1
AND
CategoryId = '.$vars['m_cat_id'].'
AND
ci.PrimaryCat = 1';
$template_found = $this->Conn->GetRow($sql);
if ($template_found !== false) {
$vars['t'] = $template_found['Path'];
return true;
}
}
$sql = 'SELECT CachedCategoryTemplate
FROM '.TABLE_PREFIX.'Category
WHERE CategoryId = '.$vars['m_cat_id'];
$vars['t'] = $this->Conn->GetOne($sql);
if (!$vars['t']) $vars['t'] = 'index';
return true;
}
function ProcessModuleItem(&$url_parts, &$vars, $set_t=true)
{
if (preg_match('/^bb_.*/', $url_parts[0])) {
$cat_item = $this->Conn->GetRow('
SELECT c.ParentPath, c.CategoryId FROM '.TABLE_PREFIX.'Category AS c
WHERE
c.CategoryId = '.$vars['m_cat_id']);
if ($set_t) {
$item_template = $this->GetItemTemplate($cat_item, 'bb');
$vars['t'] = $item_template;
}
$this->Application->HandleEvent($bb_event, 'bb:ParseEnv', Array('url_parts' => $url_parts, 'vars' => $vars));
$vars = $bb_event->getEventParam('vars');
return 'bb';
}
if (!isset($url_parts[0])) return false;
if ( count($url_parts) != 1 ) return false;
$url_part = array_shift($url_parts);
// match module reviews page
$page = 1;
if( preg_match('/(.*)_([\d]+)$/', $url_part, $rets) )
{
$url_part = $rets[1];
$page = $rets[2];
}
// locating the item in CategoryItems by filename to detect its ItemPrefix and its category ParentPath
$cat_item = $this->Conn->GetRow('
SELECT ci.ItemResourceId, ci.ItemPrefix, c.ParentPath, ci.CategoryId FROM '.TABLE_PREFIX.'CategoryItems AS ci
LEFT JOIN '.TABLE_PREFIX.'Category AS c
ON c.CategoryId = ci.CategoryId
WHERE
ci.CategoryId = '.$vars['m_cat_id'].'
AND
ci.Filename = '.$this->Conn->qstr($url_part));
if ($cat_item !== false) { // item found
$module_prefix = $cat_item['ItemPrefix'];
$item_template = $this->GetItemTemplate($cat_item, $module_prefix);
// converting ResourceId to correpsonding Item id
$module_config = $this->Application->getUnitOptions($module_prefix);
$item_id = $this->Conn->GetOne(
'SELECT '.$module_config['IDField'].' FROM '.$module_config['TableName'].'
WHERE ResourceId = '.$cat_item['ItemResourceId']
);
if ((!$set_t || $item_template) && $item_id) {
if ($set_t) {
$vars['t'] = $item_template;
}
$vars[ $module_prefix.'_id' ] = $item_id;
$vars[ $module_prefix.'_Reviews_Page' ] = $page;
return $module_prefix;
}
}
array_unshift($url_parts, $url_part);
return false;
}
function GetItemTemplate($category, $module_prefix)
{
if (!is_array($category)) {
$category = $this->Conn->GetRow('
SELECT c.ParentPath, c.CategoryId FROM '.TABLE_PREFIX.'Category AS c
WHERE
c.CategoryId = '.$category);
}
$parent_path = implode(',',explode('|', substr($category['ParentPath'], 1, -1)));
// item template is stored in module' system custom field - need to get that field Id
$item_template_field_id = $this->Conn->GetOne(
'SELECT CustomFieldId
FROM '.TABLE_PREFIX.'CustomField
WHERE FieldName = '.$this->Conn->qstr($module_prefix.'_ItemTemplate'));
// looking for item template through cats hierarchy sorted by parent path
$query = 'SELECT ccd.l1_cust_'.$item_template_field_id.',
FIND_IN_SET(c.CategoryId, '.$this->Conn->qstr($parent_path).') AS Ord1,
c.CategoryId, c.Name, ccd.l1_cust_'.$item_template_field_id.'
FROM '.TABLE_PREFIX.'Category AS c
LEFT JOIN '.TABLE_PREFIX.'CategoryCustomData AS ccd
ON ccd.ResourceId = c.ResourceId
WHERE c.CategoryId IN ('.$parent_path.') AND ccd.l1_cust_'.$item_template_field_id.' != \'\'
ORDER BY FIND_IN_SET(c.CategoryId, '.$this->Conn->qstr($parent_path).') DESC';
$item_template = $this->Conn->GetOne($query);
return $item_template;
}
function ProcessPhisycalTemplate(&$url_parts, &$vars)
{
if (!isset($url_parts[0])) return false;
$remaining = array();
do
{
$template_path = implode('/', $url_parts);
$t_parts['path'] = dirname($template_path) == '.' ? '' : '/'.dirname($template_path);
$t_parts['file'] = basename($template_path);
$sql = 'SELECT FileId
FROM '.TABLE_PREFIX.'ThemeFiles
WHERE (FilePath = '.$this->Conn->qstr($t_parts['path']).') AND (FileName = '.$this->Conn->qstr($t_parts['file'].'.tpl').')';
// $sql = 'SELECT FileId FROM '.TABLE_PREFIX.'ThemeFiles WHERE CONCAT(FilePath, "/", FileName) = '.$this->Conn->qstr('/'.$template_path.'.tpl');
$template_found = $this->Conn->GetOne($sql);
if(!$template_found)
{
array_unshift($remaining, array_pop($url_parts));
}
} while (!$template_found && $url_parts);
$url_parts = $remaining;
if ($template_found) {
$vars['t'] = $template_path;
return true;
}
return false;
}
/**
* Checks if whole url_parts matches a whole In-CMS page
*
* @param array $url_parts
* @return boolean
*/
function ProcessVirtualTemplate(&$url_parts, &$vars)
{
- if (!isset($url_parts[0]) || !$this->Application->isModuleEnabled('In-CMS')) return false;
+ if (!isset($url_parts[0]) || !$this->Application->isModuleEnabled('In-Edit')) return false;
$template_path = implode('/', $url_parts);
$sql = 'SELECT p.PageId, ci.CategoryId FROM '.TABLE_PREFIX.'Pages AS p
LEFT JOIN '.TABLE_PREFIX.'CategoryItems AS ci
ON ci.ItemResourceId = p.ResourceId
WHERE
Path = '.$this->Conn->qstr($template_path).'
AND
ci.PrimaryCat = 1
AND
p.Status = 1';
$template_found = $this->Conn->GetRow($sql);
if ($template_found) {
$vars['m_cat_id'] = $template_found['CategoryId'];
$vars['t'] = $template_path;
return true;
}
return false;
}
function processRewriteURL()
{
$passed = array();
$url = $this->HTTPQuery->Get('_mod_rw_url_');
if( substr($url, -5) == '.html' ) $url = substr($url, 0, strlen($url) - 5 );
$restored = false;
$cache = $this->Conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "mod_rw_'.md5($url).'"');
if (false && $cache && $cache['Cached'] > 0) {
$cache = unserialize($cache['Data']);
$vars = $cache['vars'];
$passed = $cache['passed'];
$restored = true;
}
else {
$passed = array();
$vars = $this->parseRewriteURL($url,$passed);
$cache = array('vars'=>$vars,'passed'=>$passed);
$this->Conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("mod_rw_'.md5($url).'", '.$this->Conn->qstr(serialize($cache)).', '.adodb_mktime().')');
}
foreach ($vars as $name => $value)
{
$this->HTTPQuery->Set($name,$value);
}
- if ($restored) {
+// if ($restored) {
$this->InitAll();
- }
+// }
$this->HTTPQuery->finalizeParsing($passed);
}
function InitAll()
{
- $this->Application->Phrases = new PhrasesCache();
+// $this->Application->Phrases = new PhrasesCache();
$this->Application->VerifyLanguageId();
$this->Application->Phrases->Init('phrases');
$this->Application->VerifyThemeId();
}
function parseRewriteURL($url, &$passed)
{
$vars = $this->Conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "mod_rw_'.md5($url).'"');
if (false && $vars && $vars['Cached'] > 0) {
$vars = unserialize($menu['Data']);
return $vars;
}
$vars = array();
$url_parts = $url ? explode('/', $url) : Array();
$process_module = true;
if($this->HTTPQuery->Get('rewrite') == 'on' || !$url_parts)
{
$this->SetDefaultValues($vars);
}
if(!$url_parts)
{
$this->InitAll();
$vars['t'] = $this->HTTPQuery->getDefaultTemplate('');
$passed[] = 'm';
return $vars;
}
else
{
$vars['t'] = '';
}
$passed = Array('m');
$this->ProcessLanguage($url_parts, $vars);
$this->ProcessTheme($url_parts, $vars);
if ( $this->ProcessVirtualTemplate($url_parts, $vars) ) {
return $vars;
}
$this->ProcessCategory($url_parts, $vars);
-
-
if ( $this->ProcessModuleIndex($url_parts, $vars) ) {
foreach ($this->Application->ModuleInfo as $module_name => $info) {
$passed[] = $info['Var'];
}
return $vars;
}
if ( $module_prefix = $this->ProcessModuleItem($url_parts, $vars) ) {
$passed[] = $module_prefix;
return $vars;
}
/*// match module
$next_template = $this->HTTPQuery->Get('next_template');
if($url_part || $next_template)
{
if($next_template)
{
$next_template_parts = explode('/', $next_template);
$module_folder = array_shift($next_template_parts);
}
else
{
$module_folder = $url_part;
}
foreach ($this->Application->ModuleInfo as $module_name => $module_data)
{
if( trim($module_data['TemplatePath'], '/') == $module_folder )
{
$module_prefix = $module_data['Var'];
break;
}
}
}*/
if ( $this->ProcessPhisycalTemplate($url_parts, $vars) ) {
if (!$url_parts) {
return $vars;
}
}
+ if ( $this->ProcessPage($url_parts, $vars) ) {
+ return $vars;
+ }
+
if ( $module_prefix = $this->ProcessModuleItem($url_parts, $vars, false) ) {
$passed[] = $module_prefix;
return $vars;
}
+ if ( $this->Application->isModuleEnabled('In-Edit') && $this->Application->GetVar('admin') == 1) {
+ $adm_ses =& $this->Application->recallObject('Session.admin');
+ $user = $adm_ses->RecallVar('user_id');
+ $perm_helper =& $this->Application->recallObject('PermissionsHelper');
+ if ($perm_helper->CheckUserPermission($user, 'PAGE.ADD', 0)) {
+ $vars['t'] = implode('/', $url_parts);
+ return $vars;
+ }
+ }
+
$not_found = $this->Application->ConfigValue('ErrorTemplate');
$vars['t'] = $not_found ? $not_found : 'error_notfound';
header('HTTP/1.0 404 Not Found');
return $vars;
// $this->HTTPQuery->finalizeParsing($passed, $module_params);
// pass params left to module
/*$this->Application->Phrases->Init('phrases');
$passed = Array('m');
$module_params = Array();
if ( isset($module_prefix) ) {
$passed[] = $module_prefix;
$module_event = new kEvent($module_prefix.':ParseEnv', Array('url_parts' => $url_parts) );
if ($process_module) {
$this->Application->HandleEvent($module_event);
}
$item_id = $this->HTTPQuery->Get($module_prefix.'_id');
$module_params = Array($module_prefix.'_id' => $item_id ? $item_id : '0' );
if ($module_event->status == erFAIL) {
$not_found = $this->Application->ConfigValue('ErrorTemplate');
$this->HTTPQuery->Set('t', $not_found ? $not_found : 'error_notfound' );
}
}
$this->HTTPQuery->finalizeParsing($passed, $module_params);*/
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/helpers/mod_rewrite_helper.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5
\ No newline at end of property
+1.6
\ No newline at end of property
Index: trunk/core/units/general/main_event_handler.php
===================================================================
--- trunk/core/units/general/main_event_handler.php (revision 6427)
+++ trunk/core/units/general/main_event_handler.php (revision 6428)
@@ -1,125 +1,129 @@
<?php
class MainEventHandler extends kEventHandler {
/**
* Description
*
* @var kDBConnection
* @access public
*/
var $Conn;
/**
* Adds ability to address db connection
*
* @return kDBEventHandler
* @access public
*/
function MainEventHandler()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
/**
* Created url part for this module
*
* @param kEvent $event
*/
function BuildEnv(&$event)
{
$prefix_special = $event->getPrefixSpecial();
$url_params = $event->getEventParam('url_params');
$query_vars = $this->Application->getUnitOption($event->Prefix, 'QueryString');
//if pass events is off and event is not implicity passed
if ( !$event->getEventParam('pass_events') && !isset($url_params[$prefix_special.'_event']) )
{
$url_params[$prefix_special.'_event'] = ''; // remove event from url if requested
//otherwise it will use value from get_var
}
if(!$query_vars) return true;
$processed_params = Array();
foreach($query_vars as $index => $var_name)
{
//if value passed in params use it, otherwise use current from application
$var_name = $prefix_special.'_'.$var_name;
$processed_params[$var_name] = isset( $url_params[$var_name] ) ? $url_params[$var_name] : $this->Application->GetVar($var_name);
if ( isset($url_params[$var_name]) ) unset( $url_params[$var_name] );
}
$ret = '';
$default_language_id = $this->Application->GetDefaultLanguageId();
if( $processed_params['m_lang'] && ($processed_params['m_lang'] != $default_language_id) )
{
$language_name = $this->Application->getCache('language_names', $processed_params['m_lang']);
if ($language_name === false) {
$sql = 'SELECT PackName
FROM '.TABLE_PREFIX.'Language
WHERE LanguageId = '.$processed_params['m_lang'];
$language_name = $this->Conn->GetOne($sql);
$this->Application->setCache('language_names', $processed_params['m_lang'], $language_name);
}
$ret .= $language_name.'/';
}
$default_theme_id = $this->Application->GetDefaultThemeId();
if( $processed_params['m_theme'] && ($processed_params['m_theme'] != $default_theme_id) )
{
$theme_name = $this->Application->getCache('theme_names', $processed_params['m_theme']);
if ($theme_name === false) {
$sql = 'SELECT Name
FROM '.TABLE_PREFIX.'Theme
WHERE ThemeId = '.$processed_params['m_theme'];
$theme_name = $this->Conn->GetOne($sql);
$this->Application->setCache('theme_names', $processed_params['m_theme'], $theme_name);
}
$ret .= $theme_name.'/';
}
- if ($processed_params['m_cat_id'] > 0) {
+ if ($processed_params['m_cat_id'] > 0 && isset($url_params['pass_category']) && $url_params['pass_category']) {
$ret .= $this->Application->getFilename('c', $processed_params['m_cat_id']).'/';
$url_params['category_processed'] = true;
}
+ else {
+// $url_params['no_category'] = 1; // for debugging
+ }
+ unset($url_params['pass_category']); // unset it just in case
$force_page_adding = false;
if (getArrayValue($url_params, 'reset'))
{
unset($url_params['reset']);
if ($processed_params['m_cat_id'])
{
$processed_params['m_cat_page'] = 1;
$force_page_adding = true;
}
}
if( $processed_params['m_cat_page'] > 1 || $force_page_adding )
{
$ret = preg_replace('/(.*)\//', '\\1', $ret).'_'.$processed_params['m_cat_page'].'/';
}
$template = getArrayValue($url_params, 't');
$category_template = $processed_params['m_cat_id'] ? $this->Application->getCache('category_templates', $processed_params['m_cat_id']) : '';
// remove template from url if it is category index cached template
if ($template == $category_template || strtolower($template) == '__default__') {
$template = '';
}
if ($template) {
$ret .= $template.'/';
}
unset($url_params['t']);
$event->setEventParam('url_params', $url_params);
$event->setEventParam('env_string', strtolower($ret) );
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/main_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.14
\ No newline at end of property
+1.15
\ No newline at end of property
Index: trunk/core/units/general/inp_ses_storage.php
===================================================================
--- trunk/core/units/general/inp_ses_storage.php (revision 6427)
+++ trunk/core/units/general/inp_ses_storage.php (revision 6428)
@@ -1,118 +1,125 @@
<?php
class InpSession extends Session
{
function Init($prefix,$special)
{
$this->SessionTimeout = $this->Application->ConfigValue('SessionTimeout');
$path = (BASE_PATH == '') ? '/' : BASE_PATH;
- if ( $this->Application->IsAdmin() ) $path = rtrim($path, '/').'/admin';
+// if ( $this->Application->IsAdmin() ) $path = rtrim($path, '/').'/admin';
$this->SetCookiePath($path);
$cookie_name = $this->Application->ConfigValue('SessionCookieName');
- $this->SetCookieName($cookie_name ? $cookie_name : 'sid');
+ if (!$cookie_name) $cookie_name = 'sid';
+ if (($this->Application->IsAdmin() && $special !== 'front') || $special == 'admin' ) { // || $this->Application->GetVar('admin') == 1
+ $cookie_name = 'adm_'.$cookie_name;
+ }
+ $this->SetCookieName($cookie_name);
$this->SetCookieDomain(SERVER_NAME);
- if( $this->Application->IsAdmin() )
+ if( $this->Application->IsAdmin()) // && $this->Application->GetVar('admin') != 1
{
$mode = constOn('IS_INSTALL') ? smCOOKIES_ONLY : smAUTO;
}
+ /*elseif ($this->Application->IsAdmin() && $this->Application->GetVar('admin') == 1) {
+ $mode = smCOOKIES_ONLY;
+ }*/
else
{
$ses_mode = $this->Application->ConfigValue('CookieSessions');
if ($ses_mode == 2) $mode = smAUTO;
if ($ses_mode == 1) $mode = smCOOKIES_ONLY;
if ($ses_mode == 0) $mode = smGET_ONLY;
}
$this->SetMode($mode);
parent::Init($prefix,$special);
if( !$this->Application->IsAdmin() && $this->GetField('PortalUserId') <= 0 )
{
$group_list = $this->Application->ConfigValue('User_GuestGroup').','.$this->Application->ConfigValue('User_LoggedInGroup');
$this->SetField('GroupId', $this->Application->ConfigValue('User_GuestGroup'));
$this->SetField('GroupList', $group_list);
}
}
}
class InpSessionStorage extends SessionStorage {
function Init($prefix,$special)
{
parent::Init($prefix,$special);
$this->setTableName(TABLE_PREFIX.'UserSession');
$this->SessionDataTable = TABLE_PREFIX.'SessionData';
$this->setIDField('SessionKey');
$this->TimestampField = 'LastAccessed';
$this->DataValueField = 'VariableValue';
$this->DataVarField = 'VariableName';
}
function LocateSession($sid)
{
$res = parent::LocateSession($sid);
if ($res) {
$this->Expiration += $this->SessionTimeout;
}
return $res;
}
function UpdateSession(&$session)
{
$time = adodb_mktime();
// Update LastAccessed only if it's newer than 1/10 of session timeout - perfomance optimization to eliminate needless updates on every click
if ($time - $this->DirectVars['LastAccessed'] > $this->SessionTimeout/10) {
$this->SetField($session, $this->TimestampField, $time);
}
}
function StoreSession(&$session, $additional_fields = Array())
{
$fields_hash = Array( 'PortalUserId' => $this->Application->IsAdmin() ? 0 : -2, // Guest
'Language' => $this->Application->GetDefaultLanguageId(),
'Theme' => $this->Application->GetDefaultThemeId(),
'IpAddress' => $_SERVER['REMOTE_ADDR'],
'GroupList' => $this->Application->ConfigValue('User_GuestGroup'),
'CurrentTempKey'=> $session->SID,
);
parent::StoreSession($session, $fields_hash);
}
function GetExpiredSIDs()
{
$query = ' SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE '.$this->TimestampField.' < '.(adodb_mktime()-$this->SessionTimeout);
$ret = $this->Conn->GetCol($query);
if($ret) {
$this->DeleteEditTables();
}
return $ret;
}
function DeleteEditTables()
{
$tables = $this->Conn->GetCol('SHOW TABLES');
$mask_edit_table = '/'.TABLE_PREFIX.'ses_(.*)_edit_(.*)/';
$mask_search_table = '/'.TABLE_PREFIX.'ses_(.*?)_(.*)/';
$sql='SELECT COUNT(*) FROM '.$this->TableName.' WHERE '.$this->IDField.' = \'%s\'';
foreach($tables as $table)
{
if( preg_match($mask_edit_table,$table,$rets) || preg_match($mask_search_table,$table,$rets) )
{
$sid=$rets[1];
$is_alive = $this->Conn->GetOne( sprintf($sql,$sid) );
if(!$is_alive) $this->Conn->Query('DROP TABLE IF EXISTS '.$table);
}
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/inp_ses_storage.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.20
\ No newline at end of property
+1.21
\ No newline at end of property
Index: trunk/index.php
===================================================================
--- trunk/index.php (revision 6427)
+++ trunk/index.php (revision 6428)
@@ -1,23 +1,23 @@
<?php
$start = getmicrotime();
define('FULL_PATH', realpath(dirname(__FILE__)));
define('APPLICATION_CLASS', 'MyApplication');
include_once(FULL_PATH.'/kernel/kernel4/startup.php');
$application =& kApplication::Instance();
$application->Init();
$application->Run();
$application->Done();
$end = getmicrotime();
//print_pre(get_included_files());
-function getmicrotime()
-{
- list($usec, $sec) = explode(" ", microtime());
- return ((float)$usec + (float)$sec);
-}
+function getmicrotime()
+{
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+}
?>
\ No newline at end of file
Property changes on: trunk/index.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.21
\ No newline at end of property
+1.22
\ No newline at end of property
Index: trunk/tools/debug_sample.php
===================================================================
--- trunk/tools/debug_sample.php (revision 6427)
+++ trunk/tools/debug_sample.php (revision 6428)
@@ -1,90 +1,102 @@
<?php
-// define('SILENT_LOG', 1); // write all sql errors to log
-// define('DBG_REQUREST_LOG', $_SERVER['DOCUMENT_ROOT'].'/../request.log'); // write all POST/GET request log to file
+// define('DBG_IP', 'xxx.yyy.zzz.ddd'); // Define IP addreses, that are allowed to user debugger, semicolon separated. All allowed if none specified.
+// define('SILENT_LOG', 1); // Log all php errors on site to separate file (/silent_log.txt)
+// define('DBG_REQUREST_LOG', '/path/to/file');// Log all user requests to site into filename specified
+// define('DBG_SITE_PATH', '/relative_path/'); // set alternative BASE_PATH for old in-portal parts (where no K4 included)
- define('DEBUG_MODE', 1); // enable/disable debug mode
- if( defined('DEBUG_MODE') && DEBUG_MODE ) InitDebugger();
+ InitDebugger();
- //define('DBG_SITE_PATH', '/'); // set alternative BASE_PATH for old in-portal parts (where no K4 included)
-
- //define('CMS', 1); // search for missing templates on HDD in database
+ /**
+ * Allows to determine if debug is allowed by user, who is viewing site
+ *
+ * @return bool
+ */
+ function DebugAllowed()
+ {
+ $ip_addresses = defined('DBG_IP') && DBG_IP ? explode(';', DBG_IP) : Array($_SERVER['REMOTE_ADDR']);
+
+ return in_array($_SERVER['REMOTE_ADDR'], $ip_addresses) &&
+ !(defined('IS_INSTALL') && IS_INSTALL);
+ }
+ /**
+ * Performs initial debugger configuration by defining control constants
+ *
+ */
function InitDebugger()
{
- define('DBG_LOCAL_BASE_PATH', 'w:'); // replace server's DocumentRoot by this path in filenames in errors
+ if (!DebugAllowed()) {
+ // debug is not allowed
+ return false;
+ }
+ define('DEBUG_MODE', 1); // Debug mode is allowed
-// define('DBG_RAISE_ON_WARNINGS', 1); // show debugger automatically if some errors occured
- define('DBG_SQL_PROFILE',1); // profile SQL queries
- define('DBG_SQL_FAILURE', defined('IS_INSTALL') && IS_INSTALL ? 0 : 1); // assume sql errors as php fatal errors, warning otherwise
+ define('DBG_LOCAL_BASE_PATH', 'w:'); // Folder name on mapped drive, where site resides
+// define('DBG_TOOLBAR_BUTTONS', 1); // Show "Show Debugger" & "Refresh Frame" buttons (on front)
-// define('DBG_PROFILE_INCLUDES', 1);
-
- define('DBG_SHOW_HTTPQUERY', 1); // show http query content
- define('DBG_SHOW_SESSIONDATA', 1); // show session data
-
-// define('DBG_EDIT_HELP', 1); // Show help filename on help screen
-// define('DBG_HELP', 1); // Show FCK editor when viewing help screen
+// define('DBG_USE_HIGHLIGHT', 0); // Use "highlight_string" php function for debugger output formatting
+// define('DBG_RAISE_ON_WARNINGS',1); // Show debugger output in case of any non-fatal error
+ define('DBG_SQL_PROFILE',1); // Profile SQL queries
+ define('DBG_SQL_FAILURE', defined('IS_INSTALL') && IS_INSTALL ? 0 : 1); // treat sql errors as fatal errors except for installation process
+
+ define('DBG_SHOW_HTTPQUERY', 1); // Show http query content (parsed user submit, GPC)
+ define('DBG_SHOW_SESSIONDATA', 1); // Show session data (at script finish)
-// define('DBG_FORCE_THEME', 1); // Use this ThemeId, not one passed in env
- define('DBG_PHRASES', 1); // Add ability to translate phrases on the fly (K4 only)
-// define('DBG_PHRASES_HIGHLIGHT', 1); // used for phrase existance detection debugging
+ define('DBG_EDIT_HELP', 1); // Show help filename on help screen
+// define('DBG_HELP', 1); // Show FCK editor when viewing help screen
+// define('DBG_FORCE_THEME', 1); // Use this theme_id instead of one in url
+ define('DBG_PHRASES', 1); // Add ability to translate phrases on the fly (K4 templates only)
define('DBG_WINDOW_WIDTH', 700);// Set custom debugger layer width (in pixels)
-// define('DBG_CACHE', 1); // debug cache usage
-// define('DBG_REDIRECT', 1); // set this to debug get redirect attempts
- define('DBG_ZEND_PRESENT', 0); // set this to zero to debug debugger
- //define('DBG_VALIDATE_CONFIGS',1); // check that config fields match ones from database
-// define('DBG_SHOW_TAGS', 1); // show tags beeing processed
+// define('DBG_REDIRECT', 1); // Show links with redirect url instead of performing it (useful in events debugging)
+// define('DBG_ZEND_PRESENT',0); // Set to 0 to debug debugger (because debugger automatically got disabled during zend debug sessions)
+// define('DBG_VALIDATE_CONFIGS',1); // Check that config fields match ones from database
+// define('DBG_SHOW_TAGS', 1); // Show tags beeing processed
// for ADODB to work: begin
define('ADODB_OUTP', 'dbg_SQLLog');
-
- function dbg_SQLLog($msg,$new_line=false)
- {
-
- }
+ function dbg_SQLLog($msg, $new_line = false) { }
// for ADODB to work: end
function isSkipTable($sql)
{
// don't show sqls that use one or more tables from list below
static $skipTables = Array( 'PermissionConfig','SessionData','Permissions',
- 'Phrase','Cache',
+ 'Phrase','Cache','Modules','PermCache','Events',
'PersistantSessionData','EmailQueue','UserSession',
- 'ThemeFiles', 'Language');
- // ,'Modules',,'PermCache','Events''ConfigurationValues',
+ 'ThemeFiles', 'Language','ConfigurationValues');
// make exception for scripts listed below
$filename = basename($_SERVER['PHP_SELF']);
switch ($filename) {
case 'session_list.php':
$allow_tables = Array('UserSession', 'SessionData');
break;
default:
$allow_tables = Array();
break;
}
foreach ($allow_tables as $allowed_table) {
unset($skipTables[ array_search($allowed_table, $skipTables)]);
}
foreach ($skipTables as $table) {
if( tableMatch($table,$sql) ) {
return true;
}
}
return false;
}
function tableMatch($table_name,$sql)
{
static $prefix = '';
$prefix = defined('TABLE_PREFIX')?TABLE_PREFIX:GetTablePrefix();
return strpos($sql,$prefix.$table_name)!==false;
}
}
?>
Property changes on: trunk/tools/debug_sample.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.12
\ No newline at end of property
+1.13
\ No newline at end of property

Event Timeline