Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Wed, Jun 18, 11:28 AM

in-portal

This file is larger than 256 KB, so syntax highlighting was skipped.
Index: trunk/kernel/include/emailmessage.php
===================================================================
--- trunk/kernel/include/emailmessage.php (revision 8103)
+++ trunk/kernel/include/emailmessage.php (revision 8104)
@@ -1,952 +1,952 @@
<?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();
+ $esender =& $this->Application->recallObject('EmailSender');
+ /* @var $esender kEmailSendingHelper */
- $footer = $this->Get('MessageType') == 'text' ? $email_object->convertHTMLtoPlain($footer[1]) : '<br/>'.$footer[1];
+ $footer = $this->Get('MessageType') == 'text' ? $esender->ConvertToText($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;
$this->Application->InitParser();
-
+
$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())
{
// $QueueOnly - {true = put in queue, false = nd now}
-
+
$application =& kApplication::Instance();
-
+
$esender =& $application->recallObject('EmailSender');
/* @var $esender kEmailSendingHelper */
-
+
$esender->SetFrom($From, $FromName);
$esender->AddTo($ToAddr, $ToName);
- $esender->SetSubject($Subject);
+ $esender->SetSubject($Subject);
$esender->SetBody(stripslashes($Html), $Text);
-
+
// set additional headers
if (is_array($extra_headers)) {
foreach ($extra_headers as $header) {
$header = explode(':', $header, 2);
$esender->SetEncodedHeader(trim($header[0]), trim($header[1]));
}
}
-
+
// add attachment if any
if (strlen($FileName) > 0) {
if(!strlen($FileLoc)) {
$FileLoc = $FileName;
}
$esender->AddAttachment($FileLoc, basename($FileName));
}
$status = $esender->Deliver();
-
+
if ($status) {
- // write to log
+ // write to log
$fields_hash = Array (
'fromuser' => $FromName,
'addressto' => $ToName ? $ToName.' ('.$ToAddr.')' : $ToAddr,
'subject' => str_replace('Subject:', '', $Subject),
'timestamp' => adodb_mktime(),
'event' => $SendEvent,
- );
-
+ );
+
$db =& $application->GetADODBConnection();
$db->doInsert($fields_hash, TABLE_PREFIX.'EmailLog');
}
}
}
?>
Property changes on: trunk/kernel/include/emailmessage.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/kernel/include/parseditem.php
===================================================================
--- trunk/kernel/include/parseditem.php (revision 8103)
+++ trunk/kernel/include/parseditem.php (revision 8104)
@@ -1,3144 +1,3144 @@
<?php
global $ItemTypePrefixes;
$ItemTypePrefixes = array();
$ItemTagFiles = array();
function RegisterPrefix($class,$prefix,$file)
{
global $ItemTypePrefixes, $ItemTagFiles;
$ItemTypePrefixes[$class] = $prefix;
$ItemTagFiles[$prefix] = $file;
}
class clsParsedItem extends clsItemDB
{
var $TagPrefix;
var $Parser;
var $AdminParser;
function clsParsedItem($id=NULL)
{
global $TemplateRoot;
$this->clsItemDB();
$this->Parser = new clsTemplateList($TemplateRoot);
$this->AdminParser = new clsAdminTemplateList();
}
/* function ParseObject($element)
{
$extra_attribs = ExtraAttributes($element->attributes);
if(strtolower($element->name)==$this->TagPrefix)
{
$field = strtolower($element->attributes["_field"]);
$tag = $this->TagPrefix."_".$field;
$ret = $this->parsetag($tag);
}
return $ret;
}
*/
function ParseTimeStamp($d,$attribs=array())
{
global $objSession;
if (isset($attribs['_tz'])) {
$timezone = $attribs['_tz'] == 'auto' ? null : $objSession->Get('tz');
$d = GetLocalTime($d, $timezone);
}
$part = isset($attribs['_part']) ? strtolower($attribs['_part']) : '';
if ($part) {
$ret = ExtractDatePart($part,$d);
}
else {
$ret = $d <= 0 ? '' : LangDate($d);
}
return $ret;
}
function ParseObject($element)
{
global $objConfig, $objCatList, $var_list_update, $var_list, $n_var_list_update, $m_var_list_update;
$extra_attribs = ExtraAttributes($element->attributes);
$ret = "";
if ($this->TagPrefix == "email" && strtolower($element->name) == "touser") {
$this->TagPrefix = "touser";
}
if(strtolower($element->name)==$this->TagPrefix)
{
$field = strtolower($element->attributes["_field"]);
switch($field)
{
case 'primarycategorylink':
$m_var_list_update['cat'] = (int)$this->GetPrimaryCategory();
$m_var_list_update['p'] = 1;
$ret = str_replace('advanced_view.php','browse.php',$_SERVER['PHP_SELF']).'?env='.BuildEnv();
unset($m_var_list_update['cat']);
unset($m_var_list_update['p']);
return $ret;
break;
case 'primarycategory':
$db =& GetADODBConnection();
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$sql = 'SELECT '.$ml_formatter->LangFieldName('CachedNavbar').' FROM '.$objCatList->SourceTable.' WHERE CategoryId = '.(int)$this->GetPrimaryCategory();
$ret = prompt_language($objConfig->Get("Root_Name"));
if ($this->GetPrimaryCategory()) {
$ret .= ' > '.str_replace('&|&', ' > ', $db->GetOne($sql));
}
break;
case "id":
$ret = $this->Get($this->id_field);
break;
case "resourceid":
if(!$this->NoResourceId)
$ret = $this->Get("ResourceId");
break;
case "category":
$c = $objCatList->GetItem($this->Get("CategoryId"));
if(is_object($c))
{
$ret = $c->parsetag($element->attributes["_cattag"]);
}
break;
case "priority":
if($this->Get("Priority")!=0)
{
$ret = (int)$this->Get("Priority");
}
else
$ret = "";
break;
case "link":
/* if(method_exists($this,"ItemURL"))
{
$ret = $this->ItemURL($element->attributes["_template"],FALSE,"");
}
break; */
case "cat_link":
if(method_exists($this,"ItemURL"))
{
$ret = $this->ItemURL($element->attributes["_template"],TRUE,"");
}
break;
case "fullpath":
$ret = str_replace('&|&', ' &gt; ', $this->Get("CachedNavbar"));
if(!strlen($ret))
{
if(is_numeric($this->Get("CategoryId")))
{
$c = $objCatList->GetItem($this->Get("CategoryId"));
if(is_object($c))
$ret = $c->GetNavBar();
}
else
{
if(method_exists($this,"GetPrimaryCategory"))
{
$cat = $this->GetPrimaryCategory();
$c = $objCatList->GetItem($cat);
if(is_object($c))
$ret = $c->GetNavBar();
}
}
}
// $ret = $this->HighlightText($ret);
break;
case "relevance":
$style = $element->attributes["_displaymode"];
if(!strlen($style))
$style = "numerical";
switch ($style)
{
case "numerical":
$ret = (100 * LangNumber($this->Get("Relevance"),1))."%";
break;
case "bar":
$OffColor = $element->attributes["_offbackgroundcolor"];
$OnColor = $element->attributes["_onbackgroundcolor"];
$percentsOff = (int)(100 - (100 * $this->Get("Relevance"))); if ($percentsOff)
{
$percentsOn = 100 - $percentsOff;
$ret = "<td width=\"$percentsOn%\" bgcolor=\"$OnColor\"><img src=\"img/s.gif\"></td><td width=\"$percentsOff%\" bgcolor=\"$OffColor\"><img src=\"img/s.gif\"></td>";
}
else
$ret = "<td width=\"100%\" bgcolor=\"$OnColor\"><img src=\"img/s.gif\"></td>";
break;
case "graphical":
$OnImage = $element->attributes["_onimage"];
if (!strlen($OnImage))
break;
// Get image extension
$image_data = explode(".", $OnImage);
$image_ext = $image_data[count($image_data)-1];
unset($image_data[count($image_data)-1]);
$rel = (10 * LangNumber($this->Get("Relevance"),1));
$OnImage1 = join(".", $image_data);
if ($rel)
$img_src = $OnImage1."_".$rel.".".$image_ext;
else
$img_src = $OnImage;
$ret = "<img src=\"$img_src\" border=\"0\" alt=\"".(10*$rel)."\">";
break;
}
break;
case "rating":
$style = $element->GetAttributeByName("_displaymode");
if(!strlen($style))
$style = "numerical";
switch($style)
{
case "numerical":
$ret = LangNumber($this->Get("CachedRating"),1);
break;
case "text":
$ret = RatingText($this->Get("CachedRating"));
break;
case "graphical":
$OnImage = $element->attributes["_onimage"];
$OffImage = $element->attributes["_offimage"];
$images = RatingTickImage($this->Get("CachedRating"),$OnImage,$OffImage);
for($i=1;$i<=count($images);$i++)
{
$url = $images[$i];
if(strlen($url))
{
$ret .= "<IMG src=\"$url\" $extra_attribs >";
$ret .= $element->GetAttributeByName('_separator');
}
}
break;
}
break;
case "reviews":
$today = FALSE;
if(method_exists($this,"ReviewCount"))
{
if($element->GetAttributeByName("_today"))
$today = TRUE;
$ret = $this->ReviewCount($today);
$ret = ($element->GetAttributeByName("_dataexists") && empty($ret))? "" : $ret;
}
else
$ret = "";
break;
case "votes":
$ret = (int)$this->Get("CachedVotesQty");
break;
case "favorite":
if(method_exists($this,"IsFavorite"))
{
if($this->IsFavorite())
{
$ret = $element->attributes["_label"];
if(!strlen($ret))
$ret = "lu_favorite";
$ret = language($ret);
}
else
$ret = "";
}
break;
case "new":
if(method_exists($this,"IsNewItem"))
{
if($this->IsNewItem())
{
$ret = $element->GetAttributeByName('_label');
if(!strlen($ret))
$ret = "lu_new";
$ret = language($ret);
}
else
$ret = "";
}
break;
case "pop":
if(method_exists($this,"IsPopItem"))
{
if($this->IsPopItem())
{
$ret = $element->GetAttributeByName('_label');
if(!strlen($ret))
$ret = "lu_pop";
$ret = language($ret);
}
else
$ret = "";
}
break;
case "hot":
if(method_exists($this,"IsHotItem"))
{
if($this->IsHotItem())
{
$ret = $element->GetAttributeByName("_label");
if(!strlen($ret))
$ret = "lu_hot";
$ret = language($ret);
}
else
$ret = "";
}
break;
case "pick":
if($this->Get("EditorsPick")==1)
{
$ret = $element->GetAttributeByName('_label');
if(!strlen($ret))
$ret = "lu_pick";
$ret = language($ret);
}
else
$ret = "";
break;
case "admin_icon":
if(method_exists($this,"StatusIcon"))
{
if($element->GetAttributeByName("fulltag"))
{
$ret = "<IMG $extra_attribs SRC=\"".$this->StatusIcon()."\">";
}
else
$ret = $this->StatusIcon();
}
break;
case "custom":
if(method_exists($this,"GetCustomFieldValue"))
{
$field = $element->attributes["_customfield"];
$listvalue = $element->attributes["_listvalue"];
$default = $element->attributes["_default"];
if (strlen($field))
$ret = $this->GetCustomFieldValue($field, $default, $listvalue);
}
break;
case "image":
$default = $element->attributes["_primary"];
$name = $element->attributes["_name"];
if(strlen($name))
{
$img = $this->GetImageByName($name);
}
else
{
if($default)
$img = $this->GetDefaultImage();
}
if(is_object($img))
{
if(strlen($element->attributes["_imagetemplate"]))
{
$ret = $img->ParseTemplate($element->attributes["_imagetemplate"]);
break;
}
else
{
if($element->attributes["_thumbnail"])
{
$url = $img->parsetag("thumb_url");
}
else
{
if(!$element->attributes["_nothumbnail"])
{
$url = $img->parsetag("image_url");
}
else
{
$url = $img->FullURL(TRUE,"");
}
}
}
}
else
{
$url = $element->attributes["_defaulturl"];
}
if($element->attributes["_imagetag"])
{
if(strlen($url))
{
$ret = "<IMG src=\"$url\" $extra_attribs >";
}
else
$ret = "";
}
else
$ret = $url;
break;
case 'perm':
$cat_id = $this->GetPrimaryCategory();
$element->attributes['_category'] = $cat_id;
$ret = m_perm_text($element->attributes);
break;
default:
$ret = "Undefined:".$element->name;
break;
}
}
else if ($this->TagPrefix == 'email'){
$ret = "Undefined:".$element->name;
}
return $ret;
}
function ParseString($name)
{
$el = new clsHtmlTag();
$el->Clear();
$el->prefix = "inp";
$el->name = $name;
$numargs = func_num_args();
$arg_list = func_get_args();
for ($i = 1; $i < $numargs; $i++)
{
$attr = $arg_list[$i];
$parts = explode("=",$attr,2);
$name = $parts[0];
$val = $parts[1];
$el->attributes[$name] = $val;
}
return $this->ParseObject($el);
}
/* pass attributes as strings
ie: ParseStringEcho('tagname','_field="something" _data="somethingelse"');
*/
function ParseStringEcho($name)
{
$el = new clsHtmlTag();
$el->Clear();
$el->prefix = "inp";
$el->name = $name;
$numargs = func_num_args();
$arg_list = func_get_args();
for ($i = 1; $i < $numargs; $i++)
{
$attr = $arg_list[$i];
$parts = explode("=",$attr,2);
$name = $parts[0];
$val = $parts[1];
$el->attributes[$name] = $val;
}
echo $this->ParseObject($el);
}
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
{
$output = $this->ParseObject($tag);
//echo $output."<br>";
if(substr($output,0,9)=="Undefined")
{
$output = $tag->Execute();
// if(substr($output,0,8)="{Unknown")
// $output = $raw;
} return $output;
}
}
else
return "";
}
function AdminParseTemplate($file)
{
$html = "";
$t = $this->AdminParser->GetTemplate($file);
if(is_object($t))
{
array_push($this->AdminParser->stack,$file);
$html = $t->source;
$next_tag = strpos($html,"<inp:");
while($next_tag)
{
$end_tag = strpos($html,"/>",$next_tag);
$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;
$next_tag = strpos($html,"<inp:");
}
array_pop($this->AdminParser->stack);
}
return $html;
}
function ParseTemplateText($text)
{
$html = $text;
$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 ParseTemplate($tname)
{
global $objTemplate, $LogLevel,$ptime,$timestart;
//echo 'Saving ID'.$this->UniqueId().' in Main parseTempalate<br>';
//$GLOBALS[$this->TagPrefix.'_ID'] = $this->UniqueId();
LogEntry("Parsing $tname\n");
$LogLevel++;
$html = "";
$t = $objTemplate->GetTemplate($tname);
//$t = $this->Parser->GetTemplate($tname);
if( is_array($this->Parser->stack) ) $this->Parser->stack = Array();
if(is_object($t))
{
array_push($this->Parser->stack,$tname);
$html = $t->source;
$html = $this->ParseTemplateText($html);
array_pop($this->Parser->stack);
}
$LogLevel--;
LogEntry("Finished Parsing $tname\n");
$ptime = round(getmicrotime() - $timestart,6);
$xf = 867530; //Download ID
if($xf != 0)
{
$x2 = substr($ptime,-6);
$ptime .= $xf ^ $x2; //(1/1000);
}
return $html;
}
/**
* Sends EmailEvent to user
*
* @param string $EventName email event name
* @param mixed $ToUserId recipient's user_id or email address
* @param int $LangId language_id (not in use)
* @param string $RecptName recipient's name (only when ID not passed)
* @return kEvent
*/
function SendUserEventMail($EventName,$ToUserId,$LangId=NULL,$RecptName=NULL)
{
$send_params = is_numeric($ToUserId) ? Array() : Array ('to_email' => $ToUserId, 'to_name' => $RecptName);
return $this->Application->EmailEventUser($EventName, $ToUserId, $send_params);
}
function SendAdminEventMail($EventName,$LangId=NULL)
{
- return $this->Application->EmailEventAdmin($EventName);
+ return $this->Application->EmailEventAdmin($EventName);
}
function parse_template($t)
{
}
}
class clsItemCollection
{
var $Items;
var $CurrentItem;
var $adodbConnection;
var $classname;
var $SourceTable;
var $LiveTable;
var $QueryItemCount;
var $AdminSearchFields = array();
var $SortField;
var $debuglevel;
var $id_field = null; // id field for list item
var $BasePermission;
var $Dummy = null;
// enshure that same sql won't be queried twice
var $QueryDone = false;
var $LastQuerySQL = '';
var $Prefix = '';
var $Special = '';
/**
* Application object
*
* @var kApplication
*/
var $Application = null;
/**
* Connection to database
*
* @var kDBConnection
*/
var $Conn = null;
function isLiveTable()
{
global $objSession;
return !preg_match('/'.GetTablePrefix().'ses_'.$objSession->GetSessionKey().'_edit_(.*)/', $this->SourceTable);
}
function SetTable($action, $table_name = null) // new by Alex
{
// $action = {'live', 'restore','edit'}
switch($action)
{
case 'live':
$this->LiveTable = $table_name;
$this->SourceTable = $this->LiveTable;
break;
case 'restore':
$this->SourceTable = $this->LiveTable;
break;
case 'edit':
global $objSession;
$this->SourceTable = $objSession->GetEditTable($this->LiveTable);
break;
}
}
function &GetDummy() // new by Alex
{
if( !isset($this->Dummy) )
$this->Dummy =& new $this->classname();
$this->Dummy->tablename = $this->SourceTable;
return $this->Dummy;
}
function clsItemCollection()
{
if (class_exists('kApplication')) {
// just in case when aplication is not found
$this->Application =& kApplication::Instance();
$this->Conn =& $this->Application->GetADODBConnection();
}
$this->adodbConnection =& GetADODBConnection();
$this->Clear();
$this->BasePermission = '';
}
function GetIDField() // new by Alex
{
// returns id field for list item
if( !isset($this->id_field) )
{
$dummy =& $this->GetDummy();
$this->id_field = $dummy->IdField();
}
return $this->id_field;
}
function &GetNewItemClass()
{
return new $this->classname();
}
function Clear()
{
unset($this->Items);
$this->Items = array();
$this->CurrentItem=0;
}
function &SetCurrentItem($id)
{
$this->CurrentItem=$id;
return $this->GetItem($id);
}
function &GetCurrentItem()
{
if($this->CurrentItem>0)
{
return $this->GetItem($this->CurrentItem);
}
else
return FALSE;
}
function NumItems()
{
if(is_array($this->Items))
{
// echo "TEST COUNT: ".count($this->Items)."<BR>";
return count($this->Items);
}
else
return 0;
}
function ItemLike($index, $string)
{
// check if any of the item field
// even partially matches $string
$found = false;
$string = strtolower($string);
$item_data = $this->Items[$index]->GetData();
foreach($item_data as $field => $value)
if( in_array($field, $this->AdminSearchFields) )
if( strpos(strtolower($value), $string) !== false)
{
$found = true;
break;
}
return $found;
}
function DeleteItem($index) // by Alex
{
// deletes item with specific index from list
$i = $index; $item_count = $this->NumItems();
while($i < $item_count - 1)
{
$this->Items[$i] = $this->Items[$i + 1];
$i++;
}
unset($this->Items[$i]);
}
function ShowItems()
{
$i = 0; $item_count = $this->NumItems();
while($i < $item_count)
{
echo "Item No <b>$i</b>:<br>";
$this->Items[$i]->PrintVars();
$i++;
}
}
function SwapItems($Index,$Index2)
{
$temp = $this->Items[$Index]->GetData();
$this->Items[$Index]->SetData($this->Items[$Index2]->GetData());
$this->Items[$Index2]->SetData($temp);
}
function CopyResource($OldId,$NewId, $main_prefix)
{
$this->Clear();
$sql = "SELECT * FROM ".$this->SourceTable." WHERE ResourceId=$OldId";
$this->Query_Item($sql);
// echo $sql."<br>\n";
if($this->NumItems()>0)
{
foreach($this->Items as $item)
{
$item->UnsetIdField();
$item->Set("ResourceId",$NewId);
$item->Create();
}
}
}
function ItemsOnClipboard()
{
global $objSession;
$clip = $objSession->GetPersistantVariable("ClipBoard");
$count = 0;
$table = $this->SourceTable;
$prefix = GetTablePrefix();
if(substr($table,0,strlen($prefix))==$prefix)
$table = substr($table,strlen($prefix));
if(strlen($clip))
{
$clipboard = ParseClipboard($clip);
if($clipboard["table"] == $table)
{
$count = count(explode(",",$clipboard["ids"]));
}
else
$count = 0;
}
else
$count = 0;
return $count;
}
function CopyToClipboard($command,$idfield, $idlist)
{
global $objSession,$objCatList;
if(is_array($idlist))
{
$list = implode(",",$idlist);
}
else
$list = $idlist;
$clip = $command."-".$objCatList->CurrentCategoryID().".".$this->SourceTable.".$idfield=".$list;
$objSession->SetVariable("ClipBoard",$clip);
}
function SortItems($asc=TRUE)
{
$done = FALSE;
$field = $this->SortField;
$ItemCount = $this->NumItems();
while(!$done)
{
$done=TRUE;
for($i=1;$i<$this->NumItems();$i++)
{
$doswap = FALSE;
if($asc)
{
$val1 = $this->Items[$i-1]->Get($field);
$val2 = $this->Items[$i]->Get($field);
$doswap = ($val1 > $val2);
}
else
{
$val1 = $this->Items[$i-1]->Get($field);
$val2 = $this->Items[$i]->Get($field);
$doswap = ($val1 < $val2);
}
if($doswap)
{
$this->SwapItems($i-1,$i);
$done = FALSE;
}
}
}
}
function &GetItem($ID,$LoadFromDB=TRUE)
{
$found=FALSE;
if(is_array($this->Items) && count($this->Items) )
{
for($x=0;$x<count($this->Items);$x++)
{
$i =& $this->GetItemRefByIndex($x);
if($i->UniqueID()==$ID)
{
$found=TRUE;
break;
}
}
}
if(!$found)
{
if($LoadFromDB)
{
$n = NULL;
$n = new $this->classname();
$n->tablename = $this->SourceTable;
$n->LoadFromDatabase($ID);
$n->Set( $n->IdField(), $ID ); // in case if no loaded set ID anyway
$index = array_push($this->Items, $n);
$i =& $this->Items[count($this->Items)-1];
}
else
$i = FALSE;
}
return $i;
}
function GetItemByIndex($index)
{
return $this->Items[$index];
}
function &GetItemRefByIndex($index)
{
return $this->Items[$index];
}
function &GetItemByField($Field, $Value, $LoadFromDB = true)
{
if( !is_array($Field) ) $Field = Array($Field);
if( !is_array($Value) ) $Value = Array($Value);
$found = false;
if( is_array($this->Items) )
{
foreach($this->Items as $i)
{
$sub_found = true;
foreach($Field as $key_index => $field_name)
{
$sub_found = $sub_found && ( $i->Get($field_name) == $Value[$key_index] );
}
if($sub_found)
{
$found = true;
break;
}
}
}
if( !$found && $LoadFromDB == true )
{
$sql = 'SELECT * FROM '.$this->SourceTable.' WHERE ';
foreach($Field as $key_index => $field_name)
{
$sql .= '(`'.$field_name.'` = '.$this->adodbConnection->qstr($Value[$key_index]).') AND ';
}
$sql = preg_replace('/(.*) AND $/', '\\1', $sql);
$res = $this->adodbConnection->Execute($sql);
if($res && !$res->EOF)
{
$i = $this->AddItemFromArray($res->fields);
$i->tablename = $this->SourceTable;
$i->Clean();
}
else
{
$i = false;
}
}
return $i;
}
function GetPage($Page, $ItemsPerPage)
{
$result = array_slice($this->Items, ($Page * $ItemsPerPage) - $ItemsPerPage, $ItemsPerPage);
return $result;
}
function GetNumPages($ItemsPerPage)
{
if( isset($_GET['reset']) && $_GET['reset'] == 1) $this->Page = 1;
return GetPageCount($ItemsPerPage,$this->QueryItemCount);
}
function &AddItemFromArray($data, $clean=FALSE)
{
$class = new $this->classname;
$class->SetFromArray($data);
$class->tablename = $this->SourceTable;
if($clean==TRUE)
$class->Clean();
//array_push($this->Items,$class);
$this->Items[] =& $class;
return $class;
}
function Query_Item($sql, $offset=-1,$rows=-1)
{
global $Errors, $objConfig;
//echo "Method QItem [<b>".get_class($this).'</b>], sql: ['.$sql.']<br>';
$dummy =& $this->GetDummy();
if( !$dummy->TableExists() )
{
if($this->debuglevel) echo "ERROR: table <b>".$dummy->tablename."</b> missing.<br>";
$this->Clear();
return false;
}
//echo "<b>".get_class($this)."</b><br>";
//echo "Rows = $rows && Offset = $offset<br>";
if($rows>-1 && $offset>-1)
{
//print_pre(debug_backtrace());
//echo "<b>Executing SelectLimit</b> $sql <b>Offset:</b> $offset,$rows<br>\n";
$result = $this->adodbConnection->SelectLimit($sql, $rows,$offset);
}
else {
$result = $this->adodbConnection->Execute($sql);
}
if ($result === false)
{
$Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Query_Item");
if($this->debuglevel) {
echo '<br><br>'.$sql.'<br><br>';
echo "Error: ".$this->adodbConnection->ErrorMsg()."<br>";
}
$this->Clear();
return false;
}
$this->Clear();
if($this->debuglevel > 0)
{
echo "This SQL: $sql<br><br>";
if( ($this->debuglevel > 1) && ($result->RecordCount() > 0) )
{
echo '<pre>'.print_r($result->GetRows(), true).'</pre>';
$result->MoveFirst();
}
}
//echo "SQL: $sql<br><br>";
LogEntry("SQL Loop Start\n");
$count = 0;
while ($result && !$result->EOF)
{
$count++;
$data = $result->fields;
$this->AddItemFromArray($data,TRUE);
if( defined('ADODB_EXTENSION') && constant('ADODB_EXTENSION') > 0 )
adodb_movenext($result);
else
$result->MoveNext();
}
LogEntry("SQL Loop End ($count iterations)\n");
$result->Free();
return $this->Items;
}
function GetOrderClause($FieldVar,$OrderVar,$DefaultField,$DefaultVar,$Priority=TRUE,$UseTableName=FALSE)
{
global $objConfig, $objSession;
if($UseTableName)
{
$TableName = $this->SourceTable.".";
}
else
$TableName = "";
$PriorityClause = $TableName."EditorsPick DESC, ".$TableName."Priority DESC";
if(strlen(trim($FieldVar))>0)
{
if(is_object($objSession))
{
if(strlen($objSession->GetPersistantVariable($FieldVar))>0)
{
$OrderBy = trim($TableName.$objSession->GetPersistantVariable($FieldVar) . " ".
$objSession->GetPersistantVariable($OrderVar));
$FieldUsed = $objSession->GetPersistantVariable($FieldVar);
}
}
$OrderBy = trim($OrderBy);
if (strlen(trim($OrderBy))==0)
{
if(!$UseTableName)
{
$OrderBy = trim($DefaultField." ".$DefaultVar);
}
else
{
if(strlen(trim($DefaultField))>0)
{
$OrderBy = $this->SourceTable.".".$DefaultField.".".$DefaultVar;
}
$FieldUsed=$DefaultField;
}
}
}
if(($FieldUsed != "Priority" || strlen($OrderBy)==0) && $Priority==TRUE)
{
if(strlen($OrderBy)==0)
{
$OrderBy = $PriorityClause;
}
else
$OrderBy = $PriorityClause.", ".$OrderBy;
}
return $OrderBy;
}
function GetResourceIDList()
{
$ret = array();
foreach($this->Items as $i)
array_push($ret,$i->Get("ResourceId"));
return $ret;
}
function GetFieldList($field)
{
$ret = array();
foreach($this->Items as $i)
array_push($ret,$i->Get($field));
return $ret;
}
function SetCommonField($FieldName,$FieldValue)
{
for($i=0;$i<$this->NumItems();$i++)
{
$this->Items[$i]->Set($FieldName,$fieldValue);
$this->Items[$i]->Update();
}
}
function ClearCategoryItems($CatId,$CatTable = "CategoryItems")
{
$CatTable = AddTablePrefix($CatTable);
$sql = "SELECT * FROM ".$this->SourceTable." INNER JOIN $CatTable ".
" ON (".$this->SourceTable.".ResourceId=$CatTable.ItemResourceId) WHERE CategoryId=$CatId";
$this->Clear();
$this->Query_Item($sql);
if($this->NumItems()>0)
{
foreach($this->Items as $i)
{
$i->DeleteCategoryItems($CatId,$CatTable);
}
}
}
function CopyToEditTable($idfield = null, $idlist = 0)
{
global $objSession;
if($idfield == null) $idfield = $this->GetIDField();
$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);
}
function CreateEmptyEditTable($idfield = null)
{
global $objSession;
if($idfield == null) $idfield = $this->GetIDField();
$edit_table = $objSession->GetEditTable($this->SourceTable);
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
$query = "SELECT * FROM ".$this->SourceTable." WHERE $idfield = -1";
$insert = "CREATE TABLE ".$edit_table." ".$query;
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($insert,ENT_NOQUOTES)."<br>\n";
$this->adodbConnection->Execute($insert);
//echo $insert."<br>";
}
function CopyFromEditTable($idfield = null)
{
global $objSession;
$GLOBALS['_CopyFromEditTable']=1;
$dropRelTableFlag = false;
if($idfield == null) $idfield = $this->GetIDField();
$edit_table = $objSession->GetEditTable($this->SourceTable);
$sql = "SELECT * FROM $edit_table";
$rs = $this->adodbConnection->Execute($sql);
$item_ids = Array();
while ($rs && !$rs->EOF) {
$data = $rs->fields;
$c = new $this->classname;
$c->SetFromArray($data);
$c->idfield = $idfield;
$c->Dirty();
if($c->Get($idfield) < 1)
{
$old_id = $c->Get($idfield);
$c->UnsetIdField();
if(!is_numeric($c->Get("OrgId")) || $c->Get("OrgId")==0)
{
$c->Clean(array("OrgId"));
}
else
{
if($c->Get("Status") != -2)
{
$org = new $this->classname();
$org->LoadFromDatabase($c->Get("OrgId"));
$org->DeleteCustomData();
$org->Delete(TRUE);
$c->Set("OrgId",0);
}
}
$c->Create();
}
$item_ids[] = $c->UniqueId(); // save item id for future use
if(is_numeric($c->Get("ResourceId")))
{
if( isset($c->Related) && is_object($c->Related) )
{
$r = $c->Related;
$r->CopyFromEditTable($c->Get("ResourceId"));
$dropRelTableFlag = true;
}
unset($r);
if( isset($c->Reviews) && is_object($c->Reviews) )
{
$r = $c->Reviews;
$r->CopyFromEditTable($c->Get("ResourceId"),true);
}
}
if(!is_numeric($c->Get("OrgId")) || $c->Get("OrgId")==0)
{
$c->Clean(array("OrgId"));
}
else
{
if($c->Get("Status") != -2)
{
$org = new $this->classname();
$org->LoadFromDatabase($c->Get("OrgId"));
$org->DeleteCustomData();
$org->Delete(TRUE);
$c->Set("OrgId",0);
}
}
$GLOBALS['_CopyFromEditTable']=1;
if(method_exists($c,"CategoryMemberList"))
{
$cats = $c->CategoryMemberList($objSession->GetEditTable("CategoryItems"));
$ci_table = $objSession->GetEditTable('CategoryItems');
$primary_cat = $c->GetPrimaryCategory($ci_table);
$c->Update();
UpdateCategoryItems($c,$cats,$primary_cat);
}
else
$c->Update();
unset($c);
unset($r);
$rs->MoveNext();
}
$objReviews = new clsItemReviewList();
$objReviews->PurgeEditTable();
if ($dropRelTableFlag)
{
$objRelGlobal = new clsRelationshipList();
$objRelGlobal->PurgeEditTable();
}
if($edit_table) @$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS ".$objSession->GetEditTable("CategoryItems"));
unset($GLOBALS['_CopyFromEditTable']);
return $item_ids;
}
function GetNextTempID()
{
// get next temporary id (lower then zero) from temp table
$db =& $this->adodbConnection;
$sql = 'SELECT MIN(%s) AS MinValue FROM %s';
return $db->GetOne( sprintf($sql, $this->GetIDField(), $this->SourceTable) ) - 1;
}
function PurgeEditTable($idfield = null)
{
global $objSession;
if($idfield == null) $idfield = $this->GetIDField();
$edit_table = $objSession->GetEditTable($this->SourceTable);
/* $rs = $this->adodbConnection->Execute("SELECT * FROM $edit_table");
while($rs && !$rs->EOF)
{
$data = $rs->fields;
$c = new $this->classname;
$c->SetFromArray($data);
$c->id_field = $idfield;
$c->tablename = $edit_table;
$c->Delete();
$rs->MoveNext();
}*/
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS ".$objSession->GetEditTable("CategoryItems"));
}
function CopyCatListToEditTable($idfield, $idlist)
{
global $objSession;
$edit_table = $objSession->GetEditTable("CategoryItems");
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
if(is_array($idlist))
{
$list = implode(",",$idlist);
}
else
$list = $idlist;
$query = "SELECT * FROM ".GetTablePrefix()."CategoryItems 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);
}
function CreateEmptyCatListTable($idfield)
{
global $objSession;
$edit_table = $objSession->GetEditTable("CategoryItems");
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
$query = "SELECT * FROM ".GetTablePrefix()."CategoryItems WHERE $idfield = -1";
$insert = "CREATE TABLE ".$edit_table." ".$query;
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($insert,ENT_NOQUOTES)."<br>\n";
$this->adodbConnection->Execute($insert);
}
function RefreshPage($page_var, $total_items)
{
global $objConfig, $objSession;
$this->QueryItemCount = $total_items;
if ( (int)GetVar('lpn') > 0)
{
$this->Page = $_GET['lpn'];
}
elseif ($objConfig->Get($page_var))
{
$this->Page = $objConfig->Get($page_var);
}
if ( ($this->Page > $this->GetNumPages($this->PerPage) || $this->Page == 0) && ($this->PerPage != -1) )
{
$this->Page = 1;
}
$objSession->SetVariable($page_var, $this->Page);
}
function PurgeCatListEditTable()
{
global $objSession;
$edit_table = $objSession->GetEditTable("CategoryItems");
$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
}
function AdminSearchWhereClause($SearchList)
{
$sql = "";
if( !is_array($SearchList) ) $SearchList = explode(",",$SearchList);
// remove empty elements
$SearchListTmp=Array();
for($f = 0; $f < count($SearchList); $f++)
if($SearchList[$f])
$SearchListTmp[]=$SearchList[$f];
$SearchList=$SearchListTmp;
if( !count($SearchList) || !count($this->AdminSearchFields) ) return '';
for($f = 0; $f < count($SearchList); $f++)
{
$value = $SearchList[$f];
if( strlen($value) )
{
$inner_sql = "";
for($i = 0; $i < count($this->AdminSearchFields); $i++)
{
$field = $this->AdminSearchFields[$i];
if( strlen( trim($value) ) )
{
if( strlen($inner_sql) ) $inner_sql .= " OR ";
$inner_sql .= $field." LIKE '%".$value."%'";
}
}
if( strlen($inner_sql) )
{
$sql .= '('.$inner_sql.') ';
if($f < count($SearchList) - 1) $sql .= " AND ";
}
}
}
return $sql;
}
function BackupData($OutFileName,$Start,$Limit)
{
$fp=fopen($Outfile,"a");
if($fp)
{
if($Start==1)
{
$sql = "DELETE FROM ".$this->SourceTable;
fputs($fp,$sql);
}
$this->Query_Item("SELECT * FROM ".$this->SourceTable." LIMIT $Start, $Limit");
foreach($this->Items as $i)
{
$sql = $i->CreateSQL();
fputs($fp,$sql);
}
fclose($fp);
$this->Clear();
}
}
function RestoreData($InFileName,$Start,$Limit)
{
$res = -1;
$fp=fopen($InFileName,"r");
if($fp)
{
fseek($fp,$Start);
$Line = 0;
while($Line < $Limit)
{
$sql = fgets($fp,16384);
$this->adodbConnection->Execute($sql);
$Line++;
}
$res = ftell($fp);
fclose($fp);
}
return $res;
}
function Delete_Item($Id, $DetectCategories = false)
{
global $objCatList;
$l =& $this->GetItem($Id);
$l->BasePermission=$this->BasePermission;
if (!$DetectCategories) {
$l->DeleteCategoryItems($objCatList->CurrentCategoryID());
}
else {
$l->RemoveFromAllCategories();
$l->Delete();
}
}
function Move_Item($Id, $OldCat, $ParentTo)
{
global $objCatList;
$l = $this->GetItem($Id);
$l->BasePermission=$this->BasePermission;
$l->AddtoCategory($ParentTo);
$l->RemoveFromCategory($OldCat);
}
function Copy_Item($Id, $ParentTo)
{
$l = $this->GetItem($Id);
$l->BasePermission=$this->BasePermission;
$l->AddtoCategory($ParentTo);
}
}/* clsItemCollection */
class clsItemList extends clsItemCollection
{
var $Page;
var $PerPageVar;
var $DefaultPerPage; // use this perpage value in case if no found in config
var $EnablePaging;
var $MaxListCount = 0;
var $PageEnvar;
var $PageEnvarIndex;
var $ListType;
var $LastLimitClause = ''; // used to store last limit cluse used in query
function setPageFromENV()
{
$this->Page=$GLOBALS[$this->PageEnvar][$this->PageEnvarIndex];
}
function clsItemList()
{
$this->clsItemCollection();
$this->EnablePaging = TRUE;
$this->PageEnvarIndex = "p";
}
function GetPageLimitSQL()
{
global $objConfig;
$limit = NULL;
if($this->EnablePaging)
{
if($this->Page<1)
$this->Page=1;
//echo "Limited to ".$objConfig->Get($this->PerPageVar)." items per page<br>\n";
if(is_numeric($objConfig->Get($this->PerPageVar)))
{
$Start = ($this->Page-1)*$objConfig->Get($this->PerPageVar);
$limit = "LIMIT ".$Start.",".$objConfig->Get($this->PerPageVar);
}
else
$limit = NULL;
}
else
{
if($this->MaxListCount)
{
$limit = 'LIMIT 0, '.$this->MaxListCount;
}
}
return $limit;
}
function GetPageOffset()
{
$Start = 0;
if($this->EnablePaging)
{
if($this->Page < 1) $this->Page = 1;
$PerPage = $this->GetPerPage();
$Start = ($this->Page - 1) * $PerPage;
}
else
{
if((int)$this->MaxListCount == 0) $Start = -1;
}
return $Start;
}
function GetPageRowCount()
{
if($this->EnablePaging)
{
if($this->Page < 1) $this->Page = 1;
//echo "Got PerPage: ".$this->GetPerPage()."<br>";
return $this->GetPerPage();
}
else
return (int)$this->MaxListCount;
}
function Query_Item($sql,$limit = null, $fix_method = 'set_first')
{
// query itemlist (module items) using $sql specified
// apply direct limit clause ($limit) or calculate it if not specified
// fix invalid page in case if needed by method specified in $fix_method
if(strlen($limit))
{
$sql .= " ".$limit;
return parent::Query_Item($sql);
}
else
{
//echo "page fix pre (class: ".get_class($this).")<br>";
$this->QueryItemCount = QueryCount($sql); // must get total item count before fixing
$this->FixInvalidPage($fix_method);
// specially made for cats delete
if ( GetVar('Action', true) != 'm_cat_delete') {
return parent::Query_Item($sql,$this->GetPageOffset(),$this->GetPageRowCount());
}
else {
return parent::Query_Item($sql);
}
}
}
function Query_List($whereClause,$orderByClause=NULL,$JoinCats=TRUE,$fix_method='set_first')
{
global $objSession, $Errors;
if($JoinCats)
{
$cattable = GetTablePrefix()."CategoryItems";
$t = $this->SourceTable;
$sql = "SELECT *,CategoryId FROM $t INNER JOIN $cattable ON $cattable.ItemResourceId=$t.ResourceId";
}
else
$sql = "SELECT * FROM ". $this->SourceTable;
if(trim($whereClause)!="")
{
if(isset($whereClause))
$sql = sprintf('%s WHERE %s',$sql,$whereClause);
}
if(strlen($orderByClause)>0)
{
if(substr($orderByClause,0,8)=="ORDER BY")
{
$sql .= " ".$orderByClause;
}
else
{
$sql .= " ORDER BY $orderByClause";
}
}
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo $sql."<br>\n";
return $this->Query_Item($sql, null, $fix_method);
}
function GetPerPage()
{
//echo "Getting Per Page ".get_class($this)."<br>";
// return category perpage
global $objConfig;
$PerPage = $objConfig->Get( $this->PerPageVar );
if( !is_numeric($PerPage) ) $PerPage = $this->DefaultPerPage ? $this->DefaultPerPage : 10;
//print_pre(debug_backtrace());
//echo "Returning: $PerPage<br>";
return $PerPage;
}
/**
* Returns current page from env var
*
* @return int
*/
function getEnvPage()
{
$var_name = preg_replace('/(.*)_update$/', '\\1', $this->PageEnvar);
return $GLOBALS[$var_name]['p'];
}
function FixInvalidPage($fix_method = 'set_first')
{
// in case if current page > total page count,
// then set current page to last possible "set_last"
// or first possible "set_first"
$PerPage = $this->GetPerPage();
$NumPages = ceil( $this->GetNumPages($PerPage) );
/*
echo "=====<br>";
echo "Class <b>".get_class($this)."</b>: Page ".$this->Page." of $NumPages<br>";
echo "PerPage: $PerPage<br>";
echo "Items Queries: ".$this->QueryItemCount."<br>";
echo "=====<br>";
*/
// if ( $this->getEnvPage() ) $fix_method = 'set_current';
if( ($this->Page > $NumPages || $this->Page == 0) && $PerPage != -1)
{
switch($fix_method)
{
case 'set_first':
$this->Page = 1;
//echo "Move 2 First (class <b>".get_class($this)."</b>)<br>";
break;
case 'set_last':
$this->Page = $NumPages;
//echo "Move 2 Last (class <b>".get_class($this)."</b>)<br>";
break;
case 'set_current':
$this->Page = $this->getEnvPage();
//echo "Move 2 Page reflected in env (class <b>".get_class($this)."</b>)<br>";
break;
}
$this->SaveNewPage();
}
}
function SaveNewPage()
{
// redefine in each list, should save to env array new page value
}
function GetPageLinkList($dest_template=NULL,$page = "",$PagesToList=10, $HideEmpty=TRUE,$EnvSuffix = '', $extra_attributes = '')
{
global $objConfig, $var_list_update, $var_list;
$url_params = $EnvSuffix ? ExtractParams($EnvSuffix) : Array();
$v= $this->PageEnvar;
global ${$v};
// if(!strlen($page)) $page = GetIndexURL(2);
$PerPage = $objConfig->Get($this->PerPageVar);
if($PerPage < 1) $PerPage = 20;
$NumPages = ceil( $this->GetNumPages($PerPage) );
if($NumPages == 1 && $HideEmpty) return '';
$var_list_update['t'] = isset($dest_template) && $dest_template ? $dest_template : $var_list['t'];
$o = '';
if( $this->Page == 0 || !is_numeric($this->Page) ) $this->Page = 1;
if($this->Page > $NumPages) $this->Page = $NumPages;
$StartPage = (int)$this->Page - ($PagesToList / 2);
if($StartPage < 1) $StartPage = 1;
$EndPage = $StartPage + ($PagesToList - 1);
if($EndPage > $NumPages)
{
$EndPage = $NumPages;
$StartPage = $EndPage - ($PagesToList - 1);
if($StartPage < 1) $StartPage = 1;
}
$o = '';
if($StartPage > 1)
{
${$v}[$this->PageEnvarIndex] = $this->Page - $PagesToList;
$prev_url = HREF_Wrapper('', $url_params);
$o .= '<a href="'.$prev_url.'" '.$extra_attributes.'>&lt;&lt;</a>';
}
for($p = $StartPage; $p <= $EndPage; $p++)
{
if($p != $this->Page)
{
${$v}[$this->PageEnvarIndex] = $p;
$href = HREF_Wrapper('', $url_params);
$o .= ' <a href="'.$href.'"'.$extra_attributes.'>'.$p.'</a> ';
}
else
{
$o .= ' <span class="current-page">'.$p.'</span>';
}
}
if($EndPage < $NumPages && $EndPage > 0)
{
${$v}[$this->PageEnvarIndex] = $this->Page + $PagesToList;
$next_url = HREF_Wrapper('', $url_params);
$o .= '<a href="'.$next_url.'"'.$extra_attributes.'> &gt;&gt;</a>';
}
unset(${$v}[$this->PageEnvarIndex],$var_list_update["t"] );
return $o;
}
function GetAdminPageLinkList($url)
{
global $objConfig;
$update =& $GLOBALS[$this->PageEnvar]; // env_var_update
$page_backup = $update[$this->PageEnvarIndex];
// insteresting stuff :)
if(!$this->PerPageVar) $this->PerPageVar = "Perpage_Links";
$PerPage = $objConfig->Get($this->PerPageVar);
if($PerPage < 1) $PerPage = 20;
$NumPages = ceil($this->GetNumPages($PerPage));
//echo $this->CurrentPage." of ".$NumPages." Pages";
if($this->Page > $NumPages) $this->Page = $NumPages;
$StartPage = $this->Page - 5;
if($StartPage < 1) $StartPage = 1;
$EndPage = $StartPage + 9;
if($EndPage > $NumPages)
{
$EndPage = $NumPages;
$StartPage = $EndPage-9;
if($StartPage < 1) $StartPage = 1;
}
$o = '';
if($StartPage > 1)
{
$update[$this->PageEnvarIndex]= $this->Page - 10;
$prev_url = $url.'?env='.BuildEnv();
$o .= '<a href="'.$prev_url.'">&lt;&lt;</a>';
}
for($p = $StartPage; $p <= $EndPage; $p++)
{
if($p != $this->Page)
{
$update[$this->PageEnvarIndex] = $p;
$href = $url.'?env='.BuildEnv();
$o .= ' <a href="'.$href.'" class="NAV_URL">'.$p.'</a> ';
}
else
{
$o .= '<SPAN class="CURRENT_PAGE">'.$p.'</SPAN>';
}
}
if($EndPage < $NumPages)
{
$update[$this->PageEnvarIndex] = $this->Page + 10;
$next_url = $url.'?env='.BuildEnv();
$o .= '<a href="'.$next_url.'"> &gt;&gt;</a>';
}
$update[$this->PageEnvarIndex] = $page_backup;
return $o;
}
}
function ParseClipboard($clip)
{
$ret = array();
$parts = explode(".",$clip,3);
$command = $parts[0];
$table = $parts[1];
$prefix = GetTablePrefix();
if(substr($table,0,strlen($prefix))==$prefix)
$table = substr($table,strlen($prefix));
$subparts = explode("=",$parts[2],2);
$idfield = $subparts[0];
$idlist = $subparts[1];
$cmd = explode("-",$command);
$ret["command"] = $cmd[0];
$ret["source"] = $cmd[1];
$ret["table"] = $table;
$ret["idfield"] = $idfield;
$ret["ids"] = $idlist;
//print_pre($ret);
return $ret;
}
function UpdateCategoryItems($item,$NewCatList,$PrimaryCatId = false)
{
global $objCatList;
$CurrentList = explode(",",$item->CategoryMemberList());
$del_list = array();
$ins_list = array();
if(!is_array($NewCatList))
{
if(strlen(trim($NewCatList))==0)
$NewCatList = $objCatList->CurrentCategoryID();
$NewCatList = explode(",",$NewCatList);
}
//print_r($NewCatList);
for($i=0;$i<count($NewCatList);$i++)
{
$cat = $NewCatList[$i];
if(!in_array($cat,$CurrentList))
$ins_list[] = $cat;
}
for($i=0;$i<count($CurrentList);$i++)
{
$cat = $CurrentList[$i];
if(!in_array($cat,$NewCatList))
$del_list[] = $cat;
}
for($i=0;$i<count($ins_list);$i++)
{
$cat = $ins_list[$i];
$item->AddToCategory($cat);
}
for($i=0;$i<count($del_list);$i++)
{
$cat = $del_list[$i];
$item->RemoveFromCategory($cat);
}
if($PrimaryCatId !== false) $item->SetPrimaryCategory($PrimaryCatId);
}
class clsCatItemList extends clsItemList
{
var $PerPageVarLong;
var $PerPageShortVar;
var $Query_SortField;
var $Query_SortOrder;
var $ItemType;
function clsCatItemList()
{
$this->ClsItemList();
$this->Query_SortField = array();
$this->Query_SortOrder = array();
}
function QueryOrderByClause($EditorsPick=FALSE,$Priority=FALSE,$UseTableName=FALSE)
{
global $objSession;
if($UseTableName)
{
$TableName = $this->SourceTable.".";
}
else {
$TableName = "";
}
$Orders = array();
if($EditorsPick)
{
$Orders[] = $TableName."EditorsPick DESC";
}
if($Priority)
{
$Orders[] = $TableName."Priority DESC";
}
if(count($this->Query_SortField)>0)
{
for($x = 0; $x < count($this->Query_SortField); $x++)
{
$FieldVar = $this->Query_SortField[$x];
$OrderVar = $this->Query_SortOrder[$x];
if(is_object($objSession))
{
$FieldVarData = $objSession->GetPersistantVariable($FieldVar);
//echo "FieldVar: $FieldVar<br>";
if(strlen($FieldVarData)>0)
{
$Orders[] = trim($TableName.$objSession->GetPersistantVariable($FieldVar) . " ".
$objSession->GetPersistantVariable($OrderVar));
}
}
}
}
if(count($Orders)>0)
{
$OrderBy = "ORDER BY ".implode(", ",$Orders);
}
else
$OrderBy="";
//echo "ORDER BY: $OrderBy<br>";
return $OrderBy;
}
function AddSortField($SortField, $SortOrder)
{
if(strlen($SortField))
{
$this->Query_SortField[] = $SortField;
$this->Query_SortOrder[] = $SortOrder;
}
}
function ClearSortFields()
{
$this->Query_SortField = array();
$this->Query_SortOrder = array();
}
/* skeletons in this closet */
function GetNewValue($CatId=NULL)
{
return 0;
}
function GetPopValue($CategoryId=NULL)
{
return 0;
}
/* end of skeletons */
function GetCountSQL($PermName,$CatId=NULL, $GroupId=NULL, $AdditonalWhere="")
{
global $objSession, $objPermissions, $objCatList;
$ltable = $this->SourceTable;
$acl = $objSession->GetACLClause();
$cattable = GetTablePrefix()."CategoryItems";
$CategoryTable = GetTablePrefix()."Category";
$ptable = GetTablePrefix()."PermCache";
$VIEW = $objPermissions->GetPermId($PermName);
$sql = "SELECT count(*) as CacheVal FROM $ltable ";
$sql .="INNER JOIN $cattable ON ($cattable.ItemResourceId=$ltable.ResourceId) ";
$sql .="INNER JOIN $CategoryTable ON ($CategoryTable.CategoryId=$cattable.CategoryId) ";
$sql .="INNER JOIN $ptable ON ($cattable.CategoryId=$ptable.CategoryId) ";
$sql .="WHERE ($acl AND PermId=$VIEW AND $cattable.PrimaryCat=1 AND $CategoryTable.Status=1) ";
if(strlen($AdditonalWhere)>0)
{
$sql .= "AND (".$AdditonalWhere.")";
}
return $sql;
}
function SqlCategoryList($attribs = array())
{
$CatTable = GetTablePrefix()."CategoryItems";
$t = $this->SourceTable;
$sql = "SELECT *,$CatTable.CategoryId FROM $t INNER JOIN $CatTable ON $CatTable.ItemResourceId=$t.ResourceId ";
$sql .="WHERE ($CatTable.CategoryId=".$catid." AND $t.Status=1)";
return $sql;
}
function CategoryCount($attribs=array())
{
global $objCatList, $objCountCache;
$cat = $attribs["_catid"];
if(!is_numeric($cat))
{
$cat = $objCatList->CurrentCategoryID();
}
if((int)$cat>0)
$c = $objCatList->GetCategory($cat);
$CatTable = GetTablePrefix()."CategoryItems";
$t = $this->SourceTable;
$sql = "SELECT count(*) as MyCount FROM $t INNER JOIN $CatTable ON ($CatTable.ItemResourceId=$t.ResourceId) ";
if($attribs["_subcats"])
{
$ctable = $objCatList->SourceTable;
$sql .= "INNER JOIN $ctable ON ($CatTable.CategoryId=$ctable.CategoryId) ";
$sql .= "WHERE (ParentPath LIKE '".$c->Get("ParentPath")."%' ";
if(!$attribs["_countcurrent"])
{
$sql .=" AND $ctable.CategoryId != $cat) AND ($t.Status=1)";
}
else
$sql .=") AND ($t.Status=1)";
}
else
$sql .="WHERE ($CatTable.CategoryId=".$cat." AND $t.Status=1) ";
if($attribs["_today"])
{
$today = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y"));
$sql .= "AND ($t.CreatedOn>=$today) ";
}
//echo $sql."<br><br>\n";
$rs = $this->adodbConnection->Execute($sql);
$ret = "";
if($rs && !$rs->EOF)
$ret = (int)$rs->fields["MyCount"];
return $ret;
}
function SqlGlobalCount($attribs=array())
{
global $objSession;
$where = '';
$p = $this->BasePermission.'.VIEW';
$t = $this->SourceTable;
if( getArrayValue($attribs,'_today') )
{
$today = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y"));
$where = "($t.CreatedOn>=$today)";
}
$GroupList = getArrayValue($attribs,'_grouponly') ? $objSession->Get('GroupList') : null;
$sql = $this->GetCountSQL($p,NULL,$GroupList,$where);
return $sql;
}
function DoGlobalCount($attribs)
{
global $objCountCache;
$cc = $objCountCache->GetValue($this->CacheListType("_"),$this->ItemType,$this->CacheListExtraId("_"),(int)getArrayValue($attribs,'_today'), 3600);
if(!is_numeric($cc))
{
$sql = $this->SqlGlobalCount($attribs);
$ret = QueryCount($sql);
$objCountCache->SetValue($this->CacheListType("_"),$this->ItemType,$this->CacheListExtraId("_"),(int)getArrayValue($attribs,'_today'),$ret);
}
else
$ret = $cc;
return $ret;
}
function CacheListExtraId($ListType)
{
global $objSession;
if(!strlen($ListType))
$ListType="_";
switch($ListType)
{
case "_":
$ExtraId = $objSession->Get("GroupList");
break;
case "category":
$ExtraId = $objSession->Get("GroupList");
break;
case "myitems":
$ExtraId = $objSession->Get("PortalUserId");
break;
case "hot":
$ExtraId = $objSession->Get("GroupList");
break;
case "pop":
$ExtraId = $objSession->Get("GroupList");
break;
case "pick":
$ExtraId = $objSession->Get("GroupList");
break;
case "favorites":
$ExtraId = $objSession->Get("PortalUserId");
break;
case "new":
$ExtraId = $objSession->Get("GroupList");
break;
}
return $ExtraId;
}
/**
* Return all listype (from tags) to id mappings
*
* @return Array
* @access private
*/
function GetListTypes()
{
return Array('_' => 0, 'category' => 1, 'myitems' => 2, 'hot' => 3, 'pop' => 4, 'pick' => 5, 'favorites' => 6, 'new' => 8);
}
function CacheListType($ListType)
{
if(empty($ListType))
$ListType='_';
$mapping = $this->GetListTypes();
return $mapping[$ListType];
}
function PerformItemCount($attribs=array())
{
global $objCountCache, $objSession;
$ret = "";
$sql = "";
$ListType = getArrayValue($attribs,'_listtype');
if(!strlen($ListType))
$ListType="_";
$ListTypeId = $this->CacheListType($ListType);
//echo "ListType: $ListType ($ListTypeId)<br>\n";
$ExtraId = $this->CacheListExtraId($ListType);
switch($ListType)
{
case "_":
$ret = $this->DoGlobalCount($attribs);
break;
case "category":
$ret = $this->CategoryCount($attribs);
break;
case "myitems":
$sql = $this->SqlMyItems($attribs);
break;
case "hot":
$sql = $this->SqlHotItems($attribs);
break;
case "pop":
$sql = $this->SqlPopItems($attribs);
break;
case "pick":
$sql = $this->SqlPickItems($attribs);
break;
case "favorites":
$sql = $this->SqlFavorites($attribs);
break;
case "search":
$sql = $this->SqlSearchItems($attribs);
break;
case "new":
$sql = $this->SqlNewItems($attribs);
break;
}
//echo "SQL: $sql<br>";
if(!empty($sql) && $ListType != "_")
{
if(is_numeric($ListTypeId) && $ListTypeId)
{
$cc = $objCountCache->GetValue($ListTypeId,$this->ItemType,$ExtraId,(int)getArrayValue($attribs,'_today'), 3600);
if(!is_numeric($cc) || $attribs['_nocache'] == 1)
{
$ret = QueryCount($sql);
$objCountCache->SetValue($ListTypeId,$this->ItemType,$ExtraId,(int)getArrayValue($attribs,'_today'),$ret);
}
else
$ret = $cc;
}
else
$ret = QueryCount($sql);
}
return $ret;
}
function GetJoinedSQL($PermName, $CatId=NULL, $AdditionalWhere="", $LoadOnlyPrimary = true)
{
global $objSession, $objPermissions;
$ltable = $this->SourceTable;
$acl = $objSession->GetACLClause();
$cattable = GetTablePrefix()."CategoryItems";
$CategoryTable = GetTablePrefix()."Category";
$ptable = GetTablePrefix()."PermCache";
$VIEW = $objPermissions->GetPermId($PermName);
$sql ="INNER JOIN $cattable ON ($cattable.ItemResourceId=$ltable.ResourceId) ";
$sql .="INNER JOIN $CategoryTable ON ($CategoryTable.CategoryId=$cattable.CategoryId) ";
$sql .= "INNER JOIN $ptable ON ($cattable.CategoryId=$ptable.CategoryId) ";
// here will come checking for PrimaryCat on search
if ($LoadOnlyPrimary) {
$sql .="WHERE ($acl AND PermId=$VIEW AND PrimaryCat=1 AND $CategoryTable.Status=1) ";
}
else {
$sql .="WHERE ($acl AND PermId=$VIEW AND $CategoryTable.Status=1) ";
}
if(is_numeric($CatId) && $CatId > 0)
{
$sql .= " AND ($CategoryTable.CategoryId=$CatId) ";
}
if(strlen($AdditionalWhere)>0)
{
$sql .= "AND (".$AdditionalWhere.")";
}
return $sql;
}
/**
* Not used in php files directly [comment by Alex]
*
* @param unknown_type $attribs
* @return unknown
*
*/
function CountFavorites($attribs)
{
if($attribs["_today"])
{
global $objSession, $objConfig, $objPermissions;
$acl = $objSession->GetACLClause();
$favtable = GetTablePrefix()."Favorites";
$ltable = $this->SourceTable;
$cattable = GetTablePrefix()."CategoryItems";
$CategoryTable = GetTablePrefix()."Category";
$ptable = GetTablePrefix()."PermCache";
$today = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y"));
$where = "PortalUserId=".$objSession->Get("PortalUserId")." AND $ltable.Status=1";
$where .= " AND $favtable.Modified >= $today AND ItemTypeId=".$this->ItemType;
$p = $this->BasePermission.".VIEW";
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$sql = "SELECT $ltable.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavBar')." AS CachedNavBar FROM $favtable INNER JOIN $ltable ON ($favtable.ResourceId=$ltable.ResourceId) ";
$sql .= $this->GetJoinedSQL($p,NULL,$where);
$ret = QueryCount($sql);
}
else
{
if (!$this->ListType == "favorites")
{
$this->ListType = "favorites";
$this->LoadFavorites($attribs);
$ret = $this->QueryItemCount;
}
else
$ret = $this->QueryItemCount;
}
return $ret;
}
function CountPickItems($attribs)
{
if (!$this->ListType == "pick")
{
$this->ListType = "pick";
$this->LoadPickItems($attribs);
$ret = $this->QueryItemCount;
}
else
$ret = $this->QueryItemCount;
return $ret;
}
function CountMyItems($attribs)
{
if (!$this->ListType == "myitems")
{
$this->ListType = "myitems";
$this->LoadMyItems($attribs);
$ret = $this->QueryItemCount;
}
else
$ret = $this->QueryItemCount;
return $ret;
}
function CountHotItems($attribs)
{
if (!$this->ListType == "hotitems")
{
$this->ListType = "hotitems";
$this->LoadHotItems($attribs);
$ret = $this->QueryItemCount;
}
else
$ret = $this->QueryItemCount;
return $ret;
}
function CountNewItems($attribs)
{
if (!$this->ListType == "newitems")
{
$this->ListType = "newitems";
$this->LoadNewItems($attribs);
$ret = $this->QueryItemCount;
}
else
$ret = $this->QueryItemCount;
return $ret;
}
function CountPopItems($attribs)
{
if (!$this->ListType == "popitems")
{
$this->ListType = "popitems";
$this->LoadPopItems($attribs);
$ret = $this->QueryItemCount;
}
else
$ret = $this->QueryItemCount;
return $ret;
}
function CountSearchItems($attribs)
{
if (!$this->ListType == "search")
{
$this->ListType = "search";
$this->LoadSearchItems($attribs);
$ret = $this->QueryItemCount;
}
else
$ret = $this->QueryItemCount;
return $ret;
}
function SqlFavorites($attribs)
{
global $objSession, $objConfig, $objPermissions;
$acl = $objSession->GetACLClause();
$favtable = GetTablePrefix()."Favorites";
$ltable = $this->SourceTable;
$cattable = GetTablePrefix()."CategoryItems";
$CategoryTable = GetTablePrefix()."Category";
$ptable = GetTablePrefix()."PermCache";
$where = "PortalUserId=".$objSession->Get("PortalUserId")." AND $ltable.Status=1";
if($attribs["_today"])
{
$today = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y"));
$where .= " AND $favtable.Modified >= $today AND ItemTypeId=".$this->ItemType;
}
$p = $this->BasePermission.".VIEW";
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$sql = "SELECT $ltable.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavBar')." AS CachedNavBar FROM $favtable INNER JOIN $ltable ON ($favtable.ResourceId=$ltable.ResourceId) ";
$sql .= $this->GetJoinedSQL($p,NULL,$where);
$OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE);
$sql .= " ".$OrderBy;
return $sql;
}
function LoadFavorites($attribs)
{
global $objSession, $objCountCache, $objConfig;
$sql = $this->SqlFavorites($attribs);
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
if($attribs["_shortlist"])
{
if ($objConfig->Get($this->PerPageShortVar) > 0) {
$this->PerPageVar = $this->PerPageShortVar;
}
else {
$this->PerPageVar = $this->PerPageVarLong;
}
}
else
$this->PerPageVar = $this->PerPageVarLong;
$CachedCount = $objCountCache->GetValue($this->CacheListType("favorites"),$this->ItemType,$this->CacheListExtraId("favorites"),(int)$attribs["_today"],3600);
if(!is_numeric($CachedCount))
{
$this->QueryItemCount = QueryCount($sql);
$objCountCache->SetValue($this->CacheListType("favorites"),$this->ItemType,$this->CacheListExtraId("favorites"),(int)$attribs["_today"],$this->QueryItemCount);
}
else
$this->QueryItemCount = (int)$CachedCount;
return $this->Query_Item($sql);
}
function SqlPickItems($attribs)
{
global $objSession, $objCatList;
$catid = (int)getArrayValue($attribs,'_catid');
$scope = (int)getArrayValue($attribs,'_scope');
//$JoinCats = (int)$attribs["_catinfo"] || $scope;
$TableName = $this->SourceTable;
if($scope)
{
if (!$catid)
{
$catid = $objCatList->CurrentCategoryID();
}
$where = GetTablePrefix()."CategoryItems.CategoryId =".$catid." AND ".$TableName.".EditorsPick=1 AND ".$TableName.".Status=1";
}
else
{
$where = $TableName.".EditorsPick=1 AND ".$TableName.".Status=1 ";
$catid=NULL;
}
if(getArrayValue($attribs,'_today'))
{
$today = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y"));
$where .= " AND ($TableName.CreatedOn>=$today)";
}
$CategoryTable = GetTablePrefix()."Category";
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavbar')." AS CachedNavBar FROM $TableName ";
$p = $this->BasePermission.".VIEW";
$sql .= $this->GetJoinedSQL($p,$catid,$where);
$OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE);
$sql .= " ".$OrderBy;
//echo "SQL: $sql<br>";
return $sql;
}
function LoadPickItems($attribs)
{
global $objSession, $objCountCache, $objConfig;
$sql = $this->SqlPickItems($attribs);
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
if($attribs["_shortlist"])
{
if ($objConfig->Get($this->PerPageShortVar) > 0) {
$this->PerPageVar = $this->PerPageShortVar;
}
else {
$this->PerPageVar = $this->PerPageVarLong;
}
}
else
$this->PerPageVar = $this->PerPageVarLong;
$CachedCount = $objCountCache->GetValue($this->CacheListType("pick"),$this->ItemType,$this->CacheListExtraId("pick"),(int)getArrayValue($attribs,'_today'),3600);
if(!is_numeric($CachedCount))
{
$this->QueryItemCount= QueryCount($sql);
$objCountCache->SetValue($this->CacheListType("pick"),$this->ItemType,$this->CacheListExtraId("pick"),(int)getArrayValue($attribs,'_today'),$this->QueryItemCount);
}
else
$this->QueryItemCount=$CachedCount;
return $this->Query_Item($sql);
}
function SqlMyItems($attribs= array())
{
global $objSession;
$TableName = $this->SourceTable;
$where = " ".$TableName.".Status>-1 AND ".$TableName.".CreatedById=".$objSession->Get("PortalUserId");
if(getArrayValue($attribs,'_today'))
{
$today = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y"));
$where .= " AND ($TableName.CreatedOn>=$today)";
}
$CategoryTable = GetTablePrefix()."Category";
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavbar')." AS CachedNavBar FROM $TableName ";
$p = $this->BasePermission.".VIEW";
$sql .= $this->GetJoinedSQL($p,null,$where); // maybe null should be replaced by some CategoryId
$OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE);
$sql .= " ".$OrderBy;
return $sql;
}
function LoadMyItems($attribs=array())
{
global $objSession,$objCountCache;
$sql = $this->SqlMyItems($attribs);
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
if($attribs["_shortlist"])
{
if ($objConfig->Get($this->PerPageShortVar) > 0) {
$this->PerPageVar = $this->PerPageShortVar;
}
else {
$this->PerPageVar = $this->PerPageVarLong;
}
}
else
$this->PerPageVar = $this->PerPageVarLong;
$CachedCount = $objCountCache->GetValue($this->CacheListType("myitems"),$this->ItemType,$this->CacheListExtraId("myitems"),(int)$attribs["_today"],3600);
if(!is_numeric($CachedCount))
{
$this->QueryItemCount= QueryCount($sql);
$objCountCache->SetValue($this->CacheListType("myitems"),$this->ItemType,$this->CacheListExtraId("myitems"),(int)$attribs["_today"],$this->QueryItemCount);
}
else
$this->QueryItemCount=$CachedCount;
return $this->Query_Item($sql);
}
function SqlNewItems($attribs = array())
{
global $objSession, $objCatList;
$catid = (int)getArrayValue($attribs,'_catid');
$scope = (int)getArrayValue($attribs,'_scope');
$show_since_last = (int)getArrayValue($attribs,'_show_since_last');
//$JoinCats = (int)$attribs["_catinfo"] || $scope;
//echo "Last: $scope<br><br>";
$TableName = $this->SourceTable;
if(getArrayValue($attribs,'_today'))
{
$cutoff = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y"));
}
else
{
if($scope)
{
if (!$catid)
{
$catid = $objCatList->CurrentCategoryID();
}
if (!$show_since_last) {
$cutoff = $this->GetNewValue($catid);
}
else {
$cutoff = $scope;
}
}
else
$cutoff = $this->GetNewValue();
}
if($scope)
{
if (!$catid)
{
$catid = $objCatList->CurrentCategoryID();
}
if (!$show_since_last) {
$where = "CategoryId =".$catid." AND ((".$TableName.".CreatedOn >=".$cutoff." AND ".$TableName.".NewItem != 0) OR ".$TableName.".NewItem=1 ) AND ".$TableName.".Status=1 ";
}
else {
$where = $TableName.".CreatedOn >=".$cutoff." AND ".$TableName.".Status=1 ";
}
}
else
{
$where = "((".$TableName.".CreatedOn >=".$this->GetNewValue()." AND ".$TableName.".NewItem != 0) OR ".$TableName.".NewItem=1 ) AND ".$TableName.".Status=1 ";
}
$CategoryTable = GetTablePrefix()."Category";
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavbar')." AS CachedNavBar FROM $TableName ";
$p = $this->BasePermission.".VIEW";
$sql .= $this->GetJoinedSQL($p,$catid,$where);
$OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE);
$sql .= " ".$OrderBy;
//echo "SQL: $sql<br><br>";
return $sql;
}
function LoadNewItems($attribs)
{
global $objSession,$objCountCache,$objConfig;
$sql = $this->SqlNewItems($attribs);
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
if( getArrayValue($attribs,'_shortlist') )
{
if ($objConfig->Get($this->PerPageShortVar) > 0) {
$this->PerPageVar = $this->PerPageShortVar;
}
else {
$this->PerPageVar = $this->PerPageVarLong;
}
}
else
$this->PerPageVar = $this->PerPageVarLong;
$CachedCount = $objCountCache->GetValue($this->CacheListType("new"),$this->ItemType,$this->CacheListExtraId("new"),(int)getArrayValue($attribs,'_today'),3600);
if(!is_numeric($CachedCount))
{
$this->QueryItemCount= QueryCount($sql);
$objCountCache->SetValue($this->CacheListType("new"),$this->ItemType,$this->CacheListExtraId("new"),(int)getArrayValue($attribs,'_today'),$this->QueryItemCount);
}
else
$this->QueryItemCount=$CachedCount;
$ret = $this->Query_Item($sql);
return $ret;
}
function SqlPopItems($attribs)
{
global $objSession, $objCatList;
$catid = (int)$attribs["_catid"];
$scope = (int)$attribs["_scope"];
//$JoinCats = (int)$attribs["_catinfo"] || $scope;
$TableName = $this->SourceTable;
if($scope)
{
if (!$catid)
{
$catid = $objCatList->CurrentCategoryID();
}
$where = "CategoryId =".$catid." AND ((".$TableName.".Hits >=".$this->GetLinkPopValue()." AND ".$TableName.".PopItem !=0) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1";
}
else
{
$where = "((".$TableName.".CachedRating >=".$this->GetPopValue()." AND ".$TableName.".PopItem !=0 ) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1 ";
$where = "((".$TableName.".Hits >=".$this->GetPopValue()." AND ".$TableName.".PopItem !=0) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1 ";
}
if($attribs["_today"])
{
$today = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y"));
$where .= " AND ($TableName.CreatedOn>=$today)";
}
$CategoryTable = GetTablePrefix()."Category";
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavbar')." AS CachedNavBar FROM $TableName ";
$p = $this->BasePermission.".VIEW";
$sql .= $this->GetJoinedSQL($p,$catid,$where);
$OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE);
$sql .= " ".$OrderBy;
return $sql;
}
function LoadPopItems($attribs)
{
global $objSession,$objCountCache;
$sql = $this->SqlPopItems($attribs);
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
if($attribs["_shortlist"])
{
if ($objConfig->Get($this->PerPageShortVar) > 0) {
$this->PerPageVar = $this->PerPageShortVar;
}
else {
$this->PerPageVar = $this->PerPageVarLong;
}
}
else
$this->PerPageVar = $this->PerPageVarLong;
$CachedCount = $objCountCache->GetValue($this->CacheListType("pop"),$this->ItemType,$this->CacheListExtraId("pop"),(int)$attribs["_today"],3600);
if(!is_numeric($CachedCount))
{
$this->QueryItemCount= QueryCount($sql);
$objCountCache->SetValue($this->CacheListType("pop"),$this->ItemType,$this->CacheListExtraId("pop"),(int)$attribs["_today"],$this->QueryItemCount);
}
else
$this->QueryItemCount=$CachedCount;
return $this->Query_Item($sql);
}
function SqlHotItems($attribs)
{
global $objSession, $objCatList;
$catid = (int)$attribs["_catid"];
$scope = (int)$attribs["_scope"];
// $JoinCats = (int)$attribs["_catinfo"] || $scope;
$TableName = $this->SourceTable;
$OrderBy = $TableName.".CachedRating DESC";
if($scope)
{
if (!$catid)
{
$catid = $objCatList->CurrentCategoryID();
}
$where = "CategoryId =".$catid." AND ((".$TableName.".CachedRating >=".$this->GetHotValue()." AND ".$TableName.".PopItem !=0) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1";
}
else
{
$where = "((".$TableName.".CachedRating >=".$this->GetPopValue()." AND ".$TableName.".PopItem !=0 ) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1 ";
}
if($attribs["_today"])
{
$today = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y"));
$where .= " AND ($TableName.CreatedOn>=$today)";
}
$CategoryTable = GetTablePrefix()."Category";
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavbar')." AS CachedNavBar FROM $TableName ";
$p = $this->BasePermission.".VIEW";
$CatId = !$scope? NULL : $catid;
$sql .= $this->GetJoinedSQL($p,$CatId,$where);
if(strlen($OrderBy))
$sql .= " ORDER BY $OrderBy ";
return $sql;
}
function LoadHotItems($attribs)
{
global $objSession,$objCountCache;
$sql = $this->SqlHotItems($attribs);
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
if($attribs["_shortlist"])
{
if ($objConfig->Get($this->PerPageShortVar) > 0) {
$this->PerPageVar = $this->PerPageShortVar;
}
else {
$this->PerPageVar = $this->PerPageVarLong;
}
}
else
$this->PerPageVar = $this->PerPageVarLong;
$CachedCount = $objCountCache->GetValue($this->CacheListType("hot"),$this->ItemType,$this->CacheListExtraId("hot"),(int)$attribs["_today"], 0);
if(!is_numeric($CachedCount))
{
$this->QueryItemCount= QueryCount($sql);
$objCountCache->SetValue($this->CacheListType("hot"),$this->ItemType,$this->CacheListExtraId("hot"),(int)$attribs["_today"],$this->QueryItemCount);
}
else
$this->QueryItemCount=$CachedCount;
return $this->Query_Item($sql);
}
function SqlSearchItems($attribs = array())
{
global $objConfig, $objItemTypes, $objSession, $objPermissions, $CountVal;
$acl = $objSession->GetACLClause();
$this->Clear();
//$stable = "ses_".$objSession->GetSessionKey()."_Search";
$stable = $objSession->GetSearchTable();
$ltable = $this->SourceTable;
$catitems = GetTablePrefix()."CategoryItems";
$cattable = GetTablePrefix()."Category";
$ptable = GetTablePrefix()."PermCache";
$p = $this->BasePermission.".VIEW";
$i = new $this->classname();
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$sql = "SELECT $cattable.CategoryId,$cattable.".$ml_formatter->LangFieldName('CachedNavbar')." AS CachedNavbar,$ltable.*, Relevance FROM $stable ";
$sql .= "INNER JOIN $ltable ON ($stable.ItemId=$ltable.".$i->id_field.") ";
$where = "ItemType=".$this->ItemType." AND $ltable.Status=1";
$load_multiple = $objConfig->Get("Search_ShowMultiple_".$attribs['multiple']);
$LoadOnlyPrimary = true;
if ($load_multiple == 1) {
$LoadOnlyPrimary = false;
}
$sql .= $this->GetJoinedSQL($p,NULL,$where, $LoadOnlyPrimary);
$tmp = $this->QueryOrderByClause(FALSE,TRUE,TRUE);
//echo "TMP: $tmp<br>";
//$tmp = substr($tmp,9);
if(strlen($tmp))
{
$sql .= $tmp.", ";
}
$sql .= " EdPick DESC,Relevance DESC ";
//echo "SQL Search Items: $sql<br><br>";
return $sql;
}
function LoadSearchItems($attribs = array())
{
global $CountVal, $objSession;
//echo "Loading <b>".get_class($this)."</b> Search Items<br>";
$sql = $this->SqlSearchItems($attribs);
//echo "$sql<br>";
$this->Query_Item($sql);
$Keywords = GetKeywords($objSession->GetVariable("Search_Keywords"));
//echo "SQL Loaded ItemCount (<b>".get_class($this).'</b>): '.$this->NumItems().'<br>';
for($i = 0; $i < $this->NumItems(); $i++)
{
$this->Items[$i]->Keywords = $Keywords;
}
if(is_numeric($CountVal[$this->ItemType]))
{
$this->QueryItemCount = $CountVal[$this->ItemType];
//echo "CACHE: <pre>"; print_r($CountVal); echo "</pre><BR>";
}
else
{
$this->QueryItemCount = QueryCount($sql);
//echo "<b>SQL</b>: ".$sql."<br><br>";
$CountVal[$this->ItemType] = $this->QueryItemCount;
}
}
/**
* Updates count cache for selected ids in list
*
* @param Array $item_ids
* @access protected
*/
function FlushCache($item_ids)
{
$db =& GetADODBConnection();
if(is_array($item_ids)) $item_ids=implode(',',$item_ids);
$sql = 'SELECT ResourceId FROM '.$this->SourceTable.' WHERE '.$this->GetIDField().' IN ('.$item_ids.')';
$resource_ids=$db->GetCol($sql);
$sql='SELECT CategoryId FROM '.GetTablePrefix().'CategoryItems WHERE ItemResourceId IN ('.implode(',',$resource_ids).')';
$cat_ids=$db->GetCol($sql);
UpdateCategoryCount($this->ItemType, $cat_ids, $this->GetListTypes());
}
function PasteFromClipboard($TargetCat,$NameField="")
{
global $objSession,$objCatList;
$clip = $objSession->GetVariable("ClipBoard");
if(strlen($clip))
{
$ClipBoard = ParseClipboard($clip);
$IsCopy = (substr($ClipBoard["command"],0,4)=="COPY") || ($ClipBoard["source"] == $TargetCat);
$item_ids = explode(",",$ClipBoard["ids"]);
for($i=0;$i<count($item_ids);$i++)
{
$item = $this->GetItem($item_ids[$i]);
if(!$IsCopy) // paste to other category then current
{
$item->MoveToCategory($ClipBoard["source"],$TargetCat);
$clip = str_replace("CUT","COPY",$clip);
$objSession->SetVariable("ClipBoard",$clip);
}
else
{
$item->CopyToNewResource($TargetCat,$NameField); // create item copy, but with new ResourceId
$item->AddToCategory($TargetCat);
UpdateCategoryCount($item->type,$TargetCat, $this->GetListTypes() );
}
}
}
}
function AdminPrintItems($template)
{
// prints item listing for admin (browse/advanced view) tabs
$o = '<table border="0" cellspacing="2" width="100%"><tbody><tr>';
$i = 1;
$topleft = 0;
$topright = 0;
$rightcount = 0;
$total_items = $this->NumItems();
$topleft = ceil($total_items / 2);
$topright = $total_items - $topleft;
for($x = 0; $x < $topleft; $x++)
{
//printingleft
$item = $this->Items[$x];
if ($i > 2)
{
$o .= "</tr>\n<tr>";
$i = 1;
}
$o .= $item->AdminParseTemplate($template);
$i++;
//printingright
if ($rightcount < $topright && ( ($x + $topleft) < $total_items) )
{
$item = $this->Items[ $x + $topleft ];
if ($i > 2)
{
$o.="</tr>\n<tr>";
$i = 1;
}
$o .= $item->AdminParseTemplate($template);
$i++;
$rightcount++;
}
}
$o .= "\n</tr></tbody></table>\n";
return $o;
}
}
// -------------- NEW CLASSES -----------------------
class DBList {
// table related attributes
var $db = null;
var $table_name = '';
var $LiveTable = '';
var $EditTable = '';
// record related attributes
var $records = Array();
var $record_count = 0;
var $cur_rec = -1; // "-1" means no records, or record index otherwise
// query related attributes
var $SelectSQL = "SELECT * FROM %s";
function DBList()
{
// use $this->SetTable('live', 'table name');
// in inherited constructors to set table for list
$this->db =&GetADODBConnection();
}
function SetTable($action, $table_name = null)
{
// $action = {'live', 'restore','edit'}
switch($action)
{
case 'live':
$this->LiveTable = $table_name;
$this->table_name = $this->LiveTable;
break;
case 'restore':
$this->table_name = $this->LiveTable;
break;
case 'edit':
global $objSession;
$this->table_name = $objSession->GetEditTable($this->LiveTable);
break;
}
}
function Clear()
{
// no use of this method at a time :)
$this->records = Array();
$this->record_count = 0;
$this->cur_rec = -1;
}
function Query()
{
// query list
$sql = sprintf($this->SelectSQL, $this->table_name);
// echo "SQL: $sql<br>";
$rs =& $this->db->Execute($sql);
if( $this->db->ErrorNo() == 0 )
{
$this->records = $rs->GetRows();
$this->record_count = count($this->records);
//$this->cur_rec = $this->record_count ? 0 : -1;
}
else
return false;
}
function ProcessList($callback_method)
{
// process list using user-defined method called
// with one parameter - current record fields
// (associative array)
if($this->record_count > 0)
{
$this->cur_rec = 0;
while($this->cur_rec < $this->record_count)
{
if( method_exists($this, $callback_method) )
$this->$callback_method( $this->GetCurrent() );
$this->cur_rec++;
}
}
}
function &GetCurrent()
{
// return currently processed record (with change ability)
return ($this->cur_rec != -1) ? $this->records[$this->cur_rec] : false;
}
function GetDBField($field_name)
{
$rec =& $this->GetCurrent();
return is_array($rec) && isset($rec[$field_name]) ? $rec[$field_name] : false;
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/include/parseditem.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.91
\ No newline at end of property
+1.92
\ No newline at end of property
Index: trunk/kernel/include/globals.php
===================================================================
--- trunk/kernel/include/globals.php (revision 8103)
+++ trunk/kernel/include/globals.php (revision 8104)
@@ -1,2039 +1,2042 @@
<?php
if (!function_exists('parse_portal_ini')) {
function parse_portal_ini($file, $parse_section = false) {
if (!file_exists($file)) return false;
if(file_exists($file) && !is_readable($file))
die('Could Not Open Ini File');
$contents = file($file);
$retval = array();
$section = '';
$ln = 1;
$resave = false;
foreach($contents as $line) {
if ($ln == 1 && $line != '<'.'?'.'php die() ?'.">\n") {
$resave = true;
}
$ln++;
$line = trim($line);
$line = eregi_replace(';[.]*','',$line);
if(strlen($line) > 0) {
//echo $line . " - ";
if(eregi('^[[a-z]+]$',str_replace(' ', '', $line))) {
//echo 'section';
$section = substr($line,1,(strlen($line)-2));
if ($parse_section) {
$retval[$section] = array();
}
continue;
} elseif(eregi('=',$line)) {
//echo 'main element';
list($key,$val) = explode(' = ',$line);
if (!$parse_section) {
$retval[trim($key)] = str_replace('"', '', $val);
}
else {
$retval[$section][trim($key)] = str_replace('"', '', $val);
}
} //end if
//echo '<br />';
} //end if
} //end foreach
if ($resave) {
$fp = fopen($file, "w");
reset($contents);
fwrite($fp,'<'.'?'.'php die() ?'.">\n\n");
foreach($contents as $line) fwrite($fp,"$line");
fclose($fp);
}
return $retval;
}
}
$vars = parse_portal_ini(FULL_PATH.'/config.php');
if ($vars) {
foreach ($vars as $config_key => $config_value) {
$GLOBALS['g_'.$config_key] = $config_value;
}
unset($config_key, $config_value);
}
/*list the tables which contain item data */
$ItemTables = array();
$KeywordIgnore = array();
global $debuglevel;
$debuglevel = 0;
//$GLOBALS['debuglevel'] = 0;
/*New, Hot, Pop field values */
define('NEVER', 0);
define('ALWAYS', 1);
define('AUTO', 2);
/*Status Values */
if( !defined('STATUS_DISABLED') ) define('STATUS_DISABLED', 0);
if( !defined('STATUS_ACTIVE') ) define('STATUS_ACTIVE', 1);
if( !defined('STATUS_PENDING') ) define('STATUS_PENDING', 2);
$LogLevel = 0;
$LogFile = NULL;
/**
* Returns reference to database connection
*
* @param bool $new_type Return Kernel4 or in-portal connection object
* @return kDBConnection
*/
function &GetADODBConnection($new_type = false)
{
static $DB = null;
global $g_DBType, $g_DBHost, $g_DBUser, $g_DBUserPassword, $g_DBName, $g_DebugMode;
global $ADODB_FETCH_MODE, $ADODB_COUNTRECS, $ADODB_CACHE_DIR, $pathtoroot;
if ($new_type) {
$application =& kApplication::Instance();
return $application->GetADODBConnection();
}
if( !isset($DB) && strlen($g_DBType) > 0 )
{
$DB = ADONewConnection($g_DBType);
$connected = $DB->Connect($g_DBHost, $g_DBUser, $g_DBUserPassword, $g_DBName);
if(!$connected) die("Error connecting to database $g_DBHost <br>\n");
$ADODB_CACHE_DIR = $pathtoroot."cache";
$ADODB_FETCH_MODE = 2;
$ADODB_COUNTRECS = false;
$DB->debug = defined('ADODB_OUTP') ? 1 : 0;
$DB->cacheSecs = 3600;
$DB->Execute('SET SQL_BIG_SELECTS = 1');
}
elseif( !strlen($g_DBType) )
{
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>';
if ( !preg_match('/admin/', __FILE__) ) $ins = 'admin/';
echo '<a href="'.$rootURL.$ins.'install.php">Go to installation script</a><br><br>';
flush();
exit;
}
return $DB;
}
function GetNextResourceId($Increment=1)
{
global $objModules, $pathtoroot;
$table_name = GetTablePrefix().'IdGenerator';
$db = &GetADODBConnection();
// dummy protection: get maximal resource id used actually and fix last_id used
$max_resourceid = 0;
$m = GetModuleArray();
foreach($m as $key=>$value)
{
$path = $pathtoroot. $value."admin/include/parser.php";
if(file_exists($path))
{
include_once($path);
}
}
$table_info = $objModules->ExecuteFunction('GetModuleInfo', 'dupe_resourceids');
$sql_template = 'SELECT MAX(ResourceId) FROM '.GetTablePrefix().'%s';
foreach($table_info as $module_name => $module_info)
{
foreach($module_info as $module_sub_info)
{
$sql = sprintf($sql_template,$module_sub_info['Table']);
$tmp_resourceid = $db->GetOne($sql);
if($tmp_resourceid > $max_resourceid) $max_resourceid = $tmp_resourceid;
}
}
// update lastid to be next resourceid available
$db->Execute('LOCK TABLES '.$table_name.' WRITE');
$last_id = $db->GetOne('SELECT lastid FROM '.$table_name);
if ($last_id - 1 > $max_resourceid) $max_resourceid = $last_id - 1;
$id_diff = $db->GetOne('SELECT '.$max_resourceid.' + 1 - lastid FROM '.$table_name);
if($id_diff) $Increment += $id_diff;
$sql = 'UPDATE '.$table_name.' SET lastid = lastid + '.$Increment; // set new id in db
$db->Execute($sql);
$val = $db->GetOne('SELECT lastid FROM '.$table_name);
if($val === false)
{
$db->Execute('INSERT INTO '.$table_name.' (lastid) VALUES ('.$Increment.')');
$val = $Increment;
}
$db->Execute('UNLOCK TABLES');
return $val - $Increment + $id_diff; // return previous free id (-1) ?
}
function AddSlash($s)
{
if(substr($s,-1) != "/")
{
return $s."/";
}
else
return $s;
}
function StripNewline($s)
{
$bfound = false;
while (strlen($s)>0 && !$bfound)
{
if(ord(substr($s,-1))<32)
{
$s = substr($s,0,-1);
}
else
$bfound = true;
}
return $s;
}
function DeleteElement($array, $indice)
{
for($i=$indice;$i<count($array)-1;$i++)
$array[$i] = $array[$i+1];
unset($array[count($array)-1]);
return $array;
}
function DeleteElementValue($needle, &$haystack)
{
while(($gotcha = array_search($needle,$haystack)) > -1)
unset($haystack[$gotcha]);
}
function TableCount($TableName, $where="",$JoinCats=1)
{
$db = &GetADODBConnection();
if(!$JoinCats)
{
$sql = "SELECT count(*) as TableCount FROM $TableName";
}
else
$sql = "SELECT count(*) as TableCount FROM $TableName INNER JOIN ".GetTablePrefix()."CategoryItems ON ".GetTablePrefix()."CategoryItems.ItemResourceId=$TableName.ResourceId";
if(strlen($where)>0)
$sql .= " WHERE ".$where;
$rs = $db->Execute($sql);
// echo "SQL TABLE COUNT: ".$sql."<br>\n";
$res = $rs->fields["TableCount"];
return $res;
}
Function QueryCount($sql)
{
$sql = preg_replace('/SELECT(.*)FROM[ \n\r](.*)/is','SELECT COUNT(*) AS TableCount FROM $2', $sql);
$sql = preg_replace('/(.*)[ \n\r]LIMIT[ \n\r](.*)/is','$1', $sql);
$sql = preg_replace('/(.*)ORDER BY(.*)/is','$1', $sql);
//echo $sql;
$db =& GetADODBConnection();
return $db->GetOne($sql);
}
function GetPageCount($ItemsPerPage,$NumItems)
{
if($ItemsPerPage==0 || $NumItems==0)
{
return 1;
}
$value = $NumItems/$ItemsPerPage;
return ceil($value);
}
/**
* @return string
* @desc Returns database table prefix entered while installation
*/
function GetTablePrefix()
{
global $g_TablePrefix;
return $g_TablePrefix;
}
function TableHasPrefix($t)
{
$pre = GetTablePrefix();
if(strlen($pre)>0)
{
if(substr($t,0,strlen($pre))==$pre)
{
return TRUE;
}
else
return FALSE;
}
else
return TRUE;
}
function AddTablePrefix($t)
{
if(!TableHasPrefix($t))
$t = GetTablePrefix().$t;
return $t;
}
function ThisDomain()
{
global $objConfig, $g_Domain;
if($objConfig->Get("DomainDetect"))
{
$d = $_SERVER['HTTP_HOST'];
}
else
$d = $g_Domain;
return $d;
}
function GetIndexUrl($secure=0)
{
global $indexURL, $rootURL, $secureURL;
if ( class_exists('kApplication') )
{
$application =& kApplication::Instance();
return $application->BaseURL().'index.php';
}
switch($secure)
{
case 0:
$ret = $indexURL;
break;
case 1:
$ret = $secureURL."index.php";
break;
case 2:
$ret = $rootURL."index.php";
break;
default:
$ret = $i;
break;
}
return $ret;
}
function GetLimitSQL($Page,$PerPage)
{
if($Page<1)
$Page=1;
if(is_numeric($PerPage))
{
if($PerPage==0)
$PerPage = 20;
$Start = ($Page-1)*$PerPage;
$limit = "LIMIT ".$Start.",".$PerPage;
}
else
$limit = NULL;
return $limit;
}
function filelist ($currentdir, $startdir=NULL,$ext=NULL)
{
global $pathchar;
//chdir ($currentdir);
// remember where we started from
if (!$startdir)
{
$startdir = $currentdir;
}
$d = @opendir($currentdir);
$files = array();
if(!$d)
return $files;
//list the files in the dir
while (false !== ($file = readdir($d)))
{
if ($file != ".." && $file != ".")
{
if (is_dir($currentdir."/".$file))
{
// If $file is a directory take a look inside
$a = filelist ($currentdir."/".$file, $startdir,$ext);
if(is_array($a))
$files = array_merge($files,$a);
}
else
{
if($ext!=NULL)
{
$extstr = stristr($file,".".$ext);
if(strlen($extstr))
$files[] = $currentdir."/".$file;
}
else
$files[] = $currentdir.'/'.$file;
}
}
}
closedir ($d);
return $files;
}
function DecimalToBin($dec,$WordLength=8)
{
$bits = array();
$str = str_pad(decbin($dec),$WordLength,"0",STR_PAD_LEFT);
for($i=$WordLength;$i>0;$i--)
{
$bits[$i-1] = (int)substr($str,$i-1,1);
}
return $bits;
}
/*
function inp_escape($in, $html_enable=0)
{
$out = stripslashes($in);
$out = str_replace("\n", "\n^br^", $out);
if($html_enable==0)
{
$out=ereg_replace("<","&lt;",$out);
$out=ereg_replace(">","&gt;",$out);
$out=ereg_replace("\"","&quot;",$out);
$out = str_replace("\n^br^", "\n<br />", $out);
}
else
$out = str_replace("\n^br^", "\n", $out);
$out=addslashes($out);
return $out;
}
*/
function inp_escape($var,$html=0)
{
if($html)return $var;
if(is_array($var))
foreach($var as $k=>$v)
$var[$k]=inp_escape($v);
else
// $var=htmlspecialchars($var,ENT_NOQUOTES);
$var=strtr($var,Array('<'=>'&lt;','>'=>'&gt;',));
return $var;
}
function inp_striptags($var,$html=0)
{
if($html)return $var;
if(is_array($var))
foreach($var as $k=>$v)
$var[$k]=inp_striptags($v);
else
$var=strip_tags($var);
return $var;
}
function inp_unescape($in)
{
// if (get_magic_quotes_gpc())
return $in;
$out=stripslashes($in);
return $out;
}
function inp_textarea_unescape($in)
{
// if (get_magic_quotes_gpc())
return $in;
$out=stripslashes($in);
$out = str_replace("\n<br />", "\n", $out);
return $out;
}
function HighlightKeywords($Keywords, $html, $OpenTag="", $CloseTag="")
{
global $objConfig;
if(!strlen($OpenTag))
$OpenTag = "<B>";
if(!strlen($CloseTag))
$CloseTag = "</B>";
$r = preg_split('((>)|(<))', $html, -1, PREG_SPLIT_DELIM_CAPTURE);
foreach ($Keywords as $k) {
for ($i = 0; $i < count($r); $i++) {
if ($r[$i] == "<") {
$i++; continue;
}
$r[$i] = preg_replace('/('.preg_quote($k, '/').')/i', "$OpenTag\\1$CloseTag", $r[$i]);
}
}
return join("", $r);
}
/*
function HighlightKeywords($Keywords,$html, $OpenTag="", $CloseTag="")
{
global $objConfig;
if(!strlen($OpenTag))
$OpenTag = "<B>";
if(!strlen($CloseTag))
$CloseTag = "</B>";
$ret = strip_tags($html);
foreach ($Keywords as $k)
{
if(strlen($k))
{
//$html = str_replace("<$k>", ":#:", $html);
//$html = str_replace("</$k>", ":##:", $html);
//$html = strip_tags($html);
if ($html = preg_replace("/($k)/Ui","$OpenTag\\1$CloseTag", $html))
//if ($html = preg_replace("/(>[^<]*)($k)([^<]*< )/Ui","$OpenTag\\1$CloseTag", $html))
$ret = $html;
//$ret = str_replace(":#:", "<$k>", $ret);
//$ret = str_replace(":##:", "</$k>", $ret);
}
}
return $ret;
}
*/
function ExtractDatePart($part, $datestamp)
{
if ($datestamp <= 0) return '';
$formats = Array( 'month' => 'm', 'day' => 'd', 'year' => 'Y',
'time_24hr' => 'H:i', 'time_12hr' => 'g:i a', 'time' => GetTimeFormat(), 'date' => GetDateFormat() );
$format = isset($formats[$part]) ? $formats[$part] : $part;
return adodb_date($format, $datestamp);
}
function GetLocalTime($TimeStamp, $TargetZone = null)
{
global $objConfig;
if ($TargetZone == null) {
$TargetZone = $objConfig->Get('Config_Site_Time');
}
$server = $objConfig->Get('Config_Server_Time');
if ($TargetZone != $server) {
$offset = ($server - $TargetZone) * -1;
$TimeStamp = $TimeStamp + (3600 * $offset);
}
return $TimeStamp;
}
function _unhtmlentities ($string)
{
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
return strtr ($string, $trans_tbl);
}
function getLastStr($hay, $need){
$getLastStr = 0;
$pos = strpos($hay, $need);
if (is_int ($pos)){ //this is to decide whether it is "false" or "0"
while($pos) {
$getLastStr = $getLastStr + $pos + strlen($need);
$hay = substr ($hay , $pos + strlen($need));
$pos = strpos($hay, $need);
}
return $getLastStr - strlen($need);
} else {
return -1; //if $need wasn´t found it returns "-1" , because it could return "0" if it´s found on position "0".
}
}
// --- bbcode processing function: begin ----
function PreformatBBCodes($text)
{
// convert phpbb url bbcode to valid in-bulletin's format
// 1. urls
$text = preg_replace('/\[url=(.*)\](.*)\[\/url\]/Ui','[url href="$1"]$2[/url]',$text);
$text = preg_replace('/\[url\](.*)\[\/url\]/Ui','[url href="$1"]$1[/url]',$text);
// 2. images
$text = preg_replace('/\[img\](.*)\[\/img\]/Ui','[img src="$1" border="0"][/img]',$text);
// 3. color
$text = preg_replace('/\[color=(.*)\](.*)\[\/color\]/Ui','[font color="$1"]$2[/font]',$text);
// 4. size
$text = preg_replace('/\[size=(.*)\](.*)\[\/size\]/Ui','[font size="$1"]$2[/font]',$text);
// 5. lists
$text = preg_replace('/\[list(.*)\](.*)\[\/list\]/Uis','[ul]$2[/ul]',$text);
// 6. email to link
$text = preg_replace('/\[email\](.*)\[\/email\]/Ui','[url href="mailto:$1"]$1[/url]',$text);
//7. b tag
$text = preg_replace('/\[(b|i|u):(.*)\](.*)\[\/(b|i|u):(.*)\]/Ui','[$1]$3[/$4]',$text);
//8. code tag
$text = preg_replace('/\[code:(.*)\](.*)\[\/code:(.*)\]/Uis','[code]$2[/code]',$text);
return $text;
}
/**
* @return string
* @param string $BBCode
* @param string $TagParams
* @param string $TextInside
* @param string $ParamsAllowed
* @desc Removes not allowed params from tag and returns result
*/
function CheckBBCodeAttribs($BBCode, $TagParams, $TextInside, $ParamsAllowed)
{
// $BBCode - bbcode to check, $TagParams - params string entered by user
// $TextInside - text between opening and closing bbcode tag
// $ParamsAllowed - list of allowed parameter names ("|" separated)
$TagParams=str_replace('\"','"',$TagParams);
$TextInside=str_replace('\"','"',$TextInside);
if( $ParamsAllowed && preg_match_all('/ +([^=]*)=["\']?([^ "\']*)["\']?/is',$TagParams,$params,PREG_SET_ORDER) )
{
$ret = Array();
foreach($params as $param)
{
// remove spaces in both parameter name & value & lowercase parameter name
$param[1] = strtolower(trim($param[1])); // name lowercased
if(($BBCode=='url')&&($param[1]=='href'))
if(false!==strpos(strtolower($param[2]),'script:'))
return $TextInside;
// $param[2]='about:blank';
if( isset($ParamsAllowed[ $param[1] ]) )
$ret[] = $param[1].'="'.$param[2].'"';
}
$ret = count($ret) ? ' '.implode(' ',$ret) : '';
return '<'.$BBCode.$ret.'>'.$TextInside.'</'.$BBCode.'>';
}
else
return '<'.$BBCode.'>'.$TextInside.'</'.$BBCode.'>';
return false;
}
function ReplaceBBCode($text)
{
global $objConfig;
// convert phpbb bbcodes to in-bulletin bbcodes
$text = PreformatBBCodes($text);
// $tag_defs = 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border';
$tags_defs = $objConfig->Get('BBTags');
foreach(explode(';',$tags_defs) as $tag)
{
$tag = explode(':',$tag);
$tag_name = $tag[0];
$tag_params = $tag[1]?array_flip(explode('|',$tag[1])):0;
$text = preg_replace('/\['.$tag_name.'(.*)\](.*)\[\/'.$tag_name.' *\]/Uise','CheckBBCodeAttribs("'.$tag_name.'",\'$1\',\'$2\',$tag_params);', $text);
}
// additional processing for [url], [*], [img] bbcode
$text = preg_replace('/<url>(.*)<\/url>/Usi','<url href="$1">$1</url>',$text);
$text = preg_replace('/<font>(.*)<\/font>/Usi','$1',$text); // skip empty fonts
$text = str_replace( Array('<url','</url>','[*]'),
Array('<a target="_blank"','</a>','<li>'),
$text);
// bbcode [code]xxx[/code] processing
$text = preg_replace('/\[code\](.*)\[\/code\]/Uise', "ReplaceCodeBBCode('$1')", $text);
return $text;
}
function leadSpace2nbsp($x)
{
return "\n".str_repeat('&nbsp;',strlen($x));
}
function ReplaceCodeBBCode($input_string)
{
$input_string=str_replace('\"','"',$input_string);
$input_string=$GLOBALS['objSmileys']->UndoSmileys(_unhtmlentities($input_string));
$input_string=trim($input_string);
$input_string=inp_htmlize($input_string);
$input_string=str_replace("\r",'',$input_string);
$input_string = str_replace("\t", " ", $input_string);
$input_string = preg_replace('/\n( +)/se',"leadSpace2nbsp('$1')",$input_string);
$input_string='<div style="border:1px solid #888888;width:100%;background-color:#eeeeee;margin-top:6px;margin-bottom:6px"><div style="padding:10px;"><code>'.$input_string.'</code></div></div>';
// $input_string='<textarea wrap="off" style="border:1px solid #888888;width:100%;height:200px;background-color:#eeeeee;">'.inp_htmlize($input_string).'</textarea>';
return $input_string;
if(false!==strpos($input_string,'<'.'?'))
{
$input_string=str_replace('<'.'?','<'.'?php',$input_string);
$input_string=str_replace('<'.'?phpphp','<'.'?php',$input_string);
$input_string=@highlight_string($input_string,1);
}
else
{
$input_string = @highlight_string('<'.'?php'.$input_string.'?'.'>',1);
$input_string = str_replace('&lt;?php', '', str_replace('?&gt;', '', $input_string));
}
return str_replace('<br />','',$input_string);
}
// --- bbcode processing function: end ----
function GetMinValue($Table,$Field, $Where=NULL)
{
$ret = 0;
$sql = "SELECT min($Field) as val FROM $Table ";
if(strlen($where))
$sql .= "WHERE $Where";
$ado = &GetADODBConnection();
$rs = $ado->execute($sql);
if($rs)
$ret = (int)$rs->fields["val"];
return $ret;
}
if (!function_exists( 'getmicrotime' ) ) {
function getmicrotime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
}
function SetMissingDataErrors($f)
{
global $FormError;
$count = 0;
if(is_array($_POST))
{
if(is_array($_POST["required"]))
{
foreach($_POST["required"] as $r)
{
$found = FALSE;
if(is_array($_FILES))
{
if( isset($_FILES[$r]) && $_FILES[$r]['size'] > 0 ) $found = TRUE;
}
if(!strlen(trim($_POST[$r])) && !$found)
{
$count++;
if (($r == "dob_day") || ($r == "dob_month") || ($r == "dob_year"))
$r = "dob";
$tag = isset($_POST["errors"]) ? $_POST["errors"][$r] : '';
if(!strlen($tag))
$tag = "lu_ferror_".$f."_".$r;
$FormError[$f][$r] = language($tag);
}
}
}
}
return $count;
}
function makepassword($length=10)
{
$pass_length=$length;
$p1=array('b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z');
$p2=array('a','e','i','o','u');
$p3=array('1','2','3','4','5','6','7','8','9');
$p4=array('(','&',')',';','%'); // if you need real strong stuff
// how much elements in the array
// can be done with a array count but counting once here is faster
$s1=21;// this is the count of $p1
$s2=5; // this is the count of $p2
$s3=9; // this is the count of $p3
$s4=5; // this is the count of $p4
// possible readable combinations
$c1='121'; // will be like 'bab'
$c2='212'; // will be like 'aba'
$c3='12'; // will be like 'ab'
$c4='3'; // will be just a number '1 to 9' if you dont like number delete the 3
// $c5='4'; // uncomment to active the strong stuff
$comb='4'; // the amount of combinations you made above (and did not comment out)
for ($p=0;$p<$pass_length;)
{
mt_srand((double)microtime()*1000000);
$strpart=mt_rand(1,$comb);
// checking if the stringpart is not the same as the previous one
if($strpart<>$previous)
{
$pass_structure.=${'c'.$strpart};
// shortcutting the loop a bit
$p=$p+strlen(${'c'.$strpart});
}
$previous=$strpart;
}
// generating the password from the structure defined in $pass_structure
for ($g=0;$g<strlen($pass_structure);$g++)
{
mt_srand((double)microtime()*1000000);
$sel=substr($pass_structure,$g,1);
$pass.=${'p'.$sel}[mt_rand(0,-1+${'s'.$sel})];
}
return $pass;
}
function LogEntry($text,$writefile=FALSE)
{
global $g_LogFile,$LogFile, $LogData, $LogLevel, $timestart;
static $last;
if(strlen($g_LogFile))
{
$el = str_pad(getmicrotime()- $timestart,10," ");
if($last>0)
$elapsed = getmicrotime() - $last;
if(strlen($el)>10)
$el = substr($el,0,10);
$indent = str_repeat(" ",$LogLevel);
$text = str_pad($text,$LogLevel,"==",STR_PAD_LEFT);
$LogData .= "$el:". round($elapsed,6).":$indent $text";
$last = getmicrotime();
if($writefile==TRUE && is_writable($g_LogFile))
{
if(!$LogFile)
{
if(file_exists($g_LogFile))
unlink($g_LogFile);
$LogFile=@fopen($g_LogFile,"w");
}
if($LogFile)
{
fputs($LogFile,$LogData);
}
}
}
}
function ValidEmail($email)
{
if (eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $email))
{
return TRUE;
}
else
{
return FALSE;
}
}
function language($phrase,$LangId=0)
{
global $objSession, $objLanguageCache, $objLanguages;
if ($LangId == 0) {
$LangId = $objSession->Get('Language');
}
if ($LangId == 0) {
$LangId = $objLanguages->GetPrimary();
}
return $objLanguageCache->GetTranslation($phrase,$LangId);
}
function admin_language($phrase,$lang=0,$LinkMissing=FALSE)
{
global $objSession, $objLanguageCache, $objLanguages;
//echo "Language passed: $lang<br>";
if($lang==0)
$lang = $objSession->Get("Language");
//echo "Language from session: $lang<br>";
if($lang==0)
$lang = $objLanguages->GetPrimary();
//echo "Language after primary: $lang<br>";
//echo "Phrase: $phrase<br>";
$translation = $objLanguageCache->GetTranslation($phrase,$lang);
if($LinkMissing && substr($translation,0,1)=="!" && substr($translation,-1)=="!")
{
$res = "<A href=\"javascript:OpenPhraseEditor('&direct=1&label=$phrase'); \">$translation</A>";
return $res;
}
else
return $translation;
}
function prompt_language($phrase,$lang=0)
{
return admin_language($phrase,$lang,TRUE);
}
function GetPrimaryTranslation($Phrase)
{
global $objLanguages;
$l = $objLanguages->GetPrimary();
return language($Phrase,$l);
}
function CategoryNameCount($ParentId,$Name)
{
$cat_table = GetTablePrefix()."Category";
$sql = "SELECT Name from $cat_table WHERE ParentId=$ParentId AND ";
$sql .="(Name LIKE '".addslashes($Name)."' OR Name LIKE 'Copy of ".addslashes($Name)."' OR Name LIKE 'Copy % of ".addslashes($Name)."')";
$ado = &GetADODBConnection();
$rs = $ado->Execute($sql);
$ret = array();
while($rs && !$rs->EOF)
{
$ret[] = $rs->fields["Name"];
$rs->MoveNext();
}
return $ret;
}
function CategoryItemNameCount($CategoryId,$Table,$Field,$Name)
{
$Name=addslashes($Name);
$cat_table = GetTablePrefix()."CategoryItems";
$sql = "SELECT $Field FROM $Table INNER JOIN $cat_table ON ($Table.ResourceId=$cat_table.ItemResourceId) ";
$sql .=" WHERE ($Field LIKE 'Copy % of $Name' OR $Field LIKE '$Name' OR $Field LIKE 'Copy of $Name') AND CategoryId=$CategoryId";
//echo $sql."<br>\n ";
$ado = &GetADODBConnection();
$rs = $ado->Execute($sql);
$ret = array();
while($rs && !$rs->EOF)
{
$ret[] = $rs->fields[$Field];
$rs->MoveNext();
}
return $ret;
}
function &GetItemCollection($ItemName)
{
global $objItemTypes;
if(is_numeric($ItemName))
{
$item = $objItemTypes->GetItem($ItemName);
}
else
$item = $objItemTypes->GetTypeByName($ItemName);
if(is_object($item))
{
$module = $item->Get("Module");
$prefix = ModuleTagPrefix($module);
$func = $prefix."_ItemCollection";
if(function_exists($func))
{
$var =& $func();
}
}
return $var;
}
function UpdateCategoryCount($item_type,$CategoriesIds,$ListType='')
{
global $objCountCache, $objItemTypes;
$db=&GetADODBConnection();
if( !is_numeric($item_type) )
{
$sql = 'SELECT ItemType FROM '.$objItemTypes->SourceTable.' WHERE ItemName=\''.$item_type.'\'';
$item_type=$db->GetOne($sql);
}
$objCountCache->EraseGlobalTypeCache($item_type);
if($item_type)
{
if(is_array($CategoriesIds))
{
$CategoriesIds=implode(',',$CategoriesIds);
}
if (!$CategoriesIds)
{
}
if(!is_array($ListType)) $ListType=Array($ListType=>'opa');
$sql = 'SELECT ParentPath FROM '.GetTablePrefix().'Category WHERE CategoryId IN ('.$CategoriesIds.')';
$rs = $db->Execute($sql);
$parents = Array();
while (!$rs->EOF)
{
$tmp=$rs->fields['ParentPath'];
$tmp=substr($tmp,1,strlen($tmp)-2);
$tmp=explode('|',$tmp);
foreach ($tmp as $tmp_cat_id) {
$parents[$tmp_cat_id]=1;
}
$rs->MoveNext();
}
$parents=array_keys($parents);
$list_types=array_keys($ListType);
foreach($parents as $ParentCategoryId)
{
foreach ($list_types as $list_type) {
$objCountCache->DeleteValue($list_type, $item_type, $ParentCategoryId, 0); // total count
$objCountCache->DeleteValue($list_type, $item_type, $ParentCategoryId, 1); // total count today
}
}
}
else
{
die('wrong item type passed to "UpdateCategoryCount"');
}
/* if(is_object($item))
{
$ItemType = $item->Get("ItemType");
$sql = "DELETE FROM ".$objCountCache->SourceTable." WHERE ItemType=$ItemType";
if( is_numeric($ListType) ) $sql .= " AND ListType=$ListType";
$objCountCache->adodbConnection->Execute($sql);
} */
}
function ResetCache($CategoryId)
{
global $objCountCache;
$db =& GetADODBConnection();
$sql = 'SELECT ParentPath FROM '.GetTablePrefix().'Category WHERE CategoryId = '.$CategoryId;
$parents = $db->GetOne($sql);
$parents = substr($parents,1,strlen($parents)-2);
$parents = explode('|',$parents);
foreach($parents as $ParentCategoryId)
{
$objCountCache->DeleteValue('_', TYPE_TOPIC, $ParentCategoryId, 0); // total topic count
$objCountCache->DeleteValue('_', TYPE_TOPIC, $ParentCategoryId, 1); // total
}
}
function UpdateModifiedCategoryCount($ItemTypeName,$CatId=NULL,$Modifier=0,$ExtraId=NULL)
{
}
function UpdateGroupCategoryCount($ItemTypeName,$CatId=NULL,$Modifier=0,$GroupId=NULL)
{
}
function GetTagCache($module,$tag,$attribs,$env)
{
global $objSystemCache, $objSession, $objConfig;
if($objConfig->Get("SystemTagCache") && !$objSession->Get('PortalUserId'))
{
$name = $tag;
if(is_array($attribs))
{
foreach($attribs as $n => $val)
{
$name .= "-".$val;
}
}
$CachedValue = $objSystemCache->GetContextValue($name,$module,$env, $objSession->Get("GroupList"));
}
else
$CachedValue="";
return $CachedValue;
}
function SaveTagCache($module, $tag, $attribs, $env, $newvalue)
{
global $objSystemCache, $objSession, $objConfig;
if($objConfig->Get("SystemTagCache"))
{
$name = $tag;
if(is_array($attribs))
{
foreach($attribs as $a => $val)
{
$name .= "-".$val;
}
}
$objSystemCache->EditCacheItem($name,$newvalue,$module,0,$env,$objSession->Get("GroupList"));
}
}
function DeleteTagCache($name,$extraparams, $env="")
{
global $objSystemCache, $objConfig;
if($objConfig->Get("SystemTagCache"))
{
$where = "Name LIKE '$name%".$extraparams."'";
if(strlen($env))
$where .= " AND Context LIKE $env";
$objSystemCache->DeleteCachedItem($where);
}
}
/**
* Deletes whole tag cache for
* selected module
*
* @param string $module
* @param string $name
* @access public
*/
function DeleteModuleTagCache($module, $tagname='')
{
global $objSystemCache, $objConfig;
if($objConfig->Get("SystemTagCache"))
{
$where = 'Module LIKE \''.$module.'\'';
if(strlen($tagname))
{
$where .= ' AND Name LIKE \''.$tagname.'\'';
}
$objSystemCache->DeleteCachedItem($where);
}
}
/*function ClearTagCache()
{
global $objSystemCache, $objConfig;
if($objConfig->Get("SystemTagCache"))
{
$where = '';
$objSystemCache->DeleteCachedItem($where);
}
}*/
/*function EraseCountCache()
{
// global $objSystemCache, $objConfig;
$db =& GetADODBConnection();
$sql = 'DELETE * FROM '.GetTablePrefix().'CountCache';
return $db->Execute($sql) ? true : false;
}*/
function ParseTagLibrary()
{
$objTagList = new clsTagList();
$objTagList->ParseInportalTags();
unset($objTagList);
}
function GetDateFormat($LangId = 0, $is_input = false)
{
global $objLanguages;
if (!$LangId) {
$LangId = $objLanguages->GetPrimary();
}
$l = $objLanguages->GetItem($LangId);
$fmt = is_object($l) ? $l->Get(($is_input ? 'Input' : '').'DateFormat') : 'm-d-Y';
if (getArrayValue($GLOBALS, 'FrontEnd')) {
return $fmt;
}
return preg_replace('/y+/i','Y', $fmt);
}
function GetTimeFormat($LangId = 0, $is_input = false)
{
global $objLanguages;
if (!$LangId) {
$LangId = $objLanguages->GetPrimary();
}
$l = $objLanguages->GetItem($LangId);
$fmt = is_object($l) ? $l->Get(($is_input ? 'Input' : '').'TimeFormat') : 'H:i:s';
return $fmt;
}
/**
* Gets one of currently selected language options
*
* @param string $optionName
* @param int $LangId
* @return string
* @access public
*/
function GetRegionalOption($optionName,$LangId=0)
{
global $objLanguages, $objSession;
if(!$LangId) $LangId=$objSession->Get('Language');
if(!$LangId) $LangId=$objLanguages->GetPrimary();
$l = $objLanguages->GetItem($LangId);
return is_object($l)?$l->Get($optionName):false;
}
/**
* Returns formatted timestamp
*
* @param int $TimeStamp
* @param int $LangId
* @param bool $is_input use input date format instead of display date format
* @return string
*/
function LangDate($TimeStamp = null, $LangId = 0, $is_input = false)
{
$fmt = GetDateFormat($LangId, $is_input);
return adodb_date($fmt, $TimeStamp);
}
/**
* Returns formatted timestamp
*
* @param int $TimeStamp
* @param int $LangId
* @param bool $is_input use input time format instead of display time format
* @return string
*/
function LangTime($TimeStamp = null, $LangId = 0, $is_input = false)
{
$fmt = GetTimeFormat($LangId, $is_input);
return adodb_date($fmt, $TimeStamp);
}
function LangNumber($Num,$DecPlaces=NULL,$LangId=0)
{
global $objLanguages;
if(!$LangId)
$LangId= $objLanguages->GetPrimary();
$l = $objLanguages->GetItem($LangId);
if(is_object($l))
{
$ret = number_format($Num,$DecPlaces,$l->Get("DecimalPoint"),$l->Get("ThousandSep"));
}
else
$ret = $num;
return $ret;
}
function replacePngTags($x, $spacer="images/spacer.gif")
{
global $rootURL,$pathtoroot;
// make sure that we are only replacing for the Windows versions of Internet
// Explorer 5+, and not Opera identified as MSIE
$msie='/msie\s([5-9])\.?[0-9]*.*(win)/i';
$opera='/opera\s+[0-9]+/i';
if(!isset($_SERVER['HTTP_USER_AGENT']) ||
!preg_match($msie,$_SERVER['HTTP_USER_AGENT']) ||
preg_match($opera,$_SERVER['HTTP_USER_AGENT']))
return $x;
// find all the png images in backgrounds
preg_match_all('/background-image:\s*url\(\'(.*\.png)\'\);/Uis',$x,$background);
for($i=0;$i<count($background[0]);$i++){
// simply replace:
// "background-image: url('image.png');"
// with:
// "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(
// enabled=true, sizingMethod=scale src='image.png');"
// haven't tested to see if background-repeat styles work...
$x=str_replace($background[0][$i],'filter:progid:DXImageTransform.'.
'Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale'.
' src=\''.$background[1][$i].'\');',$x);
}
// OK, time to find all the IMG tags with ".png" in them
preg_match_all('/(<img.*\.png.*>|<input.*type=([\'"])image\\2.*\.png.*>)/Uis',$x,$images);
while(list($imgnum,$v)=@each($images[0])){
$original=$v;
$atts=''; $width=0; $height=0;
// If the size is defined by styles, find
preg_match_all('/style=".*(width: ([0-9]+))px.*'.
'(height: ([0-9]+))px.*"/Ui',$v,$arr2);
if(is_array($arr2) && count($arr2[0])){
// size was defined by styles, get values
$width=$arr2[2][0];
$height=$arr2[4][0];
}
// size was not defined by styles, get values
preg_match_all('/width=\"?([0-9]+)\"?/i',$v,$arr2);
if(is_array($arr2) && count($arr2[0])){
$width=$arr2[1][0];
}
preg_match_all('/height=\"?([0-9]+)\"?/i',$v,$arr2);
if(is_array($arr2) && count($arr2[0])){
$height=$arr2[1][0];
}
preg_match_all('/src=\"([^\"]+\.png)\"/i',$v,$arr2);
if(isset($arr2[1][0]) && !empty($arr2[1][0]))
$image=$arr2[1][0];
else
$image=NULL;
// We do this so that we can put our spacer.gif image in the same
// directory as the image
$tmp=split('[\\/]',$image);
array_pop($tmp);
$image_path=join('/',$tmp);
if(substr($image,0,strlen($rootURL))==$rootURL)
{
$path = str_replace($rootURL,$pathtoroot,$image);
}
else
{
$path = $pathtoroot."themes/telestial/$image";
}
// echo "Sizing $path.. <br>\n";
// echo "Full Tag: ".htmlentities($image)."<br>\n";
//if(!$height || !$width)
//{
$g = imagecreatefrompng($path);
if($g)
{
$height = imagesy($g);
$width = imagesx($g);
}
//}
if(strlen($image_path)) $image_path.='/';
// end quote is already supplied by originial src attribute
$replace_src_with=$spacer.'" style="width: '.$width.
'px; height: '.$height.'px; filter: progid:DXImageTransform.'.
'Microsoft.AlphaImageLoader(src=\''.$image.'\', sizingMethod='.
'\'scale\')';
// now create the new tag from the old
$new_tag=str_replace($image,$replace_src_with,$original);
// now place the new tag into the content
$x=str_replace($original,$new_tag,$x);
}
return $x;
}
function GetOptions($field) // by Alex
{
// get dropdown values from custom field
$tmp =& new clsCustomField();
$tmp->LoadFromDatabase($field, 'FieldName');
$tmp_values = $tmp->Get('ValueList');
unset($tmp);
$tmp_values = explode(',', $tmp_values);
foreach($tmp_values as $mixed)
{
$elem = explode('=', trim($mixed));
$ret[ $elem[0] ] = $elem[1];
}
return $ret;
}
function ResetPage($module_prefix, $page_variable = 'p')
{
// resets page in specific module when category is changed
global $objSession;
if( !is_object($objSession) ) // when changing pages session doesn't exist -> InPortal BUG
{
global $var_list, $SessionQueryString, $FrontEnd;
$objSession = new clsUserSession($var_list["sid"],($SessionQueryString && $FrontEnd==1));
}
$last_cat = $objSession->GetVariable('last_category');
$prev_cat = $objSession->GetVariable('prev_category');
//echo "Resetting Page [$prev_cat] -> [$last_cat]<br>";
if($prev_cat != $last_cat) $GLOBALS[$module_prefix.'_var_list'][$page_variable] = 1;
}
if( !function_exists('GetVar') )
{
/**
* @return string
* @param string $name
* @param bool $post_priority
* @desc Get's variable from http query
*/
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] !== false ? $_POST[$name] : ( isset($_GET[$name]) && $_GET[$name] ? $_GET[$name] : false );
}
}
function SetVar($VarName, $VarValue)
{
$_REQUEST[$VarName] = $VarValue;
$_POST[$VarName] = $VarValue;
$_GET[$VarName] = $VarValue;
}
function PassVar(&$source)
{
// source array + any count of key names in passed array
$params = func_get_args();
array_shift($params);
if( count($params) )
{
$ret = Array();
foreach($params as $var_name)
if( isset($source[$var_name]) )
$ret[] = $var_name.'='.$source[$var_name];
$ret = '&'.implode('&', $ret);
}
return $ret;
}
function GetSubmitVariable(&$array, $postfix)
{
// gets edit status of module
// used in case if some modules share
// common action parsed by kernel parser,
// but each module uses own EditStatus variable
$modules = Array('In-Link' => 'Link', 'In-News' => 'News', 'In-Bulletin' => 'Topic', 'In-Portal'=>'Review');
foreach($modules as $module => $prefix)
if( isset($array[$prefix.$postfix]) )
return Array('Module' => $module, 'variable' => $array[$prefix.$postfix]);
return false;
}
function GetModuleByAction()
{
$prefix2module = Array('m' => 'In-Portal', 'l' => 'In-Link', 'n' => 'In-News', 'bb' => 'In-Bulletin');
$action = GetVar('Action');
if($action)
{
$module_prefix = explode('_', $action);
return $prefix2module[ $module_prefix[0] ];
}
else
return false;
}
function dir_size($dir) {
// calculates folder size based on filesizes inside it (recursively)
$totalsize=0;
if ($dirstream = @opendir($dir)) {
while (false !== ($filename = readdir($dirstream))) {
if ($filename!="." && $filename!="..")
{
if (is_file($dir."/".$filename))
$totalsize+=filesize($dir."/".$filename);
if (is_dir($dir."/".$filename))
$totalsize+=dir_size($dir."/".$filename);
}
}
}
closedir($dirstream);
return $totalsize;
}
function size($bytes) {
// shows formatted file/directory size
$types = Array("la_bytes","la_kilobytes","la_megabytes","la_gigabytes","la_terabytes");
$current = 0;
while ($bytes > 1024) {
$current++;
$bytes /= 1024;
}
return round($bytes,2)." ".language($types[$current]);
}
function echod($str)
{
// echo debug output
echo str_replace( Array('[',']'), Array('[<b>', '</b>]'), $str).'<br>';
}
function PrepareParams($source, $to_lower, $mapping)
{
// prepare array with form values to use with item
$result = Array();
foreach($to_lower as $field)
$result[ $field ] = $source[ strtolower($field) ];
if( is_array($mapping) )
{
foreach($mapping as $field_from => $field_to)
$result[$field_to] = $source[$field_from];
}
return $result;
}
function GetELT($field, $phrases = Array())
{
// returns FieldOptions equivalent in In-Portal
$ret = Array();
foreach($phrases as $phrase)
$ret[] = admin_language($phrase);
$ret = "'".implode("','", $ret)."'";
return 'ELT('.$field.','.$ret.')';
}
function GetModuleImgPath($module)
{
global $rootURL, $admin;
return $rootURL.$module.'/'.$admin.'/images';
}
function ActionPostProcess($StatusField, $ListClass, $ListObjectName = '', $IDField = null)
{
// each action postprocessing stuff from admin
if( !isset($_REQUEST[$StatusField]) ) return false;
$list =& $GLOBALS[$ListObjectName];
if( !is_object($list) ) $list = new $ListClass();
$SFValue = $_REQUEST[$StatusField]; // status field value
switch($SFValue)
{
case 1: // User hit "Save" button
$list->CopyFromEditTable($IDField);
break;
case 2: // User hit "Cancel" button
$list->PurgeEditTable($IDField);
break;
}
if( function_exists('SpecificProcessing') ) SpecificProcessing($StatusField, $SFValue);
if($SFValue == 1 || $SFValue == 2) $list->Clear();
}
function MakeHTMLTag($element, $attrib_prefix)
{
$result = Array();
$ap_length = strlen($attrib_prefix);
foreach($element->attributes as $attib_name => $attr_value)
if( substr($attib_name, $ap_length) == $ap_length )
$result[] = substr($attib_name, $ap_length, strlen($attib_name)).'="'.$attr_value.'"';
return count($result) ? implode(' ', $result) : false;
}
function GetImportScripts()
{
// return currently installed import scripts
static $import_scripts = Array();
if( count($import_scripts) == 0 )
{
$sql = 'SELECT imp.* , m.LoadOrder
FROM '.TABLE_PREFIX.'ImportScripts imp
LEFT JOIN '.TABLE_PREFIX.'Modules m ON m.Name = imp.is_Module
WHERE m.Loaded = 1
ORDER BY m.LoadOrder';
$db =& GetADODBConnection();
$rs = $db->Execute($sql);
if ($rs && $rs->RecordCount() > 0) {
while (!$rs->EOF) {
$rec =& $rs->fields;
$import_scripts[ $rec['is_id'] ] = Array( 'label' => $rec['is_label'], 'url' => $rec['is_script'],
'enabled' => $rec['is_enabled'], 'field_prefix' => $rec['is_field_prefix'],
'id' => $rec['is_string_id'], 'required_fields' => $rec['is_requred_fields'],
'module' => strtolower($rec['is_Module']) );
$rs->MoveNext();
}
}
else {
$import_scripts = Array();
}
}
return $import_scripts;
}
function GetImportScript($id)
{
$scripts = GetImportScripts();
return isset($scripts[$id]) ? $scripts[$id] : false;
}
function GetNextTemplate($current_template)
{
// used on front, returns next template to make
// redirect to
$dest = GetVar('dest', true);
if(!$dest) $dest = GetVar('DestTemplate', true);
return $dest ? $dest : $current_template;
}
// functions for dealign with enviroment variable construction
function GenerateModuleEnv($prefix, $var_list)
{
// globalize module varible arrays
$main =& $GLOBALS[$prefix.'_var_list'];
$update =& $GLOBALS[$prefix.'_var_list_update'];
//echo "VAR: [$main]; VAR_UPDATE: [$update]<br>";
// if update var count is zero, then do nothing
if( !is_array($update) || count($update) == 0 ) return '';
// ensure that we have no empty values in enviroment variable
foreach($update as $vl_key => $vl_value) {
if(!$vl_value) $update[$vl_key] = '0'; // unset($update[$vl_key]);
}
foreach($main as $vl_key => $vl_value) {
+ // we need to skip wid here, otherwise empty wid will become 0 and the window name for javascript will be changed (to main_0),
+ // making all links to original (main) window open in new window
+ if ($vl_key == 'wid') continue;
if(!$vl_value) $main[$vl_key] = '0'; // unset($main[$vl_key]);
}
$ret = Array();
foreach($var_list as $var_name) {
$value = GetEnvVar($prefix, $var_name);
if(!$value && $var_name == 'id') $value = '0';
$ret[] = $value;
}
// Removing all var_list_udpate
$keys = array_keys($update);
foreach ($keys as $key) {
unset($update[$key]);
}
return ':'.$prefix.implode('-',$ret);
}
// functions for dealign with enviroment variable construction
function GenerateModuleEnv_NEW($prefix, $var_list)
{
// globalize module varible arrays
$main =& $GLOBALS[$prefix.'_var_list'];
$update =& $GLOBALS[$prefix.'_var_list_update'];
//echo "VAR: [$main]; VAR_UPDATE: [$update]<br>";
if ( isset($update) && $update )
{
// ensure that we have no empty values in enviroment variable
foreach($update as $vl_key => $vl_value) {
if(!$vl_value) $update[$vl_key] = '0'; // unset($update[$vl_key]);
}
$app =& kApplication::Instance();
$passed = $app->GetVar('prefixes_passed');
$passed[] = $prefix;
$app->SetVar('prefixes_passed', $passed);
}
else
{
return Array();
}
if ($main) {
foreach($main as $vl_key => $vl_value) {
if(!$vl_value) $main[$vl_key] = '0'; // unset($main[$vl_key]);
}
}
$ret = Array();
foreach($var_list as $src_name => $dst_name) {
$ret[$dst_name] = GetEnvVar($prefix, $src_name);
}
// Removing all var_list_udpate
if ( isset($update) && $update )
{
$keys = array_keys($update);
foreach ($keys as $key) unset($update[$key]);
}
return $ret;
}
function GetEnvVar($prefix, $name)
{
// get variable from template variable's list
// (used in module parsers to build env string)
$main =& $GLOBALS[$prefix.'_var_list'];
$update =& $GLOBALS[$prefix.'_var_list_update'];
// if part of env found in POST, then use it first
$submit_value = GetVar($prefix.'_'.$name);
if ($submit_value !== false) {
return $submit_value;
}
return isset($update[$name]) ? $update[$name] : ( isset($main[$name]) ? $main[$name] : '');
}
/**
* Checks if debug mode is active
*
* @return bool
*/
function IsDebugMode($check_debugger = true)
{
$application =& kApplication::Instance();
return $application->isDebugMode($check_debugger);
}
/**
* Checks if we are in admin
*
* @return bool
*/
function IsAdmin()
{
$application =& kApplication::Instance();
return $application->IsAdmin();
}
/**
* Two strings in-case-sensitive compare.
* Returns >0, when string1 > string2,
* <0, when string1 > string2,
* 0, when string1 = string2
*
* @param string $string1
* @param string $string2
* @return int
*/
function stricmp ($string1, $string2) {
return strcmp(strtolower($string1), strtolower($string2));
}
/**
* Generates unique code
*
* @return string
*/
function GenerateCode()
{
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 bracket_comp($elem1, $elem2)
{
if( ($elem1['End']>$elem2['End'] || $elem1['End'] == -1) && $elem2['End'] != -1 )
{
return 1;
}
elseif ( ($elem1['End']<$elem2['End'] || $elem2['End'] == -1) && $elem1['End'] != -1 )
{
return -1;
}
else
{
return 0;
}
}
function bracket_id_sort($first_id, $second_id)
{
$first_abs = abs($first_id);
$second_abs = abs($second_id);
$first_sign = ($first_id == 0) ? 0 : $first_id / $first_abs;
$second_sign = ($second_id == 0) ? 0 : $second_id / $second_abs;
if($first_sign != $second_sign)
{
if($first_id > $second_id) {
$bigger =& $first_abs;
$smaller =& $second_abs;
}
else {
$bigger =& $second_abs;
$smaller =& $first_abs;
}
$smaller = $bigger + $smaller;
}
if($first_abs > $second_abs) {
return 1;
}
elseif ($first_abs < $second_abs)
{
return -1;
}
else
{
return 0;
}
}
function ap_bracket_comp($elem1, $elem2)
{
if ($elem1['FromAmount']!="" && $elem1['ToAmount']=="" && $elem2['FromAmount']!="" && $elem2['ToAmount']!="") return 1;
if ($elem1['FromAmount']!="" && $elem1['ToAmount']=="" && $elem2['FromAmount']=="" && $elem2['ToAmount']=="") return -1;
if ($elem1['ToAmount']=="" && $elem2['ToAmount']!="") return 1;
if ($elem1['ToAmount']!="" && $elem2['ToAmount']=="") return -1;
if( ($elem1['ToAmount']>$elem2['ToAmount'] && $elem2['ToAmount']!=-1) || ($elem1['ToAmount'] == -1 && $elem2['ToAmount'] != -1 ))
{
return 1;
}
elseif ( ($elem1['ToAmount']<$elem2['ToAmount']) || ($elem2['ToAmount'] == -1 && $elem1['ToAmount'] != -1 ))
{
return -1;
}
else
{
return 0;
}
}
function inp_htmlize($var, $strip = 0)
{
if( is_array($var) )
{
foreach($var as $k => $v) $var[$k] = inp_htmlize($v, $strip);
}
else
{
$var = htmlspecialchars($strip ? stripslashes($var) : $var);
}
return $var;
}
/**
* Sets in-portal cookies, that will not harm K4 to breath free :)
*
* @param string $name
* @param mixed $value
* @param int $expire
* @author Alex
*/
function set_cookie($name, $value, $expire = 0, $cookie_path = null)
{
if (!isset($cookie_path))
{
$cookie_path = IsAdmin() ? rtrim(BASE_PATH, '/').'/admin' : BASE_PATH;
}
setcookie($name, $value, $expire, $cookie_path, $_SERVER['HTTP_HOST']);
}
/**
* If we are on login required template, but we are not logged in, then logout user
*
* @return bool
*/
function require_login($condition = null, $redirect_params = 'logout=1', $pass_env = false)
{
if( !isset($condition) ) $condition = !admin_login();
if(!$condition) return false;
global $objSession, $adminURL;
if( !headers_sent() ) set_cookie(SESSION_COOKIE_NAME, ' ', adodb_mktime() - 3600);
$objSession->Logout();
if($pass_env) $redirect_params = 'env='.BuildEnv().'&'.$redirect_params;
header('Location: '.$adminURL.'/index.php?'.$redirect_params);
exit;
}
/**
* Builds up K4 url from data supplied by in-portal
*
* @param string $t template
* @param Array $params
* @param string $index_file
* @return string
*/
function HREF_Wrapper($t = '', $params = null, $index_file = null)
{
$url_params = BuildEnv_NEW();
if( isset($params) ) $url_params = array_merge_recursive2($url_params, $params);
if(!$t)
{
$t = $url_params['t'];
unset($url_params['t']);
}
$app =& kApplication::Instance();
return $app->HREF($t, '', $url_params, $index_file);
}
/**
* Set url params based on tag params & mapping hash passed
*
* @param Array $url_params - url params before change
* @param Array $tag_attribs - tag attributes
* @param Array $params_map key - tag_param, value - url_param
*/
function MapTagParams(&$url_params, $tag_attribs, $params_map)
{
foreach ($params_map as $tag_param => $url_param)
{
if( getArrayValue($tag_attribs, $tag_param) ) $url_params[$url_param] = $tag_attribs[$tag_param];
}
}
function ExtractParams($params_str, $separator = '&')
{
if(!$params_str) return Array();
$ret = Array();
$parts = explode($separator, trim($params_str, $separator) );
foreach ($parts as $part)
{
list($var_name, $var_value) = explode('=', $part);
$ret[$var_name] = $var_value;
}
return $ret;
}
function &recallObject($var_name, $class_name)
{
if (!isset($GLOBALS[$var_name]) || !is_object($GLOBALS[$var_name]))
{
$GLOBALS[$var_name] = new $class_name();
}
return $GLOBALS[$var_name];
}
/**
* Returns true in case of AM/PM time
*
* @return bool
*/
function is12HourMode()
{
return preg_match('/(a|A)/', GetTimeFormat() );
}
/**
* Saves custom fields for old in-portal items
*
* @param string $prefix K4 prefix of item
* @param int $resource_id resource id of item
* @param int $item_type type of custom fields
*/
function saveCustomFields($prefix, $resource_id, $item_type)
{
$objCustomEdit = new clsCustomDataList();
$CustomFields = new clsCustomFieldList($item_type);
$data_changed = false;
for ($i = 0; $i < $CustomFields->NumItems(); $i++) {
$objField =& $CustomFields->GetItemRefByIndex($i);
$field_name = $objField->Get('FieldName');
$element_type = $objField->Get('ElementType');
$value = getCustomValue($field_name);
if ($element_type == 'checkbox' && $value === false) {
// unchecked checkboxes are not submitted
$value = 0;
}
if ($value !== false) {
$objCustomEdit->SetFieldValue($objField->Get('CustomFieldId'), $resource_id, $value);
$data_changed = true;
}
}
if ($data_changed) {
$objCustomEdit->SaveData($prefix, $resource_id);
}
}
/**
* Returns custom field value from submit
*
* @param string $field_name
* @return mixed
*/
function getCustomValue($field_name)
{
if (IsAdmin()) {
$field_name = '_'.$field_name;
}
elseif (isset($_POST[strtolower($field_name)])) {
$field_name = strtolower($field_name);
}
return GetVar($field_name);
}
function checkActionPermission($action_mapping, $action, $system = 0)
{
$application =& kApplication::Instance();
if (!isset($action_mapping[$action])) {
// if no permission mapping defined, then action is allowed in any case
return true;
}
$perm_status = false;
$action_mapping = explode('|', $action_mapping[$action]);
foreach ($action_mapping as $perm_name) {
$perm_status = $application->CheckPermission($perm_name, $system);
if ($perm_status) {
break;
}
}
if (!$perm_status) {
$application->Redirect($application->IsAdmin() ? 'no_permission' : $application->ConfigValue('NoPermissionTemplate'), null, '', 'index.php');
}
return true;
}
function checkViewPermission($section_name, $system = 1)
{
$application =& kApplication::Instance();
$application->InitParser();
$application->ProcessParsedTag('m', 'RequireLogin', Array('permissions' => $section_name.'.view', 'system' => $system, 'index_file' => 'index.php'));
}
?>
Property changes on: trunk/kernel/include/globals.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/kernel/include/portaluser.php
===================================================================
--- trunk/kernel/include/portaluser.php (revision 8103)
+++ trunk/kernel/include/portaluser.php (revision 8104)
@@ -1,1165 +1,1199 @@
<?php
RegisterPrefix("clsPortalUser","user","kernel/include/portaluser.php");
class clsPortalUser extends clsItem
{
var $Vars; //contains the PersistantSessionData for the user
var $VarsLoaded;
var $PrimeGroup;
function clsPortalUser($UserId=NULL)
{
// $this->clsParsedItem();
$this->clsItem();
$this->tablename=GetTablePrefix()."PortalUser";
$this->type=6;
$this->Prefix = 'u';
$this->BasePermission="USER";
$this->id_field = "PortalUserId";
$this->TagPrefix="user";
$this->Vars = Array();
$this->VarsLoaded = FALSE;
$this->debuglevel = 0;
if(isset($UserId))
$this->LoadFromDatabase($UserId);
}
function Create()
{
$ret = parent::Create();
if ($ret && $this->isLiveTable())
{
$application =& kApplication::Instance();
$sync_manager =& $application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('createUser', $this->Data);
}
return $ret;
}
function Update($UpdatedBy = null, $modificationDate = null)
{
$ret = parent::Update($UpdatedBy, $modificationDate);
if ($ret && $this->isLiveTable())
{
$application =& kApplication::Instance();
$sync_manager =& $application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('updateUser', $this->Data);
}
return $ret;
}
function Delete()
{
global $objGroups, $objFavorites;
$g = $objGroups->GetPersonalGroup($this->Get("Login"));
if (is_object($g)) $g->Delete();
$objFavorites->DeleteUser($this->Get("PortalUserId")); //delete favorites
$ret = parent::Delete();
if($ret && $this->isLiveTable())
{
$application =& kApplication::Instance();
$sync_manager =& $application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('deleteUser', $this->Data);
}
return $ret;
}
function RemoveFromAllGroups()
{
$sql = "DELETE FROM ".GetTablePrefix()."UserGroup WHERE PortaluserId=".$this->Get("PortalUserId");
$this->adodbConnection->Execute($sql);
}
function RemoveFromGroup($GroupId)
{
$sql = "DELETE FROM ".GetTablePrefix()."UserGroup WHERE PortaluserId=".$this->Get("PortalUserId");
$sql .= " AND GroupId=$GroupId";
$this->adodbConnection->Execute($sql);
}
function PrimaryGroup($ReturnField = "GroupId")
{
global $objGroups;
$ret = "";
if(!is_object($this->PrimeGroup))
{
if((int)$this->Get("GroupId")>0)
{
$this->PrimeGroup =& $objGroups->GetItem($this->Get("GroupId"));
}
else
{
$this->PrimeGroup = new clsPortalGroup();
$sql = "SELECT * FROM ".GetTablePrefix()."UserGroup INNER JOIN ".GetTablePrefix()."PortalGroup ON (".GetTablePrefix()."UserGroup.GroupId=".GetTablePrefix()."PortalGroup.GroupId) WHERE PrimaryGroup = 1 AND PortalUserId=".$this->Get("PortalUserId");
//echo $sql;
$rs = $this->adodbConnection->Execute($sql);
if($rs && !$rs->EOF)
$this->PrimeGroup->SetFromArray($rs->fields);
}
}
$ret = $this->PrimeGroup->Get($ReturnField);
return $ret;
}
function SetPrimaryGroup($GroupId)
{
if($this->IsInGroup($GroupId))
{
$sql = "UPDATE ".GetTablePrefix()."UserGroup SET PrimaryGroup=0 WHERE PortalUserId=".$this->Get("PortalUserId");
$this->adodbConnection->Execute($sql);
$sql = "UPDATE ".GetTablePrefix()."UserGroup SET PrimaryGroup=1 WHERE GroupId=$GroupId AND PortalUserId=".$this->Get("PortalUserId");
$this->adodbConnection->Execute($sql);
}
}
function GetGroupList()
{
$ret = array();
$sql = "SELECT GroupId FROM %sUserGroup WHERE PortalUserId = %s ORDER BY PrimaryGroup";
$sql = sprintf($sql, GetTablePrefix(), $this->Get("PortalUserId"));
$ret = $this->adodbConnection->GetCol($sql);
return $ret;
}
function IsInGroup($GroupId)
{
$groups = $this->GetGroupList();
if( $groups === false ) return false;
return in_array($GroupId, $groups) ? true : false;
}
function GetPersonalGroup($CreateIfMissing = FALSE)
{
global $objGroups;
$n = "_".$this->Get("Login");
$g = $objGroups->GetItemByField("Name",$n);
if(!is_object($g) && $CreateIfMissing)
$g = $this->CreatePersonalGroup();
return $g;
}
function CreatePersonalGroup()
{
global $objGroups;
$Description = $this->Get("FirstName")." ".$this->Get("LastName");
$CreatedOn = adodb_mktime();
$n = "_".$this->Get("Login");
$g = $objGroups->Add_Group($n, $Description, $CreatedOn, 1, 0);
$g->Set("Personal",1);
$g->Set("System",0);
$g->Set("Enabled",1);
$g->Update();
if(is_object($g))
$g->AddUser($this->Get("PortalUserId"));
return $g;
}
function Validate()
{
global $Errors;
$dataValid = true;
if(!strlen($this->Get("Login")))
{
$Errors->AddError("error.fieldIsRequired",'Login',"","",get_class($this),"Validate");
$dataValid = false;
}
if(!strlen($this->Get("Email")))
{
$Errors->AddError("error.fieldIsRequired",'Email',"","",get_class($this),"Validate");
$dataValid = false;
}
return $dataValid;
}
function Approve()
{
$this->Set("Status", 1);
$this->Update();
$this->SendUserEventMail("USER.APPROVE",$this->Get("PortalUserId"));
$this->SendAdminEventMail("USER.APPROVE");
}
function Deny($IsBanned = 0)
{
$this->Set( Array('Status','IsBanned'), Array(0,$IsBanned) );
$this->Update();
$this->SendUserEventMail("USER.DENY",$this->Get("PortalUserId"));
$this->SendAdminEventMail("USER.DENY");
}
function HasSystemPermission($PermissionName)
{
global $objGroups;
$GroupList = $this->GetGroupList();
for($i=0;$i<count($GroupList);$i++)
{
$g = $objGroups->GetItem($GroupList[$i]);
$value = $g->HasSystemPermission($PermissionName);
if($value != -1)
break;
}
return $value;
}
function LoadPersistantVars()
{
global $objConfig;
unset($this->Vars);
$this->Vars = Array();
$user_id = $this->HasField('PortalUserId') ? $this->Get('PortalUserId') : 0;
$sql = "SELECT VariableName, VariableValue FROM ".GetTablePrefix()."PersistantSessionData WHERE PortalUserId = ".(int)$user_id." ORDER BY PortalUserId ASC";
$result = $this->adodbConnection->Execute($sql);
while ($result && !$result->EOF)
{
$data = $result->fields;
$this->Vars[$data["VariableName"]] = $data["VariableValue"];
if( basename($_SERVER['PHP_SELF']) != 'edit_config.php' )
{
$objConfig->Set($data["VariableName"], $data["VariableValue"], 1, 1);
}
$result->MoveNext();
}
$this->VarsLoaded = TRUE;
}
function SetPersistantVariable($variableName, $variableValue)
{
global $objConfig;
if(!$this->VarsLoaded)
$this->LoadPersistantVars();
$userid = $this->Get("PortalUserId");
$objConfig->Set($variableName,$variableValue,1);
$fields = array_keys($this->Vars);
if(strlen($variableValue)>0)
{
if(in_array($variableName,$fields))
{
$sql = "UPDATE ".GetTablePrefix()."PersistantSessionData SET VariableValue='$variableValue' WHERE VariableName='$variableName' AND PortalUserId=$userid";
}
else
$sql = "INSERT INTO ".GetTablePrefix()."PersistantSessionData (VariableName,VariableValue,PortalUserId) VALUES ('$variableName','$variableValue',$userid)";
}
else
$sql = "DELETE FROM ".GetTablePrefix()."PersistantSessionData WHERE VariableName='$variableName' AND PortalUserId=$userid";
$this->Vars[$variableName] = $variableValue;
// echo "<BR>SQL: $sql<BR>";
$this->adodbConnection->Execute($sql);
}
function GetPersistantVariable($variableName)
{
global $objConfig, $objSession;
if(!$this->VarsLoaded)
{
$this->LoadPersistantVars();
}
$fields = array_keys($this->Vars);
if(in_array($variableName,$fields))
{
$val = $this->Vars[$variableName];
}
else
{
if( $this->UniqueId() == $objSession->Get('PortalUserId') )
{
$val = $objConfig->Get($variableName);
}
else
{
$val = '';
}
}
return $val;
}
function GetAllPersistantVars()
{
if(!$this->VarsLoaded)
{
$this->LoadPersistantVars();
}
return $this->Vars;
}
function GetIcon()
{
}
function StatusIcon()
{
global $imagesURL;
$url = $imagesURL."/itemicons/icon16_user";
if($this->Get("Status")==0)
{
$url .= "_disabled";
}
else
if($this->Get("Status")==2)
{
$url .= "_pending";
}
$url .= ".gif";
return $url;
}
function IsFriend($UserId)
{
$ftable = GetTablePrefix()."Favorites";
$sql = "SELECT count(*) as FriendCount FROM $ftable WHERE PortalUserId=$UserId AND ResourceId=";
$sql .=$this->Get("ResourceId")." AND ItemTypeId=6";
$rs = $this->adodbConnection->Execute($sql);
if($rs && !$rs->EOF)
return ($rs->fields["FriendCount"]>0);
return FALSE;
}
function GetUserTime($timestamp)
{
if(is_numeric($this->Get("tz")))
{
return GetLocalTime($timestamp,$this->Get("tz"));
}
else
return GetLocalTime($timestamp);
}
function ParseObject($element)
{
global $objConfig, $objUsers, $objCatList,$objSession, $var_list_update, $var_list, $m_var_list_update;
//echo "<PRE>"; print_r($element); echo "</pre>";
//echo "Tag Prefix: ".$this->TagPrefix." Element: ".$element->name."<br>";
$this->clsPortalUser();
if (strtolower($element->name) == 'touser') {
$this->TagPrefix = "touser";
}
$extra_attribs = ExtraAttributes($element->attributes);
if(strtolower($element->name)==$this->TagPrefix)
{
$field = strtolower($element->attributes["_field"]);
if(substr($field,0,3)=="pp_")
{
$perm = $objSession->GetPersistantVariable($field);
if($perm)
{
$field = substr($field,3);
}
else
$field = "";
}
switch($field)
{
/*
@field:user.login
@description:User's login name
*/
case "username":
case "login":
$ret = $this->Get("Login");
break;
case "firstname":
$ret = $this->Get("FirstName");
break;
case "lastname":
$ret = $this->Get("LastName");
break;
case "password":
/*
@field:user.password
@description:User password
*/
/*$ret = $objSession->Get("password");
$objSession->Set("password", '');*/
$ret = GetVar('user_password');
break;
case "email":
$ret = $this->Get("Email");
break;
case "street":
$ret = $this->Get("Street");
break;
case "city":
$ret = $this->Get("City");
break;
case "state":
$ret = $this->Get("State");
break;
case "zip":
$ret = $this->Get("Zip");
break;
case "phone":
$ret = $this->Get("Phone");
break;
case "country":
$ret = $this->Get("Country");
break;
case "primarygroup":
/*
@field:user.primarygroup
@description:Parses a field from the user's primary group
@attrib:_groupfield::group field name to parse, defaults to group name
*/
$groupfield = $element->attributes["_groupfield"];
if(!strlen($groupfield))
$groupfield="Name";
$ret = $this->PrimaryGroup($groupfield);
break;
case "date":
/*
@field:user.date
@description:Returns the date/time the user was created
@attrib:_tz:bool:Convert the date to the user's local time
@attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr
*/
$d = $this->Get("CreatedOn");
if($element->attributes["_tz"])
{
$d = GetLocalTime($d,$objSession->Get("tz"));
}
$part = strtolower($element->attributes["_part"]);
if(strlen($part))
{
$ret = ExtractDatePart($part,$d);
}
else
{
if($d<=0)
{
$ret = "";
}
else
$ret = LangDate($d);
}
break;
case "dob":
/*
@field:user.dob
@description:Returns the date/time of the users date of birth
@attrib:_tz:bool:Convert the date to the user's local time
@attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr
*/
$d = $this->Get("dob");
if($element->attributes["_tz"])
{
$d = GetLocalTime($d,$objSession->Get("tz"));
}
$part = strtolower($element->attributes["_part"]);
if(strlen($part))
{
$ret = ExtractDatePart($part,$d);
}
else
{
// if($d<=0)
// {
// $ret = "";
// }
// else
$ret = LangDate($d);
}
break;
case "modified":
/*
@field:user.modified
@description:Returns the date/time the user was last modified
@attrib:_tz:bool:Convert the date to the user's local time
@attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr
*/
$d = $this->Get("Modified");
if($d<=0)
$d = $this->Get("CreatedOn");
if($element->GetAttributeByName('_tz'))
{
$d = GetLocalTime($d,$objSession->Get("tz"));
}
$part = strtolower($element->GetAttributeByName('_part'));
if(strlen($part))
{
$ret = ExtractDatePart($part,$d);
}
else
{
if($d<=0)
{
$ret = "";
}
else
$ret = LangDate($d);
}
break;
case 'send_pm_link':
$var_list_update['t'] = $element->GetAttributeByName('_Template');
$ret = HREF_Wrapper('', Array('ToUser' => $this->Get('Login') ) );
break;
case "profile_link":
/*
@field:user.profile_link
@description:Create a link to the user's profile
@attrib:_template:tpl:template the link should point to
*/
$t = $element->attributes["_template"];
if(strlen($t))
{
$var_list_update["t"] = $t;
}
else
{
$var_list_update["t"] = $var_list["t"];
}
$ret = HREF_Wrapper('', Array('UserId' => $this->Get('PortalUserId') ) );
break;
case "add_friend_link":
/*
@field:user.add_friend_link
@description:link to add a user to the friends list
@attrib:_template:tpl:Template link shoukd point to
*/
if($element->attributes["_force"] || !$this->IsFriend($objSession->Get("PortalUserId")) &&
$this->Get("PortalUserId") != $objSession->Get("PortalUserId"))
{
$t = $element->attributes["_template"];
if(strlen($t))
{
$var_list_update["t"] = $t;
}
else
{
$var_list_update["t"] = $var_list["t"];
}
$ret = HREF_Wrapper('', Array('Action' => 'm_add_friend', 'UserId' => $this->Get('PortalUserId') ) );
}
else
$ret = "";
break;
case "del_friend_link":
/*
@field:user.del_friend_link
@description:link to remove a user from the friends list
@attrib:_template:tpl:Template link shoukd point to
*/
if($element->attributes["_force"] || $this->IsFriend($objSession->Get("PortalUserId")) &&
$this->Get("PortalUserId") != $objSession->Get("PortalUserId"))
{
$t = $element->attributes["_template"];
if(strlen($t))
{
$var_list_update["t"] = $t;
}
else
{
$var_list_update["t"] = $var_list["t"];
}
$ret = HREF_Wrapper('', Array('Action' => 'm_del_friend', 'UserId' => $this->Get('PortalUserId') ) );
}
else
$ret = "";
break;
case "icon":
$ret = $this->GetIcon();
break;
case "image":
/*
@field:user.image
@description:Return an image associated with the user
@attrib:_default:bool:If true, will return the default image if the requested image does not exist
@attrib:_name::Return the image with this name
@attrib:_thumbnail:bool:If true, return the thumbnail version of the image
@attrib:_imagetag:bool:If true, returns a complete image tag. exta html attributes are passed to the image tag
*/
$avatar = $element->attributes["_avatar"];
$default = $element->attributes["_primary"];
$name = $element->attributes["_name"];
if ($avatar)
{
$img = $this->GetAvatarImage();
}
elseif(strlen($name))
{
$img = $this->GetImageByName($name);
// echo "<PRE>";print_r($img); echo "</PRE>";
}
elseif ($default)
{
$img = $this->GetDefaultImage();
}
if($img)
{
if($element->attributes["_thumbnail"])
{
$url = $img->parsetag("thumb_url");
}
else
$url = $img->parsetag("image_url");
}
else
{
$url = $element->attributes["_defaulturl"];
}
if($element->attributes["_imagetag"])
{
if(strlen($url))
{
$ret = "<IMG src=\"$url\" $extra_attribs >";
}
else
$ret = "";
}
else
$ret = $url;
break;
case "custom":
/*
@field:cat.custom
@description:Returns a custom field
@attrib:_customfield::field name to return
@attrib:_default::default value
*/
$field = $element->attributes["_customfield"];
$default = $element->attributes["
"];
$ret = $this->GetPersistantVariable($field);
if(!strlen($ret))
$ret = $this->GetCustomFieldValue($field,$default);
break;
default:
$ret = "Undefined:".$element->name;
break;
}
}
else
{
$ret = $this->parsetag($element->name);
}
return $ret;
}
function parsetag($tag)
{
global $m_var_list_update, $var_list_update, $var_list, $objConfig;
if(is_object($tag))
{
$tagname = $tag->name;
}
else
$tagname = $tag;
switch($tagname)
{
case "user_id":
return $this->Get("ResourceId");
break;
case "user_login":
return $this->Get("Login");
break;
case "user_group":
return $this->Get("PrimaryGroupName");
break;
case "user_firstname":
return $this->Get("FirstName");
break;
case "user_lastname":
return $this->Get("LastName");
break;
case "user_email":
return $this->Get("Email");
break;
case "user_date":
return LangDate($this->Get('CreatedOn'), 0, true);
break;
case "user_time":
return LangTime($this->Get('CreatedOn'), 0, true);
break;
case "user_dob":
return LangDate($this->Get('dob'), 0, true);
break;
case "user_password":
return $this->Get("Password");
break;
case "user_phone":
return $this->Get("Phone");
break;
case "user_street":
return $this->Get("Street");
break;
case "user_city":
return $this->Get("City");
break;
case "user_state":
return $this->Get("State");
break;
case "user_zip":
return $this->Get("Zip");
break;
case "user_country":
return $this->Get("Country");
break;
case "user_resourceid":
return $this->Get("ResourceId");
break;
case "user_icon":
return $this->GetIcon();
break;
case "user_profile_link":
$var_list_update["t"] = "user_profile";
$m_var_list_update["action"] = $this->Get("UserId");
$ret = HREF_Wrapper();
unset($m_var_list_update["action"], $var_list_update["t"]);
return $ret;
break;
case "user_messages":
return $this->NewMessages();
break;
case "user_messages_link":
$var_list_update["t"] = "inbulletin/bb_private_msg_list";
return HREF_Wrapper();
unset($var_list_update);
break;
default:
return "Undefined:$tagname";
break;
}
- }
+ }
+
+ /**
+ * Sends EmailEvent to user
+ *
+ * @param string $EventName email event name
+ * @param mixed $ToUserId recipient's user_id or email address
+ * @param int $LangId language_id (not in use)
+ * @param string $RecptName recipient's name (only when ID not passed)
+ * @return kEvent
+ */
+ function SendUserEventMail($EventName,$ToUserId,$LangId=NULL,$RecptName=NULL)
+ {
+ $object =& $this->Application->recallObject('u', null, Array ('skip_autoload' => true));
+ /* @var $object kDBItem */
+
+ $object->Load($this->UniqueId());
+
+ $send_params = is_numeric($ToUserId) ? Array() : Array ('to_email' => $ToUserId, 'to_name' => $RecptName);
+ $status = $this->Application->EmailEventUser($EventName, $ToUserId, $send_params);
+ $object->Load($this->Application->RecallVar('user_id'));
+ return $status;
+ }
+
+ function SendAdminEventMail($EventName,$LangId=NULL)
+ {
+ $object =& $this->Application->recallObject('u', null, Array ('skip_autoload' => true));
+ /* @var $object kDBItem */
+
+ $object->Load($this->UniqueId());
+
+ $status = $this->Application->EmailEventAdmin($EventName);
+ $object->Load($this->Application->RecallVar('user_id'));
+ return $status;
+ }
} /* class clsPortalUser*/
class clsUserManager extends clsItemList //clsItemCollection
{
/*this class wraps common user-related functions */
// var $Page;
function clsUserManager()
{
$this->clsItemCollection(); // clsItemList() // need to use this, but double limit clause being created (normal+default 0,100)
$this->Prefix = 'u';
$this->classname = "clsPortalUser";
$this->SetTable('live', GetTablePrefix().'PortalUser');
$this->Page = isset($_GET['lpn']) ? $_GET['lpn'] : 1;
$this->EnablePaging = true;
$this->PerPageVar = "Perpage_User";
$this->AdminSearchFields = array("Login","FirstName","LastName","Email","Street","City", "State","Zip","Country","Phone");
}
function GetPageLinkList($dest_template=NULL,$link_template=NULL,$page = "")
{
global $objConfig, $m_var_list_update, $var_list_update, $var_list;
// if(!strlen($page)) $page = GetIndexURL(2);
$NumPages = $this->GetNumPages($objConfig->Get("Perpage_Topics"));
if(strlen($dest_template)>0)
{
$var_list_update["t"]=$dest_template;
}
else
{
$var_list_update["t"] = $var_list["t"];
}
$o = "";
if($this->Page>1)
{
$m_var_list_update["p"]=$this->Page-1;
$prev_url = HREF_Wrapper();
}
if($this->Page<$NumPages)
{
$m_var_list_update["p"]=$this->Page+1;
$next_url = HREF_Wrapper();
}
for($p=1;$p<=$NumPages;$p++)
{
$t = template($link_template);
if($p!=$this->Page)
{
$m_var_list_update["p"]=$p;
$href = HREF_Wrapper();
$t = str_replace("<%page_link%>", $href, $t);
$t = str_replace("<%page_number%>",$p,$t);
$t = str_replace("<%prev_url%>",$prev_url,$t);
$t = str_replace("<%next_url%>",$next_url,$t);
$o .= $t;
}
else
{
$o .= "<SPAN class=\"CURRENT_PAGE\">$p</SPAN>";
}
}
return $o;
}
function GetUser($ID)
{
$u = $this->GetItem($ID);
return $u;
}
function GetUserName($Id)
{
$rs = $this->adodbConnection->Execute("SELECT Login from ".$this->SourceTable." where PortalUserId=$Id");
return $rs->fields["Login"];
}
function GetUserId($Login)
{
$rs = $this->adodbConnection->Execute("SELECT PortalUserId from ".$this->SourceTable." where Login LIKE '$Login'");
return $rs->fields["PortalUserId"];
}
function GetTotalUsers()
{
return $this->UserCount("1");
}
function GetLatestUser()
{
global $Errors;
$sql = "SELECT max(CreatedOn) as LastDate FROM ".$this->SourceTable;
$result = $this->adodbConnection->Execute($sql);
if ($result === false || !is_object($result))
{
$Errors->AddError("error.DatabaseError",NULL,$adodbConnection->ErrorMsg(),"",get_class($this),"GetLatestUser");
return false;
}
$sql = "SELECT PortalUserId FROM ".$this->SourceTable." WHERE CreatedOn >= ".$result->fields["LastDate"];
$result = $this->adodbConnection->Execute($sql);
if (!rs || $rs->EOF)
{
$Errors->AddError("error.DatabaseError",NULL,$adodbConnection->ErrorMsg(),"",get_class($this),"GetLatestUser");
return false;
}
$u = $this->GetUser($result->fields["PortalUserId"]);
return $u;
}
function &Add_User($Login, $Password, $Email, $CreatedOn, $FirstName="", $LastName="", $Status=2,
$Phone="", $Street="", $City="", $State="", $Zip="", $Country="", $dob=0, $ip="", $CheckBanned=FALSE)
{
$u = new clsPortalUser(NULL);
$u->tablename = $this->SourceTable;
//echo "Creating User..<br>\n";
$u->Set(array("Login", "Password", "FirstName", "LastName", "Email", "Status",
"Phone","Street", "City", "State", "Zip", "Country", "CreatedOn","dob"),
array($Login, $Password, $FirstName, $LastName, $Email, $Status,
$Phone, $Street, $City, $State, $Zip, $Country, $CreatedOn, $dob));
$BrokenRule = $CheckBanned ? $u->CheckBanned() : false;
if(!$BrokenRule)
{
$u->Create();
$this->processEvent($u, 'OnAfterItemCreate');
return $u;
}
return $BrokenRule;
/*md5($Password)*/
}
function &Add_User_NEW($fields_hash, $check_banned = false)
{
$user = new clsPortalUser(NULL);
$user->tablename = $this->SourceTable;
foreach ($fields_hash as $field_name => $field_value) {
$user->Set($field_name, $field_value);
}
$broken_rule = $check_banned ? $user->CheckBanned() : false;
if (!$BrokenRule) {
$user->Create();
$this->processEvent($user, 'OnAfterItemCreate');
return $user;
}
return $BrokenRule;
}
function &Edit_User_NEW($id, $fields_hash)
{
$user =& $this->GetItem($id);
if (!is_object($user)) {
return $user;
}
$fields_hash['IsBanned'] = $user->Get('IsBanned');
if ($fields_hash['Status'] == 1) {
$fields_hash['IsBanned'] = 0;
}
if (isset($fields_hash['Password']) && !$fields_hash['Password']) {
unset($fields_hash['Password']);
}
foreach ($fields_hash as $field_name => $field_value) {
$user->Set($field_name, $field_value);
}
$user->Update();
$this->processEvent($user, 'OnAfterItemUpdate');
return $user;
}
function &Edit_User($UserId, $Login, $Password, $Email, $CreatedOn, $FirstName="", $LastName="",
$Status=2, $Phone="", $Street="", $City="", $State="", $Zip="", $Country="", $dob=0, $MinPwResetDelay=300)
{
//echo "<font color=\"red\">Editing User: [$UserId]</font><br>";
$u =& $this->GetItem($UserId);
if(!$CreatedOn)
$CreatedOn = $u->Get("CreatedOn");
// $u->debuglevel=1;
if (is_object($u))
{
$IsBanned = $u->Get('IsBanned');
if($Status == 1) $IsBanned = 0;
$u->Set(array("Login", "FirstName", "LastName", "Email", "Status",
"Phone", "Street", "City", "State", "Zip", "Country", "CreatedOn","dob","IsBanned", "MinPwResetDelay"),
array($Login, $FirstName, $LastName, $Email, $Status,
$Phone, $Street, $City, $State, $Zip, $Country, $CreatedOn,$dob,$IsBanned,$MinPwResetDelay));
if(strlen($Password))
$u->Set("Password",$Password);
$u->Update();
}
$this->processEvent($u, 'OnAfterItemUpdate');
return $u;
}
/**
* Enter description here...
*
* @param clsPortalUser $user
* @param string $event_name
*/
function processEvent(&$user, $event_name)
{
if ($user->UsingTempTable()) {
return true;
}
$user_dummy =& $this->Application->recallObject('u.-item', null, Array('skip_autoload' => true));
$user_dummy->SetDBFieldsFromHash($user->Data);
$user_dummy->setID($user->UniqueId());
$event = new kEvent('u.-item:'.$event_name);
$event->setEventParam('id', $user_dummy->GetID() );
$this->Application->HandleEvent($event);
}
function Delete_User($UserId)
{
$u = $this->GetItemByField("ResourceId",$UserId);
if(is_object($u))
{
$u->RemoveFromAllGroups();
$u->Delete();
}
}
function LoadUsers($where = "",$orderBy = "")
{
global $objConfig;
$this->Clear();
if($this->Page<1)
$this->Page=1;
if(is_numeric($objConfig->Get("Perpage_Users")))
{
$Start = ($this->Page-1)*$objConfig->Get("Perpage_Users");
$limit = "LIMIT ".$Start.",".$objConfig->Get("Perpage_Users");
}
else
$limit = NULL;
$where = trim($where);
$orderBy = trim($orderBy);
if(!strlen($where))
$where = "1";
$this->QueryItemCount=TableCount($this->SourceTable,$where,0);
if($this->QueryItemCount>0)
{
if ($orderBy!="")
{
$this->Query_PortalUser($where,$orderBy,$limit);
}
else
{
$this->Query_PortalUser($where,"Login DESC",$limit);
}
}
}
function Query_PortalUser($whereClause,$orderByClause="", $limitClause="")
{
global $m_var_list,$Errors, $objSession;
$resultSet = array();
$utable = $this->SourceTable;
$gtable = GetTablePrefix()."UserGroup";
$sql = "SELECT * FROM $utable LEFT JOIN $gtable ON ($utable.PortalUserId=$gtable.PortalUserId)";
if(isset($whereClause))
$sql = sprintf('%s WHERE %s',$sql,$whereClause);
if(isset($orderByClause))
if(strlen(trim($orderByClause))>0)
$sql = sprintf('%s ORDER BY %s',$sql,$orderByClause);
if(isset($limitClause))
$sql = sprintf('%s %s',$sql,$limitClause);
return $this->Query_Item($sql);
}
function Query_GroupPortalUser($whereClause,$orderByClause)
{
global $m_var_list,$objSession,$Errors;
$resultSet = array();
$table = $this->SourceTable;
$sql = "SELECT * FROM $table LEFT JOIN ".GetTablePrefix()."UserGroup USING (PortalUserId) ";
if(isset($whereClause))
$sql = sprintf('%s WHERE %s',$sql,$whereClause);
if(isset($orderByClause))
$sql = sprintf('%s ORDER BY %s',$sql,$orderByClause);
return $this->query_item($sql);
}
function UserCount($whereClause)
{
$count = TableCount($this->SourceTable,$whereClause,0);
return $count;
}
function CountActive()
{
return $this->UserCount("Status=1");
}
function CountPending()
{
return $this->UserCount("Status=2");
}
function CountDisabled()
{
return $this->UserCount("Status=0");
}
function CopyFromEditTable($idfield)
{
global $objSession;
$this->Application->SetVar('u_mode', '');
$GLOBALS['_CopyFromEditTable']=1;
$edit_table = $objSession->GetEditTable($this->SourceTable);
$sql = "SELECT * FROM $edit_table";
$rs = $this->adodbConnection->Execute($sql);
$user_dummy =& $this->Application->recallObject('u.-item', null, Array('skip_autoload' => true));
$item_ids = Array();
while ($rs && !$rs->EOF) {
$data = $rs->fields;
$c = new $this->classname;
$c->SetFromArray($data);
$c->idfield = $idfield;
$c->Dirty();
$user_dummy->SetDBFieldsFromHash($data);
if ($c->Get($idfield) < 1) {
$old_id = $c->Get($idfield);
$c->UnsetIdField();
$c->Create();
$sql = "UPDATE ".GetTablePrefix()."UserGroup SET PortalUserId=".$c->Get("PortalUserId");
$sql .=" WHERE PortalUserId=0";
$this->adodbConnection->Execute($sql);
$event_name = 'OnAfterItemCreate';
}
else {
$c->Update();
$event_name = 'OnAfterItemUpdate';
}
$user_dummy->setID($c->UniqueId());
// process after hooks: begin
$event = new kEvent('u.-item:'.$event_name);
$event->setEventParam('id', $user_dummy->GetID() );
$this->Application->HandleEvent($event);
// process after hooks: end
$item_ids[] = $c->UniqueId();
unset($c);
$rs->MoveNext();
}
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
unset($GLOBALS['_CopyFromEditTable']);
return $item_ids;
}
function PurgeEditTable()
{
parent::PurgeEditTable();
$sql = "DELETE FROM ".GetTablePrefix()."UserGroup WHERE PortalUserId=0";
$this->adodbConnection->Execute($sql);
}
} /*clsUserManager*/
?>
Property changes on: trunk/kernel/include/portaluser.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.36
\ No newline at end of property
+1.37
\ No newline at end of property
Index: trunk/kernel/include/itemdb.php
===================================================================
--- trunk/kernel/include/itemdb.php (revision 8103)
+++ trunk/kernel/include/itemdb.php (revision 8104)
@@ -1,697 +1,698 @@
<?php
define('FT_OPTION', 1); // option formatter
class clsItemDB
{
var $Formatters = Array(); // by Alex
var $m_dirtyFieldsMap = array();
var $Data = array();
var $adodbConnection;
var $tablename;
var $BasePermission;
var $id_field;
var $NoResourceId;
var $debuglevel;
var $Prefix = '';
var $Special = '';
var $SelectSQL = 'SELECT * FROM %s WHERE %s';
/**
* Application object
*
* @var kApplication
*/
var $Application = null;
/**
* Connection to database
*
* @var kDBConnection
*/
var $Conn = null;
function clsItemDB()
{
if (class_exists('kApplication')) {
// just in case when aplication is not found
$this->Application =& kApplication::Instance();
$this->Conn =& $this->Application->GetADODBConnection();
}
$this->adodbConnection = &GetADODBConnection();
$this->tablename="";
$this->NoResourceId=0;
$this->debuglevel=0;
}
// ============================================================================================
function GetFormatter($field)
{
return $this->HasFormatter($field) ? $this->Formatters[$field] : false;
}
function isLiveTable()
{
global $objSession;
return !preg_match('/'.GetTablePrefix().'ses_'.$objSession->GetSessionKey().'_edit_(.*)/', $this->tablename);
}
function SetFormatter($field, $type, $params)
{
// by Alex
// all params after 2nd are formmater type specific
$this->Formatters[$field]['type'] = $type;
switch($type)
{
case FT_OPTION:
$this->Formatters[$field]['options'] = $params;
break;
}
}
/*
function FormatFields()
{
// format item in list data before printing
foreach($this->Formatters as $field => $formatter)
$this->Data[$field] = $this->FormatField($field);
}
*/
function FormatField($field)
{
// formats single field if it has formatter
if( $this->HasFormatter($field) )
{
$fmt = $this->Formatters[$field];
switch($fmt['type'])
{
case FT_OPTION:
return $fmt['options'][ $this->Data[$field] ];
break;
}
}
else
return $this->Get($field);
}
function HasFormatter($field)
{
// checks if formatter is set for field
return isset($this->Formatters[$field]) ? 1 : 0;
}
// ============================================================================================
function UnsetIdField()
{
$f = $this->IdField();
unset($this->Data[$f]);
unset($this->m_dirtyFieldsMap[$f]);
}
function UnsetField($field)
{
unset($this->Data[$field]);
unset($this->m_dirtyFieldsMap[$field]);
}
function IdField()
{
if(!strlen($this->id_field))
{
return $this->tablename."Id";
}
else
return $this->id_field;
}
function UniqueId()
{
return $this->Get($this->IdField());
}
function SetUniqueId($value)
{
$var = $this->IdField();
if( $this->UsingTempTable() ) $value = $this->UniqueId();
$this->Set($var, $value);
}
function SetModified($UserId=NULL,$modificationDate=null)
{
global $objSession;
$keys = array_keys($this->Data);
if(in_array("Modified",$keys))
{
$this->Set("Modified", isset($modificationDate) ? $modificationDate : adodb_date("U") );
}
if(in_array("ModifiedById",$keys))
{
if(!$UserId)
$UserId = $objSession->Get("PortalUserId");
$this->Set("ModifiedById",$UserId);
}
}
function PrintVars()
{
echo '<pre>'.print_r($this->Data, true).'</pre>';
}
// =================================================================
function GetFormatted($name)
{
// get formatted field value
return $this->FormatField($name);
}
function Get($name)
{
// get un-formatted field value
//if( !isset($this->Data[$name]) ) print_pre( debug_backtrace() );
return $this->HasField($name) ? $this->Data[$name] : '';
}
// =================================================================
function HasField($name)
{
// checks if field exists in item
return isset($this->Data[$name]) ? 1 : 0;
}
/**
* Set's value(-s) of field(-s) specified.
* Modifies HasChanges flag automatically.
*
* @param string/array $name
* @param string/array $value
* @access public
*/
function Set($name, $value)
{
//echo "Setting Field <b>$name</b>: = [$value]<br>";
if( is_array($name) )
{
for ($i=0; $i < sizeof($name); $i++)
{
$this->_Set($name[$i],$value[$i]);
}
}
else
{
$this->_Set($name,$value);
}
}
/**
* Set's value(-s) of field(-s) specified.
* Modifies HasChanges flag automatically.
*
* @param string $name
* @param string $value
* @access private
*/
function _Set($name,$value)
{
$var = 'm_'.$name;
if( !$this->HasField($name) || $this->Data[$name] != $value )
{
if( !(isset($_GET['new']) && $_GET['new']) ) {
$this->DetectChanges($name, $value);
}
$this->Data[$name] = $value;
$this->m_dirtyFieldsMap[$name] = $value;
}
}
function Dirty($list=NULL)
{
if($list==NULL)
{
foreach($this->Data as $field => $value)
{
$this->m_dirtyFieldsMap[$field] = $value;
}
}
else
{
foreach($list as $field)
{
$this->m_dirtyFieldsMap[$field] = $this->Data[$field];
}
}
}
function Clean($list=NULL)
{
if($list == NULL)
{
unset($this->m_dirtyFieldsMap);
$this->m_dirtyFieldsMap=array();
}
else
{
foreach($list as $value)
{
$varname = "m_" . $value;
unset($this->m_dirtyFieldsMap[$value]);
}
}
}
function SetDebugLevel($value)
{
$this->debuglevel = $value;
}
function SetFromArray($data, $dirty = false)
{
if(is_array($data))
{
$this->Data = $data;
if($dirty) $this->m_dirtyFieldsMap = $data;
}
}
function GetData()
{
return $this->Data;
}
function SetData($data, $dirty = false)
{
$this->SetFromArray($data, $dirty);
}
function Delete()
{
global $Errors;
if($this->Get($this->IdField())==0)
{
$Errors->AddError("error.AppError",NULL,'Internal error: Delete requires set id',"",get_class($this),"Delete");
return false;
}
$sql = sprintf('DELETE FROM %s WHERE %s = %s', $this->tablename, $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),"Delete");
return false;
}
return true;
}
function Update($UpdatedBy=NULL,$modificationDate = null)
{
global $Errors, $objSession;
if( !$this->raiseEvent('OnBeforeItemUpdate') ) return false;
if( count($this->m_dirtyFieldsMap) == 0 ) return true;
$this->SetModified($UpdatedBy, $modificationDate);
$sql = 'UPDATE '.$this->tablename .' SET ';
foreach ($this->m_dirtyFieldsMap as $key => $value)
{
if(!is_numeric($key) && $key != $this->IdField() && $key!='ResourceId')
{
if( is_null($value) )
{
$value = 'NULL';
}
else
{
$value = $this->adodbConnection->qstr( isset($GLOBALS['_CopyFromEditTable']) ? $value : stripslashes($value) );
}
$sql .= '`'.$key.'` = '.$value.', ';
}
}
$sql = preg_replace('/(.*), $/','\\1',$sql);
$sql .= ' WHERE '.$this->IdField().' = '.$this->adodbConnection->qstr( $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);
$this->raiseEvent('OnAfterItemUpdate');
return true;
}
function ReplaceID($new_id)
{
// replace item's id, because Update method
// is too dummy to do this autommatically
// USED in temporary table editing stuff
$db =& $this->adodbConnection;
$sql = "UPDATE %1\$s SET `%2\$s` = %3\$s WHERE `%2\$s` = %4\$s";
$sql = sprintf($sql, $this->tablename, $this->IdField(), $new_id, (int)$this->UniqueId() );
if($this->debuglevel > 0) echo $sql.'<br>';
$db->Execute($sql);
}
function CreateSQL()
{
global $Errors;
$sql = "INSERT INTO ".$this->tablename." (";
$first = 1;
foreach ($this->Data as $key => $value)
{
if($first)
{
$sql = sprintf("%s %s",$sql,$key);
$first = 0;
}
else
{
$sql = sprintf("%s, %s",$sql,$key);
}
}
$sql = sprintf('%s ) VALUES (',$sql);
$first = 1;
foreach ($this->Data as $key => $value)
{
if( is_array($value) )
{
global $debugger;
$debugger->dumpVars($value);
$debugger->appendTrace();
trigger_error('Value of array type not allowed in method <b>CreateSQL</b> of <b>clsItemDB</b> class', E_USER_ERROR);
}
if($first)
{
if(isset($GLOBALS['_CopyFromEditTable']))
$sql = sprintf("%s %s",$sql,$this->adodbConnection->qstr(($value)));
else
$sql = sprintf("%s %s",$sql,$this->adodbConnection->qstr(stripslashes($value)));
$first = 0;
}
else
{
if(isset($GLOBALS['_CopyFromEditTable']))
$sql = sprintf("%s, %s",$sql,$this->adodbConnection->qstr(($value)));
else
$sql = sprintf("%s, %s",$sql,$this->adodbConnection->qstr(stripslashes($value)));
}
}
$sql = sprintf('%s)',$sql);
return $sql;
}
/**
* Set's HasChanges flag based on new field
* with $name with value $value.
*
* @param string $name
* @param string $value
* @access private
*/
function DetectChanges($name, $value)
{
global $objSession;
if( !is_object($objSession) ) return false;
//echo "<b>class: ".get_class($this)."</b><br>";
if (!isset($this->Data[$name]) ) return false;
if ( getArrayValue($this->Data, $name) != $value && $value != '') {
//echo "$name Modified tt ".$this->Data[$name]." tt $value<br>";
if ($objSession->GetVariable("HasChanges") != 1) {
$objSession->SetVariable("HasChanges", 2);
}
}
}
function Create()
{
global $Errors, $objSession;
if( !$this->raiseEvent('OnBeforeItemCreate') ) return false;
if($this->debuglevel) echo "Creating Item: ".get_class($this)."<br>";
if($this->NoResourceId!=1 && (int)$this->Get("ResourceId")==0)
{
$this->Set("ResourceId", GetNextResourceId());
}
$sql = $this->CreateSql();
if($this->debuglevel>0)
echo $sql."<br>\n";
if ($this->adodbConnection->Execute($sql) === false)
{
$Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Create");
return false;
}
$this->SetUniqueId($this->adodbConnection->Insert_ID());
if ($objSession->GetVariable("HasChanges") == 2) {
$objSession->SetVariable("HasChanges", 1);
}
/*if ($this->adodbConnection->Affected_Rows() > 0) {
$objSession->SetVariable("HasChanges", 1);
} */
$this->raiseEvent('OnAfterItemCreate');
return true;
}
function Increment($field, $calculate_hot = false)
{
global $Errors;
if ($calculate_hot) {
$sql = "SELECT $field FROM ".$this->tablename." WHERE ".$this->IdField()." = ".$this->UniqueId();
$rs = $this->adodbConnection->Execute($sql);
$sql = "SELECT MAX($field) AS max_value FROM ".$this->tablename." WHERE ROUND($field) = ".round($rs->fields[$field]);
$rs = $this->adodbConnection->Execute($sql);
//echo "MAX VALUE: ".$rs->fields['max_value']."<br>";
//echo "MAX SQL: $sql<br>";
$new_val = $rs->fields['max_value'] + 1;
$sql = "SELECT count($field) AS count FROM ".$this->tablename." WHERE $field = $new_val";
$rsc = $this->adodbConnection->Execute($sql);
while ($rsc->fields['count'] != 0) {
$sql = "SELECT count($field) AS count FROM ".$this->tablename." WHERE $field = $new_val";
$rsc = $this->adodbConnection->Execute($sql);
//echo "New Value:$new_val<br>";
if ($rsc->fields['count'] > 0) {
$new_val = $new_val + 0.000001;
}
}
$sql = "Update ".$this->tablename." set $field=$new_val where ".$this->IdField()."=" . $this->UniqueId();
}
else {
$sql = "Update ".$this->tablename." set $field=$field+1 where ".$this->IdField()."=" . $this->UniqueId();
}
if($this->debuglevel>0)
echo $sql."<br>";
$result = $this->adodbConnection->Execute($sql);
if ($result === false)
{
$Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Increment");
return false;
}
if ($calculate_hot) {
$this->Set($field,$new_val);
}
else {
$this->Set($field, $this->Get($field) + 1);
}
}
function Decrement($field)
{
global $Errors;
$sql = "Update ".$this->tablename." set $field=$field-1 where ".$this->IdField()."=" .(int)$this->UniqueId();
if($this->debuglevel>0)
echo $sql;
$result = $this->adodbConnection->Execute($sql);
if ($result === false)
{
$Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Decrement");
return false;
}
$this->Set($field,$this->Get($field)-1);
}
function GetFieldList($UseLoadedData=FALSE)
{
if(count($this->Data) && $UseLoadedData==TRUE)
{
$res = array_keys($this->Data);
}
else
{
$res = $this->adodbConnection->MetaColumnNames($this->tablename);
}
return $res;
}
function UsingTempTable()
{
global $objSession;
$temp = $objSession->GetEditTable($this->tablename);
$p = GetTablePrefix()."ses";
$t = substr($temp,0,strlen($p));
$ThisTable = substr($this->tablename,0,strlen($p));
if($t==$ThisTable)
{
return TRUE;
}
else
return FALSE;
}
function LoadFromDatabase($Id, $IdField = null) // custom IdField by Alex
{
global $objSession,$Errors;
if(!isset($Id))
{
$Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromDatabase");
return false;
}
// --------- multiple ids allowed: begin -----------------
$id_field = isset($IdField) ? $IdField : $this->IdField();
if( !is_array($id_field) ) $id_field = Array($id_field);
if( !is_array($Id) ) $Id = Array($Id);
$i = 0; $id_count = count($id_field);
$conditions = Array();
while($i < $id_count)
{
$conditions[] = "(`".$id_field[$i]."` = '".$Id[$i]."')";
$i++;
}
$sql = sprintf($this->SelectSQL, $this->tablename, implode(' AND ', $conditions) );
// --------- multiple ids allowed: end --------------------
if($this->debuglevel) echo "Load SQL: $sql<br>";
$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;
if($this->debuglevel) print_pre($data);
if(is_array($data))
$this->SetFromArray($data);
$this->Clean();
return TRUE;
}
function FieldExists($field)
{
$res = array_key_exists($field,$this->Data);
return $res;
}
function ValueExists($Field,$Value)
{
$sql = "SELECT $Field FROM ".$this->tablename." WHERE $Field='$Value'";
$rs = $this->adodbConnection->Execute($sql);
if($rs && !$rs->EOF)
{
return TRUE;
}
else
return FALSE;
}
function FieldMax($Field)
{
$sql = "SELECT Max($Field) as m FROM ".$this->tablename;
$rs = $this->adodbConnection->Execute($sql);
if($rs && !$rs->EOF)
{
$ret = $rs->fields["m"];
}
else
$ret = 0;
}
function FieldMin($Field)
{
$sql = "SELECT Min($Field) as m FROM ".$this->tablename;
$rs = $this->adodbConnection->Execute($sql);
if($rs && !$rs->EOF)
{
$ret = $rs->fields["m"];
}
else
$ret = 0;
}
function TableExists($table = null)
{
static $tables_found = Array ();
- if ($table == null) $table = $this->tablename;
+ if($table == null) $table = $this->tablename;
+
if (!isset($tables_found[$table])) {
// checks if table specified in item exists in db
$db =& GetADODBConnection();
$sql = "SHOW TABLES LIKE '%s'";
$rs = $db->Execute( sprintf($sql, $table) );
if ($rs->RecordCount() == 1) {
// table exists in normal case
$tables_found[$table] = 1;
}
else {
// check if table exists in lowercase
$rs = $db->Execute( sprintf($sql, strtolower($table) ) );
$tables_found[$table] = $rs->RecordCount() == 1 ? 1 : 0;
}
}
return $tables_found[$table];
}
function raiseEvent($name, $id = null)
{
return true;
/*if (!getArrayValue($GLOBALS, '_CopyFromEditTable')) {
return true;
}
if( !isset($id) ) $id = $this->GetID();
$event = new kEvent( Array('name'=>$name,'prefix'=>$this->Prefix,'special'=>$this->Special) );
$event->setEventParam('id', $id);
$this->Application->HandleEvent($event);
return $event->status == erSUCCESS ? true : false;*/
}
}
?>
Property changes on: trunk/kernel/include/itemdb.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.36
\ No newline at end of property
+1.37
\ No newline at end of property
Index: trunk/kernel/admin_templates/incs/catalog.js
===================================================================
--- trunk/kernel/admin_templates/incs/catalog.js (revision 8103)
+++ trunk/kernel/admin_templates/incs/catalog.js (revision 8104)
@@ -1,329 +1,333 @@
function Catalog($url_mask, $cookie_prefix, $tab_shift) {
this.CookiePrefix = $cookie_prefix ? $cookie_prefix : '';
this.BusyRequest = new Array();
this.URLMask = $url_mask;
this.Separator = '#separator#';
this.ParentCategoryID = 0;
this.OnResponceMethod = null;
this.TabShift = isset($tab_shift) ? $tab_shift : 1; // start from 2nd tab (index starting from 0)
this.TabRegistry = new Array();
this.ActivePrefix = getCookie(this.CookiePrefix + 'active_prefix');
this.PreviousPrefix = this.ActivePrefix;
$ViewMenus = new Array('c');
}
Catalog.prototype.Init = function () {
var $prefix = this.queryTabRegistry('prefix', this.ActivePrefix, 'prefix');
if ($prefix !== this.ActivePrefix && this.TabRegistry.length > this.TabShift) {
// ActivePrefix not set or has non-existing prefix value
this.ActivePrefix = this.TabRegistry[this.TabShift]['prefix'];
}
this.SetAlternativeTabs();
this.AfterInit();
}
Catalog.prototype.AfterInit = function () {
this.go_to_cat();
}
Catalog.prototype.SetAlternativeTabs = function () {
// set alternative grids between all items (catalog is set when tab is loaded via AJAX first time)
var $i = this.TabShift;
while ($i < this.TabRegistry.length) {
// run through all prefixes
var $j = this.TabShift;
while ($j < this.TabRegistry.length) {
if (this.TabRegistry[$i]['prefix'] == this.TabRegistry[$j]['prefix']) {
$j++;
continue;
}
// and set alternative to all other prefixes
$GridManager.AddAlternativeGrid(this.TabRegistry[$i]['prefix'], this.TabRegistry[$j]['prefix']);
$j++;
}
$i++;
}
}
Catalog.prototype.submit_kernel_form = function($tab_id) {
var $prefix = 'dummy';
var $result_div = '';
if (isset($tab_id)) {
// responce result + progress are required
$prefix = this.queryTabRegistry('tab_id', $tab_id, 'prefix');
$result_div = $tab_id + '_div';
}
var $kf = document.getElementById($form_name);
Request.params = Request.serializeForm($kf);
Request.method = $kf.method.toUpperCase();
this.BusyRequest[$prefix] = false;
Request.makeRequest($kf.action, this.BusyRequest[$prefix], $result_div, this.successCallback, this.errorCallback, $result_div, this);
$form_name = 'kernel_form'; // restore back to main form with current category id of catalog
};
Catalog.prototype.successCallback = function($request, $params, $object) {
var $text = $request.responseText;
var $match_redirect = new RegExp('^#redirect#(.*)').exec($text);
if ($match_redirect != null) {
// redirect to external template requested
window.location.href = $match_redirect[1];
return false;
}
$params = $params.split(',');
var $js_end = $text.indexOf($object.Separator);
if ($js_end != -1) {
// allow to detect if output is permitted by ajax request parameters
var $request_visible = '$request_visible = ' + ($params[0].length ? 'true' : 'false') + "\n";
if ($params[0].length) {
document.getElementById($params[0]).innerHTML = $text.substring($js_end + $object.Separator.length);
eval($request_visible + $text.substring(0, $js_end));
}
else {
// eval JS only & set mark that js should not use HTML as usual in grids
eval($request_visible + $text.substring(0, $js_end));
}
}
else if ($params[0].length) {
document.getElementById($params[0]).innerHTML = $text;
}
if (typeof($object.OnResponceMethod) == 'function') {
$object.OnResponceMethod($object);
$object.OnResponceMethod = null;
}
if (typeof($Debugger) != 'undefined') {
$Debugger.Clear();
}
}
+Catalog.prototype.trim = function ($string) {
+ return $string.replace(/\s*((\S+\s*)*)/, "$1").replace(/((\s*\S+)*)\s*/, "$1");
+}
+
Catalog.prototype.errorCallback = function($request, $params, $object) {
// $Debugger.ShowProps($request, 'req');
alert('AJAX Error; class: Catalog; ' + Request.getErrorHtml($request));
}
Catalog.prototype.submit_event = function($prefix_special, $event, $t, $OnResponceMethod) {
if (typeof($OnResponceMethod) == 'function') {
this.OnResponceMethod = $OnResponceMethod;
}
var $prev_template = get_hidden_field('t');
if (!isset($prefix_special)) $prefix_special = this.getCurrentPrefix();
var $tab_id = this.queryTabRegistry('prefix', $prefix_special, 'tab_id');
$form_name = $tab_id + '_form'; // set firstly, because set_hidden_field uses it
if (isset($event)) set_hidden_field('events[' + $prefix_special + ']', $event);
if (isset($t)) set_hidden_field('t', $t);
this.submit_kernel_form($tab_id);
set_hidden_field('t', $prev_template);
}
Catalog.prototype.go_to_cat = function($cat_id) {
if (!isset($cat_id)) {
// gets current category
$cat_id = get_hidden_field('m_cat_id');
}
else {
// sets new category to kernel_form in case if item tab
// loads faster and will check if it's category is same
// as parent category of categories list
if (get_hidden_field('m_cat_id') == $cat_id) {
// it's the same category, then don't reload category list
return ;
}
set_hidden_field('m_cat_id', $cat_id);
}
this.resetTabs(false);
// query sub categories of $cat_id
var $url = this.URLMask.replace('#TEMPLATE_NAME#', 'in-portal/xml/categories_list').replace('#CATEGORY_ID#', $cat_id);
var $prefix = this.TabRegistry[0]['prefix'];
var $tab_id = this.TabRegistry[0]['tab_id'];
this.BusyRequest[$prefix] = false;
Request.makeRequest($url, this.BusyRequest[$prefix], $tab_id + '_div', this.successCallback, this.errorCallback, $tab_id + '_div', this);
this.switchTab(); // refresh current item tab
}
// set all item tabs counters to "?" before quering catagories
Catalog.prototype.resetTabs = function($reset_content) {
var $i = this.TabShift;
while ($i < this.TabRegistry.length) {
this.setItemCount(this.TabRegistry[$i]['prefix'], '?');
$i++;
}
if ($reset_content) {
// set category for all tabs to -1 (forces reload next time)
$i = this.TabShift;
while ($i < this.TabRegistry.length) {
document.getElementById(this.TabRegistry[$i]['tab_id'] + '_div').setAttribute('category_id', -1);
$i++;
}
}
}
Catalog.prototype.switchTab = function($prefix, $force) {
if (this.queryTabRegistry('prefix', this.ActivePrefix, 'prefix') != this.ActivePrefix) {
// active prefix is not registred -> cookie left, but not modules installed/enabled at the moment
return false;
}
if (!isset($prefix)) $prefix = this.ActivePrefix;
if (this.BusyRequest[$prefix]) {
alert('prefix: ['+$prefix+']; request busy: ['+this.BusyRequest[$prefix]+']');
}
if (this.ActivePrefix != $prefix) {
// hide source tab
this.PreviousPrefix = this.ActivePrefix;
document.getElementById(this.PreviousPrefix + '_tab').className = 'catalog-tab-unselected';
document.getElementById(this.queryTabRegistry('prefix', this.PreviousPrefix, 'tab_id') + '_div').style.display = 'none';
this.HideDependentButtons(this.PreviousPrefix);
}
// show destination tab
this.ActivePrefix = $prefix;
document.getElementById(this.ActivePrefix + '_tab').className = 'catalog-tab-selected';
var $div_id = this.queryTabRegistry('prefix', this.ActivePrefix, 'tab_id') + '_div'; // destination tab
document.getElementById($div_id).style.display = 'block';
this.ShowDependentButtons(this.ActivePrefix);
this.setViewMenu(this.ActivePrefix);
setCookie(this.CookiePrefix + 'active_prefix', this.ActivePrefix);
this.refreshTab($prefix, $div_id, $force);
}
Catalog.prototype.refreshTab = function($prefix, $div_id, $force) {
var $cat_id = get_hidden_field('m_cat_id');
var $tab_cat_id = document.getElementById($div_id).getAttribute('category_id');
if ($cat_id != $tab_cat_id || $force) {
// query tab content only in case if not queried or category don't match
var $url = this.URLMask.replace('#TEMPLATE_NAME#', this.queryTabRegistry('prefix', $prefix, 'module_path') + '/catalog_tab');
$url = $url.replace('#CATEGORY_ID#', $cat_id);
$url = $url.replace('#PREFIX#', $prefix);
this.BusyRequest[$prefix] = false;
Request.makeRequest($url, this.BusyRequest[$prefix], $div_id, this.successCallback, this.errorCallback, $div_id, this);
}
/*else {
alert('refresh disabled = {tab: '+this.ActivePrefix+'; cat_id: '+$cat_id+'; form_name: '+$form_name+'}');
}*/
}
// adds information about tab to tab_registry
Catalog.prototype.registerTab = function($tab_id) {
var $tab = document.getElementById($tab_id + '_div');
var $index = this.TabRegistry.length;
this.TabRegistry[$index] = new Array();
this.TabRegistry[$index]['tab_id'] = $tab_id;
this.TabRegistry[$index]['prefix'] = $tab.getAttribute('prefix');
if ($tab_id == 'categories') {
this.TabRegistry[$index]['module_path'] = 'in-portal/';
}
else {
this.TabRegistry[$index]['module_path'] = $tab.getAttribute('edit_template').substring(0, $tab.getAttribute('edit_template').indexOf('/'));
}
this.TabRegistry[$index]['view_template'] = $tab.getAttribute('view_template');
this.TabRegistry[$index]['edit_template'] = $tab.getAttribute('edit_template');
this.TabRegistry[$index]['dep_buttons'] = $tab.getAttribute('dep_buttons').length > 0 ? $tab.getAttribute('dep_buttons').split(',') : new Array();
this.TabRegistry[$index]['index'] = $index;
}
// allows to get any information about tab
Catalog.prototype.queryTabRegistry = function($search_key, $search_value, $return_key) {
var $i = 0;
// alert('looking in '+$search_key+' for '+$search_value+' will return '+$return_key)
while ($i < this.TabRegistry.length) {
if (this.TabRegistry[$i][$search_key] == $search_value) {
// alert('got '+this.TabRegistry[$i][$return_key])
return this.TabRegistry[$i][$return_key];
break;
}
$i++;
}
return false;
}
Catalog.prototype.ShowDependentButtons = function($prefix) {
/*var $tab_id = this.queryTabRegistry('prefix', $prefix, 'tab_id')
if (!document.getElementById($tab_id + '_form')) {
// tab form not found => no permission to view -> no permission to do any actions
alert('no form: ['+$tab_id + '_form'+']');
return ;
}
else {
alert('has form: ['+$tab_id + '_form'+']');
}*/
var $dep_buttons = this.queryTabRegistry('prefix', $prefix, 'dep_buttons');
var $i = 0;
while ($i < $dep_buttons.length) {
a_toolbar.ShowButton($dep_buttons[$i]);
$i++;
}
}
Catalog.prototype.HideDependentButtons = function($prefix) {
var $dep_buttons = this.queryTabRegistry('prefix', $prefix, 'dep_buttons');
var $i = 0;
while ($i < $dep_buttons.length) {
a_toolbar.HideButton($dep_buttons[$i]);
$i++;
}
}
Catalog.prototype.setItemCount = function($prefix, $count) {
setInnerHTML($prefix + '_item_count', $count);
}
Catalog.prototype.setCurrentCategory = function($prefix, $category_id) {
var $tab_id = this.queryTabRegistry('prefix', $prefix, 'tab_id');
// alert('setting current category for prefix: ['+$prefix+']; tab_id ['+$tab_id+'] = ['+$category_id+']');
document.getElementById($tab_id + '_div').setAttribute('category_id', $category_id);
}
Catalog.prototype.getCurrentPrefix = function() {
if (isset(Grids[this.ActivePrefix]) && (Grids[this.ActivePrefix].SelectedCount > 0)) {
// item tab grid exists and some items are selected
return this.ActivePrefix;
}
else {
// return prefix of first registred tab -> categories
return this.TabRegistry[0]['prefix'];
}
}
Catalog.prototype.setViewMenu = function($item_prefix) {
if (this.TabShift == 1) {
$ViewMenus = isset($item_prefix) ? new Array('c', $item_prefix) : new Array('c');
}
else {
$ViewMenus = isset($item_prefix) ? new Array($item_prefix) : new Array();
}
}
Catalog.prototype.reflectPasteButton = function($status) {
a_toolbar.SetEnabled('paste', $status);
a_toolbar.SetEnabled('clear_clipboard', $status);
}
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/incs/catalog.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.31
\ No newline at end of property
+1.32
\ No newline at end of property
Index: trunk/kernel/admin_templates/catalog.tpl
===================================================================
--- trunk/kernel/admin_templates/catalog.tpl (revision 8103)
+++ trunk/kernel/admin_templates/catalog.tpl (revision 8104)
@@ -1,241 +1,241 @@
<inp2:m_RequireLogin permissions="in-portal:browse.view" system="1" ajax="yes"/>
<inp2:m_include t="incs/header" nobody="yes" noform="yes"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF" onload="$Catalog.Init();">
<inp2:m_ParseBlock name="section_header" prefix="c" icon="icon46_catalog" module="in-portal" title="!la_title_Browse!"/>
<inp2:m_ParseBlock name="blue_bar" prefix="c" title_preset="catalog" module="in-portal"/>
<!-- main kernel_form: begin -->
<inp2:m_RenderElement name="kernel_form"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<input type="hidden" name="m_cat_id" value="<inp2:m_get name="m_cat_id"/>"/>
<link rel="stylesheet" rev="stylesheet" href="incs/nlsmenu.css" type="text/css" />
<script type="text/javascript" src="js/nlsmenu.js"></script>
<script type="text/javascript" src="js/nlsmenueffect_1_2_1.js"></script>
<script type="text/javascript" src="js/ajax.js"></script>
<script type="text/javascript" src="<inp2:m_TemplatesBase module="in-portal"/>/incs/catalog.js"></script>
<script type="text/javascript">
var menuMgr = new NlsMenuManager("mgr");
menuMgr.timeout = 500;
menuMgr.flowOverFormElement = true;
Request.progressText = '<inp2:m_phrase name="la_title_Loading" escape="1"/>';
var $is_catalog = true;
var $Catalog = new Catalog('<inp2:m_Link template="#TEMPLATE_NAME#" m_cat_id="#CATEGORY_ID#" no_amp="1"/>', 'catalog_');
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('in-portal:upcat', '<inp2:m_phrase label="la_ToolTip_Up" escape="1"/>', function() {
$Catalog.go_to_cat($Catalog.ParentCategoryID);
}
) );
a_toolbar.AddButton( new ToolBarButton('in-portal:homecat', '<inp2:m_phrase label="la_ToolTip_Home" escape="1"/>', function() {
$Catalog.go_to_cat(0);
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('in-portal:new_cat', '<inp2:m_phrase label="la_ToolTip_New_Category" escape="1"/>', function() {
std_precreate_item('c', 'in-portal/categories/categories_edit');
}
) );
a_toolbar.AddButton( new ToolBarButton('in-portal:editcat', '<inp2:m_phrase label="la_ToolTip_Edit_Current_Category" escape="1"/>', function() {
var $edit_url = '<inp2:m_t t="#TEMPLATE#" m_opener="d" c_mode="t" c_event="OnEdit" c_id="#CATEGORY_ID#" pass="all,c" no_amp="1"/>';
var $category_id = get_hidden_field('m_cat_id');
var $redirect_url = $edit_url.replace('#CATEGORY_ID#', $category_id);
$redirect_url = $redirect_url.replace('#TEMPLATE#', $category_id > 0 ? 'in-portal/categories/categories_edit' : 'in-portal/categories/categories_edit_permissions');
redirect($redirect_url);
}
) );
<inp2:m_ModuleInclude template="catalog_tab" tab_init="1" skip_prefixes="m"/>
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
var $template = $Catalog.queryTabRegistry('prefix', $Catalog.getCurrentPrefix(), 'view_template');
std_delete_items($Catalog.getCurrentPrefix(), $template, 1);
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
$Catalog.submit_event(null, 'OnMassApprove');
}
) );
a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
$Catalog.submit_event(null, 'OnMassDecline');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('in-portal:export', '<inp2:m_phrase label="la_ToolTip_Export" escape="1"/>', function() {
var $export_prefixes = new Array('l', 'p');
if (in_array($Catalog.ActivePrefix, $export_prefixes)) {
submit_event($Catalog.ActivePrefix, 'OnExport');
}
else {
alert('<inp2:m_phrase name="la_Text_InDevelopment" escape="1"/>');
}
}
) );
a_toolbar.AddButton( new ToolBarButton('in-portal:rebuild_cache', '<inp2:m_phrase label="la_ToolTip_RebuildCategoryCache" escape="1"/>', function() {
redirect('<inp2:m_t t="in-portal/categories/cache_updater" pass="m"/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep4') );
a_toolbar.AddButton( new ToolBarButton('in-portal:cut', '<inp2:m_phrase label="la_ToolTip_Cut" escape="1"/>', function() {
$Catalog.submit_event(null, 'OnCut');
}
) );
a_toolbar.AddButton( new ToolBarButton('in-portal:copy', '<inp2:m_phrase label="la_ToolTip_Copy" escape="1"/>', function() {
$Catalog.submit_event(null, 'OnCopy');
}
) );
a_toolbar.AddButton( new ToolBarButton('in-portal:paste', '<inp2:m_phrase label="la_ToolTip_Paste" escape="1"/>', function() {
$Catalog.submit_event('c', 'OnPasteClipboard', null, function($object) {
$object.resetTabs(true);
$object.switchTab();
} );
}
) );
/*a_toolbar.AddButton( new ToolBarButton('clear_clipboard', '<inp2:m_phrase label="la_ToolTip_ClearClipboard" escape="1"/>', function() {
if (confirm('<inp2:m_phrase name="la_text_ClearClipboardWarning" js_escape="1"/>')) {
$Catalog.submit_event('c', 'OnClearClipboard', null, function($object) {
$GridManager.CheckDependencies($object.ActivePrefix);
} );
}
}
) );*/
a_toolbar.AddButton( new ToolBarSeparator('sep5') );
a_toolbar.AddButton( new ToolBarButton('move_up', '<inp2:m_phrase label="la_ToolTip_Move_Up" escape="1"/>', function() {
$Catalog.submit_event(null, 'OnMassMoveUp');
}
) );
a_toolbar.AddButton( new ToolBarButton('move_down', '<inp2:m_phrase label="la_ToolTip_Move_Down" escape="1"/>', function() {
$Catalog.submit_event(null, 'OnMassMoveDown');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep6') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar, 'view');
}
) );
a_toolbar.Render();
function edit()
{
var $current_prefix = $Catalog.getCurrentPrefix();
$form_name = $Catalog.queryTabRegistry('prefix', $current_prefix, 'tab_id') + '_form';
std_edit_item($current_prefix, $Catalog.queryTabRegistry('prefix', $current_prefix, 'edit_template'));
}
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="kernel_form_end"/>
<!-- main kernel_form: end -->
<!-- category list: begin -->
<table id="c_search_warning" width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_notop" style="display: none;">
<tr>
<td valign="top" class="hint_red">
<inp2:m_phrase name="la_Warning_Filter"/>
</td>
</tr>
</table>
<inp2:m_set t="in-portal/xml/categories_list"/>
<inp2:m_RenderElement name="kernel_form" form_name="categories_form"/>
-<table class="toolbar" cellspacing="0" cellpadding="2" width="100%" border="0" style="border-top-width: 0px;">
- <tr bgcolor="#e0e0da" height="20">
+<table class="toolbar" cellspacing="0" cellpadding="0" width="100%" border="0" style="border-top-width: 0px;">
+ <tr bgcolor="#e0e0da">
<td valign="middle">
- <img height="15" src="img/arrow.gif" width="15" align="absmiddle" border="0"><span id="category_path"></span>
+ <img src="img/arrow.gif" width="15" height="15" align="absmiddle" border="0"><span id="category_path"></span>
</td>
<td align="right" class="search-cell">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>Search:&nbsp;</td>
<td>
- <input type="text" id="c_search_keyword" name="c_search_keyword" value="" onkeydown="search_keydown(event, 'c', 'Default', 1);" style="border: 1px solid grey;" />
+ <input type="text" id="c_search_keyword" name="c_search_keyword" value="" onkeydown="search_keydown(event, 'c', 'Default', 1);" class="search-box"/>
<input type="text" style="display: none;" />
</td>
<td id="search_buttons[c]">
<script type="text/javascript">
<inp2:m_RenderElement name="grid_search_buttons" PrefixSpecial="c" grid="Default" ajax="1"/>
</script>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div id="categories_div" prefix="c" view_template="in-portal/xml/categories_list" edit_template="in-portal/categories/categories_edit" dep_buttons="" class="catalog-tab" style="display: block;"></div>
<inp2:m_RenderElement name="kernel_form_end"/>
<inp2:m_set t="in-portal/catalog"/>
<script type="text/javascript">$Catalog.registerTab('categories');</script>
<!-- categories list: end -->
<!-- item tabs: begin -->
<table cellpadding="0" cellspacing="0">
<tr>
<inp2:m_DefineElement name="item_tab" title="">
<td nowrap="nowrap" width="140">
<table id="<inp2:m_param name="prefix"/>_tab" cellpadding="0" cellspacing="0" width="100%" class="catalog-tab-unselected" onclick="$Catalog.switchTab('<inp2:m_param name="prefix"/>');">
<tr>
<td class="catalog-tab-left">
<img src="img/spacer.gif" height="22" width="9" />
</td>
<td class="catalog-tab-middle" width="100%" valign="middle" nowrap="nowrap">
<inp2:m_phrase name="$title"/> <span class="cats_stats">(<span id="<inp2:m_param name="prefix"/>_item_count">?</span>)</span>
</td>
<td class="catalog-tab-right">
<img src="img/spacer.gif" height="22" width="9" />
</td>
<td style="background-color: #FFFFFF;">
<img src="img/spacer.gif" height="1" width="5" />
</td>
</tr>
</table>
</td>
</inp2:m_DefineElement>
<inp2:adm_ListCatalogTabs render_as="item_tab" title_property="ViewMenuPhrase" skip_prefixes="m"/>
</tr>
</table>
<!-- item tabs: end -->
<inp2:m_ModuleInclude template="catalog_tab" tab_init="2" skip_prefixes="m"/>
<inp2:m_include t="incs/footer" noform="yes"/>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/catalog.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.28
\ No newline at end of property
+1.29
\ No newline at end of property
Index: trunk/kernel/frontaction.php
===================================================================
--- trunk/kernel/frontaction.php (revision 8103)
+++ trunk/kernel/frontaction.php (revision 8104)
@@ -1,1148 +1,1151 @@
<?php
switch($Action)
{
case "m_login":
// if($objSession->ValidSession()) $objSession->Logout();
//echo $objSession->GetSessionKey()."<br>\n";
$url_params = Array();
$application =& kApplication::Instance();
if ($objConfig->Get("CookieSessions") == 1 && $_COOKIE["cookies_on"] != "1") {
$FormError["login"]["login_user"] = language("lu_cookies_error");
}
else
{
$MissingCount = SetMissingDataErrors("login");
if($MissingCount==2)
{
$FormError["login"]["login_user"]= language("lu_ferror_loginboth");
unset($FormError["login"]["login_password"]);
}
if($MissingCount==0)
{
if($_POST["login_user"]=="root")
{
$FormError["login"]["login_user"]= language("lu_access_denied");
}
else
{
$LoginCheck = $objSession->Login( $_POST["login_user"], md5($_POST["login_password"]) );
if($LoginCheck === true)
{
if( !headers_sent() && GetVar('usercookie') == 1 )
{
$c = $_POST["login_user"]."|";
$pw = $_POST["login_password"];
if(strlen($pw) < 31) $pw = md5($pw);
$c .= $pw;
set_cookie('login', $c, adodb_mktime() + 2592000);
}
// set new destination template if passed
$dest = GetVar('dest', true);
if(!$dest) $dest = GetVar('DestTemplate', true);
if($dest) $var_list['t'] = $dest;
$next_template = $objSession->GetVariable('next_template');
if($next_template)
{
$objSession->SetVariable('next_template','');
$var_list_update['t'] = $next_template;
$url_params['pass'] = 'all';
header('Location: ' . HREF_Wrapper('', $url_params) );
exit;
$var_list['t'] = $next_template.'.tpl';
}
elseif($var_list['t'] == 'login')
{
$var_list['t'] = 'index';
}
$event_params = Array('user' => $_POST['login_user'], 'pass' => $_POST['login_password']);
$application->HandleEvent( new kEvent('u:OnInpLogin', $event_params) );
$redirect_template = getArrayValue($var_list_update, 't') ? $var_list_update['t'] : $var_list['t'];
$application->Redirect($redirect_template);
}
else
{
switch($LoginCheck)
{
case -1: // user or/and pass wrong
$FormError["login"]["login_password"] = language("lu_incorrect_login");
break;
case -2: // user ok, but has no permission
$FormError["login"]["login_password"] = language("la_text_nopermissions");
break;
}
}
}
}
}
break;
case "m_resetpw":
$passed_key = $_GET['user_key'];
$u = $objUsers->GetItemByField("PwResetConfirm", $passed_key);
$found = is_object($u);
if($found)
{
$exp_time = $u->Get('PwRequestTime') + 3600;
$u->Set("PwResetConfirm", '');
$u->Set("PwRequestTime", 0);
if ($exp_time > adodb_mktime())
{
$objSession->SetVariable('codevalidationresult', 'lu_resetpw_confirm_text');
$newpw = makepassword();
SetVar('user_password', $newpw);
$u->Set("Password",$newpw);
$u->Set("PassResetTime", adodb_mktime());
$u->Set("PwResetConfirm", '');
$u->Set("PwRequestTime", 0);
$u->Update();
$u->SendUserEventMail("USER.PSWD",$u->Get("PortalUserId"));
$u->SendAdminEventMail("USER.PSWD");
$u->Set("Password",md5($newpw));
$u->Update();
$u->Clean();
} else {
$objSession->SetVariable('codevalidationresult', 'lu_code_expired');
}
} else {
$objSession->SetVariable('codevalidationresult', 'lu_code_is_not_valid');
}
break;
case "m_forgotpw":
$MissingCount = SetMissingDataErrors("forgotpw");
// $pass_reset_add = $objConfig->Get("Users_AllowReset");
if($MissingCount==0)
{
$username = $_POST["username"];
$email = $_POST["email"];
$found = false;
$allow_reset = true;
if(strlen($username))
{
$u = $objUsers->GetItemByField("Login",$username);
if(is_object($u))
$found = ($u->Get("Login")==$username && $u->Get("Status")==1) && strlen($u->Get("Password"));
}
else if(strlen($email))
{
$u = $objUsers->GetItemByField("Email",$email);
if(is_object($u))
$found = ($u->Get("Email")==$email && $u->Get("Status")==1) && strlen($u->Get("Password"));
}
if(is_object($u))
{
$PwResetConfirm = $u->Get('PwResetConfirm');
$PwRequestTime = $u->Get('PwRequestTime');
$PassResetTime = $u->Get('PassResetTime');
$MinPwResetDelay = $u->Get('MinPwResetDelay');
$allow_reset = (strlen($PwResetConfirm) ?
adodb_mktime() > $PwRequestTime + $MinPwResetDelay :
adodb_mktime() > $PassResetTime + $MinPwResetDelay);
}
if($found && $allow_reset)
{
//$newpw = makepassword();
//$objSession->Set('password', $newpw);
$objSession->Set('tmp_user_id', $u->Get("PortalUserId"));
$objSession->Set('tmp_email', $u->Get("Email"));
//$u->Set("Password",$newpw);
//$u->Update();
$u->SendUserEventMail("USER.PSWDC",$u->Get("PortalUserId"));
//$u->SendAdminEventMail("USER.PSWDC");
//$u->Set("Password",md5($newpw));
//$u->Update();
$u->Clean();
$var_list['t'] = GetVar('Confirm');
}
else
{
if(!strlen($username) && !strlen($email))
{
$FormError["forgotpw"]["username"] = language("lu_ferror_forgotpw_nodata");
$MissingCount++;
}
else
{
$error_phrases=Array();
if($allow_reset)
{
$error_phrases['username']='lu_ferror_unknown_username';
$error_phrases['email']='lu_ferror_unknown_email';
}
else
{
$error_phrases['username']='lu_ferror_reset_denied';
$error_phrases['email']='lu_ferror_reset_denied';
}
foreach ($error_phrases as $field_name => $phrase_name) {
if(GetVar($field_name))
{
$FormError["forgotpw"][$field_name] = language($phrase_name);
break;
}
}
$MissingCount++;
}
if(strlen($_GET["error"]))
$var_list["t"] = $_GET["error"];
}
}
else
if(strlen($_GET["error"]))
$var_list["t"] = $_GET["error"];
break;
case "m_subscribe_confirm":
$t = "";
$_GET["subscribe_email"] = $_POST["subscribe_email"];
$SubscribeAddress = $_POST["subscribe_email"];
if(!ValidEmail($SubscribeAddress)&& strlen($SubscribeAddress))
{
$t = $_GET["Error"];
$objSession->SetVariable('SubscribeError', 'lu_invalid_emailaddress');
}
else
{
if((int)$objConfig->Get("User_SubscriberGroup")>0)
{
$g = $objGroups->GetItem($objConfig->Get("User_SubscriberGroup"));
if(is_object($g))
{
$email = $_POST["subscribe_email"];
if(strlen($email)>0)
{
$u = $objUsers->GetItemByField("Email",$email);
if(is_object($u))
{
if($u->CheckBanned())
{
$t = $_GET["Error"];
$objSession->SetVariable('SubscribeError', 'lu_subscribe_banned');
}
else
{
if($u->IsInGroup($g->Get("GroupId")))
{
$t = $_GET["Unsubscribe"];
}
else
$t = $_GET["Subscribe"];
}
}
else
$t = $_GET["Subscribe"];
}
else
{
$t = $_GET["Error"];
$objSession->SetVariable('SubscribeError', 'lu_subscribe_no_address');
}
}
else
{
$t = $_GET["Error"];
$objSession->SetVariable('SubscribeError', 'lu_subscribe_unknown_error');
}
}
}
if(strlen($t))
{
$var_list["t"] = $t;
$var_list_update["t"] = $t;
}
$objSession->SetVariable('SubscribeAddress', $SubscribeAddress);
break;
case "m_subscribe":
if($_POST["buttons"][0]==language("lu_button_yes"))
{
$SubscribeAddress = $_POST["subscribe_email"];
if(strlen($SubscribeAddress)>0)
{
if(ValidEmail($SubscribeAddress))
{
$GroupId = (int)$objConfig->Get("User_SubscriberGroup");
if ($GroupId)
{
$g = $objGroups->GetItem($GroupId);
$u = $objUsers->GetItemByField("Email",$SubscribeAddress);
if(is_object($u))
{
if(strtolower($u->Get("Email"))==strtolower($SubscribeAddress))
{
$bExists = TRUE;
}
else
$bExists = FALSE;
}
if($bExists)
{
$g->AddUser($u->Get("PortalUserId"),0,false);
}
else
{
$u = new clsPortalUser(NULL);
$u->Set("Email",$SubscribeAddress);
$u->Set("ip",$_SERVER['REMOTE_ADDR']);
$u->Set("CreatedOn",adodb_date("U"));
$u->Set("Status",1);
if(!$u->CheckBanned())
{
$u->Create();
$g->AddUser($u->Get("PortalUserId"),1,false);
}
else
$SubscribeResult = "lu_subscribe_banned";
}
$SubscribeResult = "lu_subscribe_success";
$u->SendUserEventMail("USER.SUBSCRIBE",$u->Get("PortalUserId"));
$u->SendAdminEventMail("USER.SUBSCRIBE");
if(strlen($_GET["Subscribe"])>0)
$var_list["t"] = $_GET["Subscribe"];
}
}
else
{
$SubscribeResult = "lu_invalid_emailaddress";
}
}
else
$SubscribeResult = "lu_subscribe_missing_address";
}
if(!strlen($SubscribeResult))
$SubscribeResult = "lu_subscribe_success";
break;
case "m_unsubscribe":
if($_POST["buttons"][0]==language("lu_button_yes"))
{
$MissingCount = SetMissingDataErrors("m_unsubscribe");
if($MissingCount==0)
{
$email = $_POST["subscribe_email"];
$u = $objUsers->GetItemByField("Email",$email);
if(is_object($u))
{
if(strtolower($u->Get("Email"))==strtolower($email))
{
$GroupId = (int)$objConfig->Get("User_SubscriberGroup");
if($u->PrimaryGroup()==$GroupId)
{
$u_gorup_list = $u->GetGroupList();
if (count($u_gorup_list) > 1) {
$u->RemoveFromGroup($GroupId);
}
else {
$u->RemoveFromAllGroups();
$u->Delete();
}
}
else
{
$u->RemoveFromGroup($GroupId);
}
}
}
if(strlen($_GET["Subscribe"])>0)
$var_list["t"] = $_GET["Subscribe"];
}
}
break;
case "m_register":
- $_POST=inp_escape($_POST);
- $MissingCount = SetMissingDataErrors("m_register");
+ $_POST=inp_escape($_POST);
+ $MissingCount = SetMissingDataErrors("m_register");
- if(!$objConfig->Get("User_Password_Auto"))
- {
- if(($_POST["password"] != $_POST["passwordverify"]) || !strlen($_POST["passwordverify"]))
- {
- $MissingCount++;
- $FormError["m_register"]["passwordverify"] = language("lu_ferror_pswd_mismatch");
- }
+ if(!$objConfig->Get("User_Password_Auto"))
+ {
+ if(($_POST["password"] != $_POST["passwordverify"]) || !strlen($_POST["passwordverify"]))
+ {
+ $MissingCount++;
+ $FormError["m_register"]["passwordverify"] = language("lu_ferror_pswd_mismatch");
+ }
- if(strlen($_POST["password"])>30)
- {
- // echo "VAR: ".$_POST["password"]; die();
- $MissingCount++;
- $FormError["m_register"]["password"] = language("lu_ferror_pswd_toolong");
- }
-
- if (strlen($_POST['password']) < $objConfig->Get("Min_Password"))
- {
- $MissingCount++;
- $FormError["m_register"]["password"] = language("lu_ferror_pswd_tooshort");
- }
- }
+ if(strlen($_POST["password"])>30)
+ {
+ // echo "VAR: ".$_POST["password"]; die();
+ $MissingCount++;
+ $FormError["m_register"]["password"] = language("lu_ferror_pswd_toolong");
+ }
- if(($_POST["username"]=="root"))
- {
- $MissingCount++;
- $FormError["m_register"]["username"] = language("lu_user_exists");
- }
- else
- {
+ if (strlen($_POST['password']) < $objConfig->Get("Min_Password"))
+ {
+ $MissingCount++;
+ $FormError["m_register"]["password"] = language("lu_ferror_pswd_tooshort");
+ }
+ }
- $u = $objUsers->GetItemByField("Login",$_POST["username"]);
- if(is_object($u))
- {
- if($u->Get("Login")==$_POST["username"])
- {
- $MissingCount++;
- $FormError["m_register"]["username"] = language("lu_user_exists");
- }
- }
- }
+ if(($_POST["username"]=="root"))
+ {
+ $MissingCount++;
+ $FormError["m_register"]["username"] = language("lu_user_exists");
+ }
+ else
+ {
+ $u = $objUsers->GetItemByField("Login",$_POST["username"]);
+ if(is_object($u))
+ {
+ if($u->Get("Login")==$_POST["username"])
+ {
+ $MissingCount++;
+ $FormError["m_register"]["username"] = language("lu_user_exists");
+ }
+ }
+ }
- if (strlen($_POST['username']) < $objConfig->Get("Min_UserName"))
- {
- $MissingCount++;
- $FormError["m_register"]["username"] = language("lu_ferror_username_tooshort");
- }
- if(!$MissingCount)
- {
- $CreatedOn = adodb_date("U");
- $GroupId = $objConfig->Get("User_NewGroup");
- $Status=0;
+ if (strlen($_POST['username']) < $objConfig->Get("Min_UserName"))
+ {
+ $MissingCount++;
+ $FormError["m_register"]["username"] = language("lu_ferror_username_tooshort");
+ }
- /* determine the status of new users */
- switch ($objConfig->Get("User_Allow_New"))
- {
- case "1":
- $Status=1;
- break;
- case "3":
- $Status=2;
- break;
- }
+ if(!$MissingCount)
+ {
+ $CreatedOn = adodb_date("U");
+ $GroupId = $objConfig->Get("User_NewGroup");
+ $Status=0;
- /* set Destination template */
- $var_list["t"] = strlen($_GET["dest"])? $_GET["dest"] : "index";
+ /* determine the status of new users */
+ switch ($objConfig->Get("User_Allow_New"))
+ {
+ case "1":
+ $Status=1;
+ break;
+ case "3":
+ $Status=2;
+ break;
+ }
- if($Status>0)
- {
- if ($objConfig->Get("User_Password_Auto")) {
- $password = makepassword();
-// $objSession->Set("password", $password);
- SetVar('user_password', $password);
- }
- else {
- $password = $_POST["password"];
- }
-
- $dob = adodb_mktime(0, 0, 0, $_POST['dob_month'], $_POST['dob_day'], $_POST['dob_year']);
- $ip = $_SERVER['REMOTE_ADDR'];
-
- $application =& kApplication::Instance();
- $application->SetVar('user_password', $password);
- SetVar('user_password', $password);
- $fields_hash = Array('Login' => $_POST['username'],
- 'Password' => md5($password),
- 'FirstName' => $_POST['firstname'],
- 'LastName' => $_POST['lastname'],
- 'Company' => $_POST['company'],
- 'Email' => $_POST['email'],
- 'Status' => $Status,
- 'Phone' => $_POST['phone'],
- 'Fax' => $_POST['fax'],
- 'Street' => $_POST['street'],
- 'Street2' => $_POST['street2'],
- 'City' => $_POST['city'],
- 'State' => $_POST['state'],
- 'Zip' => $_POST['zip'],
- 'Country' => $_POST['country'],
- 'CreatedOn' => $CreatedOn,
- 'dob' => $dob,
- 'ip' => $ip);
- $u =& $objUsers->Add_User_NEW($fields_hash, true);
+ /* set Destination template */
+ $var_list["t"] = strlen($_GET["dest"])? $_GET["dest"] : "index";
- if(!is_object($u))
- {
- $RuleId=$u;
- $r = $objBanList->GetItem($RuleId);
- $err = $r->Get("ErrorTag");
-
- if(strlen($err))
- {
- $FormError["m_register"][$r->Get("ItemField")] = language($err);
- $MissingCount++;
- }
- }
- else
- {
- $u->Set("Password",$password);
- $u->Clean();
- if($GroupId>0)
- {
- $g = $objGroups->GetItem($GroupId);
- $g->AddUser($u->Get("PortalUserId"),1,false);
- }
+ if($Status>0)
+ {
+ if ($objConfig->Get("User_Password_Auto")) {
+ $password = makepassword();
+ // $objSession->Set("password", $password);
+ SetVar('user_password', $password);
+ }
+ else {
+ $password = $_POST["password"];
+ }
- $custom = $_POST["custom"];
- if (is_array($custom)) {
- for($x = 0; $x < count($custom); $x++) {
- $u->SetCustomField($custom[$x],$_POST[$custom[$x]]);
- }
- $u->SaveCustomFields();
- }
+ $dob = adodb_mktime(0, 0, 0, $_POST['dob_month'], $_POST['dob_day'], $_POST['dob_year']);
+ $ip = $_SERVER['REMOTE_ADDR'];
- if($Status==1)
- {
- if($objConfig->Get("User_Password_Auto"))
- {
- $u->SendUserEventMail("USER.VALIDATE",$u->Get("PortalUserId"));
- $u->SendAdminEventMail("USER.VALIDATE");
- }
- else
- {
- $doLoginNow = true;
- $u->SendUserEventMail("USER.ADD",$u->Get("PortalUserId"));
- $u->SendAdminEventMail("USER.ADD");
- }
- }
- else
- {
- $u->SendUserEventMail("USER.ADD.PENDING",$u->Get("PortalUserId"));
- $u->SendAdminEventMail("USER.ADD.PENDING");
- }
+ $application =& kApplication::Instance();
+ $application->SetVar('user_password', $password);
+ SetVar('user_password', $password);
+ $fields_hash = Array('Login' => $_POST['username'],
+ 'Password' => md5($password),
+ 'FirstName' => $_POST['firstname'],
+ 'LastName' => $_POST['lastname'],
+ 'Company' => $_POST['company'],
+ 'Email' => $_POST['email'],
+ 'Status' => $Status,
+ 'Phone' => $_POST['phone'],
+ 'Fax' => $_POST['fax'],
+ 'Street' => $_POST['street'],
+ 'Street2' => $_POST['street2'],
+ 'City' => $_POST['city'],
+ 'State' => $_POST['state'],
+ 'Zip' => $_POST['zip'],
+ 'Country' => $_POST['country'],
+ 'CreatedOn' => $CreatedOn,
+ 'dob' => $dob,
+ 'ip' => $ip);
+ $u =& $objUsers->Add_User_NEW($fields_hash, true);
- if ($doLoginNow)
- {
- $login_ok = $objSession->Login($_POST["username"], md5($password));
- if($login_ok)
- {
- $next_template = $objSession->GetVariable('next_template');
- if($next_template)
- {
- $objSession->SetVariable('next_template','');
- $var_list_update["t"] = $next_template;
- header('Location: ' . HREF_Wrapper() );
- exit;
- $var_list['t'] = $next_template.'.tpl';
- }
+ if(!is_object($u))
+ {
+ $RuleId=$u;
+ $r = $objBanList->GetItem($RuleId);
+ $err = $r->Get("ErrorTag");
+
+ if(strlen($err))
+ {
+ $FormError["m_register"][$r->Get("ItemField")] = language($err);
+ $MissingCount++;
+ }
+ }
+ else
+ {
+ $u->Set("Password",$password);
+ $u->Clean();
+ if($GroupId>0)
+ {
+ $g = $objGroups->GetItem($GroupId);
+ $g->AddUser($u->Get("PortalUserId"),1,false);
+ }
+
+ $custom = $_POST["custom"];
+ if (is_array($custom)) {
+ for($x = 0; $x < count($custom); $x++) {
+ $u->SetCustomField($custom[$x],$_POST[$custom[$x]]);
+ }
+ $u->SaveCustomFields();
+ }
+
+ if($Status==1)
+ {
+ if($objConfig->Get("User_Password_Auto"))
+ {
+ $u->SendUserEventMail("USER.VALIDATE",$u->Get("PortalUserId"));
+ $u->SendAdminEventMail("USER.VALIDATE");
+ }
+ else
+ {
+ $doLoginNow = true;
+ $u->SendUserEventMail("USER.ADD",$u->Get("PortalUserId"));
+ $u->SendAdminEventMail("USER.ADD");
+ }
+ }
+ else
+ {
+ $u->SendUserEventMail("USER.ADD.PENDING",$u->Get("PortalUserId"));
+ $u->SendAdminEventMail("USER.ADD.PENDING");
+ }
+
+ if ($doLoginNow)
+ {
+ $login_ok = $objSession->Login($_POST["username"], md5($password));
+ if($login_ok)
+ {
+ $next_template = $objSession->GetVariable('next_template');
+ if (!$next_template) {
+// $next_template = strlen($_GET["dest"])? $_GET["dest"] : "index";
+ }
+ if($next_template)
+ {
+ $objSession->SetVariable('next_template','');
+ $var_list_update["t"] = $next_template;
+ header('Location: ' . HREF_Wrapper() );
+ exit;
+ $var_list['t'] = $next_template.'.tpl';
+ }
- }
- }
- }
- }
- }
- break;
+ }
+ }
+ }
+ }
+ }
+ break;
case "m_add_friend":
$id = $_GET["UserId"];
$userid = $objSession->Get("PortalUserId");
if($id!=$userid)
{
$u =& $objUsers->GetItem($id);
$u->AddFavorite($userid);
}
DeleteModuleTagCache('kernel');
break;
case "m_del_friend":
$id = $_GET["UserId"];
$userid = $objSession->Get("PortalUserId");
$u =& $objUsers->GetItem($id);
$u->DeleteFavorite();
DeleteModuleTagCache('kernel');
break;
case 'm_acctinfo':
$_POST = inp_escape($_POST);
$MissingCount = SetMissingDataErrors("m_acctinfo");
$UserId = $_GET["UserId"];
if ($UserId != $objSession->Get("PortalUserId")) {
$MissingCount++;
$FormError["m_acctinfo"]["UserId"] = language("lu_ferror_m_profile_userid");
}
if ($_POST["password"]) {
if (($_POST["password"] != $_POST["passwordverify"]) || !strlen($_POST["passwordverify"])) {
$MissingCount++;
$FormError["m_acctinfo"]["passwordverify"] = language("lu_ferror_pswd_mismatch");
}
if (strlen($_POST["password"])>30) {
// echo "VAR: ".$_POST["password"]; die();
$MissingCount++;
$FormError["m_acctinfo"]["password"] = language("lu_ferror_pswd_toolong");
}
if (strlen($_POST['password']) < $objConfig->Get("Min_Password")) {
$MissingCount++;
$FormError["m_acctinfo"]["password"] = language("lu_ferror_pswd_tooshort");
}
}
$db =& GetADODBConnection();
$email = GetVar('email');
$test_id = $db->GetOne('SELECT PortalUserId FROM '.GetTablePrefix().'PortalUser WHERE Email = '.$db->qstr($email));
if ($test_id && ($test_id != $objSession->Get('PortalUserId')) ) {
$MissingCount++;
$FormError["m_acctinfo"]["email"] = language("lu_ferror_email_duplicate");
}
if (!$MissingCount) {
/* save profile */
$u =& $objUsers->GetItem($UserId);
$status = $u->Get("Status");
$dob = adodb_mktime(0, 0, 0, $_POST['dob_month'], $_POST['dob_day'], $_POST['dob_year']);
$password = strlen($_POST["password"]) > 0 ? md5($_POST["password"]) : '';
$fields_hash = Array( 'Login' => $_POST['username'],
'Password' => $password,
'FirstName' => $_POST['firstname'],
'LastName' => $_POST['lastname'],
'Company' => $_POST['company'],
'Email' => $_POST['email'],
'Status' => $status,
'Phone' => $_POST['phone'],
'Fax' => $_POST['fax'],
'Street' => $_POST['street'],
'Street2' => $_POST['street2'],
'City' => $_POST['city'],
'State' => $_POST['state'],
'Zip' => $_POST['zip'],
'Country' => $_POST['country'],
'dob' => $dob,
'MinPwResetDelay' => $_POST['minpwresetdelay'],
);
$user =& $objUsers->Edit_User_NEW($UserId, $fields_hash);
saveCustomFields('u', $u->Get('ResourceId'), 6);
}
DeleteModuleTagCache('kernel');
break;
case "m_profile":
$userid = $objSession->Get("PortalUserId");
if($userid>0)
{
$u = $objUsers->GetItem($userid);
foreach($_POST as $field=>$value)
{
if(substr($field,0,3)=="pp_")
{
$objSession->SetPersistantVariable($field,$value);
}
}
}
break;
case "m_set_lang":
$lang = $_GET["lang"];
$LangId = 0;
if(strlen($lang))
{
$l = $objLanguages->GetItemByField("PackName",$lang);
if(is_object($l))
{
$LangId = $l->Get("LanguageId");
}
}
if($LangId)
{
if($objSession->Get("PortalUserId")>0)
{
$objSession->SetPersistantVariable("Language",$LangId);
}
$objSession->Set("Language",$LangId);
$objSession->Update();
$m_var_list_update["lang"] = $LangId;
$m_var_list["lang"] = $LangId;
}
break;
case "m_set_theme":
$id = $_POST["ThemeId"];
if(!is_numeric($id))
$id = $_GET["ThemeId"];
if($id)
{
$objSession->SetThemeName($id);
$m_var_list["t"] = "index";
$m_var_list_update["theme"] = $id;
$m_var_list["theme"] = $id;
unset($CurrentTheme);
}
break;
case "m_sort_cats":
$_POST['Category_Sortfield'] = preg_replace('/^(Name$|^Description)$/', 'l'.$m_var_list['lang'].'_$1', $_POST['Category_Sortfield']);
$objSession->SetVariable("Category_Sortfield",$_POST["Category_Sortfield"]);
$objSession->SetVariable("Category_Sortorder",$_POST["Category_Sortorder"]);
$objSession->SetVariable("Perpage_Category",$_POST["Perpage_Category"]);
DeleteModuleTagCache('kernel');
break;
case "m_add_cat_confirm":
$perm = 0;
$CategoryId=$objCatList->CurrentCategoryID();
if ($objSession->HasCatPermission("CATEGORY.ADD.PENDING"))
$perm = 2;
if ($objSession->HasCatPermission("CATEGORY.ADD"))
$perm = 1;
if ($perm == 0)
{
$MissingCount++;
$FormError["m_addcat"]["name"] = language("lu_ferror_no_access");
}
else
{
$MissingCount = SetMissingDataErrors("m_addcat");
if(is_array($_FILES))
{
foreach($_FILES as $field => $file)
{
$allowed = TRUE;
if(strlen($_POST["imagetypes"][$field]))
{
$types = explode(",",strtolower($_POST["imagetypes"][$field]));
if(is_array($types))
{
if(count($types)>0)
{
$path_parts = pathinfo($file["name"]);
$ext = $path_parts["extension"];
$allowed = in_array($ext,$types);
if(!$allowed)
{
$MissingCount++;
$FormError["m_addcat"][$field] = language("lu_ferror_wrongtype");
}
}
}
}
$maxsize = (int)$_POST["maxsize"][$field];
if($maxsize>0 && $allowed && $file["size"]>$maxsize)
{
$allowed = FALSE;
$MissingCount++;
$FormError["m_addcat"][$field] = language("lu_ferror_toolarge");
}
}
}
if($MissingCount==0)
{
$_POST = inp_striptags($_POST);
$fields_hash = Array( 'ParentId' => $objCatList->CurrentCategoryID(),
$objCatList->TitleField => $_POST['name'],
$objCatList->DescriptionField => $_POST['description'],
'CreatedOn' => adodb_date('U'),
'EditorsPick' => 0,
'Status' => $perm,
'HotItem' => 2,
'NewItem' => 2,
'PopItem' => 2,
'Priority' => 0,
'MetaKeywords' => $_POST['meta_keywords'],
'MetaDescription' => $_POST['meta_description'],
'AutomaticFilename' => 1,
'Filename' => '',
'CategoryTemplate' => '',
);
$cat =& $objCatList->Add_NEW($fields_hash);
saveCustomFields('c', $cat->Get('ResourceId'), $cat->type);
$cat->UpdateCachedPath();
$cat->Update();
$cat->UpdateACL();
$objCatList->UpdateMissingCacheData();
if(strlen($_GET["Confirm"]))
{
$var_list["t"] = $_GET["Confirm"];
}
else
$var_list["t"] = $_GET["DestTemplate"];
}
}
DeleteModuleTagCache('kernel');
break;
case "m_front_review_add":
if($objSession->InSpamControl($_POST["ItemId"]))
{
$StatusMessage["review"] = language("la_Review_AlreadyReviewed");
}
else
{
$objReviews = new clsItemReviewList();
$Status = $objConfig->Get("Review_DefaultStatus");
$CreatedOn = adodb_date("U");
$html = (int)$objConfig->Get("Review_Html");
$ReviewText = inp_striptags($_POST["review_text"]);
$r = $objReviews->AddReview($CreatedOn,$ReviewText,$Status, $IPAddress,
0, $_POST["ItemId"], $_POST["ItemType"], $objSession->Get("PortalUserId"));
foreach($ItemTypes as $type=>$id)
{
if($id==$_POST["ItemType"])
{
$ValName = $type."_ReviewDelay_Value";
$IntName = $type."_ReviewDelay_Interval";
break;
}
}
if(strlen($ValName) && strlen($IntName))
{
$exp_secs = $objConfig->Get($ValName) * $objConfig->Get($IntName);
$objSession->AddToSpamControl($_POST["ItemId"],$exp_secs);
if(is_object($r))
{
if($Status)
{
$StatusMessage["review"] = language("la_Review_Added");
}
else
$StatusMessage["review"] = language("la_Review_Pending");
}
else
$StatusMessage["review"] = language("la_Review_Error");
}
else
$StatusMessage["error"] = language("la_ConfigError_Review");
}
DeleteModuleTagCache('kernel');
break;
case "m_suggest_email":
$cutoff = adodb_mktime()+(int)$objConfig->Get("Suggest_MinInterval");
$email = inp_striptags($_POST["suggest_email"]);
if (strlen($email))
{
if(ValidEmail($email))
{
$sql = "SELECT * FROM ".GetTablePrefix()."SuggestMail WHERE email='".$email."' and sent<".$cutoff;
$adodbConnection = &GetADODBConnection();
$rs = $adodbConnection->Execute($sql);
$rs = false;
if($rs && !$rs->EOF)
{
if(strlen($_GET["Error"])>0)
$var_list["t"] = $_GET["Error"];
$objSession->SetVariable('suggest_result', "$email ".language("lu_already_suggested ")." ".LangDate($rs->fields["sent"]) );
}
else
{
$application =& kApplication::Instance();
$got_string = $application->GetVar('captcha_string');
if ($objConfig->Get("Suggest_Captcha") && !$application->GetVar('check_captcha')) {
$captcha_helper = $application->recallObject('CaptchaHelper');
$captcha_code = $captcha_helper->GenerateCaptchaCode();
$objSession->SetVariable('suggest_captcha_code', $captcha_code);
$application->StoreVar('suggest_email', $email);
if ($var_list["DestTemplate"] != $_GET["Captcha"]) {
$var_list["DestTemplate"] = $var_list["t"];
}
$var_list["t"] = $_GET["Captcha"];
}
else {
// if no captcha or captcha Ok
if (!$objConfig->Get("Suggest_Captcha") || $got_string == $application->RecallVar('suggest_captcha_code')) {
$Event =& $objMessageList->GetEmailEventObject("USER.SUGGEST");
if(is_object($Event))
{
if($Event->Get("Enabled")=="1")
{
$Event->Item = null;
$Event->SendToAddress($email);
$sql = "INSERT INTO ".GetTablePrefix()."SuggestMail (email,sent) VALUES ('".$email."','".adodb_mktime()."')";
$rs = $adodbConnection->Execute($sql);
$objSession->SetVariable('suggest_result', language("lu_suggest_success")." ".$email);
}
}
$e =& $objMessageList->GetEmailEventObject("USER.SUGGEST",1);
if($e->Get("Enabled")==1)
$e->SendAdmin();
if(strlen($_GET["Confirm"])>0)
$var_list["t"] = $_GET["Confirm"];
$application->RemoveVar('suggest_captcha_code');
$application->RemoveVar('suggest_email');
}
elseif ($got_string != $application->RecallVar('suggest_captcha_code')) {
// generate new captcha code in case of error
$captcha_helper = $application->recallObject('CaptchaHelper');
$captcha_code = $captcha_helper->GenerateCaptchaCode();
$objSession->SetVariable('suggest_captcha_code', $captcha_code);
$objSession->SetVariable('suggest_result', language("lu_invalid_captcha"));
}
}
}
}
else
{
if(strlen($_GET["Error"])>0)
$var_list["t"] = $_GET["Error"];
$objSession->SetVariable('suggest_result', language("lu_invalid_emailaddress"));
}
}
else
{
if(strlen($_GET["Error"])>0)
$var_list["t"] = $_GET["Error"];
$objSession->SetVariable('suggest_result', language("lu_suggest_no_address"));
}
break;
case "m_simple_search":
$keywords = trim($_POST["keywords"]);
$type = $objItemTypes->GetTypeByName("Category");
$objSearch = new clsSearchResults("Category","clsCategory");
$length = $objConfig->Get('Search_MinKeyword_Length');
if(strlen($keywords))
{
$performSearch = false;
$isExact = (substr($keywords, 0, 2) == '\"' && substr($keywords, strlen($keywords) - 2, 2) == '\"');
if ($isExact) {
$performSearch = (strlen(trim(str_replace('\"', '', $keywords))) >= $length);
}
else {
$key_arr = explode(' ', $keywords);
/*foreach($key_arr as $value) {
if (strlen(str_replace("+", "", $value)) < $length || strlen(str_replace("-", "", $value)) < $length) {
$keywords = str_replace($value, '', $keywords);
//$keywords = str_replace($value, '', $keywords);
}
}
//$keywords = str_replace(' ', ' ', $keywords);
//$keywords = str_replace('\"', '', $keywords);
*/
$tmp_keywords = str_replace("+", "", $keywords);
$tmp_keywords = str_replace("-", "", $tmp_keywords);
$performSearch = (strlen($tmp_keywords) >= $length);
}
if ($performSearch) {
$objSearchList = new clsSearchLogList();
$objSearchList->UpdateKeyword($keywords,0);
$objSearch->SetKeywords($keywords);
$objSearch->AddSimpleFields('c');
if (is_numeric($objConfig->Get("SearchRel_Pop_category"))) {
$objSearch->PctPop = ($objConfig->Get("SearchRel_Pop_category")/100);
}
if (is_numeric($objConfig->Get("SearchRel_Keyword_category"))) {
$objSearch->PctRelevance = ($objConfig->Get("SearchRel_Keyword_category")/100);
}
if (is_numeric($objConfig->Get("SearchRel_Rating_category"))) {
$objSearch->PctRating = ($objConfig->Get("SearchRel_Rating_category")/100);
}
//echo "Searching On $keywords<br>\n";
$objSearch->PerformSearch(1,$SortOrder,TRUE);
$SearchPerformed = TRUE;
//$objSearch->SetRelevence($type->Get("ItemType"), "CategoryId");
//echo "Finished Setting Category Relevence<br>\n";
}
else {
if(strlen($_GET["Error"])>0)
$var_list["t"] = $_GET["Error"];
$MissingCount = SetMissingDataErrors("m_simplesearch");
$MissingCount++;
setSearchError(lu_keywords_tooshort);
}
}
else
{
if (strlen($_GET["Error"])>0) {
$var_list["t"] = $_GET["Error"];
}
$MissingCount = SetMissingDataErrors("m_simplesearch");
$MissingCount++;
setSearchError('lu_no_keyword');
}
break;
case "m_adv_search":
if ($_GET['type']) {
$modules = Array( 1 => 'In-Portal', 2 => 'In-News',
3 => 'In-Bulletin', 4 => 'In-Link',
11 => 'In-Commerce');
$module = $modules[$_GET["type"]];
}
else {
$module = 0;
}
if( !is_object($objSearchConfig) ) $objSearchConfig = new clsSearchConfigList($module);
switch($_GET["type"])
{
case 1: /* category */
//echo "Searching for categories<br>";
$objAdvSearch = new clsAdvancedSearchResults("Category","clsCategory", $_GET["type"]);
foreach($objSearchConfig->Items as $field)
{
$fld = $field->Get("FieldName");
$Verb = $_POST["verb"][$field->Get("FieldName")];
if(!strlen($Verb) && $field->Get("FieldType")=="boolean")
{
if($_POST["value"][$field->Get("FieldName")]!=-1)
{
$Value = $_POST["value"][$field->Get("FieldName")];
$Verb = "is";
}
}
else
{
$Value = $_POST["value"][$field->Get("FieldName")];
}
switch( $_POST["andor"][$field->Get("FieldName")])
{
case 1:
$Conjuction = "AND";
break;
case 2:
$Conjuction = "OR";
break;
default:
$Conjuction = "";
break;
}
if (strlen($Value) && $Verb=="any")
{
$Verb = 'contains';
}
if(strlen($Value) && strlen($Verb)>0 && $Verb!="any")
{
// echo "Adding CAT SearchField: [".$field->Get("TableName")."]; [".$field->Get("FieldName")."]; [$Verb]; [$Value]; [$Conjuction]<br>";
$objAdvSearch->AddAdvancedField($field->Get("TableName"),$field->Get("FieldName"),$Verb,$Value,$Conjuction, 'c');
}
}
$objAdvSearch->PerformSearch(1,NULL,TRUE);
break;
}
break;
case "m_id":
$application->ApplicationDie($Action.':'.$DownloadId);
break;
case "m_simple_subsearch":
$keywords = $_POST["keywords"];
$type = $objItemTypes->GetTypeByName("Category");
$objSearch = new clsSearchResults("Category","clsCategory");
$length = $objConfig->Get('Search_MinKeyword_Length');
if(strlen($keywords))
{
$performSearch = false;
$isExact = (substr($keywords, 0, 1) == '"' && substr($keywords, strlen($keywords) - 1, 1) == '"');
if ($isExact) {
$performSearch = (strlen(trim(str_replace('\"', '', $keywords))) >= $length);
}
else {
$key_arr = explode(' ', $keywords);
/*foreach($key_arr as $value) {
if (strlen($value) < $length) {
$keywords = str_replace(' '.$value, '', $keywords);
$keywords = str_replace($value.' ', '', $keywords);
}
}*/
//$keywords = str_replace(' ', ' ', $keywords);
$tmp_keywords = str_replace("+", "", $keywords);
$tmp_keywords = str_replace("-", "", $tmp_keywords);
$performSearch = (strlen($tmp_keywords) >= $length);
}
if ($performSearch) {
$objSearchList = new clsSearchLogList();
$objSearchList->UpdateKeyword($keywords,0);
$objSearch->SetKeywords($keywords);
$objSearch->AddSimpleFields('c');
if (is_numeric($objConfig->Get("SearchRel_Pop_category"))) {
$objSearch->PctPop = ($objConfig->Get("SearchRel_Pop_category")/100);
}
if (is_numeric($objConfig->Get("SearchRel_Keyword_category"))) {
$objSearch->PctRelevance = ($objConfig->Get("SearchRel_Keyword_category")/100);
}
if (is_numeric($objConfig->Get("SearchRel_Rating_category"))) {
$objSearch->PctRating = ($objConfig->Get("SearchRel_Rating_category")/100);
}
$SearchResultIdList = $objSearch->Result_IdList();
if(count($SearchResultIdList)>0)
{
$objSearch->PerformSearch(1,$SortOrder, TRUE,$SearchResultIdList);
//$objSearch->SetRelevence($type->Get("ItemType"), "CategoryId");
}
$SearchPerformed = TRUE;
}
else {
$MissingCount = SetMissingDataErrors("m_simplesearch");
$MissingCount++;
setSearchError('lu_keywords_tooshort');
}
}
else {
$MissingCount = SetMissingDataErrors("m_simplesearch");
$MissingCount++;
setSearchError('lu_no_keyword');
}
break;
}
function setSearchError($error_phrase)
{
$GLOBALS['FormError']['m_simplesearch']['keywords'] = language($error_phrase);
$GLOBALS['objSession']->SetVariable('search_error', $error_phrase);
}
?>
Property changes on: trunk/kernel/frontaction.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.79
\ No newline at end of property
+1.80
\ No newline at end of property
Index: trunk/admin/install.php
===================================================================
--- trunk/admin/install.php (revision 8103)
+++ trunk/admin/install.php (revision 8104)
@@ -1,2042 +1,2043 @@
<?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 = '';
// new path detection without K4 init: begin
define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
define('BASE_PATH', rtrim(preg_replace('#/admin$#', '', str_replace('\\', '/', dirname($_SERVER['PHP_SELF']))), '/'));
$rootURL = 'http://'.$_SERVER['HTTP_HOST'].rtrim(BASE_PATH, '/').'/admin/';
// new path detection without K4 init: end
$pathtoroot = FULL_PATH.'/';
$admin = 'admin';
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');
$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) {
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__).'/..'));
}
include_once(FULL_PATH.'/core/kernel/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__).'/..'));
include_once(FULL_PATH.'/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
- $objThemes->CreateMissingThemes(false);
+// $objThemes->CreateMissingThemes(false);
+ $application->HandleEvent($theme_event, 'adm:OnRebuildThemes');
$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)
{
// run core install script
K4_RunSQL('/core/install/install_schema.sql');
K4_RunSQL('/core/install/install_data.sql');
K4_SetModuleVersion('Core');
// run in-portal install script
$filename = $pathtoroot.$admin."/install/inportal_schema.sql";
RunSchemaFile($ado,$filename);
$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=="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(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();
if( TableExists($ado, 'Language,Phrase') )
{
// KERNEL 4 INIT: BEGIN
define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
include_once(FULL_PATH.'/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
// KERNEL 4 INIT: END
$lang_xml =& $application->recallObject('LangXML');
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');
$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();
}
}
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!';
}
}
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);
+ $Offset = $objMessageList->ReadImportTable($EventTable, $force_finish ? false : true,300,$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);
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") {
$ado =& inst_GetADODBConnection();
$sql = 'UPDATE '.TABLE_PREFIX.'UserSession
SET LastAccessed = 0
WHERE PortalUserId IN (0,-2)';
$ado->Execute($sql);
echo "<script>window.location='index.php';</script>";
}
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");
$ado->Execute('INSERT INTO '.$g_TablePrefix.'Cache (VarName, Data) VALUES (\'ForcePermCacheUpdate\', \'1\')');
$include_file = $pathtoroot.$admin."/install/install_finish.php";
}
// 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-2007, 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.114
\ No newline at end of property
+1.115
\ No newline at end of property
Index: trunk/admin/install/upgrades/readme_4_0_1.txt
===================================================================
--- trunk/admin/install/upgrades/readme_4_0_1.txt (nonexistent)
+++ trunk/admin/install/upgrades/readme_4_0_1.txt (revision 8104)
@@ -0,0 +1,18 @@
+Readme notes for In-Portal 4.0.1
+Intechnic Corporation, Apr 5, 2007
+
+In current release versions of all modules were synchronized and increased to 4.x.x.
+Major features in In-commerce like group-based pricing, payments
+and shipping were introduced. Both back-end improvements and bug fixes
+were done on platform and modules levels. For complete list of changes refer to changelog_4_0_1.txt.
+
+New Features:
+
+- Security code for User Registration
+- Column picker for grids in Admin
+
+Bugs:
+
+- Sending User password in email after registration
+- Copy/Paste items as Admin
+- Uploading files with FCK editor
\ No newline at end of file
Property changes on: trunk/admin/install/upgrades/readme_4_0_1.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/inportal_data.sql
===================================================================
--- trunk/admin/install/inportal_data.sql (revision 8103)
+++ trunk/admin/install/inportal_data.sql (revision 8104)
@@ -1,228 +1,228 @@
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 PermissionConfig VALUES (DEFAULT, 'CATEGORY.ADD', 'lu_PermName_Category.Add_desc', 'lu_PermName_Category.Add_error', 'In-Portal');
INSERT INTO PermissionConfig VALUES (DEFAULT, 'CATEGORY.DELETE', 'lu_PermName_Category.Delete_desc', 'lu_PermName_Category.Delete_error', 'In-Portal');
INSERT INTO PermissionConfig VALUES (DEFAULT, 'CATEGORY.ADD.PENDING', 'lu_PermName_Category.AddPending_desc', 'lu_PermName_Category.AddPending_error', 'In-Portal');
INSERT INTO PermissionConfig VALUES (DEFAULT, 'CATEGORY.MODIFY', 'lu_PermName_Category.Modify_desc', 'lu_PermName_Category.Modify_error', 'In-Portal');
INSERT INTO PermissionConfig VALUES (DEFAULT, 'ADMIN', 'lu_PermName_Admin_desc', 'lu_PermName_Admin_error', 'Admin');
INSERT INTO PermissionConfig VALUES (DEFAULT, 'LOGIN', 'lu_PermName_Login_desc', 'lu_PermName_Admin_error', 'Front');
INSERT INTO PermissionConfig VALUES (DEFAULT, 'DEBUG.ITEM', 'lu_PermName_Debug.Item_desc', '', 'Admin');
INSERT INTO PermissionConfig VALUES (DEFAULT, 'DEBUG.LIST', 'lu_PermName_Debug.List_desc', '', 'Admin');
INSERT INTO PermissionConfig VALUES (DEFAULT, 'DEBUG.INFO', 'lu_PermName_Debug.Info_desc', '', 'Admin');
INSERT INTO PermissionConfig VALUES (DEFAULT, 'PROFILE.MODIFY', 'lu_PermName_Profile.Modify_desc', '', 'Admin');
INSERT INTO PermissionConfig VALUES (DEFAULT, 'SHOWLANG', 'lu_PermName_ShowLang_desc', '', 'Admin');
INSERT INTO PermissionConfig VALUES (DEFAULT, 'FAVORITES', 'lu_PermName_favorites_desc', 'lu_PermName_favorites_error', 'In-Portal');
INSERT INTO PermissionConfig VALUES (DEFAULT, 'SYSTEM_ACCESS.READONLY', 'la_PermName_SystemAccess.ReadOnly_desc', 'la_PermName_SystemAccess.ReadOnly_error', 'Admin');
INSERT INTO Permissions VALUES (DEFAULT, 'LOGIN', 12, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:site.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:browse.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:advanced_view.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:reviews.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_categories.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_categories.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_search.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_search.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_email.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_email.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_custom.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_custom.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_custom.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configuration_custom.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:users.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_list.advanced:ban', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_list.advanced:send_email', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_groups.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_groups.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_groups.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_groups.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_groups.advanced:send_email', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_groups.advanced:manage_permissions', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_users.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_users.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_email.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_email.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_custom.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_custom.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_custom.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_custom.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_banlist.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_banlist.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_banlist.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_banlist.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:reports.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:log_summary.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:searchlog.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:searchlog.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:sessionlog.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:sessionlog.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:emaillog.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:emaillog.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:visits.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:visits.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_general.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_general.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:modules.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mod_status.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mod_status.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mod_status.advanced:approve', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mod_status.advanced:decline', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:addmodule.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:addmodule.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:addmodule.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:tag_library.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_themes.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_themes.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_themes.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_themes.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_styles.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_styles.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_styles.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_styles.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_lang.advanced:set_primary', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_lang.advanced:import', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_lang.advanced:export', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:tools.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:backup.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:restore.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:export.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:main_import.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:sql_query.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:sql_query.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:server_info.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, '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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 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, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT count(*) FROM <%prefix%>Category WHERE Status=1 ', NULL, 'la_prompt_ActiveCategories', '0', '1');
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT count(*) FROM <%prefix%>PortalUser WHERE Status=1 ', NULL, 'la_prompt_ActiveUsers', '0', '1');
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT count(*) FROM <%prefix%>UserSession', NULL, 'la_prompt_CurrentSessions', '0', '1');
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) as CategoryCount FROM <%prefix%>Category', NULL, 'la_prompt_TotalCategories', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS ActiveCategories FROM <%prefix%>Category WHERE Status = 1', NULL, 'la_prompt_ActiveCategories', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS PendingCategories FROM <%prefix%>Category WHERE Status = 2', NULL, 'la_prompt_PendingCategories', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS DisabledCategories FROM <%prefix%>Category WHERE Status = 0', NULL, 'la_prompt_DisabledCategories', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, '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 (DEFAULT, 'In-Portal', 'SELECT COUNT(*) FROM <%prefix%>Category WHERE EditorsPick = 1', NULL, 'la_prompt_CategoryEditorsPick', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Category', NULL, 'la_prompt_NewestCategoryDate', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Category', NULL, 'la_prompt_LastCategoryUpdate', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS TotalUsers FROM <%prefix%>PortalUser', NULL, 'la_prompt_TopicsUsers', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS ActiveUsers FROM <%prefix%>PortalUser WHERE Status = 1', NULL, 'la_prompt_UsersActive', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS PendingUsers FROM <%prefix%>PortalUser WHERE Status = 2', NULL, 'la_prompt_UsersPending', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS DisabledUsers FROM <%prefix%>PortalUser WHERE Status = 0', NULL, 'la_prompt_UsersDisabled', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>PortalUser', NULL, 'la_prompt_NewestUserDate', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT( DISTINCT LOWER( Country ) ) FROM <%prefix%>PortalUser WHERE LENGTH(Country) > 0', NULL, 'la_prompt_UsersUniqueCountries', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT( DISTINCT LOWER( State ) ) FROM <%prefix%>PortalUser WHERE LENGTH(State) > 0', NULL, 'la_prompt_UsersUniqueStates', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS TotalUserGroups FROM <%prefix%>PortalGroup', NULL, 'la_prompt_TotalUserGroups', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS BannedUsers FROM <%prefix%>PortalUser WHERE IsBanned = 1', NULL, 'la_prompt_BannedUsers', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS NonExipedSessions FROM <%prefix%>UserSession WHERE Status = 1', NULL, 'la_prompt_NonExpiredSessions', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS ThemeCount FROM <%prefix%>Theme', NULL, 'la_prompt_ThemeCount', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', 'SELECT COUNT(*) AS RegionsCount FROM <%prefix%>Language', NULL, 'la_prompt_RegionsCount', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', '<%m:sql_action sql="SHOW+TABLES" action="COUNT" field="*"%>', NULL, 'la_prompt_TablesCount', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', '<%m:sql_action sql="SHOW+TABLE+STATUS" action="SUM" field="Rows"%>', NULL, 'la_prompt_RecordsCount', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Portal', '<%m:custom_action sql="empty" action="SysFileSize"%>', NULL, 'la_prompt_SystemFileSize', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, '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 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);
-INSERT INTO Modules VALUES ('In-Portal', 'kernel/', 'm', '4.0.2', 1, 0, '', 0, '1054738405');
\ No newline at end of file
+INSERT INTO Modules VALUES ('In-Portal', 'kernel/', 'm', '4.0.2', 1, 0, '', 0, '1054738405');
Property changes on: trunk/admin/install/inportal_data.sql
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.75
\ No newline at end of property
+1.76
\ No newline at end of property
Index: trunk/admin/install/langpacks/english.lang
===================================================================
--- trunk/admin/install/langpacks/english.lang (revision 8103)
+++ trunk/admin/install/langpacks/english.lang (revision 8104)
@@ -1,2356 +1,2362 @@
<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="cust_shipping_addr_block" Module="In-Portal" Type="1">QmxvY2sgU2hpcHBpbmcgQWRkcmVzcyBFZGl0aW5n</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_AdministrativeConsole" Module="In-Portal" Type="1">QWRtaW5pc3RyYXRpdmUgQ29uc29sZQ==</PHRASE>
<PHRASE Label="la_Always" Module="In-Portal" Type="1">QWx3YXlz</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_AvailableColumns" Module="In-Portal" Type="1">QXZhaWxhYmxlIENvbHVtbnM=</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_Category" Module="In-Portal" Type="1">Q2F0ZWdvcnk=</PHRASE>
<PHRASE Label="la_col_CategoryName" Module="In-Portal" Type="1">Q2F0ZWdvcnkgTmFtZQ==</PHRASE>
<PHRASE Label="la_col_CreatedOn" Module="In-Portal" Type="1">Q3JlYXRlZCBPbg==</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_Error" Module="In-Portal" Type="1">Jm5ic3A7</PHRASE>
<PHRASE Label="la_col_Event" Module="In-Portal" Type="1">RXZlbnQ=</PHRASE>
<PHRASE Label="la_col_FieldName" Module="In-Portal" Type="1">RmllbGQgTmFtZQ==</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_ImageEnabled" Module="In-Portal" Type="1">U3RhdHVz</PHRASE>
<PHRASE Label="la_col_ImageName" Module="In-Portal" Type="1">SW1hZ2U=</PHRASE>
<PHRASE Label="la_col_ImageUrl" Module="In-Portal" Type="1">VVJM</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_Preview" Module="In-Portal" Type="1">UHJldmlldw==</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_Prompt" Module="In-Portal" Type="1">RmllbGQgUHJvbXB0</PHRASE>
<PHRASE Label="la_col_PurchaseDate" Module="In-Portal" Type="1">RGF0ZQ==</PHRASE>
<PHRASE Label="la_col_RebateAmount" Module="In-Portal" Type="1">JA==</PHRASE>
<PHRASE Label="la_col_RebatePercent" Module="In-Portal" Type="1">JQ==</PHRASE>
<PHRASE Label="la_col_RelationshipType" Module="In-Portal" Type="1">UmVsYXRpb24gVHlwZQ==</PHRASE>
<PHRASE Label="la_col_ReviewedBy" Module="In-Portal" Type="1">UmV2aWV3ZWQgQnk=</PHRASE>
<PHRASE Label="la_col_ReviewText" Module="In-Portal" Type="1">UmV2aWV3IFRleHQ=</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_TargetId" Module="In-Portal" Type="1">SXRlbQ==</PHRASE>
<PHRASE Label="la_col_TargetType" Module="In-Portal" Type="1">SXRlbSBUeXBl</PHRASE>
<PHRASE Label="la_col_Title" Module="In-Portal" Type="1">VGl0bGU=</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_Value" Module="In-Portal" Type="1">RmllbGQgVmFsdWU=</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_MailFunctionHeaderSeparator" Module="In-Portal" Type="1">SGVhZGVyIFNlcGFyYXRvciBUeXBl</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_PerpageReviews" Module="In-Portal" Type="1">UmV2aWV3cyBwZXIgcGFnZQ==</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_ConfirmDeleteExportPreset" Module="In-Portal" Type="1">QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSBzZWxlY3RlZCBFeHBvcnQgUHJlc2V0Pw==</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_PasswordMatch" Module="In-Portal" Type="1">UGFzc3dvcmRzIGRvIG5vdCBtYXRjaCE=</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_AltValue" Module="In-Portal" Type="1">QWx0IFZhbHVl</PHRASE>
<PHRASE Label="la_fld_AssignedCoupon" Module="In-Portal" Type="1">QXNzaWduZWQgQ291cG9u</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_CreatedById" Module="In-Portal" Type="1">Q3JlYXRlZCBCeQ==</PHRASE>
<PHRASE Label="la_fld_CreatedOn" Module="In-Portal" Type="1">Q3JlYXRlZCBPbg==</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_Expire" Module="In-Portal" Type="1">RXhwaXJl</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_ExportPresetName" Module="In-Portal" Type="1">RXhwb3J0IFByZXNldCBUaXRsZQ==</PHRASE>
<PHRASE Label="la_fld_ExportPresets" Module="In-Portal" Type="1">RXhwb3J0IFByZXNldA==</PHRASE>
<PHRASE Label="la_fld_ExportSavePreset" Module="In-Portal" Type="1">U2F2ZS9VcGRhdGUgRXhwb3J0IFByZXNldA==</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_Hits" Module="In-Portal" Type="1">SGl0cw==</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_ImageId" Module="In-Portal" Type="1">SW1hZ2UgSUQ=</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_IsPrimary" Module="In-Portal" Type="1">UHJpbWFyeQ==</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_Location" Module="In-Portal" Type="1">TG9jYXRpb24=</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_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_Primary" Module="In-Portal" Type="1">UHJpbWFyeQ==</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_Rating" Module="In-Portal" Type="1">UmF0aW5n</PHRASE>
<PHRASE Label="la_fld_RelationshipId" Module="In-Portal" Type="1">UmVsYXRpb24gSUQ=</PHRASE>
<PHRASE Label="la_fld_RelationshipType" Module="In-Portal" Type="1">VHlwZQ==</PHRASE>
<PHRASE Label="la_fld_RemoteUrl" Module="In-Portal" Type="1">UmVtb3RlIFVSTA==</PHRASE>
<PHRASE Label="la_fld_ReplaceDuplicates" Module="In-Portal" Type="1">UmVwbGFjZSBEdXBsaWNhdGVz</PHRASE>
<PHRASE Label="la_fld_ReviewId" Module="In-Portal" Type="0">UmV2aWV3IElE</PHRASE>
<PHRASE Label="la_fld_ReviewText" Module="In-Portal" Type="1">UmV2aWV3IFRleHQ=</PHRASE>
<PHRASE Label="la_fld_SameAsThumb" Module="In-Portal" Type="1">U2FtZSBBcyBUaHVtYg==</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_TargetId" Module="In-Portal" Type="1">SXRlbQ==</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_Title" Module="In-Portal" Type="1">VGl0bGU=</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_Upload" Module="In-Portal" Type="1">VXBsb2FkIEZpbGUgRnJvbSBMb2NhbCBQQw==</PHRASE>
<PHRASE Label="la_fld_URL" Module="In-Portal" Type="1">VVJM</PHRASE>
<PHRASE Label="la_fld_Visibility" Module="In-Portal" Type="1">VmlzaWJpbGl0eQ==</PHRASE>
<PHRASE Label="la_fld_Votes" Module="In-Portal" Type="1">Vm90ZXM=</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_Password" Module="In-Portal" Type="1">SW52YWxpZCB1c2VybmFtZSBvciBwYXNzd29yZA==</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_Linux" Module="In-Portal" Type="1">TGludXggKFxuKQ==</PHRASE>
<PHRASE Label="la_LocalImage" Module="In-Portal" Type="1">TG9jYWwgSW1hZ2U=</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_Never" Module="In-Portal" Type="1">TmV2ZXI=</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_OneWay" Module="In-Portal" Type="1">T25lIFdheQ==</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_PickedColumns" Module="In-Portal" Type="1">U2VsZWN0ZWQgQ29sdW1ucw==</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_PrimaryCategory" Module="In-Portal" Type="1">UHJpbWFyeQ==</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_Reciprocal" Module="In-Portal" Type="1">UmVjaXByb2NhbA==</PHRASE>
+ <PHRASE Label="la_registration_captcha" Module="In-Portal" Type="1">VXNlIENhcHRjaGEgY29kZSBvbiBSZWdpc3RyYXRpb24=</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_Counters" Module="In-Portal" Type="1">Q291bnRlcnM=</PHRASE>
<PHRASE Label="la_section_CustomFields" Module="In-Portal" Type="1">Q3VzdG9tIEZpZWxkcw==</PHRASE>
<PHRASE Label="la_section_FullSizeImage" Module="In-Portal" Type="1">RnVsbCBTaXplIEltYWdl</PHRASE>
<PHRASE Label="la_section_General" Module="In-Portal" Type="1">R2VuZXJhbA==</PHRASE>
<PHRASE Label="la_section_Image" Module="In-Portal" Type="1">SW1hZ2U=</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_Relation" Module="In-Portal" Type="1">UmVsYXRpb24=</PHRASE>
<PHRASE Label="la_section_Templates" Module="In-Portal" Type="1">VGVtcGxhdGVz</PHRASE>
<PHRASE Label="la_section_ThumbnailImage" Module="In-Portal" Type="1">VGh1bWJuYWlsIEltYWdl</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_SelectColumns" Module="In-Portal" Type="1">U2VsZWN0IENvbHVtbnM=</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_Editing_Review" Module="In-Portal" Type="1">RWRpdGluZyBSZXZpZXc=</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_Image" Module="In-Portal" Type="1">QWRkaW5nIEltYWdl</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_Relationship" Module="In-Portal" Type="1">QWRkaW5nIFJlbGF0aW9uc2hpcA==</PHRASE>
<PHRASE Label="la_title_Adding_Review" Module="In-Portal" Type="1">QWRkaW5nIFJldmlldw==</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_ColumnPicker" Module="In-Portal" Type="1">Q29sdW1uIFBpY2tlcg==</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_CouponSelector" Module="In-Portal" Type="1">Q291cG9uIFNlbGVjdG9y</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_Image" Module="In-Portal" Type="1">RWRpdGluZyBJbWFnZQ==</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_Relationship" Module="In-Portal" Type="1">RWRpdGluZyBSZWxhdGlvbnNoaXA=</PHRASE>
<PHRASE Label="la_title_Editing_Review" Module="In-Portal" Type="1">RWRpdGluZyBSZXZpZXc=</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_Images" Module="In-Portal" Type="1">SW1hZ2Vz</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_Image" Module="In-Portal" Type="1">TmV3IEltYWdl</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_Relationship" Module="In-Portal" Type="1">TmV3IFJlbGF0aW9uc2hpcA==</PHRASE>
<PHRASE Label="la_title_New_Review" Module="In-Portal" Type="1">TmV3IFJldmlldw==</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_NewReview" Module="In-Portal" Type="1">TmV3IFJldmlldw==</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_images" Module="In-Portal" Type="1">TmV3IEltYWdlcw==</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_setprimarycategory" Module="In-Portal" Type="1">U2V0IFByaW1hcnkgQ2F0ZWdvcnk=</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_translate" Module="In-Portal" Type="1">VHJhbnNsYXRl</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_multiselect" Module="In-Portal" Type="1">TXVsdGlwbGUgU2VsZWN0</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_week" Module="In-Portal" Type="1">d2Vlaw==</PHRASE>
+ <PHRASE Label="la_Windows" Module="In-Portal" Type="1">V2luZG93cyAoXHJcbik=</PHRASE>
<PHRASE Label="la_year" Module="In-Portal" Type="1">eWVhcg==</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_captcha" Module="In-Portal" Type="0">U2VjdXJpdHkgY29kZQ==</PHRASE>
+ <PHRASE Label="lu_captcha_prompt" Module="In-Portal" Type="0">RW50ZXIgU2VjdXJpdHkgQ29kZQ==</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_pending_approval" Module="In-Portal" Type="0">UGVuZGluZyBBcHByb3ZhbA==</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">WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IEluLXBvcnRhbCByZWdpc3RyYXRpb24KCldlbGNvbWUgdG8gSW4tcG9ydGFsIQ0KWW91ciB1c2VyIHJlZ2lzdHJhdGlvbiBoYXMgYmVlbiBhcHByb3ZlZC4gWW91ciB1c2VyIG5hbWUgaXMgIjxpbnA6dG91c2VyIF9GaWVsZD0iVXNlck5hbWUiIC8+IiBhbmQgeW91ciBwYXNzd29yZCBpcyAiPGlucDp0b3VzZXIgX0ZpZWxkPSJwYXNzd29yZCIgLz4iLg0K</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.103
\ No newline at end of property
+1.104
\ No newline at end of property
Index: trunk/core/kernel/session/session.php
===================================================================
--- trunk/core/kernel/session/session.php (revision 8103)
+++ trunk/core/kernel/session/session.php (revision 8104)
@@ -1,894 +1,891 @@
<?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 $PersistentVars = 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())
{
if (defined('IS_INSTALL') && IS_INSTALL && !$this->Application->TableFound($this->TableName)) {
return false;
}
-
$fields_hash = Array (
$this->IDField => $session->SID,
$this->TimestampField => $session->Expiration
);
$this->Conn->doInsert($fields_hash, $this->TableName);
foreach ($additional_fields as $field_name => $field_value) {
$this->SetField($session, $field_name, $field_value);
}
}
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)
{
$value_changed = !isset($this->DirectVars[$var_name]) || ($this->DirectVars[$var_name] != $value);
if ($value_changed) {
$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;
}
function LoadPersistentVars(&$session)
{
$user_id = $this->Application->RecallVar('user_id');
if ($user_id != -2) {
// root & normal users
$sql = 'SELECT VariableValue, VariableName
FROM '.TABLE_PREFIX.'PersistantSessionData
WHERE PortalUserId = '.$user_id;
$this->PersistentVars = $this->Conn->GetCol($sql, 'VariableName');
}
else {
$this->PersistentVars = Array ();
}
}
function StorePersistentVar(&$session, $var_name, $var_value)
{
$this->PersistentVars[$var_name] = $var_value;
$replace_hash = Array (
'PortalUserId' => $this->Application->RecallVar('user_id'),
'VariableName' => $var_name,
'VariableValue' => $var_value
);
$this->Conn->doInsert($replace_hash, TABLE_PREFIX.'PersistantSessionData', 'REPLACE');
}
function RecallPersistentVar(&$session, $var_name, $default = false)
{
return isset($this->PersistentVars[$var_name]) ? $this->PersistentVars[$var_name] : $default;
}
function RemovePersistentVar(&$session, $var_name)
{
unset($this->PersistentVars[$var_name]);
$user_id = $this->Application->RecallVar('user_id');
if ($user_id != -2) {
$sql = 'DELETE FROM '.TABLE_PREFIX.'PersistantSessionData
WHERE PortalUserId = '.$user_id.' AND VariableName = '.$this->Conn->qstr($var_name);
$this->Conn->Query($sql);
}
}
}
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($special)
{
$this->Storage =& $this->Application->recallObject('SessionStorage.'.$special);
$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($special);
$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');
return ;
}
}
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)
{
//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
$is_install = defined('IS_INSTALL') && IS_INSTALL;
if (!$is_install && $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
$this->SetCookie('cookies_on', 1, adodb_mktime() + 31104000); //one year should be enough
}
}
else
$this->CookiesEnabled = true;
return $this->CookiesEnabled;
}
/**
* Sets cookie for current site using path and domain
*
* @param string $name
* @param mixed $value
* @param int $expires
*/
function SetCookie($name, $value, $expires = null)
{
setcookie($name, $value, $expires, $this->CookiePath, $this->CookieDomain, $this->CookieSecure);
}
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 ? $this->GetSessionCookie() : $get_sid;
break;
case smCOOKIES_ONLY:
$sid = $this->GetSessionCookie();
break;
case smGET_ONLY:
$sid = $get_sid;
break;
case smCOOKIES_AND_GET:
$cookie_sid = $this->GetSessionCookie();
//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;
}
}
$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);
if ($this->Application->IsAdmin() || $this->Special == 'admin') {
$this->StoreVar('admin', 1);
}
if ($this->Special != '') {
// front-session called from admin or otherwise, then save it's data
$this->SaveData();
}
}
/**
* Returns SID from cookie
*
* @return int
*/
function GetSessionCookie()
{
return isset($this->Application->HttpQuery->Cookie[$this->CookieName]) ? $this->Application->HttpQuery->Cookie[$this->CookieName] : false;
}
/**
* Updates SID in cookie with new value
*
*/
function SetSessionCookie()
{
$this->SetCookie($this->CookieName, $this->SID, $this->Expiration);
$_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')) {
// dump session data
$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);
}
if ($this->Application->isDebugMode() && constOn('DBG_SHOW_PERSISTENTDATA')) {
// dump persistent session data
if ($this->Storage->PersistentVars) {
$this->Application->Debugger->appendHTML('Persistant Session:');
$session_data = $this->Storage->PersistentVars;
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);
}
}
}
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)
{
// save last_template
$wid = $this->Application->GetVar('m_wid');
$last_env = $this->getLastTemplateENV($t, Array('m_opener' => 'u'));
$last_template = basename($_SERVER['PHP_SELF']).'|'.substr($last_env, strlen(ENV_VAR_NAME) + 1);
$this->StoreVar(rtrim('last_template_'.$wid, '_'), $last_template);
$last_env = $this->getLastTemplateENV($t, Array());
$last_template = basename($_SERVER['PHP_SELF']).'|'.substr($last_env, strlen(ENV_VAR_NAME) + 1);
$this->StoreVar(rtrim('last_template_popup_'.$wid, '_'), $last_template);
// save other last... variables for mistical purposes (customizations may be)
$this->StoreVar('last_url', $_SERVER['REQUEST_URI']); // needed by ord:StoreContinueShoppingLink
$this->StoreVar('last_env', substr($last_env, strlen(ENV_VAR_NAME)+1));
}
function getLastTemplateENV($t, $params)
{
$params['__URLENCODE__'] = 1;
return $this->Application->BuildEnv($t, $params, 'all');
}
function StoreVar($name, $value)
{
$this->Data->Set($name, $value);
}
function StorePersistentVar($name, $value)
{
$this->Storage->StorePersistentVar($this, $name, $value);
}
function LoadPersistentVars()
{
$this->Storage->LoadPersistentVars($this);
}
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 RecallPersistentVar($name, $default = false)
{
return $this->Storage->RecallPersistentVar($this, $name, $default);
}
function RemoveVar($name)
{
$this->Storage->RemoveFromData($this, $name);
$this->Data->Remove($name);
}
function RemovePersistentVar($name)
{
return $this->Storage->RemovePersistentVar($this, $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();
}
-
/**
* Allows to check if user in this session is logged in or not
*
* @return bool
*/
function LoggedIn()
{
$user_id = $this->RecallVar('user_id');
-
$ret = $user_id > 0;
if ($this->RecallVar('admin') == 1 && ($user_id == -1)) {
$ret = true;
}
return $ret;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/session/session.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.56
\ No newline at end of property
+1.57
\ No newline at end of property
Index: trunk/core/kernel/utility/unit_config_reader.php
===================================================================
--- trunk/core/kernel/utility/unit_config_reader.php (revision 8103)
+++ trunk/core/kernel/utility/unit_config_reader.php (revision 8104)
@@ -1,753 +1,742 @@
<?php
class kUnitConfigReader extends kBase {
/**
* Configs readed
*
* @var Array
* @access private
*/
var $configData=Array();
var $configFiles=Array();
var $CacheExpired = false;
var $prefixFiles = array();
var $ProcessAllConfigs = false;
var $FinalStage = false;
var $StoreCache = false;
var $AfterConfigProcessed = array();
/**
* Scan kernel and user classes
* for available configs
*
* @access protected
*/
function Init($prefix,$special)
{
parent::Init($prefix,$special);
}
function CacheParsedData()
{
$event_manager =& $this->Application->recallObject('EventManager');
$aggregator =& $this->Application->recallObject('TagsAggregator', 'kArray');
$config_vars = Array(
'SessionTimeout',
'SessionCookieName',
'SessionReferrerCheck',
'CookieSessions',
'UseCronForRegularEvent',
'User_GuestGroup',
'User_LoggedInGroup',
'SessionTimeout',
'UseModRewrite',
'UseOutputCompression',
'OutputCompressionLevel',
);
foreach ($config_vars as $var) {
$this->Application->ConfigValue($var);
}
$cache = Array(
'Factory.Files' => $this->Application->Factory->Files,
'Factory.realClasses' => $this->Application->Factory->realClasses,
'Factory.Dependencies' => $this->Application->Factory->Dependencies,
'ConfigReader.prefixFiles' => $this->prefixFiles,
'EventManager.buildEvents' => $event_manager->buildEvents,
'EventManager.beforeRegularEvents' => $event_manager->beforeRegularEvents,
'EventManager.afterRegularEvents' => $event_manager->afterRegularEvents,
'EventManager.beforeHooks' => $event_manager->beforeHooks,
'EventManager.afterHooks' => $event_manager->afterHooks,
'TagsAggregator.data' => $aggregator->_Array,
// the following caches should be reset based on admin interaction (adjusting config, enabling modules etc)
'Application.Caches.ConfigVariables' => $this->Application->Caches['ConfigVariables'],
'Application.ConfigCacheIds' => $this->Application->ConfigCacheIds,
'Application.ConfigHash' => $this->Application->ConfigHash,
'Application.ReplacementTemplates' => $this->Application->ReplacementTemplates,
'Application.ModuleInfo' => $this->Application->ModuleInfo,
);
$conn =& $this->Application->GetADODBConnection();
$conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("configs_parsed", '.$conn->qstr(serialize($cache)).', '.adodb_mktime().')');
$conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("config_files", '.$conn->qstr(serialize($this->configFiles)).', '.adodb_mktime().')');
unset($this->configFiles);
}
function RestoreParsedData()
{
$conn =& $this->Application->GetADODBConnection();
$data = $conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "configs_parsed"');
if ($data && $data['Cached'] > 0 ) {
$cache = unserialize($data['Data']);
$this->Application->Factory->Files = $cache['Factory.Files'];
$this->Application->Factory->realClasses = $cache['Factory.realClasses'];
$this->Application->Factory->Dependencies = $cache['Factory.Dependencies'];
$this->prefixFiles = $cache['ConfigReader.prefixFiles'];
$event_manager =& $this->Application->recallObject('EventManager');
$event_manager->buildEvents = $cache['EventManager.buildEvents'];
$event_manager->beforeRegularEvents = $cache['EventManager.beforeRegularEvents'];
$event_manager->afterRegularEvents = $cache['EventManager.afterRegularEvents'];
$event_manager->beforeHooks = $cache['EventManager.beforeHooks'];
$event_manager->afterHooks = $cache['EventManager.afterHooks'];
$aggregator =& $this->Application->recallObject('TagsAggregator', 'kArray');
$aggregator->_Array = $cache['TagsAggregator.data'];
$this->Application->ConfigHash = $cache['Application.ConfigHash'];
$this->Application->Caches['ConfigVariables'] = $cache['Application.ConfigCacheIds'];
$this->Application->ConfigCacheIds = $cache['Application.ConfigCacheIds'];
$this->Application->ReplacementTemplates = $cache['Application.ReplacementTemplates'];
$this->Application->ModuleInfo = $cache['Application.ModuleInfo'];
return true;
}
else return false;
}
function ResetParsedData($include_sections = false)
{
$conn =& $this->Application->GetADODBConnection();
$conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "configs_parsed"');
if ($include_sections) {
$conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "sections_parsed"');
}
}
function scanModules($folderPath, $cache = true)
{
if (defined('IS_INSTALL') && IS_INSTALL && !defined('FORCE_CONFIG_CACHE')) {
// disable config caching during installation
$cache = false;
}
if ($cache) {
$restored = $this->RestoreParsedData();
if ($restored) return;
}
$this->ProcessAllConfigs = true;
$this->includeConfigFiles($folderPath, $cache);
$this->ParseConfigs();
// tell AfterConfigRead to store cache if neede
// can't store it here beacuse AfterConfigRead needs ability to change config data
$this->StoreCache = $cache;
}
function findConfigFiles($folderPath)
{
// if FULL_PATH = "/" ensure, that all "/" in $folderPath are not deleted
$reg_exp = '/^'.preg_quote(FULL_PATH, '/').'/';
$folderPath = preg_replace($reg_exp, '', $folderPath, 1); // this make sense, since $folderPath may NOT contain FULL_PATH
$fh = opendir(FULL_PATH.$folderPath);
while (($sub_folder = readdir($fh))) {
$full_path = FULL_PATH.$folderPath.'/'.$sub_folder;
if ($this->isDir($full_path)) {
//the following is to exclude OLD, not removed files when upgrading to 'core'
if (preg_match('/^\/kernel\/kernel4\//', $folderPath) || ($folderPath == '/kernel/units' && file_exists(FULL_PATH.$this->getConfigName('/core/units/'.$sub_folder)))) {
continue;
}
if (file_exists(FULL_PATH.$this->getConfigName($folderPath.'/'.$sub_folder))) {
$this->configFiles[] = $this->getConfigName($folderPath.'/'.$sub_folder);
}
$this->findConfigFiles($full_path);
// if (filemtime($full_path) > $cached) { }
}
}
}
function includeConfigFiles($folderPath, $cache = true)
{
$this->Application->refreshModuleInfo();
$conn =& $this->Application->GetADODBConnection();
$data = $conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "config_files"');
if ($cache && $data) {
$this->configFiles = unserialize($data['Data']);
shuffle($this->configFiles);
$files_cached = $data['Cached'];
}
else {
$this->findConfigFiles($folderPath); // search from base directory
}
foreach ($this->configFiles as $filename)
{
$prefix = $this->PreloadConfigFile($filename);
if (!$prefix) {
trigger_error('Prefix not defined in config file '.$filename, E_USER_ERROR);
}
}
}
/**
* Process all read config files - called ONLY when there is no cache!
*
*/
function ParseConfigs()
{
$prioritized_configs = array();
foreach ($this->configData as $prefix => $config) {
if (isset($config['ConfigPriority'])) {
$prioritized_configs[$prefix] = $config['ConfigPriority'];
continue;
}
$this->parseConfig($prefix);
}
foreach ($this->configData as $prefix => $config) {
$this->ProcessDependencies($prefix);
$this->postProcessConfig($prefix, 'AggregateConfigs', 'sub_prefix');
$clones = $this->postProcessConfig($prefix, 'Clones', 'prefix');
}
asort($prioritized_configs);
foreach ($prioritized_configs as $prefix => $priority) {
$this->parseConfig($prefix);
}
}
function AfterConfigRead()
{
// if (!$this->ProcessAllConfigs) return ;
$this->FinalStage = true;
foreach ($this->configData as $prefix => $config) {
if (in_array($prefix, $this->AfterConfigProcessed)) continue;
$this->Application->HandleEvent( new kEvent($prefix.':OnAfterConfigRead') );
$this->AfterConfigProcessed[] = $prefix;
}
if ($this->StoreCache) $this->CacheParsedData();
}
/**
* Register nessasary classes
* This method should only process the data which is cached!
*
* @param string $prefix
* @access private
*/
function parseConfig($prefix)
{
$config =& $this->configData[$prefix];
$event_manager =& $this->Application->recallObject('EventManager');
$register_classes = getArrayValue($config,'RegisterClasses');
if (!$register_classes) $register_classes = Array();
$class_params=Array('ItemClass','ListClass','EventHandlerClass','TagProcessorClass');
foreach($class_params as $param_name)
{
if ( !(isset($config[$param_name]) ) ) continue;
$config[$param_name]['pseudo'] = $this->getPrefixByParamName($param_name,$prefix);
$register_classes[] = $config[$param_name];
}
foreach($register_classes as $class_info)
{
$require_classes = getArrayValue($class_info, 'require_classes');
if ($require_classes) {
if (!is_array($require_classes)) {
$require_classes = array($require_classes);
}
if (!isset($config['_Dependencies'][$class_info['class']])) {
$config['_Dependencies'][$class_info['class']] = array();
}
$config['_Dependencies'][$class_info['class']] = array_merge($config['_Dependencies'][$class_info['class']], $require_classes);
}
$this->Application->registerClass(
$class_info['class'],
$config['BasePath'].'/'.$class_info['file'],
$class_info['pseudo']/*,
getArrayValue($class_info, 'require_classes')*/
);
if (getArrayValue($class_info, 'build_event')) {
$event_manager->registerBuildEvent($class_info['pseudo'],$class_info['build_event']);
}
}
$regular_events = getArrayValue($config, 'RegularEvents');
if($regular_events)
{
foreach($regular_events as $short_name => $regular_event_info)
{
$event_manager->registerRegularEvent( $short_name, $config['Prefix'].':'.$regular_event_info['EventName'], $regular_event_info['RunInterval'], $regular_event_info['Type'] );
}
}
$hooks = getArrayValue($config, 'Hooks');
if (is_array($hooks) && count($hooks) > 0) {
foreach ($hooks as $hook) {
if (isset($config['ParentPrefix']) && $hook['HookToPrefix'] == $config['ParentPrefix']) {
trigger_error('Depricated Hook Usage [prefix: <b>'.$config['Prefix'].'</b>; do_prefix: <b>'.$hook['DoPrefix'].'</b>] use <b>#PARENT#</b> as <b>HookToPrefix</b> value, where HookToPrefix is same as ParentPrefix', E_USER_NOTICE);
}
if ($hook['HookToPrefix'] == '') {
$hook['HookToPrefix'] = $config['Prefix']; // new: set hooktoprefix to current prefix if not set
}
if (isset($config['ParentPrefix'])) {
// new: allow to set hook to parent prefix what ever it is
if ($hook['HookToPrefix'] == '#PARENT#') {
$hook['HookToPrefix'] = $config['ParentPrefix'];
}
if ($hook['DoPrefix'] == '#PARENT#') {
$hook['DoPrefix'] = $config['ParentPrefix'];
}
}
elseif ($hook['HookToPrefix'] == '#PARENT#' || $hook['DoPrefix'] == '#PARENT#') {
continue; // we need parent prefix but it's not set !
}
$do_prefix = $hook['DoPrefix'] == '' ? $config['Prefix'] : $hook['DoPrefix'];
if ( !is_array($hook['HookToEvent']) ) {
$hook_events = Array( $hook['HookToEvent'] );
}
else {
$hook_events = $hook['HookToEvent'];
}
foreach ($hook_events as $hook_event) {
$this->Application->registerHook($hook['HookToPrefix'], $hook['HookToSpecial'], $hook_event, $hook['Mode'], $do_prefix, $hook['DoSpecial'], $hook['DoEvent'], $hook['Conditional']);
}
}
}
if ( is_array(getArrayValue($config, 'AggregateTags')) ) {
foreach ($config['AggregateTags'] as $aggregate_tag) {
if (isset($config['ParentPrefix'])) {
if ($aggregate_tag['AggregateTo'] == $config['ParentPrefix']) {
trigger_error('Depricated Aggregate Tag Usage [prefix: <b>'.$config['Prefix'].'</b>; AggregateTo: <b>'.$aggregate_tag['AggregateTo'].'</b>] use <b>#PARENT#</b> as <b>AggregateTo</b> value, where AggregateTo is same as ParentPrefix', E_USER_NOTICE);
}
if ($aggregate_tag['AggregateTo'] == '#PARENT#') {
$aggregate_tag['AggregateTo'] = $config['ParentPrefix'];
}
}
$aggregate_tag['LocalPrefix'] = $config['Prefix'];
$this->Application->registerAggregateTag($aggregate_tag);
}
}
if (isset($config['ReplacementTemplates']) && $config['ReplacementTemplates']) {
// replacement templates defined in this config
$this->Application->ReplacementTemplates = array_merge_recursive2($this->Application->ReplacementTemplates, $config['ReplacementTemplates']);
}
if ( $this->Application->isDebugMode(false) && constOn('DBG_VALIDATE_CONFIGS') && isset($config['TableName']) ) {
$this->ValidateConfig($prefix);
}
}
-
function ValidateConfig($prefix)
{
global $debugger;
-
$config =& $this->configData[$prefix];
-
$tablename = $config['TableName'];
$float_types = Array ('float', 'double', 'numeric');
$conn =& $this->Application->GetADODBConnection();
$table_found = $conn->Query('SHOW TABLES LIKE "'.$tablename.'"');
if (!$table_found) {
// config present, but table missing, strange
$debugger->appendHTML("<b class='debug_error'>Config Warning: </b>Table <strong>$tablename</strong> missing, but prefix <b>".$config['Prefix']."</b> requires it!");
safeDefine('DBG_RAISE_ON_WARNINGS', 1);
return ;
}
-
$res = $conn->Query('DESCRIBE '.$tablename);
$config_link = $debugger->getFileLink(FULL_PATH.$this->prefixFiles[$config['Prefix']], 1, $config['Prefix']);
-
$error_messages = Array (
'field_not_found' => 'Field <strong>%s</strong> exists in the database, but <strong>is not defined</strong> in config',
'default_missing' => 'Default value for field <strong>%s</strong> not set in config',
'not_null_error1' => 'Field <strong>%s</strong> is NOT NULL in the database, but is not configured as not_null or required',
'not_null_error2' => 'Field <strong>%s</strong> is described as NOT NULL in config, but <strong>does not have DEFAULT value</strong>',
'not_null_error3' => 'Field <strong>%s</strong> is described as <strong>NOT NULL in config</strong>, but is <strong>NULL in db</strong>',
'invalid_default' => '<strong>Default value</strong> for field %s<strong>%s</strong> not sync. to db (in config = %s, in db = %s)',
'type_missing' => '<strong>Type definition</strong> for field <strong>%s</strong> missing in config',
);
-
$config_errors = Array ();
$tablename = preg_replace('/^'.preg_quote(TABLE_PREFIX, '/').'(.*)/', '\\1', $tablename); // remove table prefix
-
+
foreach ($res as $field) {
$f_name = $field['Field'];
if (getArrayValue($config, 'Fields')) {
if (preg_match('/l[\d]+_[\w]/', $f_name)) {
// skip multilingual fields
continue;
}
-
if (!array_key_exists ($f_name, $config['Fields'])) {
$config_errors[] = sprintf($error_messages['field_not_found'], $f_name);
}
else {
if (is_numeric($field['Default'])) {
$field['Default'] = preg_match('/[\.,]/', $field['Default']) ? (float)$field['Default'] : (int)$field['Default'];
}
$options = $config['Fields'][$f_name];
$default_missing = false;
if (!array_key_exists('default', $options)) {
$config_errors[] = sprintf($error_messages['default_missing'], $f_name);
$default_missing = true;
}
-
if ($field['Null'] != 'YES') {
// field is NOT NULL in database (MySQL5 for null returns "NO", but MySQL4 returns "")
if ( $f_name != $config['IDField'] && !isset($options['not_null']) && !isset($options['required']) ) {
$config_errors[] = sprintf($error_messages['not_null_error1'], $f_name);
}
if (isset($options['not_null']) && $options['not_null'] && !isset($options['default']) ) {
$config_errors[] = sprintf($error_messages['not_null_error2'], $f_name);
}
}
else {
if (isset($options['not_null']) && $options['not_null']) {
$config_errors[] = sprintf($error_messages['not_null_error3'], $f_name);
}
}
-
if (!array_key_exists('type', $options)) {
$config_errors[] = sprintf($error_messages['type_missing'], $f_name);
}
-
if (!$default_missing) {
if ($f_name == $config['IDField'] && $options['type'] != 'string' && $options['default'] !== 0) {
$config_errors[] = sprintf($error_messages['invalid_default'], '<span class="debug_error">IDField</span> ', $f_name, $this->varDump($options['default']), $this->varDump($field['Default']));
}
else if ($options['default'] != '#NOW#' && $field['Default'] !== $options['default'] && !in_array($options['type'], $float_types)) {
$config_errors[] = sprintf($error_messages['invalid_default'], '', $f_name, $this->varDump($options['default']), $this->varDump($field['Default']));
}
}
}
}
}
-
if ($config_errors) {
$error_prefix = '<strong class="debug_error">Config Error'.(count($config_errors) > 1 ? 's' : '').': </strong> for prefix <strong>'.$config_link.'</strong> ('.$tablename.') in unit config:<br />';
$config_errors = $error_prefix.'&nbsp;&nbsp;&nbsp;'.implode('<br />&nbsp;&nbsp;&nbsp;', $config_errors);
-
$debugger->appendHTML($config_errors);
- safeDefine('DBG_RAISE_ON_WARNINGS', 1);
- }
+ safeDefine('DBG_RAISE_ON_WARNINGS', 1);
+ }
}
function varDump($value)
{
return '<strong>'.var_export($value, true).'</strong> of '.gettype($value);
+
}
-
+
function ProcessDependencies($prefix)
{
$config =& $this->configData[$prefix];
$deps = getArrayValue($config, '_Dependencies');
if (!$deps) return ;
foreach ($deps as $real_class => $requires) {
foreach ($requires as $class) {
$this->Application->registerDependency($real_class, $class);
}
}
unset($config['_Dependencies']);
}
function postProcessConfig($prefix, $config_key, $dst_prefix_var)
{
$main_config =& $this->configData[$prefix];
$sub_configs = getArrayValue($main_config, $config_key);
if (!$sub_configs) {
return array();
}
unset($main_config[$config_key]);
$processed = array();
foreach ($sub_configs as $sub_prefix => $sub_config) {
if ($config_key == 'AggregateConfigs' && !isset($this->configData[$sub_prefix])) {
$this->loadConfig($sub_prefix);
}
$sub_config['Prefix'] = $sub_prefix;
$this->configData[$sub_prefix] = array_merge_recursive2($this->configData[$$dst_prefix_var], $sub_config);
// when merging empty array to non-empty results non-empty array, but empty is required
foreach ($sub_config as $sub_key => $sub_value) {
if (!$sub_value) {
unset($this->configData[$sub_prefix][$sub_key]);
}
}
if ($config_key == 'Clones') {
$this->prefixFiles[$sub_prefix] = $this->prefixFiles[$prefix];
}
$this->postProcessConfig($sub_prefix, $config_key, $dst_prefix_var);
if ($config_key == 'AggregateConfigs') {
$processed = array_merge($this->postProcessConfig($sub_prefix, 'Clones', 'prefix'), $processed);
}
elseif ($this->ProcessAllConfigs) {
$this->parseConfig($sub_prefix);
}
array_push($processed, $sub_prefix);
}
if (!$prefix) {
// configs, that used only for cloning & not used ifself
unset($this->configData[$prefix]);
}
return array_unique($processed);
}
function PreloadConfigFile($filename)
{
$config_found = file_exists(FULL_PATH.$filename) && $this->configAllowed($filename);
if( defined('DEBUG_MODE') && DEBUG_MODE && constOn('DBG_PROFILE_INCLUDES') )
{
if ( in_array($filename, get_required_files()) ) return;
global $debugger;
if($config_found) {
$file = FULL_PATH.$filename;
$debugger->ProfileStart('inc_'.crc32($file), $file);
include_once($file);
$debugger->ProfileFinish('inc_'.crc32($file));
$debugger->profilerAddTotal('includes', 'inc_'.crc32($file));
}
}
else
{
if ($config_found) include_once(FULL_PATH.$filename);
}
if ($config_found) {
if (isset($config) && $config) {
// config file is included for 1st time -> save it's content for future processing
$prefix = isset($config['Prefix']) ? $config['Prefix'] : '';
preg_match('/\/(.*)\//U', $filename, $rets);
$config['ModuleFolder'] = $rets[1];
$config['BasePath'] = dirname(FULL_PATH.$filename);
if (isset($config['AdminTemplatePath'])) {
// append template base folder for admin templates path of this prefix
$module_templates = $rets[1] == 'core' ? 'in-portal/' : $rets[1].'/';
$config['AdminTemplatePath'] = $module_templates.$config['AdminTemplatePath'];
}
$this->configData[$prefix] = $config;
$this->prefixFiles[$prefix] = $filename;
return $prefix;
}
elseif ($prefix = array_search($filename, $this->prefixFiles)) {
// attempt is made to include config file twice or more, but include_once prevents that,
// but file exists on hdd, then it is already saved to all required arrays, just return it's prefix
return $prefix;
}
}
return 'dummy';
}
function loadConfig($prefix)
{
if (!isset($this->prefixFiles[$prefix])) {
if ($this->Application->isDebugMode()) $this->Application->Debugger->appendTrace();
trigger_error('Configuration file for prefix <b>'.$prefix.'</b> is unknown', E_USER_ERROR);
return ;
}
$file = $this->prefixFiles[$prefix];
$prefix = $this->PreloadConfigFile($file);
$clones = $this->postProcessConfig($prefix, 'AggregateConfigs', 'sub_prefix');
$clones = array_merge($this->postProcessConfig($prefix, 'Clones', 'prefix'), $clones);
if ($this->FinalStage) {
array_unshift($clones, $prefix);
$clones = array_unique($clones);
foreach ($clones as $a_prefix) {
$this->Application->HandleEvent( new kEvent($a_prefix.':OnAfterConfigRead') );
}
}
}
/**
* Reads unit (specified by $prefix)
* option specified by $option
*
* @param string $prefix
* @param string $name
* @param mixed $default
* @return string
* @access public
*/
function getUnitOption($prefix, $name, $default = false)
{
if (preg_match('/(.*)\.(.*)/', $prefix, $rets)) {
if (!isset($this->configData[$rets[1]])) {
$this->loadConfig($rets[1]);
}
$ret = isset($this->configData[$rets[1]][$name][$rets[2]]) ? $this->configData[$rets[1]][$name][$rets[2]] : false;
// $ret = getArrayValue($this->configData, $rets[1], $name, $rets[2]);
}
else {
if (!isset($this->configData[$prefix])) {
$this->loadConfig($prefix);
}
$ret = isset($this->configData[$prefix][$name]) ? $this->configData[$prefix][$name] : false;
// $ret = getArrayValue($this->configData, $prefix, $name);
}
return $ret === false ? $default : $ret;
}
/**
* Read all unit with $prefix options
*
* @param string $prefix
* @return Array
* @access public
*/
function getUnitOptions($prefix)
{
if (!isset($this->configData[$prefix])) {
$this->loadConfig($prefix);
}
return $this->configData[$prefix];
}
/**
* Set's new unit option value
*
* @param string $prefix
* @param string $name
* @param string $value
* @access public
*/
function setUnitOption($prefix, $name, $value)
{
if (preg_match('/(.*)\.(.*)/', $prefix, $rets)) {
if (!isset($this->configData[$rets[1]])) {
$this->loadConfig($rets[1]);
}
$this->configData[$rets[1]][$name][$rets[2]] = $value;
}
else {
if (!isset($this->configData[$prefix])) {
$this->loadConfig($prefix);
}
$this->configData[$prefix][$name] = $value;
}
}
function getPrefixByParamName($paramName,$prefix)
{
$pseudo_class_map=Array(
'ItemClass'=>'%s',
'ListClass'=>'%s_List',
'EventHandlerClass'=>'%s_EventHandler',
'TagProcessorClass'=>'%s_TagProcessor'
);
return sprintf($pseudo_class_map[$paramName],$prefix);
}
/**
* Get's config file name based
* on folder name supplied
*
* @param string $folderPath
* @return string
* @access private
*/
function getConfigName($folderPath)
{
return $folderPath.'/'.basename($folderPath).'_config.php';
}
/**
* is_dir ajustment to work with
* directory listings too
*
* @param string $folderPath
* @return bool
* @access private
*/
function isDir($folderPath)
{
$base_name = basename($folderPath);
$ret = !( $base_name == '.' || $base_name == '..' );
return $ret && is_dir($folderPath);
}
/**
* Checks if config file is allowed for includion (if module of config is installed)
*
* @param string $config_path relative path from in-portal directory
*/
function configAllowed($config_path)
{
if (defined('IS_INSTALL') && IS_INSTALL) {
// at installation start no modules in db and kernel configs could not be read
return true;
}
if (preg_match('#/plugins/|/core#', $config_path)) {
return true;
}
$module_found = false;
if (!$this->Application->ModuleInfo) return false;
foreach($this->Application->ModuleInfo as $module_name => $module_info)
{
$module_path = '/'.$module_info['Path'];
if (preg_match('/^'.preg_quote($module_path, '/').'/', $config_path)) {
// if (substr($config_path, 0, strlen($module_path)) == $module_path) {
// config file path starts with module folder path
$module_found = true;
break;
}
}
return $module_found;
}
/**
* Returns true if config exists and is allowed for reading
*
* @param string $prefix
* @return bool
*/
function prefixRegistred($prefix)
{
return isset($this->prefixFiles[$prefix]) ? true : false;
}
function iterateConfigs($callback_function, $params)
{
$this->includeConfigFiles(MODULES_PATH); //make sure to re-read all configs
$this->AfterConfigRead();
foreach ($this->configData as $prefix => $config_data) {
$callback_function[0]->$callback_function[1]($prefix, $config_data, $params);
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/utility/unit_config_reader.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.75
\ No newline at end of property
+1.76
\ No newline at end of property
Index: trunk/core/kernel/db/db_tag_processor.php
===================================================================
--- trunk/core/kernel/db/db_tag_processor.php (revision 8103)
+++ trunk/core/kernel/db/db_tag_processor.php (revision 8104)
@@ -1,1876 +1,1877 @@
<?php
class kDBTagProcessor extends TagProcessor {
/**
* Description
*
* @var kDBConnection
* @access public
*/
var $Conn;
function kDBTagProcessor()
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
}
/**
* Returns true if "new" button was pressed in toolbar
*
* @param Array $params
* @return bool
*/
function IsNewMode($params)
{
$object =& $this->getObject($params);
return $object->GetID() <= 0;
}
/**
* Returns view menu name for current prefix
*
* @param Array $params
* @return string
*/
function GetItemName($params)
{
$item_name = $this->Application->getUnitOption($this->Prefix, 'ViewMenuPhrase');
return $this->Application->Phrase($item_name);
}
function ViewMenu($params)
{
$block_params = $params;
unset($block_params['block']);
$block_params['name'] = $params['block'];
$list =& $this->GetList($params);
$block_params['PrefixSpecial'] = $list->getPrefixSpecial();
return $this->Application->ParseBlock($block_params);
}
function SearchKeyword($params)
{
$list =& $this->GetList($params);
return $this->Application->RecallVar($list->getPrefixSpecial().'_search_keyword');
}
/**
* Draw filter menu content (for ViewMenu) based on filters defined in config
*
* @param Array $params
* @return string
*/
function DrawFilterMenu($params)
{
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $params['spearator_block'];
$separator = $this->Application->ParseBlock($block_params);
$filter_menu = $this->Application->getUnitOption($this->Prefix,'FilterMenu');
if(!$filter_menu)
{
trigger_error('<span class="debug_error">no filters defined</span> for prefix <b>'.$this->Prefix.'</b>, but <b>DrawFilterMenu</b> tag used', E_USER_WARNING);
return '';
}
// Params: label, filter_action, filter_status
$block_params['name'] = $params['item_block'];
$view_filter = $this->Application->RecallVar($this->getPrefixSpecial().'_view_filter');
if($view_filter === false)
{
$event_params = Array('prefix'=>$this->Prefix,'special'=>$this->Special,'name'=>'OnRemoveFilters');
$this->Application->HandleEvent( new kEvent($event_params) );
$view_filter = $this->Application->RecallVar($this->getPrefixSpecial().'_view_filter');
}
$view_filter = unserialize($view_filter);
$filters = Array();
$prefix_special = $this->getPrefixSpecial();
foreach ($filter_menu['Filters'] as $filter_key => $filter_params) {
$group_params = isset($filter_params['group_id']) ? $filter_menu['Groups'][ $filter_params['group_id'] ] : Array();
if (!isset($group_params['element_type'])) {
$group_params['element_type'] = 'checkbox';
}
if (!$filter_params) {
$filters[] = $separator;
continue;
}
$block_params['label'] = addslashes( $this->Application->Phrase($filter_params['label']) );
if (getArrayValue($view_filter,$filter_key)) {
$submit = 0;
if (isset($params['old_style'])) {
$status = $group_params['element_type'] == 'checkbox' ? 1 : 2;
}
else {
$status = $group_params['element_type'] == 'checkbox' ? '[\'img/check_on.gif\']' : '[\'img/menu_dot.gif\']';
}
}
else {
$submit = 1;
$status = 'null';
}
$block_params['filter_action'] = 'set_filter("'.$prefix_special.'","'.$filter_key.'","'.$submit.'",'.$params['ajax'].');';
$block_params['filter_status'] = $status; // 1 - checkbox, 2 - radio, 0 - no image
$filters[] = $this->Application->ParseBlock($block_params);
}
return implode('', $filters);
}
function IterateGridFields($params)
{
$mode = $params['mode'];
$def_block = isset($params['block']) ? $params['block'] : '';
$force_block = isset($params['force_block']) ? $params['force_block'] : false;
$grids = $this->Application->getUnitOption($this->Prefix,'Grids');
$grid_config = $grids[$params['grid']]['Fields'];
$picker_helper =& $this->Application->RecallObject('ColumnPickerHelper');
/* @var $picker_helper kColumnPickerHelper */
$picker_helper->ApplyPicker($this->getPrefixSpecial(), $grid_config, $params['grid']);
$std_params['pass_params']='true';
$std_params['PrefixSpecial']=$this->getPrefixSpecial();
$o = '';
$i = 0;
foreach ($grid_config as $field => $options) {
$i++;
$block_params = Array();
$block_params['name'] = $force_block ? $force_block : (isset($options[$mode.'_block']) ? $options[$mode.'_block'] : $def_block);
$block_params['field'] = $field;
$block_params['sort_field'] = isset($options['sort_field']) ? $options['sort_field'] : $field;
$block_params['filter_field'] = isset($options['filter_field']) ? $options['filter_field'] : $field;
if (isset($options['filter_width'])) {
$block_params['filter_width'] = $options['filter_width'];
}
elseif (isset($options['width'])) {
if (isset($options['filter_block']) && preg_match('/range/', $options['filter_block'])) {
if ($options['width'] < 60) {
$options['width'] = 60;
$block_params['filter_width'] = 20;
}
else {
$block_params['filter_width'] = $options['width'] - 40;
}
}
else {
$block_params['filter_width'] = max($options['width']-10, 20);
}
}
if (isset($block_params['filter_width'])) $block_params['filter_width'] .= 'px';
$field_options = $this->Application->getUnitOption($this->Prefix.'.'.$field, 'Fields');
if (isset($field_options['use_phrases'])) {
$block_params['use_phrases'] = $field_options['use_phrases'];
}
$block_params['is_last'] = ($i == count($grid_config));
$block_params = array_merge($std_params, $options, $block_params);
$o.= $this->Application->ParseBlock($block_params, 1);
}
return $o;
}
function PickerCRC($params)
{
/* @var $picker_helper kColumnPickerHelper */
$picker_helper =& $this->Application->RecallObject('ColumnPickerHelper');
$picker_helper->SetGridName($params['grid']);
$data = $picker_helper->LoadColumns($this->getPrefixSpecial());
return $data['crc'];
}
function 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';
$i = 0;
while (!$list->EOL())
{
$this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET
$block_params['is_last'] = ($i == $list->SelectedCount-1);
$o.= $this->Application->ParseBlock($block_params, 1);
$list->GoNext();
$i++;
}
$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) );
$block_params['is_last'] = ($i == $list->SelectedCount-1);
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['first_col'] = $column_number == 1 ? 1 : 0;
$block_params['last_col'] = $column_number == $columns ? 1 : 0;
$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'] : '';
+ $t = isset($params['template']) ? $params['template'] : '';
unset($params['template']);
if (!$t) $t = $this->Application->GetVar('t');
if (isset($params['page'])) {
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $params['page']);
unset($params['page']);
}
if (!isset($params['pass'])) {
$params['pass'] = 'm,'.$this->getPrefixSpecial();
}
return $this->Application->HREF($t, '', $params);
}
function ColumnWidth($params)
{
$columns = $this->Application->Parser->GetParam('columns');
return round(100/$columns).'%';
}
/**
* Append prefix and special to tag
* params (get them from tagname) like
* they were really passed as params
*
* @param Array $tag_params
* @return Array
* @access protected
*/
function prepareTagParams($tag_params = Array())
{
/*if (isset($tag_params['list_name'])) {
$list =& $this->GetList($tag_params);
$this->Init($list->Prefix, $list->Special);
}*/
$ret = $tag_params;
$ret['Prefix'] = $this->Prefix;
$ret['Special'] = $this->Special;
$ret['PrefixSpecial'] = $this->getPrefixSpecial();
return $ret;
}
function GetISO($currency)
{
if ($currency == 'selected') {
$iso = $this->Application->RecallVar('curr_iso');
}
elseif ($currency == 'primary' || $currency == '') {
$iso = $this->Application->GetPrimaryCurrency();
}
else { //explicit currency
$iso = $currency;
}
return $iso;
}
function ConvertCurrency($value, $iso)
{
$converter =& $this->Application->recallObject('kCurrencyRates');
// convery primary currency to selected (if they are the same, converter will just return)
$value = $converter->Convert($value, 'PRIMARY', $iso);
return $value;
}
function AddCurrencySymbol($value, $iso)
{
$currency =& $this->Application->recallObject('curr.-'.$iso, null, Array('skip_autoload' => true));
if( !$currency->isLoaded() ) $currency->Load($iso, 'ISO');
+
$symbol = $currency->GetDBField('Symbol');
if (!$symbol) $symbol = $currency->GetDBField('ISO').'&nbsp;';
if ($currency->GetDBField('SymbolPosition') == 0) {
$value = $symbol.$value;
}
if ($currency->GetDBField('SymbolPosition') == 1) {
$value = $value.$symbol;
}
return $value;
}
/**
* Get's requested field value
*
* @param Array $params
* @return string
* @access public
*/
function Field($params)
{
$field = $this->SelectParam($params, 'name,field');
if( !$this->Application->IsAdmin() ) $params['no_special'] = 'no_special';
$object =& $this->getObject($params);
if ( $this->HasParam($params, 'db') )
{
$value = $object->GetDBField($field);
}
else
{
if( $this->HasParam($params, 'currency') )
{
$iso = $this->GetISO($params['currency']);
$original = $object->GetDBField($field);
$value = $this->ConvertCurrency($original, $iso);
$object->SetDBField($field, $value);
$object->Fields[$field]['converted'] = true;
}
$format = getArrayValue($params, 'format');
if( !$format || $format == '$format' )
{
$format = null;
}
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( 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 ErrorWarning($params)
{
if (!isset($params['field'])) {
$params['field'] = 'any';
}
if ($this->HasError($params)) {
$params['prefix'] = $this->getPrefixSpecial();
return $this->Application->ParseBlock($params);
}
}
function IsRequired($params)
{
$field = $params['field'];
$object =& $this->getObject($params);;
$formatter_class = getArrayValue($object->Fields, $field, 'formatter');
if ($formatter_class == 'kMultiLanguage')
{
$formatter =& $this->Application->recallObject($formatter_class);
$field = $formatter->LangFieldName($field);
}
$options = $object->GetFieldOptions($field);
return getArrayValue($options,'required');
}
function 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] = (strlen($key) == strlen($value) && ($key == $value) ? ' '.$selected : '');
$o .= $this->Application->ParseBlock($block_params, 1);
}
}
return $o;
}
function PredefinedSearchOptions($params)
{
$object =& $this->getObject($params);
/* @var $object kDBList */
$field = $params['field'];
$saved_value = $object->Queried ? $object->GetDBField($field) : null;
$object->SetDBField($field, $this->SearchField($params));
$view_name = $this->Application->RecallVar($this->getPrefixSpecial().'_current_view');
$custom_filter = $this->Application->RecallPersistentVar($this->getPrefixSpecial().'_custom_filter.'.$view_name);
$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;
}
/**
* Returns grid padination information
* Can return links to pages
*
* @param Array $params
* @return mixed
*/
function PageInfo($params)
{
$object =& $this->GetList($params);
/* @var $object kDBList */
$type = $params['type'];
unset($params['type']); // remove parameters used only by current tag
switch ($type) {
case 'current':
$ret = $object->Page;
break;
case 'total':
$ret = $object->GetTotalPages();
break;
case 'prev':
$ret = $object->Page > 1 ? $object->Page - 1 : false;
break;
case 'next':
$ret = $object->Page < $object->GetTotalPages() ? $object->Page + 1 : false;
break;
}
if ($ret && isset($params['as_link']) && $params['as_link']) {
unset($params['as_link']); // remove parameters used only by current tag
$params['page'] = $ret;
$current_page = $object->Page; // backup current page
$ret = $this->PageLink($params);
$this->Application->SetVar($object->getPrefixSpecial().'_Page', $current_page); // restore page
}
return $ret;
}
/**
* Print grid pagination using
* block names specified
*
* @param Array $params
* @return string
* @access public
*/
function PrintPages($params)
{
$list =& $this->GetList($params);
$prefix_special = $list->getPrefixSpecial();
$total_pages = $list->GetTotalPages();
if ($total_pages > 1) $this->Application->Parser->DataExists = true;
if($total_pages == 0) $total_pages = 1; // display 1st page as selected in case if we have no pages at all
$o = '';
// what are these 2 lines for?
$this->Application->SetVar($prefix_special.'_event','');
$this->Application->SetVar($prefix_special.'_id','');
$current_page = $list->Page; // $this->Application->RecallVar($prefix_special.'_Page');
$block_params = $this->prepareTagParams($params);
$split = ( isset($params['split'] ) ? $params['split'] : 10 );
$split_start = $current_page - ceil($split/2);
if ($split_start < 1){
$split_start = 1;
}
$split_end = $split_start + $split-1;
if ($split_end > $total_pages) {
$split_end = $total_pages;
$split_start = max($split_end - $split + 1, 1);
}
if ($current_page > 1){
$prev_block_params = $this->prepareTagParams();
if ($total_pages > $split){
$prev_block_params['page'] = max($current_page-$split, 1);
$prev_block_params['name'] = $this->SelectParam($params, 'prev_page_split_render_as,prev_page_split_block');
if ($prev_block_params['name']){
$o .= $this->Application->ParseBlock($prev_block_params, 1);
}
}
$prev_block_params['name'] = 'page';
$prev_block_params['page'] = $current_page-1;
$prev_block_params['name'] = $this->SelectParam($params, 'prev_page_render_as,block_prev_page,prev_page_block');
if ($prev_block_params['name']) {
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $current_page-1);
$o .= $this->Application->ParseBlock($prev_block_params, 1);
}
}
else {
if ( $no_prev_page_block = $this->SelectParam($params, 'no_prev_page_render_as,block_no_prev_page') ) {
$block_params['name'] = $no_prev_page_block;
$o .= $this->Application->ParseBlock($block_params, 1);
}
}
$separator_params['name'] = $this->SelectParam($params, 'separator_render_as,block_separator');
for ($i = $split_start; $i <= $split_end; $i++)
{
if ($i == $current_page) {
$block = $this->SelectParam($params, 'current_render_as,active_render_as,block_current,active_block');
}
else {
$block = $this->SelectParam($params, 'link_render_as,inactive_render_as,block_link,inactive_block');
}
$block_params['name'] = $block;
$block_params['page'] = $i;
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $i);
$o .= $this->Application->ParseBlock($block_params, 1);
if ($this->SelectParam($params, 'separator_render_as,block_separator')
&& $i < $split_end)
{
$o .= $this->Application->ParseBlock($separator_params, 1);
}
}
if ($current_page < $total_pages){
$next_block_params = $this->prepareTagParams();
$next_block_params['page']=$current_page+1;
$next_block_params['name'] = $this->SelectParam($params, 'next_page_render_as,block_next_page,next_page_block');
if ($next_block_params['name']){
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $current_page+1);
$o .= $this->Application->ParseBlock($next_block_params, 1);
}
if ($total_pages > $split){
$next_block_params['page']=min($current_page+$split, $total_pages);
$next_block_params['name'] = $this->SelectParam($params, 'next_page_split_render_as,next_page_split_block');
if ($next_block_params['name']){
$o .= $this->Application->ParseBlock($next_block_params, 1);
}
}
}
$this->Application->SetVar($this->getPrefixSpecial().'_Page', $current_page);
return $o;
}
/**
* Print grid pagination using
* block names specified
*
* @param Array $params
* @return string
* @access public
*/
function PaginationBar($params)
{
return $this->PrintPages($params);
}
/**
* Returns field name (processed by kMultiLanguage formatter
* if required) and item's id from it's IDField or field required
*
* @param Array $params
* @return Array (id,field)
* @access private
*/
function prepareInputName($params)
{
$field = $this->SelectParam($params, 'name,field');
$object =& $this->getObject($params);
$formatter_class = getArrayValue($object->Fields, $field, 'formatter');
if ($formatter_class == 'kMultiLanguage')
{
$formatter =& $this->Application->recallObject($formatter_class);
$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);
$wid = $this->Application->GetTopmostWid($this->Prefix);
$session_name = rtrim($this->getPrefixSpecial().'_selected_ids_'.$wid, '_');
$ids = explode(',', $this->Application->RecallVar($session_name));
$cur_id = $object->GetID();
$i = array_search($cur_id, $ids);
if ($i !== false) {
return $i < count($ids) - 1 ? $ids[$i + 1] : '';
}
return '';
}
function PrevId($params)
{
$object =& $this->getObject($params);
$wid = $this->Application->GetTopmostWid($this->Prefix);
$session_name = rtrim($this->getPrefixSpecial().'_selected_ids_'.$wid, '_');
$ids = explode(',', $this->Application->RecallVar($session_name));
$cur_id = $object->GetID();
$i = array_search($cur_id, $ids);
if ($i !== false) {
return $i > 0 ? $ids[$i - 1] : '';
}
return '';
}
function IsSingle($params)
{
return ($this->NextId($params) === '' && $this->PrevId($params) === '');
}
function IsLast($params)
{
return ($this->NextId($params) === '');
}
function IsFirst($params)
{
return ($this->PrevId($params) === '');
}
/**
* Checks if field value is equal to proposed one
*
* @param Array $params
* @return bool
*/
function FieldEquals($params)
{
$object =& $this->getObject($params);
$ret = $object->GetDBField($this->SelectParam($params, 'name,field')) == $params['value'];
// if( getArrayValue($params,'inverse') ) $ret = !$ret;
return $ret;
}
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)
{
// extract tag_perams passed directly to SectionTitle tag for specific prefix
foreach ($params as $tp_name => $tp_value) {
if (preg_match('/(.*)\[(.*)\]/', $tp_name, $regs)) {
$all_tag_params[ $regs[1] ][ $regs[2] ] = $tp_value;
unset($params[$tp_name]);
}
}
$tag_params = Array();
foreach($prefixes as $prefix_special)
{
$prefix_data = $this->Application->processPrefix($prefix_special);
$prefix_data['prefix_special'] = rtrim($prefix_data['prefix_special'],'.');
if($all_tag_params)
{
$tag_params = getArrayValue($all_tag_params, $prefix_data['prefix_special']);
if(!$tag_params) $tag_params = Array();
}
$tag_params = array_merge_recursive2($params, $tag_params);
$objects[ $prefix_data['prefix_special'] ] =& $this->Application->recallObject($prefix_data['prefix_special'], $prefix_data['prefix'], $tag_params);
$object_status[ $prefix_data['prefix_special'] ] = $objects[ $prefix_data['prefix_special'] ]->IsNewItem() ? 'new' : 'edit';
// a. set object's status field (adding item/editing item) for each object in title
if( getArrayValue($title_info[ $object_status[ $prefix_data['prefix_special'] ].'_status_labels' ],$prefix_data['prefix_special']) )
{
$status_labels[ $prefix_data['prefix_special'] ] = $title_info[ $object_status[ $prefix_data['prefix_special'] ].'_status_labels' ][ $prefix_data['prefix_special'] ];
$title = str_replace('#'.$prefix_data['prefix_special'].'_status#', $status_labels[ $prefix_data['prefix_special'] ], $title);
}
// b. setting object's titlefield value (in titlebar ONLY) to default in case if object beeing created with no titlefield filled in
if( $object_status[ $prefix_data['prefix_special'] ] == 'new' )
{
$new_value = $this->getInfo( $objects[ $prefix_data['prefix_special'] ], 'titlefield' );
if(!$new_value && getArrayValue($title_info['new_titlefield'],$prefix_data['prefix_special']) ) $new_value = $this->Application->Phrase($title_info['new_titlefield'][ $prefix_data['prefix_special'] ]);
$title = str_replace('#'.$prefix_data['prefix_special'].'_titlefield#', $new_value, $title);
}
}
}
// 2. replace phrases if any found in format string
$title = $this->Application->ReplaceLanguageTags($title,false);
// 3. find and replace any replacement vars
preg_match_all('/#(.*_.*)#/Uis',$title,$rets);
if ($rets[1]) {
$replacement_vars = array_keys( array_flip($rets[1]) );
foreach ($replacement_vars as $replacement_var) {
$var_info = explode('_',$replacement_var,2);
$object =& $objects[ $var_info[0] ];
$new_value = $this->getInfo($object,$var_info[1]);
$title = str_replace('#'.$replacement_var.'#', $new_value, $title);
}
}
// replace trailing spaces inside title preset + '' occurences into single space
$title = preg_replace('/[ ]*\'\'[ ]*/', ' ', $title);
$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;
}
}
function GridInfo($params) {
$object =& $this->GetList($params);
/* @var $object kDBList */
switch ($params['type'])
{
case 'filtered':
return $object->GetRecordsCount();
case 'total':
return $object->GetNoFilterCount();
case 'from':
return $object->RecordsCount ? $object->Offset+1 : 0; //0-based
case 'to':
return min($object->Offset + $object->PerPage, $object->RecordsCount);
case 'total_pages':
return $object->GetTotalPages();
case 'needs_pagination':
return $object->RecordsCount > $object->PerPage;
}
}
/**
* 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 'multiselect':
case 'radio':
$field_options = $object->GetFieldOptions($field, 'options');
if ($object->GetDBField('DirectOptions')) {
// used for custom fields
$field_options['options'] = $object->GetDBField('DirectOptions');
}
else {
// used for configuration
$field_options['options'] = $helper->GetValuesHash( $object->GetDBField($params['value_list_field']) );
}
$object->SetFieldOptions($field, $field_options);
break;
case 'text':
case 'textarea':
$params['field_params'] = $helper->ParseConfigSQL($object->GetDBField($params['value_list_field']));
break;
case 'password':
case 'checkbox':
default:
break;
}
return $this->Application->ParseBlock($params, 1);
}
/**
* Get's requested custom field value
*
* @param Array $params
* @return string
* @access public
*/
function CustomField($params)
{
$params['name'] = 'cust_'.$this->SelectParam($params, 'name,field');
return $this->Field($params);
}
function CustomFieldLabel($params)
{
$object =& $this->getObject($params);
$field = $this->SelectParam($params, 'name,field');
$sql = 'SELECT FieldLabel
FROM '.$this->Application->getUnitOption('cf', 'TableName').'
WHERE FieldName = '.$this->Conn->qstr($field);
return $this->Application->Phrase($this->Conn->GetOne($sql));
}
/**
* transposes 1-dimensional array elements for vertical alignment according to given columns and per_page parameters
*
* @param array $arr
* @param int $columns
* @param int $per_page
* @return array
*/
function LinearToVertical(&$arr, $columns, $per_page)
{
$rows = $columns;
// in case if after applying per_page limit record count less then
// can fill requrested column count, then fill as much as we can
$cols = min(ceil($per_page / $columns), ceil(count($arr) / $columns));
$imatrix = array();
for ($row = 0; $row < $rows; $row++) {
for ($col = 0; $col < $cols; $col++) {
$source_index = $row * $cols + $col;
if (!isset($arr[$source_index])) {
// in case if source array element count is less then element count in one row
continue;
}
$imatrix[$col * $rows + $row] = $arr[$source_index];
}
}
ksort($imatrix);
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 = substr($this->Application->GetVar($top_prefix.'_mode'), 0, 1) == 't';
$modified = $this->Application->RecallVar($top_prefix.'_modified');
if ($temp_tables && $modified) {
$block_params = $this->prepareTagParams($params);
$block_params['name'] = $this->SelectParam($params, 'render_as,name');
$block_params['edit_mode'] = $temp_tables ? 1 : 0;
return $this->Application->ParseBlock($block_params);
}
$this->Application->RemoveVar($top_prefix.'_modified');
return '';
}
/**
* Returns list record count queries (on all pages)
*
* @param Array $params
* @return int
*/
function TotalRecords($params)
{
$list =& $this->GetList($params);
if (!$list->Counted) $list->CountRecs();
return $list->RecordsCount;
}
/**
* Range filter field name
*
* @param Array $params
* @return string
*/
function SearchInputName($params)
{
$field = $this->SelectParam($params, 'field,name');
$ret = 'custom_filters['.$this->getPrefixSpecial().']['.$params['grid'].']['.$field.']['.$params['filter_type'].']';
if (isset($params['type'])) {
$ret .= '['.$params['type'].']';
}
return $ret;
}
/**
* Return range filter field value
*
* @param Array $params
* @return string
*/
function SearchField($params) // RangeValue
{
$field = $this->SelectParam($params, 'field,name');
$view_name = $this->Application->RecallVar($this->getPrefixSpecial().'_current_view');
$custom_filter = $this->Application->RecallPersistentVar($this->getPrefixSpecial().'_custom_filter.'.$view_name);
$custom_filter = $custom_filter ? unserialize($custom_filter) : Array();
if (isset($custom_filter[ $params['grid'] ][$field])) {
$ret = $custom_filter[ $params['grid'] ][$field][ $params['filter_type'] ]['submit_value'];
if (isset($params['type'])) {
$ret = $ret[ $params['type'] ];
}
if( !$this->HasParam($params, 'no_special') ) $ret = htmlspecialchars($ret);
return $ret;
}
return '';
}
function SearchFormat($params)
{
$field = $params['field'];
$object =& $this->GetList($params);
$options = $object->GetFieldOptions($field);
$format = $options[ $this->SelectParam($params, 'input_format') ? 'input_format' : 'format' ];
$formatter_class = getArrayValue($options,'formatter');
if($formatter_class)
{
$formatter =& $this->Application->recallObject($formatter_class);
$human_format = getArrayValue($params,'human');
$edit_size = getArrayValue($params,'edit_size');
$sample = getArrayValue($params,'sample');
if($sample)
{
return $formatter->GetSample($field, $options, $object);
}
elseif($human_format || $edit_size)
{
$format = $formatter->HumanFormat($format);
return $edit_size ? strlen($format) : $format;
}
}
return $format;
}
/**
* Returns error of range field
*
* @param unknown_type $params
* @return unknown
*/
function SearchError($params)
{
$field = $this->SelectParam($params, 'field,name');
$error_var_name = $this->getPrefixSpecial().'_'.$field.'_'.$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 = preg_replace('/([^:]*):.*/', '\1', $this->Application->RecallVar('module'));
if (!$force_module) $force_module = 'core';
}
else {
$force_module = strtolower($force_module);
}
if ($force_module == 'core') {
$module_folder = 'core';
}
else {
$module_folder = trim( $this->Application->findModule('Name', $force_module, 'Path'), '/');
}
}
else {
$module_folder = $this->Application->getUnitOption($this->Prefix, 'ModuleFolder');
}
return '../../'.$module_folder.'/admin_templates/';
}
/**
* Returns object used in tag processor
*
* @access public
* @return kDBBase
*/
function &getObject($params = Array())
{
$object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
return $object;
}
/**
* Checks if object propery value matches value passed
*
* @param Array $params
* @return bool
*/
function PropertyEquals($params)
{
$object =& $this->getObject($params);
$property_name = $this->SelectParam($params, 'name,var,property');
return $object->$property_name == $params['value'];
}
/**
* Group list records by header, saves internal order in group
*
* @param Array $records
* @param string $heading_field
*/
function groupRecords(&$records, $heading_field)
{
$sorted = Array();
$i = 0; $record_count = count($records);
while ($i < $record_count) {
$sorted[ $records[$i][$heading_field] ][] = $records[$i];
$i++;
}
$records = Array();
foreach ($sorted as $heading => $heading_records) {
$records = array_merge_recursive($records, $heading_records);
}
}
function DisplayOriginal($params)
{
return false;
}
function MultipleEditing($params)
{
$wid = $this->Application->GetTopmostWid($this->Prefix);
$session_name = rtrim($this->getPrefixSpecial().'_selected_ids_'.$wid, '_');
$selected_ids = explode(',', $this->Application->RecallVar($session_name));
$ret = '';
if ($selected_ids) {
$selected_ids = explode(',', $selected_ids);
$object =& $this->getObject( array_merge_recursive2($params, Array('skip_autoload' => true)) );
$params['name'] = $params['render_as'];
foreach ($selected_ids as $id) {
$object->Load($id);
$ret .= $this->Application->ParseBlock($params);
}
}
return $ret;
}
function ExportStatus($params)
{
$export_object =& $this->Application->recallObject('CatItemExportHelper');
$event = new kEvent($this->getPrefixSpecial().':OnDummy');
$action_method = 'perform'.ucfirst($this->Special);
$field_values = $export_object->$action_method($event);
// finish code is done from JS now
if ($field_values['start_from'] >= $field_values['total_records'])
{
if ($this->Special == 'import') {
$this->Application->StoreVar('PermCache_UpdateRequired', 1);
$this->Application->Redirect('in-portal/categories/cache_updater', Array('m_opener' => 'r', 'pass' => 'm', 'continue' => 1, 'no_amp' => 1));
}
elseif ($this->Special == 'export') {
$finish_t = $this->Application->RecallVar('export_finish_t');
$this->Application->Redirect($finish_t, Array('pass' => 'all'));
$this->Application->RemoveVar('export_finish_t');
}
}
$export_options = $export_object->loadOptions($event);
return $export_options['start_from'] * 100 / $export_options['total_records'];
}
/**
* Returns path where exported category items should be saved
*
* @param Array $params
*/
function ExportPath($params)
{
$ret = EXPORT_PATH.'/';
if( getArrayValue($params, 'as_url') )
{
$ret = str_replace( FULL_PATH.'/', $this->Application->BaseURL(), $ret);
}
$export_options = unserialize($this->Application->RecallVar($this->getPrefixSpecial().'_options'));
$ret .= $export_options['ExportFilename'].'.'.($export_options['ExportFormat'] == 1 ? 'csv' : 'xml');
return $ret;
}
function FieldTotal($params)
{
$list =& $this->GetList($params);
return $list->GetFormattedTotal($this->SelectParam($params, 'field,name'), $params['function']);
}
function FCKEditor($params) {
$params['no_special'] = 1;
$value = $this->Field($params);
$name = $this->InputName($params);
$theme_path = $this->Application->BaseURL().substr($this->Application->GetFrontThemePath(), 1);
$bgcolor = $this->Application->GetVar('bgcolor');
if (!$bgcolor) $bgcolor = '#ffffff';
include_once(FULL_PATH.'/core/cmseditor/fckeditor.php');
$oFCKeditor = new FCKeditor($name);
$oFCKeditor->BasePath = BASE_PATH.'/core/cmseditor/';
$oFCKeditor->Width = $params['width'] ;
$oFCKeditor->Height = $params['height'] ;
$oFCKeditor->ToolbarSet = 'Advanced' ;
$oFCKeditor->Value = $value ;
$oFCKeditor->Config = Array(
//'UserFilesPath' => $pathtoroot.'kernel/user_files',
'ProjectPath' => BASE_PATH.'/',
'CustomConfigurationsPath' => $this->Application->BaseURL().'core/admin_templates/js/inp_fckconfig.js',
'StylesXmlPath' => $theme_path.'/inc/styles.xml',
'EditorAreaCSS' => $theme_path.'/inc/style.css',
'DefaultClass' => 'Default Text',
// 'Debug' => 1,
'Admin' => 1,
'K4' => 1,
'newBgColor' => $bgcolor,
);
return $oFCKeditor->CreateHtml();
}
function IsNewItem($params)
{
$object =& $this->getObject($params);
return $object->IsNewItem();
}
/**
* Creates link to an item including only it's id
*
* @param Array $params
* @return string
*/
function ItemLink($params)
{
$object =& $this->getObject($params);
$params['pass'] = 'm';
$params[$object->getPrefixSpecial().'_id'] = $object->GetID();
return $this->Application->ProcessParsedTag('m', 't', $params);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/db/db_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.77
\ No newline at end of property
+1.78
\ No newline at end of property
Index: trunk/core/kernel/db/db_event_handler.php
===================================================================
--- trunk/core/kernel/db/db_event_handler.php (revision 8103)
+++ trunk/core/kernel/db/db_event_handler.php (revision 8104)
@@ -1,2052 +1,2051 @@
<?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'),
'OnCut' => array('self'=>'edit', 'subitem' => 'edit'),
'OnCopy' => array('self'=>'edit', 'subitem' => 'edit'),
'OnPaste' => array('self'=>'edit', 'subitem' => 'edit'),
'OnSelectItems' => Array('self' => 'add|edit', 'subitem' => 'add|edit'),
'OnProcessSelected' => Array('self' => 'add|edit', 'subitem' => 'add|edit'),
'OnSelectUser' => Array('self' => 'add|edit', 'subitem' => 'add|edit'),
'OnMassApprove' => Array('self' => 'advanced:approve|edit', 'subitem' => 'advanced:approve|add|edit'),
'OnMassDecline' => Array('self' => 'advanced:decline|edit', 'subitem' => 'advanced:decline|add|edit'),
'OnMassMoveUp' => Array('self' => 'advanced:move_up|edit', 'subitem' => 'advanced:move_up|add|edit'),
'OnMassMoveDown' => Array('self' => 'advanced:move_down|edit', 'subitem' => 'advanced:move_down|add|edit'),
'OnPreCreate' => Array('self' => 'add|add.pending', 'subitem' => 'edit|edit.pending'),
'OnEdit' => Array('self' => 'edit|edit.pending', 'subitem' => 'edit|edit.pending'),
'OnExport' => Array('self' => 'view|advanced:export'),
'OnExportBegin' => Array('self' => 'view|advanced:export'),
'OnExportProgress' => Array('self' => 'view|advanced:export'),
// theese event do not harm, but just in case check them too :)
'OnCancelEdit' => Array('self' => true, 'subitem' => true),
'OnCancel' => Array('self' => true, 'subitem' => true),
'OnReset' => Array('self' => true, 'subitem' => true),
'OnSetSorting' => Array('self' => true, 'subitem' => true),
'OnSetSortingDirect' => Array('self' => true, 'subitem' => true),
'OnSetFilter' => Array('self' => true, 'subitem' => true),
'OnApplyFilters' => Array('self' => true, 'subitem' => true),
'OnRemoveFilters' => Array('self' => true, 'subitem' => true),
'OnSetFilterPattern' => Array('self' => true, 'subitem' => true),
'OnSetPerPage' => Array('self' => true, 'subitem' => true),
'OnSearch' => Array('self' => true, 'subitem' => true),
'OnSearchReset' => Array('self' => true, 'subitem' => true),
'OnGoBack' => Array('self' => true, 'subitem' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
function mapEvents()
{
$events_map = Array(
'OnRemoveFilters' => 'FilterAction',
'OnApplyFilters' => 'FilterAction',
'OnMassApprove'=>'iterateItems',
'OnMassDecline'=>'iterateItems',
'OnMassMoveUp'=>'iterateItems',
'OnMassMoveDown'=>'iterateItems',
);
$this->eventMethods = array_merge($this->eventMethods, $events_map);
}
/**
* Returns ID of current item to be edited
* by checking ID passed in get/post as prefix_id
* or by looking at first from selected ids, stored.
* Returned id is also stored in Session in case
* it was explicitly passed as get/post
*
* @param kEvent $event
* @return int
*/
function getPassedID(&$event)
{
if ($event->getEventParam('raise_warnings') === false) {
$event->setEventParam('raise_warnings', 1);
}
// 1. get id from post (used in admin)
$ret = $this->Application->GetVar($event->getPrefixSpecial(true).'_id');
if($ret) return $ret;
// 2. get id from env (used in front)
$ret = $this->Application->GetVar($event->getPrefixSpecial().'_id');
if($ret) return $ret;
// recall selected ids array and use the first one
$ids = $this->Application->GetVar($event->getPrefixSpecial().'_selected_ids');
if ($ids != '') {
$ids=explode(',',$ids);
if($ids) $ret=array_shift($ids);
}
else { // if selected ids are not yet stored
$this->StoreSelectedIDs($event);
return $this->Application->GetVar($event->getPrefixSpecial(true).'_id'); // StoreSelectedIDs sets this variable
}
return $ret;
}
/**
* Prepares and stores selected_ids string
* in Session and Application Variables
* by getting all checked ids from grid plus
* id passed in get/post as prefix_id
*
* @param kEvent $event
* @param Array $ids
*
* @return Array ids stored
*/
function StoreSelectedIDs(&$event, $ids = null)
{
$wid = $this->Application->GetTopmostWid($event->Prefix);
$session_name = rtrim($event->getPrefixSpecial().'_selected_ids_'.$wid, '_');
if (isset($ids)) {
// save ids directly if they given
$this->Application->StoreVar($session_name, implode(',', $ids));
return $ids;
}
$ret = Array();
// May be we don't need this part: ?
$passed = $this->Application->GetVar($event->getPrefixSpecial(true).'_id');
if($passed !== false && $passed != '')
{
array_push($ret, $passed);
}
$ids = Array();
// get selected ids from post & save them to session
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
$id_field = $this->Application->getUnitOption($event->Prefix,'IDField');
foreach($items_info as $id => $field_values)
{
if( getArrayValue($field_values,$id_field) ) array_push($ids,$id);
}
//$ids=array_keys($items_info);
}
$ret = array_unique(array_merge($ret, $ids));
$this->Application->SetVar($event->getPrefixSpecial().'_selected_ids', implode(',',$ret));
$this->Application->LinkVar($event->getPrefixSpecial().'_selected_ids', $session_name);
// This is critical - otherwise getPassedID will return last ID stored in session! (not exactly true)
// this smells... needs to be refactored
$first_id = getArrayValue($ret,0);
if (($first_id === false) && ($event->getEventParam('raise_warnings') == 1)) {
if ($this->Application->isDebugMode()) {
$this->Application->Debugger->appendTrace();
}
trigger_error('Requested ID for prefix <b>'.$event->getPrefixSpecial().'</b> <span class="debug_error">not passed</span>',E_USER_NOTICE);
}
$this->Application->SetVar($event->getPrefixSpecial(true).'_id', $first_id);
return $ret;
}
/**
* Returns stored selected ids as an array
*
* @param kEvent $event
* @param bool $from_session return ids from session (written, when editing was started)
* @return array
*/
function getSelectedIDs(&$event, $from_session = false)
{
if ($from_session) {
$wid = $this->Application->GetTopmostWid($event->Prefix);
$var_name = rtrim($event->getPrefixSpecial().'_selected_ids_'.$wid, '_');
$ret = $this->Application->RecallVar($var_name);
}
else {
$ret = $this->Application->GetVar($event->getPrefixSpecial().'_selected_ids');
}
return explode(',', $ret);
}
/**
* Returs associative array of submitted fields for current item
* Could be used while creating/editing single item -
* meaning on any edit form, except grid edit
*
* @param kEvent $event
*/
function getSubmittedFields(&$event)
{
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
$field_values = $items_info ? array_shift($items_info) : Array();
return $field_values;
}
/**
* Removes any information about current/selected ids
* from Application variables and Session
*
* @param kEvent $event
*/
function clearSelectedIDs(&$event)
{
$prefix_special = $event->getPrefixSpecial();
$ids = implode(',', $this->getSelectedIDs($event, true));
$event->setEventParam('ids', $ids);
$wid = $this->Application->GetTopmostWid($event->Prefix);
$session_name = rtrim($prefix_special.'_selected_ids_'.$wid, '_');
$this->Application->RemoveVar($session_name);
$this->Application->SetVar($prefix_special.'_selected_ids', '');
$this->Application->SetVar($prefix_special.'_id', ''); // $event->getPrefixSpecial(true).'_id' too may be
}
/*function SetSaveEvent(&$event)
{
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent','OnUpdate');
$this->Application->LinkVar($event->Prefix_Special.'_SaveEvent');
}*/
/**
* Common builder part for Item & List
*
* @param kDBBase $object
* @param kEvent $event
* @access private
*/
function dbBuild(&$object, &$event)
{
$object->Configure( $event->getEventParam('populate_ml_fields') );
$this->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');
/* @var $object 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);
$var_names = Array (
$top_prefix,
rtrim($top_prefix.'_'.$event->Special, '_'),
rtrim($top_prefix.'.'.$event->Special, '.'),
);
$var_names = array_unique($var_names);
$temp_mode = false;
foreach ($var_names as $var_name) {
$value = $this->Application->GetVar($var_name.'_mode');
if (substr($value, 0, 1) == 't') {
$temp_mode = true;
break;
}
}
return $temp_mode;
}
/**
* Returns table prefix from event (temp or live)
*
* @param kEvent $event
* @return string
* @todo Needed? Should be refactored (by Alex)
*/
function TablePrefix(&$event)
{
return $this->UseTempTables($event) ? $this->Application->GetTempTablePrefix('prefix:'.$event->Prefix).TABLE_PREFIX : TABLE_PREFIX;
}
/**
* Load item if id is available
*
* @param kEvent $event
*/
function LoadItem(&$event)
{
$object =& $event->getObject();
$id = $this->getPassedID($event);
if ($object->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();
/* @var $object kDBList */
$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);
$view_name = $this->Application->RecallVar($event->getPrefixSpecial().'_current_view');
$this->Application->StorePersistentVar($event->getPrefixSpecial().'_PerPage.'.$view_name, $per_page);
}
/**
* Set's correct page for list
* based on data provided with event
*
* @param kEvent $event
* @access private
* @see OnListBuild
*/
function SetPagination(&$event)
{
// get PerPage (forced -> session -> config -> 10)
$per_page = $this->getPerPage($event);
$object =& $event->getObject();
$object->SetPerPage($per_page);
$this->Application->StoreVarDefault($event->getPrefixSpecial().'_Page', 1);
$page = $this->Application->GetVar($event->getPrefixSpecial().'_Page');
if (!$page) {
$page = $this->Application->GetVar($event->getPrefixSpecial(true).'_Page');
}
if (!$page) {
$page = $this->Application->RecallVar($event->getPrefixSpecial().'_Page');
}
else {
$this->Application->StoreVar($event->getPrefixSpecial().'_Page', $page);
}
if( !$event->getEventParam('skip_counting') )
{
$pages = $object->GetTotalPages();
if($page > $pages)
{
$this->Application->StoreVar($event->getPrefixSpecial().'_Page', 1);
$page = 1;
}
}
/*$per_page = $event->getEventParam('per_page');
if ($per_page == 'list_next') {
$cur_page = $page;
$cur_per_page = $per_page;
$object->SetPerPage(1);
$object =& $this->Application->recallObject($event->Prefix);
$cur_item_index = $object->CurrentIndex;
$page = ($cur_page-1) * $cur_per_page + $cur_item_index + 1;
$object->SetPerPage(1);
}*/
$object->SetPage($page);
}
/**
* Returns current per-page setting for list
*
* @param kEvent $event
* @return int
*/
function getPerPage(&$event)
{
// 1. per-page is passed as tag parameter to PrintList, InitList, etc.
$per_page = $event->getEventParam('per_page');
/*if ($per_page == 'list_next') {
$per_page = '';
}*/
// 2. per-page variable name is store into config variable
$config_mapping = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping');
if ($config_mapping) {
switch ( $per_page ){
case 'short_list' :
$per_page = $this->Application->ConfigValue($config_mapping['ShortListPerPage']);
break;
case 'default' :
$per_page = $this->Application->ConfigValue($config_mapping['PerPage']);
break;
}
}
if (!$per_page) {
// per-page is stored to persistent session
$view_name = $this->Application->RecallVar($event->getPrefixSpecial().'_current_view');
$per_page = $this->Application->RecallPersistentVar($event->getPrefixSpecial().'_PerPage.'.$view_name);
if (!$per_page) {
// per-page is stored to current session
$per_page = $this->Application->RecallVar($event->getPrefixSpecial().'_PerPage');
}
if (!$per_page) {
if ($config_mapping) {
if (!isset($config_mapping['PerPage'])) {
trigger_error('Incorrect mapping of <span class="debug_error">PerPage</span> key in config for prefix <b>'.$event->Prefix.'</b>', E_USER_WARNING);
}
$per_page = $this->Application->ConfigValue($config_mapping['PerPage']);
}
if (!$per_page) {
// none of checked above per-page locations are useful, then try default value
$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) {
if ($tag_sort_by == 'random') {
$by = 'RAND()';
$dir = '';
}
else {
list($by, $dir) = explode(',', $tag_sort_by);
}
$object->AddOrderField($by, $dir);
}
if ($sorting_configs && isset ($sorting_configs['DefaultSorting1Field'])){
$list_sortings[$sorting_prefix]['Sorting'] = Array(
$this->Application->ConfigValue($sorting_configs['DefaultSorting1Field']) => $this->Application->ConfigValue($sorting_configs['DefaultSorting1Dir']),
$this->Application->ConfigValue($sorting_configs['DefaultSorting2Field']) => $this->Application->ConfigValue($sorting_configs['DefaultSorting2Dir']),
);
}
// Use default if not specified
if ( !$cur_sort1 || !$cur_sort1_dir)
{
if ( $sorting = getArrayValue($list_sortings, $sorting_prefix, 'Sorting') ) {
reset($sorting);
$cur_sort1 = key($sorting);
$cur_sort1_dir = current($sorting);
if (next($sorting)) {
$cur_sort2 = key($sorting);
$cur_sort2_dir = current($sorting);
}
}
}
if ( $forced_sorting = getArrayValue($list_sortings, $sorting_prefix, 'ForcedSorting') ) {
foreach ($forced_sorting as $field => $dir) {
$object->AddOrderField($field, $dir);
}
}
if($cur_sort1 != '' && $cur_sort1_dir != '')
{
$object->AddOrderField($cur_sort1, $cur_sort1_dir);
}
if($cur_sort2 != '' && $cur_sort2_dir != '')
{
$object->AddOrderField($cur_sort2, $cur_sort2_dir);
}
}
/**
* Add filters found in session
*
* @param kEvent $event
*/
function AddFilters(&$event)
{
$object =& $event->getObject();
$edit_mark = rtrim($this->Application->GetSID().'_'.$this->Application->GetTopmostWid($event->Prefix), '_');
// add search filter
$filter_data = $this->Application->RecallVar($event->getPrefixSpecial().'_search_filter');
if ($filter_data) {
$filter_data = unserialize($filter_data);
foreach ($filter_data as $filter_field => $filter_params) {
$filter_type = ($filter_params['type'] == 'having') ? HAVING_FILTER : WHERE_FILTER;
$filter_value = str_replace(EDIT_MARK, $edit_mark, $filter_params['value']);
$object->addFilter($filter_field, $filter_value, $filter_type, FLT_SEARCH);
}
}
// add custom filter
$view_name = $this->Application->RecallVar($event->getPrefixSpecial().'_current_view');
$custom_filters = $this->Application->RecallPersistentVar($event->getPrefixSpecial().'_custom_filter.'.$view_name);
if ($custom_filters) {
$grid_name = $event->getEventParam('grid');
$custom_filters = unserialize($custom_filters);
if (isset($custom_filters[$grid_name])) {
foreach ($custom_filters[$grid_name] as $field_name => $field_options) {
list ($filter_type, $field_options) = each($field_options);
if (isset($field_options['value']) && $field_options['value']) {
$filter_type = ($field_options['sql_filter_type'] == 'having') ? HAVING_FILTER : WHERE_FILTER;
$filter_value = str_replace(EDIT_MARK, $edit_mark, $field_options['value']);
$object->addFilter($field_name, $filter_value, $filter_type, FLT_CUSTOM);
}
}
}
}
$view_filter = $this->Application->RecallVar($event->getPrefixSpecial().'_view_filter');
if($view_filter)
{
$view_filter = unserialize($view_filter);
$temp_filter =& $this->Application->makeClass('kMultipleFilter');
$filter_menu = $this->Application->getUnitOption($event->Prefix,'FilterMenu');
$group_key = 0; $group_count = count($filter_menu['Groups']);
while($group_key < $group_count)
{
$group_info = $filter_menu['Groups'][$group_key];
$temp_filter->setType( constant('FLT_TYPE_'.$group_info['mode']) );
$temp_filter->clearFilters();
foreach ($group_info['filters'] as $flt_id)
{
$sql_key = getArrayValue($view_filter,$flt_id) ? 'on_sql' : 'off_sql';
if ($filter_menu['Filters'][$flt_id][$sql_key] != '')
{
$temp_filter->addFilter('view_filter_'.$flt_id, $filter_menu['Filters'][$flt_id][$sql_key]);
}
}
$object->addFilter('view_group_'.$group_key, $temp_filter, $group_info['type'] , FLT_VIEW);
$group_key++;
}
}
}
/**
* Set's new sorting for list
*
* @param kEvent $event
* @access protected
*/
function OnSetSorting(&$event)
{
$cur_sort1 = $this->Application->RecallVar($event->Prefix_Special.'_Sort1');
$cur_sort1_dir = $this->Application->RecallVar($event->Prefix_Special.'_Sort1_Dir');
$use_double_sorting = $this->Application->ConfigValue('UseDoubleSorting') !== false ? $this->Application->ConfigValue('UseDoubleSorting') : true;
if ($use_double_sorting) {
$cur_sort2 = $this->Application->RecallVar($event->Prefix_Special.'_Sort2');
$cur_sort2_dir = $this->Application->RecallVar($event->Prefix_Special.'_Sort2_Dir');
}
$passed_sort1 = $this->Application->GetVar($event->getPrefixSpecial(true).'_Sort1');
if ($cur_sort1 == $passed_sort1) {
$cur_sort1_dir = $cur_sort1_dir == 'asc' ? 'desc' : 'asc';
}
else {
if ($use_double_sorting) {
$cur_sort2 = $cur_sort1;
$cur_sort2_dir = $cur_sort1_dir;
}
$cur_sort1 = $passed_sort1;
$cur_sort1_dir = 'asc';
}
$this->Application->StoreVar($event->Prefix_Special.'_Sort1', $cur_sort1);
$this->Application->StoreVar($event->Prefix_Special.'_Sort1_Dir', $cur_sort1_dir);
if ($use_double_sorting) {
$this->Application->StoreVar($event->Prefix_Special.'_Sort2', $cur_sort2);
$this->Application->StoreVar($event->Prefix_Special.'_Sort2_Dir', $cur_sort2_dir);
}
}
/**
* Set sorting directly to session
*
* @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) );
/* @var $object kDBItem */
-
+
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info) {
list($id,$field_values) = each($items_info);
$object->SetFieldsFromHash($field_values);
}
$this->customProcessing($event,'before');
//look at kDBItem' Create for ForceCreateId description, it's rarely used and is NOT set by default
if( $object->Create($event->getEventParam('ForceCreateId')) )
{
if( $object->IsTempTable() ) $object->setTempID();
$this->customProcessing($event,'after');
$event->status=erSUCCESS;
$event->redirect_params = Array('opener'=>'u');
}
else
{
$event->status = erFAIL;
$event->redirect = false;
$this->Application->SetVar($event->Prefix_Special.'_SaveEvent','OnCreate');
$object->setID($id);
}
}
/**
* Updates kDBItem
*
* @param kEvent $event
* @access protected
*/
function OnUpdate(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
foreach($items_info as $id => $field_values)
{
$object->Load($id);
$object->SetFieldsFromHash($field_values);
$this->customProcessing($event, 'before');
if( $object->Update($id) )
{
$this->customProcessing($event, 'after');
$event->status=erSUCCESS;
}
else
{
$event->status=erFAIL;
$event->redirect=false;
break;
}
}
}
$event->redirect_params = Array('opener'=>'u');
}
/**
* Delete's kDBItem object
*
* @param kEvent $event
* @access protected
*/
function OnDelete(&$event)
{
$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');
$ids = $this->StoreSelectedIDs($event);
$event->setEventParam('ids', $ids);
$this->customProcessing($event, 'before');
$ids = $event->getEventParam('ids');
if($ids)
{
$temp->DeleteItems($event->Prefix, $event->Special, $ids);
}
$this->clearSelectedIDs($event);
}
/**
* Sets window id (of first opened edit window) to temp mark in uls
*
* @param kEvent $event
*/
function setTempWindowID(&$event)
{
$mode = $this->Application->GetVar($event->Prefix.'_mode');
if ($mode == 't') {
$wid = $this->Application->GetVar('m_wid');
$this->Application->SetVar($event->Prefix.'_mode', 't'.$wid);
}
}
/**
* Prepare temp tables and populate it
* with items selected in the grid
*
* @param kEvent $event
*/
function OnEdit(&$event)
{
$this->setTempWindowID($event);
$this->StoreSelectedIDs($event);
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
/* @var $temp kTempTablesHandler */
$temp->PrepareEdit();
$event->redirect=false;
}
/**
* Saves content of temp table into live and
* redirects to event' default redirect (normally grid template)
*
* @param kEvent $event
*/
function OnSave(&$event)
{
$event->CallSubEvent('OnPreSave');
if ($event->status == erSUCCESS) {
$skip_master = false;
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
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->StoreSelectedIDs($event, $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);
$object =& $event->getObject();
return !$object->IsLoaded();
// $item_id = $this->getPassedID($event);
// return ($item_id == '') ? true : false;
}
/**
* Saves edited item into temp table
* If there is no id, new item is created in temp table
*
* @param kEvent $event
*/
function OnPreSave(&$event)
{
//$event->redirect = false;
// if there is no id - it means we need to create an item
if (is_object($event->MasterEvent)) {
$event->MasterEvent->setEventParam('IsNew',false);
}
if ($this->isNewItemCreate($event)) {
$event->CallSubEvent('OnPreSaveCreated');
if (is_object($event->MasterEvent)) {
$event->MasterEvent->setEventParam('IsNew',true);
}
return;
}
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info) {
foreach ($items_info as $id => $field_values) {
$object->SetDefaultValues();
$object->Load($id);
$object->SetFieldsFromHash($field_values);
$this->customProcessing($event, 'before');
if( $object->Update($id) )
{
$this->customProcessing($event, 'after');
$event->status=erSUCCESS;
}
else {
$event->status = erFAIL;
$event->redirect = false;
break;
}
}
}
}
/**
* 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->setTempWindowID($event);
$this->clearSelectedIDs($event);
$object =& $event->getObject( Array('skip_autoload' => true) );
$temp =& $this->Application->recallObject($event->Prefix.'_TempHandler', 'kTempTablesHandler');
$temp->PrepareEdit();
$object->setID(0);
$this->Application->SetVar($event->getPrefixSpecial().'_id',0);
$this->Application->SetVar($event->getPrefixSpecial().'_PreCreate', 1);
$event->redirect=false;
}
/**
* Creates a new item in temp table and
* stores item id in App vars and Session on succsess
*
* @param kEvent $event
*/
function OnPreSaveCreated(&$event)
{
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info) $field_values = array_shift($items_info);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->SetFieldsFromHash($field_values);
$this->customProcessing($event, 'before');
if( $object->Create() )
{
$this->customProcessing($event, 'after');
$event->redirect_params[$event->getPrefixSpecial(true).'_id'] = $object->GetId();
$event->status=erSUCCESS;
}
else
{
$event->status=erFAIL;
$event->redirect=false;
$object->setID(0);
}
}
function OnReset(&$event)
{
//do nothing - should reset :)
if ($this->isNewItemCreate($event)) {
// just reset id to 0 in case it was create
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->setID(0);
$this->Application->SetVar($event->getPrefixSpecial().'_id',0);
}
}
/**
* Apply same processing to each item beeing selected in grid
*
* @param kEvent $event
* @access private
*/
function iterateItems(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$object =& $event->getObject( Array('skip_autoload' => true) );
$ids = $this->StoreSelectedIDs($event);
if ($ids) {
$status_field = array_shift( $this->Application->getUnitOption($event->Prefix,'StatusField') );
foreach ($ids as $id) {
$object->Load($id);
switch ($event->Name) {
case 'OnMassApprove':
$object->SetDBField($status_field, 1);
break;
case 'OnMassDecline':
$object->SetDBField($status_field, 0);
break;
case 'OnMassMoveUp':
$object->SetDBField('Priority', $object->GetDBField('Priority') + 1);
break;
case 'OnMassMoveDown':
$object->SetDBField('Priority', $object->GetDBField('Priority') - 1);
break;
}
if ($object->Update()) {
$event->status = erSUCCESS;
}
else {
$event->status = erFAIL;
$event->redirect = false;
break;
}
}
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnMassClone(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$event->status = erSUCCESS;
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$ids = $this->StoreSelectedIDs($event);
if ($ids) {
$temp->CloneItems($event->Prefix, $event->Special, $ids);
}
$this->clearSelectedIDs($event);
}
function check_array($records, $field, $value)
{
foreach ($records as $record) {
if ($record[$field] == $value) {
return true;
}
}
return false;
}
function OnPreSavePopup(&$event)
{
$object =& $event->getObject();
$this->RemoveRequiredFields($object);
$event->CallSubEvent('OnPreSave');
$this->finalizePopup($event);
}
/* End of Edit events */
// III. Events that allow to put some code before and after Update,Load,Create and Delete methods of item
/**
* Occurse before loading item, 'id' parameter
* allows to get id of item beeing loaded
*
* @param kEvent $event
* @access public
*/
function OnBeforeItemLoad(&$event)
{
}
/**
* Occurse after loading item, 'id' parameter
* allows to get id of item that was loaded
*
* @param kEvent $event
* @access public
*/
function OnAfterItemLoad(&$event)
{
}
/**
* Occurse before creating item
*
* @param kEvent $event
* @access public
*/
function OnBeforeItemCreate(&$event)
{
}
/**
* Occurse after creating item
*
* @param kEvent $event
* @access public
*/
function OnAfterItemCreate(&$event)
{
}
/**
* Occurse before updating item
*
* @param kEvent $event
* @access public
*/
function OnBeforeItemUpdate(&$event)
{
}
/**
* Occurse after updating item
*
* @param kEvent $event
* @access public
*/
function OnAfterItemUpdate(&$event)
{
}
/**
* Occurse before deleting item, id of item beeing
* deleted is stored as 'id' event param
*
* @param kEvent $event
* @access public
*/
function OnBeforeItemDelete(&$event)
{
}
/**
* Occurse after deleting item, id of deleted item
* is stored as 'id' param of event
*
* @param kEvent $event
* @access public
*/
function OnAfterItemDelete(&$event)
{
}
/**
* Occurs after successful item validation
*
* @param kEvent $event
*/
function OnAfterItemValidate(&$event)
{
}
/**
* Occures after an item has been copied to temp
* Id of copied item is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnAfterCopyToTemp(&$event)
{
}
/**
* Occures before an item is deleted from live table when copying from temp
* (temp handler deleted all items from live and then copy over all items from temp)
* Id of item being deleted is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnBeforeDeleteFromLive(&$event)
{
}
/**
* Occures before an item is copied to live table (after all foreign keys have been updated)
* Id of item being copied is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnBeforeCopyToLive(&$event)
{
}
/**
* !!! NOT FULLY IMPLEMENTED - SEE TEMP HANDLER COMMENTS (search by event name)!!!
* Occures after an item has been copied to live table
* Id of copied item is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnAfterCopyToLive(&$event)
{
}
/**
* Occures before an item is cloneded
* Id of ORIGINAL item is passed as event' 'id' param
* Do not call object' Update method in this event, just set needed fields!
*
* @param kEvent $event
*/
function OnBeforeClone(&$event)
{
}
/**
* Occures after an item has been cloned
* Id of newly created item is passed as event' 'id' param
*
* @param kEvent $event
*/
function OnAfterClone(&$event)
{
}
/**
* Ensures that popup will be closed automatically
* and parent window will be refreshed with template
* passed
*
* @param kEvent $event
* @access public
*/
function finalizePopup(&$event)
{
$event->SetRedirectParam('opener', 'u');
/*return ;
// 2. substitute opener
$opener_stack = $this->Application->RecallVar('opener_stack');
$opener_stack = $opener_stack ? unserialize($opener_stack) : Array();
//array_pop($opener_stack);
$t = $this->Application->RecallVar('return_template');
$this->Application->RemoveVar('return_template');
// restore original "m" prefix all params, that have values before opening selector
$return_m = $this->Application->RecallVar('return_m');
$this->Application->RemoveVar('return_m');
$this->Application->HttpQuery->parseEnvPart($return_m);
$pass_events = $event->getEventParam('pass_events');
$redirect_params = array_merge_recursive2($event->redirect_params, Array('m_opener' => 'u', '__URLENCODE__' => 1));
$new_level = 'index.php|'.ltrim($this->Application->BuildEnv($t, $redirect_params, 'all', $pass_events), ENV_VAR_NAME.'=');
array_push($opener_stack, $new_level);
$this->Application->StoreVar('opener_stack', serialize($opener_stack));*/
}
/**
* Create search filters based on search query
*
* @param kEvent $event
* @access protected
*/
function OnSearch(&$event)
{
$event->setPseudoClass('_List');
$search_helper =& $this->Application->recallObject('SearchHelper');
$search_helper->performSearch($event);
}
/**
* Clear search keywords
*
* @param kEvent $event
* @access protected
*/
function OnSearchReset(&$event)
{
$search_helper =& $this->Application->recallObject('SearchHelper');
$search_helper->resetSearch($event);
}
/**
* Set's new filter value (filter_id meaning from config)
*
* @param kEvent $event
*/
function OnSetFilter(&$event)
{
$filter_id = $this->Application->GetVar('filter_id');
$filter_value = $this->Application->GetVar('filter_value');
$view_filter = $this->Application->RecallVar($event->getPrefixSpecial().'_view_filter');
$view_filter = $view_filter ? unserialize($view_filter) : Array();
$view_filter[$filter_id] = $filter_value;
$this->Application->StoreVar( $event->getPrefixSpecial().'_view_filter', serialize($view_filter) );
}
function OnSetFilterPattern(&$event)
{
$filters = $this->Application->GetVar($event->getPrefixSpecial(true).'_filters');
if (!$filters) return ;
$view_filter = $this->Application->RecallVar($event->getPrefixSpecial().'_view_filter');
$view_filter = $view_filter ? unserialize($view_filter) : Array();
$filters = explode(',', $filters);
foreach ($filters as $a_filter) {
list($id, $value) = explode('=', $a_filter);
$view_filter[$id] = $value;
}
$this->Application->StoreVar( $event->getPrefixSpecial().'_view_filter', serialize($view_filter) );
$event->redirect = false;
}
/**
* Add/Remove all filters applied to list from "View" menu
*
* @param kEvent $event
*/
function FilterAction(&$event)
{
$view_filter = Array();
$filter_menu = $this->Application->getUnitOption($event->Prefix,'FilterMenu');
switch ($event->Name)
{
case 'OnRemoveFilters':
$filter_value = 1;
break;
case 'OnApplyFilters':
$filter_value = 0;
break;
}
foreach($filter_menu['Filters'] as $filter_key => $filter_params)
{
if(!$filter_params) continue;
$view_filter[$filter_key] = $filter_value;
}
$this->Application->StoreVar( $event->getPrefixSpecial().'_view_filter', serialize($view_filter) );
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnPreSaveAndOpenTranslator(&$event)
{
$this->Application->SetVar('allow_translation', true);
$object =& $event->getObject();
$this->RemoveRequiredFields($object);
$event->CallSubEvent('OnPreSave');
if ($event->status == erSUCCESS) {
$resource_id = $this->Application->GetVar('translator_resource_id');
if ($resource_id) {
$t_prefixes = explode(',', $this->Application->GetVar('translator_prefixes'));
$cdata =& $this->Application->recallObject($t_prefixes[1], null, Array('skip_autoload' => true));
$cdata->Load($resource_id, 'ResourceId');
if (!$cdata->isLoaded()) {
$cdata->SetDBField('ResourceId', $resource_id);
$cdata->Create();
}
$this->Application->SetVar($cdata->getPrefixSpecial().'_id', $cdata->GetID());
}
$event->redirect = $this->Application->GetVar('translator_t');
$event->redirect_params = Array('pass'=>'all,trans,'.$this->Application->GetVar('translator_prefixes'),
$event->getPrefixSpecial(true).'_id' => $object->GetID(),
'trans_event' => 'OnLoad',
'trans_prefix' => $this->Application->GetVar('translator_prefixes'),
'trans_field' => $this->Application->GetVar('translator_field'),
'trans_multi_line' => $this->Application->GetVar('translator_multi_line'),
);
// 1. SAVE LAST TEMPLATE TO SESSION (really needed here, because of tweaky redirect)
$last_template = $this->Application->RecallVar('last_template');
preg_match('/index4\.php\|'.$this->Application->GetSID().'-(.*):/U', $last_template, $rets);
$this->Application->StoreVar('return_template', $this->Application->GetVar('t'));
}
}
function RemoveRequiredFields(&$object)
{
// making all field non-required to achieve successful presave
foreach($object->Fields as $field => $options)
{
if(isset($options['required']))
{
unset($object->Fields[$field]['required']);
}
}
}
/**
* Dynamically fills customdata config
*
* @param kEvent $event
*/
function OnCreateCustomFields(&$event)
{
if (defined('IS_INSTALL') && IS_INSTALL && !$this->Application->TableFound('CustomField')) {
return false;
}
-
$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', '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 = 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 'multiselect':
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;
}
$config_calculated_fields = $this->Application->getUnitOption($main_prefix, 'CalculatedFields', Array());
foreach ($config_calculated_fields as $special => $special_fields) {
$config_calculated_fields[$special] = array_merge_recursive2($config_calculated_fields[$special], $calculated_fields);
}
$this->Application->setUnitOption($main_prefix, 'CalculatedFields', $config_calculated_fields);
$this->Application->setUnitOption($main_prefix, 'CustomFields', $custom_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 = substr($this->Application->GetVar($event->Prefix.'_mode'), 0, 1) == '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);
}
/** EXPORT RELATED **/
/**
* Shows export dialog
*
* @param kEvent $event
*/
function OnExport(&$event)
{
$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;
}
$this->Application->StoreVar($event->Prefix.'_export_ids', $selected_ids ? implode(',', $selected_ids) : '' );
$export_t = $this->Application->GetVar('export_template');
$this->Application->LinkVar('export_finish_t');
$this->Application->LinkVar('export_progress_t');
$this->Application->StoreVar('export_oroginal_special', $event->Special);
$export_helper =& $this->Application->recallObject('CatItemExportHelper');
$event->redirect = $export_t ? $export_t : $export_helper->getModuleFolder($event).'/export';
list($index_file, $env) = explode('|', $this->Application->RecallVar('last_template'));
$finish_url = $this->Application->BaseURL('/admin').$index_file.'?'.ENV_VAR_NAME.'='.$env;
$this->Application->StoreVar('export_finish_url', $finish_url);
$redirect_params = Array(
$this->Prefix.'.export_event' => 'OnNew',
'pass' => 'all,'.$this->Prefix.'.export');
$event->setRedirectParams($redirect_params);
}
/**
* Apply some special processing to
* object beeing recalled before using
* it in other events that call prepareObject
*
* @param Object $object
* @param kEvent $event
* @access protected
*/
function prepareObject(&$object, &$event)
{
if ($event->Special == 'export' || $event->Special == 'import')
{
$export_helper =& $this->Application->recallObject('CatItemExportHelper');
$export_helper->prepareExportColumns($event);
}
}
/**
* Returns specific to each item type columns only
*
* @param kEvent $event
* @return Array
*/
function getCustomExportColumns(&$event)
{
return Array();
}
/**
* Export form validation & processing
*
* @param kEvent $event
*/
function OnExportBegin(&$event)
{
$export_helper =& $this->Application->recallObject('CatItemExportHelper');
/* @var $export_helper kCatDBItemExportHelper */
$export_helper->OnExportBegin($event);
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnExportCancel(&$event)
{
$this->OnGoBack($event);
}
/**
* Allows configuring export options
*
* @param kEvent $event
*/
function OnBeforeExportBegin(&$event)
{
}
function OnDeleteExportPreset(&$event)
{
$object =& $event->GetObject();
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
list($id,$field_values) = each($items_info);
$preset_key = $field_values['ExportPresets'];
$user =& $this->Application->recallObject('u.current');
$export_settings = $user->getPersistantVar('export_settings');
if (!$export_settings) return ;
$export_settings = unserialize($export_settings);
if (!isset($export_settings[$event->Prefix])) return ;
$to_delete = '';
$export_presets = array(''=>'');
foreach ($export_settings[$event->Prefix] as $key => $val) {
if (implode('|', $val['ExportColumns']) == $preset_key) {
$to_delete = $key;
break;
}
}
if ($to_delete) {
unset($export_settings[$event->Prefix][$to_delete]);
$user->setPersistantVar('export_settings', serialize($export_settings));
}
}
}
/**
* Saves changes & changes language
*
* @param kEvent $event
*/
function OnPreSaveAndChangeLanguage(&$event)
{
$event->CallSubEvent('OnPreSave');
if ($event->status == erSUCCESS) {
$this->Application->SetVar('m_lang', $this->Application->GetVar('language'));
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/db/db_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.84
\ No newline at end of property
+1.85
\ No newline at end of property
Index: trunk/core/kernel/db/db_connection.php
===================================================================
--- trunk/core/kernel/db/db_connection.php (revision 8103)
+++ trunk/core/kernel/db/db_connection.php (revision 8104)
@@ -1,598 +1,597 @@
<?php
/**
* Multi database connection class
*
*/
class kDBConnection {
/**
* Current database type
*
* @var string
* @access private
*/
var $dbType = 'mysql';
/**
* Created connection handle
*
* @var resource
* @access private
*/
var $connectionID = null;
/**
* Handle of currenty processed recordset
*
* @var resource
* @access private
*/
var $queryID = null;
/**
* DB type specific function mappings
*
* @var Array
* @access private
*/
var $metaFunctions = Array();
/**
* Function to handle sql errors
*
* @var string
* @access private
*/
var $errorHandler = '';
/**
* Error code
*
* @var int
* @access private
*/
var $errorCode = 0;
/**
* Error message
*
* @var string
* @access private
*/
var $errorMessage = '';
/**
* Defines if database connection
* operations should generate debug
* information
*
* @var bool
*/
var $debugMode = false;
/**
* Last query to database
*
* @var string
*/
var $lastQuery = '';
/**
* Initializes connection class with
* db type to used in future
*
* @param string $dbType
* @return DBConnection
* @access public
*/
function kDBConnection($dbType, $errorHandler = '')
{
$this->dbType = $dbType;
// $this->initMetaFunctions();
if (!$errorHandler) {
$this->errorHandler = Array(&$this, 'handleError');
}
else {
$this->errorHandler = $errorHandler;
}
}
/**
* Set's custom error
*
* @param int $code
* @param string $msg
* @access public
*/
function setError($code, $msg)
{
$this->errorCode = $code;
$this->errorMessage = $msg;
}
/**
* Checks if previous query execution
* raised an error.
*
* @return bool
* @access public
*/
function hasError()
{
return !($this->errorCode == 0);
}
/**
* Caches function specific to requested
* db type
*
* @access private
*/
function initMetaFunctions()
{
$ret = Array();
switch ($this->dbType)
{
case 'mysql':
$ret = Array(); // only define functions, that name differs from "dbType_<meta_name>"
break;
}
$this->metaFunctions = $ret;
}
/**
* Get's function for specific db type
* based on it's meta name
*
* @param string $name
* @return string
* @access private
*/
function getMetaFunction($name)
{
/*if (!isset($this->metaFunctions[$name])) {
$this->metaFunctions[$name] = $name;
}*/
return $this->dbType.'_'.$name;
}
/**
* Try to connect to database server
* using specified parameters and set
* database to $db if connection made
*
* @param string $host
* @param string $user
* @param string $pass
* @param string $db
* @access public
*/
function Connect($host, $user, $pass, $db, $force_new = false)
{
$func = $this->getMetaFunction('connect');
$this->connectionID = $func($host, $user, $pass, $force_new) or trigger_error("Database connection failed, please check your connection settings", E_USER_ERROR);
if ($this->connectionID) {
if (defined('DBG_SQL_MODE')) {
$this->Query('SET sql_mode = \''.DBG_SQL_MODE.'\'');
}
-
$this->setDB($db);
$this->showError();
}
}
function ReConnect($host, $user, $pass, $db, $force_new = false)
{
$func = $this->getMetaFunction('close');
$func($this->connectionID);
$this->Connect($host, $user, $pass, $db, $force_new);
}
/**
* Shows error message from previous operation
* if it failed
*
* @access private
*/
function showError($sql = '')
{
$this->setError(0, ''); // reset error
if ($this->connectionID) {
$func = $this->getMetaFunction('errno'); $this->errorCode = $func($this->connectionID);
if ($this->hasError()) {
$func = $this->getMetaFunction('error'); $this->errorMessage = $func($this->connectionID);
if (is_array($this->errorHandler)) {
$func = $this->errorHandler[1];
$ret = $this->errorHandler[0]->$func($this->errorCode, $this->errorMessage, $sql);
}
else {
$func = $this->errorHandler;
$ret = $func($this->errorCode,$this->errorMessage,$sql);
}
if (!$ret) exit;
}
}
}
/**
* Default error handler for sql errors
*
* @param int $code
* @param string $msg
* @param string $sql
* @return bool
* @access private
*/
function handleError($code, $msg, $sql)
{
echo '<b>Processing SQL</b>: '.$sql.'<br>';
echo '<b>Error ('.$code.'):</b> '.$msg.'<br>';
return false;
}
/**
* Set's database name for connection
* to $new_name
*
* @param string $new_name
* @return bool
* @access public
*/
function setDB($new_name)
{
if (!$this->connectionID) return false;
$func = $this->getMetaFunction('select_db');
return $func($new_name, $this->connectionID);
}
/**
* Returns first field of first line
* of recordset if query ok or false
* otherwise
*
* @param string $sql
* @param int $offset
* @return string
* @access public
*/
function GetOne($sql, $offset = 0)
{
$row = $this->GetRow($sql, $offset);
if(!$row) return false;
return array_shift($row);
}
/**
* Returns first row of recordset
* if query ok, false otherwise
*
* @param stirng $sql
* @param int $offset
* @return Array
* @access public
*/
function GetRow($sql, $offset = 0)
{
$sql .= ' '.$this->getLimitClause($offset, 1);
$ret = $this->Query($sql);
if(!$ret) return false;
return array_shift($ret);
}
/**
* Returns 1st column of recordset as
* one-dimensional array or false otherwise
* Optional parameter $key_field can be used
* to set field name to be used as resulting
* array key
*
* @param string $sql
* @param string $key_field
* @return Array
* @access public
*/
function GetCol($sql, $key_field = null)
{
$rows = $this->Query($sql);
if (!$rows) return $rows;
$i = 0; $row_count = count($rows);
$ret = Array();
if (isset($key_field)) {
while ($i < $row_count) {
$ret[$rows[$i][$key_field]] = array_shift($rows[$i]);
$i++;
}
}
else {
while ($i < $row_count) {
$ret[] = array_shift($rows[$i]);
$i++;
}
}
return $ret;
}
/**
* Queries db with $sql query supplied
* and returns rows selected if any, false
* otherwise. Optional parameter $key_field
* allows to set one of the query fields
* value as key in string array.
*
* @param string $sql
* @param string $key_field
* @return Array
*/
function Query($sql, $key_field = null)
{
$this->lastQuery = $sql;
if ($this->debugMode) return $this->debugQuery($sql,$key_field);
$query_func = $this->getMetaFunction('query');
$this->queryID = $query_func($sql,$this->connectionID);
if (is_resource($this->queryID)) {
$ret = Array();
$fetch_func = $this->getMetaFunction('fetch_assoc');
if (isset($key_field)) {
while (($row = $fetch_func($this->queryID))) {
$ret[$row[$key_field]] = $row;
}
}
else {
while (($row = $fetch_func($this->queryID))) {
$ret[] = $row;
}
}
$this->Destroy();
return $ret;
}
$this->showError($sql);
return false;
}
function ChangeQuery($sql)
{
$this->Query($sql);
return $this->errorCode == 0 ? true : false;
}
function debugQuery($sql, $key_field = null)
{
global $debugger;
$query_func = $this->getMetaFunction('query');
// set 1st checkpoint: begin
$isSkipTable = true;
$profileSQLs = defined('DBG_SQL_PROFILE') && DBG_SQL_PROFILE;
if ($profileSQLs) {
$isSkipTable = isSkipTable($sql);
if (!$isSkipTable) {
$queryID = $debugger->generateID();
$debugger->profileStart('sql_'.$queryID, $debugger->formatSQL($sql));
}
}
// set 1st checkpoint: end
$this->queryID = $query_func($sql, $this->connectionID);
if( is_resource($this->queryID) )
{
$ret = Array();
$fetch_func = $this->getMetaFunction('fetch_assoc');
if( isset($key_field) )
{
while( ($row = $fetch_func($this->queryID)) )
{
$ret[$row[$key_field]] = $row;
}
}
else
{
while( ($row = $fetch_func($this->queryID)) )
{
$ret[] = $row;
}
}
// set 2nd checkpoint: begin
if(!$isSkipTable) {
$debugger->profileFinish('sql_'.$queryID);
$debugger->profilerAddTotal('sql', 'sql_'.$queryID);
}
$this->Destroy();
// set 2nd checkpoint: end
return $ret;
}
else {
// set 2nd checkpoint: begin
if(!$isSkipTable) {
$debugger->profileFinish('sql_'.$queryID);
$debugger->profilerAddTotal('sql', 'sql_'.$queryID);
}
// set 2nd checkpoint: end
}
$this->showError($sql);
return false;
}
/**
* Free memory used to hold recordset handle
*
* @access private
*/
function Destroy()
{
if($this->queryID)
{
$free_func = $this->getMetaFunction('free_result');
$free_func($this->queryID);
$this->queryID = null;
}
}
/**
* Returns auto increment field value from
* insert like operation if any, zero otherwise
*
* @return int
* @access public
*/
function getInsertID()
{
$func = $this->getMetaFunction('insert_id');
return $func($this->connectionID);
}
/**
* Returns row count affected by last query
*
* @return int
* @access public
*/
function getAffectedRows()
{
$func = $this->getMetaFunction('affected_rows');
return $func($this->connectionID);
}
/**
* Returns LIMIT sql clause part for specific db
*
* @param int $offset
* @param int $rows
* @return string
* @access private
*/
function getLimitClause($offset, $rows)
{
if(!($rows > 0)) return '';
switch ($this->dbType) {
default:
return 'LIMIT '.$offset.','.$rows;
break;
}
}
/**
* Correctly quotes a string so that all strings are escaped. We prefix and append
* to the string single-quotes.
* An example is $db->qstr("Don't bother",magic_quotes_runtime());
*
* @param s the string to quote
* @param [magic_quotes] if $s is GET/POST var, set to get_magic_quotes_gpc().
* This undoes the stupidity of magic quotes for GPC.
*
* @return quoted string to be sent back to database
*/
function qstr($s,$magic_quotes=false)
{
$replaceQuote = "\\'";
if (!$magic_quotes)
{
if ($replaceQuote[0] == '\\')
{
// only since php 4.0.5
$s = str_replace(array('\\',"\0"),array('\\\\',"\\\0"),$s);
//$s = str_replace("\0","\\\0", str_replace('\\','\\\\',$s));
}
return "'".str_replace("'",$replaceQuote,$s)."'";
}
// undo magic quotes for "
$s = str_replace('\\"','"',$s);
if($replaceQuote == "\\'") // ' already quoted, no need to change anything
{
return "'$s'";
}
else // change \' to '' for sybase/mssql
{
$s = str_replace('\\\\','\\',$s);
return "'".str_replace("\\'",$replaceQuote,$s)."'";
}
}
/**
* Returns last error code occured
*
* @return int
*/
function getErrorCode()
{
return $this->errorCode;
}
/**
* Returns last error message
*
* @return string
* @access public
*/
function getErrorMsg()
{
return $this->errorMessage;
}
function doInsert($fields_hash, $table, $type = 'INSERT')
{
$fields_sql = '';
$values_sql = '';
foreach ($fields_hash as $field_name => $field_value) {
$fields_sql .= '`'.$field_name.'`,';
$values_sql .= $this->qstr($field_value).',';
}
$fields_sql = preg_replace('/(.*),$/', '\\1', $fields_sql);
$values_sql = preg_replace('/(.*),$/', '\\1', $values_sql);
$sql = strtoupper($type).' INTO `'.$table.'` ('.$fields_sql.') VALUES ('.$values_sql.')';
return $this->ChangeQuery($sql);
}
function doUpdate($fields_hash, $table, $key_clause)
{
if (!$fields_hash) return true;
$fields_sql = '';
foreach ($fields_hash as $field_name => $field_value) {
$fields_sql .= '`'.$field_name.'` = '.$this->qstr($field_value).',';
}
$fields_sql = preg_replace('/(.*),$/', '\\1', $fields_sql);
$sql = 'UPDATE `'.$table.'` SET '.$fields_sql.' WHERE '.$key_clause;
return $this->ChangeQuery($sql);
}
/**
* Allows to detect table's presense in database
*
* @param string $table_name
* @return bool
*/
function TableFound($table_name)
{
static $table_found = Array();
if (!preg_match('/^'.preg_quote(TABLE_PREFIX, '/').'(.*)/', $table_name)) {
$table_name = TABLE_PREFIX.$table_name;
}
if (!isset($table_found[$table_name])) {
$table_found[$table_name] = $this->Query('SHOW TABLES LIKE "'.$table_name.'"');
}
return $table_found[$table_name];
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/db/db_connection.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/kernel/db/dbitem.php
===================================================================
--- trunk/core/kernel/db/dbitem.php (revision 8103)
+++ trunk/core/kernel/db/dbitem.php (revision 8104)
@@ -1,994 +1,993 @@
<?php
/**
* DBItem
*
* Desciption
* @package kernel4
*/
class kDBItem extends kDBBase {
/**
* Description
*
* @var array Associative array of current item' field values
* @access public
*/
var $FieldValues;
/**
* Unformatted field values, before parse
*
* @var Array
* @access private
*/
var $DirtyFieldValues = Array();
var $FieldErrors;
var $ErrorMsgs = Array();
/**
* If set to true, Update will skip Validation before running
*
* @var array Associative array of current item' field values
* @access public
*/
var $IgnoreValidation = false;
var $Loaded = false;
/**
* Holds item' primary key value
*
* @var int Value of primary key field for current item
* @access public
*/
var $ID;
function kDBItem()
{
parent::kDBBase();
$this->ErrorMsgs['required'] = '!la_err_required!'; //'Field is required';
$this->ErrorMsgs['unique'] = '!la_err_unique!'; //'Field value must be unique';
$this->ErrorMsgs['value_out_of_range'] = '!la_err_value_out_of_range!'; //'Field is out of range, possible values from %s to %s';
$this->ErrorMsgs['length_out_of_range'] = '!la_err_length_out_of_range!'; //'Field is out of range';
$this->ErrorMsgs['bad_type'] = '!la_err_bad_type!'; //'Incorrect data format, please use %s';
$this->ErrorMsgs['invalid_format'] = '!la_err_invalid_format!'; //'Incorrect data format, please use %s';
$this->ErrorMsgs['bad_date_format'] = '!la_err_bad_date_format!'; //'Incorrect date format, please use (%s) ex. (%s)';
$this->ErrorMsgs['primary_lang_required'] = '!la_err_primary_lang_required!';
}
function SetDirtyField($field_name, $field_value)
{
$this->DirtyFieldValues[$field_name] = $field_value;
}
function GetDirtyField($field_name)
{
return $this->DirtyFieldValues[$field_name];
}
/**
* Set's default values for all fields
*
* @param bool $populate_ml_fields create all ml fields from db in config or not
*
* @access public
*/
function SetDefaultValues($populate_ml_fields = false)
{
parent::SetDefaultValues($populate_ml_fields);
if ($populate_ml_fields) {
$this->PopulateMultiLangFields();
}
foreach ($this->Fields as $field => $params) {
if ( isset($params['default']) ) {
$this->SetDBField($field, $params['default']);
}
else {
$this->SetDBField($field, NULL);
}
}
}
/**
* Sets current item field value
* (applies formatting)
*
* @access public
* @param string $name Name of the field
* @param mixed $value Value to set the field to
* @return void
*/
function SetField($name,$value)
{
$options = $this->GetFieldOptions($name);
$parsed = $value;
if ($value == '') {
$parsed = NULL;
}
if (isset($options['formatter'])) {
$formatter =& $this->Application->recallObject($options['formatter']);
// $parsed = $formatter->Parse($value, $options, $err);
$parsed = $formatter->Parse($value, $name, $this);
}
// this will make sure numeric value is converted to normal representation
// according to regional format, even when formatter is not set (try seting format to 1.234,56 to understand why)
elseif (preg_match('#int|integer|double|float|real|numeric#', $options['type'])) {
$formatter =& $this->Application->recallObject('kFormatter');
$parsed = $formatter->TypeCast($value, $options);
}
$this->SetDBField($name,$parsed);
}
/**
* 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->FieldValues[$name] = $value;
/*if (isset($this->Fields[$name]['formatter'])) {
$formatter =& $this->Application->recallObject($this->Fields[$name]['formatter']);
$formatter->UpdateSubFields($name, $value, $this->Fields[$name], $this);
}*/
}
/**
* Set's field error, if pseudo passed not found then create it with message text supplied.
* Don't owerrite existing pseudo translation.
*
* @param string $field
* @param string $pseudo
* @param string $error_label
*/
function SetError($field, $pseudo, $error_label = '')
{
$error_field = isset($this->Fields[$field]['error_field']) ? $this->Fields[$field]['error_field'] : $field;
$this->FieldErrors[$error_field]['pseudo'] = $pseudo;
$error_msg = $error_label ? $this->Application->Phrase($error_label) : '';
if ($error_label && !getArrayValue($this->ErrorMsgs, $pseudo))
{
$this->ErrorMsgs[$pseudo] = $error_msg;
}
}
/**
* Return current item' field value by field name
* (doesn't apply formatter)
*
* @access public
* @param string $name field name to return
* @return mixed
*/
function GetDBField($name)
{
return $this->FieldValues[$name];
}
function HasField($name)
{
return isset($this->FieldValues[$name]);
}
function GetFieldValues()
{
return $this->FieldValues;
}
/**
* Sets item' fields corresponding to elements in passed $hash values.
*
* The function sets current item fields to values passed in $hash, by matching $hash keys with field names
* of current item. If current item' fields are unknown {@link kDBItem::PrepareFields()} is called before acutally setting the fields
*
* @access public
* @param Array $hash
* @param Array $set_fields Optional param, field names in target object to set, other fields will be skipped
* @return void
*/
function SetFieldsFromHash($hash, $set_fields=null)
{
// used in formatter which work with multiple fields together
foreach($hash as $field_name => $field_value)
{
if( eregi("^[0-9]+$", $field_name) || !array_key_exists($field_name,$this->Fields) ) continue;
if ( is_array($set_fields) && !in_array($field_name, $set_fields) ) continue;
$this->SetDirtyField($field_name, $field_value);
}
// formats all fields using associated formatters
foreach ($hash as $field_name => $field_value)
{
if( eregi("^[0-9]+$", $field_name) || !array_key_exists($field_name,$this->Fields) ) continue;
if ( is_array($set_fields) && !in_array($field_name, $set_fields) ) continue;
$this->SetField($field_name,$field_value);
}
}
function SetDBFieldsFromHash($hash, $set_fields=null)
{
foreach ($hash as $field_name => $field_value)
{
if( eregi("^[0-9]+$", $field_name) || !array_key_exists($field_name,$this->Fields) ) continue;
if ( is_array($set_fields) && !in_array($field_name, $set_fields) ) continue;
$this->SetDBField($field_name, $field_value);
}
}
/**
* Returns part of SQL WHERE clause identifing the record, ex. id = 25
*
* @access public
* @param string $method Child class may want to know who called GetKeyClause, Load(), Update(), Delete() send its names as method
* @param Array $keys_hash alternative, then item id, keys hash to load item by
* @return void
* @see kDBItem::Load()
* @see kDBItem::Update()
* @see kDBItem::Delete()
*/
function GetKeyClause($method=null, $keys_hash = null)
{
if( !isset($keys_hash) ) $keys_hash = Array($this->IDField => $this->ID);
$ret = '';
foreach($keys_hash as $field => $value)
{
if (!preg_match('/\./', $field)) {
$ret .= '(`'.$this->TableName.'`.'.$field.' = '.$this->Conn->qstr($value).') AND ';
}
else {
$ret .= '('.$field.' = '.$this->Conn->qstr($value).') AND ';
}
}
return preg_replace('/(.*) AND $/', '\\1', $ret);
}
/**
* Loads item from the database by given id
*
* @access public
* @param mixed $id item id of keys->values hash to load item by
* @param string $id_field_name Optional parameter to load item by given Id field
* @return bool True if item has been loaded, false otherwise
*/
function Load($id, $id_field_name = null)
{
if ( isset($id_field_name) ) $this->SetIDField( $id_field_name );
$keys_sql = '';
if( is_array($id) )
{
$keys_sql = $this->GetKeyClause('load', $id);
}
else
{
$this->setID($id);
$keys_sql = $this->GetKeyClause('load');
}
if ( isset($id_field_name) ) $this->setIDField( $this->Application->getUnitOption($this->Prefix, 'IDField') );
if( ($id === false) || !$keys_sql ) return $this->Clear();
if( !$this->raiseEvent('OnBeforeItemLoad', $id) ) return false;
$q = $this->GetSelectSQL().' WHERE '.$keys_sql;
$field_values = $this->Conn->GetRow($q);
if($field_values)
{
$this->FieldValues = array_merge_recursive2($this->FieldValues, $field_values);
}
else
{
return $this->Clear();
}
if( is_array($id) || isset($id_field_name) ) $this->setID( $this->FieldValues[$this->IDField] );
$this->UpdateFormattersSubFields(); // used for updating separate virtual date/time fields from DB timestamp (for example)
$this->raiseEvent('OnAfterItemLoad', $this->GetID() );
$this->Loaded = true;
return true;
}
/**
* Builds select sql, SELECT ... FROM parts only
*
* @access public
* @return string
*/
function GetSelectSQL()
{
$sql = $this->addCalculatedFields($this->SelectClause);
return parent::GetSelectSQL($sql);
}
function UpdateFormattersMasterFields()
{
foreach ($this->Fields as $field => $options) {
if (isset($options['formatter'])) {
$formatter =& $this->Application->recallObject($options['formatter']);
$formatter->UpdateMasterFields($field, $this->GetDBField($field), $options, $this);
}
}
}
function SkipField($field_name, $force_id=false)
{
$skip = false;
$skip = $skip || ( isset($this->VirtualFields[$field_name]) ); //skipping 'virtual' field
$skip = $skip || ( !getArrayValue($this->FieldValues, $field_name) && getArrayValue($this->Fields[$field_name], 'skip_empty') ); //skipping marked field with 'skip_empty'
// $skip = $skip || ($field_name == $this->IDField && !$force_id); //skipping Primary Key
// $table_name = preg_replace("/^(.*)\./", "$1", $field_name);
// $skip = $skip || ($table_name && ($table_name != $this->TableName)); //skipping field from other tables
$skip = $skip || ( !isset($this->Fields[$field_name]) ); //skipping field not in Fields (nor virtual, nor real)
return $skip;
}
/**
* Updates previously loaded record with current item' values
*
* @access public
* @param int Primery Key Id to update
* @return bool
*/
function Update($id=null, $system_update=false)
{
if( isset($id) ) $this->setID($id);
if( !$this->raiseEvent('OnBeforeItemUpdate') ) return false;
if( !isset($this->ID) ) return false;
// Validate before updating
if( !$this->IgnoreValidation && !$this->Validate() ) return false;
if( !$this->raiseEvent('OnAfterItemValidate') ) return false;
//Nothing to update
if(!$this->FieldValues) return true;
$sql = sprintf('UPDATE %s SET ',$this->TableName);
foreach ($this->FieldValues as $field_name => $field_value)
{
if ($this->SkipField($field_name)) continue;
$real_field_name = eregi_replace("^.*\.", '',$field_name); //removing table names from field names
//Adding part of SET clause for current field, escaping data with ADODB' qstr
if (is_null( $this->FieldValues[$field_name] )) {
if (isset($this->Fields[$field_name]['not_null']) && $this->Fields[$field_name]['not_null']) {
$sql .= '`'.$real_field_name.'` = '.$this->Conn->qstr($this->Fields[$field_name]['default']).', ';
}
else {
$sql .= '`'.$real_field_name.'` = NULL, ';
}
}
else {
$sql.= sprintf('`%s`=%s, ', $real_field_name, $this->Conn->qstr($this->FieldValues[$field_name], 0));
}
}
$sql = ereg_replace(", $", '', $sql); //Removing last comma and space
$sql.= sprintf(' WHERE %s', $this->GetKeyClause('update')); //Adding WHERE clause with Primary Key
if( $this->Conn->ChangeQuery($sql) === false ) return false;
$affected = $this->Conn->getAffectedRows();
if (!$system_update && $affected == 1){
$this->setModifiedFlag();
}
$this->saveCustomFields();
$this->raiseEvent('OnAfterItemUpdate');
$this->Loaded = true;
if ($this->mode != 't') {
$this->Application->resetCounters($this->TableName);
}
return true;
}
/**
* Validate all item fields based on
* constraints set in each field options
* in config
*
* @return bool
* @access private
*/
function Validate()
{
$this->UpdateFormattersMasterFields(); //order is critical - should be called BEFORE checking errors
$global_res = true;
foreach ($this->Fields as $field => $params) {
$res = true;
$res = $res && $this->ValidateType($field, $params);
$res = $res && $this->ValidateRange($field, $params);
$res = $res && $this->ValidateUnique($field, $params);
$res = $res && $this->ValidateRequired($field, $params);
$res = $res && $this->CustomValidation($field, $params);
// If Formatter has set some error messages during values parsing
$error_field = isset($params['error_field']) ? $params['error_field'] : $field;
if (isset($this->FieldErrors[$error_field]['pseudo']) && $this->FieldErrors[$error_field] != '') {
$global_res = false;
}
$global_res = $global_res && $res;
}
if (!$global_res && $this->Application->isDebugMode() )
{
global $debugger;
$error_msg = "Validation failed in prefix <b>".$this->Prefix."</b>, FieldErrors follow (look at items with 'pseudo' key set)<br>
You may ignore this notice if submitted data really has a validation error ";
trigger_error( $error_msg, E_USER_NOTICE);
$debugger->dumpVars($this->FieldErrors);
}
return $global_res;
}
/**
* Check field value by user-defined alghoritm
*
* @param string $field field name
* @param Array $params field options from config
* @return bool
*/
function CustomValidation($field, $params)
{
return true;
}
/**
* Check if item has errors
*
* @param Array $skip_fields fields to skip during error checking
* @return bool
*/
function HasErrors($skip_fields)
{
$global_res = false;
foreach ($this->Fields as $field => $field_params) {
// If Formatter has set some error messages during values parsing
if ( !( in_array($field, $skip_fields) ) &&
isset($this->FieldErrors[$field]['pseudo']) && $this->FieldErrors[$field] != '') {
$global_res = true;
}
}
return $global_res;
}
/**
* Check if value in field matches field type specified in config
*
* @param string $field field name
* @param Array $params field options from config
* @return bool
*/
function ValidateType($field, $params)
{
$res = true;
$val = $this->FieldValues[$field];
$error_field = isset($params['error_field']) ? $params['error_field'] : $field;
if ( $val != '' &&
isset($params['type']) &&
preg_match("#int|integer|double|float|real|numeric|string#", $params['type'])
) {
$res = is_numeric($val);
if($params['type']=='string' || $res)
{
$f = 'is_'.$params['type'];
settype($val, $params['type']);
$res = $f($val) && ($val==$this->FieldValues[$field]);
}
if (!$res)
{
$this->FieldErrors[$error_field]['pseudo'] = 'bad_type';
$this->FieldErrors[$error_field]['params'] = $params['type'];
}
}
return $res;
}
/**
* Check if value is set for required field
*
* @param string $field field name
* @param Array $params field options from config
* @return bool
* @access private
*/
function ValidateRequired($field, $params)
{
$res = true;
$error_field = isset($params['error_field']) ? $params['error_field'] : $field;
if ( getArrayValue($params,'required') )
{
$res = ( (string) $this->FieldValues[$field] != '');
}
$options = $this->GetFieldOptions($field);
if (!$res && getArrayValue($options, 'formatter') != 'kUploadFormatter') $this->FieldErrors[$error_field]['pseudo'] = 'required';
return $res;
}
/**
* Validates that current record has unique field combination among other table records
*
* @param string $field field name
* @param Array $params field options from config
* @return bool
* @access private
*/
function ValidateUnique($field, $params)
{
$res = true;
$error_field = isset($params['error_field']) ? $params['error_field'] : $field;
$unique_fields = getArrayValue($params,'unique');
if($unique_fields !== false)
{
$where = Array();
array_push($unique_fields,$field);
foreach($unique_fields as $unique_field)
{
// if field is not empty or if it is required - we add where condition
if ($this->GetDBField($unique_field) != '' || $this->Fields[$unique_field]['required']) {
$where[] = '`'.$unique_field.'` = '.$this->Conn->qstr( $this->GetDBField($unique_field) );
}
}
// This can ONLY happen if all unique fields are empty and not required.
// In such case we return true, because if unique field is not required there may be numerous empty values
if (!$where) return true;
$sql = 'SELECT COUNT(*) FROM %s WHERE ('.implode(') AND (',$where).') AND ('.$this->IDField.' <> '.(int)$this->ID.')';
$res_temp = $this->Conn->GetOne( str_replace('%s', $this->TableName, $sql) );
$current_table_only = getArrayValue($params, 'current_table_only'); // check unique record only in current table
$res_live = $current_table_only ? 0 : $this->Conn->GetOne( str_replace('%s', $this->Application->GetLiveName($this->TableName), $sql) );
$res = ($res_temp == 0) && ($res_live == 0);
if(!$res) $this->FieldErrors[$error_field]['pseudo'] = 'unique';
}
return $res;
}
/**
* Check if field value is in range specified in config
*
* @param string $field field name
* @param Array $params field options from config
* @return bool
* @access private
*/
function ValidateRange($field, $params)
{
$res = true;
$val = $this->FieldValues[$field];
$error_field = isset($params['error_field']) ? $params['error_field'] : $field;
if ( isset($params['type']) && preg_match("#int|integer|double|float|real#", $params['type']) && strlen($val) > 0 ) {
if ( isset($params['max_value_inc'])) {
$res = $res && $val <= $params['max_value_inc'];
$max_val = $params['max_value_inc'].' (inclusive)';
}
if ( isset($params['min_value_inc'])) {
$res = $res && $val >= $params['min_value_inc'];
$min_val = $params['min_value_inc'].' (inclusive)';
}
if ( isset($params['max_value_exc'])) {
$res = $res && $val < $params['max_value_exc'];
$max_val = $params['max_value_exc'].' (exclusive)';
}
if ( isset($params['min_value_exc'])) {
$res = $res && $val > $params['min_value_exc'];
$min_val = $params['min_value_exc'].' (exclusive)';
}
}
if (!$res) {
$this->FieldErrors[$error_field]['pseudo'] = 'value_out_of_range';
if ( !isset($min_val) ) $min_val = '-&infin;';
if ( !isset($max_val) ) $max_val = '&infin;';
$this->FieldErrors[$error_field]['params'] = Array( $min_val, $max_val );
return $res;
}
if ( isset($params['max_len'])) {
$res = $res && strlen($val) <= $params['max_len'];
}
if ( isset($params['min_len'])) {
$res = $res && strlen($val) >= $params['min_len'];
}
if (!$res) {
$this->FieldErrors[$error_field]['pseudo'] = 'length_out_of_range';
$this->FieldErrors[$error_field]['params'] = Array( getArrayValue($params,'min_len'), getArrayValue($params,'max_len') );
return $res;
}
return $res;
}
/**
* Return error message for field
*
* @param string $field
* @return string
* @access public
*/
function GetErrorMsg($field, $force_escape = null)
{
if( !isset($this->FieldErrors[$field]) ) return '';
$err = getArrayValue($this->FieldErrors[$field], 'pseudo');
if (!$err) return '';
// if special error msg defined in config
if( isset($this->Fields[$field]['error_msgs'][$err]) )
{
$msg = $this->Fields[$field]['error_msgs'][$err];
}
else //fall back to defaults
{
if( !isset($this->ErrorMsgs[$err]) ) {
trigger_error('No user message is defined for pseudo error <b>'.$err.'</b><br>', E_USER_WARNING);
return $err; //return the pseudo itself
}
$msg = $this->ErrorMsgs[$err];
}
$msg = $this->Application->ReplaceLanguageTags($msg, $force_escape);
if ( isset($this->FieldErrors[$field]['params']) )
{
return vsprintf($msg, $this->FieldErrors[$field]['params']);
}
return $msg;
}
/**
* Creates a record in the database table with current item' values
*
* @param mixed $force_id Set to TRUE to force creating of item's own ID or to value to force creating of passed id. Do not pass 1 for true, pass exactly TRUE!
* @access public
* @return bool
*/
function Create($force_id=false, $system_create=false)
{
if( !$this->raiseEvent('OnBeforeItemCreate') ) return false;
// Validating fields before attempting to create record
if( !$this->IgnoreValidation && !$this->Validate() ) return false;
if( !$this->raiseEvent('OnAfterItemValidate') ) return false;
if (is_int($force_id)) {
$this->FieldValues[$this->IDField] = $force_id;
}
elseif (!$force_id || !is_bool($force_id)) {
$this->FieldValues[$this->IDField] = $this->generateID();
}
$fields_sql = '';
$values_sql = '';
foreach ($this->FieldValues as $field_name => $field_value) {
if ($this->SkipField($field_name, $force_id)) continue;
//Adding field' value to Values block of Insert statement, escaping it with qstr
if (is_null( $this->FieldValues[$field_name] )) {
if (isset($this->Fields[$field_name]['not_null']) && $this->Fields[$field_name]['not_null']) {
$values_sql .= $this->Conn->qstr($this->Fields[$field_name]['default'], 0);
}
else {
$values_sql .= 'NULL';
}
}
else {
if ($field_name == $this->IDField && $this->FieldValues[$field_name] == 0) {
$values_sql .= 'DEFAULT';
}
else {
$values_sql .= $this->Conn->qstr($this->FieldValues[$field_name], 0);
}
}
-
$fields_sql .= '`'.$field_name.'`, '; //Adding field name to fields block of Insert statement
$values_sql .= ', ';
}
//Cutting last commas and spaces
$fields_sql = ereg_replace(", $", '', $fields_sql);
$values_sql = ereg_replace(", $", '', $values_sql);
$sql = sprintf('INSERT INTO %s (%s) VALUES (%s)', $this->TableName, $fields_sql, $values_sql); //Formatting query
//Executing the query and checking the result
if ($this->Conn->ChangeQuery($sql) === false) return false;
$insert_id = $this->Conn->getInsertID();
if ($insert_id == 0) {
// insert into temp table (id is not auto-increment field)
$insert_id = $this->FieldValues[$this->IDField];
}
$this->setID($insert_id);
if (!$system_create){
$this->setModifiedFlag();
}
$this->saveCustomFields();
if ($this->mode != 't') {
$this->Application->resetCounters($this->TableName);
}
$this->raiseEvent('OnAfterItemCreate');
$this->Loaded = true;
return true;
}
/**
* Deletes the record from databse
*
* @access public
* @return bool
*/
function Delete($id = null)
{
if( isset($id) ) $this->setID($id);
if( !$this->raiseEvent('OnBeforeItemDelete') ) return false;
$q = 'DELETE FROM '.$this->TableName.' WHERE '.$this->GetKeyClause('Delete');
$ret = $this->Conn->ChangeQuery($q);
$this->setModifiedFlag();
$this->raiseEvent('OnAfterItemDelete');
if ($this->mode != 't') {
$this->Application->resetCounters($this->TableName);
}
return $ret;
}
function PopulateMultiLangFields()
{
$ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
$lang_count = $ml_helper->getLanguageCount();
foreach ($this->Fields as $field => $options)
{
if (isset($options['formatter']) && $options['formatter'] == 'kMultiLanguage' && isset($options['master_field'])) {
if (preg_match('/^l([0-9]+)_(.*)/', $field, $regs)) {
$l = $regs[1];
$name = $regs[2];
unset($options['required']); // all non-primary language field set to non-required
for ($i=1; $i<=$lang_count; $i++) {
if ($i == $l) continue;
$this->Fields['l'.$i.'_'.$name] = $options;
}
}
}
}
}
/**
* Sets new name for item in case if it is beeing copied
* in same table
*
* @param array $master Table data from TempHandler
* @param int $foreign_key ForeignKey value to filter name check query by
* @access private
*/
function NameCopy($master=null, $foreign_key=null)
{
$title_field = $this->Application->getUnitOption($this->Prefix, 'TitleField');
if (!$title_field || isset($this->CalculatedFields[$title_field]) ) return;
$new_name = $this->GetDBField($title_field);
$original_checked = false;
do {
if ( preg_match('/Copy ([0-9]*) *of (.*)/', $new_name, $regs) ) {
$new_name = 'Copy '.($regs[1]+1).' of '.$regs[2];
}
elseif ($original_checked) {
$new_name = 'Copy of '.$new_name;
}
// if we are cloning in temp table this will look for names in temp table,
// since object' TableName contains correct TableName (for temp also!)
// if we are cloning live - look in live
$query = 'SELECT '.$title_field.' FROM '.$this->TableName.'
WHERE '.$title_field.' = '.$this->Conn->qstr($new_name);
$foreign_key_field = getArrayValue($master, 'ForeignKey');
$foreign_key_field = is_array($foreign_key_field) ? $foreign_key_field[ $master['ParentPrefix'] ] : $foreign_key_field;
if ($foreign_key_field && isset($foreign_key)) {
$query .= ' AND '.$foreign_key_field.' = '.$foreign_key;
}
$res = $this->Conn->GetOne($query);
/*// if not found in live table, check in temp table if applicable
if ($res === false && $object->Special == 'temp') {
$query = 'SELECT '.$name_field.' FROM '.$this->GetTempName($master['TableName']).'
WHERE '.$name_field.' = '.$this->Conn->qstr($new_name);
$res = $this->Conn->GetOne($query);
}*/
$original_checked = true;
} while ($res !== false);
$this->SetDBField($title_field, $new_name);
}
function raiseEvent($name, $id = null, $additional_params = Array())
{
if( !isset($id) ) $id = $this->GetID();
$event = new kEvent( Array('name'=>$name,'prefix'=>$this->Prefix,'special'=>$this->Special) );
$event->setEventParam('id', $id);
if ($additional_params) {
foreach ($additional_params as $ap_name => $ap_value) {
$event->setEventParam($ap_name, $ap_value);
}
}
$this->Application->HandleEvent($event);
return $event->status == erSUCCESS ? true : false;
}
/**
* Set's new ID for item
*
* @param int $new_id
* @access public
*/
function setID($new_id)
{
$this->ID = $new_id;
$this->SetDBField($this->IDField, $new_id);
}
/**
* Generate and set new temporary id
*
* @access private
*/
function setTempID()
{
$new_id = (int)$this->Conn->GetOne('SELECT MIN('.$this->IDField.') FROM '.$this->TableName);
if($new_id > 0) $new_id = 0;
--$new_id;
$this->Conn->Query('UPDATE '.$this->TableName.' SET `'.$this->IDField.'` = '.$new_id.' WHERE `'.$this->IDField.'` = '.$this->GetID());
$this->SetID($new_id);
}
/**
* Set's modification flag for main prefix of current prefix to true
*
* @access private
* @author Alexey
*/
function setModifiedFlag()
{
$main_prefix = $this->Application->GetTopmostPrefix($this->Prefix);
$this->Application->StoreVar($main_prefix.'_modified', '1');
}
/**
* Returns ID of currently processed record
*
* @return int
* @access public
*/
function GetID()
{
return $this->ID;
}
/**
* Generates ID for new items before inserting into database
*
* @return int
* @access private
*/
function generateID()
{
return 0;
}
/**
* Returns true if item was loaded successfully by Load method
*
* @return bool
*/
function isLoaded()
{
return $this->Loaded;
}
/**
* Checks if field is required
*
* @param string $field
* @return bool
*/
function isRequired($field)
{
return getArrayValue( $this->Fields[$field], 'required' );
}
/**
* Sets new required flag to field
*
* @param string $field
* @param bool $is_required
*/
function setRequired($field, $is_required = true)
{
$this->Fields[$field]['required'] = $is_required;
}
function Clear()
{
$this->setID(null);
$this->Loaded = false;
$this->FieldValues = Array();
$this->SetDefaultValues();
$this->FieldErrors = Array();
return $this->Loaded;
}
function Query($force = false)
{
if( $this->Application->isDebugMode() )
{
$this->Application->Debugger->appendTrace();
}
trigger_error('<b>Query</b> method is called in class <b>'.get_class($this).'</b> for prefix <b>'.$this->getPrefixSpecial().'</b>', E_USER_ERROR);
}
function saveCustomFields()
{
if (!$this->customFields) {
return true;
}
$cdata_key = rtrim($this->Prefix.'-cdata.'.$this->Special, '.');
$cdata =& $this->Application->recallObject($cdata_key, null, Array('skip_autoload' => true));
$resource_id = $this->GetDBField('ResourceId');
$cdata->Load($resource_id, 'ResourceId');
$cdata->SetDBField('ResourceId', $resource_id);
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
foreach ($this->customFields as $custom_id => $custom_name) {
$cdata->SetDBField($ml_formatter->LangFieldName('cust_'.$custom_id), $this->GetDBField('cust_'.$custom_name));
}
if ($cdata->isLoaded()) {
$ret = $cdata->Update();
}
else {
$ret = $cdata->Create();
if ($cdata->mode == 't') $cdata->setTempID();
}
return $ret;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/db/dbitem.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.34
\ No newline at end of property
+1.35
\ No newline at end of property
Index: trunk/core/kernel/application.php
===================================================================
--- trunk/core/kernel/application.php (revision 8103)
+++ trunk/core/kernel/application.php (revision 8104)
@@ -1,2496 +1,2494 @@
<?php
/**
* Basic class for Kernel3-based Application
*
* This class is a Facade for any other class which needs to deal with Kernel3 framework.<br>
* The class incapsulates the main run-cycle of the script, provide access to all other objects in the framework.<br>
* <br>
* The class is a singleton, which means that there could be only one instance of KernelApplication in the script.<br>
* This could be guranteed by NOT calling the class constuctor directly, but rather calling KernelApplication::Instance() method,
* which returns an instance of the application. The method gurantees that it will return exactly the same instance for any call.<br>
* See singleton pattern by GOF.
* @package kernel4
*/
class kApplication {
/**
* Is true, when Init method was called already, prevents double initialization
*
* @var bool
*/
var $InitDone = false;
/**
* Holds internal TemplateParser object
* @access private
* @var TemplateParser
*/
var $Parser;
/**
* Holds parser output buffer
* @access private
* @var string
*/
var $HTML;
/**
* Prevents request from beeing proceeded twice in case if application init is called mere then one time
*
* @var bool
* @todo This is not good anyway (by Alex)
*/
var $RequestProcessed = false;
/**
* The main Factory used to create
* almost any class of kernel and
* modules
*
* @access private
* @var kFactory
*/
var $Factory;
/**
* All ConfigurationValues table content (hash) here
*
* @var Array
* @access private
*/
var $ConfigHash = Array();
/**
* Ids of config variables used in current run (for caching)
*
* @var Array
* @access private
*/
var $ConfigCacheIds = array();
/**
* Template names, that will be used instead of regular templates
*
* @var Array
*/
var $ReplacementTemplates = Array ();
/**
* Reference to debugger
*
* @var Debugger
*/
var $Debugger = null;
/**
* Holds all phrases used
* in code and template
*
* @var PhrasesCache
*/
var $Phrases;
/**
* Modules table content, key - module name
*
* @var Array
*/
var $ModuleInfo = Array();
/**
* Holds DBConnection
*
* @var kDBConnection
*/
var $Conn = null;
/**
* Maintains list of user-defined error handlers
*
* @var Array
*/
var $errorHandlers = Array();
// performance needs:
/**
* Holds a refererence to httpquery
*
* @var kHttpQuery
*/
var $HttpQuery = null;
/**
* Holds a reference to UnitConfigReader
*
* @var kUnitConfigReader
*/
var $UnitConfigReader = null;
/**
* Holds a reference to Session
*
* @var Session
*/
var $Session = null;
/**
* Holds a ref to kEventManager
*
* @var kEventManager
*/
var $EventManager = null;
/**
* Ref to itself, needed because everybody used to write $this->Application, even inside kApplication
*
* @var kApplication
*/
var $Application = null;
/**
* Ref for TemplatesChache
*
* @var TemplatesCache
*/
var $TemplatesCache = null;
var $CompilationCache = array(); //used when compiling templates
var $CachedProcessors = array(); //used when running compiled templates
/**
* Returns kApplication instance anywhere in the script.
*
* This method should be used to get single kApplication object instance anywhere in the
* Kernel-based application. The method is guranteed to return the SAME instance of kApplication.
* Anywhere in the script you could write:
* <code>
* $application =& kApplication::Instance();
* </code>
* or in an object:
* <code>
* $this->Application =& kApplication::Instance();
* </code>
* to get the instance of kApplication. Note that we call the Instance method as STATIC - directly from the class.
* To use descendand of standard kApplication class in your project you would need to define APPLICATION_CLASS constant
* BEFORE calling kApplication::Instance() for the first time. If APPLICATION_CLASS is not defined the method would
* create and return default KernelApplication instance.
* @static
* @access public
* @return kApplication
*/
function &Instance()
{
static $instance = false;
if(!$instance)
{
safeDefine('APPLICATION_CLASS', 'kApplication');
$class = APPLICATION_CLASS;
$instance = new $class();
$instance->Application =& $instance;
}
return $instance;
}
/**
* Initializes the Application
*
* @access public
* @see kHTTPQuery
* @see Session
* @see TemplatesCache
* @return bool Was Init actually made now or before
*/
function Init()
{
if($this->InitDone) return false;
if (!constOn('SKIP_OUT_COMPRESSION')) {
ob_start(); // collect any output from method (other then tags) into buffer
}
if(defined('DEBUG_MODE') && $this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Init:');
}
if (!$this->isDebugMode() && !constOn('DBG_ZEND_PRESENT')) {
error_reporting(0);
ini_set('display_errors', 0);
}
if (!constOn('DBG_ZEND_PRESENT')) {
$error_handler = set_error_handler( Array(&$this,'handleError') );
if ($error_handler) $this->errorHandlers[] = $error_handler;
}
$this->Conn = new kDBConnection(SQL_TYPE, Array(&$this, 'handleSQLError') );
$this->Conn->Connect(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB);
$this->Conn->debugMode = $this->isDebugMode();
$this->Factory = new kFactory();
$this->registerDefaultClasses();
$this->Phrases = new PhrasesCache();
$this->EventManager =& $this->Factory->makeClass('EventManager');
$this->Factory->Storage['EventManager'] =& $this->EventManager;
$this->RegisterDefaultBuildEvents();
$this->SetDefaultConstants();
$this->UnitConfigReader =& $this->recallObject('kUnitConfigReader');
$this->UnitConfigReader->scanModules(MODULES_PATH);
$this->registerModuleConstants();
$rewrite_on = $this->ConfigValue('UseModRewrite');
// admin=1 - when front is browsed using admin session
$admin_on = getArrayValue($_REQUEST, 'admin') || $this->IsAdmin();
define('MOD_REWRITE', $rewrite_on && !$admin_on ? 1 : 0);
$this->HttpQuery =& $this->recallObject('HTTPQuery');
$this->Session =& $this->recallObject('Session');
$this->HttpQuery->AfterInit();
$this->LoadCache();
$this->InitConfig();
$this->Phrases->Init('phrases');
$this->UnitConfigReader->AfterConfigRead();
/*// Module items are recalled during url parsing & PhrasesCache is needed already there,
// because it's used in their build events. That's why phrases cache initialization is
// called from kHTTPQuery in case when mod_rewrite is used
if (!$this->RewriteURLs()) {
$this->Phrases = new PhrasesCache();
}*/
if(!$this->RecallVar('UserGroups')) {
$session =& $this->recallObject('Session');
$user_groups = trim($session->GetField('GroupList'), ',');
if (!$user_groups) $user_groups = $this->ConfigValue('User_GuestGroup');
$this->StoreVar('UserGroups', $user_groups);
}
if ($this->GetVar('m_cat_id') === false) $this->SetVar('m_cat_id', 0);
if( !$this->RecallVar('curr_iso') ) $this->StoreVar('curr_iso', $this->GetPrimaryCurrency() );
$this->SetVar('visits_id', $this->RecallVar('visit_id') );
$language =& $this->recallObject( 'lang.current', null, Array('live_table' => true) );
$this->ValidateLogin();
if($this->isDebugMode()) {
$this->Debugger->profileFinish('kernel4_startup');
}
$this->InitDone = true;
$this->HandleEvent( new kEvent('adm:OnStartup') );
return true;
}
/**
* Returns module information. Searches module by requested field
*
* @param string $field
* @param mixed $value
* @param string field value to returns, if not specified, then return all fields
* @param string field to return
* @return Array
*/
function findModule($field, $value, $return_field = null)
{
$found = false;
foreach ($this->ModuleInfo as $module_name => $module_info) {
if (strtolower($module_info[$field]) == strtolower($value)) {
$found = true;
break;
}
}
if ($found) {
return isset($return_field) ? $module_info[$return_field] : $module_info;
}
return false;
}
function refreshModuleInfo()
{
if (defined('IS_INSTALL') && IS_INSTALL && !$this->TableFound('Modules')) {
$this->registerModuleConstants();
return false;
}
-
$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', '/core/admin_templates');
return;
}
$path = $this->GetFrontThemePath();
if ($path === false) {
$this->ApplicationDie('No Primary Theme Selected or Current Theme is Unknown or Disabled');
}
safeDefine('THEMES_PATH', $path);
/*
$theme_id = $this->GetVar('m_theme');
if (!$theme_id) {
$theme_id = $this->GetDefaultThemeId();
if (!$theme_id) {
if (!defined('IS_INSTALL')) $this->ApplicationDie('No Primary Theme Selected');
}
}
$this->SetVar('m_theme', $theme_id);
$this->SetVar('theme.current_id', $theme_id ); // KOSTJA: this is to fool theme' getPassedId
$theme =& $this->recallObject('theme.current');
if (!$theme->IsLoaded() || !$theme->GetDBField('Enabled')) {
if (!defined('IS_INSTALL')) $this->ApplicationDie('Unknown or disabled theme');
}
safeDefine('THEMES_PATH', '/themes/'.$theme->GetDBField('Name'));
*/
}
function GetFrontThemePath($force=0)
{
static $path=null;
if (!$force && isset($path)) return $path;
$theme_id = $this->GetVar('m_theme');
if (!$theme_id) {
$theme_id = $this->GetDefaultThemeId(1); //1 to force front-end mode!
if (!$theme_id) {
return false;
}
}
$this->SetVar('m_theme', $theme_id);
$this->SetVar('theme.current_id', $theme_id ); // KOSTJA: this is to fool theme' getPassedId
$theme =& $this->recallObject('theme.current');
if (!$theme->IsLoaded() || !$theme->GetDBField('Enabled')) {
return false;
}
$path = '/themes/'.$theme->GetDBField('Name');
return $path;
}
function GetDefaultLanguageId()
{
static $language_id = 0;
if ($language_id > 0) return $language_id;
$table = $this->getUnitOption('lang','TableName');
$id_field = $this->getUnitOption('lang','IDField');
$sql = 'SELECT '.$id_field.'
FROM '.$table.'
WHERE (PrimaryLang = 1) AND (Enabled = 1)';
$language_id = $this->Conn->GetOne($sql);
if (!$language_id && defined('IS_INSTALL') && IS_INSTALL) {
$language_id = 1;
}
return $language_id;
}
function GetDefaultThemeId($force_front=0)
{
static $theme_id = 0;
if($theme_id > 0) return $theme_id;
if (constOn('DBG_FORCE_THEME')) {
$theme_id = DBG_FORCE_THEME;
}
elseif (!$force_front && $this->IsAdmin()) {
$theme_id = 999;
}
else {
$table = $this->getUnitOption('theme','TableName');
$id_field = $this->getUnitOption('theme','IDField');
$sql = 'SELECT '.$id_field.'
FROM '.$table.'
WHERE (PrimaryTheme = 1) AND (Enabled = 1)';
$theme_id = $this->Conn->GetOne($sql);
}
return $theme_id;
}
function GetPrimaryCurrency()
{
if ($this->isModuleEnabled('In-Commerce')) {
$table = $this->getUnitOption('curr', 'TableName');
return $this->Conn->GetOne('SELECT ISO FROM '.$table.' WHERE IsPrimary = 1');
}
else {
return 'USD';
}
}
/**
* Registers default classes such as ItemController, GridController and LoginController
*
* Called automatically while initializing Application
* @access private
* @return void
*/
function RegisterDefaultClasses()
{
$this->registerClass('kTempTablesHandler', KERNEL_PATH.'/utility/temp_handler.php');
$this->registerClass('kEventManager', KERNEL_PATH.'/event_manager.php', 'EventManager');
$this->registerClass('kUnitConfigReader', KERNEL_PATH.'/utility/unit_config_reader.php');
$this->registerClass('kArray', KERNEL_PATH.'/utility/params.php');
$this->registerClass('Params', KERNEL_PATH.'/utility/params.php');
$this->registerClass('kHelper', KERNEL_PATH.'/kbase.php');
$this->registerClass('kCache', KERNEL_PATH.'/utility/cache.php', 'Cache', Array('Params'));
$this->registerClass('kHTTPQuery', KERNEL_PATH.'/utility/http_query.php', 'HTTPQuery', Array('Params') );
$this->registerClass('Session', KERNEL_PATH.'/session/session.php');
$this->registerClass('SessionStorage', KERNEL_PATH.'/session/session.php');
$this->registerClass('Params', KERNEL_PATH.'/utility/params.php', 'kActions');
$this->registerClass('kMultipleFilter', KERNEL_PATH.'/utility/filters.php');
$this->registerClass('kDBList', KERNEL_PATH.'/db/dblist.php');
$this->registerClass('kDBItem', KERNEL_PATH.'/db/dbitem.php');
$this->registerClass('kDBEventHandler', KERNEL_PATH.'/db/db_event_handler.php');
$this->registerClass('kTagProcessor', KERNEL_PATH.'/processors/tag_processor.php');
$this->registerClass('kMainTagProcessor', KERNEL_PATH.'/processors/main_processor.php','m_TagProcessor', 'kTagProcessor');
$this->registerClass('kDBTagProcessor', KERNEL_PATH.'/db/db_tag_processor.php', null, 'kTagProcessor');
$this->registerClass('TemplatesCache', KERNEL_PATH.'/parser/template.php');
$this->registerClass('Template', KERNEL_PATH.'/parser/template.php');
$this->registerClass('TemplateParser', KERNEL_PATH.'/parser/template_parser.php',null, 'kDBTagProcessor');
$this->registerClass('kEmailSendingHelper', KERNEL_PATH.'/utility/email_send.php', 'EmailSender', Array('kHelper'));
$this->registerClass('kSocket', KERNEL_PATH.'/utility/socket.php', 'Socket');
if (file_exists(MODULES_PATH.'/in-commerce/units/currencies/currency_rates.php')) {
$this->registerClass('kCurrencyRates', MODULES_PATH.'/in-commerce/units/currencies/currency_rates.php');
}
$this->registerClass('FCKeditor', FULL_PATH.'/admin/editor/cmseditor/fckeditor.php'); // need this?
/* Moved from MyApplication */
$this->registerClass('Inp1Parser',KERNEL_PATH.'/../units/general/inp1_parser.php','Inp1Parser');
$this->registerClass('InpSession',KERNEL_PATH.'/../units/general/inp_ses_storage.php','Session');
$this->registerClass('InpSessionStorage',KERNEL_PATH.'/../units/general/inp_ses_storage.php','SessionStorage');
$this->registerClass('kCatDBItem',KERNEL_PATH.'/../units/general/cat_dbitem.php');
$this->registerClass('kCatDBItemExportHelper',KERNEL_PATH.'/../units/general/cat_dbitem_export.php', 'CatItemExportHelper');
$this->registerClass('kCatDBList',KERNEL_PATH.'/../units/general/cat_dblist.php');
$this->registerClass('kCatDBEventHandler',KERNEL_PATH.'/../units/general/cat_event_handler.php');
$this->registerClass('kCatDBTagProcessor',KERNEL_PATH.'/../units/general/cat_tag_processor.php');
// Do not move to config - this helper is used before configs are read
$this->registerClass('kModulesHelper', KERNEL_PATH.'/../units/general/helpers/modules.php', 'ModulesHelper');
/* End moved */
}
function RegisterDefaultBuildEvents()
{
$event_manager =& $this->recallObject('EventManager');
$event_manager->registerBuildEvent('kTempTablesHandler', 'OnTempHandlerBuild');
}
/**
* Returns item's filename that corresponds id passed. If possible, then get it from cache
*
* @param string $prefix
* @param int $id
* @return string
*/
function getFilename($prefix, $id, $category_id=null)
{
$filename = $this->getCache('filenames', $prefix.'_'.$id);
if ($filename === false) {
$table = $this->getUnitOption($prefix, 'TableName');
$id_field = $this->getUnitOption($prefix, 'IDField');
if ($prefix == 'c') {
if(!$id) {
$this->setCache('filenames', $prefix.'_'.$id, '');
return '';
}
// this allows to save 2 sql queries for each category
$sql = 'SELECT NamedParentPath, 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() // it's defined in startup.php - can be removed??
{
safeDefine('SERVER_NAME', $_SERVER['HTTP_HOST']);
}
/**
* Registers each module specific constants if any found
*
*/
function registerModuleConstants()
{
if (file_exists(KERNEL_PATH.'/constants.php')) {
k4_include_once(KERNEL_PATH.'/constants.php');
}
if (!$this->ModuleInfo) return false;
foreach($this->ModuleInfo as $module_name => $module_info)
{
$module_path = '/'.$module_info['Path'];
$contants_file = FULL_PATH.$module_path.'constants.php';
if( file_exists($contants_file) ) k4_include_once($contants_file);
}
return true;
}
function ProcessRequest()
{
$event_manager =& $this->recallObject('EventManager');
/* @var $event_manager kEventManager */
if($this->isDebugMode() && constOn('DBG_SHOW_HTTPQUERY')) {
$this->Debugger->appendHTML('HTTPQuery:');
$this->Debugger->dumpVars($this->HttpQuery->_Params);
}
$event_manager->ProcessRequest();
$event_manager->RunRegularEvents(reBEFORE);
$this->RequestProcessed = true;
}
/**
* Actually runs the parser against current template and stores parsing result
*
* This method gets t variable passed to the script, loads the template given in t variable and
* parses it. The result is store in {@link $this->HTML} property.
* @access public
* @return void
*/
function Run()
{
if($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) {
$this->Debugger->appendMemoryUsage('Application before Run:');
}
if ($this->IsAdmin()) {
// for permission checking in events & templates
$this->LinkVar('module'); // for common configuration templates
$this->LinkVar('section'); // for common configuration templates
if ($this->GetVar('m_opener') == 'p') {
$this->LinkVar('main_prefix'); // window prefix, that opened selector
$this->LinkVar('dst_field'); // field to set value choosed in selector
// $this->LinkVar('return_template'); // template to go, when something was coosen from popup (from finalizePopup)
// $this->LinkVar('return_m'); // main env part to restore after popup will be closed (from finalizePopup)
}
if ($this->GetVar('ajax') == 'yes') {
// hide debug output from ajax requests automatically
define('DBG_SKIP_REPORTING', 1);
}
}
if (!$this->RequestProcessed) $this->ProcessRequest();
$this->InitParser();
$t = $this->GetVar('t');
if ($this->isModuleEnabled('In-Edit')) {
$cms_handler =& $this->recallObject('cms_EventHandler');
if (!$this->TemplatesCache->TemplateExists($t) && !$this->IsAdmin()) {
$t = $cms_handler->GetDesignTemplate();
}
/*else {
$cms_handler->SetCatByTemplate();
}*/
}
if ($this->isModuleEnabled('Proj-CMS')) {
$cms_handler =& $this->recallObject('st_EventHandler');
if (!$this->TemplatesCache->TemplateExists($t) && !$this->IsAdmin()) {
$t = $cms_handler->GetDesignTemplate();
}
}
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);
}
function RemovePersistentVar($var)
{
return $this->Session->RemovePersistentVar($var);
}
/**
* Restores Session variable to it's db version
*
* @param string $var
*/
function RestoreVar($var)
{
return $this->Session->RestoreVar($var);
}
/**
* Returns session variable value
*
* Return value of $var variable stored in Session. An optional default value could be passed as second parameter.
*
* @see SimpleSession
* @access public
* @param string $var Variable name
* @param mixed $default Default value to return if no $var variable found in session
* @return mixed
*/
function RecallVar($var,$default=false)
{
return $this->Session->RecallVar($var,$default);
}
function RecallPersistentVar($var, $default = false)
{
return $this->Session->RecallPersistentVar($var, $default);
}
/**
* Stores variable $val in session under name $var
*
* Use this method to store variable in session. Later this variable could be recalled.
* @see RecallVar
* @access public
* @param string $var Variable name
* @param mixed $val Variable value
*/
function StoreVar($var, $val)
{
$session =& $this->recallObject('Session');
$this->Session->StoreVar($var, $val);
}
function StorePersistentVar($var, $val)
{
$this->Session->StorePersistentVar($var, $val);
}
function StoreVarDefault($var, $val)
{
$session =& $this->recallObject('Session');
$this->Session->StoreVarDefault($var, $val);
}
/**
* Links HTTP Query variable with session variable
*
* If variable $var is passed in HTTP Query it is stored in session for later use. If it's not passed it's recalled from session.
* This method could be used for making sure that GetVar will return query or session value for given
* variable, when query variable should overwrite session (and be stored there for later use).<br>
* This could be used for passing item's ID into popup with multiple tab -
* in popup script you just need to call LinkVar('id', 'current_id') before first use of GetVar('id').
* After that you can be sure that GetVar('id') will return passed id or id passed earlier and stored in session
* @access public
* @param string $var HTTP Query (GPC) variable name
* @param mixed $ses_var Session variable name
* @param mixed $default Default variable value
*/
function LinkVar($var, $ses_var = null, $default = '')
{
if (!isset($ses_var)) $ses_var = $var;
if ($this->GetVar($var) !== false) {
$this->StoreVar($ses_var, $this->GetVar($var));
}
else {
$this->SetVar($var, $this->RecallVar($ses_var, $default));
}
}
/**
* Returns variable from HTTP Query, or from session if not passed in HTTP Query
*
* The same as LinkVar, but also returns the variable value taken from HTTP Query if passed, or from session if not passed.
* Returns the default value if variable does not exist in session and was not passed in HTTP Query
*
* @see LinkVar
* @access public
* @param string $var HTTP Query (GPC) variable name
* @param mixed $ses_var Session variable name
* @param mixed $default Default variable value
* @return mixed
*/
function GetLinkedVar($var, $ses_var = null, $default = '')
{
$this->LinkVar($var, $ses_var, $default);
return $this->GetVar($var);
}
function AddBlock($name, $tpl)
{
$this->cache[$name] = $tpl;
}
/* Seems to be not used anywhere... /Kostja
function SetTemplateBody($title,$body)
{
$templates_cache =& $this->recallObject('TemplatesCache');
$templates_cache->SetTemplateBody($title,$body);
}*/
function ProcessTag($tag_data)
{
$a_tag = new Tag($tag_data,$this->Parser);
return $a_tag->DoProcessTag();
}
function ProcessParsedTag($prefix, $tag, $params)
{
$a_tag = new Tag('',$this->Parser);
$a_tag->Tag = $tag;
$tmp=$this->Application->processPrefix($prefix);
$a_tag->Processor = $tmp['prefix'];
$a_tag->Special = $tmp['special'];
$a_tag->NamedParams = $params;
return $a_tag->DoProcessTag();
}
/**
* Return ADODB Connection object
*
* Returns ADODB Connection object already connected to the project database, configurable in config.php
* @access public
* @return kDBConnection
*/
function &GetADODBConnection()
{
return $this->Conn;
}
function ParseBlock($params,$pass_params=0,$as_template=false)
{
if (substr($params['name'], 0, 5) == 'html:') return substr($params['name'], 6);
return $this->Parser->ParseBlock($params, $pass_params, $as_template);
}
/**
* Returns index file, that could be passed as parameter to method, as parameter to tag and as constant or not passed at all
*
* @param string $prefix
* @param string $index_file
* @param Array $params
* @return string
*/
function getIndexFile($prefix, $index_file, &$params)
{
if (isset($params['index_file'])) {
$index_file = $params['index_file'];
unset($params['index_file']);
return $index_file;
}
if (isset($index_file)) {
return $index_file;
}
if (defined('INDEX_FILE')) {
return INDEX_FILE;
}
$cut_prefix = trim(BASE_PATH, '/').'/'.trim($prefix, '/');
return trim(preg_replace('/'.preg_quote($cut_prefix, '/').'(.*)/', '\\1', $_SERVER['PHP_SELF']), '/');
}
/**
* Return href for template
*
* @access public
* @param string $t Template path
* @var string $prefix index.php prefix - could be blank, 'admin'
*/
function HREF($t, $prefix='', $params=null, $index_file=null)
{
if(!$t) $t = $this->GetVar('t'); // moved from kMainTagProcessor->T()
if ($this->isModuleEnabled('Proj-CMS')) {
$t = preg_replace('/^Content\//', '', $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') {
$wid = $this->Application->GetVar('m_wid');
$stack_name = rtrim('opener_stack_'.$wid, '_');
$opener_stack = $this->RecallVar($stack_name);
if ($opener_stack && $opener_stack != serialize(Array())) {
$opener_stack = unserialize($opener_stack);
list($index_file, $env) = explode('|', $opener_stack[count($opener_stack) - 1]);
$ret = $this->BaseURL($prefix, $ssl).$index_file.'?'.ENV_VAR_NAME.'='.$env;
if ( getArrayValue($params,'escape') ) $ret = addslashes($ret);
if (isset($params['m_opener']) && $params['m_opener'] == 'u') {
array_pop($opener_stack);
if (!$opener_stack) {
$this->RemoveVar($stack_name);
// remove popups last templates, because popup is closing now
$this->RemoveVar('last_template_'.$wid);
$this->RemoveVar('last_template_popup_'.$wid);
// don't save popups last templates again :)
$this->SetVar('skip_last_template', 1);
}
else {
$this->StoreVar($stack_name, serialize($opener_stack));
}
}
return $ret;
}
else {
//define('DBG_REDIRECT', 1);
$t = $this->GetVar('t');
}
}
$pass = isset($params['pass']) ? $params['pass'] : '';
$pass_events = isset($params['pass_events']) ? $params['pass_events'] : false; // pass events with url
$map_link = '';
if( isset($params['anchor']) )
{
$map_link = '#'.$params['anchor'];
unset($params['anchor']);
}
if ( isset($params['no_amp']) )
{
$params['__URLENCODE__'] = $params['no_amp'];
unset($params['no_amp']);
}
$no_rewrite = false;
if( isset($params['__NO_REWRITE__']) )
{
$no_rewrite = true;
unset($params['__NO_REWRITE__']);
}
$force_rewrite = false;
if( isset($params['__MOD_REWRITE__']) )
{
$force_rewrite = true;
unset($params['__MOD_REWRITE__']);
}
$force_no_sid = false;
if( isset($params['__NO_SID__']) )
{
$force_no_sid = true;
unset($params['__NO_SID__']);
}
// append pass through variables to each link to be build
$params = array_merge_recursive2($this->getPassThroughVariables($params), $params);
if ($force_rewrite || ($this->RewriteURLs($ssl) && !$no_rewrite))
{
$session =& $this->recallObject('Session');
if( $session->NeedQueryString() && !$force_no_sid ) $params['sid'] = $this->GetSID();
$url = $this->BuildEnv_NEW($t, $params, $pass, $pass_events);
$ret = $this->BaseURL($prefix, $ssl).$url.$map_link;
}
else
{
unset($params['pass_category']); // we don't need to pass it when mod_rewrite is off
$env = $this->BuildEnv($t, $params, $pass, $pass_events);
$ret = $this->BaseURL($prefix, $ssl).$index_file.'?'.$env.$map_link;
}
return $ret;
}
/**
* Returns variables with values that should be passed throught with this link + variable list
*
* @param Array $params
* @return Array
*/
function getPassThroughVariables(&$params)
{
static $cached_pass_through = null;
if (isset($params['no_pass_through']) && $params['no_pass_through']) {
unset($params['no_pass_through']);
return Array();
}
// because pass through is not changed during script run, then we can cache it
if (is_null($cached_pass_through)) {
$cached_pass_through = Array();
$pass_through = $this->Application->GetVar('pass_through');
if ($pass_through) {
// names of variables to pass to each link
$cached_pass_through['pass_through'] = $pass_through;
$pass_through = explode(',', $pass_through);
foreach ($pass_through as $pass_through_var) {
$cached_pass_through[$pass_through_var] = $this->Application->GetVar($pass_through_var);
}
}
}
return $cached_pass_through;
}
/**
* Returns sorted array of passed prefixes (to build url from)
*
* @param string $pass
* @return Array
*/
function getPassInfo($pass = 'all')
{
if (!$pass) $pass = 'all';
$pass = trim(
preg_replace(
'/(?<=,|\\A)all(?=,|\\z)/',
trim($this->GetVar('passed'), ','),
trim($pass, ',')
),
',');
if (!$pass) {
return Array();
}
$pass_info = array_unique( explode(',', $pass) ); // array( prefix[.special], prefix[.special] ...
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();
$ret = '';
if ($env_var) {
$ret = ENV_VAR_NAME.'=';
}
$ret .= $sid.(constOn('INPORTAL_ENV') ? '-' : ':');
$encode = false;
if (isset($params['__URLENCODE__'])) {
$encode = $params['__URLENCODE__'];
unset($params['__URLENCODE__']);
}
if (isset($params['__SSL__'])) {
unset($params['__SSL__']);
}
$env_string = '';
$category_id = isset($params['m_cat_id']) ? $params['m_cat_id'] : $this->GetVar('m_cat_id');
$item_id = 0;
$pass_info = $this->getPassInfo($pass);
if ($pass_info) {
if ($pass_info[0] == 'm') array_shift($pass_info);
foreach ($pass_info as $pass_element) {
list($prefix) = explode('.', $pass_element);
$require_rewrite = $this->findModule('Var', $prefix);
if ($require_rewrite) {
$item_id = isset($params[$pass_element.'_id']) ? $params[$pass_element.'_id'] : $this->GetVar($pass_element.'_id');
}
$env_string .= ':'.$this->BuildModuleEnv($pass_element, $params, $pass_events);
}
}
if (strtolower($t) == '__default__') {
// to put category & item templates into cache
$filename = $this->getFilename('c', $category_id);
if ($item_id) {
$mod_rw_helper =& $this->Application->recallObject('ModRewriteHelper');
$t = $mod_rw_helper->GetItemTemplate($category_id, $pass_element); // $pass_element should be the last processed element
// $t = $this->getCache('item_templates', $category_id);
}
elseif ($category_id) {
$t = $this->getCache('category_templates', $category_id);
}
else {
$t = 'index';
}
}
$ret .= $t.':'.$this->BuildModuleEnv('m', $params, $pass_events).$env_string;
unset($params['pass'], $params['opener'], $params['m_event']);
if ($this->GetVar('admin') && !isset($params['admin'])) {
$params['admin'] = 1;
}
if( 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();
-
// session expiration is called from session initialization,
// that's why $this->Session may be not defined here
$session =& $this->Application->recallObject('Session');
/* @var $session Session */
$session->SaveData();
exit;
}
function Phrase($label)
{
return $this->Phrases->GetPhrase($label);
}
/**
* Replace language tags in exclamation marks found in text
*
* @param string $text
* @param bool $force_escape force escaping, not escaping of resulting string
* @return string
* @access public
*/
function ReplaceLanguageTags($text, $force_escape=null)
{
// !!!!!!!!
// if( !is_object($this->Phrases) ) $this->Debugger->appendTrace();
return $this->Phrases->ReplaceLanguageTags($text,$force_escape);
}
/**
* Checks if user is logged in, and creates
* user object if so. User object can be recalled
* later using "u.current" prefix_special. Also you may
* get user id by getting "u.current_id" variable.
*
* @access private
*/
function ValidateLogin()
{
$session =& $this->recallObject('Session');
$user_id = $session->GetField('PortalUserId');
if (!$user_id && $user_id != -1) $user_id = -2;
$this->SetVar('u.current_id', $user_id);
if (!$this->IsAdmin()) {
// needed for "profile edit", "registration" forms ON FRONT ONLY
$this->SetVar('u_id', $user_id);
}
$this->StoreVar('user_id', $user_id);
if ($this->GetVar('expired') == 1) {
// this parameter is set only from admin
$user =& $this->recallObject('u.current');
$user->SetError('ValidateLogin', 'session_expired', 'la_text_sess_expired');
}
if (($user_id != -2) && constOn('DBG_REQUREST_LOG') ) {
$http_query =& $this->recallObject('HTTPQuery');
$http_query->writeRequestLog(DBG_REQUREST_LOG);
}
if ($user_id != -2) {
// normal users + root
$this->LoadPersistentVars();
}
}
/**
* Loads current user persistent session data
*
*/
function LoadPersistentVars()
{
$this->Session->LoadPersistentVars();
}
function LoadCache() {
$cache_key = $this->GetVar('t').$this->GetVar('m_theme').$this->GetVar('m_lang').$this->IsAdmin();
$query = sprintf("SELECT PhraseList, ConfigVariables FROM %s WHERE Template = %s",
TABLE_PREFIX.'PhraseCache',
$this->Conn->Qstr(md5($cache_key)));
$res = $this->Conn->GetRow($query);
if ($res) {
$this->Caches['PhraseList'] = $res['PhraseList'] ? explode(',', $res['PhraseList']) : array();
$config_ids = $res['ConfigVariables'] ? explode(',', $res['ConfigVariables']) : array();
if (isset($this->Caches['ConfigVariables'])) {
$config_ids = array_diff($config_ids, $this->Caches['ConfigVariables']);
}
}
else {
$config_ids = array();
}
$this->Caches['ConfigVariables'] = $config_ids;
$this->ConfigCacheIds = $config_ids;
}
function UpdateCache()
{
$update = false;
//something changed
$update = $update || $this->Phrases->NeedsCacheUpdate();
$update = $update || (count($this->ConfigCacheIds) && $this->ConfigCacheIds != $this->Caches['ConfigVariables']);
if ($update) {
$cache_key = $this->GetVar('t').$this->GetVar('m_theme').$this->GetVar('m_lang').$this->IsAdmin();
$query = sprintf("REPLACE %s (PhraseList, CacheDate, Template, ConfigVariables)
VALUES (%s, %s, %s, %s)",
TABLE_PREFIX.'PhraseCache',
$this->Conn->Qstr(join(',', $this->Phrases->Ids)),
adodb_mktime(),
$this->Conn->Qstr(md5($cache_key)),
$this->Conn->qstr(implode(',', array_unique($this->ConfigCacheIds))));
$this->Conn->Query($query);
}
}
function InitConfig()
{
if (isset($this->Caches['ConfigVariables']) && count($this->Caches['ConfigVariables']) > 0) {
$this->ConfigHash = array_merge($this->ConfigHash, $this->Conn->GetCol(
'SELECT VariableValue, VariableName FROM '.TABLE_PREFIX.'ConfigurationValues
WHERE VariableId IN ('.implode(',', $this->Caches['ConfigVariables']).')', 'VariableName'));
}
}
/**
* Returns configuration option value by name
*
* @param string $name
* @return string
*/
function ConfigValue($name)
{
$res = isset($this->ConfigHash[$name]) ? $this->ConfigHash[$name] : false;
if ($res !== false) return $res;
if (defined('IS_INSTALL') && IS_INSTALL && !$this->TableFound('ConfigurationValues')) {
return false;
}
-
$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->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 genealogical main prefix for subtable prefix passes
* OR prefix, that has been found in REQUEST and some how is parent of passed subtable prefix
*
* @param string $current_prefix
* @param string $real_top if set to true will return real topmost prefix, regardless of its id is passed or not
* @return string
* @access public
* @author Kostja / Alex
*/
function GetTopmostPrefix($current_prefix, $real_top=false)
{
// 1. get genealogical tree of $current_prefix
$prefixes = Array ($current_prefix);
while ( $parent_prefix = $this->getUnitOption($current_prefix, 'ParentPrefix') ) {
$current_prefix = $parent_prefix;
array_unshift($prefixes, $current_prefix);
}
if ($real_top) return $current_prefix;
// 2. find what if parent is passed
$passed = explode(',', $this->GetVar('all_passed'));
foreach ($prefixes as $a_prefix) {
if (in_array($a_prefix, $passed)) {
return $a_prefix;
}
}
return $current_prefix;
}
/**
* Triggers email event of type Admin
*
* @param string $email_event_name
* @param int $to_user_id
* @param array $send_params associative array of direct send params, possible keys: to_email, to_name, from_email, from_name, message, message_text
* @return unknown
*/
function &EmailEventAdmin($email_event_name, $to_user_id = -1, $send_params = false)
{
$event =& $this->EmailEvent($email_event_name, 1, $to_user_id, $send_params);
return $event;
}
/**
* Triggers email event of type User
*
* @param string $email_event_name
* @param int $to_user_id
* @param array $send_params associative array of direct send params, possible keys: to_email, to_name, from_email, from_name, message, message_text
* @return unknown
*/
function &EmailEventUser($email_event_name, $to_user_id = -1, $send_params = false)
{
$event =& $this->EmailEvent($email_event_name, 0, $to_user_id, $send_params);
return $event;
}
/**
* Triggers general email event
*
* @param string $email_event_name
* @param int $email_event_type ( 0 for User, 1 for Admin)
* @param int $to_user_id
* @param array $send_params associative array of direct send params,
* possible keys: to_email, to_name, from_email, from_name, message, message_text
* @return unknown
*/
function &EmailEvent($email_event_name, $email_event_type, $to_user_id = -1, $send_params = false)
{
$params = array(
'EmailEventName' => $email_event_name,
'EmailEventToUserId' => $to_user_id,
'EmailEventType' => $email_event_type,
);
if ($send_params) {
$params['DirectSendParams'] = $send_params;
}
$event_str = isset($send_params['use_special']) ? 'emailevents.'.$send_params['use_special'].':OnEmailEvent' : 'emailevents:OnEmailEvent';
$this->HandleEvent($event, $event_str, $params);
return $event;
}
/**
* Allows to check if user in this session is logged in or not
*
* @return bool
*/
function LoggedIn()
{
return $this->Session->LoggedIn();
+
}
/**
* Check current user permissions based on it's group permissions in specified category
*
* @param string $name permission name
* @param int $cat_id category id, current used if not specified
* @param int $type permission type {1 - system, 0 - per category}
* @return int
*/
function CheckPermission($name, $type = 1, $cat_id = null)
{
$perm_helper =& $this->recallObject('PermissionsHelper');
return $perm_helper->CheckPermission($name, $type, $cat_id);
}
/**
* Set's any field of current visit
*
* @param string $field
* @param mixed $value
*/
function setVisitField($field, $value)
{
$visit =& $this->recallObject('visits');
$visit->SetDBField($field, $value);
$visit->Update();
}
/**
* Allows to check if in-portal is installed
*
* @return bool
*/
function isInstalled()
{
return $this->InitDone && (count($this->ModuleInfo) > 0);
}
/**
* Allows to determine if module is installed & enabled
*
* @param string $module_name
* @return bool
*/
function isModuleEnabled($module_name)
{
return $this->findModule('Name', $module_name) !== false;
}
function reportError($class, $method)
{
$this->Debugger->appendTrace();
trigger_error('depricated method <b>'.$class.'->'.$method.'(...)</b>', E_USER_ERROR);
}
/**
* Returns Window ID of passed prefix main prefix (in edit mode)
*
* @param string $prefix
* @return mixed
*/
function GetTopmostWid($prefix)
{
$top_prefix = $this->GetTopmostPrefix($prefix);
$mode = $this->GetVar($top_prefix.'_mode');
return $mode != '' ? substr($mode, 1) : '';
}
/**
* Get temp table name
*
* @param string $table
* @param mixed $wid
* @return string
*/
function GetTempName($table, $wid = '')
{
if (preg_match('/prefix:(.*)/', $wid, $regs)) {
$wid = $this->GetTopmostWid($regs[1]);
}
return TABLE_PREFIX.'ses_'.$this->GetSID().($wid ? '_'.$wid : '').'_edit_'.$table;
}
function GetTempTablePrefix($wid = '')
{
if (preg_match('/prefix:(.*)/', $wid, $regs)) {
$wid = $this->GetTopmostWid($regs[1]);
}
return TABLE_PREFIX.'ses_'.$this->GetSID().($wid ? '_'.$wid : '').'_edit_';
}
function IsTempTable($table)
{
return preg_match('/'.TABLE_PREFIX.'ses_'.$this->GetSID().'(_[\d]+){0,1}_edit_(.*)/',$table);
}
/**
* Return live table name based on temp table name
*
* @param string $temp_table
* @return string
*/
function GetLiveName($temp_table)
{
if( preg_match('/'.TABLE_PREFIX.'ses_'.$this->GetSID().'(_[\d]+){0,1}_edit_(.*)/',$temp_table, $rets) )
{
// cut wid from table end if any
return $rets[2];
}
else
{
return $temp_table;
}
}
function CheckProcessors($processors)
{
foreach ($processors as $a_processor)
{
if (!isset($this->CachedProcessors[$a_processor])) {
$this->CachedProcessors[$a_processor] =& $this->recallObject($a_processor.'_TagProcessor');
}
}
}
function TimeZoneAdjustment($time_zone = null)
{
if ($time_zone == 'GMT') {
return (-1) * adodb_date('Z');
}
$target_zone = isset($time_zone) ? $time_zone : $this->ConfigValue('Config_Site_Time');
return 3600 * ($target_zone - $this->ConfigValue('Config_Server_Time'));
}
function ApplicationDie($message = '')
{
$message = ob_get_clean().$message;
if ($this->isDebugMode()) {
$message .= $this->Debugger->printReport(true);
}
echo $this->UseOutputCompression() ? gzencode($message, DBG_COMPRESSION_LEVEL) : $message;
exit;
}
/* moved from MyApplication */
function getUserGroups($user_id)
{
switch($user_id)
{
case -1:
$user_groups = $this->ConfigValue('User_LoggedInGroup');
break;
case -2:
$user_groups = $this->ConfigValue('User_LoggedInGroup');
$user_groups .= ','.$this->ConfigValue('User_GuestGroup');
break;
default:
$sql = 'SELECT GroupId FROM '.TABLE_PREFIX.'UserGroup WHERE PortalUserId = '.$user_id;
$res = $this->Conn->GetCol($sql);
$user_groups = Array( $this->ConfigValue('User_LoggedInGroup') );
if(is_array($res))
{
$user_groups = array_merge($user_groups, $res);
}
$user_groups = implode(',', $user_groups);
}
return $user_groups;
}
/**
* Allows to detect if page is browsed by spider (293 agents supported)
*
* @return bool
*/
function IsSpider()
{
static $is_spider = null;
if (!isset($is_spider)) {
$user_agent = trim($_SERVER['HTTP_USER_AGENT']);
$robots = file(FULL_PATH.'/core/robots_list.txt');
foreach ($robots as $robot_info) {
$robot_info = explode("\t", $robot_info, 3);
if ($user_agent == trim($robot_info[2])) {
$is_spider = true;
break;
}
}
}
return $is_spider;
}
/**
* Allows to detect table's presense in database
*
* @param string $table_name
* @return bool
*/
function TableFound($table_name)
{
return $this->Conn->TableFound($table_name);
}
/**
* Returns counter value
*
* @param string $name counter name
* @param Array $params counter parameters
* @param string $query_name specify query name directly (don't generate from parmeters)
* @param bool $multiple_results
* @return mixed
*/
function getCounter($name, $params = Array (), $query_name = null, $multiple_results = false)
{
$count_helper =& $this->Application->recallObject('CountHelper');
/* @var $count_helper kCountHelper */
return $count_helper->getCounter($name, $params, $query_name, $multiple_results);
}
/**
* Resets counter, whitch are affected by one of specified tables
*
* @param string $tables comma separated tables list used in counting sqls
*/
function resetCounters($tables)
{
$count_helper =& $this->Application->recallObject('CountHelper');
/* @var $count_helper kCountHelper */
return $count_helper->resetCounters($tables);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/application.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.177
\ No newline at end of property
+1.178
\ No newline at end of property
Index: trunk/core/units/categories/categories_event_handler.php
===================================================================
--- trunk/core/units/categories/categories_event_handler.php (revision 8103)
+++ trunk/core/units/categories/categories_event_handler.php (revision 8104)
@@ -1,565 +1,611 @@
<?php
class CategoriesEventHandler extends kDBEventHandler {
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnRebuildCache' => Array('self' => 'add|edit'),
'OnPasteClipboard' => Array('self' => 'add|edit'),
'OnPaste' => array('self'=>'add|edit', 'subitem' => 'edit'),
// 'OnSave' => Array('self' => 'add|edit')
);
$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 == 'OnEdit' || $event->Name == 'OnSave') {
// check each id from selected individually and only if all are allowed proceed next
if ($event->Name == 'OnEdit') {
$selected_ids = implode(',', $this->StoreSelectedIDs($event));
}
else {
$selected_ids = implode(',', $this->getSelectedIDs($event, true));
}
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
if (strlen($selected_ids) > 0) {
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'SELECT '.$id_field.', CreatedById
FROM '.$table_name.' item_table
WHERE '.$id_field.' IN ('.$selected_ids.')';
$items = $this->Conn->Query($sql, $id_field);
}
else {
// when creating new category, then no IDs are stored in session
$parent_cat = $this->Application->RecallVar('m_cat_id');
$items[$parent_cat] = Array (
$id_field => $parent_cat,
'CreatedById' => $this->Application->RecallVar('user_id'),
);
}
$perm_value = true;
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
foreach ($items as $item_id => $item_data) {
if ($perm_helper->ModifyCheckPermission($item_data['CreatedById'], $item_data[$id_field], $event->Prefix) == 0) {
// one of items selected has no permission
$perm_value = false;
break;
}
}
if (!$perm_value) {
$event->status = erPERM_FAIL;
}
return $perm_value;
}
return parent::CheckPermission($event);
}
/**
+ * Set's mark, that root category is edited
+ *
+ * @param kEvent $event
+ */
+ function OnEdit(&$event)
+ {
+ $category_id = $this->Application->GetVar($event->getPrefixSpecial().'_id');
+ $this->Application->StoreVar('IsRootCategory_'.$this->Application->GetVar('m_wid'), $category_id === '0');
+
+ parent::OnEdit($event);
+ }
+
+ /**
* Apply system filter to categories list
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
parent::SetCustomQuery($event);
$types=$event->getEventParam('types');
$except_types=$event->getEventParam('except');
$object =& $event->getObject();
$type_clauses = Array();
$object =& $event->getObject();
/* @var $object kDBList */
// hide categories with status = 4 (system categories)
$object->addFilter('system_categories', '%1$s.Status <> 4');
if ($event->getEventParam('parent_cat_id') !== false) {
$parent_cat_id = $event->getEventParam('parent_cat_id');
if ($parent_cat_id == 'Root') {
$module_name = $event->getEventParam('module') ? $event->getEventParam('module') : 'In-Commerce';
$module =& $this->Application->recallObject('mod.'.$module_name);
$parent_cat_id = $module->GetDBField('RootCat');
}
}
else {
$parent_cat_id = $this->Application->GetVar('c_id');
if (!$parent_cat_id) {
$parent_cat_id = $this->Application->GetVar('m_cat_id');
}
if (!$parent_cat_id) {
$parent_cat_id = 0;
}
}
if ("$parent_cat_id" != 'any') {
if ($event->getEventParam('recursive')) {
$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('parent_filter', 'ParentId IN ('.implode(', ', $subcats).')');
}
else {
$object->addFilter('parent_filter', 'ParentId = '.$parent_cat_id);
}
}
$object->addFilter('perm_filter', 'PermId = 1'); // check for CATEGORY.VIEW permission
if ($this->Application->RecallVar('user_id') != -1) {
// apply permission filters to all users except "root"
$groups = explode(',',$this->Application->RecallVar('UserGroups'));
foreach ($groups as $group) {
$view_filters[] = 'FIND_IN_SET('.$group.', acl)';
}
$view_filter = implode(' OR ', $view_filters);
$object->addFilter('perm_filter2', $view_filter);
}
if (!$this->Application->IsAdmin()) {
// apply status filter only on front
$object->addFilter('status_filter', $object->TableName.'.Status = 1');
}
if(strpos($types, 'category_related') !== false)
{
$object->removeFilter('parent_filter');
$resource_id = $this->Conn->GetOne('
SELECT ResourceId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
WHERE CategoryId = '.$parent_cat_id
);
$sql = 'SELECT DISTINCT(TargetId) FROM '.TABLE_PREFIX.'Relationship
WHERE SourceId = '.$resource_id.' AND SourceType = 1';
$related_cats = $this->Conn->GetCol($sql);
$related_cats = is_array($related_cats) ? $related_cats : Array();
$sql = 'SELECT DISTINCT(SourceId) FROM '.TABLE_PREFIX.'Relationship
WHERE TargetId = '.$resource_id.' AND TargetType = 1 AND Type = 1';
$related_cats2 = $this->Conn->GetCol($sql);
$related_cats2 = is_array($related_cats2) ? $related_cats2 : Array();
$related_cats = array_unique( array_merge( $related_cats2, $related_cats ) );
if($related_cats)
{
$type_clauses['category_related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_cats).')';
$type_clauses['category_related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_cats).')';
}
else
{
$type_clauses['category_related']['include'] = '0';
$type_clauses['category_related']['except'] = '1';
}
$type_clauses['category_related']['having_filter'] = false;
}
if(strpos($types, 'product_related') !== false)
{
$object->removeFilter('parent_filter');
$product_id = $event->getEventParam('product_id') ? $event->getEventParam('product_id') : $this->Application->GetVar('p_id');
$resource_id = $this->Conn->GetOne('
SELECT ResourceId FROM '.$this->Application->getUnitOption('p', 'TableName').'
WHERE ProductId = '.$product_id
);
$sql = 'SELECT DISTINCT(TargetId) FROM '.TABLE_PREFIX.'Relationship
WHERE SourceId = '.$resource_id.' AND TargetType = 1';
$related_cats = $this->Conn->GetCol($sql);
$related_cats = is_array($related_cats) ? $related_cats : Array();
$sql = 'SELECT DISTINCT(SourceId) FROM '.TABLE_PREFIX.'Relationship
WHERE TargetId = '.$resource_id.' AND SourceType = 1 AND Type = 1';
$related_cats2 = $this->Conn->GetCol($sql);
$related_cats2 = is_array($related_cats2) ? $related_cats2 : Array();
$related_cats = array_unique( array_merge( $related_cats2, $related_cats ) );
if($related_cats)
{
$type_clauses['product_related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_cats).')';
$type_clauses['product_related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_cats).')';
}
else
{
$type_clauses['product_related']['include'] = '0';
$type_clauses['product_related']['except'] = '1';
}
$type_clauses['product_related']['having_filter'] = false;
}
/********************************************/
$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']);
}
}
}
}
$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);
}
/**
* Enter description here...
*
* @param kEvent $event
* @return int
*/
function GetPassedId(&$event)
{
if ( $this->Application->IsAdmin()) {
return parent::getPassedID($event);
}
return $this->Application->GetVar('m_cat_id');
}
function ParentGetPassedId(&$event)
{
return parent::GetPassedId($event);
}
/**
* Adds calculates fields for item statuses
*
* @param kCatDBItem $object
* @param kEvent $event
*/
function prepareObject(&$object, &$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->addCalculatedField(
'IsNew',
' IF(%1$s.NewItem = 2,
IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - '.
$this->Application->ConfigValue('Category_DaysNew').
'*3600*24), 1, 0),
%1$s.NewItem
)');
}
/**
* Set correct parent path for newly created categories
*
* @param kEvent $event
*/
function OnAfterCopyToLive(&$event)
{
$parent_path = false;
$object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true, 'live_table' => true));
$object->Load($event->getEventParam('id'));
if ($event->getEventParam('temp_id') == 0) {
if ($object->isLoaded()) {
// update path only for real categories (not including "Home" root category)
$fields_hash = Array('ParentPath' => $object->buildParentPath());
$this->Conn->doUpdate($fields_hash, $object->TableName, 'CategoryId = '.$object->GetID());
$parent_path = $fields_hash['ParentPath'];
}
}
else {
$parent_path = $object->GetDBField('ParentPath');
}
if ($parent_path) {
$cache_updater =& $this->Application->recallObject('kPermCacheUpdater', null, array('strict_path' => $parent_path));
$cache_updater->OneStepRun();
$cache_updater->StrictPath = false;
}
}
/**
* Set cache modification mark if needed
*
* @param kEvent $event
*/
function OnBeforeDeleteFromLive(&$event)
{
$id = $event->getEventParam('id');
// loding anyway, because this object is needed by "c-perm:OnBeforeDeleteFromLive" event
$temp_object =& $event->getObject( Array('skip_autoload' => true) );
$temp_object->Load($id);
if ($id == 0) {
if ($temp_object->isLoaded()) {
// new category -> update cache (not loaded when "Home" category)
$this->Application->StoreVar('PermCache_UpdateRequired', 1);
}
return ;
}
// existing category was edited, check if in-cache fields are modified
$live_object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('live_table' => true, 'skip_autoload' => true));
$live_object->Load($id);
$cached_fields = Array('Name', 'Filename', 'CategoryTemplate', 'ParentId', 'Priority');
foreach ($cached_fields as $cached_field) {
if ($live_object->GetDBField($cached_field) != $temp_object->GetDBField($cached_field)) {
// use session instead of REQUEST because of permission editing in category can contain
// multiple submits, that changes data before OnSave event occurs
$this->Application->StoreVar('PermCache_UpdateRequired', 1);
break;
}
}
}
/**
* Calls kDBEventHandler::OnSave original event
* Used in proj-cms:StructureEventHandler->OnSave
*
* @param kEvent $event
*/
function parentOnSave(&$event)
{
parent::OnSave($event);
}
/**
+ * Reset root-category flag when new category is created
+ *
+ * @param kEvent $event
+ */
+ function OnPreCreate(&$event)
+ {
+ $this->Application->RemoveVar('IsRootCategory_'.$this->Application->GetVar('m_wid'));
+
+ parent::OnPreCreate($event);
+ }
+
+ /**
* Checks cache update mark and redirect to cache if needed
*
* @param kEvent $event
*/
function OnSave(&$event)
{
$object =& $event->getObject();
if ($object->IsRoot()) {
$event->setEventParam('master_ids', Array(0));
+ $this->RemoveRequiredFields($object);
}
parent::OnSave($event);
if ($event->status == erSUCCESS && $this->Application->RecallVar('PermCache_UpdateRequired')) {
// "catalog" should be in opener stack by now
$wid = $this->Application->GetVar('m_wid');
$stack_name = rtrim('opener_stack_'.$wid, '_');
-
+ $this->Application->RemoveVar('IsRootCategory_'.$wid);
+
$opener_stack = unserialize($this->Application->RecallVar($stack_name));
$opener_stack[0] = str_replace('catalog', 'categories/cache_updater', $opener_stack[0]);
$this->Application->StoreVar($stack_name, serialize($opener_stack));
$this->Application->RemoveVar('PermCache_UpdateRequired');
}
}
/**
+ * Creates a new item in temp table and
+ * stores item id in App vars and Session on succsess
+ *
+ * @param kEvent $event
+ */
+ function OnPreSaveCreated(&$event)
+ {
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ /* @var $object CategoriesItem */
+
+ if ($object->IsRoot()) {
+ // don't create root category while saving permissions
+ return ;
+ }
+
+ parent::OnPreSaveCreated($event);
+ }
+
+ /**
* Deletes all selected items.
* Automatically recurse into sub-items using temp handler, and deletes sub-items
* by calling its Delete method if sub-item has AutoDelete set to true in its config file
*
* @param kEvent $event
*/
function OnMassDelete(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
// $event->status = erSUCCESS;
$ids = $this->StoreSelectedIDs($event);
if ($ids) {
$recursive_helper =& $this->Application->recallObject('RecursiveHelper');
/* @var $recursive_helper kRecursiveHelper */
foreach ($ids as $id) {
$recursive_helper->DeleteCategory($id, $event->Prefix);
}
}
$this->clearSelectedIDs($event);
}
/**
* Add selected items to clipboard with mode = COPY (CLONE)
*
* @param kEvent $event
*/
function OnCopy(&$event)
{
$this->Application->RemoveVar('clipboard');
$clipboard_helper =& $this->Application->recallObject('ClipboardHelper');
$clipboard_helper->setClipboard($event, 'copy', $this->StoreSelectedIDs($event));
$this->clearSelectedIDs($event);
}
/**
* Add selected items to clipboard with mode = CUT
*
* @param kEvent $event
*/
function OnCut(&$event)
{
$this->Application->RemoveVar('clipboard');
$clipboard_helper =& $this->Application->recallObject('ClipboardHelper');
$clipboard_helper->setClipboard($event, 'cut', $this->StoreSelectedIDs($event));
$this->clearSelectedIDs($event);
}
/**
* Controls all item paste operations. Can occur only with filled clipbord.
*
* @param kEvent $event
*/
function OnPasteClipboard(&$event)
{
$clipboard = unserialize( $this->Application->RecallVar('clipboard') );
foreach ($clipboard as $prefix => $clipboard_data) {
$paste_event = new kEvent($prefix.':OnPaste', Array('clipboard_data' => $clipboard_data));
$this->Application->HandleEvent($paste_event);
$event->redirect = $paste_event->redirect;
$event->redirect_params = $paste_event->redirect_params;
$event->status = $paste_event->status;
}
}
/**
* Paste categories with subitems from clipboard
*
* @param kEvent $event
*/
function OnPaste(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$clipboard_data = $event->getEventParam('clipboard_data');
if (!$clipboard_data['cut'] && !$clipboard_data['copy']) {
return false;
}
$recursive_helper =& $this->Application->recallObject('RecursiveHelper');
/* @var $recursive_helper kRecursiveHelper */
if ($clipboard_data['cut']) {
$recursive_helper->MoveCategories($clipboard_data['cut'], $this->Application->GetVar('m_cat_id'));
}
if ($clipboard_data['copy']) {
foreach ($clipboard_data['copy'] as $id) {
$recursive_helper->PasteCategory($id, $event->Prefix);
}
}
if ($clipboard_data['cut'] || $clipboard_data['copy']) {
$event->redirect = 'in-portal/categories/cache_updater';
}
}
/**
* Occurs when pasting category
*
* @param kEvent $event
*/
/*function OnCatPaste(&$event)
{
$inp_clipboard = $this->Application->RecallVar('ClipBoard');
$inp_clipboard = explode('-', $inp_clipboard, 2);
if($inp_clipboard[0] == 'COPY')
{
$saved_cat_id = $this->Application->GetVar('m_cat_id');
$cat_ids = $event->getEventParam('cat_ids');
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table = $this->Application->getUnitOption($event->Prefix, 'TableName');
$ids_sql = 'SELECT '.$id_field.' FROM '.$table.' WHERE ResourceId IN (%s)';
$resource_ids_sql = 'SELECT ItemResourceId FROM '.TABLE_PREFIX.'CategoryItems WHERE CategoryId = %s AND PrimaryCat = 1';
$object =& $this->Application->recallObject($event->Prefix.'.item', $event->Prefix, Array('skip_autoload' => true));
foreach($cat_ids as $source_cat => $dest_cat)
{
$item_resource_ids = $this->Conn->GetCol( sprintf($resource_ids_sql, $source_cat) );
if(!$item_resource_ids) continue;
$this->Application->SetVar('m_cat_id', $dest_cat);
$item_ids = $this->Conn->GetCol( sprintf($ids_sql, implode(',', $item_resource_ids) ) );
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
if($item_ids) $temp->CloneItems($event->Prefix, $event->Special, $item_ids);
}
$this->Application->SetVar('m_cat_id', $saved_cat_id);
}
}*/
/**
* Cleares clipboard content
*
* @param kEvent $event
*/
function OnClearClipboard(&$event)
{
$this->Application->RemoveVar('clipboard');
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/categories/categories_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.28
\ No newline at end of property
+1.29
\ No newline at end of property
Index: trunk/core/units/categories/categories_item.php
===================================================================
--- trunk/core/units/categories/categories_item.php (revision 8103)
+++ trunk/core/units/categories/categories_item.php (revision 8104)
@@ -1,234 +1,224 @@
<?php
class CategoriesItem extends kDBItem
{
function Create($force_id=false, $system_create=false)
{
$this->checkFilename();
$this->generateFilename();
if (!$this->Validate()) return false;
$this->SetDBField('ResourceId', $this->Application->NextResourceId());
$this->SetDBField('CreatedById', $this->Application->RecallVar('user_id') );
$this->SetDBField('CreatedOn_date', adodb_mktime() );
$this->SetDBField('CreatedOn_time', adodb_mktime() );
$parent_category = $this->GetDBField('ParentId') > 0 ? $this->GetDBField('ParentId') : $this->Application->GetVar('m_cat_id');
$this->SetDBField('ParentId', $parent_category);
$ret = parent::Create($force_id, $system_create);
if ($ret) {
$sql = 'UPDATE %s SET ParentPath = %s WHERE CategoryId = %s';
$parent_path = $this->buildParentPath();
$this->Conn->Query( sprintf($sql, $this->TableName, $this->Conn->qstr($parent_path), $this->GetID() ) );
$this->SetDBField('ParentPath', $parent_path);
}
return $ret;
}
function Update($id=null, $system_update=false)
{
$this->checkFilename();
$this->generateFilename();
$ret = parent::Update($id, $system_update);
return $ret;
}
function buildParentPath()
{
$parent_id = $this->GetDBField('ParentId');
if ($parent_id == 0) {
$parent_path = '|';
}
else {
$cat_table = $this->Application->getUnitOption($this->Prefix, 'TableName');
$sql = 'SELECT ParentPath FROM '.$cat_table.' WHERE CategoryId = %s';
$parent_path = $this->Conn->GetOne( sprintf($sql, $parent_id) );
}
return $parent_path.$this->GetID().'|';
}
/**
* replace not allowed symbols with "_" chars + remove duplicate "_" chars in result
*
* @param string $string
* @return string
*/
function stripDisallowed($string)
{
$not_allowed = Array( ' ', '\\', '/', ':', '*', '?', '"', '<', '>', '|', '`',
'~', '!', '@', '#', '$', '%', '^', '&', '(', ')', '~',
'+', '=', '-', '{', '}', ']', '[', "'", ';', '.', ',');
$string = str_replace($not_allowed, '_', $string);
$string = preg_replace('/(_+)/', '_', $string);
$string = $this->checkAutoFilename($string);
return $string;
}
function checkFilename()
{
// System templates allow any characters in filename, because they may and will contain "/"
if( !$this->GetDBField('AutomaticFilename') && !$this->GetDBField('IsSystem'))
{
$filename = $this->GetDBField('Filename');
$this->SetDBField('Filename', $this->stripDisallowed($filename) );
}
}
function checkAutoFilename($filename)
{
if(!$filename) return $filename;
$item_id = !$this->GetID() ? 0 : $this->GetID();
// check temp table
$sql_temp = 'SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE Filename = '.$this->Conn->qstr($filename);
$found_temp_ids = $this->Conn->GetCol($sql_temp);
// check live table
$sql_live = 'SELECT '.$this->IDField.' FROM '.$this->Application->GetLiveName($this->TableName).' WHERE Filename = '.$this->Conn->qstr($filename);
$found_live_ids = $this->Conn->GetCol($sql_live);
$found_item_ids = array_unique( array_merge($found_temp_ids, $found_live_ids) );
$has_page = preg_match('/(.*)_([\d]+)([a-z]*)$/', $filename, $rets);
$duplicates_found = (count($found_item_ids) > 1) || ($found_item_ids && $found_item_ids[0] != $item_id);
if ($duplicates_found || $has_page) // other category has same filename as ours OR we have filename, that ends with _number
{
$append = $duplicates_found ? '_a' : '';
if($has_page)
{
$filename = $rets[1].'_'.$rets[2];
$append = $rets[3] ? $rets[3] : '_a';
}
// check live & temp table
$sql_temp = 'SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE (Filename = %s) AND ('.$this->IDField.' != '.$item_id.')';
$sql_live = 'SELECT '.$this->IDField.' FROM '.$this->Application->GetLiveName($this->TableName).' WHERE (Filename = %s) AND ('.$this->IDField.' != '.$item_id.')';
while ( $this->Conn->GetOne( sprintf($sql_temp, $this->Conn->qstr($filename.$append)) ) > 0 ||
$this->Conn->GetOne( sprintf($sql_live, $this->Conn->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;
}
/**
* Generate item's filename based on it's title field value
*
* @return string
*/
function generateFilename()
{
if ( !$this->GetDBField('AutomaticFilename') && $this->GetDBField('Filename') ) return false;
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$name = $this->stripDisallowed( $this->GetDBField( $ml_formatter->LangFieldName('Name', true) ) );
if ( $name != $this->GetDBField('Filename') ) $this->SetDBField('Filename', $name);
}
/**
* Allows to detect if root category being edited
*
* @param Array $params
*/
function IsRoot()
{
- $category_id = $this->Application->GetVar($this->getPrefixSpecial().'_id');
- if (is_numeric($category_id) && $category_id == 0 && !$this->Application->GetVar($this->getPrefixSpecial().'_PreCreate')) {
- $sql = 'SELECT '.$this->IDField.'
- FROM '.$this->TableName.'
- WHERE '.$this->IDField.' = '.$category_id;
- if ($this->Conn->GetOne($sql) === false) {
- return true;
- }
- }
-
- return false;
+ return $this->Application->RecallVar('IsRootCategory_'.$this->Application->GetVar('m_wid'));
}
/**
* Sets correct name to Home category while editing it
*
* @return bool
*/
function IsNewItem()
{
if ($this->IsRoot() && $this->Prefix == 'c') {
$title_field = $this->Application->getUnitOption($this->Prefix, 'TitleField');
$category_name = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') );
$this->SetDBField($title_field, $category_name);
return false;
}
return parent::IsNewItem();
}
/**
* Sets new name for item in case if it is beeing copied
* in same table
*
* @param array $master Table data from TempHandler
* @param int $foreign_key ForeignKey value to filter name check query by
* @access private
*/
function NameCopy($master=null, $foreign_key=null)
{
$title_field = $this->Application->getUnitOption($this->Prefix, 'TitleField');
if (!$title_field || isset($this->CalculatedFields[$title_field]) ) return;
$new_name = $this->GetDBField($title_field);
$cat_id = $this->Application->GetVar('m_cat_id');
$this->SetDBField('ParentId', $cat_id);
$original_checked = false;
do {
if ( preg_match('/Copy ([0-9]*) *of (.*)/', $new_name, $regs) ) {
$new_name = 'Copy '.($regs[1]+1).' of '.$regs[2];
}
elseif ($original_checked) {
$new_name = 'Copy of '.$new_name;
}
// if we are cloning in temp table this will look for names in temp table,
// since object' TableName contains correct TableName (for temp also!)
// if we are cloning live - look in live
$query = 'SELECT '.$title_field.' FROM '.$this->TableName.'
WHERE ParentId = '.$cat_id.' AND '.$title_field.' = '.$this->Conn->qstr($new_name);
$foreign_key_field = getArrayValue($master, 'ForeignKey');
$foreign_key_field = is_array($foreign_key_field) ? $foreign_key_field[ $master['ParentPrefix'] ] : $foreign_key_field;
if ($foreign_key_field && isset($foreign_key)) {
$query .= ' AND '.$foreign_key_field.' = '.$foreign_key;
}
$res = $this->Conn->GetOne($query);
/*// if not found in live table, check in temp table if applicable
if ($res === false && $object->Special == 'temp') {
$query = 'SELECT '.$name_field.' FROM '.$this->GetTempName($master['TableName']).'
WHERE '.$name_field.' = '.$this->Conn->qstr($new_name);
$res = $this->Conn->GetOne($query);
}*/
$original_checked = true;
} while ($res !== false);
$this->SetDBField($title_field, $new_name);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/categories/categories_item.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.13
\ No newline at end of property
+1.14
\ No newline at end of property
Index: trunk/core/units/admin/admin_tag_processor.php
===================================================================
--- trunk/core/units/admin/admin_tag_processor.php (revision 8103)
+++ trunk/core/units/admin/admin_tag_processor.php (revision 8104)
@@ -1,724 +1,730 @@
<?php
class AdminTagProcessor extends kDBTagProcessor {
function SetConst($params)
{
$name = $this->SelectParam($params, 'name,const');
safeDefine($name, $params['value']);
}
/**
* Allows to execute js script after the page is fully loaded
*
* @param Array $params
* @return string
*/
function AfterScript($params)
{
$after_script = $this->Application->GetVar('after_script');
if ($after_script) {
return '<script type="text/javascript">'.$after_script.'</script>';
}
return '';
}
/**
* Returns section title with #section# keyword replaced with current section
*
* @param Array $params
* @return string
*/
function GetSectionTitle($params)
{
$params['name'] = replaceModuleSection($params['phrase']);
return $this->Application->ProcessParsedTag('m', 'Phrase', $params);
}
/**
* Returns section icon with #section# keyword replaced with current section
*
* @param Array $params
* @return string
*/
function GetSectionIcon($params)
{
return replaceModuleSection($params['icon']);
}
/**
* Allows to detect if current template is one of listed ones
*
* @param Array $params
* @return int
*/
function TemplateMatches($params)
{
$templates = explode(',' ,$params['templates']);
$t = $this->Application->GetVar('t');
return in_array($t, $templates) ? 1 : 0;
}
/**
* Save return script in cases, when old sections are opened from new sections
*
* @param Array $params
*/
function SaveReturnScript($params)
{
// admin/save_redirect.php?do=
$url = str_replace($this->Application->BaseURL(), '', $this->Application->ProcessParsedTag('m', 'Link', $params) );
$url = explode('?', $url, 2);
$url = 'save_redirect.php?'.$url[1].'&do='.$url[0];
$this->Application->StoreVar('ReturnScript', $url);
}
/**
* Redirects to correct next import step template based on import script data
*
* @param Array $params
*/
function ImportRedirect($params)
{
$import_id = $this->Application->GetVar('import_id');
if ($import_id) {
// redirect forward to step3 (import parameters coosing)
$this->Application->StoreVar('ImportScriptID', $import_id);
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'ImportScripts
WHERE is_id = '.$import_id;
$db =& $this->Application->GetADODBConnection();
$is_params = $db->GetRow($sql);
if ($is_params['is_type'] == 'db') {
$this->Application->Redirect('', null, '', 'import/step3.php');
}
elseif ($is_params['is_type'] == 'csv') {
$module = strtolower($is_params['is_Module']);
$template = $module.'/import';
$module_info = $this->Application->findModule('Name', $module);
$item_prefix = $module_info['Var'];
$pass_params = Array('m_opener' => 'd', $item_prefix.'.import_id' => 0, $item_prefix.'.import_event' => 'OnNew', 'pass' => 'm,'.$item_prefix.'.import', 'm_cat_id' => $module_info['RootCat']);
$this->Application->Redirect($template, $pass_params);
}
}
else {
// redirect back to step2 (import type choosing)
$this->Application->Redirect('', null, '', 'import/step2.php');
}
}
/**
* Returns version of module by name
*
* @param Array $params
* @return string
*/
function ModuleVersion($params)
{
return $this->Application->findModule('Name', $params['module'], 'Version');
}
/**
* Used in table form section drawing
*
* @param Array $params
* @return string
*/
function DrawTree($params)
{
static $deep_level = 0;
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
$params['deep_level'] = $deep_level++;
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
if (!isset($section_data['children'])) {
return $ret;
}
+ $debug_mode = $this->Application->isDebugMode(); // caching for faster performance
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $section_name) {
+ $section_data =& $sections_helper->getSectionData($section_name);
+ if (!$debug_mode && isset($section_data['debug_only']) && $section_data['debug_only']) {
+ // don't show section for debug mode only without debug mode turned on
+ continue;
+ }
$params['section_name'] = $section_name;
$ret .= $this->DrawTree($params);
$deep_level--;
}
return $ret;
}
function SectionInfo($params)
{
$section = $params['section'];
if ($section == '#session#') {
$section = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
$section_data =& $sections_helper->getSectionData($section);
if (isset($params['parent']) && $params['parent']) {
do {
$section_data =& $sections_helper->getSectionData($section_data['parent']);
} while (isset($section_data['use_parent_header']) && $section_data['use_parent_header']);
}
$info = $params['info'];
switch ($info) {
case 'module_path':
if (isset($params['module']) && $params['module']) {
$module = $params['module'];
}
elseif (isset($section_data['icon_module'])) {
$module = $section_data['icon_module'];
}
else {
$module = '#session#';
}
$res = $this->ModulePath(array('module' => $module));
break;
default:
$res = $section_data[$info];
}
if ($info == 'label' || isset($params['as_label'])) {
$res = $this->Application->Phrase($res);
}
return $res;
}
function PrintSection($params)
{
$section_name = $params['section_name'];
if ($section_name == '#session#') {
$section_name = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
$section_data =& $sections_helper->getSectionData($section_name);
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
$params['section_name'] = $section_name;
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$ret = $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
return $ret;
}
/**
* Used in XML drawing for tree
*
* @param Array $params
* @return string
*/
function PrintSections($params)
{
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
if ($section_name == '#session#') {
$section_name = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
if (!isset($section_data['children'])) {
return '';
}
$debug_mode = $this->Application->isDebugMode();
$super_admin_mode = $this->Application->RecallVar('super_admin');
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $section_name) {
$params['section_name'] = $section_name;
$section_data =& $sections_helper->getSectionData($section_name);
if (isset($section_data['show_mode'])) {
$show_mode = $section_data['show_mode'];
// if super admin section -> show in super admin mode & debug mode
$show_section = (($show_mode & smSUPER_ADMIN) == smSUPER_ADMIN) && ($super_admin_mode || $debug_mode);
if (!$show_section) {
// if section is in debug mode only && debug mode -> show
$show_section = (($show_mode & smDEBUG) == smDEBUG) && $debug_mode;
}
if (!$show_section) {
continue;
}
}
if (isset($section_data['tabs_only']) && $section_data['tabs_only']) {
$perm_status = false;
$folder_label = $section_data['label'];
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $priority => $section_name) {
// if only tabs in this section & none of them have permission, then skip section too
$section_data =& $sections_helper->getSectionData($section_name);
if ($section_data && isset($section_data['perm_prefix'])) {
// this section uses other section permissions
$section_name = $this->Application->getUnitOption($section_data['perm_prefix'].'.main', 'PermSection');
}
$perm_status = $this->Application->CheckPermission($section_name.'.view', 1);
if ($perm_status) {
break;
}
}
if (!$perm_status) {
// no permission for all tabs -> don't display tree node either
continue;
}
$params['section_name'] = $section_name;
$section_data =& $sections_helper->getSectionData($section_name);
$section_data['label'] = $folder_label; // use folder label in tree
$section_data['is_tab'] = 1;
}
else {
if ($section_data && isset($section_data['perm_prefix'])) {
// this section uses other section permissions
$section_name = $this->Application->getUnitOption($section_data['perm_prefix'].'.main', 'PermSection');
}
if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue;
}
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$late_load = getArrayValue($section_data, 'late_load');
if ($late_load) {
$t = $late_load['t'];
unset($late_load['t']);
$section_data['late_load'] = $this->Application->HREF($t, '', $late_load);
$params['children_count'] = 99;
}
else {
$section_data['late_load'] = '';
}
$ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
$params['section_name'] = $section_name;
}
return preg_replace("/\r\n|\n/", '', $ret);
}
function ListSectionPermissions($params)
{
$section_name = isset($params['section_name']) ? $params['section_name'] : $this->Application->GetVar('section_name');
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$block_params = array_merge_recursive2($section_data, Array('name' => $params['render_as'], 'section_name' => $section_name));
$ret = '';
foreach ($section_data['permissions'] as $perm_name) {
if (preg_match('/^advanced:(.*)/', $perm_name) != $params['type']) continue;
$block_params['perm_name'] = $perm_name;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
function ModuleInclude($params)
{
foreach ($params as $param_name => $param_value) {
$params[$param_name] = replaceModuleSection($param_value);
}
return $this->Application->ProcessParsedTag('m', 'ModuleInclude', $params);
}
function TodayDate($params)
{
return date($params['format']);
}
function TreeEditWarrning($params)
{
$ret = $this->Application->Phrase($params['label']);
$ret = str_replace(Array('&lt;', '&gt;', 'br/', 'br /', "\n", "\r"), Array('<', '>', 'br', 'br', '', ''), $ret);
if (getArrayValue($params, 'escape')) {
$ret = addslashes($ret);
}
$ret = str_replace('<br>', '\n', $ret);
return $ret;
}
/**
* Draws section tabs using block name passed
*
* @param Array $params
*/
function ListTabs($params)
{
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($params['section_name']);
$ret = '';
$block_params = Array('name' => $params['render_as']);
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $priority => $section_name) {
if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue;
$tab_data =& $sections_helper->getSectionData($section_name);
$block_params['t'] = $tab_data['url']['t'];
$block_params['title'] = $tab_data['label'];
$block_params['main_prefix'] = $section_data['SectionPrefix'];
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
/**
* Returns list of module item tabs that have view permission in current category
*
* @param Array $params
*/
function ListCatalogTabs($params)
{
$ret = '';
$special = isset($params['special']) ? $params['special'] : '';
$replace_main = isset($params['replace_m']) && $params['replace_m'];
$skip_prefixes = isset($params['skip_prefixes']) ? explode(',', $params['skip_prefixes']) : Array();
$block_params = Array('name' => $params['render_as']);
foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
$prefix = $module_info['Var'];
if (in_array($prefix, $skip_prefixes) || !$this->Application->prefixRegistred($prefix) || !$this->Application->getUnitOption($prefix, 'CatalogItem')) continue;
if ($prefix == 'm' && $replace_main) $prefix = 'c';
$label = $this->Application->getUnitOption($prefix, $params['title_property']);
$block_params['title'] = $label;
$block_params['prefix'] = $prefix;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
function FCKEditor($params)
{
if (file_exists(FULL_PATH.'/core/cmseditor/fckeditor.php')) {
$editor_path = 'core/cmseditor/';
}
else {
$editor_path = 'admin/editor/cmseditor/';
}
include_once(FULL_PATH.'/'.$editor_path.'/fckeditor.php');
$oFCKeditor = new FCKeditor($params['name']);
$oFCKeditor->BasePath = BASE_PATH.'/'.$editor_path;
$oFCKeditor->Width = $params['width'] ;
$oFCKeditor->Height = $params['height'] ;
$oFCKeditor->ToolbarSet = 'Advanced' ;
$oFCKeditor->Value = '' ;
$oFCKeditor->Config = Array(
// 'UserFilesPath' => FULL_PATH.'/kernel/user_files',
'ProjectPath' => BASE_PATH.'/',
'CustomConfigurationsPath' => $this->Application->isModuleEnabled('In-Portal') ? $this->Application->BaseURL().'kernel/admin_templates/incs/inp_fckconfig.js' : $this->Application->BaseURL().$editor_path.'fckconfig.js',
// 'EditorAreaCSS' => $this->Application->BaseURL().'/themes/inportal_site/inc/inportal.css', //GetThemeCSS(),
//'StylesXmlPath' => '../../inp_styles.xml',
// 'Debug' => 1,
'Admin' => 1,
'K4' => 1,
);
return $oFCKeditor->CreateHtml();
}
/**
* Allows to construct link for opening any type of catalog item selector
*
* @param Array $params
* @return string
*/
function SelectorLink($params)
{
$mode = 'catalog';
if (isset($params['mode'])) { // {catalog, advanced_view}
$mode = $params['mode'];
unset($params['mode']);
}
$params['t'] = 'in-portal/item_selector/item_selector_'.$mode;
$default_params = Array('no_amp' => 1, 'pass' => 'all,'.$params['prefix']);
unset($params['prefix']);
$pass_through = Array();
if (isset($params['tabs_dependant'])) { // {yes, no}
$pass_through['td'] = $params['tabs_dependant'];
unset($params['tabs_dependant']);
}
if (isset($params['selection_mode'])) { // {single, multi}
$pass_through['tm'] = $params['selection_mode'];
unset($params['selection_mode']);
}
if (isset($params['tab_prefixes'])) { // {all, none, <comma separated prefix list}
$pass_through['tp'] = $params['tab_prefixes'];
unset($params['tab_prefixes']);
}
if ($pass_through) {
// add pass_through to selector url if any
$params['pass_through'] = implode(',', array_keys($pass_through));
$params = array_merge_recursive2($params, $pass_through);
}
// user can override default parameters (except pass_through of course)
$params = array_merge_recursive2($default_params, $params);
return $this->Application->ProcessParsedTag('m', 't', $params);
}
function TimeFrame($params)
{
$w = adodb_date('w');
$m = adodb_date('m');
$y = adodb_date('Y');
//FirstDayOfWeek is 0 for Sunday and 1 for Monday
$fdow = $this->Application->ConfigValue('FirstDayOfWeek');
if ($fdow && $w == 0) $w = 7;
$today_start = adodb_mktime(0,0,0,adodb_date('m'),adodb_date('d'),$y);
$first_day_of_this_week = $today_start - ($w - $fdow)*86400;
$first_day_of_this_month = adodb_mktime(0,0,0,$m,1,$y);
$this_quater = ceil($m/3);
$this_quater_start = adodb_mktime(0,0,0,$this_quater*3-2,1,$y);
switch ($params['type']) {
case 'last_week_start':
$timestamp = $first_day_of_this_week - 86400*7;
break;
case 'last_week_end':
$timestamp = $first_day_of_this_week - 1;
break;
case 'last_month_start':
$timestamp = $m == 1 ? adodb_mktime(0,0,0,12,1,$y-1) : adodb_mktime(0,0,0,$m-1,1,$y);
break;
case 'last_month_end':
$timestamp = $first_day_of_this_month = adodb_mktime(0,0,0,$m,1,$y) - 1;
break;
case 'last_quater_start':
$timestamp = $this_quater == 1 ? adodb_mktime(0,0,0,10,1,$y-1) : adodb_mktime(0,0,0,($this_quater-1)*3-2,1,$y);
break;
case 'last_quater_end':
$timestamp = $this_quater_start - 1;
break;
case 'last_6_months_start':
$timestamp = $m <= 6 ? adodb_mktime(0,0,0,$m+6,1,$y-1) : adodb_mktime(0,0,0,$m-6,1,$y);
break;
case 'last_year_start':
$timestamp = adodb_mktime(0,0,0,1,1,$y-1);
break;
case 'last_year_end':
$timestamp = adodb_mktime(23,59,59,12,31,$y-1);
break;
}
if (isset($params['format'])) {
$format = $params['format'];
if(preg_match("/_regional_(.*)/", $format, $regs))
{
$lang =& $this->Application->recallObject('lang.current');
$format = $lang->GetDBField($regs[1]);
}
return adodb_date($format, $timestamp);
}
return $timestamp;
}
function CheckPermCache($params)
{
if ($this->Conn->GetOne('SELECT Data FROM '.TABLE_PREFIX.'Cache WHERE VarName = \'ForcePermCacheUpdate\'')) {
$this->Application->Redirect($params['cache_update_t'], array('continue' => 1));
}
}
/**
* Checks if current protocol is SSL
*
* @param Array $params
* @return int
*/
function IsSSL($params)
{
return (PROTOCOL == 'https://')? 1 : 0;
}
function PrintColumns($params)
{
$picker_helper =& $this->Application->RecallObject('ColumnPickerHelper');
$picker_helper->SetGridName($this->Application->GetLinkedVar('grid_name'));
/* @var $picker_helper kColumnPickerHelper */
$main_prefix = $this->Application->RecallVar('main_prefix');
$cols = $picker_helper->LoadColumns($main_prefix);
$o = '';
if (isset($params['hidden']) && $params['hidden']) {
foreach ($cols['hidden_fields'] as $col) {
$title = $this->Application->Phrase($cols['titles'][$col]);
$o .= "<option value='$col'>".$title;
}
}
else {
foreach ($cols['order'] as $col) {
if (in_array($col, $cols['hidden_fields'])) continue;
$title = $this->Application->Phrase($cols['titles'][$col]);
$o .= "<option value='$col'>".$title;
}
}
return $o;
}
/**
* Allows to set popup size (key - current template name)
*
* @param Array $params
*/
function SetPopupSize($params)
{
if (!$this->UsePopups($params)) return ;
$width = $params['width'];
$height = $params['height'];
if ($this->Application->GetVar('ajax') == 'yes') {
// during AJAX request just output size
die($width.'x'.$height);
}
$t = $this->Application->GetVar('t');
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'PopupSizes
WHERE TemplateName = '.$this->Conn->qstr($t);
$popup_info = $this->Conn->GetRow($sql);
if (!$popup_info) {
// create new popup size record
$fields_hash = Array (
'TemplateName' => $t,
'PopupWidth' => $width,
'PopupHeight' => $height,
);
$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'PopupSizes');
}
elseif ($popup_info['PopupWidth'] != $width || $popup_info['PopupHeight'] != $height) {
// popup found and size in tag differs from one in db -> update in db
$fields_hash = Array (
'PopupWidth' => $width,
'PopupHeight' => $height,
);
$this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'PopupSizes', 'PopupId = '.$popup_info['PopupId']);
}
}
/**
* Returns popup size (by template), if not cached, then parse template to get value
*
* @param Array $params
* @return string
*/
function GetPopupSize($params)
{
$t = $this->Application->GetVar('template_name');
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'PopupSizes
WHERE TemplateName = '.$this->Conn->qstr($t);
$popup_info = $this->Conn->GetRow($sql);
if (!$popup_info) {
$this->Application->InitParser();
$this->Application->ParseBlock(array('name' => $t)); // dies when SetPopupSize tag found & in ajax requrest
return '750x400'; // tag SetPopupSize not found in template -> use default size
}
return $popup_info['PopupWidth'].'x'.$popup_info['PopupHeight'];
}
function UsePopups($params)
{
return (int)$this->Application->ConfigValue('UsePopups');
}
function UseToolbarLabels($params)
{
return (int)$this->Application->ConfigValue('UseToolbarLabels');
}
/**
* Checks if debug mode enabled (optionally) and specified constant is on
*
* @param Array $params
* @return bool
*/
function ConstOn($params)
{
$constant_name = $this->SelectParam($params, 'name,const');
$debug_mode = isset($params['debug_mode']) && $params['debug_mode'] ? $this->Application->isDebugMode() : true;
return $debug_mode && constOn($constant_name);
}
/**
* Builds link to last template in main frame of admin
*
* @param Array $params
* @return string
*/
function MainFrameLink($params)
{
$last_template = $this->Application->RecallVar('last_template_popup'); // because of m_opener=s there
if (!$last_template) {
return false;
}
list(, $env) = explode('|', $last_template);
$vars = $this->Application->HttpQuery->processQueryString($env, 'pass');
if ($vars['t'] == 'login' || $vars['t'] == 'index') {
// prevents redirect recursion OR old in-portal pages
return false;
}
$vars = array_merge_recursive2($vars, $params);
$t = $vars['t'];
unset($vars['t']);
return $this->Application->HREF($t, '', $vars);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/admin/admin_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.35
\ No newline at end of property
+1.36
\ No newline at end of property
Index: trunk/core/units/users/users_event_handler.php
===================================================================
--- trunk/core/units/users/users_event_handler.php (revision 8103)
+++ trunk/core/units/users/users_event_handler.php (revision 8104)
@@ -1,1209 +1,1207 @@
<?php
class UsersEventHandler extends kDBEventHandler
{
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
// admin
'OnSetPersistantVariable' => Array('self' => 'view'), // because setting to logged in user only
'OnUpdateRootPassword' => Array('self' => true), // 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);
}
/**
* Shows only admins when required
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
$object =& $event->getObject();
/* @var $object kDBList */
if ($event->Special == 'admins') {
$object->addFilter('primary_filter', 'ug.GroupId = 11');
}
if ($event->Special == 'regular') {
$object->addFilter('primary_filter', 'ug.GroupId <> 11');
}
if (!$this->Application->IsAdmin()) {
$object->addFilter('status_filter', '%1$s.Status = '.STATUS_ACTIVE);
}
}
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
if ($event->Name == 'OnLogin' || $event->Name == 'OnLogout') {
// permission is checked in OnLogin event directly
return true;
}
if (!$this->Application->IsAdmin()) {
$user_id = $this->Application->RecallVar('user_id');
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
if ($event->Name == 'OnCreate' && $user_id == -2) {
// "Guest" can create new users
return true;
}
if ($event->Name == 'OnUpdate' && $user_id > 0) {
$user_dummy =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true));
foreach ($items_info as $id => $field_values) {
if ($id != $user_id) {
// registered users can update their record only
return false;
}
$user_dummy->Load($id);
$status_field = array_shift($this->Application->getUnitOption($event->Prefix, 'StatusField'));
if ($user_dummy->GetDBField($status_field) != STATUS_ACTIVE) {
// not active user is not allowed to update his record (he could not activate himself manually)
return false;
}
if (isset($field_values[$status_field]) && $user_dummy->GetDBField($status_field) != $field_values[$status_field]) {
// user can't change status by himself
return false;
}
}
return true;
}
if ($event->Name == 'OnUpdate' && $user_id <= 0) {
// guests are not allowed to update their record, because they don't have it :)
return false;
}
}
return parent::CheckPermission($event);
}
function OnSessionExpire()
{
$this->Application->resetCounters('UserSession');
if ($this->Application->IsAdmin()) {
$this->Application->Redirect('index', Array('expired' => 1), '', 'index.php');
}
if ($this->Application->GetVar('admin') == 1) {
$session_admin =& $this->Application->recallObject('Session.admin');
/* @var $session_admin Session */
-
if (!$session_admin->LoggedIn()) {
// front-end session created from admin session & both expired
$this->Application->DeleteVar('admin');
$this->Application->Redirect('index', Array('expired' => 1), '', 'admin/index.php');
}
}
-
$get = $this->Application->HttpQuery->getRedirectParams();
$t = $this->Application->GetVar('t');
$get['js_redirect'] = $this->Application->ConfigValue('UseJSRedirect');
$this->Application->Redirect($t ? $t : 'index', $get);
}
/**
* Checks user data and logs it in if allowed
*
* @param kEvent $event
*/
function OnLogin(&$event)
{
// persistent session data after login is not refreshed, because redirect will follow in any case
$prefix_special = $this->Application->IsAdmin() ? 'u.current' : 'u'; // "u" used on front not to change theme
$object =& $this->Application->recallObject($prefix_special, null, Array('skip_autoload' => true));
$password = $this->Application->GetVar('password');
$invalid_pseudo = $this->Application->IsAdmin() ? 'la_invalid_password' : 'lu_invalid_password';
if(!$password)
{
$object->SetError('ValidateLogin', 'invalid_password', $invalid_pseudo);
$event->status = erFAIL;
return false;
}
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
list($login_field, $submit_field) = $email_as_login && !$this->Application->IsAdmin() ? Array('Email', 'email') : Array('Login', 'login');
$login_value = $this->Application->GetVar($submit_field);
// process "Save Username" checkbox
if ($this->Application->IsAdmin()) {
$save_username = $this->Application->GetVar('cb_save_username') ? $login_value : '';
$this->Application->Session->SetCookie('save_username', $save_username, adodb_mktime() + 31104000); // 1 year expiration
$this->Application->SetVar('save_username', $save_username); // cookie will be set on next refresh, but refresh won't occur if login error present, so duplicate cookie in HTTPQuery
}
if ($this->Application->IsAdmin() && ($login_value == 'root') || ($login_value == 'super-root')) {
// logging in "root" (admin only)
$super_admin = ($login_value == 'super-root') && $this->verifySuperAdmin();
$login_value = 'root';
$root_password = $this->Application->ConfigValue('RootPass');
$password_formatter =& $this->Application->recallObject('kPasswordFormatter');
$test = $password_formatter->EncryptPassword($password, 'b38');
if ($root_password != $test) {
$object->SetError('ValidateLogin', 'invalid_password', $invalid_pseudo);
$event->status = erFAIL;
return false;
}
elseif ($this->checkLoginPermission($login_value)) {
$user_id = -1;
$object->Load($user_id);
$object->SetDBField('Login', $login_value);
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', $user_id);
// $session->SetField('GroupList', implode(',', $groups) );
$this->Application->SetVar('u.current_id', $user_id);
$this->Application->StoreVar('user_id', $user_id);
if ($super_admin) {
$this->Application->StoreVar('super_admin', 1);
}
$this->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.current_id', $user_id);
$this->Application->StoreVar('user_id', $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', $invalid_pseudo);
$event->status = erFAIL;
}
$event->SetRedirectParam('pass', 'm');
}
/**
* Checks that user is allowed to use super admin mode
*
* @return bool
*/
function verifySuperAdmin()
{
$sa_mode = isset($GLOBALS['debugger']) && $GLOBALS['debugger']->ipMatch(defined('SA_IP') ? SA_IP : '');
return $sa_mode || $this->Application->isDebugMode();
}
/**
* Enter description here...
*
* @param string $user_name
* @return bool
*/
function checkLoginPermission($user_name)
{
$ret = true;
if ($this->Application->IsAdmin()) {
$modules_helper =& $this->Application->recallObject('ModulesHelper');
if ($user_name != 'root') {
// root is virtual user, so allow him to login to admin in any case
$ret = $this->Application->CheckPermission('ADMIN', 1);
}
$ret = $ret && $modules_helper->checkLogin();
}
else {
$ret = $this->Application->CheckPermission('LOGIN', 1);
}
return $ret;
}
/**
* Process all required data and redirect logged-in user
*
* @param kEvent $event
*/
function processLoginRedirect(&$event, $password)
{
$prefix_special = $this->Application->IsAdmin() ? 'u.current' : 'u'; // "u" used on front not to change theme
$object =& $this->Application->recallObject($prefix_special, null, Array('skip_autoload' => true));
$next_template = $this->Application->GetVar('next_template');
if ($next_template == '_ses_redirect') {
$location = $this->Application->BaseURL().$this->Application->RecallVar($next_template);
if( $this->Application->isDebugMode() && constOn('DBG_REDIRECT') )
{
$this->Application->Debugger->appendTrace();
echo "<b>Debug output above!!!</b> Proceed to redirect: <a href=\"$location\">$location</a><br>";
}
else {
header('Location: '.$location);
}
$session =& $this->Application->recallObject('Session');
$session->SaveData();
exit;
}
if ($next_template) {
$event->redirect = $next_template;
}
if ($this->Application->ConfigValue('UseJSRedirect')) {
$event->SetRedirectParam('js_redirect', 1);
}
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LoginUser', $object->GetDBField('Login'), $password);
$this->Application->resetCounters('UserSession');
}
/**
* Called when user logs in using old in-portal
*
* @param kEvent $event
*/
function OnInpLogin(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LoginUser', $event->getEventParam('user'), $event->getEventParam('pass') );
if ($event->redirect && is_string($event->redirect)) {
// some real template specified instead of true
$this->Application->Redirect($event->redirect, $event->redirect_params);
}
}
/**
* Called when user logs in using old in-portal
*
* @param kEvent $event
*/
function OnInpLogout(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LogoutUser');
}
function OnLogout(&$event)
{
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('LogoutUser');
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', -2);
$this->Application->SetVar('u.current_id', -2);
$this->Application->StoreVar('user_id', -2);
$object =& $this->Application->recallObject('u.current', null, Array('skip_autoload' => true));
$object->Load(-2);
$this->Application->DestroySession();
$group_list = $this->Application->ConfigValue('User_GuestGroup').','.$this->Application->ConfigValue('User_LoggedInGroup');
$session->SetField('GroupList', $group_list);
$this->Application->StoreVar('UserGroups', $group_list);
if ($this->Application->ConfigValue('UseJSRedirect')) {
$event->SetRedirectParam('js_redirect', 1);
}
$this->Application->resetCounters('UserSession');
$event->SetRedirectParam('pass', 'm');
}
/**
* 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();
$ug_table = TABLE_PREFIX.'UserGroup';
if ($object->mode == 't') {
$ug_table = $this->Application->GetTempName($ug_table, 'prefix:'.$event->Prefix);
}
$sql = 'UPDATE '.$ug_table.'
SET PrimaryGroup = 0
WHERE PortalUserId = '.$object->GetDBField('PortalUserId');
$this->Conn->Query($sql);
// set primary group to user
if ($this->Application->IsAdmin() && $this->Application->GetVar('user_group')) {
// while in admin you can set any group for new users
$group_id = $this->Application->GetVar('user_group');
}
else {
$group_id = $this->Application->ConfigValue('User_NewGroup');
}
$sql = 'REPLACE INTO '.$ug_table.'(PortalUserId,GroupId,PrimaryGroup) VALUES (%s,%s,1)';
$this->Conn->Query( sprintf($sql, $object->GetID(), $group_id) );
}
}
/**
* Login user if possible, if not then redirect to corresponding template
*
* @param kEvent $event
*/
function autoLoginUser(&$event)
{
$object =& $event->getObject();
$this->Application->SetVar('u.current_id', $object->GetID() );
if($object->GetDBField('Status') == STATUS_ACTIVE && !$this->Application->ConfigValue('User_Password_Auto'))
{
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
list($login_field, $submit_field) = $email_as_login ? Array('Email', 'email') : Array('Login', 'login');
$this->Application->SetVar($submit_field, $object->GetDBField($login_field) );
$this->Application->SetVar('password', $object->GetDBField('Password_plain') );
$event->CallSubEvent('OnLogin');
}
}
/**
* When creating user & user with such email exists then force to use OnUpdate insted of ?
*
* @param kEvent $event
*/
function OnSubstituteSubscriber(&$event)
{
$ret = false;
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
list($id, $field_values) = each($items_info);
$user_email = isset($field_values['Email']) ? $field_values['Email'] : false;
if($user_email)
{
// check if is subscriber
$verify_user =& $this->Application->recallObject('u.verify', null, Array('skip_autoload' => true) );
$verify_user->Load($user_email, 'Email');
if( $verify_user->isLoaded() && $verify_user->isSubscriberOnly() )
{
$items_info = Array( $verify_user->GetDBField('PortalUserId') => $field_values );
$this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
$ret = true;
}
}
}
if( isset($event->MasterEvent) )
{
$event->MasterEvent->setEventParam('is_subscriber_only', $ret);
}
else
{
$event->setEventParam('is_subscriber_only', $ret);
}
}
/**
* Enter description here...
*
* @param kEvent $event
* @return bool
*/
function isSubscriberOnly(&$event)
{
$event->CallSubEvent('OnSubstituteSubscriber');
$is_subscriber = false;
if( $event->getEventParam('is_subscriber_only') )
{
$is_subscriber = true;
$object =& $event->getObject( Array('skip_autoload' => true) );
$this->OnUpdate($event);
if($event->status == erSUCCESS)
{
$this->OnAfterItemCreate($event);
$object->SendEmailEvents();
if( !$this->Application->IsAdmin() && ($event->status == erSUCCESS) && $event->redirect) $this->autoLoginUser($event);
}
}
return $is_subscriber;
}
/**
* Creates new user
*
* @param kEvent $event
*/
function OnCreate(&$event)
{
if( !$this->Application->IsAdmin() ) $this->setUserStatus($event);
if( !$this->isSubscriberOnly($event) )
{
$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
$cs_helper->CheckStateField($event, 'State', 'Country');
$object =& $event->getObject( Array('skip_autoload' => true) );
/* @var $object kDBItem */
if ($this->Application->ConfigValue('User_Password_Auto')) {
$pass = makepassword4(rand(5,8));
$object->SetField('Password', $pass);
$object->SetField('VerifyPassword', $pass);
$this->Application->SetVar('user_password',$pass);
}
parent::OnCreate($event);
$this->Application->SetVar('u.current_id', $object->getID() ); // for affil:OnRegisterAffiliate after hook
$this->setNextTemplate($event);
if( !$this->Application->IsAdmin() && ($event->status == erSUCCESS) && $event->redirect)
{
$object->SendEmailEvents();
$this->autoLoginUser($event);
}
}
}
/**
* Set's new user status based on config options
*
* @param kEvent $event
*/
function setUserStatus(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$new_users_allowed = $this->Application->ConfigValue('User_Allow_New');
// 1 - Instant, 2 - Not Allowed, 3 - Pending
switch ($new_users_allowed)
{
case 1: // Instant
$object->SetDBField('Status', 1);
$next_template = $this->Application->GetVar('registration_confirm_template');
if($next_template) $event->redirect = $next_template;
break;
case 3: // Pending
$next_template = $this->Application->GetVar('registration_confirm_pending_template');
if($next_template) $event->redirect = $next_template;
$object->SetDBField('Status', 2);
break;
case 2: // Not Allowed
$object->SetDBField('Status', 0);
break;
}
/*if ($object->GetDBField('PaidMember') == 1) {
$this->Application->HandleEvent($add_to_cart, 'ord:OnAddToCart');
$event->redirect = 'in-commerce/checkout/shop_cart';
} */
}
/**
* Set's new unique resource id to user
*
* @param kEvent $event
*/
function OnBeforeItemCreate(&$event)
{
$email_as_login = $this->Application->ConfigValue('Email_As_Login');
$object =& $event->getObject();
if ($email_as_login) {
$object->Fields['Email']['error_msgs']['unique'] = $this->Application->Phrase('lu_user_and_email_already_exist');
}
}
/**
* Set's new unique resource id to user
*
* @param kEvent $event
*/
function OnAfterItemValidate(&$event)
{
$object =& $event->getObject();
$resource_id = $object->GetDBField('ResourceId');
if (!$resource_id)
{
$object->SetDBField('ResourceId', $this->Application->NextResourceId() );
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnRecommend(&$event){
$friend_email = $this->Application->GetVar('friend_email');
$friend_name = $this->Application->GetVar('friend_email');
// used for error reporting only -> rewrite code + theme (by Alex)
$object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too
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->RecallVar('user_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->ErrorMsgs['send_error'] = $this->Application->Phrase('lu_email_send_error');
$object->FieldErrors['Email']['pseudo'] = 'send_error';
$event->status = erFAIL;
}
}
else {
$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());
$event->redirect = $this->Application->GetVar($group_info ? 'unsubscribe_template' : 'subscribe_template');
}
else {
$event->redirect = $this->Application->GetVar('subscribe_template');
$this->Application->StoreVar('SubscriberEmail', $user_email);
}
}
else {
// used for error reporting only -> rewrite code + theme (by Alex)
$object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too
$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', null, 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)){
$this->RemoveRequiredFields($object);
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));
// used for error reporting only -> rewrite code + theme (by Alex)
$user_current_object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too
$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');
// used for error reporting only -> rewrite code + theme (by Alex)
$user_current_object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true));// TODO: change theme too
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);
}
/**
* Allows to change root password
*
* @param kEvent $event
*/
function OnUpdateRootPassword(&$event)
{
$user_id = $this->Application->RecallVar('user_id');
if ($user_id != -1) {
// not "root" can't change root's password via this event
return false;
}
// put salt to user's config
$field_options = $this->Application->getUnitOption($event->Prefix.'.RootPassword', 'Fields');
$field_options['salt'] = 'b38';
$this->Application->setUnitOption($event->Prefix.'.RootPassword', 'Fields', $field_options);
$object =& $event->getObject( Array('skip_autoload' => true) );
/* @var $object UsersItem */
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info) {
list ($id, $field_values) = each($items_info);
$this->RemoveRequiredFields($object);
$object->SetDBField('RootPassword', $this->Application->ConfigValue('RootPass'));
$object->SetFieldsFromHash($field_values);
$status = $object->Validate();
if ($status) {
// validation on, password match too
$fields_hash = Array (
'VariableValue' => $object->GetDBField('RootPassword')
);
$conf_table = $this->Application->getUnitOption('conf', 'TableName');
$this->Conn->doUpdate($fields_hash, $conf_table, 'VariableName = "RootPass"');
$event->SetRedirectParam('opener', 'u');
}
else {
$event->status = erFAIL;
$event->redirect = false;
}
}
}
/**
* Apply some special processing to
* object beeing recalled before using
* it in other events that call prepareObject
*
* @param Object $object
* @param kEvent $event
* @access protected
*/
function prepareObject(&$object, &$event)
{
parent::prepareObject($object, $event);
if (!$this->Application->IsAdmin()) {
if ($this->Application->RecallVar('register_captcha_code')) return ;
$captcha_helper =& $this->Application->recallObject('CaptchaHelper');
/* @var $captcha_helper kCaptchaHelper */
$this->Application->StoreVar('register_captcha_code', $captcha_helper->GenerateCaptchaCode());
}
}
/**
* Apply custom processing to item
*
* @param kEvent $event
*/
function customProcessing(&$event, $type)
{
if ($event->Name == 'OnCreate' && $type == 'before') {
$object =& $event->getObject();
/* @var $object kDBItem */
// if auto password has not been set already - store real one - to be used in email events
if (!$this->Application->GetVar('user_password')) {
$this->Application->SetVar('user_password', $object->GetDirtyField('Password'));
$object->SetDBField('Password_plain', $object->GetDirtyField('Password'));
}
// Validate captcha image if it's requried
if ($this->Application->ConfigValue('RegistrationCaptcha') && $object->GetDBField('Captcha') != $this->Application->RecallVar('register_captcha_code')) {
$object->SetError('Captcha', 'captcha_error', 'lu_captcha_error');
$captcha_helper =& $this->Application->recallObject('CaptchaHelper');
/* @var $captcha_helper kCaptchaHelper */
$this->Application->StoreVar('register_captcha_code', $captcha_helper->GenerateCaptchaCode());
}
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/users/users_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.75
\ No newline at end of property
+1.76
\ No newline at end of property
Index: trunk/core/units/users/users_item.php
===================================================================
--- trunk/core/units/users/users_item.php (revision 8103)
+++ trunk/core/units/users/users_item.php (revision 8104)
@@ -1,171 +1,171 @@
<?php
class UsersItem extends kDBItem {
var $persistantVars = Array();
function LoadPersistantVars($id=null)
{
$id = $id == -1 ? -1 : $this->GetID();
if (!$id) return ;
$sql = 'SELECT VariableValue, VariableName
FROM '.TABLE_PREFIX.'PersistantSessionData
WHERE PortalUserId = '.$id;
$this->persistantVars = $this->Conn->GetCol($sql, 'VariableName');
}
function setPersistantVar($var_name, $var_value)
{
$this->persistantVars[$var_name] = $var_value;
if ($this->GetID() > 0 || $this->GetID() == -1) {
$replace_hash = Array( 'PortalUserId' => $this->GetID(),
'VariableName' => $var_name,
'VariableValue' => $var_value
);
$this->Conn->doInsert($replace_hash, TABLE_PREFIX.'PersistantSessionData', 'REPLACE');
}
else {
$this->Application->StoreVar($var_name, $var_value);
}
}
function getPersistantVar($var_name)
{
return getArrayValue($this->persistantVars, $var_name);
}
function Load($id, $id_field_name = null)
{
$ret = parent::Load($id, $id_field_name);
if ($ret || $id == -1) {
$this->LoadPersistantVars($id);
}
return $ret;
}
/**
* Returns IDs of groups to which user belongs and membership is not expired
*
* @return Array
* @access public
*/
function getMembershipGroups($force_reload = false)
{
$user_groups = $this->Application->RecallVar('UserGroups');
if($user_groups === false || $force_reload)
{
$sql = 'SELECT GroupId FROM %s WHERE (PortalUserId = %s) AND ( (MembershipExpires IS NULL) OR ( MembershipExpires >= UNIX_TIMESTAMP() ) )';
$sql = sprintf($sql, TABLE_PREFIX.'UserGroup', $this->GetID() );
return $this->Conn->GetCol($sql);
}
else
{
return explode(',', $user_groups);
}
}
/**
* Set's Login from Email if required by configuration settings
*
*/
function setLogin()
{
if( $this->Application->ConfigValue('Email_As_Login') )
{
$this->SetDBField('Login', $this->GetDBField('Email') );
}
}
function SendEmailEvents()
{
switch( $this->GetDBField('Status') )
{
case 1:
if ($this->Application->ConfigValue('User_Password_Auto')) {
$this->Application->EmailEventAdmin('USER.VALIDATE', $this->GetID() );
$this->Application->EmailEventUser('USER.VALIDATE', $this->GetID() );
}
else {
- $this->Application->EmailEventAdmin('USER.ADD', $this->GetID() );
- $this->Application->EmailEventUser('USER.ADD', $this->GetID() );
+ $this->Application->EmailEventAdmin('USER.ADD', $this->GetID() );
+ $this->Application->EmailEventUser('USER.ADD', $this->GetID() );
}
break;
case 2:
$this->Application->EmailEventAdmin('USER.ADD.PENDING', $this->GetID() );
$this->Application->EmailEventUser('USER.ADD.PENDING', $this->GetID() );
break;
}
}
function isSubscriberOnly()
{
$subscribers_group_id = $this->Application->ConfigValue('User_SubscriberGroup');
$sql = 'SELECT PortalUserId
FROM '.TABLE_PREFIX.'UserGroup
WHERE GroupId = '.$subscribers_group_id.' AND
PortalUserId = '.$this->GetDBField('PortalUserId').' AND
PrimaryGroup = 1';
return $this->Conn->GetOne($sql) == $this->GetDBField('PortalUserId');
}
function Create($force_id=false, $system_create=false)
{
$ret = parent::Create($force_id, $system_create);
if ($ret) {
// find out how to syncronize user only when it's copied to live table
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('createUser', $this->FieldValues);
}
return $ret;
}
function Update($id=null, $system_update=false)
{
$ret = parent::Update($id, $system_update);
if ($ret) {
// find out how to syncronize user only when it's copied to live table
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('updateUser', $this->FieldValues);
}
return $ret;
}
/**
* Deletes the record from databse
*
* @access public
* @return bool
*/
function Delete($id = null)
{
$ret = parent::Delete($id);
if ($ret) {
$sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize');
$sync_manager->performAction('deleteUser', $this->FieldValues);
}
return $ret;
}
function setName($full_name)
{
$full_name = explode(' ', $full_name);
if (count($full_name) > 2) {
$last_name = array_pop($full_name);
$first_name = implode(' ', $full_name);
}
else {
$last_name = $full_name[1];
$first_name = $full_name[0];
}
$this->SetDBField('FirstName', $first_name);
$this->SetDBField('LastName', $last_name);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/users/users_item.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.13
\ No newline at end of property
+1.14
\ No newline at end of property
Index: trunk/core/units/languages/import_xml.php
===================================================================
--- trunk/core/units/languages/import_xml.php (revision 8103)
+++ trunk/core/units/languages/import_xml.php (revision 8104)
@@ -1,420 +1,438 @@
<?php
define('LANG_OVERWRITE_EXISTING', 1);
define('LANG_SKIP_EXISTING', 2);
class LangXML_Parser extends kBase {
/**
* Path to current node beeing processed
*
* @var Array
*/
var $path = Array();
/**
* Connection to database
*
* @var kDBConnection
*/
var $Conn = null;
/**
* Fields of language currently beeing processed
*
* @var Array
*/
var $current_language = Array();
/**
* Fields of phrase currently beeing processed
*
* @var Array
*/
var $current_phrase = Array();
/**
* Fields of event currently beeing processed
*
* @var Array
*/
var $current_event = Array();
/**
* Event type + name mapping to id (from system)
*
* @var Array
*/
var $events_hash = Array();
/**
* Phrase types allowed for import/export operations
*
* @var Array
*/
var $phrase_types_allowed = Array();
/**
* Modules allowed for export (import in development)
*
* @var Array
*/
var $modules_allowed = Array();
/**
* Current Language in import
*
* @var LanguagesItem
*/
var $lang_object = null;
var $tables = Array();
var $ip_address = '';
var $import_mode = LANG_SKIP_EXISTING;
var $Encoding = 'base64';
function LangXML_Parser($temp_mode = true)
{
parent::kBase();
$this->Conn =& $this->Application->GetADODBConnection();
if ($temp_mode) {
$this->Application->SetVar('lang_mode', 't');
$this->tables['lang'] = $this->prepareTempTable('lang');
$this->tables['phrases'] = $this->prepareTempTable('phrases');
$this->tables['emailmessages'] = $this->prepareTempTable('emailmessages');
}
else {
$this->tables['lang'] = $this->Application->getUnitOption('lang', 'TableName');
$this->tables['phrases'] = $this->Application->getUnitOption('phrases', 'TableName');
$this->tables['emailmessages'] = $this->Application->getUnitOption('emailmessages', 'TableName');
}
$this->lang_object =& $this->Application->recallObject('lang.imp', null, Array('skip_autoload' => true));
$sql = 'SELECT EventId, CONCAT(Event,"_",Type) AS EventMix FROM '.TABLE_PREFIX.'Events';
$this->events_hash = $this->Conn->GetCol($sql, 'EventMix');
$this->ip_address = getenv('HTTP_X_FORWARDED_FOR') ? getenv('HTTP_X_FORWARDED_FOR') : getenv('REMOTE_ADDR');
}
function SetEncoding($enc)
{
$this->Encoding = $enc;
}
function renameTable($table_prefix, $new_name)
{
$this->Conn->Query('ALTER TABLE '.$this->tables[$table_prefix].' RENAME '.$new_name);
$this->tables[$table_prefix] = $new_name;
}
/**
* Create temp table for prefix, if table already exists, then delete it and create again
*
* @param string $prefix
*/
function prepareTempTable($prefix)
{
$idfield = $this->Application->getUnitOption($prefix, 'IDField');
$table = $this->Application->getUnitOption($prefix,'TableName');
$temp_table = $this->Application->GetTempName($table);
$sql = 'DROP TABLE IF EXISTS %s';
$this->Conn->Query( sprintf($sql, $temp_table) );
$sql = 'CREATE TABLE %s SELECT * FROM %s WHERE 0';
$this->Conn->Query( sprintf($sql, $temp_table, $table) );
$sql = 'ALTER TABLE %1$s CHANGE %2$s %2$s INT(11) NOT NULL';
$this->Conn->Query( sprintf($sql, $temp_table, $idfield) );
return $temp_table;
}
function Parse($filename, $phrase_types, $module_ids, $import_mode = LANG_SKIP_EXISTING)
{
// define the XML parsing routines/functions to call based on the handler path
if( !file_exists($filename) || !$phrase_types /*|| !$module_ids*/ ) return false;
$phrase_types = explode('|', substr($phrase_types, 1, -1) );
// $module_ids = explode('|', substr($module_ids, 1, -1) );
$this->phrase_types_allowed = array_flip($phrase_types);
$this->import_mode = $import_mode;
//if (in_array('In-Portal',)
$xml_parser = xml_parser_create();
xml_set_element_handler( $xml_parser, Array(&$this, 'startElement'), Array(&$this, 'endElement') );
xml_set_character_data_handler( $xml_parser, Array(&$this, 'characterData') );
$fdata = file_get_contents($filename);
$ret = xml_parse($xml_parser, $fdata);
xml_parser_free($xml_parser); // clean up the parser object
$this->Application->SetVar('lang_mode', '');
return $ret;
}
function startElement(&$parser, $element, $attributes)
{
array_push($this->path, $element);
$path = implode(' ',$this->path);
//check what path we are in
$this->LastLine = xml_get_current_line_number($parser);
$this->SecondData = false;
switch($path)
{
case 'LANGUAGES LANGUAGE':
$this->current_language = Array('PackName' => $attributes['PACKNAME'], 'LocalName' => $attributes['PACKNAME'], 'Encoding' => $attributes['ENCODING']);
$sql = 'SELECT %s FROM %s WHERE PackName = %s';
$sql = sprintf( $sql,
$this->lang_object->IDField,
$this->Application->GetLiveName($this->lang_object->TableName),
$this->Conn->qstr($this->current_language['PackName']) );
$language_id = $this->Conn->GetOne($sql);
if($language_id)
{
$this->current_language['LanguageId'] = $language_id;
$this->lang_object->SwitchToLive();
$this->lang_object->Load($language_id);
}
break;
case 'LANGUAGES LANGUAGE PHRASES':
case 'LANGUAGES LANGUAGE EVENTS':
if( !getArrayValue($this->current_language,'Charset') ) $this->current_language['Charset'] = 'iso-8859-1';
$this->lang_object->SetFieldsFromHash($this->current_language);
if( !getArrayValue($this->current_language,'LanguageId') )
{
$this->lang_object->SetDBField('Enabled', STATUS_ACTIVE);
if( $this->lang_object->Create() ) $this->current_language['LanguageId'] = $this->lang_object->GetID();
}
elseif($this->import_mode == LANG_OVERWRITE_EXISTING)
{
$this->lang_object->TableName = $this->Application->getUnitOption($this->lang_object->Prefix, 'TableName');
$this->lang_object->Update();
}
break;
case 'LANGUAGES LANGUAGE PHRASES PHRASE':
$phrase_module = getArrayValue($attributes,'MODULE');
if(!$phrase_module) $phrase_module = 'In-Portal';
$this->current_phrase = Array( 'LanguageId' => $this->current_language['LanguageId'],
'Phrase' => $attributes['LABEL'],
'PhraseType' => $attributes['TYPE'],
- 'PhraseId' => 0,
'Module' => $phrase_module,
'LastChanged' => adodb_mktime(),
'LastChangeIP' => $this->ip_address,
'Translation' => '');
break;
case 'LANGUAGES LANGUAGE EVENTS EVENT':
- $this->current_event = Array( 'EmailMessageId'=> 0,
- 'LanguageId' => $this->current_language['LanguageId'],
+ $this->current_event = Array( 'LanguageId' => $this->current_language['LanguageId'],
'EventId' => $this->events_hash[ $attributes['EVENT'].'_'.$attributes['TYPE'] ],
'MessageType' => $attributes['MESSAGETYPE'],
'Template' => '');
break;
}
// if($path == 'SHIPMENT PACKAGE')
}
function characterData(&$parser, $line)
{
$line = trim($line);
if(!$line) return ;
$path = join (' ',$this->path);
$language_nodes = Array('DATEFORMAT','TIMEFORMAT','INPUTDATEFORMAT','INPUTTIMEFORMAT','DECIMAL','THOUSANDS','CHARSET','UNITSYSTEM');
$node_field_map = Array('LANGUAGES LANGUAGE DATEFORMAT' => 'DateFormat',
'LANGUAGES LANGUAGE TIMEFORMAT' => 'TimeFormat',
'LANGUAGES LANGUAGE INPUTDATEFORMAT'=> 'InputDateFormat',
'LANGUAGES LANGUAGE INPUTTIMEFORMAT'=> 'InputTimeFormat',
'LANGUAGES LANGUAGE DECIMAL' => 'DecimalPoint',
'LANGUAGES LANGUAGE THOUSANDS' => 'ThousandSep',
'LANGUAGES LANGUAGE CHARSET' => 'Charset',
'LANGUAGES LANGUAGE UNITSYSTEM' => 'UnitSystem');
if( in_array( end($this->path), $language_nodes) )
{
$this->current_language[ $node_field_map[$path] ] = $line;
}
else
{
switch($path)
{
case 'LANGUAGES LANGUAGE PHRASES PHRASE':
if( isset($this->phrase_types_allowed[ $this->current_phrase['PhraseType'] ]) )
{
$this->current_phrase['Translation'] .= $line;
}
break;
case 'LANGUAGES LANGUAGE EVENTS EVENT':
$cur_line = xml_get_current_line_number($parser);
if ($cur_line != $this->LastLine) {
$this->current_event['Template'] .= str_repeat("\r\n", ($cur_line - $this->LastLine) );
$this->LastLine = $cur_line;
}
$this->current_event['Template'] .= $line;
$this->SecondData = true;
break;
}
}
}
function endElement(&$parser, $element)
{
$path = implode(' ',$this->path);
switch($path)
{
case 'LANGUAGES LANGUAGE PHRASES PHRASE':
if( isset($this->phrase_types_allowed[ $this->current_phrase['PhraseType'] ]) )
{
if ($this->current_language['Encoding'] == 'plain') {
// nothing to decode!
}
else {
$this->current_phrase['Translation'] = base64_decode($this->current_phrase['Translation']);
}
- $this->Conn->doInsert($this->current_phrase, $this->tables['phrases']);
+ $this->insertRecord($this->tables['phrases'], $this->current_phrase);
}
break;
case 'LANGUAGES LANGUAGE EVENTS EVENT':
if ($this->current_language['Encoding'] == 'plain') {
$this->current_event['Template'] = rtrim($this->current_event['Template']);
// nothing to decode!
}
else {
$this->current_event['Template'] = base64_decode($this->current_event['Template']);
}
- $this->Conn->doInsert($this->current_event, $this->tables['emailmessages']);
+ $this->insertRecord($this->tables['emailmessages'],$this->current_event);
break;
}
array_pop($this->path);
}
+ function insertRecord($table, $fields_hash)
+ {
+ $fields = '';
+ $values = '';
+
+ foreach($fields_hash as $field_name => $field_value)
+ {
+ $fields .= '`'.$field_name.'`,';
+ $values .= $this->Conn->qstr($field_value).',';
+ }
+
+ $fields = preg_replace('/(.*),$/', '\\1', $fields);
+ $values = preg_replace('/(.*),$/', '\\1', $values);
+
+ $sql = 'INSERT INTO `'.$table.'` ('.$fields.') VALUES ('.$values.')';
+ $this->Conn->Query($sql);
+
+// return $this->Conn->getInsertID(); // no need because of temp table without auto_increment column at all
+ }
+
/**
* Creates XML file with exported language data
*
* @param string $filename filename to export into
* @param Array $phrase_types phrases types to export from modules passed in $module_ids
* @param Array $language_ids IDs of languages to export
* @param Array $module_ids IDs of modules to export phrases from
*/
function Create($filename, $phrase_types, $language_ids, $module_ids)
{
$fp = fopen($filename,'w');
if(!$fp || !$phrase_types || !$module_ids || !$language_ids) return false;
$phrase_types = explode('|', substr($phrase_types, 1, -1) );
$module_ids = explode('|', substr($module_ids, 1, -1) );
$this->events_hash = array_flip($this->events_hash);
$lang_table = $this->Application->getUnitOption('lang','TableName');
$phrases_table = $this->Application->getUnitOption('phrases','TableName');
$emailevents_table = $this->Application->getUnitOption('emailmessages','TableName');
$mainevents_table = $this->Application->getUnitOption('emailevents','TableName');
$phrase_tpl = "\t\t\t".'<PHRASE Label="%s" Module="%s" Type="%s">%s</PHRASE>'."\n";
$event_tpl = "\t\t\t".'<EVENT MessageType="%s" Event="%s" Type="%s">%s</EVENT>'."\n";
$sql = 'SELECT * FROM %s WHERE LanguageId = %s';
$ret = '<LANGUAGES>'."\n";
foreach($language_ids as $language_id)
{
// languages
$row = $this->Conn->GetRow( sprintf($sql, $lang_table, $language_id) );
$ret .= "\t".'<LANGUAGE PackName="'.$row['PackName'].'" Encoding="'.$this->Encoding.'"><DATEFORMAT>'.$row['DateFormat'].'</DATEFORMAT>';
$ret .= '<TIMEFORMAT>'.$row['TimeFormat'].'</TIMEFORMAT><INPUTDATEFORMAT>'.$row['InputDateFormat'].'</INPUTDATEFORMAT>';
$ret .= '<INPUTTIMEFORMAT>'.$row['InputTimeFormat'].'</INPUTTIMEFORMAT><DECIMAL>'.$row['DecimalPoint'].'</DECIMAL>';
$ret .= '<THOUSANDS>'.$row['ThousandSep'].'</THOUSANDS><CHARSET>'.$row['Charset'].'</CHARSET>';
$ret .= '<UNITSYSTEM>'.$row['UnitSystem'].'</UNITSYSTEM>'."\n";
// phrases
$phrases_sql = 'SELECT * FROM '.$phrases_table.' WHERE LanguageId = %s AND PhraseType IN (%s) AND Module IN (%s) ORDER BY Phrase';
if( in_array('In-Portal',$module_ids) ) array_push($module_ids, ''); // for old language packs
$rows = $this->Conn->Query( sprintf($phrases_sql,$language_id, implode(',',$phrase_types), '\''.implode('\',\'',$module_ids).'\'' ) );
if($rows)
{
$ret .= "\t\t".'<PHRASES>'."\n";
foreach($rows as $row)
{
$data = $this->Encoding == 'base64' ? base64_encode($row['Translation']) : '<![CDATA['.$row['Translation'].']]>';
$ret .= sprintf($phrase_tpl, $row['Phrase'], $row['Module'], $row['PhraseType'], $data );
}
$ret .= "\t\t".'</PHRASES>'."\n";
}
// email events
if( in_array('In-Portal',$module_ids) ) unset( $module_ids[array_search('',$module_ids)] ); // for old language packs
$module_sql = preg_replace('/(.*) OR $/', '\\1', preg_replace('/(.*),/U', 'INSTR(Module,\'\\1\') OR ', implode(',', $module_ids).',' ) );
$sql = 'SELECT EventId FROM '.$mainevents_table.' WHERE '.$module_sql;
$event_ids = $this->Conn->GetCol($sql);
if($event_ids)
{
$ret .= "\t\t".'<EVENTS>'."\n";
$event_sql = ' SELECT em.*
FROM '.$emailevents_table.' em
LEFT JOIN '.$mainevents_table.' e ON e.EventId = em.EventId
WHERE em.LanguageId = %s AND em.EventId IN (%s)
ORDER BY e.Event, e.Type';
$rows = $this->Conn->Query( sprintf($event_sql,$language_id, $event_ids ? implode(',',$event_ids) : '' ) );
foreach($rows as $row)
{
list($event_name, $event_type) = explode('_', $this->events_hash[ $row['EventId'] ] );
$data = $this->Encoding == 'base64' ? base64_encode($row['Template']) : '<![CDATA['.$row['Template'].']]>';
$ret .= sprintf($event_tpl, $row['MessageType'], $event_name, $event_type, $data );
}
$ret .= "\t\t".'</EVENTS>'."\n";
}
$ret .= "\t".'</LANGUAGE>'."\n";
}
$ret .= '</LANGUAGES>';
fwrite($fp, $ret);
fclose($fp);
return true;
}
/**
* Creates new instance of LangXML_Parser class
*
* @param int $type
* @return LangXML_Parser
*/
function &makeClass($temp_mode = true)
{
$result = new LangXML_Parser($temp_mode);
return $result;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/languages/import_xml.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.24
\ No newline at end of property
+1.25
\ 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 8103)
+++ trunk/core/units/email_events/email_events_event_handler.php (revision 8104)
@@ -1,380 +1,380 @@
<?php
define('EVENT_TYPE_FRONTEND', 0);
define('EVENT_TYPE_ADMIN', 1);
define('EVENT_STATUS_DISABLED', 0);
define('EVENT_STATUS_ENABLED', 1);
define('EVENT_STATUS_FRONTEND', 2);
-
+
class EmailEventsEventsHandler extends kDBEventHandler
{
/**
* 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) );
$selected_ids = $this->getSelectedIDs($event, true);
$ids = $this->Application->RecallVar($event->getPrefixSpecial().'_selected_ids');
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'UPDATE '.$table_name.'
SET '.$this->Application->RecallVar('dst_field').' = '.$user_id.'
WHERE '.$id_field.' IN ('.$ids.')';
$this->Conn->Query($sql);
}
$this->finalizePopup($event);
}
/**
* Saves selected ids to session
*
* @param kEvent $event
*/
function OnSaveSelected(&$event)
{
$this->StoreSelectedIDs($event);
}
/**
* Returns sender & recipients ids plus event_id (as parameter by reference)
*
* @param kEvent $event
* @param int $event_id id of email event used
- *
+ *
* @return mixed
*/
function GetMessageRecipients(&$event, &$event_id)
{
$email_event =& $event->getObject( Array('skip_autoload' => true) );
/* @var $email_event kDBItem */
-
+
// get event parameters by name & type
$load_keys = Array (
'Event' => $event->getEventParam('EmailEventName'),
'Type' => $event->getEventParam('EmailEventType'),
);
$email_event->Load($load_keys);
-
+
if (!$email_event->isLoaded()) {
// event record not found
return false;
}
-
+
$enabled = $email_event->GetDBField('Enabled');
if ($enabled == EVENT_STATUS_DISABLED) {
return false;
}
if ($enabled == EVENT_STATUS_FRONTEND && $this->Application->IsAdmin()) {
return false;
}
// initial values
$to_user_id = $event->getEventParam('EmailEventToUserId');
$from_user_id = $email_event->GetDBField('FromUserId');
-
+
if ($email_event->GetDBField('Type') == EVENT_TYPE_ADMIN) {
// For type "Admin" recipient is a user from field FromUserId which means From/To user in Email events list
$to_user_id = $from_user_id;
$from_user_id = -1;
}
-
+
$event_id = $email_event->GetDBField('EventId');
-
+
return Array ($from_user_id, $to_user_id);
}
-
+
/**
* Returns user name, email by id, or ones, that specified in $direct_params
*
* @param int $user_id
* @param string $user_type type of user = {to,from}
* @param Array $direct_params
* @return Array
*/
function GetRecipientInfo($user_id, $user_type, $direct_params = null)
{
// load user, because it can be addressed from email template tags
$user =& $this->Application->recallObject('u.email-'.$user_type, null, Array('skip_autoload' => true));
/* @var $user UsersItem */
-
+
$email = $name = '';
$result = $user_id > 0 ? $user->Load($user_id) : $user->Clear();
if ($user->IsLoaded()) {
$email = $user->GetDBField('Email');
$name = trim($user->GetDBField('FirstName').' '.$user->GetDBField('LastName'));
}
-
+
if (is_array($direct_params)) {
if (isset($direct_params[$user_type.'_email'])) {
$email = $direct_params[$user_type.'_email'];
}
-
+
if (isset($direct_params[$user_type.'_name'])) {
$name = $direct_params[$user_type.'_name'];
}
}
-
+
if (!$email) {
// if email is empty, then use admins email
$email = $this->Application->ConfigValue('Smtp_AdminMailFrom');
}
-
+
if (!$name) {
$name = $user_type == 'from' ? strip_tags($this->Application->ConfigValue('Site_Name')) : $email;
}
-
+
return Array ($email, $name);
}
-
+
/**
* Returns email event message by ID (headers & body in one piece)
*
* @param int $event_id
* @param string $message_type contains message type = {text,html}
*/
function GetMessageBody($event_id, &$message_type)
{
$current_language = $this->Application->GetVar('m_lang');
$message =& $this->Application->recallObject('emailmessages', null, Array('skip_autoload' => true));
/* @var $message kDBItem */
-
+
$message->Load( Array('EventId' => $event_id, 'LanguageId' => $current_language) );
if (!$message->isLoaded()) {
// event translation on required language not found
- return false;
+ return false;
}
-
+
$message_type = $message->GetDBField('MessageType');
-
+
// 1. get message body
$message_body = $message->GetDBField('Template');
-
+
// 2. add footer
$sql = 'SELECT em.Template
FROM '.$message->TableName.' em
LEFT JOIN '.TABLE_PREFIX.'Events e ON e.EventId = em.EventId
WHERE em.LanguageId = '.$current_language.' AND e.Event = "COMMON.FOOTER"';
-
+
list (, $footer) = explode("\n\n", $this->Conn->GetOne($sql));
if ($message_type == 'text') {
$esender =& $this->Application->recallObject('EmailSender');
/* @var $esender kEmailSendingHelper */
-
+
$footer = $esender->ConvertToText($footer);
}
-
+
if ($footer) {
$message_body .= "\r\n".$footer;
}
-
+
// 3. replace tags if needed
$default_replacement_tags = Array (
'<inp:touser _Field="password"' => '<inp2:u_Field name="Password_plain"',
+
'<inp:touser _Field="UserName"' => '<inp2:u_Field name="Login"',
'<inp:touser _Field' => '<inp2:u_Field name',
);
-
$replacement_tags = $message->GetDBField('ReplacementTags');
$replacement_tags = $replacement_tags ? unserialize($replacement_tags) : Array ();
$replacement_tags = array_merge_recursive2($default_replacement_tags, $replacement_tags);
foreach ($replacement_tags as $replace_from => $replace_to) {
$message_body = str_replace($replace_from, $replace_to, $message_body);
}
-
+
return $message_body;
}
-
+
/**
* Parse message template and return headers (as array) and message body part
*
* @param string $message
* @param Array $direct_params
* @return Array
*/
function ParseMessageBody($message, $direct_params = null)
{
$direct_params['message_text'] = isset($direct_params['message']) ? $direct_params['message'] : ''; // parameter alias
-
+
// 1. parse template
$this->Application->InitParser();
$parser_params = $this->Application->Parser->Params; // backup parser params
$this->Application->Parser->Params = array_merge_recursive2($this->Application->Parser->Params, $direct_params);
$message = $this->Application->Parser->Parse($message, 'email_template', 0);
$this->Application->Parser->Params = $parser_params; // restore parser params
// 2. replace line endings, that are send with data submitted via request
$message = str_replace("\r\n", "\n", $message); // possible case
$message = str_replace("\r", "\n", $message); // impossible case, but just in case replace this too
// 3. separate headers from body
$message_headers = Array ();
list($headers, $message_body) = explode("\n\n", $message, 2);
-
+
$headers = explode("\n", $headers);
foreach ($headers as $header) {
$header = explode(':', $header, 2);
$message_headers[ trim($header[0]) ] = trim($header[1]);
}
-
+
return Array ($message_headers, $message_body);
}
-
+
/**
* Raised when email message shoul be sent
*
* @param kEvent $event
*/
function OnEmailEvent(&$event)
{
$email_event_name = $event->getEventParam('EmailEventName');
if (strpos($email_event_name, '_') !== false) {
trigger_error('<span class="debug_error">Invalid email event name</span> <b>'.$email_event_name.'</b>. Use only <b>UPPERCASE characters</b> and <b>dots</b> as email event names', E_USER_ERROR);
}
// additional parameters from kApplication->EmailEvent
$send_params = $event->getEventParam('DirectSendParams');
-
+
// 1. get information about message sender and recipient
$recipients = $this->GetMessageRecipients($event, $event_id);
if ($recipients === false) {
// if not valid recipients found, then don't send event
return false;
}
-
+
list ($from_id, $to_id) = $recipients;
list ($from_email, $from_name) = $this->GetRecipientInfo($from_id, 'from', $send_params);
list ($to_email, $to_name) = $this->GetRecipientInfo($to_id, 'to', $send_params);
-
+
// 2. prepare message to be sent
$message_template = $this->GetMessageBody($event_id, $message_type);
if (!trim($message_template)) {
return false;
}
-
+
list ($message_headers, $message_body) = $this->ParseMessageBody($message_template, $send_params);
if (!trim($message_body)) {
return false;
}
-
+
// 3. set headers & send message
$esender =& $this->Application->recallObject('EmailSender');
/* @var $esender kEmailSendingHelper */
-
+
$esender->SetFrom($from_email, $from_name);
$esender->AddTo($to_email, $to_name);
-
+
$message_subject = isset($message_headers['Subject']) ? $message_headers['Subject'] : 'Mail message';
- $esender->SetSubject($message_subject);
+ $esender->SetSubject($message_subject);
foreach ($message_headers as $header_name => $header_value) {
$esender->SetEncodedHeader($header_name, $header_value);
}
$esender->CreateTextHtmlPart($message_body, $message_type == 'html');
$event->status = $esender->Deliver() ? erSUCCESS : erFAIL;
if ($event->status == erSUCCESS){
// all keys, that are not used in email sending are written to log record
$send_keys = Array ('from_email', 'from_name', 'to_email', 'to_name', 'message');
foreach ($send_keys as $send_key) {
unset($send_params[$send_key]);
}
-
+
$fields_hash = Array (
'fromuser' => $from_name.' ('.$from_email.')',
'addressto' => $to_name.' ('.$to_email.')',
'subject' => $message_subject,
'timestamp' => adodb_mktime(),
'event' => $email_event_name,
'EventParams' => serialize($send_params),
);
-
+
$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'EmailLog');
}
$this->Application->removeObject('u.email-from');
$this->Application->removeObject('u.email-to');
}
}
?>
\ 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.31
\ No newline at end of property
+1.32
\ No newline at end of property
Index: trunk/core/units/general/helpers/multilanguage.php
===================================================================
--- trunk/core/units/general/helpers/multilanguage.php (revision 8103)
+++ trunk/core/units/general/helpers/multilanguage.php (revision 8104)
@@ -1,249 +1,248 @@
<?php
/**
* Performs action on multilingual fields
*
*/
class kMultiLanguageHelper extends kHelper {
var $languageCount = 0;
/**
* Structure of table, that is currently processed
*
* @var Array
*/
var $curStructure = Array();
/**
* Field, to get structure information from
*
* @var string
*/
var $curSourceField = false;
/**
* Indexes used in table of 32
*
* @var int
*/
var $curIndexCount = 0;
/**
* Fields from config, that are currently used
*
* @var Array
*/
var $curFields = Array();
function kMultiLanguageHelper()
{
parent::kHelper();
$this->languageCount = $this->getLanguageCount();
}
/**
* Returns language count in system (always is divisible by 5)
*
*/
function getLanguageCount()
{
$table_name = $this->Application->getUnitOption('lang', 'TableName');
$languages_count = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$table_name);
if (!$languages_count) {
// during installation we have not languages, but we need to created custom field columns
$languages_count = 1;
}
return $languages_count + 5 - ( $languages_count % 5 ? ($languages_count % 5) : 5 );
}
function scanTable($mask)
{
$i = 0;
$fields_found = 0;
$fields = array_keys($this->curStructure);
foreach ($fields as $field_name) {
if (preg_match($mask, $field_name)) {
$fields_found++;
}
}
return $fields_found;
}
function readTableStructure($table_name, $refresh = false)
{
// if ($refresh || !getArrayValue($structure_status, $prefix.'.'.$table_name)) {
$this->curStructure = $this->Conn->Query('DESCRIBE '.$table_name, 'Field');
$this->curIndexCount = count($this->Conn->Query('SHOW INDEXES FROM '.$table_name));
// }
}
/**
* Creates missing multilanguage fields in table by specified prefix
*
* @param string $prefix
* @param bool $refresh Forces config field structure to be re-read from database
*/
function createFields($prefix, $refresh = false)
{
if ($refresh) {
$this->Application->HandleEvent( new kEvent($prefix.':OnCreateCustomFields') );
}
$table_name = $this->Application->getUnitOption($prefix, 'TableName');
$this->curFields = $this->Application->getUnitOption($prefix, 'Fields');
if (!($table_name && $this->curFields) || ($table_name && !$this->Conn->TableFound($table_name))) {
// invalid config found or prefix not found
return true;
}
$sqls = Array();
$this->readTableStructure($table_name, $refresh);
foreach($this->curFields as $field_name => $field_options)
{
if (getArrayValue($field_options, 'formatter') == 'kMultiLanguage') {
if (isset($field_options['master_field'])) {
unset($this->curFields[$field_name]);
continue;
}
$created_count = $this->getCreatedCount($field_name);
$create_count = $this->languageCount - $created_count;
if ($create_count > 0) {
// `l77_Name` VARCHAR( 255 ) NULL DEFAULT '0';
$field_mask = Array();
$field_mask['name'] = 'l%s_'.$field_name;
$field_mask['null'] = getArrayValue($field_options, 'not_null') ? 'NOT NULL' : 'NULL';
if ($this->curSourceField) {
$default_value = $this->getFieldParam('Default') != 'NULL' ? $this->Conn->qstr($this->getFieldParam('Default')) : $this->getFieldParam('Default');
$field_mask['type'] = $this->getFieldParam('Type');
}
else {
$default_value = is_null($field_options['default']) ? 'NULL' : $this->Conn->qstr($field_options['default']);
$field_mask['type'] = $field_options['db_type'];
}
$field_mask['default'] = 'DEFAULT '.$default_value;
-
if (strtoupper($field_mask['type']) == 'TEXT') {
// text fields in mysql doesn't have default value
$field_mask = $field_mask['name'].' '.$field_mask['type'].' '.$field_mask['null'];
}
else {
$field_mask = $field_mask['name'].' '.$field_mask['type'].' '.$field_mask['null'].' '.$field_mask['default'];
}
$sqls[] = 'ALTER TABLE '.$table_name.( $this->generateAlterSQL($field_mask, $created_count + 1, $create_count) );
}
}
}
foreach ($sqls as $sql_query) {
$this->Conn->Query($sql_query);
}
}
function deleteField($prefix, $custom_id)
{
$table_name = $this->Application->getUnitOption($prefix, 'TableName');
$sql = 'DESCRIBE '.$table_name.' "l%_cust_'.$custom_id.'"';
$fields = $this->Conn->GetCol($sql);
$sql = 'ALTER TABLE '.$table_name.' ';
$sql_template = 'DROP COLUMN %s, ';
foreach ($fields as $field_name) {
$sql .= sprintf($sql_template, $field_name);
}
$sql = preg_replace('/(.*), $/', '\\1', $sql);
$this->Conn->Query($sql);
}
/**
* Returns parameter requested of current source field
*
* @param string $param_name
* @return string
*/
function getFieldParam($param_name)
{
return $this->curStructure[$this->curSourceField][$param_name];
}
function getCreatedCount($field_name)
{
$ret = $this->scanTable('/^l[\d]+_'.preg_quote($field_name, '/').'/');
if (!$ret) {
// no multilingual fields at all (but we have such field without language prefix)
$original_found = $this->scanTable('/'.preg_quote($field_name, '/').'/');
$this->curSourceField = $original_found ? $field_name : false;
}
else {
$this->curSourceField = 'l1_'.$field_name;
}
return $ret;
}
/**
* Returns ALTER statement part for adding required fields to table
*
* @param string $field_mask sql mask for creating field with correct definition (type & size)
* @param int $start_index add new fields starting from this index
* @param int $create_count create this much new multilingual field translations
* @return string
*/
function generateAlterSQL($field_mask, $start_index, $create_count)
{
static $single_lang = null;
if (!isset($single_lang)) {
// if single language mode, then create indexes only on primary columns
$table_name = $this->Application->getUnitOption('lang', 'TableName');
$sql = 'SELECT COUNT(*)
FROM '.$table_name.'
WHERE Enabled = 1';
// if language count = 0, then assume it's multi language mode
$single_lang = $this->Conn->GetOne($sql) == 1;
}
$ret = ' ';
$ml_field = preg_replace('/l(.*)_(.*?) (.*)/', '\\2', $field_mask);
$i_count = $start_index + $create_count;
while ($start_index < $i_count) {
list($prev_field,$type) = explode(' ', sprintf($field_mask, $start_index - 1) );
if (substr($prev_field, 0, 3) == 'l0_') {
$prev_field = substr($prev_field, 3, strlen($prev_field));
if (!$this->curSourceField) {
// get field name before this one
$fields = array_keys($this->curFields);
// $prev_field = key(end($this->curStructure));
$prev_field = $fields[array_search($prev_field, $fields) - 1];
if (getArrayValue($this->curFields[$prev_field], 'formatter') == 'kMultiLanguage') {
$prev_field = 'l'.$this->languageCount.'_'.$prev_field;
}
}
}
$field_expression = sprintf($field_mask, $start_index);
$ret .= 'ADD COLUMN '.$field_expression.' AFTER `'.$prev_field.'`, ';
if ($this->curIndexCount < 32 && ($start_index == $this->Application->GetDefaultLanguageId() || !$single_lang)) {
// create index for primary language column + for all others (if multiple languages installed)
list($field_name, $field_params) = explode(' ', $field_expression, 2);
$index_type = isset($this->curFields[$ml_field]['index_type']) ? $this->curFields[$prev_field]['index_type'] : 'string';
$ret .= $index_type == 'string' ? 'ADD INDEX (`'.$field_name.'` (5) ), ' : 'ADD INDEX (`'.$field_name.'`), ';
$this->curIndexCount++;
}
$start_index++;
}
return preg_replace('/, $/',';',$ret);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/helpers/multilanguage.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/inp1_parser.php
===================================================================
--- trunk/core/units/general/inp1_parser.php (revision 8103)
+++ trunk/core/units/general/inp1_parser.php (revision 8104)
@@ -1,155 +1,166 @@
<?php
class Inp1Parser extends kHelper {
-
+
var $InportalInited = false;
-
+
var $InpParsetInited = false;
-
+
function Parse($tname, $template_body)
{
global $objTemplate, $var_list, $var_list_update;
-
+
+ if ($tname == 'email_template') {
+ if ( !$this->InportalInited) {
+ $this->InitInPortal();
+ }
+ // in case Parsing was called through InitInPortal -> moudles -> frontaction -> emailevent
+ // we need to make sure old parser is initialized
+ $this->InitParser();
+ $template_body = $objTemplate->ParseTemplateFromBuffer($tname, $template_body);
+ return $template_body;
+ }
+
if ( !$this->InportalInited) {
//$save_t = $this->Application->GetVar('t');
$this->InitInPortal();
$var_list['t'] = $this->cutTPL($var_list['t']);
if($var_list['t'] != $this->Application->GetVar('t'))
{
$get = $_GET;
unset($get['env'], $get['Action'], $get['_mod_rw_url_'], $get['rewrite']);
$this->Application->StoreVar('K4_Template_Referer', $this->Application->GetVar('t') );
-
+
$this->Application->Redirect($var_list['t'], $get);
}
}
-
+
$var_list['t'] = $this->cutTPL($var_list['t']);
-
+
if ($var_list['t'] != $this->Application->GetVar('t')) {
//$var_list['t'] = rtrim($var_list['t'],'.tpl');
$t = $var_list['t'];
$this->Application->SetVar('t', $t);
$template_cache =& $this->Application->recallObject('TemplatesCache');
$template_body = $this->Application->Parser->Parse( $template_cache->GetTemplateBody($t), $t, 0 );
}
else {
$this->InitParser();
$template_body = $objTemplate->ParseTemplateFromBuffer($tname, $template_body);
}
return $template_body;
}
-
+
function cutTPL($tname)
{
if( substr($tname,-4) == '.tpl' )
{
return substr($tname, 0, strlen($tname)-4 );
}
return $tname;
}
-
+
function InitParser()
{
global $objTemplate, $CurrentTheme, $objThemes, $objLanguageCache, $var_list;
if ($this->InpParsetInited) return true;
-
+
$theme_id = $this->Application->IsAdmin() ? 1 : $this->Application->GetVar('m_theme');
if ($theme_id) {
$CurrentTheme = $objThemes->GetItem($theme_id);
-
+
$timeout = $CurrentTheme->Get('CacheTimeout');
$objLanguageCache->LoadTemplateCache($var_list['t'], $timeout, $theme_id);
$objLanguageCache->LoadCachedVars($this->Application->GetVar('m_lang'));
-
+
$objTemplate = new clsTemplateList(FULL_PATH.THEMES_PATH.'/');
}
-
+
$this->InpParsetInited = true;
}
-
+
function InitInPortal()
{
$this->InportalInited = true;
- /*global $pathtoroot, $FrontEnd, $indexURL, $rootURL, $secureURL, $var_list, $CurrentTheme,
- $objThemes, $objConfig, $m_var_list, $timeout, $objLanguages, $objLanguageCache,
- $TemplateRoot, $objTemplate, $html, $objSession, $Errors, $objCatList, $objUsers,
+ /*global $pathtoroot, $FrontEnd, $indexURL, $rootURL, $secureURL, $var_list, $CurrentTheme,
+ $objThemes, $objConfig, $m_var_list, $timeout, $objLanguages, $objLanguageCache,
+ $TemplateRoot, $objTemplate, $html, $objSession, $Errors, $objCatList, $objUsers,
$env, $mod_prefix, $ExtraVars, $timestart, $timeend, $timeout, $sqlcount, $totalsql,
$template_path, $modules_loaded, $mod_root_cats, $objModules, $objItemTypes;*/
-
-
- global $sec, $usec, $timestart, $pathtoroot, $FrontEnd, $indexURL, $kernel_version, $FormError,
- $FormValues, $ItemTables, $KeywordIgnore, $debuglevel,
- $LogLevel, $LogFile, $rq_value, $rq_name, $dbg_constMap, $dbg_constValue, $dbg_constName,
- $debugger, $g_LogFile, $LogData, $Errors,
- $g_DebugMode, $totalsql, $sqlcount, $objConfig, $ItemTypePrefixes, $ItemTagFiles, $objModules,
+
+
+ global $sec, $usec, $timestart, $pathtoroot, $FrontEnd, $indexURL, $kernel_version, $FormError,
+ $FormValues, $ItemTables, $KeywordIgnore, $debuglevel,
+ $LogLevel, $LogFile, $rq_value, $rq_name, $dbg_constMap, $dbg_constValue, $dbg_constName,
+ $debugger, $g_LogFile, $LogData, $Errors,
+ $g_DebugMode, $totalsql, $sqlcount, $objConfig, $ItemTypePrefixes, $ItemTagFiles, $objModules,
$objSystemCache, $objBanList, $objItemTypes, $objThemes, $objLanguages, $objImageList, $objFavorites,
- $objUsers, $objGroups, $DownloadId, $objPermissions, $objPermCache, $m_var_list, $objCatList,
- $objCustomFieldList, $objCustomDataList, $objCountCache, $CRLF, $objMessageList, $objEmailQueue,
- $ExtraVars, $adodbConnection, $sql, $rs, $mod_prefix, $modules_loaded, $name,
- $template_path, $mod_root_cats, $value, $mod, $ItemTypes,
- $ParserFiles, $SessionQueryString, $var_list, $objSession,
- $orderByClause, $TemplateRoot, $ip, $UseSession, $Action, $CookieTest, $sessionId,
- $var_list_update, $CurrentTheme, $UserID, $objCurrentUser, $objLanguageCache,
- $folder_name, $objLinkList, $tag_override, $timeZones, $siteZone, $serverZone,
- $lastExpire, $diffZone, $date, $nowDate, $lastExpireDate, $SearchPerformed,
- $TotalMessagesSent, $ado, $adminDir, $rootURL, $secureURL, $html, $timeout,
+ $objUsers, $objGroups, $DownloadId, $objPermissions, $objPermCache, $m_var_list, $objCatList,
+ $objCustomFieldList, $objCustomDataList, $objCountCache, $CRLF, $objMessageList, $objEmailQueue,
+ $ExtraVars, $adodbConnection, $sql, $rs, $mod_prefix, $modules_loaded, $name,
+ $template_path, $mod_root_cats, $value, $mod, $ItemTypes,
+ $ParserFiles, $SessionQueryString, $var_list, $objSession,
+ $orderByClause, $TemplateRoot, $ip, $UseSession, $Action, $CookieTest, $sessionId,
+ $var_list_update, $CurrentTheme, $UserID, $objCurrentUser, $objLanguageCache,
+ $folder_name, $objLinkList, $tag_override, $timeZones, $siteZone, $serverZone,
+ $lastExpire, $diffZone, $date, $nowDate, $lastExpireDate, $SearchPerformed,
+ $TotalMessagesSent, $ado, $adminDir, $rootURL, $secureURL, $html, $timeout,
$pathchar, $objTemplate, $objTopicList, $objArticleList, $objPostingList, $objCensorList,
$objSmileys, $objPMList, $SubscribeAddress, $SubscribeError, $SubscribeResult, $application;
-
+
$pathtoroot = FULL_PATH.'/';
-
+
if (!file_exists(FULL_PATH.'/config.php')) {
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='admin/install.php'>Go to installation script</a><br><br>";
flush();
$this->Application->ApplicationDie();
}
-
+
//ob_start();
$FrontEnd = 1;
-
+
$indexURL="../../index.php"; //Set to relative URL from the theme directory
-
+
/* initalize the in-portal system */
include_once(FULL_PATH."/kernel/startup.php");
-
+
$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
$secureURL = $rootURL;
-
+
if( !$var_list['t'] ) $var_list['t'] = 'index';
-
+
$this->InitParser();
-
+
// process referer in session: begin
if (is_object($objSession)) {
$k4_referer = $objSession->GetVariable('K4_Template_Referer');
if ($k4_referer) {
$_local_t = $k4_referer;
$this->Application->RemoveVar('K4_Template_Referer');
}
$objSession->SetVariable('Template_Referer', isset($_local_t) ? $_local_t : '');
}
// process referer in session: end
-
+
if ($this->Application->isDebugMode() && $Action) {
$this->Application->Debugger->setHTMLByIndex(1, 'Front Action: <b>'.$Action.'</b>', 'append');
}
-
+
LogEntry("Output Complete\n");
$objLanguageCache->SaveTemplateCache();
LogEntry("Templates Cached\n");
-
+
$timeend = getmicrotime();
$diff = $timeend - $timestart;
-
+
LogEntry("\nTotal Queries Executed: $sqlcount in $totalsql seconds\n");
LogEntry("\nPage Execution Time: $diff seconds\n", true);
if ($LogFile) {
fclose($LogFile);
}
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/general/inp1_parser.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.17
\ No newline at end of property
+1.18
\ No newline at end of property
Index: trunk/core/units/general/cat_event_handler.php
===================================================================
--- trunk/core/units/general/cat_event_handler.php (revision 8103)
+++ trunk/core/units/general/cat_event_handler.php (revision 8104)
@@ -1,1738 +1,1750 @@
<?php
$application =& kApplication::Instance();
$application->Factory->includeClassFile('kDBEventHandler');
class kCatDBEventHandler extends kDBEventHandler {
/**
* Allows to override standart permission mapping
*
*/
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnExport' => Array('self' => 'view|advanced:export'),
'OnExportBegin' => Array('self' => 'view|advanced:export'),
'OnSaveSettings' => Array('self' => 'add|edit|advanced:import'),
'OnBeforeDeleteOriginal' => Array('self' => 'edit|advanced:approve'),
'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 = implode(',', $this->getSelectedIDs($event, true));
if (!$selected_ids) {
$selected_ids = 0; // when saving newly created item (OnPreCreate -> OnPreSave -> OnSave)
}
}
- $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 (strlen($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_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;
+ if (!$perm_value) {
+ $event->status = erPERM_FAIL;
+ }
+ }
+ else {
+ trigger_error('IDs not passed to '.$event->getPrefixSpecial().':CheckPermission', E_USER_WARNING);
}
return $perm_value;
}
return parent::CheckPermission($event);
}
/**
* Add selected items to clipboard with mode = COPY (CLONE)
*
* @param kEvent $event
*/
function OnCopy(&$event)
{
$this->Application->RemoveVar('clipboard');
$clipboard_helper =& $this->Application->recallObject('ClipboardHelper');
$clipboard_helper->setClipboard($event, 'copy', $this->StoreSelectedIDs($event));
}
/**
* Add selected items to clipboard with mode = CUT
*
* @param kEvent $event
*/
function OnCut(&$event)
{
$this->Application->RemoveVar('clipboard');
$clipboard_helper =& $this->Application->recallObject('ClipboardHelper');
$clipboard_helper->setClipboard($event, 'cut', $this->StoreSelectedIDs($event));
}
/**
* Performs category item paste
*
* @param kEvent $event
*/
function OnPaste(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
return;
}
$clipboard_data = $event->getEventParam('clipboard_data');
if (!$clipboard_data['cut'] && !$clipboard_data['copy']) {
return false;
}
if ($clipboard_data['copy']) {
$temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$this->Application->SetVar('ResetCatBeforeClone', 1);
$temp->CloneItems($event->Prefix, $event->Special, $clipboard_data['copy']);
}
if ($clipboard_data['cut']) {
$object =& $this->Application->recallObject($event->getPrefixSpecial().'.item', $event->Prefix, Array('skip_autoload' => true));
foreach ($clipboard_data['cut'] as $id) {
$object->Load($id);
$object->MoveToCat();
}
}
}
/**
* 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).')');
$object->addFilter('primary_filter', 'PrimaryCat = 1');
}
else {
$object->addFilter('category_filter', TABLE_PREFIX.'CategoryItems.CategoryId = '.$parent_cat_id );
}
}
}
else {
$object->addFilter('primary_filter', 'PrimaryCat = 1');
}
// add permission filter
if ($this->Application->RecallVar('user_id') == -1) {
// for "root" CATEGORY.VIEW permission is checked for items lists too
$view_perm = 1;
}
else {
// for any real user itemlist view permission is checked instead of CATEGORY.VIEW
$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);
if ($types) {
$types_array = explode(',', $types);
for ($i = 0; $i < sizeof($types_array); $i++) {
$type = trim($types_array[$i]);
if (isset($type_clauses[$type])) {
if ($type_clauses[$type]['having_filter']) {
$includes_or_filter_h->removeFilter('filter_'.$type);
$includes_or_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['include']);
}else {
$includes_or_filter->removeFilter('filter_'.$type);
$includes_or_filter->addFilter('filter_'.$type, $type_clauses[$type]['include']);
}
}
}
}
if ($except_types) {
$except_types_array = explode(',', $except_types);
for ($i = 0; $i < sizeof($except_types_array); $i++) {
$type = trim($except_types_array[$i]);
if (isset($type_clauses[$type])) {
if ($type_clauses[$type]['having_filter']) {
$excepts_and_filter_h->removeFilter('filter_'.$type);
$excepts_and_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['except']);
}else {
$excepts_and_filter->removeFilter('filter_'.$type);
$excepts_and_filter->addFilter('filter_'.$type, $type_clauses[$type]['except']);
}
}
}
}
/*if ( !$this->Application->IsAdmin() ) {
$object->addFilter('expire_filter', '%1$s.Expire IS NULL OR %1$s.Expire > UNIX_TIMESTAMP()');
}*/
/*$list_type = $event->getEventParam('ListType');
switch($list_type)
{
case 'favorites':
$fav_table = $this->Application->getUnitOption('fav','TableName');
$user_id =& $this->Application->RecallVar('user_id');
$sql = 'SELECT DISTINCT f.ResourceId
FROM '.$fav_table.' f
LEFT JOIN '.$object->TableName.' p ON p.ResourceId = f.ResourceId
WHERE f.PortalUserId = '.$user_id;
$ids = $this->Conn->GetCol($sql);
if(!$ids) $ids = Array(-1);
$object->addFilter('category_filter', TABLE_PREFIX.'CategoryItems.PrimaryCat = 1');
$object->addFilter('favorites_filter', '%1$s.`ResourceId` IN ('.implode(',',$ids).')');
break;
case 'search':
$search_results_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$sql = ' SELECT DISTINCT ResourceId
FROM '.$search_results_table.'
WHERE ItemType=11';
$ids = $this->Conn->GetCol($sql);
if(!$ids) $ids = Array(-1);
$object->addFilter('search_filter', '%1$s.`ResourceId` IN ('.implode(',',$ids).')');
break;
} */
$object->addFilter('includes_filter', $includes_or_filter);
$object->addFilter('excepts_filter', $excepts_and_filter);
$object->addFilter('includes_filter_h', $includes_or_filter_h, HAVING_FILTER);
$object->addFilter('excepts_filter_h', $excepts_and_filter_h, HAVING_FILTER);
}
/**
* Adds calculates fields for item statuses
*
* @param kCatDBItem $object
* @param kEvent $event
*/
function prepareObject(&$object, &$event)
{
$this->prepareItemStatuses($event);
$object->addCalculatedField('CachedNavbar', 'l'.$this->Application->GetVar('m_lang').'_CachedNavbar');
if ($event->Special == 'export' || $event->Special == 'import')
{
$export_helper =& $this->Application->recallObject('CatItemExportHelper');
$export_helper->prepareExportColumns($event);
}
}
/**
* Creates calculated fields for all item statuses based on config settings
*
* @param kEvent $event
*/
function prepareItemStatuses(&$event)
{
$object =& $event->getObject( Array('skip_autoload' => true) );
$property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings');
if (!$property_map) {
return ;
}
// new items
$object->addCalculatedField('IsNew', ' IF(%1$s.NewItem = 2,
IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - '.
$this->Application->ConfigValue($property_map['NewDays']).
'*3600*24), 1, 0),
%1$s.NewItem
)');
// hot items (cache updated every hour)
$sql = 'SELECT Data
FROM '.TABLE_PREFIX.'Cache
WHERE (VarName = "'.$property_map['HotLimit'].'") AND (Cached >'.(adodb_mktime() - 3600).')';
$hot_limit = $this->Conn->GetOne($sql);
if ($hot_limit === false) {
$hot_limit = $this->CalculateHotLimit($event);
}
$object->addCalculatedField('IsHot', ' IF(%1$s.HotItem = 2,
IF(%1$s.'.$property_map['ClickField'].' >= '.$hot_limit.', 1, 0),
%1$s.HotItem
)');
// popular items
$object->addCalculatedField('IsPop', ' IF(%1$s.PopItem = 2,
IF(%1$s.CachedVotesQty >= '.
$this->Application->ConfigValue($property_map['MinPopVotes']).
' AND %1$s.CachedRating >= '.
$this->Application->ConfigValue($property_map['MinPopRating']).
', 1, 0),
%1$s.PopItem)');
}
function CalculateHotLimit(&$event)
{
$property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings');
if (!$property_map) {
return;
}
$click_field = $property_map['ClickField'];
$last_hot = $this->Application->ConfigValue($property_map['MaxHotNumber']) - 1;
$sql = 'SELECT '.$click_field.' FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
ORDER BY '.$click_field.' DESC
LIMIT '.$last_hot.', 1';
$res = $this->Conn->GetCol($sql);
$hot_limit = (double)array_shift($res);
$this->Conn->Query('REPLACE INTO '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("'.$property_map['HotLimit'].'", "'.$hot_limit.'", '.adodb_mktime().')');
return $hot_limit;
return 0;
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnBeforeItemUpdate(&$event)
{
$property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings');
if (!$property_map) {
return;
}
$click_field = $property_map['ClickField'];
$object =& $event->getObject();
if( $this->Application->IsAdmin() && ($this->Application->GetVar($click_field.'_original') !== false) &&
floor($this->Application->GetVar($click_field.'_original')) != $object->GetDBField($click_field) )
{
$sql = 'SELECT MAX('.$click_field.') FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
WHERE FLOOR('.$click_field.') = '.$object->GetDBField($click_field);
$hits = ( $res = $this->Conn->GetOne($sql) ) ? $res + 0.000001 : $object->GetDBField($click_field);
$object->SetDBField($click_field, $hits);
}
}
/**
* Load price from temp table if product mode is temp table
*
* @param kEvent $event
*/
function OnAfterItemLoad(&$event)
{
$special = substr($event->Special, -6);
$object =& $event->getObject();
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;
}
+ elseif (!$this->Application->IsAdmin() && $object->GetDBField('Status') != 1 && $object->Prefix != 'cms') {
+ header('HTTP/1.0 404 Not Found');
+ while (ob_get_level()) { ob_end_clean(); }
+ $this->Application->HTML = $this->Application->ParseBlock(array('name'=>$this->Application->ConfigValue('ErrorTemplate')));
+ $this->Application->Done();
+ exit();
+ }
}
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');
$items_table = $this->Application->getUnitOption($event->Prefix, 'TableName');
$module_name = $this->Application->findModule('Var', $event->Prefix, 'Name');
$sql = ' SELECT * FROM '.$this->Application->getUnitOption('confs', 'TableName').'
WHERE ModuleName="'.$module_name.'"
AND SimpleSearch=1';
$search_config = $this->Conn->Query($sql, 'FieldName');
$field_list = array_keys($search_config);
$join_clauses = Array();
// field processing
$weight_sum = 0;
$alias_counter = 0;
$custom_fields = $this->Application->getUnitOption($event->Prefix, 'CustomFields');
if ($custom_fields) {
$custom_table = $this->Application->getUnitOption($event->Prefix.'-cdata', 'TableName');
$join_clauses[] = ' LEFT JOIN '.$custom_table.' custom_data ON '.$items_table.'.ResourceId = custom_data.ResourceId';
}
// what field in search config becomes what field in sql (key - new field, value - old field (from searchconfig table))
$search_config_map = Array();
foreach ($field_list as $key => $field) {
$options = $object->getFieldOptions($field);
$local_table = TABLE_PREFIX.$search_config[$field]['TableName'];
$weight_sum += $search_config[$field]['Priority']; // counting weight sum; used when making relevance clause
// processing multilingual fields
if (getArrayValue($options, 'formatter') == 'kMultiLanguage') {
$field_list[$key.'_primary'] = 'l'.$this->Application->GetDefaultLanguageId().'_'.$field;
$field_list[$key] = 'l'.$lang.'_'.$field;
if(!isset($search_config[$field]['ForeignField']))
{
$field_list[$key.'_primary'] = $local_table.'.'.$field_list[$key.'_primary'];
$search_config_map[ $field_list[$key.'_primary'] ] = $field;
}
}
// processing fields from other tables
if($foreign_field = $search_config[$field]['ForeignField'])
{
$exploded = explode(':', $foreign_field, 2);
if($exploded[0] == 'CALC')
{
unset($field_list[$key]);
continue; // ignoring having type clauses in simple search
/*$user_groups = $this->Application->RecallVar('UserGroups');
$having_list[$key] = str_replace('{PREFIX}', TABLE_PREFIX, $exploded[1]);
$join_clause = str_replace('{PREFIX}', TABLE_PREFIX, $search_config[$field]['JoinClause']);
$join_clause = str_replace('{USER_GROUPS}', $user_groups, $join_clause);
$join_clause = ' LEFT JOIN '.$join_clause;
$join_clauses[] = $join_clause;*/
}
else
{
$multi_lingual = false;
if ($exploded[0] == 'MULTI')
{
$multi_lingual = true;
$foreign_field = $exploded[1];
}
$exploded = explode('.', $foreign_field); // format: table.field_name
$foreign_table = TABLE_PREFIX.$exploded[0];
$alias_counter++;
$alias = 't'.$alias_counter;
if ($multi_lingual) {
$field_list[$key] = $alias.'.'.'l'.$lang.'_'.$exploded[1];
$field_list[$key.'_primary'] = 'l'.$this->Application->GetDefaultLanguageId().'_'.$field;
$search_config_map[ $field_list[$key] ] = $field;
$search_config_map[ $field_list[$key.'_primary'] ] = $field;
}
else {
$field_list[$key] = $alias.'.'.$exploded[1];
$search_config_map[ $field_list[$key] ] = $field;
}
$join_clause = str_replace('{ForeignTable}', $alias, $search_config[$field]['JoinClause']);
$join_clause = str_replace('{LocalTable}', $items_table, $join_clause);
$join_clauses[] = ' LEFT JOIN '.$foreign_table.' '.$alias.'
ON '.$join_clause;
}
}
else {
// processing fields from local table
if ($search_config[$field]['CustomFieldId']) {
$local_table = 'custom_data';
$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 '.$items_table.'.Status=1';
if($this->Application->GetVar('Action') == 'm_simple_subsearch') // subsearch, In-portal
{
if( $event->getEventParam('ResultIds') )
{
$where_clause .= ' AND '.$items_table.'.ResourceId IN ('.implode(',', $event->specificParams['ResultIds']).')';
}
}
if( $event->MasterEvent && $event->MasterEvent->Name == 'OnListBuild' ) // subsearch, k4
{
if( $event->MasterEvent->getEventParam('ResultIds') )
{
$where_clause .= ' AND '.$items_table.'.ResourceId IN ('.implode(',', $event->MasterEvent->getEventParam('ResultIds')).')';
}
}
// making relevance clause
$positive_words = $search_helper->getPositiveKeywords($keywords);
$this->Application->StoreVar('highlight_keywords', serialize($positive_words));
$revelance_parts = Array();
reset($search_config);
foreach ($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)';
}
}
$conf_postfix = $this->Application->getUnitOption($event->Prefix, 'SearchConfigPostfix');
$rel_keywords = $this->Application->ConfigValue('SearchRel_Keyword_'.$conf_postfix) / 100;
$rel_pop = $this->Application->ConfigValue('SearchRel_Pop_'.$conf_postfix) / 100;
$rel_rating = $this->Application->ConfigValue('SearchRel_Rating_'.$conf_postfix) / 100;
$relevance_clause = '('.implode(' + ', $revelance_parts).') / '.$weight_sum.' * '.$rel_keywords;
if ($rel_pop && isset($object->Fields['Hits'])) {
$relevance_clause .= ' + (Hits + 1) / (MAX(Hits) + 1) * '.$rel_pop;
}
if ($rel_rating && isset($object->Fields['CachedRating'])) {
$relevance_clause .= ' + (CachedRating + 1) / (MAX(CachedRating) + 1) * '.$rel_rating;
}
// building final search query
if (!$this->Application->GetVar('do_not_drop_search_table') && !$this->Application->GetVar('INPORTAL_ON')) {
$this->Conn->Query('DROP TABLE IF EXISTS '.$search_table); // erase old search table if clean k4 event
$this->Application->SetVar('do_not_drop_search_table', true);
}
$search_table_exists = $this->Conn->Query('SHOW TABLES LIKE "'.$search_table.'"');
if ($search_table_exists) {
$select_intro = 'INSERT INTO '.$search_table.' (Relevance, ItemId, ResourceId, ItemType, EdPick) ';
}
else {
$select_intro = 'CREATE TABLE '.$search_table.' AS ';
}
$edpick_clause = $this->Application->getUnitOption($event->Prefix.'.EditorsPick', 'Fields') ? $items_table.'.EditorsPick' : '0';
$sql = $select_intro.' SELECT '.$relevance_clause.' AS Relevance,
'.$items_table.'.'.$this->Application->getUnitOption($event->Prefix, 'IDField').' AS ItemId,
'.$items_table.'.ResourceId,
'.$this->Application->getUnitOption($event->Prefix, 'ItemType').' AS ItemType,
'.$edpick_clause.' AS EdPick
FROM '.$object->TableName.'
'.implode(' ', $join_clauses).'
WHERE '.$where_clause.'
GROUP BY '.$items_table.'.'.$this->Application->getUnitOption($event->Prefix, 'IDField');
$res = $this->Conn->Query($sql);
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnSubSearch(&$event)
{
$search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search';
$sql = 'SHOW TABLES LIKE "'.$search_table.'"';
if($this->Conn->Query($sql))
{
$sql = 'SELECT DISTINCT ResourceId FROM '.$search_table;
$ids = $this->Conn->GetCol($sql);
}
$event->setEventParam('ResultIds', $ids);
$event->CallSubEvent('OnSimpleSearch');
}
/**
* Enter description here...
*
* @param kEvent $event
* @todo Change all hardcoded Products table & In-Commerce module usage to dynamic usage from item config !!!
*/
function OnAdvancedSearch(&$event)
{
$query_object =& $this->Application->recallObject('HTTPQuery');
if(!isset($query_object->Post['andor']))
{
return; // used when navigating by pages or changing sorting in search results
}
$this->Application->RemoveVar('keywords');
$this->Application->RemoveVar('Search_Keywords');
$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);
$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 === */
/**
* Shows export dialog
*
* @param kEvent $event
*/
function OnExport(&$event)
{
// use old fasion (in-portal) grid
$selector_name = $this->Application->getUnitOption($event->Prefix, 'CatalogSelectorName');
if ($selector_name) {
$selected_ids = $this->Application->GetVar($selector_name);
}
else {
$selected_ids = $this->StoreSelectedIDs($event);
if (implode(',', $selected_ids) == '') {
// K4 fix when no ids found bad selected ids array is formed
$selected_ids = false;
}
}
$selected_cats_ids = $this->Application->GetVar('export_categories');
$this->Application->StoreVar($event->Prefix.'_export_ids', $selected_ids ? implode(',', $selected_ids) : '' );
$this->Application->StoreVar($event->Prefix.'_export_cats_ids', $selected_cats_ids);
$export_helper =& $this->Application->recallObject('CatItemExportHelper');
$event->redirect = $export_helper->getModuleFolder($event).'/export';
$redirect_params = Array( 'm_opener' => 'd',
$this->Prefix.'.export_event' => 'OnNew',
'pass' => 'all,'.$this->Prefix.'.export');
$event->setRedirectParams($redirect_params);
}
/**
* Performs each export step & displays progress percent
*
* @param kEvent $event
*/
function OnExportProgress(&$event)
{
$export_object =& $this->Application->recallObject('CatItemExportHelper');
/* @var $export_object kCatDBItemExportHelper */
$event = new kEvent($event->getPrefixSpecial().':OnDummy');
$action_method = 'perform'.ucfirst($event->Special);
$field_values = $export_object->$action_method($event);
// finish code is done from JS now
if ($field_values['start_from'] == $field_values['total_records']) {
if ($event->Special == 'import') {
$this->Application->StoreVar('PermCache_UpdateRequired', 1);
$this->Application->Redirect('in-portal/categories/cache_updater', Array('m_opener' => 'r', 'pass' => 'm', 'continue' => 1, 'no_amp' => 1));
}
elseif ($event->Special == 'export') {
$template = $this->Application->getUnitOption($event->Prefix, 'ModuleFolder').'/'.$event->Special.'_finish';
$this->Application->Redirect($template, Array('pass' => 'all'));
}
}
$export_options = $export_object->loadOptions($event);
echo $export_options['start_from'] * 100 / $export_options['total_records'];
-
+
$event->status = erSTOP;
}
-
+
/**
* Returns specific to each item type columns only
*
* @param kEvent $event
* @return Array
*/
function getCustomExportColumns(&$event)
{
return Array( '__VIRTUAL__ThumbnailImage' => 'ThumbnailImage',
'__VIRTUAL__FullImage' => 'FullImage',
'__VIRTUAL__ImageAlt' => 'ImageAlt');
}
/**
* Sets non standart virtual fields (e.g. to other tables)
*
* @param kEvent $event
*/
function setCustomExportColumns(&$event)
{
$this->restorePrimaryImage($event);
}
/**
* Create/Update primary image record in info found in imported data
*
* @param kEvent $event
*/
function restorePrimaryImage(&$event)
{
$object =& $event->getObject();
$has_image_info = $object->GetDBField('ImageAlt') && ($object->GetDBField('ThumbnailImage') || $object->GetDBField('FullImage'));
if (!$has_image_info) {
return false;
}
$image_data = $object->getPrimaryImageData();
$image =& $this->Application->recallObject('img', null, Array('skip_autoload' => true));
if ($image_data) {
$image->Load($image_data['ImageId']);
}
else {
$image->Clear();
$image->SetDBField('Name', 'main');
$image->SetDBField('DefaultImg', 1);
$image->SetDBField('ResourceId', $object->GetDBField('ResourceId'));
}
$image->SetDBField('AltName', $object->GetDBField('ImageAlt'));
if ($object->GetDBField('ThumbnailImage')) {
$thumbnail_field = $this->isURL( $object->GetDBField('ThumbnailImage') ) ? 'ThumbUrl' : 'ThumbPath';
$image->SetDBField($thumbnail_field, $object->GetDBField('ThumbnailImage') );
$image->SetDBField('LocalThumb', $thumbnail_field == 'ThumbPath' ? 1 : 0);
}
if (!$object->GetDBField('FullImage')) {
$image->SetDBField('SameImages', 1);
}
else {
$image->SetDBField('SameImages', 0);
$full_field = $this->isURL( $object->GetDBField('FullImage') ) ? 'Url' : 'LocalPath';
$image->SetDBField($full_field, $object->GetDBField('FullImage') );
$image->SetDBField('LocalImage', $full_field == 'LocalPath' ? 1 : 0);
}
if ($image->isLoaded()) {
$image->Update();
}
else {
$image->Create();
}
}
function isURL($path)
{
return preg_match('#(http|https)://(.*)#', $path);
}
/**
* Prepares item for import/export operations
*
* @param kEvent $event
*/
function OnNew(&$event)
{
parent::OnNew($event);
if ($event->Special != 'import' && $event->Special != 'export') return ;
$export_helper =& $this->Application->recallObject('CatItemExportHelper');
$export_helper->setRequiredFields($event);
$this->Application->StoreVar('ImportCategory', 0);
}
/**
* Process items selected in item_selector
*
* @param kEvent $event
*/
function OnProcessSelected(&$event)
{
$selected_ids = $this->Application->GetVar('selected_ids');
$dst_field = $this->Application->RecallVar('dst_field');
if ($dst_field == 'ItemCategory') {
// Item Edit -> Categories Tab -> New Categories
$object =& $event->getObject();
$category_ids = explode(',', $selected_ids['c']);
foreach ($category_ids as $category_id) {
$object->assignToCategory($category_id);
}
}
if ($dst_field == 'ImportCategory') {
// Tools -> Import -> Item Import -> Select Import Category
$this->Application->StoreVar('ImportCategory', $selected_ids['c']);
// $this->Application->StoreVar($event->getPrefixSpecial().'_ForceNotValid', 1); // not to loose import/export values on form refresh
$this->Application->SetVar($event->getPrefixSpecial().'_id', 0);
$this->Application->SetVar($event->getPrefixSpecial().'_event', 'OnExportBegin');
$passed = $this->Application->GetVar('passed');
$this->Application->SetVar('passed', $passed.','.$event->getPrefixSpecial());
$event->setEventParam('pass_events', true);
}
$this->finalizePopup($event);
}
/**
* Saves Import/Export settings to session
*
* @param kEvent $event
*/
function OnSaveSettings(&$event)
{
$event->redirect = false;
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info) {
list($id, $field_values) = each($items_info);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->SetFieldsFromHash($field_values);
$field_values['ImportFilename'] = $object->GetDBField('ImportFilename'); //if upload formatter has renamed the file during moving !!!
$field_values['ImportSource'] = 2;
$field_values['ImportLocalFilename'] = $object->GetDBField('ImportFilename');
$items_info[$id] = $field_values;
$this->Application->StoreVar($event->getPrefixSpecial().'_ItemsInfo', serialize($items_info));
}
}
function OnCancelAction(&$event)
{
$event->redirect_params = Array('pass' => 'all,'.$event->GetPrefixSpecial());
$event->redirect = $this->Application->GetVar('cancel_template');
}
/* === RELATED TO IMPORT/EXPORT: END === */
/**
* Stores item's owner login into separate field together with id
*
* @param kEvent $event
* @param string $id_field
* @param string $cached_field
*/
function cacheItemOwner(&$event, $id_field, $cached_field)
{
$object =& $event->getObject();
$user_id = $object->GetDBField($id_field);
$options = $object->GetFieldOptions($id_field);
if (isset($options['options'][$user_id])) {
$object->SetDBField($cached_field, $options['options'][$user_id]);
}
else {
$id_field = $this->Application->getUnitOption('u', 'IDField');
$table_name = $this->Application->getUnitOption('u', 'TableName');
$sql = 'SELECT Login
FROM '.$table_name.'
WHERE '.$id_field.' = '.$user_id;
$object->SetDBField($cached_field, $this->Conn->GetOne($sql));
}
}
/**
* Saves item beeing edited into temp table
*
* @param kEvent $event
*/
function OnPreSave(&$event)
{
parent::OnPreSave($event);
$use_pending_editing = $this->Application->getUnitOption($event->Prefix, 'UsePendingEditing');
if ($event->status == erSUCCESS && $use_pending_editing) {
// decision: clone or not clone
$object =& $event->getObject();
if ($object->GetID() == 0 || $object->GetDBField('OrgId') > 0) {
// new items or cloned items shouldn't be cloned again
return true;
}
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
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 = $this->getSelectedIDs($event, true);
$selected_ids[ array_search($object->GetID(), $selected_ids) ] = $cloned_ids[0];
$this->StoreSelectedIDs($event, $selected_ids);
// 6. delete original item from temp table
$temp_handler->DeleteItems($event->Prefix, $event->Special, Array($object->GetID()));
}
}
}
/**
* Sets default expiration based on module setting
*
* @param kEvent $event
*/
function OnPreCreate(&$event)
{
parent::OnPreCreate($event);
if ($event->status == erSUCCESS) {
$object =& $event->getObject();
$object->SetDBField('CreatedById', $this->Application->RecallVar('user_id'));
}
}
/**
* Occures before original item of item in pending editing got deleted (for hooking only)
*
* @param kEvent $event
*/
function OnBeforeDeleteOriginal(&$event)
{
}
/**
* Occures before an item is cloneded
* Id of ORIGINAL item is passed as event' 'id' param
* Do not call object' Update method in this event, just set needed fields!
*
* @param kEvent $event
*/
function OnBeforeClone(&$event)
{
if ($this->Application->GetVar('ResetCatBeforeClone')) {
$object =& $event->getObject();
$object->SetDBField('CategoryId', null);
}
}
/**
* 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.71
\ No newline at end of property
+1.72
\ No newline at end of property
Index: trunk/core/admin_templates/incs/grid_blocks.tpl
===================================================================
--- trunk/core/admin_templates/incs/grid_blocks.tpl (revision 8103)
+++ trunk/core/admin_templates/incs/grid_blocks.tpl (revision 8104)
@@ -1,484 +1,483 @@
<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_DefineElement name="search_main_toolbar">
</inp2:m_DefineElement>
<inp2:m_block name="grid_pagination" SearchPrefixSpecial="" ajax="0"/>
<table cellspacing="0" cellpadding="0" 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>
<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" grid="$grid"/>
</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_pagination_elem" ajax="0">
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_search" ajax="0">
<td align="right" class="search-cell">
<table cellspacing="0" cellpadding="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"/>" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);" style="border: 1px solid grey;" />
- <input type="text" style="display: none"; />
+ <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"/>" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);" class="search-box"/>
+ <input type="text" style="display: none;"/>
</td>
- <td style="white-space: nowrap" id="search_buttons[<inp2:m_param name="PrefixSpecial"/>]">
+ <td style="white-space: nowrap;" id="search_buttons[<inp2:m_param name="PrefixSpecial"/>]">
<div style="white-space: nowrap;"></div>
- <script type="text/javascript">
- <inp2:m_RenderElement name="grid_search_buttons" pass_params="true"/>
- </script>
-
+ <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">
Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'] = new ToolBar('icon16_');
Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].IconSize = {w:22,h:22};
Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].UseLabels = false;
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" ajax="0"/>
<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="" module="" />
<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 module="$module"/>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="" module="" />
<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 module="$module"/>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="" module="" />
<td valign="top" class="text">
<table border="0" cellpadding="0" cellspacing="0" class="grid_id_cell">
<tr>
<td><img src="<inp2:ModulePath module="$module"/>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="" module=""/>
<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 module="$module"/>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_style="" currency=""/>
<td valign="top" class="text" style="<inp2:m_param name="td_style"/>"><inp2:$PrefixSpecial_field field="$field" first_chars="$first_chars" currency="$currency" nl2br="$nl2br" grid="$grid" no_special="$no_special" format="$format"/></td>
<inp2:m_blockend />
<inp2:m_block name="grid_edit_td" format="" />
<td valign="top" class="text"><input type="text" id="<inp2:$PrefixSpecial_InputName field="$field"/>" name="<inp2:$PrefixSpecial_InputName field="$field"/>" value="<inp2:$PrefixSpecial_field field="$field" grid="$grid" format="$format"/>"></td>
<inp2:m_blockend />
<inp2:m_block name="grid_data_label_td" />
<td valign="top" class="text"><inp2:$PrefixSpecial_field field="$field" grid="$grid" plus_or_as_label="1" no_special="no_special" format="$format"/></td>
<inp2:m_blockend />
<inp2:m_block name="grid_data_label_ml_td" format="" />
<td valign="top" class="text">
<span class="<inp2:m_if check="{$SourcePrefix}_HasError" field="$virtual_field">error</inp2:m_if>">
<inp2:$PrefixSpecial_Field field="$field" grid="$grid" as_label="1" no_special="no_special" format="$format"/>
</span><inp2:m_if check="{$SourcePrefix}_IsRequired" field="$virtual_field"/><span class="error"> *</span></inp2:m_if>:<br />
<inp2:m_if check="FieldEquals" field="$ElementTypeField" value="textarea">
<a href="javascript:PreSaveAndOpenTranslatorCV('<inp2:m_param name="SourcePrefix"/>,<inp2:m_param name="SourcePrefix"/>-cdata', '<inp2:m_param name="SourcePrefix"/>-cdata:cust_<inp2:Field name="CustomFieldId"/>', 'popups/translator', <inp2:$SourcePrefix_Field field="ResourceId"/>, 1);" title="<inp2:m_Phrase label="la_Translate" escape="1"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand;" border="0"></a>
<inp2:m_else/>
<a href="javascript:PreSaveAndOpenTranslatorCV('<inp2:m_param name="SourcePrefix"/>,<inp2:m_param name="SourcePrefix"/>-cdata', '<inp2:m_param name="SourcePrefix"/>-cdata:cust_<inp2:Field name="CustomFieldId"/>', 'popups/translator', <inp2:$SourcePrefix_Field field="ResourceId"/>);" title="<inp2:m_Phrase label="la_Translate" escape="1"/>"><img src="img/icons/icon24_translate.gif" style="cursor:hand;" border="0"></a>
</inp2:m_if>
</td>
<inp2:m_blockend />
<inp2:m_DefineElement name="grid_column_filter">
<td>&nbsp;</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_options_filter" use_phrases="0">
<td>
<select <inp2:m_if check="SearchField" field="$filter_field" filter_type="options" grid="$grid">class="filter"</inp2:m_if> name="<inp2:SearchInputName field="$filter_field" filter_type="options" grid="$grid"/>">
<inp2:m_if prefix="m" function="ParamEquals" name="use_phrases" value="1"/>
<inp2:PredefinedSearchOptions field="$filter_field" block="inp_option_phrase" selected="selected" has_empty="1" empty_value="" filter_type="options" grid="$grid"/>
<inp2:m_else/>
<inp2:PredefinedSearchOptions field="$filter_field" block="inp_option_item" selected="selected" has_empty="1" empty_value="" filter_type="options" grid="$grid"/>
<inp2:m_endif/>
</select>
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_like_filter">
<td>
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="like" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="like" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="like" grid="$grid"/>" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/>
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_equals_filter">
<td>
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="equals" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="equals" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="equals" grid="$grid"/>" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/>
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_range_filter">
<td>
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="range" type="from" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="range" type="from" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="range" type="from" grid="$grid"/>" size="5" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/><br />
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="range" type="to" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="range" type="to" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="range" type="to" grid="$grid"/>" size="5" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/><br />
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_float_range_filter">
<td>
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="float_range" type="from" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="float_range" type="from" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="float_range" type="from" grid="$grid"/>" size="5" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/><br />
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="float_range" type="to" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="float_range" type="to" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="float_range" type="to" grid="$grid"/>" size="5" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/><br />
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_date_range_filter">
<td>
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="date_range" type="from" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="from" grid="$grid"/>" id="<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="from" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="date_range" type="from" grid="$grid"/>" size="15" datepickerIcon="img/calendar_icon.gif" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/><br />
<input type="text" class="flat-input<inp2:m_if check="SearchField" field="$filter_field" filter_type="date_range" type="to" grid="$grid"> filter</inp2:m_if>" name="<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="to" grid="$grid"/>" id="<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="to" grid="$grid"/>" value="<inp2:SearchField field="$filter_field" filter_type="date_range" type="to" grid="$grid"/>" size="15" datepickerIcon="img/calendar_icon.gif" onkeydown="search_keydown(event, '<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>);"/><br />
</td>
<script type="text/javascript">
initCalendar("<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="from" grid="$grid"/>", "<inp2:Format field="{$sort_field}_date" input_format="1"/>");
initCalendar("<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="to" grid="$grid"/>", "<inp2:Format field="{$sort_field}_date" input_format="1"/>");
</script>
</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" js_escape="1"/>','<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 old_style="1" 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_include template="incs/menu_blocks"/>
<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" totals_block="grid_total_td" row_block="_row" ajax="0" totals="0">
<!--
grid_filters - show individual filters for each column
has_filters - draw filter section in "View" menu in toolbar
-->
<inp2:InitList pass_params="1"/> <!-- this is to avoid recalling prefix as an item in first iterate grid, by col-picker for instance -->
<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%" 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" td_style="">
<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" />
<inp2:m_DefineElement name="grid_total_td">
<inp2:m_if check="m_Param" name="total">
<td style="<inp2:m_param name="td_style"/>">
<inp2:FieldTotal name="$field" function="$total"/>
</td>
<inp2:m_else/>
<td style="<inp2:m_param name="td_style"/>">&nbsp;</td>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_if check="m_ParamEquals" name="totals" value="1">
<tr class="totals-row"/>
<inp2:IterateGridFields grid="$grid" mode="data" block="$totals_block"/>
</tr>
</inp2:m_if>
</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>
<link rel="stylesheet" rev="stylesheet" href="incs/nlsmenu.css" type="text/css" />
<script type="text/javascript" src="js/nlsmenu.js"></script>
<script type="text/javascript" src="js/nlsmenueffect_1_2_1.js"></script>
<script type="text/javascript">
var menuMgr = new NlsMenuManager("mgr");
menuMgr.timeout = 500;
menuMgr.flowOverFormElement = true;
</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" view_menu="1" 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_if check="m_Param" name="view_menu">
<inp2:m_RenderElement name="nlsmenu_declaration" pass_params="true"/>
$ViewMenus = new Array('<inp2:m_param name="PrefixSpecial"/>');
</inp2:m_if>
</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>
<link rel="stylesheet" rev="stylesheet" href="incs/nlsmenu.css" type="text/css" />
<script type="text/javascript" src="js/nlsmenu.js"></script>
<script type="text/javascript" src="js/nlsmenueffect_1_2_1.js"></script>
<script type="text/javascript">
var menuMgr = new NlsMenuManager("mgr");
menuMgr.timeout = 500;
menuMgr.flowOverFormElement = true;
</script>
<inp2:m_set fw_menu_included="1"/>
</inp2:m_if>
<script type="text/javascript">
<inp2:m_RenderElement name="grid_js" selected_class="table_white_selected" tag_name="td" pass_params="true"/>
</script>
</inp2:m_if>
<input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1" name="<inp2:m_param name="PrefixSpecial"/>_Sort1" value="">
<input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" name="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" value="asc">
</inp2:m_DefineElement>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/incs/grid_blocks.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.7
\ No newline at end of property
Index: trunk/core/admin_templates/incs/style.css
===================================================================
--- trunk/core/admin_templates/incs/style.css (revision 8103)
+++ trunk/core/admin_templates/incs/style.css (revision 8104)
@@ -1,651 +1,654 @@
/* --- In-Portal --- */
html {
height: 100%;
}
.head_version {
font-family: verdana, arial;
font-size: 10px;
font-weight: normal;
color: white;
padding-right: 5px;
text-decoration: none;
}
body {
font-family: Verdana, Arial, Helvetica, Sans-serif;
font-size: 12px;
color: #000000;
scrollbar-3dlight-color: #333333;
scrollbar-arrow-color: #ffffff;
scrollbar-track-color: #88d2f8;
scrollbar-darkshadow-color: #333333;
scrollbar-highlight-color: #009ffd;
scrollbar-shadow-color: #009ffd;
scrollbar-face-color: #009ffd;
overflow-x: auto; overflow-y: auto;
height: 100%;
margin: 0px 0px 0px 8px
}
A {
color: #006699;
text-decoration: none;
}
A:hover {
color: #009ff0;
text-decoration: none;
}
TD {
font-family: verdana,helvetica;
font-size: 10pt;
text-decoration: none;
}
form {
display: inline;
}
.text {
font-family: verdana, arial;
font-size: 12px;
font-weight: normal;
text-decoration: none;
}
.tablenav {
font-family: verdana, arial;
font-size: 14px;
font-weight: bold;
color: #FFFFFF;
text-decoration: none;
background-color: #73C4F5;
background: url(../img/tabnav_back.gif) repeat-x;
}
.header_left_bg {
background: url(../img/tabnav_left.gif) no-repeat;
}
.tablenav_link {
font-family: verdana, arial;
font-size: 14px;
font-weight: bold;
color: #FFFFFF;
text-decoration: none;
}
/*.tablenav_link:hover {
font-family: verdana, arial;
font-size: 14px;
font-weight: bold;
color: #ffcc00;
text-decoration: none;
}*/
.tableborder {
font-family: arial, helvetica, sans-serif;
font-size: 10pt;
border: 1px solid #000000;
border-top-width: 0px;
border-collapse: collapse;
}
.tableborder_full, .tableborder_full_kernel {
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
border: 1px solid #000000;
border-collapse: collapse;
}
.tableborder_full {
border-bottom-width: 0px;
}
.search-cell {
padding-right: 0px;
white-space: nowrap;
}
+.search-box {
+ border: 1px solid #808080;
+}
.button {
font-family: arial, verdana;
font-size: 12px;
font-weight: normal;
color: #000000;
background: url(../img/button_back.gif) #f9eeae repeat-x;
text-decoration: none;
}
.button-disabled {
font-family: arial, verdana;
font-size: 12px;
font-weight: normal;
color: #676767;
background: url(../img/button_back_disabled.gif) #f9eeae repeat-x;
text-decoration: none;
}
.hint_red {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
font-style: normal;
color: #FF0000;
/* background-color: #F0F1EB; */
}
.tree_head {
font-family: verdana, arial;
font-size: 10px;
font-weight: bold;
color: #FFFFFF;
text-decoration: none;
}
.admintitle {
font-family: verdana, arial;
font-size: 20px;
font-weight: bold;
color: #009FF0;
text-decoration: none;
}
.table_border_notop, .table_border_nobottom {
background-color: #F0F1EB;
border: 1px solid #000000;
border-collapse: collapse;
}
.table_border_notop {
border-top-width: 0px;
}
.table_border_nobottom {
border-bottom-width: 0px;
}
.pagination_bar {
background-color: #D7D7D7;
border: 1px solid #000000;
border-top-width: 0px;
border-collapse: collapse;
}
.totals-row td {
background-color: #D7D7D7;
border-bottom: 1px solid #000000;
border-top: 1px solid #000000;
font-weight: bold;
}
/* Categories */
.priority {
color: #FF0000;
padding-left: 1px;
padding-right: 1px;
font-size: 11px;
}
.cat_no, .cat_desc, .cat_new, .cat_pick, .cats_stats {
font-family: arial, verdana, sans-serif;
}
.cat_no {
font-size: 10px;
color: #707070;
}
.cat_desc {
font-size: 9pt;
color: #000000;
}
.cat_new {
font-size: 12px;
vertical-align: super;
color: blue;
}
.cat_pick {
font-size: 12px;
vertical-align: super;
color: #009900;
}
.cats_stats {
font-size: 11px;
color: #707070;
}
/* Links */
.link, .link:hover, .link_desc, .link_detail {
font-family: arial, helvetica, sans-serif;
}
.link {
font-size: 9pt;
color: #1F569A;
}
.link:hover {
font-size: 9pt;
color: #009FF0;
}
.link_desc {
font-size: 9pt;
color: #000000;
}
.link_detail {
font-size: 11px;
color: #707070;
}
.link_rate, .link_review, .link_modify, .link_div, .link_new, .link_top, .link_pop, .link_pick {
font-family: arial, helvetica, sans-serif;
font-size: 12px;
}
.link_rate, .link_review, .link_modify, .link_div {
text-decoration: none;
}
.link_rate { color: #006600; }
.link_review { color: #A27900; }
.link_modify { color: #800000; }
.link_div { color: #000000; }
.link_new, .link_top, .link_pop, .link_pick {
vertical-align: super;
}
.link_new { color: #0000FF; }
.link_top { color: #FF0000; }
.link_pop { color: FFA500; }
.link_pick { color: #009900; }
/* ToolBar */
.divider {
BACKGROUND-COLOR: #999999
}
.toolbar {
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
border: 1px solid #000000;
border-width: 0 1 1 1;
background-color: #F0F1EB;
border-collapse: collapse;
}
.current_page {
font-family: verdana;
font-size: 12px;
font-weight: bold;
background-color: #C4C4C4;
padding-left: 1px;
padding-right: 1px;
}
.nav_url {
font-family: verdana;
font-size: 12px;
font-weight: bold;
color: #1F569A;
}
.nav_arrow {
font-family: verdana;
font-size: 12px;
font-weight: normal;
color: #1F569A;
padding-left: 3px;
padding-right: 3px;
}
.nav_current_item {
font-family: verdana;
font-size: 12px;
font-weight: bold;
color: #666666;
}
/* Edit forms */
.hint {
font-family: arial, helvetica, sans-serif;
font-size: 12px;
font-style: normal;
color: #666666;
}
.table_color1, .table_color2 {
font-family: verdana, arial;
font-size: 14px;
font-weight: normal;
color: #000000;
text-decoration: none;
}
.table_color1 { background-color: #F6F6F6; }
.table_color2 { background-color: #EBEBEB; }
.table_white, .table_white_selected {
font-family: verdana, arial;
font-weight: normal;
font-size: 14px;
color: #000000;
text-decoration: none;
padding-top: 0px;
padding-bottom: 0px;
}
.table_white {
background-color: #FFFFFF;
}
.table_white_selected {
background-color: #C6D6EF;
}
.subsectiontitle {
font-family: verdana, arial;
font-size: 14px;
font-weight: bold;
background-color: #999999;
text-decoration: none;
color: #FFFFFF;
}
/*.subsectiontitle:hover {
font-family: verdana, arial;
font-size: 14px;
font-weight: bold;
background-color: #999999;
text-decoration: none;
color: #FFCC00;
}*/
.error {
font-family: arial, helvetica, sans-serif;
font-weight: bold;
font-size: 9pt;
color: #FF0000;
}
/* Tabs */
.tab_border {
border: 1px solid #000000;
border-width: 1 0 0 0;
}
.tab, .tab:hover {
font-family: verdana, arial, helvetica;
font-size: 12px;
font-weight: bold;
color: #000000;
text-decoration: none;
}
.tab2, .tab2:hover {
font-family: verdana, arial, helvetica;
font-size: 12px;
font-weight: bold;
text-decoration: none;
}
.tab2 { color: #FFFFFF; }
.tab2:hover { color: #000000; }
/* Item DIVS */
.selected_div { background-color: #C6D6EF; }
.notselected_div { background-color: #FFFFFF; }
/* Item tabs */
.itemtab_active {
background: url("../img/itemtabs/tab_active.gif") #eee repeat-x;
}
.itemtab_inactive {
background: url("../img/itemtabs/tab_inactive.gif") #F9EEAE repeat-x;
}
/* Grids */
.columntitle, .columntitle:hover {
font-family: verdana, arial;
font-size: 14px;
font-weight: bold;
background-color: #999999;
text-decoration: none;
}
.columntitle { color: #FFFFFF; }
.columntitle:hover { color: #FFCC00; }
.columntitle_small, .columntitle_small:hover {
font-family: verdana, arial;
font-size: 12px;
font-weight: bold;
background-color: #999999;
text-decoration: none;
}
.columntitle_small { color: #FFFFFF; }
.columntitle_small:hover { color: #FFCC00; }
/* ----------------------------- */
.section_header_bg {
background: url(../img/logo_bg.gif) no-repeat top right;
}
.small {
font-size: 9px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
/* order preview & preview_print styles */
.order_print_defaults TD,
.order_preview_header,
.order_preview_header TD,
.order_print_preview_header TD,
.order_preview_field_name,
.order-totals-name,
.arial2r,
.orders_print_flat_table TD {
font-family: Arial;
font-size: 10pt;
}
.order_preview_header, .order_preview_header TD, .order_print_preview_header TD {
background-color: #C9E9FE;
font-weight: bold;
}
.order_print_preview_header TD {
background-color: #FFFFFF;
}
.order_preview_field_name {
font-weight: bold;
padding: 2px 4px 2px 4px;
}
.order-totals-name {
font-style: normal;
}
.border1 {
border: 1px solid #111111;
}
.arial2r {
color: #602830;
font-weight: bold;
}
.orders_flat_table, .orders_print_flat_table {
border-collapse: collapse;
margin: 5px;
}
.orders_flat_table TD {
padding: 2px 5px 2px 5px;
border: 1px solid #444444;
}
.orders_print_flat_table TD {
border: 1px solid #000000;
padding: 2px 5px 2px 5px;
}
.help_box {
padding: 5px 10px 5px 10px;
}
.progress_bar
{
background: url(../img/progress_bar_segment.gif);
}
.grid_id_cell TD {
padding-right: 2px;
}
/*.transparent {
filter: alpha(opacity=50);
-moz-opacity: .5;
opacity: .5;
}*/
.none_transparent {
}
.subitem_icon {
vertical-align: top;
padding-top: 0px;
text-align: center;
width: 28px;
}
.subitem_description {
vertical-align: middle;
}
.dLink, .dLink:hover {
display: block;
margin-bottom: 5px;
font-family: Verdana;
font-size: 13px;
font-weight: bold;
color: #2C73CB;
}
.dLink {
text-decoration: none;
}
.dLink:hover {
text-decoration: underline;
}
a.config-header, a.config-header:hover {
color: #FFFFFF;
font-size: 11px;
}
.catalog-tab-left {
background: url(../img/itemtabs/tab_left.gif) top left no-repeat;
}
.catalog-tab-middle {
background: url(../img/itemtabs/tab_middle.gif) top left repeat-x;
}
.catalog-tab-right {
background: url(../img/itemtabs/tab_right.gif) top right no-repeat;
}
catalog-tab-separator td {
background: #FFFFFF;
}
.catalog-tab-selected td {
background-color: #E0E0DA;
cursor: default;
}
.catalog-tab-unselected td, .catalog-tab-unselected td span {
background-color: #F0F1EB;
cursor: pointer;
}
.catalog-tab {
display: none;
width: 100%;
}
.progress-text {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
color: #414141;
}
.flat-input {
border: 1px solid grey;
}
/* Toolbar */
.toolbar-button, .toolbar-button-disabled, .toolbar-button-over {
float: left;
clear: none !important;
border: none;
text-align: center;
font-size: 10px;
padding: 2px 2px 2px 2px;
vertical-align: middle;
}
.toolbar-button-over {
}
/* Forms */
table.edit-form {
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
border: 1px solid #000000;
border-top-width: 0px;
border-collapse: collapse;
width: 100%;
}
table.edit-form td {
padding: 4px;
margin: 0px;
}
Property changes on: trunk/core/admin_templates/incs/style.css
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.7
\ No newline at end of property
Index: trunk/core/admin_templates/tools/system_tools.tpl
===================================================================
--- trunk/core/admin_templates/tools/system_tools.tpl (revision 8103)
+++ trunk/core/admin_templates/tools/system_tools.tpl (revision 8104)
@@ -1,50 +1,51 @@
<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
<inp2:m_include t="incs/header"/>
<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"/>
<script type="text/javascript">
function show_structure($prefix, $event) {
var $form = document.getElementById($form_name);
openwin('about:blank', 'table_structure', 800, 575);
$form.target = 'table_structure';
submit_event($prefix, $event);
set_hidden_field('events[adm]', '');
}
</script>
<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="$title"/>:
</td>
<td valign="top" colspan="2">
<input class="button" type="button" onclick="submit_event('adm', '<inp2:m_param name="event_name"/>');" value="Go">
</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="subsection" title="la_section_General"/>
<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"/>
<inp2:m_RenderElement name="service_elem" title="la_Service_RebuildThemes" event_name="OnRebuildThemes"/>
<inp2:m_RenderElement name="subsection" title="la_section_Configs"/>
<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;">
Table Structure:
</td>
<td valign="top" colspan="2">
<input type="text" name="table_name" value="" size="30"/>
<input class="button" type="button" onclick="show_structure('adm', 'OnGenerateTableStructure');" value="Go">
<span class="small">table name (prefix optional) OR unit config prefix</span>
</td>
</tr>
</table>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/tools/system_tools.tpl
___________________________________________________________________
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/admin_templates/catalog/catalog.tpl
===================================================================
--- trunk/core/admin_templates/catalog/catalog.tpl (revision 8103)
+++ trunk/core/admin_templates/catalog/catalog.tpl (revision 8104)
@@ -1,241 +1,241 @@
<inp2:m_RequireLogin permissions="in-portal:browse.view" system="1" ajax="yes"/>
<inp2:m_include t="incs/header" nobody="yes" noform="yes"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF" onload="$Catalog.Init();">
<inp2:m_ParseBlock name="section_header" prefix="c" icon="icon46_catalog" module="in-portal" title="!la_title_Browse!"/>
<inp2:m_ParseBlock name="blue_bar" prefix="c" title_preset="catalog" module="in-portal"/>
<!-- main kernel_form: begin -->
<inp2:m_RenderElement name="kernel_form"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<input type="hidden" name="m_cat_id" value="<inp2:m_get name="m_cat_id"/>"/>
<link rel="stylesheet" rev="stylesheet" href="incs/nlsmenu.css" type="text/css" />
<script type="text/javascript" src="js/nlsmenu.js"></script>
<script type="text/javascript" src="js/nlsmenueffect_1_2_1.js"></script>
<script type="text/javascript" src="js/ajax.js"></script>
<script type="text/javascript" src="<inp2:m_TemplatesBase module="in-portal"/>/incs/catalog.js"></script>
<script type="text/javascript">
var menuMgr = new NlsMenuManager("mgr");
menuMgr.timeout = 500;
menuMgr.flowOverFormElement = true;
Request.progressText = '<inp2:m_phrase name="la_title_Loading" escape="1"/>';
var $is_catalog = true;
var $Catalog = new Catalog('<inp2:m_Link template="#TEMPLATE_NAME#" m_cat_id="#CATEGORY_ID#" no_amp="1"/>', 'catalog_');
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('in-portal:upcat', '<inp2:m_phrase label="la_ToolTip_Up" escape="1"/>', function() {
$Catalog.go_to_cat($Catalog.ParentCategoryID);
}
) );
a_toolbar.AddButton( new ToolBarButton('in-portal:homecat', '<inp2:m_phrase label="la_ToolTip_Home" escape="1"/>', function() {
$Catalog.go_to_cat(0);
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('in-portal:new_cat', '<inp2:m_phrase label="la_ToolTip_New_Category" escape="1"/>', function() {
std_precreate_item('c', 'in-portal/categories/categories_edit');
}
) );
a_toolbar.AddButton( new ToolBarButton('in-portal:editcat', '<inp2:m_phrase label="la_ToolTip_Edit_Current_Category" escape="1"/>', function() {
var $edit_url = '<inp2:m_t t="#TEMPLATE#" m_opener="d" c_mode="t" c_event="OnEdit" c_id="#CATEGORY_ID#" pass="all,c" no_amp="1"/>';
var $category_id = get_hidden_field('m_cat_id');
var $redirect_url = $edit_url.replace('#CATEGORY_ID#', $category_id);
$redirect_url = $redirect_url.replace('#TEMPLATE#', $category_id > 0 ? 'in-portal/categories/categories_edit' : 'in-portal/categories/categories_edit_permissions');
redirect($redirect_url);
}
) );
<inp2:m_ModuleInclude template="catalog_tab" tab_init="1" skip_prefixes="m"/>
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
var $template = $Catalog.queryTabRegistry('prefix', $Catalog.getCurrentPrefix(), 'view_template');
std_delete_items($Catalog.getCurrentPrefix(), $template, 1);
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
$Catalog.submit_event(null, 'OnMassApprove');
}
) );
a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
$Catalog.submit_event(null, 'OnMassDecline');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('in-portal:export', '<inp2:m_phrase label="la_ToolTip_Export" escape="1"/>', function() {
var $export_prefixes = new Array('l', 'p');
if (in_array($Catalog.ActivePrefix, $export_prefixes)) {
submit_event($Catalog.ActivePrefix, 'OnExport');
}
else {
alert('<inp2:m_phrase name="la_Text_InDevelopment" escape="1"/>');
}
}
) );
a_toolbar.AddButton( new ToolBarButton('in-portal:rebuild_cache', '<inp2:m_phrase label="la_ToolTip_RebuildCategoryCache" escape="1"/>', function() {
redirect('<inp2:m_t t="in-portal/categories/cache_updater" pass="m"/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep4') );
a_toolbar.AddButton( new ToolBarButton('in-portal:cut', '<inp2:m_phrase label="la_ToolTip_Cut" escape="1"/>', function() {
$Catalog.submit_event(null, 'OnCut');
}
) );
a_toolbar.AddButton( new ToolBarButton('in-portal:copy', '<inp2:m_phrase label="la_ToolTip_Copy" escape="1"/>', function() {
$Catalog.submit_event(null, 'OnCopy');
}
) );
a_toolbar.AddButton( new ToolBarButton('in-portal:paste', '<inp2:m_phrase label="la_ToolTip_Paste" escape="1"/>', function() {
$Catalog.submit_event('c', 'OnPasteClipboard', null, function($object) {
$object.resetTabs(true);
$object.switchTab();
} );
}
) );
/*a_toolbar.AddButton( new ToolBarButton('clear_clipboard', '<inp2:m_phrase label="la_ToolTip_ClearClipboard" escape="1"/>', function() {
if (confirm('<inp2:m_phrase name="la_text_ClearClipboardWarning" js_escape="1"/>')) {
$Catalog.submit_event('c', 'OnClearClipboard', null, function($object) {
$GridManager.CheckDependencies($object.ActivePrefix);
} );
}
}
) );*/
a_toolbar.AddButton( new ToolBarSeparator('sep5') );
a_toolbar.AddButton( new ToolBarButton('move_up', '<inp2:m_phrase label="la_ToolTip_Move_Up" escape="1"/>', function() {
$Catalog.submit_event(null, 'OnMassMoveUp');
}
) );
a_toolbar.AddButton( new ToolBarButton('move_down', '<inp2:m_phrase label="la_ToolTip_Move_Down" escape="1"/>', function() {
$Catalog.submit_event(null, 'OnMassMoveDown');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep6') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar, 'view');
}
) );
a_toolbar.Render();
function edit()
{
var $current_prefix = $Catalog.getCurrentPrefix();
$form_name = $Catalog.queryTabRegistry('prefix', $current_prefix, 'tab_id') + '_form';
std_edit_item($current_prefix, $Catalog.queryTabRegistry('prefix', $current_prefix, 'edit_template'));
}
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="kernel_form_end"/>
<!-- main kernel_form: end -->
<!-- category list: begin -->
<table id="c_search_warning" width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_notop" style="display: none;">
<tr>
<td valign="top" class="hint_red">
<inp2:m_phrase name="la_Warning_Filter"/>
</td>
</tr>
</table>
<inp2:m_set t="in-portal/xml/categories_list"/>
<inp2:m_RenderElement name="kernel_form" form_name="categories_form"/>
-<table class="toolbar" cellspacing="0" cellpadding="2" width="100%" border="0" style="border-top-width: 0px;">
- <tr bgcolor="#e0e0da" height="20">
+<table class="toolbar" cellspacing="0" cellpadding="0" width="100%" border="0" style="border-top-width: 0px;">
+ <tr bgcolor="#e0e0da">
<td valign="middle">
- <img height="15" src="img/arrow.gif" width="15" align="absmiddle" border="0"><span id="category_path"></span>
+ <img src="img/arrow.gif" width="15" height="15" align="absmiddle" border="0"><span id="category_path"></span>
</td>
<td align="right" class="search-cell">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>Search:&nbsp;</td>
<td>
- <input type="text" id="c_search_keyword" name="c_search_keyword" value="" onkeydown="search_keydown(event, 'c', 'Default', 1);" style="border: 1px solid grey;" />
+ <input type="text" id="c_search_keyword" name="c_search_keyword" value="" onkeydown="search_keydown(event, 'c', 'Default', 1);" class="search-box"/>
<input type="text" style="display: none;" />
</td>
<td id="search_buttons[c]">
<script type="text/javascript">
<inp2:m_RenderElement name="grid_search_buttons" PrefixSpecial="c" grid="Default" ajax="1"/>
</script>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div id="categories_div" prefix="c" view_template="in-portal/xml/categories_list" edit_template="in-portal/categories/categories_edit" dep_buttons="" class="catalog-tab" style="display: block;"></div>
<inp2:m_RenderElement name="kernel_form_end"/>
<inp2:m_set t="in-portal/catalog"/>
<script type="text/javascript">$Catalog.registerTab('categories');</script>
<!-- categories list: end -->
<!-- item tabs: begin -->
<table cellpadding="0" cellspacing="0">
<tr>
<inp2:m_DefineElement name="item_tab" title="">
<td nowrap="nowrap" width="140">
<table id="<inp2:m_param name="prefix"/>_tab" cellpadding="0" cellspacing="0" width="100%" class="catalog-tab-unselected" onclick="$Catalog.switchTab('<inp2:m_param name="prefix"/>');">
<tr>
<td class="catalog-tab-left">
<img src="img/spacer.gif" height="22" width="9" />
</td>
<td class="catalog-tab-middle" width="100%" valign="middle" nowrap="nowrap">
<inp2:m_phrase name="$title"/> <span class="cats_stats">(<span id="<inp2:m_param name="prefix"/>_item_count">?</span>)</span>
</td>
<td class="catalog-tab-right">
<img src="img/spacer.gif" height="22" width="9" />
</td>
<td style="background-color: #FFFFFF;">
<img src="img/spacer.gif" height="1" width="5" />
</td>
</tr>
</table>
</td>
</inp2:m_DefineElement>
<inp2:adm_ListCatalogTabs render_as="item_tab" title_property="ViewMenuPhrase" skip_prefixes="m"/>
</tr>
</table>
<!-- item tabs: end -->
<inp2:m_ModuleInclude template="catalog_tab" tab_init="2" skip_prefixes="m"/>
<inp2:m_include t="incs/footer" noform="yes"/>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/catalog/catalog.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.28
\ No newline at end of property
+1.29
\ No newline at end of property
Index: trunk/core/admin_templates/js/script.js
===================================================================
--- trunk/core/admin_templates/js/script.js (revision 8103)
+++ trunk/core/admin_templates/js/script.js (revision 8104)
@@ -1,1399 +1,1399 @@
if ( !( isset($init_made) && $init_made ) ) {
var Grids = new Array();
var Toolbars = new Array();
var $Menus = new Array();
var $ViewMenus = new Array();
var $nls_menus = new Array();
var $MenuNames = new Array();
var $form_name = 'kernel_form';
if(!$fw_menus) var $fw_menus = new Array();
var $env = '';
var submitted = false;
var $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();
replaceFireBug();
}
function use_popups($prefix_special, $event) {
return $use_popups;
}
function getArrayValue()
{
var $value = arguments[0];
var $current_key = 0;
$i = 1;
while ($i < arguments.length) {
$current_key = arguments[$i];
if (isset($value[$current_key])) {
$value = $value[$current_key];
}
else {
return false;
}
$i++;
}
return $value;
}
function setArrayValue()
{
// first argument - array, other arguments - keys (arrays too), last argument - value
var $array = arguments[0];
var $current_key = 0;
$i = 1;
while ($i < arguments.length - 1) {
$current_key = arguments[$i];
if (!isset($array[$current_key])) {
$array[$current_key] = new Array();
}
$array = $array[$current_key];
$i++;
}
$array[$array.length] = arguments[arguments.length - 1];
}
function 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 = '';
set_hidden_field('t', t);
window.setTimeout(function() {submitted = false}, 500);
}
function set_event(prefix_special, event)
{
var event_field=document.getElementById('events[' + prefix_special + ']');
if(isset(event_field))
{
event_field.value = event;
}
}
function isset(variable)
{
if(variable==null) return false;
return (typeof(variable)=='undefined')?false:true;
}
function in_array(needle, haystack)
{
return array_search(needle, haystack) != -1;
}
function array_search(needle, haystack)
{
for (var i=0; i<haystack.length; i++)
{
if (haystack[i] == needle) return i;
}
return -1;
}
function print_pre(variable, msg)
{
if (!isset(msg)) msg = '';
var s = msg;
for (prop in variable) {
s += prop+" => "+variable[prop] + "\n";
}
alert(s);
}
function go_to_page($prefix_special, $page, $ajax)
{
set_form($prefix_special, $ajax);
set_hidden_field($prefix_special + '_Page', $page);
submit_event($prefix_special, null, null, null, $ajax);
}
function go_to_list(prefix_special, tab)
{
set_hidden_field(prefix_special+'_GoTab', tab);
submit_event(prefix_special,'OnUpdateAndGoToTab',null);
}
function go_to_tab(prefix_special, tab)
{
set_hidden_field(prefix_special+'_GoTab', tab);
submit_event(prefix_special,'OnPreSaveAndGoToTab',null);
}
function go_to_id(prefix_special, id)
{
set_hidden_field(prefix_special+'_GoId', id);
submit_event(prefix_special,'OnPreSaveAndGo')
}
// in-portal compatibility functions: begin
function getScriptURL($script_name, tpl)
{
tpl = tpl ? '-'+tpl : '';
var $asid = get_hidden_field('sid');
return base_url+$script_name+'?env='+( isset($env)&&$env?$env:$asid )+tpl+'&en=0';
}
function OpenEditor(extra_env,TargetForm,TargetField)
{
// var $url = getScriptURL('admin/editor/editor_new.php');
var $url = getScriptURL('admin/index.php', 'popups/editor');
// alert($url);
$url = $url+'&TargetForm='+TargetForm+'&TargetField='+TargetField+'&destform=popup';
if(extra_env.length>0) $url += extra_env;
openwin($url,'html_edit',800,575);
}
function OpenUserSelector(extra_env,TargetForm,TargetField)
{
var $url = getScriptURL('admin/users/user_select.php');
$url += '&destform='+TargetForm+'&Selector=radio&destfield='+TargetField+'&IdField=Login';
if(extra_env.length>0) $url += extra_env;
openwin($url,'user_select',800,575);
return false;
}
function OpenCatSelector(extra_env)
{
var $url = getScriptURL('admin/cat_select.php');
if(extra_env.length>0) $url += extra_env;
openwin($url,'catselect',750,400);
}
function OpenItemSelector(extra_env,$TargetForm)
{
var $url = getScriptURL('admin/relation_select.php') + '&destform='+$TargetForm;
if(extra_env.length>0) $url += extra_env;
openwin($url,'groupselect',750,400);
}
function OpenUserEdit($user_id, $extra_env)
{
var $url = getScriptURL('admin/users/adduser.php') + '&direct_id=' + $user_id;
if( isset($extra_env) ) $url += $extra_env;
window.location.href = $url;
}
function OpenLinkEdit($link_id, $extra_env)
{
var $url = getScriptURL('in-link/admin/addlink.php') + '&item=' + $link_id;
if( isset($extra_env) ) $url += $extra_env;
window.location.href = $url;
}
function OpenHelp($help_link)
{
// $help_link.match('http://(.*).lv/in-commerce/admin(.*)');
// alert(RegExp.$2);
openwin($help_link,'HelpPopup',750,400);
}
function openEmailSend($url, $type, $prefix_special)
{
var $kf = document.getElementById($form_name);
var $prev_action = $kf.action;
var $prev_opener = get_hidden_field('m_opener');
$kf.action = $url;
set_hidden_field('m_opener', 'p');
$kf.target = 'sendmail';
set_hidden_field('idtype', 'group');
set_hidden_field('idlist', Grids[$prefix_special].GetSelected().join(',') );
openwin('','sendmail',750,400);
submit_kernel_form();
$kf.action = $prev_action;
set_hidden_field('m_opener', $prev_opener);
}
// in-portal compatibility functions: end
function InitTranslator(prefix, field, t, multi_line)
{
var $kf = document.getElementById($form_name);
var $window_name = 'select_'+t.replace(/(\/|-)/g, '_');
var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)');
$regex = $regex.exec($kf.action);
// set_hidden_field('return_m', $regex[4]);
var $prev_opener = get_hidden_field('m_opener');
if (!isset(multi_line)) multi_line = 0;
openwin('', $window_name, 750, 400);
// set_hidden_field('return_template', $kf.elements['t'].value); // where should return after popup is done
set_hidden_field('m_opener', 'p');
set_hidden_field('translator_wnd_name', $window_name);
set_hidden_field('translator_field', field);
set_hidden_field('translator_t', t);
set_hidden_field('translator_prefixes', prefix);
set_hidden_field('translator_multi_line', multi_line);
$kf.target = $window_name;
return $prev_opener;
}
function PreSaveAndOpenTranslator(prefix, field, t, multi_line)
{
var $prev_opener = InitTranslator(prefix, field, t, multi_line);
var split_prefix = prefix.split(',');
submit_event(split_prefix[0], 'OnPreSaveAndOpenTranslator');
set_hidden_field('m_opener', $prev_opener);
}
function PreSaveAndOpenTranslatorCV(prefix, field, t, resource_id, multi_line)
{
var $prev_opener = InitTranslator(prefix, field, t, multi_line);
set_hidden_field('translator_resource_id', resource_id);
var split_prefix = prefix.split(',');
submit_event(split_prefix[0],'OnPreSaveAndOpenTranslator');
set_hidden_field('m_opener', $prev_opener);
}
function openTranslator(prefix,field,url,wnd)
{
var $kf = document.getElementById($form_name);
set_hidden_field('trans_prefix', prefix);
set_hidden_field('trans_field', field);
set_hidden_field('events[trans]', 'OnLoad');
var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(.*)');
var $t = $regex.exec(url)[3];
$kf.target = wnd;
submit_event(prefix,'',$t,url);
}
function openwin($url,$name,$width,$height)
{
// prevent window from opening larger, then screen resolution on user's computer (to Kostja)
// alert('openwin: name = ['+$name+']');
var left = Math.round((screen.width - $width)/2);
var top = Math.round((screen.height - $height)/2);
cur_x = is.ie ? window.screenLeft : window.screenX;
cur_y = is.ie ? window.screenTop : window.screenY;
// alert('current X,Y: '+cur_x+','+cur_y+' target x,y: '+left+','+top);
var $window_params = 'left='+left+',top='+top+',width='+$width+',height='+$height+',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no';
return window.open($url,$name,$window_params);
}
function OnResizePopup(e) {
if (!document.all) {
var $winW = window.innerWidth;
var $winH = window.innerHeight;
}
else {
var $winW = window.document.body.offsetWidth;
var $winH = window.document.body.offsetHeight;
}
window.status = '[width: ' + $winW + '; height: ' + $winH + ']';
}
function opener_action(new_action)
{
var $prev_opener = get_hidden_field('m_opener');
set_hidden_field('m_opener', new_action);
return $prev_opener;
}
function open_popup($prefix_special, $event, $t, $window_size) {
if (!$window_size) {
// if no size given, then query it from ajax
var $default_size = '750x400';
var $pm = getFrame('head').$popup_manager;
if ($pm) {
// popup manager was found in head frame
$pm.ResponceFunction = function ($responce) {
if (!$responce.match(/([\d]+)x([\d]+)/)) {
// invalid responce was received, may be php fatal error during AJAX request
$responce = $default_size;
}
open_popup($prefix_special, $event, $t, $responce);
}
$pm.GetSize($t);
return ;
}
$window_size = $default_size;
}
var $kf = document.getElementById($form_name);
var $window_name = $t.replace(/(\/|-)/g, '_'); // replace "/" and "-" with "_"
$window_size = $window_size.split('x');
openwin('', $window_name, $window_size[0], $window_size[1]);
$kf.target = $window_name;
var $prev_opener = opener_action('p');
event_bak = get_hidden_field('events[' + $prefix_special + ']')
if (!event_bak) event_bak = '';
submit_event($prefix_special, $event, $t);
opener_action($prev_opener); // restore opener in parent window
set_hidden_field('events[' + $prefix_special + ']', event_bak); // restore event
}
function openSelector($prefix, $url, $dst_field, $window_size, $event)
{
// if url has additional params - store it and make hidden fields from it (later, below)
var $additional = [];
if ($url.match('(.*?)&(.*)')) {
$url = RegExp.$1;
var tmp = RegExp.$2;
var pairs = tmp.split('&');
for (var i in pairs) {
var data = pairs[i].split('=');
$additional[data[0]] = data[1];
}
}
// get template name from url
var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)');
$regex = $regex.exec($url);
var $t = $regex[3];
// substitute form action with selector's url
var $kf = document.getElementById($form_name);
var $prev_action = $kf.action;
$kf.action = $url;
// check parameter values
if (!isset($event)) $event = '';
// set variables need for selector to work
processHooks('openSelector', hBEFORE);
set_hidden_field('main_prefix', $prefix);
set_hidden_field('dst_field', $dst_field);
for (var i in $additional)
{
set_hidden_field(i, $additional[i]);
}
open_popup($prefix, $event, $t);
// restore form action back
processHooks('openSelector', hAFTER);
$kf.action = $prev_action;
}
function translate_phrase($label, $template) {
set_hidden_field('phrases_label', $label);
open_popup('phrases', 'OnNew', $template);
}
function std_precreate_item(prefix_special, edit_template)
{
set_hidden_field(prefix_special+'_mode', 't');
if (use_popups(prefix_special, 'OnPreCreate')) {
open_popup(prefix_special, 'OnPreCreate', edit_template);
}
else {
opener_action('d');
- submit_event(prefix_special,'OnPreCreate', edit_template);
- }
+ submit_event(prefix_special,'OnPreCreate', edit_template);
+ }
set_hidden_field(prefix_special+'_mode', '');
}
function std_new_item(prefix_special, edit_template)
{
if (use_popups(prefix_special, 'OnNew')) {
open_popup(prefix_special, 'OnNew', edit_template);
}
else {
opener_action('d');
submit_event(prefix_special,'OnNew', edit_template);
}
}
function std_edit_item(prefix_special, edit_template)
{
set_hidden_field(prefix_special+'_mode', 't');
if (use_popups(prefix_special, 'OnEdit')) {
open_popup(prefix_special, 'OnEdit', edit_template);
}
else {
opener_action('d');
submit_event(prefix_special,'OnEdit',edit_template);
}
set_hidden_field(prefix_special+'_mode', '');
}
function std_edit_temp_item(prefix_special, edit_template)
{
if (use_popups(prefix_special, '')) {
open_popup(prefix_special, '', edit_template);
}
else {
opener_action('d');
submit_event(prefix_special,'',edit_template);
}
}
function std_delete_items(prefix_special, t, $ajax)
{
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, $prefix_special, $grid, $ajax)
{
$event = $event ? $event : event;
if (window.event) {// IE
var $key_code = $event.keyCode;
}
else if($event.which) { // Netscape/Firefox/Opera
var $key_code = $event.which;
}
switch ($key_code) {
case 13:
search($prefix_special, $grid, parseInt($ajax));
break;
case 27:
search_reset($prefix_special, $grid, parseInt($ajax));
break;
}
}
function getRealLeft(el)
{
if (typeof(el) == 'string') {
el = document.getElementById(el);
}
xPos = el.offsetLeft;
tempEl = el.offsetParent;
while (tempEl != null)
{
xPos += tempEl.offsetLeft;
tempEl = tempEl.offsetParent;
}
// if (obj.x) return obj.x;
return xPos;
}
function getRealTop(el)
{
if (typeof(el) == 'string') {
el = document.getElementById(el);
}
yPos = el.offsetTop;
tempEl = el.offsetParent;
while (tempEl != null)
{
yPos += tempEl.offsetTop;
tempEl = tempEl.offsetParent;
}
// if (obj.y) return obj.y;
return yPos;
}
function show_viewmenu_old($toolbar, $button_id)
{
var $img = $toolbar.GetButtonImage($button_id);
var $pos_x = getRealLeft($img) - ((document.all) ? 6 : -2);
var $pos_y = getRealTop($img) + 32;
var $prefix_special = '';
window.triedToWriteMenus = false;
if($ViewMenus.length == 1)
{
$prefix_special = $ViewMenus[$ViewMenus.length-1];
$fw_menus[$prefix_special+'_view_menu']();
$Menus[$prefix_special+'_view_menu'].writeMenus('MenuContainers['+$prefix_special+']');
window.FW_showMenu($Menus[$prefix_special+'_view_menu'], $pos_x, $pos_y);
}
else
{
// prepare menus
for(var $i in $ViewMenus)
{
$prefix_special = $ViewMenus[$i];
$fw_menus[$prefix_special+'_view_menu']();
}
$Menus['mixed'] = new Menu('ViewMenu_mixed');
// merge menus into new one
for(var $i in $ViewMenus)
{
$prefix_special = $ViewMenus[$i];
$Menus['mixed'].addMenuItem( $Menus[$prefix_special+'_view_menu'] );
}
$Menus['mixed'].writeMenus('MenuContainers[mixed]');
window.FW_showMenu($Menus['mixed'], $pos_x, $pos_y);
}
}
var nlsMenuRendered = false;
function show_viewmenu($toolbar, $button_id)
{
if($ViewMenus.length == 1) {
$prefix_special = $ViewMenus[$ViewMenus.length-1];
menu_to_show = $prefix_special+'_view_menu';
}
else
{
mixed_menu = menuMgr.createMenu(rs('mixed_menu'));
mixed_menu.applyBorder(false, false, false, false);
mixed_menu.dropShadow("none");
mixed_menu.showIcon = true;
// merge menus into new one
for(var $i in $ViewMenus)
{
$prefix_special = $ViewMenus[$i];
mixed_menu.addItem( rs($prefix_special+'.view.menu.mixed'),
$MenuNames[$prefix_special+'_view_menu'],
'javascript:void()', null, true, null,
rs($prefix_special+'.view.menu'),$MenuNames[$prefix_special+'_view_menu'] );
}
menu_to_show = 'mixed_menu';
}
renderMenus();
nls_showMenu(rs(menu_to_show), $toolbar.GetButtonImage($button_id))
}
function renderMenus()
{
menuMgr.renderMenus('nlsMenuPlace');
nlsMenuRendered = true;
}
function set_window_title($title)
{
var $window = window;
if($window.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.replace(/&lt;a href=&quot;(.*?)&quot;&gt;(.*?)&lt;\/a&gt;/g, '$2');
}
return $string.replace(/<a href="(.*?)">(.*?)<\/a>/g, '$2');
}
function redirect($url)
{
window.location.href = $url;
}
function update_checkbox_options($cb_mask, $hidden_id)
{
var $kf = document.getElementById($form_name);
var $tmp = '';
for (var i = 0; i < $kf.elements.length; i++)
{
if ( $kf.elements[i].id.match($cb_mask) )
{
if ($kf.elements[i].checked) $tmp += '|'+$kf.elements[i].value;
}
}
if($tmp.length > 0) $tmp += '|';
document.getElementById($hidden_id).value = $tmp.replace(/,$/, '');
}
function update_multiple_options($hidden_id) {
var $select = document.getElementById($hidden_id + '_select');
var $result = '';
for (var $i = 0; $i < $select.options.length; $i++) {
if ($select.options[$i].selected) {
$result += $select.options[$i].value + '|';
}
}
document.getElementById($hidden_id).value = $result ? '|' + $result : '';
}
// related to lists operations (moving)
function move_selected($from_list, $to_list)
{
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 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;
}
// remove spaces and underscores from a string, used for nls_menu
function rs(str)
{
return str.replace(/[ _\']+/g, '.');
}
function getFrame($name)
{
var $main_window = window;
// 1. cycle through popups to get main window
try {
// will be error, when other site is opened in parent window
while ($main_window.opener) {
$main_window = $main_window.opener;
}
}
catch (err) {
// catch Access/Permission Denied error
// alert('getFrame.Error: [' + err.description + ']');
return window;
}
var $frameset = $main_window.parent.frames;
for ($i = 0; $i < $frameset.length; $i++) {
if ($frameset[$i].name == $name) {
return $frameset[$i];
}
}
return $main_window.parent;
}
function ClearBrowserSelection()
{
if (window.getSelection) {
// removeAllRanges will be supported by Opera from v 9+, do nothing by now
var selection = window.getSelection();
if (selection.removeAllRanges) { // Mozilla & Opera 9+
// alert('clearing FF')
window.getSelection().removeAllRanges();
}
} else if (document.selection && !is.opera) { // IE
// alert('clearing IE')
document.selection.empty();
}
}
function reset_form(prefix, event, msg)
{
if (confirm(RemoveTranslationLink(msg, true))) {
submit_event(prefix, event)
}
}
function cancel_edit(prefix, cancel_ev, save_ev, msg)
{
if (confirm(RemoveTranslationLink(msg, true))) {
submit_event(prefix, save_ev)
}
else {
submit_event(prefix, cancel_ev)
}
}
function execJS(node)
{
var bSaf = (navigator.userAgent.indexOf('Safari') != -1);
var bOpera = (navigator.userAgent.indexOf('Opera') != -1);
var bMoz = (navigator.appName == 'Netscape');
if (!node) return;
/* IE wants it uppercase */
var st = node.getElementsByTagName('SCRIPT');
var strExec;
for(var i=0;i<st.length; i++)
{
if (bSaf) {
strExec = st[i].innerHTML;
st[i].innerHTML = "";
} else if (bOpera) {
strExec = st[i].text;
st[i].text = "";
} else if (bMoz) {
strExec = st[i].textContent;
st[i].textContent = "";
} else {
strExec = st[i].text;
st[i].text = "";
}
try {
var x = document.createElement("script");
x.type = "text/javascript";
/* In IE we must use .text! */
if ((bSaf) || (bOpera) || (bMoz))
x.innerHTML = strExec;
else x.text = strExec;
document.getElementsByTagName("head")[0].appendChild(x);
} catch(e) {
alert(e);
}
}
};
function NumberFormatter() {}
NumberFormatter.ThousandsSep = '\'';
NumberFormatter.DecimalSep = '.';
NumberFormatter.Parse = function(num)
{
if (num == '') return 0;
return parseFloat( num.toString().replace(this.ThousandsSep, '').replace(this.DecimalSep, '.') );
}
NumberFormatter.Format = function(num)
{
num += '';
x = num.split('.');
x1 = x[0];
x2 = x.length > 1 ? this.DecimalSep + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + this.ThousandsSep + '$2');
}
return x1 + x2;
}
function getDimensions(obj) {
var style
if (obj.currentStyle) {
style = obj.currentStyle;
}
else {
style = getComputedStyle(obj,'');
}
padding = [parseInt(style.paddingTop), parseInt(style.paddingRight), parseInt(style.paddingBottom), parseInt(style.paddingLeft)]
border = [parseInt(style.borderTopWidth), parseInt(style.borderRightWidth), parseInt(style.borderBottomWidth), parseInt(style.borderLeftWidth)]
for (var i in padding) if ( isNaN( padding[i] ) ) padding[i] = 0
for (var i in border) if ( isNaN( border[i] ) ) border[i] = 0
var result = new Object();
result.innerHeight = obj.clientHeight - padding[0] - padding[2];
result.innerWidth = obj.clientWidth - padding[1] - padding[3];
result.padding = padding;
result.borders = border;
return result;
}
function findPos(obj) {
var curleft = curtop = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
return [curleft,curtop];
}
function addEvent(el, evname, func, traditional) {
if (traditional) {
eval('el.on'+evname+'='+func);
return;
}
if (is.ie) {
el.attachEvent("on" + evname, func);
} else {
el.addEventListener(evname, func, true);
}
};
function addLoadEvent(func, wnd) {
if (!wnd) wnd = window
var oldonload = wnd.onload;
if (typeof wnd.onload != 'function') {
wnd.onload = func;
} else {
wnd.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
function replaceFireBug() {
if (!window.console || !console.firebug) {
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i) {
window.console[names[i]] = function() {
alert('FireBug console object methods are not available outside Firefox!');
}
}
}
}
\ No newline at end of file
Property changes on: trunk/core/admin_templates/js/script.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.9
\ No newline at end of property
+1.10
\ No newline at end of property
Index: trunk/core/admin_templates/js/catalog.js
===================================================================
--- trunk/core/admin_templates/js/catalog.js (revision 8103)
+++ trunk/core/admin_templates/js/catalog.js (revision 8104)
@@ -1,329 +1,333 @@
function Catalog($url_mask, $cookie_prefix, $tab_shift) {
this.CookiePrefix = $cookie_prefix ? $cookie_prefix : '';
this.BusyRequest = new Array();
this.URLMask = $url_mask;
this.Separator = '#separator#';
this.ParentCategoryID = 0;
this.OnResponceMethod = null;
this.TabShift = isset($tab_shift) ? $tab_shift : 1; // start from 2nd tab (index starting from 0)
this.TabRegistry = new Array();
this.ActivePrefix = getCookie(this.CookiePrefix + 'active_prefix');
this.PreviousPrefix = this.ActivePrefix;
$ViewMenus = new Array('c');
}
Catalog.prototype.Init = function () {
var $prefix = this.queryTabRegistry('prefix', this.ActivePrefix, 'prefix');
if ($prefix !== this.ActivePrefix && this.TabRegistry.length > this.TabShift) {
// ActivePrefix not set or has non-existing prefix value
this.ActivePrefix = this.TabRegistry[this.TabShift]['prefix'];
}
this.SetAlternativeTabs();
this.AfterInit();
}
Catalog.prototype.AfterInit = function () {
this.go_to_cat();
}
Catalog.prototype.SetAlternativeTabs = function () {
// set alternative grids between all items (catalog is set when tab is loaded via AJAX first time)
var $i = this.TabShift;
while ($i < this.TabRegistry.length) {
// run through all prefixes
var $j = this.TabShift;
while ($j < this.TabRegistry.length) {
if (this.TabRegistry[$i]['prefix'] == this.TabRegistry[$j]['prefix']) {
$j++;
continue;
}
// and set alternative to all other prefixes
$GridManager.AddAlternativeGrid(this.TabRegistry[$i]['prefix'], this.TabRegistry[$j]['prefix']);
$j++;
}
$i++;
}
}
Catalog.prototype.submit_kernel_form = function($tab_id) {
var $prefix = 'dummy';
var $result_div = '';
if (isset($tab_id)) {
// responce result + progress are required
$prefix = this.queryTabRegistry('tab_id', $tab_id, 'prefix');
$result_div = $tab_id + '_div';
}
var $kf = document.getElementById($form_name);
Request.params = Request.serializeForm($kf);
Request.method = $kf.method.toUpperCase();
this.BusyRequest[$prefix] = false;
Request.makeRequest($kf.action, this.BusyRequest[$prefix], $result_div, this.successCallback, this.errorCallback, $result_div, this);
$form_name = 'kernel_form'; // restore back to main form with current category id of catalog
};
Catalog.prototype.successCallback = function($request, $params, $object) {
var $text = $request.responseText;
var $match_redirect = new RegExp('^#redirect#(.*)').exec($text);
if ($match_redirect != null) {
// redirect to external template requested
window.location.href = $match_redirect[1];
return false;
}
$params = $params.split(',');
var $js_end = $text.indexOf($object.Separator);
if ($js_end != -1) {
// allow to detect if output is permitted by ajax request parameters
var $request_visible = '$request_visible = ' + ($params[0].length ? 'true' : 'false') + "\n";
if ($params[0].length) {
document.getElementById($params[0]).innerHTML = $text.substring($js_end + $object.Separator.length);
eval($request_visible + $text.substring(0, $js_end));
}
else {
// eval JS only & set mark that js should not use HTML as usual in grids
eval($request_visible + $text.substring(0, $js_end));
}
}
else if ($params[0].length) {
document.getElementById($params[0]).innerHTML = $text;
}
if (typeof($object.OnResponceMethod) == 'function') {
$object.OnResponceMethod($object);
$object.OnResponceMethod = null;
}
if (typeof($Debugger) != 'undefined') {
$Debugger.Clear();
}
}
+Catalog.prototype.trim = function ($string) {
+ return $string.replace(/\s*((\S+\s*)*)/, "$1").replace(/((\s*\S+)*)\s*/, "$1");
+}
+
Catalog.prototype.errorCallback = function($request, $params, $object) {
// $Debugger.ShowProps($request, 'req');
alert('AJAX Error; class: Catalog; ' + Request.getErrorHtml($request));
}
Catalog.prototype.submit_event = function($prefix_special, $event, $t, $OnResponceMethod) {
if (typeof($OnResponceMethod) == 'function') {
this.OnResponceMethod = $OnResponceMethod;
}
var $prev_template = get_hidden_field('t');
if (!isset($prefix_special)) $prefix_special = this.getCurrentPrefix();
var $tab_id = this.queryTabRegistry('prefix', $prefix_special, 'tab_id');
$form_name = $tab_id + '_form'; // set firstly, because set_hidden_field uses it
if (isset($event)) set_hidden_field('events[' + $prefix_special + ']', $event);
if (isset($t)) set_hidden_field('t', $t);
this.submit_kernel_form($tab_id);
set_hidden_field('t', $prev_template);
}
Catalog.prototype.go_to_cat = function($cat_id) {
if (!isset($cat_id)) {
// gets current category
$cat_id = get_hidden_field('m_cat_id');
}
else {
// sets new category to kernel_form in case if item tab
// loads faster and will check if it's category is same
// as parent category of categories list
if (get_hidden_field('m_cat_id') == $cat_id) {
// it's the same category, then don't reload category list
return ;
}
set_hidden_field('m_cat_id', $cat_id);
}
this.resetTabs(false);
// query sub categories of $cat_id
var $url = this.URLMask.replace('#TEMPLATE_NAME#', 'in-portal/xml/categories_list').replace('#CATEGORY_ID#', $cat_id);
var $prefix = this.TabRegistry[0]['prefix'];
var $tab_id = this.TabRegistry[0]['tab_id'];
this.BusyRequest[$prefix] = false;
Request.makeRequest($url, this.BusyRequest[$prefix], $tab_id + '_div', this.successCallback, this.errorCallback, $tab_id + '_div', this);
this.switchTab(); // refresh current item tab
}
// set all item tabs counters to "?" before quering catagories
Catalog.prototype.resetTabs = function($reset_content) {
var $i = this.TabShift;
while ($i < this.TabRegistry.length) {
this.setItemCount(this.TabRegistry[$i]['prefix'], '?');
$i++;
}
if ($reset_content) {
// set category for all tabs to -1 (forces reload next time)
$i = this.TabShift;
while ($i < this.TabRegistry.length) {
document.getElementById(this.TabRegistry[$i]['tab_id'] + '_div').setAttribute('category_id', -1);
$i++;
}
}
}
Catalog.prototype.switchTab = function($prefix, $force) {
if (this.queryTabRegistry('prefix', this.ActivePrefix, 'prefix') != this.ActivePrefix) {
// active prefix is not registred -> cookie left, but not modules installed/enabled at the moment
return false;
}
if (!isset($prefix)) $prefix = this.ActivePrefix;
if (this.BusyRequest[$prefix]) {
alert('prefix: ['+$prefix+']; request busy: ['+this.BusyRequest[$prefix]+']');
}
if (this.ActivePrefix != $prefix) {
// hide source tab
this.PreviousPrefix = this.ActivePrefix;
document.getElementById(this.PreviousPrefix + '_tab').className = 'catalog-tab-unselected';
document.getElementById(this.queryTabRegistry('prefix', this.PreviousPrefix, 'tab_id') + '_div').style.display = 'none';
this.HideDependentButtons(this.PreviousPrefix);
}
// show destination tab
this.ActivePrefix = $prefix;
document.getElementById(this.ActivePrefix + '_tab').className = 'catalog-tab-selected';
var $div_id = this.queryTabRegistry('prefix', this.ActivePrefix, 'tab_id') + '_div'; // destination tab
document.getElementById($div_id).style.display = 'block';
this.ShowDependentButtons(this.ActivePrefix);
this.setViewMenu(this.ActivePrefix);
setCookie(this.CookiePrefix + 'active_prefix', this.ActivePrefix);
this.refreshTab($prefix, $div_id, $force);
}
Catalog.prototype.refreshTab = function($prefix, $div_id, $force) {
var $cat_id = get_hidden_field('m_cat_id');
var $tab_cat_id = document.getElementById($div_id).getAttribute('category_id');
if ($cat_id != $tab_cat_id || $force) {
// query tab content only in case if not queried or category don't match
var $url = this.URLMask.replace('#TEMPLATE_NAME#', this.queryTabRegistry('prefix', $prefix, 'module_path') + '/catalog_tab');
$url = $url.replace('#CATEGORY_ID#', $cat_id);
$url = $url.replace('#PREFIX#', $prefix);
this.BusyRequest[$prefix] = false;
Request.makeRequest($url, this.BusyRequest[$prefix], $div_id, this.successCallback, this.errorCallback, $div_id, this);
}
/*else {
alert('refresh disabled = {tab: '+this.ActivePrefix+'; cat_id: '+$cat_id+'; form_name: '+$form_name+'}');
}*/
}
// adds information about tab to tab_registry
Catalog.prototype.registerTab = function($tab_id) {
var $tab = document.getElementById($tab_id + '_div');
var $index = this.TabRegistry.length;
this.TabRegistry[$index] = new Array();
this.TabRegistry[$index]['tab_id'] = $tab_id;
this.TabRegistry[$index]['prefix'] = $tab.getAttribute('prefix');
if ($tab_id == 'categories') {
this.TabRegistry[$index]['module_path'] = 'in-portal/';
}
else {
this.TabRegistry[$index]['module_path'] = $tab.getAttribute('edit_template').substring(0, $tab.getAttribute('edit_template').indexOf('/'));
}
this.TabRegistry[$index]['view_template'] = $tab.getAttribute('view_template');
this.TabRegistry[$index]['edit_template'] = $tab.getAttribute('edit_template');
this.TabRegistry[$index]['dep_buttons'] = $tab.getAttribute('dep_buttons').length > 0 ? $tab.getAttribute('dep_buttons').split(',') : new Array();
this.TabRegistry[$index]['index'] = $index;
}
// allows to get any information about tab
Catalog.prototype.queryTabRegistry = function($search_key, $search_value, $return_key) {
var $i = 0;
// alert('looking in '+$search_key+' for '+$search_value+' will return '+$return_key)
while ($i < this.TabRegistry.length) {
if (this.TabRegistry[$i][$search_key] == $search_value) {
// alert('got '+this.TabRegistry[$i][$return_key])
return this.TabRegistry[$i][$return_key];
break;
}
$i++;
}
return false;
}
Catalog.prototype.ShowDependentButtons = function($prefix) {
/*var $tab_id = this.queryTabRegistry('prefix', $prefix, 'tab_id')
if (!document.getElementById($tab_id + '_form')) {
// tab form not found => no permission to view -> no permission to do any actions
alert('no form: ['+$tab_id + '_form'+']');
return ;
}
else {
alert('has form: ['+$tab_id + '_form'+']');
}*/
var $dep_buttons = this.queryTabRegistry('prefix', $prefix, 'dep_buttons');
var $i = 0;
while ($i < $dep_buttons.length) {
a_toolbar.ShowButton($dep_buttons[$i]);
$i++;
}
}
Catalog.prototype.HideDependentButtons = function($prefix) {
var $dep_buttons = this.queryTabRegistry('prefix', $prefix, 'dep_buttons');
var $i = 0;
while ($i < $dep_buttons.length) {
a_toolbar.HideButton($dep_buttons[$i]);
$i++;
}
}
Catalog.prototype.setItemCount = function($prefix, $count) {
setInnerHTML($prefix + '_item_count', $count);
}
Catalog.prototype.setCurrentCategory = function($prefix, $category_id) {
var $tab_id = this.queryTabRegistry('prefix', $prefix, 'tab_id');
// alert('setting current category for prefix: ['+$prefix+']; tab_id ['+$tab_id+'] = ['+$category_id+']');
document.getElementById($tab_id + '_div').setAttribute('category_id', $category_id);
}
Catalog.prototype.getCurrentPrefix = function() {
if (isset(Grids[this.ActivePrefix]) && (Grids[this.ActivePrefix].SelectedCount > 0)) {
// item tab grid exists and some items are selected
return this.ActivePrefix;
}
else {
// return prefix of first registred tab -> categories
return this.TabRegistry[0]['prefix'];
}
}
Catalog.prototype.setViewMenu = function($item_prefix) {
if (this.TabShift == 1) {
$ViewMenus = isset($item_prefix) ? new Array('c', $item_prefix) : new Array('c');
}
else {
$ViewMenus = isset($item_prefix) ? new Array($item_prefix) : new Array();
}
}
Catalog.prototype.reflectPasteButton = function($status) {
a_toolbar.SetEnabled('paste', $status);
a_toolbar.SetEnabled('clear_clipboard', $status);
}
\ No newline at end of file
Property changes on: trunk/core/admin_templates/js/catalog.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.31
\ No newline at end of property
+1.32
\ No newline at end of property
Index: trunk/core/install/upgrades.sql
===================================================================
--- trunk/core/install/upgrades.sql (revision 8103)
+++ trunk/core/install/upgrades.sql (revision 8104)
@@ -1,88 +1,75 @@
# ===== v 4.0.1 =====
ALTER TABLE EmailLog ADD EventParams TEXT NOT NULL;
INSERT INTO ConfigurationAdmin VALUES ('MailFunctionHeaderSeparator', 'la_Text_smtp_server', 'la_config_MailFunctionHeaderSeparator', 'radio', NULL, '1=la_Linux,2=la_Windows', 30.08, 0, 0);
INSERT INTO ConfigurationValues VALUES (0, 'MailFunctionHeaderSeparator', 1, 'In-Portal', 'in-portal:configure_general');
ALTER TABLE PersistantSessionData DROP PRIMARY KEY ;
ALTER TABLE PersistantSessionData ADD INDEX ( `PortalUserId` ) ;
# ===== v 4.0.2 =====
ALTER TABLE EmailMessage ADD ReplacementTags TEXT AFTER Template;
ALTER TABLE Phrase
CHANGE Translation Translation TEXT NOT NULL,
CHANGE Module Module VARCHAR(30) NOT NULL DEFAULT 'In-Portal';
-
ALTER TABLE Category
CHANGE Description Description TEXT,
CHANGE l1_Description l1_Description TEXT,
CHANGE l2_Description l2_Description TEXT,
CHANGE l3_Description l3_Description TEXT,
CHANGE l4_Description l4_Description TEXT,
CHANGE l5_Description l5_Description TEXT,
CHANGE CachedNavbar CachedNavbar text,
CHANGE l1_CachedNavbar l1_CachedNavbar text,
CHANGE l2_CachedNavbar l2_CachedNavbar text,
CHANGE l3_CachedNavbar l3_CachedNavbar text,
CHANGE l4_CachedNavbar l4_CachedNavbar text,
CHANGE l5_CachedNavbar l5_CachedNavbar text,
CHANGE ParentPath ParentPath TEXT NULL DEFAULT NULL,
CHANGE NamedParentPath NamedParentPath TEXT NULL DEFAULT NULL;
-
ALTER TABLE ConfigurationAdmin CHANGE ValueList ValueList TEXT;
-
ALTER TABLE EmailQueue
CHANGE `Subject` `Subject` TEXT,
CHANGE toaddr toaddr TEXT,
CHANGE fromaddr fromaddr TEXT;
-
ALTER TABLE Category DROP Pop;
-
ALTER TABLE PortalUser
CHANGE CreatedOn CreatedOn INT DEFAULT NULL,
CHANGE dob dob INT(11) NULL DEFAULT NULL,
CHANGE PassResetTime PassResetTime INT(11) UNSIGNED NULL DEFAULT NULL,
CHANGE PwRequestTime PwRequestTime INT(11) UNSIGNED NULL DEFAULT NULL,
CHANGE `Password` `Password` VARCHAR(255) NULL DEFAULT 'd41d8cd98f00b204e9800998ecf8427e';
-
ALTER TABLE Modules
CHANGE BuildDate BuildDate INT UNSIGNED NULL DEFAULT NULL,
CHANGE Version Version VARCHAR(10) NOT NULL DEFAULT '0.0.0',
CHANGE `Var` `Var` VARCHAR(100) NOT NULL DEFAULT '';
-
ALTER TABLE Language
CHANGE Enabled Enabled INT(11) NOT NULL DEFAULT '1',
CHANGE InputDateFormat InputDateFormat VARCHAR(50) NOT NULL DEFAULT 'm/d/Y',
CHANGE InputTimeFormat InputTimeFormat VARCHAR(50) NOT NULL DEFAULT 'g:i:s A',
CHANGE DecimalPoint DecimalPoint VARCHAR(10) NOT NULL DEFAULT '',
CHANGE ThousandSep ThousandSep VARCHAR(10) NOT NULL DEFAULT '';
-
ALTER TABLE Events CHANGE FromUserId FromUserId INT(11) NOT NULL DEFAULT '-1';
-
ALTER TABLE StdDestinations CHANGE DestAbbr2 DestAbbr2 CHAR(2) NULL DEFAULT NULL;
-
ALTER TABLE PermCache DROP DACL;
-
ALTER TABLE PortalGroup CHANGE CreatedOn CreatedOn INT UNSIGNED NULL DEFAULT NULL;
-
ALTER TABLE UserSession
CHANGE SessionKey SessionKey INT UNSIGNED NULL DEFAULT NULL ,
CHANGE CurrentTempKey CurrentTempKey INT UNSIGNED NULL DEFAULT NULL ,
CHANGE PrevTempKey PrevTempKey INT UNSIGNED NULL DEFAULT NULL ,
CHANGE LastAccessed LastAccessed INT UNSIGNED NOT NULL DEFAULT '0',
CHANGE PortalUserId PortalUserId INT(11) NOT NULL DEFAULT '-2',
CHANGE Language Language INT(11) NOT NULL DEFAULT '1',
CHANGE Theme Theme INT(11) NOT NULL DEFAULT '1';
-
CREATE TABLE Counters (
CounterId int(10) unsigned NOT NULL auto_increment,
Name varchar(100) NOT NULL default '',
CountQuery text,
CountValue text,
LastCounted int(10) unsigned default NULL,
LifeTime int(10) unsigned NOT NULL default '3600',
IsClone tinyint(3) unsigned NOT NULL default '0',
TablesAffected text,
PRIMARY KEY (CounterId),
UNIQUE KEY Name (Name)
-);
+);
\ No newline at end of file
Property changes on: trunk/core/install/upgrades.sql
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.10
\ No newline at end of property
+1.11
\ No newline at end of property

Event Timeline